Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈智峰
jinfa-admin
Commits
37945cb4
Commit
37945cb4
authored
Jan 19, 2022
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-system
into v2
parents
5de203ea
f0c5751a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
29 deletions
+58
-29
config.ts
config/config.ts
+1
-1
env.js
env.js
+1
-1
index.tsx
...ng/marketingActivitiesManagement/activePage/add/index.tsx
+26
-7
index.tsx
...esManagement/activePage/components/ActivityItem/index.tsx
+1
-1
useGetSameKeys.tsx
...ement/activePage/fixtures/common/hooks/useGetSameKeys.tsx
+0
-1
useSaveData.ts
...anagement/activePage/fixtures/common/hooks/useSaveData.ts
+1
-1
editPanelForm.tsx
...ctivePage/fixtures/components/EditPanel/editPanelForm.tsx
+5
-5
index.tsx
...age/fixtures/components/EditPanelFormily/Coupon/index.tsx
+8
-1
index.tsx
...ent/activePage/fixtures/components/WebEditPanel/index.tsx
+15
-11
No files found.
config/config.ts
View file @
37945cb4
...
...
@@ -36,7 +36,7 @@ export default defineConfig({
'process.env.SOCKET_URL'
:
process
.
env
.
SOCKET_URL
},
esbuild
:
{},
//
mfsu: {},
mfsu
:
{},
locale
:
{
antd
:
true
,
// 默认情况下,当前语言环境的识别按照:localStorage 中 umi_locale 值 > 浏览器检测 > default 设置的默认语言 > 中文
...
...
env.js
View file @
37945cb4
...
...
@@ -103,7 +103,7 @@ module.exports = {
ssh
:
JSON
.
stringify
({
user
:
"root"
,
// Password optional, prompted if none given
password
:
"
12345
6"
,
password
:
"
SsyLingxi@test66
6"
,
host
:
"10.0.0.17"
,
port
:
22
,
localRoot
:
path
.
resolve
(
'./dist/'
),
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/add/index.tsx
View file @
37945cb4
...
...
@@ -8,14 +8,15 @@ import { history , useLocation, Link } from 'umi';
import
{
BgColorsOutlined
,
CheckCircleOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
FormEffectHooks
,
createFormActions
,
FormPath
}
from
'@formily/antd'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
moment
from
'moment'
;
import
moment
,
{
Moment
}
from
'moment'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
GlobalConfig
}
from
'@/global/config'
;
import
schema
from
'./schema'
;
import
styles
from
'./index.less'
;
import
FormilyTemplateDrawer
from
'../components/TemplateDrawer/formilyTemplateDrawer'
;
import
{
getTemplateWebActivityPageGet
,
postTemplateWebActivityPageAdd
,
postTemplateWebActivityPageUpdate
}
from
'@/services/TemplateV2Api'
;
import
{
getTemplateWebActivityPageGet
,
GetTemplateWebActivityPageGetResponse
,
postTemplateWebActivityPageAdd
,
postTemplateWebActivityPageUpdate
}
from
'@/services/TemplateV2Api'
;
import
{
postManageWebShopWebAll
}
from
'@/services/ManageV2Api'
;
import
{
WEB
}
from
'@/constants/const/environment'
;
const
actions
=
createFormActions
();
...
...
@@ -41,13 +42,29 @@ type SubmitType = {
}
}
type
ValueDataType
=
Omit
<
GetTemplateWebActivityPageGetResponse
,
'startTime'
|
'endTime'
|
'templateId'
|
'templateName'
|
'templatePicUrl'
>
&
{
template
:
{
templateId
:
number
,
templateName
:
string
,
templatePicUrl
:
string
,
}
startTime
:
Moment
,
endTime
:
Moment
}
const
WEB_FIXTURE_LINK
=
"/marketingManage/marketing/activitiesManagement/webFixtures"
const
APP_FIXTURE_LINK
=
"/marketingManage/marketing/activitiesManagement/fixtures"
const
Add
=
()
=>
{
const
{
id
,
}
=
usePageStatus
();
const
{
pathname
}
=
useLocation
();
const
isEdit
=
useMemo
(()
=>
id
!==
''
&&
pathname
.
includes
(
"edit"
),
[
id
]);
const
isView
=
useMemo
(()
=>
id
!==
''
&&
pathname
.
includes
(
"view"
),
[
id
]);
const
[
initialValue
,
setInitialValue
]
=
useState
<
any
>
(
null
);
const
[
initialValue
,
setInitialValue
]
=
useState
<
ValueDataType
|
null
>
(
null
);
const
fixtureLink
=
initialValue
?.
environment
===
WEB
?
WEB_FIXTURE_LINK
:
APP_FIXTURE_LINK
;
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
onSubmit
=
async
(
values
:
SubmitType
)
=>
{
...
...
@@ -84,7 +101,8 @@ const Add = () => {
okText
:
'立即装修'
,
cancelText
:
'稍后'
,
onOk
:
()
=>
{
history
.
push
(
`/marketingManage/marketing/activitiesManagement/fixtures?id=
${
data
}
`
);
const
jumpLink
=
values
.
environment
===
WEB
?
WEB_FIXTURE_LINK
:
APP_FIXTURE_LINK
;
history
.
push
(
`
${
jumpLink
}
?id=
${
data
}
`
);
},
onCancel
:
()
=>
{
history
.
goBack
();
...
...
@@ -111,7 +129,7 @@ const Add = () => {
templateName
,
templatePicUrl
,
},
startTime
:
moment
(
startTime
),
startTime
:
moment
(
startTime
)
,
endTime
:
moment
(
endTime
),
});
actions
.
setFieldState
(
'*(environment,template,shopId)'
,
state
=>
{
...
...
@@ -131,7 +149,7 @@ const Add = () => {
FormPath
.
setIn
(
state
,
'props.x-component-props'
,
{
environment
:
initialValue
.
environment
});
});
async
function
setMall
()
{
const
data
=
await
fetchMallData
({
environment
:
initialValue
.
environment
.
toString
(),
siteId
:
GlobalConfig
.
global
.
siteInfo
.
id
}
as
any
);
const
data
=
await
fetchMallData
({
environment
:
initialValue
?
.
environment
.
toString
(),
siteId
:
GlobalConfig
.
global
.
siteInfo
.
id
}
as
any
);
actions
.
setFieldState
(
"shopId"
,
state
=>
{
state
.
props
.
enum
=
data
;
});
...
...
@@ -162,6 +180,7 @@ const Add = () => {
return
"新增活动页"
;
};
return
(
<
PageHeaderWrapper
title=
{
renderTitle
()
}
...
...
@@ -172,7 +191,7 @@ const Add = () => {
<
Space
>
{
isEdit
&&
(
<
Link
to=
{
`
/marketingManage/marketing/activitiesManagement/fixtures
?id=${id}`
}
>
<
Link
to=
{
`
${fixtureLink}
?id=${id}`
}
>
<
Button
icon=
{
<
BgColorsOutlined
/>
}
>
活动页装修
</
Button
>
</
Link
>
)
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/components/ActivityItem/index.tsx
View file @
37945cb4
...
...
@@ -76,7 +76,7 @@ const ActiveItem: React.FC<Iprops> = (props: Iprops) => {
<
img
className=
{
styles
.
image
}
src=
{
templatePicUrl
}
/>
<
div
className=
{
styles
.
infoContainer
}
>
<
div
className=
{
styles
.
header
}
>
<
Link
to=
{
`/marketingManage/marketing/activitiesManagement/
view
?id=${id}`
}
>
{
title
}
</
Link
>
<
Link
to=
{
`/marketingManage/marketing/activitiesManagement/
edit
?id=${id}`
}
>
{
title
}
</
Link
>
<
div
className=
{
styles
.
status
}
>
<
StatusTag
type=
"success"
title=
{
statusName
}
/>
</
div
>
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/common/hooks/useGetSameKeys.tsx
View file @
37945cb4
...
...
@@ -54,7 +54,6 @@ const formatProps = {
const
useGetSameKeys
=
()
=>
{
const
{
pageConfig
}
=
useSelector
<
any
,
any
>
([
'pageConfig'
]);
console
.
log
(
"pageConfig"
,
pageConfig
);
const
sameKeys
=
useMemo
(()
=>
{
if
(
pageConfig
===
null
||
Object
.
keys
(
pageConfig
).
length
===
0
)
{
return
{};
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/common/hooks/useSaveData.ts
View file @
37945cb4
...
...
@@ -156,7 +156,7 @@ function useSaveData(options: Options) {
const
{
data
,
code
,
...
rest
}
=
await
postTemplateWebActivityPageAdorn
({
id
:
id
,
adornContent
:
result
adornContent
:
withThemeStyle
}
as
any
,
{
ctlType
:
'none'
});
setSaving
(
false
);
if
(
code
===
1000
)
{
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/EditPanel/editPanelForm.tsx
View file @
37945cb4
...
...
@@ -21,7 +21,7 @@ type SettingPanelType = {
}
const
formActions
=
createFormActions
();
/** 请求
借
口type, 请求列表接口需要带上type */
/** 请求
接
口type, 请求列表接口需要带上type */
const
ACTIVITY_MAP
=
{
"specialOfferItem"
:
1
,
/** 直降促销 */
...
...
@@ -98,9 +98,7 @@ const EditPanelForm = () => {
imageUrl
:
[{
name
:
'广告图'
,
url
:
selectedInfo
?.
props
?.
imageUrl
}]
},
couponItem
:
{
coupon
:
{
...
selectedInfo
.
props
}
coupon
:
selectedInfo
.
props
},
hotItem
:
{
product
:
{
...
...
@@ -111,6 +109,7 @@ const EditPanelForm = () => {
title
:
selectedInfo
.
props
?.
title
,
},
};
console
.
log
(
"================================"
,
selectedInfo
.
props
)
/** 如果是活动子集, 那么现实选择活动商品 */
if
(
activityListItem
.
includes
(
componentType
)
||
componentType
===
'hotItem'
||
componentType
===
'suggestProductItem'
)
{
setFormValue
({
...
...
@@ -120,6 +119,7 @@ const EditPanelForm = () => {
});
setSchema
(
activityProducts
);
}
else
{
// 如果是 top 或者是 活动容器,那么需要修改他的容器卡片名称
const
schemaMap
=
{
top
:
activityImageSchema
,
couponItem
:
couponSchema
,
...
...
@@ -133,7 +133,7 @@ const EditPanelForm = () => {
:
propsMapToValue
?.[
componentType
];
setSchema
(
tempSchema
);
setFormValue
(
tempFormValue
);
setFormValue
(
{
...
tempFormValue
}
);
}
/** 16 种活动,请求是需要带上活动类型 */
const
activityType
=
ACTIVITY_MAP
[
componentType
]
?
{
activityType
:
ACTIVITY_MAP
[
componentType
]
}
:
{};
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/EditPanelFormily/Coupon/index.tsx
View file @
37945cb4
...
...
@@ -92,6 +92,11 @@ const FormilyCoupon: React.FC<Iprops> & { isFieldComponent: boolean } = (props:
// setInnerValue(value);
// }, [value]);
const
handleClose
=
()
=>
{
setRadioValue
(
PLATFORM
);
setDrawerVisible
(
false
)
}
const
onChange
=
(
e
)
=>
{
setRadioValue
(
e
.
target
.
value
);
const
pageInfo
=
(
ref
?.
current
as
any
)?.
getPaginationInfo
();
...
...
@@ -115,6 +120,7 @@ const FormilyCoupon: React.FC<Iprops> & { isFieldComponent: boolean } = (props:
// setInnerValue(selectedRow[0]);
props
.
mutators
.
change
(
selectedRow
[
0
]);
setDrawerVisible
(
false
);
setRadioValue
(
PLATFORM
)
});
};
...
...
@@ -166,7 +172,8 @@ const FormilyCoupon: React.FC<Iprops> & { isFieldComponent: boolean } = (props:
</
div
>
<
CouponSelect
visible=
{
drawerVisible
}
onCancel=
{
()
=>
setDrawerVisible
(
false
)
}
// onCancel={() => setDrawerVisible(false)}
onCancel=
{
handleClose
}
mode=
"radio"
formExtra=
{
formExtra
}
ref=
{
ref
as
any
}
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/WebEditPanel/index.tsx
View file @
37945cb4
...
...
@@ -101,6 +101,11 @@ const minTypeToTwo = ["fullQuantityDiscountItem", "fullMoneyDiscountItem", "give
const
activityListItem
=
Object
.
keys
(
ACTIVITY_MAP
);
const
activityList
=
activityListItem
.
map
((
_item
)
=>
_item
.
substring
(
0
,
_item
.
length
-
4
));
/**
* TODO 有时间将EditPanel 合并
*/
const
EditPanelForm
=
()
=>
{
const
{
selectedInfo
,
pageConfig
}
=
useSelector
<
SettingPanelType
,
STATE_PROPS
>
([
'selectedInfo'
,
'pageConfig'
]);
const
{
state
:
visible
,
toggle
:
setVisible
}
=
useToggle
(
false
);
...
...
@@ -132,9 +137,7 @@ const EditPanelForm = () => {
imageUrl
:
[{
name
:
'广告图'
,
url
:
selectedInfo
?.
props
?.
imageUrl
}]
},
couponItem
:
{
coupon
:
{
...
selectedInfo
.
props
}
coupon
:
{...
selectedInfo
.
props
}
},
hotItem
:
{
product
:
{
...
...
@@ -150,7 +153,8 @@ const EditPanelForm = () => {
setFormValue
({
product
:
{
...
selectedInfo
.
props
,
}
},
uuid
:
Math
.
random
()
});
setSchema
(
activityProducts
);
}
else
{
...
...
@@ -158,16 +162,16 @@ const EditPanelForm = () => {
top
:
activityImageSchema
,
couponItem
:
couponSchema
,
};
const
isContainer
=
activityList
.
includes
(
componentType
)
||
componentType
===
'hot'
||
componentType
===
'suggestProduct'
||
componentType
===
'coupon'
;
/** 如果是 suggestProduct, 或者是hot 或者是活动父级,那么直接设置他的卡片名称 */
const
tempSchema
=
activityList
.
includes
(
componentType
)
||
componentType
===
'hot'
||
componentType
===
'suggestProduct'
||
componentType
===
'coupon'
?
cardSchema
:
schemaMap
?.[
componentType
];
const
tempFormValue
=
activityList
.
includes
(
componentType
)
||
componentType
===
'hot'
||
componentType
===
'suggestProduct'
||
componentType
===
'coupon'
?
{
title
:
selectedInfo
.
props
.
title
}
const
tempSchema
=
isContainer
?
cardSchema
:
schemaMap
?.[
componentType
];
const
tempFormValue
=
isContainer
?
{
title
:
selectedInfo
.
props
.
title
}
:
propsMapToValue
?.[
componentType
];
setSchema
(
tempSchema
);
setFormValue
(
tempFormValue
);
// 这里加uuid 是为了解决这个bug http://chandao.shushangyun.com/index.php?m=bug&f=view&bugID=19739,formily value 改变不触发更新,
setFormValue
({...
tempFormValue
,
uuid
:
Math
.
random
()});
}
/** 16 种活动,请求是需要带上活动类型 */
const
activityType
=
ACTIVITY_MAP
[
componentType
]
?
{
activityType
:
ACTIVITY_MAP
[
componentType
]
}
:
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment