Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
linweijiong
jinfa-platform
Commits
7f7cc051
Commit
7f7cc051
authored
Dec 24, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
662452e7
d214d2fa
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
871 additions
and
793 deletions
+871
-793
BasicLayout.tsx
src/layouts/BasicLayout.tsx
+1
-0
AvatarDropdown.tsx
src/layouts/components/AvatarDropdown.tsx
+5
-3
RightContent.tsx
src/layouts/components/RightContent.tsx
+2
-2
index.tsx
src/pages/balance/accountsPayable/settlementList/index.tsx
+1
-1
productNoticeSettlementDetail.tsx
...sPayable/settlementList/productNoticeSettlementDetail.tsx
+12
-13
index.tsx
src/pages/balance/accountsReceivable/invoice/index.tsx
+17
-4
index.tsx
...pages/balance/accountsReceivable/invoice/schema/index.tsx
+13
-14
index.tsx
...es/balance/platformSettlement/accountReceivable/index.tsx
+1
-1
index.tsx
...nce/platformSettlement/accountReceivable/schema/index.tsx
+1
-1
index.tsx
src/pages/balance/platformSettlement/integral/index.tsx
+2
-2
info.tsx
src/pages/balance/platformSettlement/integral/info.tsx
+11
-13
index.tsx
...ages/balance/platformSettlement/integral/schema/index.tsx
+2
-2
index.tsx
src/pages/balance/settleRules/memberSettle/schema/index.tsx
+1
-1
index.tsx
src/pages/balance/settleRules/receipt/index.tsx
+2
-3
info.tsx
src/pages/balance/settleRules/receipt/info.tsx
+9
-7
index.less
src/pages/channel/channelInfo/index.less
+2
-3
index.tsx
src/pages/channel/channelInfo/index.tsx
+17
-17
index.tsx
src/pages/handling/assign/add/index.tsx
+3
-3
index.tsx
src/pages/handling/assign/detail/index.tsx
+1
-1
index.tsx
src/pages/handling/common/index.tsx
+3
-1
content.tsx
src/pages/handling/components/ProcessDetail/content.tsx
+4
-4
index.tsx
src/pages/handling/components/ProcessProducts/index.tsx
+48
-18
schema.tsx
src/pages/handling/components/ProcessProducts/schema.tsx
+15
-5
index.less
src/pages/home/components/UserCenter/index.less
+7
-0
index.tsx
src/pages/home/components/UserCenter/index.tsx
+9
-11
index.less
src/pages/home/index.less
+5
-1
index.tsx
src/pages/home/index.tsx
+46
-51
index.tsx
src/pages/lxMall/components/ShopHeader/index.tsx
+6
-7
index.tsx
src/pages/lxMall/components/TopBar/index.tsx
+2
-3
LXChannelLayout.tsx
src/pages/lxMall/layouts/LXChannelLayout.tsx
+2
-2
LXIChannelLayout.tsx
src/pages/lxMall/layouts/LXIChannelLayout.tsx
+2
-2
LXShopLayout.tsx
src/pages/lxMall/layouts/LXShopLayout.tsx
+12
-5
index.less
src/pages/shop/shopInfo/index.less
+123
-124
index.tsx
src/pages/shop/shopInfo/index.tsx
+418
-420
index.less
src/pages/systemSetting/message/index.less
+32
-21
index.tsx
src/pages/systemSetting/message/index.tsx
+34
-27
No files found.
src/layouts/BasicLayout.tsx
View file @
7f7cc051
...
...
@@ -153,6 +153,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
return
(
<
ProLayout
pageTitleRender=
{
()
=>
currentRouter
?
currentRouter
.
name
:
window
.
location
.
href
}
// contentStyle={{minWidth: '1280px'}}
style=
{
prolayoutStyle
}
logo=
{
logo
}
formatMessage=
{
formatMessage
}
...
...
src/layouts/components/AvatarDropdown.tsx
View file @
7f7cc051
...
...
@@ -5,8 +5,9 @@ import { history, Link } from 'umi';
import
PersonDropdown
from
'./PersonDropdown'
import
styles
from
'../styles/RightContent.less'
;
import
{
removeAuth
,
removeRouters
,
getAuth
}
from
'@/utils/auth'
;
import
{
inject
,
observer
}
from
'mobx-react'
const
AvatarDropdown
=
()
=>
{
const
AvatarDropdown
=
(
props
)
=>
{
const
logout
=
()
=>
{
removeAuth
()
...
...
@@ -16,7 +17,7 @@ const AvatarDropdown = () => {
const
currentUser
=
{
name
:
getAuth
()?.
name
||
'未知用户'
,
avatar
:
'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png
'
,
avatar
:
props
.
UserStore
.
avatar
||
'
'
,
}
const
menuHeaderDropdown
=
(
...
...
@@ -50,4 +51,5 @@ const AvatarDropdown = () => {
)
}
export
default
AvatarDropdown
export
default
inject
(
'UserStore'
)(
observer
(
AvatarDropdown
))
src/layouts/components/RightContent.tsx
View file @
7f7cc051
...
...
@@ -72,7 +72,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
</
Badge
>
</
a
>
</
Tooltip
>
<
Tooltip
title=
"服务"
>
{
/*
<Tooltip title="服务">
<a
target="_blank"
href=""
...
...
@@ -81,7 +81,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
>
<CustomerServiceOutlined />
</a>
</
Tooltip
>
</Tooltip>
*/
}
<
Avatar
/>
</
div
>
);
...
...
src/pages/balance/accountsPayable/settlementList/index.tsx
View file @
7f7cc051
...
...
@@ -72,7 +72,7 @@ const SettlementList = () => {
{
title
:
'结算日期'
,
dataIndex
:
'settlementDate'
},
{
title
:
'结算方式'
,
dataIndex
:
'settlementWayName'
},
{
title
:
'结算方'
,
dataIndex
:
'settlementName'
},
{
title
:
'结算单据'
,
dataIndex
:
'orderTypeName'
},
{
title
:
'结算单据
类型
'
,
dataIndex
:
'orderTypeName'
},
{
title
:
'总单数'
,
dataIndex
:
'totalCount'
},
{
title
:
'结算金额'
,
dataIndex
:
'amount'
},
{
title
:
'结算时间'
,
dataIndex
:
'settlementTime'
},
...
...
src/pages/balance/accountsPayable/settlementList/productNoticeSettlementDetail.tsx
View file @
7f7cc051
...
...
@@ -31,7 +31,7 @@ const columns = [
{
title
:
'单据总额'
,
dataIndex
:
'orderAmount'
},
{
title
:
'收货批次'
,
dataIndex
:
'batch'
},
{
title
:
'收货时间'
,
dataIndex
:
'receiveTime'
},
{
title
:
'收货数量'
,
dataIndex
:
'receive
Time
'
},
{
title
:
'收货数量'
,
dataIndex
:
'receive
Count
'
},
// {title: '加工单价', dataIndex: 'processPrice'},
{
title
:
'结算金额'
,
dataIndex
:
'settlementAmount'
},
]
...
...
@@ -45,7 +45,7 @@ interface infoType {
payName
:
string
,
// 付款方
orderTypeName
:
string
,
// 结算单据类型名称
totalCount
:
number
,
// 总单数
amount
:
number
,
// 结算金额
amount
:
number
,
// 结算金额
statusName
:
string
// 结算状态名称
}
...
...
@@ -84,9 +84,9 @@ const ProductNoticeSettlementDetail: React.FC = () => {
const
endTime
=
values
.
endTime
?.
format
(
format
);
const
receiveStartTime
=
values
.
receiveStartTime
?.
format
(
format
);
const
receiveEndTime
=
values
.
receiveEndTime
?.
format
(
format
);
ref
.
current
.
reload
({...
values
,
startTime
,
endTime
,
receiveStartTime
,
receiveEndTime
});
}
}
return
(
<
PageHeaderWrapper
...
...
@@ -96,21 +96,21 @@ const ProductNoticeSettlementDetail: React.FC = () => {
style=
{
{
padding
:
'0'
}
}
onBack=
{
()
=>
history
.
goBack
()
}
title=
{
<
AvatarWrap
<
AvatarWrap
info=
{
{
aloneTxt
:
'单'
,
name
:
"结算单号:"
}
}
}
}
extra=
{
(
<
span
style=
{
{
fontSize
:
12
,
fontWeight
:
'normal'
}
}
>
{
infoDetail
?.
settlementNo
}
</
span
>
)
}
/>
}
>
<
Descriptions
column=
{
3
}
style=
{
{
padding
:
'0 32px'
,
<
Descriptions
column=
{
3
}
style=
{
{
padding
:
'0 32px'
,
}
}
>
<
Descriptions
.
Item
label=
"结算日期"
>
{
infoDetail
?.
settlementDate
}
</
Descriptions
.
Item
>
...
...
@@ -133,7 +133,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchListData
(
params
)
}
controlRender=
{
<
NiceForm
<
NiceForm
actions=
{
formActions
}
components=
{
{
RangePicker
}
}
expressionScope=
{
{
...
...
@@ -161,4 +161,4 @@ const ProductNoticeSettlementDetail: React.FC = () => {
)
}
export
default
ProductNoticeSettlementDetail
\ No newline at end of file
export
default
ProductNoticeSettlementDetail
src/pages/balance/accountsReceivable/invoice/index.tsx
View file @
7f7cc051
...
...
@@ -144,8 +144,16 @@ const SettlementList = () => {
return
data
}
const
reload
=
(
values
)
=>
{
ref
.
current
.
reload
(
values
);
/**
* 搜索
*/
const
handleSearch
=
(
values
)
=>
{
const
format
=
'YYYY-MM-DD'
const
payStartTime
=
values
.
payStartTime
?.
format
(
format
);
const
payEndTime
=
values
.
payEndTime
?.
format
(
format
);
const
orderStartTime
=
values
.
orderStartTime
?.
format
(
format
);
const
orderEndTime
=
values
.
orderEndTime
?.
format
(
format
);
ref
.
current
.
reload
({...
values
,
payStartTime
,
payEndTime
,
orderStartTime
,
orderEndTime
});
}
return
(
...
...
@@ -182,8 +190,13 @@ const SettlementList = () => {
);
}
}
schema=
{
schema
}
onSubmit=
{
reload
}
onSubmit=
{
handleSearch
}
onReset=
{
()
=>
{
formActions
.
setFieldValue
(
'payStartTime'
,
null
);
formActions
.
setFieldValue
(
'payEndTime'
,
null
);
formActions
.
setFieldValue
(
'orderStartTime'
,
null
);
formActions
.
setFieldValue
(
'orderEndTime'
,
null
);
}
}
/>
}
/>
...
...
src/pages/balance/accountsReceivable/invoice/schema/index.tsx
View file @
7f7cc051
...
...
@@ -29,7 +29,7 @@ export const schema: ISchema = {
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
placeholder
:
'搜索
订单号
'
,
},
},
},
...
...
@@ -43,28 +43,28 @@ export const schema: ISchema = {
},
},
properties
:
{
desc
:
{
orderAbstract
:
{
type
:
'string'
,
default
:
undefined
,
'x-component-props'
:
{
placeholder
:
'单据摘要'
,
allowClear
:
true
,
placeholder
:
'单据摘要'
,
allowClear
:
true
,
},
},
"[orderStartTime, orderEndTime]"
:
{
type
:
'object'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
placeholder
:
[
"下单时间(开始时间)"
,
"下单时间(结束时间)"
],
allowClear
:
true
,
placeholder
:
[
"下单时间(开始时间)"
,
"下单时间(结束时间)"
],
allowClear
:
true
,
},
},
"[payStartTime, payEndTime]"
:
{
type
:
'object'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
placeholder
:
[
"支付时间(开始时间)"
,
"支付时间(结束时间)"
],
allowClear
:
true
,
placeholder
:
[
"支付时间(开始时间)"
,
"支付时间(结束时间)"
],
allowClear
:
true
,
},
},
invoiceStatus
:
{
...
...
@@ -76,8 +76,8 @@ export const schema: ISchema = {
{
label
:
'已开票'
,
value
:
1
}
],
'x-component-props'
:
{
placeholder
:
'开票状态(全部)'
,
allowClear
:
true
,
placeholder
:
'开票状态(全部)'
,
allowClear
:
true
,
},
},
payStatus
:
{
...
...
@@ -89,8 +89,8 @@ export const schema: ISchema = {
{
label
:
'已支付'
,
value
:
1
}
],
'x-component-props'
:
{
placeholder
:
'支付状态(全部)'
,
allowClear
:
true
,
placeholder
:
'支付状态(全部)'
,
allowClear
:
true
,
},
},
submit
:
{
...
...
@@ -107,4 +107,4 @@ export const schema: ISchema = {
},
},
},
};
\ No newline at end of file
};
src/pages/balance/platformSettlement/accountReceivable/index.tsx
View file @
7f7cc051
...
...
@@ -159,7 +159,7 @@ const AccountReceivable = () => {
expressionScope=
{
{}
}
components=
{
{
DatePicker
}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.settlementN
ame
'
,
FORM_FILTER_PATH
);
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.settlementN
o
'
,
FORM_FILTER_PATH
);
useAsyncSelect
(
[
'status'
],
fetchOptions
(
PublicApi
.
getSettleAccountsCommonGetSettlementStatus
),
...
...
src/pages/balance/platformSettlement/accountReceivable/schema/index.tsx
View file @
7f7cc051
...
...
@@ -13,7 +13,7 @@ export const schema: ISchema = {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
settlementN
ame
:
{
settlementN
o
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
...
...
src/pages/balance/platformSettlement/integral/index.tsx
View file @
7f7cc051
...
...
@@ -55,7 +55,7 @@ const Integral: React.FC = () => {
title
:
'兑换比率'
,
dataIndex
:
'ratio'
,
render
:
(
text
,
record
)
=>
{
return
(
record
.
ratio
*
100
+
"%"
);
return
(
record
.
ratio
+
"%"
);
}
},
{
title
:
'结算金额'
,
dataIndex
:
'amount'
},
...
...
@@ -160,7 +160,7 @@ const Integral: React.FC = () => {
components=
{
{
DatePicker
}
}
expressionScope=
{
{}
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.
name
'
,
FORM_FILTER_PATH
);
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'megaLayout.
settlementNo
'
,
FORM_FILTER_PATH
);
useAsyncSelect
(
[
'status'
],
fetchOptions
(
PublicApi
.
getSettleAccountsCommonGetSettlementStatus
),
...
...
src/pages/balance/platformSettlement/integral/info.tsx
View file @
7f7cc051
...
...
@@ -33,7 +33,7 @@ const columns = [
{
title
:
'支付积分'
,
dataIndex
:
'payScore'
},
{
title
:
'支付时间'
,
dataIndex
:
'payTime'
},
{
title
:
'兑换比率'
,
title
:
'兑换比率'
,
dataIndex
:
'ratio'
,
render
:
(
text
,
record
)
=>
{
return
record
.
ratio
*
100
+
"%"
...
...
@@ -72,7 +72,6 @@ const Info: React.FC = () => {
* 搜索
*/
const
handleSearch
=
(
values
)
=>
{
console
.
log
(
values
);
const
format
=
'YYYY-MM-DD'
const
{
payTime
,
orderTime
,
...
rest
}
=
values
;
// 支付时间
...
...
@@ -83,9 +82,9 @@ const Info: React.FC = () => {
const
orderTimeRange
=
orderTime
?
timeRange
(
values
.
orderTime
)
:
null
;
const
orderStartTime
=
orderTimeRange
?
moment
(
orderTimeRange
.
st
).
format
(
format
)
:
null
;
const
orderEndTime
=
orderTimeRange
?
moment
(
orderTimeRange
.
et
).
format
(
format
)
:
null
;
ref
.
current
.
reload
({...
rest
,
payStartTime
,
payEndTime
,
orderStartTime
,
orderEndTime
});
}
}
return
(
...
...
@@ -96,21 +95,21 @@ const Info: React.FC = () => {
style=
{
{
padding
:
'0'
}
}
onBack=
{
()
=>
history
.
goBack
()
}
title=
{
<
AvatarWrap
<
AvatarWrap
info=
{
{
aloneTxt
:
'单'
,
name
:
"结算单号:"
}
}
}
}
extra=
{
(
<
span
style=
{
{
fontSize
:
12
,
fontWeight
:
'normal'
}
}
>
{
infoDetail
?.
settlementNo
}
</
span
>
)
}
/>
}
>
<
Descriptions
column=
{
3
}
style=
{
{
padding
:
'0 32px'
,
<
Descriptions
column=
{
3
}
style=
{
{
padding
:
'0 32px'
,
}
}
>
<
Descriptions
.
Item
label=
"结算日期:"
>
{
infoDetail
?.
settlementDate
}
</
Descriptions
.
Item
>
...
...
@@ -134,7 +133,7 @@ const Info: React.FC = () => {
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchListData
(
params
)
}
controlRender=
{
<
NiceForm
<
NiceForm
actions=
{
formActions
}
expressionScope=
{
{
exportBtn
:
(
...
...
@@ -157,4 +156,4 @@ const Info: React.FC = () => {
)
}
export
default
Info
\ No newline at end of file
export
default
Info
src/pages/balance/platformSettlement/integral/schema/index.tsx
View file @
7f7cc051
...
...
@@ -18,11 +18,11 @@ export const schema: ISchema = {
type
:
'object'
,
'x-component'
:
'mega-layout'
,
properties
:
{
name
:
{
settlementNo
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
placeholder
:
'搜索
结算单号
'
,
align
:
'flex-left'
,
// tip: '输入通知单号、通知单摘要进行搜索',
},
...
...
src/pages/balance/settleRules/memberSettle/schema/index.tsx
View file @
7f7cc051
...
...
@@ -33,7 +33,7 @@ export const indexSchema = {
"span"
:
2
},
'x-component-props'
:
{
placeholder
:
'搜索'
,
placeholder
:
'搜索
策略名称
'
,
advanced
:
false
,
},
},
...
...
src/pages/balance/settleRules/receipt/index.tsx
View file @
7f7cc051
...
...
@@ -122,7 +122,7 @@ const Receipt: React.FC<iProps> = () => {
</
Col
>
)
})
}
}
<
Col
span=
{
8
}
className=
{
styles
.
margin
}
>
<
div
className=
{
styles
.
add
}
onClick=
{
handleRouterAdd
}
>
...
...
@@ -137,4 +137,4 @@ const Receipt: React.FC<iProps> = () => {
)
}
export
default
Receipt
\ No newline at end of file
export
default
Receipt
src/pages/balance/settleRules/receipt/info.tsx
View file @
7f7cc051
...
...
@@ -56,7 +56,7 @@ const schema = {
{
label
:
'增值税专用发票'
,
value
:
2
}
],
},
'x-rules'
:
[
{
required
:
true
,
message
:
'请选择发票种类'
}
]
...
...
@@ -68,7 +68,7 @@ const schema = {
{
required
:
true
,
message
:
'请填写发票抬头'
},
{
limitByte
:
true
,
maxByte
:
40
}
],
},
taxNo
:
{
type
:
'string'
,
...
...
@@ -113,7 +113,7 @@ const schema = {
title
:
'是否默认'
,
'x-component'
:
'SchemaSwitch'
},
}
}
}
...
...
@@ -131,7 +131,7 @@ const Info: React.FC = () => {
const
serviceActions
=
isAdd
?
PublicApi
.
postSettleAccountsInvoiceMessageAdd
:
PublicApi
.
postSettleAccountsInvoiceMessageUpdate
let
tempData
=
{...
value
,
isDefault
:
value
.
isDefault
?
1
:
0
};
const
postData
=
isAdd
?
tempData
:
{...
tempData
,
id
};
setSubmitLoading
(
true
);
...
...
@@ -160,7 +160,9 @@ const Info: React.FC = () => {
}
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
>
<
Card
>
<
NiceForm
components=
{
{
SchemaSwitch
,
SchemaRadio
}
}
...
...
@@ -173,12 +175,12 @@ const Info: React.FC = () => {
<
FormButtonGroup
offset=
{
4
}
>
<
Submit
loading=
{
submitLoading
}
>
提交
</
Submit
>
<
Button
onClick=
{
handleCancel
}
>
取消
</
Button
>
</
FormButtonGroup
>
</
FormButtonGroup
>
</
NiceForm
>
</
Card
>
<
Prompt
when=
{
unsaved
}
message=
{
"内容未保存,确定要离开?"
}
/>
</
PageHeaderWrapper
>
)
}
...
...
src/pages/channel/channelInfo/index.less
View file @
7f7cc051
...
...
@@ -29,7 +29,7 @@
.img_list {
display: flex;
flex-wrap: wrap;
}
.shop_url {
...
...
@@ -120,4 +120,4 @@
}
}
}
}
\ No newline at end of file
}
src/pages/channel/channelInfo/index.tsx
View file @
7f7cc051
...
...
@@ -328,7 +328,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
label=
{
<
RequireItem
label=
"公司简介"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入公司简介"
}]
}
>
<
Input
.
TextArea
allowClear
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"请输入公司简介"
maxLength=
{
200
}
/>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"请输入公司简介"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
...
...
@@ -346,15 +346,15 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"600x400"
onChange=
{
(
url
)
=>
handleAddworkshopPics
(
url
)
}
/>
</
div
>
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"600x400"
onChange=
{
(
url
)
=>
handleAddworkshopPics
(
url
)
}
/>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
...
...
@@ -373,15 +373,15 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"106x107"
onChange=
{
(
url
)
=>
handleAddhonorPics
(
url
)
}
/>
</
div
>
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"106x107"
onChange=
{
(
url
)
=>
handleAddhonorPics
(
url
)
}
/>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
...
...
src/pages/handling/assign/add/index.tsx
View file @
7f7cc051
...
...
@@ -356,9 +356,9 @@ const Add: React.FC<{}> = () => {
category
:
item
.
customerCategoryName
,
brand
:
item
.
brandName
,
unit
:
item
.
unitName
,
processNum
:
item
.
processNum
||
0
,
processPrice
:
item
.
processUnitPrice
||
0
,
processTotalPrice
:
item
.
processTotalPrice
,
processNum
:
item
.
processNum
*
1
||
0
,
processPrice
:
item
.
processUnitPrice
*
1
||
0
,
processTotalPrice
:
item
.
processTotalPrice
*
1
,
deliveryDate
:
deliveryDateFormat
,
property
:{
specs
:
item
.
productProps
||
[],
...
...
src/pages/handling/assign/detail/index.tsx
View file @
7f7cc051
...
...
@@ -244,7 +244,7 @@ const Detail: React.FC<{}> = () => {
const
AllReceiptReceive
=
(
<
Space
direction=
{
"vertical"
}
>
{
hasProductNoReply
!
hasProductNoReply
?
<
Popconfirm
title=
{
'确认本单全部发货单是否已全部收到回单'
}
onConfirm=
{
()
=>
handleAllReceiptReceive
(
true
)
}
...
...
src/pages/handling/common/index.tsx
View file @
7f7cc051
...
...
@@ -180,7 +180,9 @@ export const SUPPLIER_INNER_STATUS_COLOR = {
"3"
:
"processing"
,
'4'
:
'processing'
,
"5"
:
"success"
,
"7"
:
"processing"
,
"6"
:
"processing"
,
"7"
:
"warning"
,
"8"
:
"processing"
,
"9"
:
"error"
,
"10"
:
"success"
,
}
...
...
src/pages/handling/components/ProcessDetail/content.tsx
View file @
7f7cc051
...
...
@@ -29,8 +29,8 @@ const schema = {
message
:
'请填写加工数量'
},
{
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
2
})?
$/
,
message
:
'请填写整数或保留
两
位小数'
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
3
})?
$/
,
message
:
'请填写整数或保留
三
位小数'
}
]
},
...
...
@@ -43,8 +43,8 @@ const schema = {
message
:
'请填写加工单价'
},
{
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
2
})?
$/
,
message
:
'请填写整数或保留
两
位小数'
pattern
:
/^
[
1-9
][
0-9
]
*
(\.[
0-9
]{1,
3
})?
$/
,
message
:
'请填写整数或保留
三
位小数'
}
]
}
...
...
src/pages/handling/components/ProcessProducts/index.tsx
View file @
7f7cc051
...
...
@@ -6,6 +6,7 @@ import { BasicForm, TablePagination, SearchForm } from '../ModalForTable'
import
{
createAsyncFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
schema
}
from
'./schema'
;
import
{
getAuth
}
from
'@/utils/auth'
;
import
{
useDebounceFn
}
from
'@umijs/hooks'
;
const
{
onFieldInit$
}
=
FormEffectHooks
...
...
@@ -55,29 +56,51 @@ const ProcessProducts = ({visible, cancel, rowSelection, loading, ...restProps})
const
effects
=
()
=>
{
onFieldInit$
(
'branchId'
).
subscribe
((
fieldState
)
=>
{
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
''
}).
then
(
res
=>
{
let
options
=
[]
if
(
res
.
code
===
1000
)
{
options
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
id
}})
}
actions
.
setFieldState
(
"branchId"
,
(
state
)
=>
{
state
.
props
[
"x-component-props"
][
"options"
]
=
options
;
})
})
changeBrand
({
name
:
''
})
});
onFieldInit$
(
'categoryId'
).
subscribe
((
fieldState
)
=>
{
PublicApi
.
getProductSelectGetSelectCategory
({
name
:
''
}).
then
(
res
=>
{
let
options
=
[]
if
(
res
.
code
===
1000
)
{
options
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
id
}})
}
actions
.
setFieldState
(
"categoryId"
,
(
state
)
=>
{
state
.
props
[
"x-component-props"
][
"options"
]
=
options
;
})
changeCategory
({
name
:
''
});
})
}
const
changeBrand
=
(
params
)
=>
{
PublicApi
.
getProductSelectGetSelectBrand
(
params
).
then
(
res
=>
{
let
options
=
[]
if
(
res
.
code
===
1000
)
{
options
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
id
}})
}
actions
.
setFieldState
(
"branchId"
,
(
state
)
=>
{
state
.
props
[
"x-component-props"
][
"options"
]
=
options
;
})
})
}
const
changeCategory
=
(
params
)
=>
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
(
params
).
then
(
res
=>
{
let
options
=
[]
if
(
res
.
code
===
1000
)
{
options
=
res
.
data
.
map
((
item
)
=>
{
return
{
label
:
item
.
name
,
value
:
item
.
id
}})
}
actions
.
setFieldState
(
"categoryId"
,
(
state
)
=>
{
state
.
props
[
"x-component-props"
][
"options"
]
=
options
;
})
})
}
const
filterCategroyOption
=
(
input
,
option
)
=>
{
return
option
.
label
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
}
const
onCategory
=
useDebounceFn
((
value
)
=>
{
changeCategory
({
name
:
value
});
},
500
)
const
filterBrandOption
=
(
input
,
option
)
=>
{
return
option
.
label
.
toLowerCase
().
indexOf
(
input
.
toLowerCase
())
>=
0
}
const
onBrandSearch
=
useDebounceFn
((
value
)
=>
{
changeBrand
({
name
:
value
});
},
500
);
return
(
<
Modal
...
...
@@ -96,7 +119,14 @@ const ProcessProducts = ({visible, cancel, rowSelection, loading, ...restProps})
schema=
{
schema
}
actions=
{
actions
}
effects=
{
effects
}
expressionScope=
{
{
rowSelection
:
rowSelection
,
columns
:
columns
}
}
expressionScope=
{
{
rowSelection
:
rowSelection
,
columns
:
columns
,
filterCategroyOption
:
filterCategroyOption
,
onCategory
:
onCategory
.
run
,
filterBrandOption
:
filterBrandOption
,
onBrandSearch
:
onBrandSearch
.
run
}
}
/>
</
Spin
>
:
null
...
...
src/pages/handling/components/ProcessProducts/schema.tsx
View file @
7f7cc051
...
...
@@ -69,7 +69,14 @@ export const schema = {
style
:
{
width
:
'200px'
,
margin
:
'0 20px 0 0'
}
},
showSearch
:
true
,
optionFilterProp
:
"children"
,
filterOption
:
"{{filterCategroyOption}}"
,
onSearch
:
"{{onCategory}}"
// filterOption: {(input, option) =>
// option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
// }
}
},
branchId
:
{
...
...
@@ -81,7 +88,11 @@ export const schema = {
style
:
{
width
:
'200px'
,
margin
:
'0 20px 0 0'
}
},
showSearch
:
true
,
optionFilterProp
:
"children"
,
filterOption
:
"{{filterBrandOption}}"
,
onSearch
:
"{{onBrandSearch}}"
}
},
queryBtn
:
{
...
...
@@ -91,7 +102,7 @@ export const schema = {
"children"
:
"查询"
,
}
}
}
}
}
}
},
...
...
@@ -123,4 +134,4 @@ export const schema = {
}
},
}
}
\ No newline at end of file
}
src/pages/home/components/UserCenter/index.less
View file @
7f7cc051
...
...
@@ -65,6 +65,12 @@
color: #fff;
position: relative;
overflow: hidden;
&:hover {
.upload {
display: block;
}
}
.text {
position: absolute;
top: 50%;
...
...
@@ -73,6 +79,7 @@
margin-left: -4px;
}
.upload {
display: none;
position: absolute;
bottom: 0;
left: 0;
...
...
src/pages/home/components/UserCenter/index.tsx
View file @
7f7cc051
...
...
@@ -35,14 +35,13 @@ function reducer(state, action) {
const
UserCenter
:
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
const
today
=
moment
();
const
userAuth
=
getAuth
();
// const hasChangeMemberAuth = userAuth?.urls.includes(EDIT_USER_URL);
// const hasCenterAuth = userAuth?.urls.includes(USER_CENTER_URL);
const
currentRole
=
userAuth
?.
roles
?.
filter
((
item
)
=>
item
.
memberRoleId
===
userAuth
.
memberRoleId
)
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
{
loading
:
false
,
logo
:
userAuth
?.
logo
})
if
(
!
userAuth
)
{
return
null
}
// const hasChangeMemberAuth = userAuth?.urls.includes(EDIT_USER_URL);
// const hasCenterAuth = userAuth?.urls.includes(USER_CENTER_URL);
const
currentRole
=
userAuth
.
roles
.
filter
((
item
)
=>
item
.
memberRoleId
===
userAuth
.
memberRoleId
)
const
[
state
,
dispatch
]
=
useReducer
(
reducer
,
{
loading
:
false
,
logo
:
userAuth
.
logo
})
const
uploadProps
=
{
name
:
'file'
,
...
...
@@ -61,7 +60,6 @@ const UserCenter: React.FC<Iprops> = (props) => {
if
(
info
.
file
.
status
===
'done'
)
{
const
{
code
,
data
}
=
info
.
file
.
response
if
(
code
===
1000
)
{
console
.
log
(
'upload success'
)
PublicApi
.
postMemberBusinessLogoAdd
({
logo
:
data
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
...
...
@@ -100,12 +98,12 @@ const UserCenter: React.FC<Iprops> = (props) => {
<
Spin
spinning=
{
state
.
loading
}
>
<
div
className=
{
styles
.
userLogo
}
>
<
div
className=
{
styles
.
randomLogo
}
>
{
state
.
logo
?
<
img
src=
{
state
.
logo
||
''
}
className=
{
styles
.
logo
}
/>
:
<
span
className=
{
styles
.
text
}
>
H
</
span
>
}
<
Upload
{
...
uploadProps
}
>
{
state
.
logo
?
<
img
src=
{
state
.
logo
||
''
}
className=
{
styles
.
logo
}
/>
:
<
span
className=
{
styles
.
text
}
>
H
</
span
>
}
<
span
className=
{
styles
.
upload
}
>
修改
</
span
>
</
Upload
>
</
div
>
...
...
src/pages/home/index.less
View file @
7f7cc051
.container {
display: flex;
flex-direction: row;
min-width: 1
366
px;
min-width: 1
179
px;
.left {
flex: 1;
...
...
@@ -56,3 +56,7 @@
margin-left: 8px;
}
}
@media (max-width: '1280px') {
}
src/pages/home/index.tsx
View file @
7f7cc051
...
...
@@ -53,63 +53,58 @@ const Home: React.FC<{}> = () => {
return
(
<
PageHeaderWrapper
>
<
div
>
<
div
className=
{
styles
.
userGuaid
}
style=
{
{
display
:
visible
?
'none'
:
'none'
}
}
>
<
UseGuaid
/>
<
div
className=
{
styles
.
userGuaid
}
style=
{
{
display
:
visible
?
'none'
:
'none'
}
}
>
<
UseGuaid
/>
</
div
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
left
}
>
<
UserCenter
/>
<
div
className=
{
styles
.
otherCenters
}
>
{
layout
.
map
((
item
)
=>
{
const
RenderComponent
=
ComponentSelect
[
item
.
name
]
return
(
<
div
className=
{
styles
.
ability
}
style=
{
{
order
:
item
.
sort
,
display
:
(
item
.
isShow
?
'block'
:
'none'
)}
}
key=
{
item
.
code
}
>
{
RenderComponent
&&
<
RenderComponent
/>
}
</
div
>
)
})
}
</
div
>
</
div
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
left
}
>
<
div
className=
{
styles
.
userCenter
}
>
<
UserCenter
/>
<
div
className=
{
styles
.
right
}
>
<
div
className=
{
styles
.
actions
}
>
<
div
className=
{
styles
.
workBench
}
>
<
CustomWorkBench
handleChangeOrder=
{
handleChangeOrder
}
layouts=
{
layout
}
/>
</
div
>
<
div
className=
{
styles
.
otherCenters
}
>
{
layout
.
map
((
item
)
=>
{
const
RenderComponent
=
ComponentSelect
[
item
.
name
]
return
(
<
div
className=
{
styles
.
ability
}
style=
{
{
order
:
item
.
sort
,
display
:
(
item
.
isShow
?
'block'
:
'none'
)}
}
key=
{
item
.
code
}
>
{
RenderComponent
&&
<
RenderComponent
/>
}
</
div
>
)
})
}
<
div
className=
{
styles
.
controller
}
onClick=
{
()
=>
setVisible
((
state
)
=>
!
state
)
}
>
<
CompassFilled
className=
{
styles
.
icon
}
/>
<
span
className=
{
styles
.
text
}
>
使用向导
</
span
>
</
div
>
</
div
>
<
div
className=
{
styles
.
right
}
>
<
div
className=
{
styles
.
actions
}
>
<
div
className=
{
styles
.
workBench
}
>
<
CustomWorkBench
handleChangeOrder=
{
handleChangeOrder
}
layouts=
{
layout
}
/>
</
div
>
<
div
className=
{
styles
.
controller
}
onClick=
{
()
=>
setVisible
((
state
)
=>
!
state
)
}
>
<
CompassFilled
className=
{
styles
.
icon
}
/>
<
span
className=
{
styles
.
text
}
>
使用向导
</
span
>
</
div
>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
LatestAnnounce
/>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
RecentVisit
/>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
AnyQuestion
/>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
AdvertisementContainer
/>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
LatestAnnounce
/>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
RecentVisit
/>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
AnyQuestion
/>
</
div
>
<
div
className=
{
styles
.
commonMargin
}
>
<
AdvertisementContainer
/>
</
div
>
</
div
>
</
div
>
</
PageHeaderWrapper
>
)
...
...
src/pages/lxMall/components/ShopHeader/index.tsx
View file @
7f7cc051
...
...
@@ -25,7 +25,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const
{
search
}
=
history
.
location
.
query
useEffect
(()
=>
{
if
(
!!
search
)
{
if
(
search
)
{
setSearchValue
(
search
)
}
else
{
setSearchValue
(
""
)
...
...
@@ -48,13 +48,12 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const
applyFroVip
=
()
=>
{
if
(
shopInfo
)
{
le
t
param
=
{
cons
t
param
=
{
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}
setApplyLoading
(
true
)
PublicApi
.
postMemberAbilityMallSubApply
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
}
setApplyLoading
(
false
)
}).
catch
(()
=>
{
setApplyLoading
(
false
)
...
...
@@ -63,8 +62,8 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
}
const
handleCollect
=
()
=>
{
le
t
status
=
!
collectState
le
t
param
=
{
cons
t
status
=
!
collectState
cons
t
param
=
{
shopId
:
shopInfo
.
id
,
status
}
...
...
@@ -101,7 +100,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
</
div
>
<
div
className=
{
styles
.
shop_header_info_content
}
>
<
div
className=
{
styles
.
shop_header_info_content_name
}
>
<
span
>
{
shopInfo
?.
company
}
</
span
>
<
span
>
{
shopInfo
?.
memberName
}
</
span
>
<
CaretDownOutlined
className=
{
styles
.
shop_header_info_content_icon
}
/>
</
div
>
<
div
className=
{
styles
.
shop_header_info_content_about
}
>
...
...
@@ -112,7 +111,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
</
div
>
<
div
className=
{
styles
.
shop_header_info_content_about_item
}
>
<
i
className=
{
styles
.
icon
}
><
img
src=
{
credit_icon
}
/></
i
>
<
span
>
{
20
0
}
</
span
>
<
span
>
{
shopInfo
?.
creditPoint
||
0
}
</
span
>
</
div
>
</
div
>
</
div
>
...
...
src/pages/lxMall/components/TopBar/index.tsx
View file @
7f7cc051
...
...
@@ -67,7 +67,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
{
userInfo
?
(
<
li
className=
{
cx
(
styles
.
topbar_menu_item
,
styles
.
username
)
}
>
<
span
className=
{
styles
.
username
}
>
{
userInfo
?.
name
}
</
span
>
<
Link
className=
{
styles
.
username
}
to=
"/memberCenter/home"
>
{
userInfo
?.
name
}
</
Link
>
<
CaretDownOutlined
className=
{
styles
.
arrow_icon
}
/>
<
div
className=
{
styles
.
userInfo_card_split
}
></
div
>
<
div
className=
{
styles
.
userInfo_card
}
>
...
...
@@ -134,4 +134,4 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
)
}
export
default
inject
(
'UserStore'
)(
observer
(
TopBar
))
\ No newline at end of file
export
default
inject
(
'UserStore'
)(
observer
(
TopBar
))
src/pages/lxMall/layouts/LXChannelLayout.tsx
View file @
7f7cc051
...
...
@@ -85,11 +85,11 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
<
Fragment
>
<
Helmet
>
{
shopInfo
?
<
title
>
{
shopInfo
.
company
}
</
title
>
:
null
shopInfo
?
<
title
>
{
shopInfo
.
memberName
}
</
title
>
:
null
}
</
Helmet
>
<
div
className=
{
styles
.
lxmall_page
}
>
<
TopBar
langComponent=
{
<
SelectLang
/>
}
name=
{
shopInfo
?.
company
}
type=
{
LAYOUT_TYPE
.
channel
}
shopUrlParam=
{
channelId
}
/>
<
TopBar
langComponent=
{
<
SelectLang
/>
}
name=
{
shopInfo
?.
memberName
}
type=
{
LAYOUT_TYPE
.
channel
}
shopUrlParam=
{
channelId
}
/>
<
div
className=
{
styles
.
content
}
>
{
!
menuRouter
?.
hideHeader
&&
(
...
...
src/pages/lxMall/layouts/LXIChannelLayout.tsx
View file @
7f7cc051
...
...
@@ -85,11 +85,11 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
<
Fragment
>
<
Helmet
>
{
shopInfo
?
<
title
>
{
shopInfo
.
company
}
</
title
>
:
null
shopInfo
?
<
title
>
{
shopInfo
.
memberName
}
</
title
>
:
null
}
</
Helmet
>
<
div
className=
{
styles
.
lxmall_page
}
>
<
TopBar
langComponent=
{
<
SelectLang
/>
}
name=
{
shopInfo
?.
company
}
type=
{
LAYOUT_TYPE
.
ichannel
}
shopUrlParam=
{
channelId
}
/>
<
TopBar
langComponent=
{
<
SelectLang
/>
}
name=
{
shopInfo
?.
memberName
}
type=
{
LAYOUT_TYPE
.
ichannel
}
shopUrlParam=
{
channelId
}
/>
<
div
className=
{
styles
.
content
}
>
{
!
menuRouter
?.
hideHeader
&&
(
...
...
src/pages/lxMall/layouts/LXShopLayout.tsx
View file @
7f7cc051
...
...
@@ -64,10 +64,17 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
const
fetchShopInfo
=
(
memberId
,
roleId
,
storeId
)
=>
{
const
param
:
any
=
{
memberId
,
roleId
,
storeId
}
PublicApi
.
getTemplateShopFindShop
(
param
).
then
(
res
=>
{
let
getShopInfoFn
=
null
if
(
storeId
)
{
param
.
storeId
=
storeId
getShopInfoFn
=
PublicApi
.
getTemplateWebMemberShopWebMemberShopMain
}
else
if
(
roleId
)
{
param
.
roleId
=
roleId
getShopInfoFn
=
PublicApi
.
getTemplateWebMemberShopWebFindByMemberIdAndRoleId
}
console
.
log
(
param
,
"param"
)
getShopInfoFn
&&
getShopInfoFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
}
...
...
@@ -107,7 +114,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
<
ShopHeader
logo=
{
mallInfo
.
logoUrl
}
shopId=
{
query
.
shopId
}
shopUrlParam=
{
shopId
}
shopInfo=
{
shopInfo
}
updateShopInfo=
{
()
=>
handleUpdate
()
}
/>
<
MainNav
menuData=
{
menuData
}
pathname=
{
location
.
pathname
}
type=
{
LAYOUT_TYPE
.
shop
}
shopId=
{
query
.
shopId
}
shopUrlParam=
{
shopId
}
/>
{
!
loading
?
shopInfo
?
shopInfo
.
status
===
1
?
children
&&
React
.
Children
.
map
(
children
,
(
child
:
any
)
=>
{
!
loading
?
shopInfo
?
children
&&
React
.
Children
.
map
(
children
,
(
child
:
any
)
=>
{
return
React
.
cloneElement
(
child
,
{
layoutType
:
LAYOUT_TYPE
.
shop
,
...
...
@@ -118,7 +125,7 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
updateShopInfo
:
()
=>
handleUpdate
()
},
);
})
:
<
SearchShopResult
search
=
{
shopInfo
.
company
}
/> : <SearchShopResult /
>
:
null
})
:
<
SearchShopResult
search
=
{
shopInfo
.
company
}
/> : <SearchShopResult /
>
}
</
div
>
<
Footer
/>
...
...
src/pages/shop/shopInfo/index.less
View file @
7f7cc051
.shop_info {
background-color: #ffffff;
padding: 32px 24px;
border-radius: 8px;
.add_template_form {
:global {
.ant-form-item-label>label::after {
display: none;
}
}
}
.form_item {
width: 572px;
resize: none;
}
.form_item_wrap {
display: flex;
flex-wrap: wrap;
align-items: center;
.size_require {
color: #C0C4CC;
}
}
.img_list {
display: flex;
}
.shop_url {
width: 572px;
color: #909399;
margin-top: 16px;
font-size: 12px;
display: flex;
&>label {
flex: 1;
width: 0;
display: block;
color: #303133;
margin-left: 8px;
margin-right: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.copy_icon {
cursor: pointer;
}
}
.upload_btn {
position: relative;
width: 104px;
height: 104px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
flex-direction: column;
background: rgba(250, 251, 252, 1);
border-radius: 2px;
border: 1px dashed rgba(223, 225, 230, 1);
cursor: pointer;
margin-right: 24px;
overflow: hidden;
margin-bottom: 12px;
&.upload {
border: 1px solid rgba(223, 225, 230, 1);
background: #ffffff;
}
.upload_img {
height: 100%;
width: 100%;
display: block;
margin: 0 auto;
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
}
&>img {
width: 100%;
height: 100%;
}
&.large {
width: 175px;
height: 120px;
}
&>p {
margin-top: 12px;
}
.delete_btn {
position: absolute;
width: 24px;
height: 24px;
border-radius: 4px;
background: rgba(0, 0, 0, 0.45);
top: 8px;
right: 8px;
color: #ffffff;
text-align: center;
line-height: 24px;
&:hover {
cursor: pointer;
opacity: .8;
}
}
}
}
\ No newline at end of file
.shop_info {
background-color: #ffffff;
padding: 32px 24px;
border-radius: 8px;
.add_template_form {
:global {
.ant-form-item-label>label::after {
display: none;
}
}
}
.form_item {
width: 572px;
resize: none;
}
.form_item_wrap {
display: flex;
flex-wrap: wrap;
align-items: center;
.size_require {
color: #C0C4CC;
}
}
.img_list {
display: flex;
flex-wrap: wrap;
}
.shop_url {
width: 572px;
color: #909399;
margin-top: 16px;
font-size: 12px;
display: flex;
&>label {
flex: 1;
width: 0;
display: block;
color: #303133;
margin-left: 8px;
margin-right: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.copy_icon {
cursor: pointer;
}
}
.upload_btn {
position: relative;
width: 104px;
height: 104px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
flex-direction: column;
background: rgba(250, 251, 252, 1);
border-radius: 2px;
border: 1px dashed rgba(223, 225, 230, 1);
cursor: pointer;
margin-right: 24px;
overflow: hidden;
margin-bottom: 12px;
&.upload {
border: 1px solid rgba(223, 225, 230, 1);
background: #ffffff;
}
.upload_img {
height: 100%;
width: 100%;
display: block;
margin: 0 auto;
background-size: auto 100%;
background-position: center center;
background-repeat: no-repeat;
}
&>img {
width: 100%;
height: 100%;
}
&.large {
width: 175px;
height: 120px;
}
&>p {
margin-top: 12px;
}
.delete_btn {
position: absolute;
width: 24px;
height: 24px;
border-radius: 4px;
background: rgba(0, 0, 0, 0.45);
top: 8px;
right: 8px;
color: #ffffff;
text-align: center;
line-height: 24px;
&:hover {
cursor: pointer;
opacity: .8;
}
}
}
}
src/pages/shop/shopInfo/index.tsx
View file @
7f7cc051
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
}
from
'antd'
import
{
Prompt
}
from
'umi'
import
{
inject
}
from
'mobx-react'
import
{
QuestionCircleOutlined
,
DeleteOutlined
,
CopyOutlined
}
from
'@ant-design/icons'
import
CitySelect
from
'@/components/CitySelect'
import
RequireItem
from
'@/components/RequireItem'
import
{
PublicApi
}
from
'@/services/api'
import
UploadImage
from
'@/components/UploadImage'
import
{
GetTemplateShopFindShopResponse
}
from
'@/services/TemplateApi'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
styles
from
'./index.less'
import
{
getAuth
}
from
'@/utils/auth'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
interface
ShopInfoPropsType
{
SiteStore
:
{
siteUrl
:
string
;
siteId
:
number
;
}
}
const
defaultCityData
=
{
index
:
0
,
provinceCode
:
0
,
province
:
''
,
cityCode
:
0
,
city
:
''
}
const
ShopInfo
:
React
.
FC
<
ShopInfoPropsType
>
=
(
props
)
=>
{
const
{
siteUrl
,
siteId
}
=
props
.
SiteStore
const
[
formIsHalfFilledOut
,
setFormIsHalfFilledOut
]
=
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
const
[
allMallList
,
setAllMallList
]
=
useState
([])
const
[
storeUrl
,
setStoreUrl
]
=
useState
<
string
>
(
''
)
const
[
selectCityData
,
setSelectCityData
]
=
useState
<
any
>
([
defaultCityData
])
const
[
workshopPics
,
setWorkshopPics
]
=
useState
([])
// 厂房照片
const
[
honorPics
,
setHonorPics
]
=
useState
([])
// 资质荣誉
const
[
logo
,
setLogo
]
=
useState
<
string
>
(
""
)
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplateShopFindShopResponse
>
()
const
[
shopId
,
setShopId
]
=
useState
<
number
>
()
useEffect
(()
=>
{
fetchShopInfo
()
fetchAllShop
()
},
[])
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
})
}
/**
* 获取店铺信息
*/
const
fetchShopInfo
=
()
=>
{
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindShop
(
param
).
then
(
res
=>
{
const
data
=
res
.
data
if
(
res
.
code
===
1000
)
{
setShopInfo
(
data
)
setSelectCityData
(
initMemberShopArea
(
data
.
memberShopAreas
))
setLogo
(
data
.
logo
)
setShopId
(
data
.
shopId
)
setWorkshopPics
(
data
.
workshopPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
if
(
data
.
shopId
&&
data
.
memberId
)
{
setStoreUrl
(
data
.
storeUrl
||
""
)
}
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
memberShopAreas
:
initMemberShopArea
(
data
.
memberShopAreas
),
workshopPics
:
data
.
workshopPics
||
[],
honorPics
:
data
.
honorPics
||
[]
})
}
})
}
const
initMemberShopArea
=
(
data
)
=>
{
if
(
!
isEmpty
(
data
))
{
return
data
.
map
((
item
,
index
)
=>
{
item
.
index
=
index
return
item
})
}
else
{
return
[
defaultCityData
]
}
}
const
handleAddNewCitySelect
=
(
item
:
any
)
=>
{
const
temp
=
[...
selectCityData
]
temp
.
push
(
item
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
memberShopAreas
:
temp
})
}
const
handleReduceCitySelect
=
(
index
:
number
)
=>
{
let
temp
=
JSON
.
parse
(
JSON
.
stringify
(
selectCityData
))
temp
=
temp
.
filter
((
item
:
any
)
=>
item
.
index
!==
index
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
memberShopAreas
:
temp
})
}
const
handleCityChange
=
(
data
:
any
)
=>
{
setSelectCityData
(
data
)
form
.
setFieldsValue
({
memberShopAreas
:
data
})
}
const
handleDeleteWorkShopImgItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
workshopPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setWorkshopPics
(
result
)
form
.
setFieldsValue
({
workshopPics
:
result
})
}
const
handleDeleteHonorPicsItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
honorPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setHonorPics
(
result
)
form
.
setFieldsValue
({
honorPics
:
result
})
}
const
handleSave
=
(
e
:
any
)
=>
{
e
.
preventDefault
()
form
.
validateFields
().
then
((
value
:
any
)
=>
{
if
(
!
checkMemberShopAreas
(
value
.
memberShopAreas
))
{
return
}
if
(
!
shopId
)
{
message
.
error
(
"店铺链接不能为空"
)
return
}
value
.
storeUrl
=
storeUrl
||
`
${
siteUrl
}
/shop`
value
.
shopId
=
shopId
PublicApi
.
postTemplateShopSaveShop
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
setFormIsHalfFilledOut
(
false
)
}
})
})
}
const
checkMemberShopAreas
=
(
shopAreas
)
=>
{
if
(
isEmpty
(
shopAreas
))
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
return
shopAreas
.
every
(
item
=>
{
if
(
!
item
.
provinceCode
)
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
else
{
return
true
}
})
}
const
handleCopyLinke
=
(
link
:
string
)
=>
{
if
(
copy
(
link
))
{
message
.
success
(
'复制成功!'
)
}
}
/**
* 添加厂房照片
* @param url
*/
const
handleAddworkshopPics
=
(
url
:
string
)
=>
{
setWorkshopPics
([...
workshopPics
,
url
])
form
.
setFieldsValue
({
workshopPics
:
[...
workshopPics
,
url
]
})
}
/**
* 添加荣誉图片
* @param url
*/
const
handleAddhonorPics
=
(
url
:
string
)
=>
{
setHonorPics
([...
honorPics
,
url
])
form
.
setFieldsValue
({
honorPics
:
[...
honorPics
,
url
]
})
}
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
// let selectItem = allMallList.filter(item => item.id === mallId)
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
null
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
}
else
{
setStoreUrl
(
null
)
}
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
const
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
let
newSiteUrl
=
siteUrl
if
(
newSiteUrl
.
indexOf
(
'http'
)
<
0
)
{
newSiteUrl
=
`http://`
+
newSiteUrl
}
switch
(
mallItem
.
type
)
{
case
1
:
result
=
`
${
newSiteUrl
}
/shop?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
case
2
:
result
=
`
${
newSiteUrl
}
/shop/pointsMall?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
default
:
result
=
""
break
}
}
else
{
result
=
""
}
return
result
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
:
null
}
return
null
}
return
(
<
PageHeaderWrapper
>
<
Prompt
when=
{
formIsHalfFilledOut
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
<
div
className=
{
styles
.
shop_info
}
>
<
Form
form=
{
form
}
className=
{
styles
.
add_template_form
}
hideRequiredMark=
{
true
}
onValuesChange=
{
handleFormValueChange
}
>
<
Form
.
Item
labelAlign=
"left"
name=
"memberShopAreas"
label=
{
<
RequireItem
label=
"归属地市"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择归属地市"
}]
}
>
<
CitySelect
selectData=
{
selectCityData
}
onAdd=
{
handleAddNewCitySelect
}
onReduce=
{
handleReduceCitySelect
}
onChange=
{
handleCityChange
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"logo"
label=
{
<
RequireItem
label=
"公司LOGO"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请上传公司LOGO"
}]
}
>
<
UploadImage
imgUrl=
{
logo
}
fileMaxSize=
{
50
}
size=
"275*50"
onChange=
{
(
val
)
=>
{
setLogo
(
val
)
form
.
setFieldsValue
({
logo
:
val
})
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"describe"
label=
{
<
RequireItem
label=
"公司简介"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入公司简介"
}]
}
>
<
Input
.
TextArea
allowClear
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"请输入公司简介"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"workshopPics"
label=
{
<
RequireItem
label=
"厂房照片"
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
workshopPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteWorkShopImgItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
div
className=
{
styles
.
upload_img
}
style=
{
{
backgroundImage
:
`url(${item})`
}
}
/>
</
div
>
))
}
</
div
>
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"600x400"
onChange=
{
(
url
)
=>
handleAddworkshopPics
(
url
)
}
/>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"honorPics"
label=
{
<
RequireItem
label=
"资质荣誉"
brief=
{
<
Tooltip
placement=
"top"
title=
"如商标注册证书、品牌授权证书等证明材料"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
honorPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteHonorPicsItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
img
className=
{
styles
.
upload_img
}
src=
{
item
}
/>
</
div
>
))
}
</
div
>
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"106x107"
onChange=
{
(
url
)
=>
handleAddhonorPics
(
url
)
}
/>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"shopId"
label=
{
<
RequireItem
label=
"店铺链接"
/>
}
// rules={[{ required: true, message: "请输入客服链接" }]}
>
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
{
getSelectMallStoreUrl
()
}
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"customerUrl"
label=
{
<
RequireItem
label=
"客服链接"
/>
}
rules=
{
[{
pattern
:
/
(
http|ftp|https
)
:
\/\/[\w\-
_
]
+
(\.[\w\-
_
]
+
)
+
([\w\-
.,@?^=%&:
/
~+#
]
*
[\w\-
@?^=%&
/
~+#
])?
/
,
message
:
'请输入正确的客服链接'
}]
}
>
<
Input
allowClear
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
{
<
RequireItem
label=
""
/>
}
>
<
Button
type=
"primary"
style=
{
{
marginRight
:
16
}
}
onClick=
{
handleSave
}
>
保存
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
</
PageHeaderWrapper
>
)
}
export
default
inject
(
'SiteStore'
)(
ShopInfo
)
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
Form
,
Input
,
Button
,
Tooltip
,
Select
,
message
}
from
'antd'
import
{
Prompt
}
from
'umi'
import
{
inject
}
from
'mobx-react'
import
{
QuestionCircleOutlined
,
DeleteOutlined
,
CopyOutlined
}
from
'@ant-design/icons'
import
CitySelect
from
'@/components/CitySelect'
import
RequireItem
from
'@/components/RequireItem'
import
{
PublicApi
}
from
'@/services/api'
import
UploadImage
from
'@/components/UploadImage'
import
{
GetTemplateShopFindShopResponse
}
from
'@/services/TemplateApi'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
styles
from
'./index.less'
import
{
getAuth
}
from
'@/utils/auth'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
interface
ShopInfoPropsType
{
SiteStore
:
{
siteUrl
:
string
;
siteId
:
number
;
}
}
const
defaultCityData
=
{
index
:
0
,
provinceCode
:
0
,
province
:
''
,
cityCode
:
0
,
city
:
''
}
const
ShopInfo
:
React
.
FC
<
ShopInfoPropsType
>
=
(
props
)
=>
{
const
{
siteUrl
,
siteId
}
=
props
.
SiteStore
const
[
formIsHalfFilledOut
,
setFormIsHalfFilledOut
]
=
useState
(
false
)
const
[
form
]
=
Form
.
useForm
()
const
[
allMallList
,
setAllMallList
]
=
useState
([])
const
[
storeUrl
,
setStoreUrl
]
=
useState
<
string
>
(
''
)
const
[
selectCityData
,
setSelectCityData
]
=
useState
<
any
>
([
defaultCityData
])
const
[
workshopPics
,
setWorkshopPics
]
=
useState
([])
// 厂房照片
const
[
honorPics
,
setHonorPics
]
=
useState
([])
// 资质荣誉
const
[
logo
,
setLogo
]
=
useState
<
string
>
(
""
)
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplateShopFindShopResponse
>
()
const
[
shopId
,
setShopId
]
=
useState
<
number
>
()
useEffect
(()
=>
{
fetchShopInfo
()
fetchAllShop
()
},
[])
// 根据站点获取商城信息
const
fetchAllShop
=
()
=>
{
const
param
:
any
=
{
siteId
,
type
:
1
}
PublicApi
.
getManageShopFindShopsBySiteId
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAllMallList
(
res
.
data
)
}
})
}
/**
* 获取店铺信息
*/
const
fetchShopInfo
=
()
=>
{
const
{
memberId
,
memberRoleId
}
=
getAuth
()
||
{}
const
param
:
any
=
{
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateWebMemberShopWebFindCurrMemberShop
(
param
).
then
(
res
=>
{
const
data
=
res
.
data
if
(
res
.
code
===
1000
)
{
setShopInfo
(
data
)
setSelectCityData
(
initMemberShopArea
(
data
.
memberShopAreas
))
setLogo
(
data
.
logo
)
setShopId
(
data
.
shopId
)
setWorkshopPics
(
data
.
workshopPics
||
[])
setHonorPics
(
data
.
honorPics
||
[])
if
(
data
.
shopId
&&
data
.
memberId
)
{
setStoreUrl
(
data
.
storeUrl
||
""
)
}
form
.
setFieldsValue
({
describe
:
data
.
describe
,
customerUrl
:
data
.
customerUrl
,
logo
:
data
.
logo
,
memberShopAreas
:
initMemberShopArea
(
data
.
memberShopAreas
),
workshopPics
:
data
.
workshopPics
||
[],
honorPics
:
data
.
honorPics
||
[]
})
}
})
}
const
initMemberShopArea
=
(
data
)
=>
{
if
(
!
isEmpty
(
data
))
{
return
data
.
map
((
item
,
index
)
=>
{
item
.
index
=
index
return
item
})
}
else
{
return
[
defaultCityData
]
}
}
const
handleAddNewCitySelect
=
(
item
:
any
)
=>
{
const
temp
=
[...
selectCityData
]
temp
.
push
(
item
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
memberShopAreas
:
temp
})
}
const
handleReduceCitySelect
=
(
index
:
number
)
=>
{
let
temp
=
JSON
.
parse
(
JSON
.
stringify
(
selectCityData
))
temp
=
temp
.
filter
((
item
:
any
)
=>
item
.
index
!==
index
)
setSelectCityData
(
temp
)
form
.
setFieldsValue
({
memberShopAreas
:
temp
})
}
const
handleCityChange
=
(
data
:
any
)
=>
{
setSelectCityData
(
data
)
form
.
setFieldsValue
({
memberShopAreas
:
data
})
}
const
handleDeleteWorkShopImgItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
workshopPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setWorkshopPics
(
result
)
form
.
setFieldsValue
({
workshopPics
:
result
})
}
const
handleDeleteHonorPicsItem
=
(
itemInfo
:
any
)
=>
{
let
result
=
[...
honorPics
]
result
=
result
.
filter
(
item
=>
item
!==
itemInfo
)
setHonorPics
(
result
)
form
.
setFieldsValue
({
honorPics
:
result
})
}
const
handleSave
=
(
e
:
any
)
=>
{
e
.
preventDefault
()
form
.
validateFields
().
then
((
value
:
any
)
=>
{
if
(
!
checkMemberShopAreas
(
value
.
memberShopAreas
))
{
return
}
if
(
!
shopId
)
{
message
.
error
(
"店铺链接不能为空"
)
return
}
value
.
storeUrl
=
storeUrl
||
`
${
siteUrl
}
/shop`
value
.
shopId
=
shopId
PublicApi
.
postTemplateWebMemberShopWebSaveCurrMemberShop
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
setFormIsHalfFilledOut
(
false
)
}
})
})
}
const
checkMemberShopAreas
=
(
shopAreas
)
=>
{
if
(
isEmpty
(
shopAreas
))
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
return
shopAreas
.
every
(
item
=>
{
if
(
!
item
.
provinceCode
)
{
message
.
destroy
()
message
.
error
(
'请选择归属地市'
)
return
false
}
else
{
return
true
}
})
}
const
handleCopyLinke
=
(
link
:
string
)
=>
{
if
(
copy
(
link
))
{
message
.
success
(
'复制成功!'
)
}
}
/**
* 添加厂房照片
* @param url
*/
const
handleAddworkshopPics
=
(
url
:
string
)
=>
{
setWorkshopPics
([...
workshopPics
,
url
])
form
.
setFieldsValue
({
workshopPics
:
[...
workshopPics
,
url
]
})
}
/**
* 添加荣誉图片
* @param url
*/
const
handleAddhonorPics
=
(
url
:
string
)
=>
{
setHonorPics
([...
honorPics
,
url
])
form
.
setFieldsValue
({
honorPics
:
[...
honorPics
,
url
]
})
}
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
// let selectItem = allMallList.filter(item => item.id === mallId)
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
null
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
}
else
{
setStoreUrl
(
null
)
}
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
const
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
let
newSiteUrl
=
siteUrl
if
(
newSiteUrl
.
indexOf
(
'http'
)
<
0
)
{
newSiteUrl
=
`http://`
+
newSiteUrl
}
switch
(
mallItem
.
type
)
{
case
1
:
result
=
`
${
newSiteUrl
}
/shop?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
case
2
:
result
=
`
${
newSiteUrl
}
/shop/pointsMall?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
id
,
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}))}
`
break
default
:
result
=
""
break
}
}
else
{
result
=
""
}
return
result
}
const
handleFormValueChange
=
()
=>
{
setFormIsHalfFilledOut
(
true
)
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
const
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
:
null
}
return
null
}
return
(
<
PageHeaderWrapper
>
<
Prompt
when=
{
formIsHalfFilledOut
}
message=
"您还有未保存的内容,是否确定要离开?"
/>
<
div
className=
{
styles
.
shop_info
}
>
<
Form
form=
{
form
}
className=
{
styles
.
add_template_form
}
hideRequiredMark=
{
true
}
onValuesChange=
{
handleFormValueChange
}
>
<
Form
.
Item
labelAlign=
"left"
name=
"memberShopAreas"
label=
{
<
RequireItem
label=
"归属地市"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请选择归属地市"
}]
}
>
<
CitySelect
selectData=
{
selectCityData
}
onAdd=
{
handleAddNewCitySelect
}
onReduce=
{
handleReduceCitySelect
}
onChange=
{
handleCityChange
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"logo"
label=
{
<
RequireItem
label=
"公司LOGO"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请上传公司LOGO"
}]
}
>
<
UploadImage
imgUrl=
{
logo
}
fileMaxSize=
{
50
}
size=
"275*50"
onChange=
{
(
val
)
=>
{
setLogo
(
val
)
form
.
setFieldsValue
({
logo
:
val
})
}
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"describe"
label=
{
<
RequireItem
label=
"公司简介"
isRequire=
{
true
}
/>
}
rules=
{
[{
required
:
true
,
message
:
"请输入公司简介"
}]
}
>
<
Input
.
TextArea
rows=
{
5
}
className=
{
styles
.
form_item
}
placeholder=
"请输入公司简介"
maxLength=
{
200
}
/>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"workshopPics"
label=
{
<
RequireItem
label=
"厂房照片"
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
workshopPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteWorkShopImgItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
div
className=
{
styles
.
upload_img
}
style=
{
{
backgroundImage
:
`url(${item})`
}
}
/>
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"600x400"
onChange=
{
(
url
)
=>
handleAddworkshopPics
(
url
)
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"honorPics"
label=
{
<
RequireItem
label=
"资质荣誉"
brief=
{
<
Tooltip
placement=
"top"
title=
"如商标注册证书、品牌授权证书等证明材料"
><
QuestionCircleOutlined
/></
Tooltip
>
}
/>
}
>
<
div
className=
{
styles
.
form_item_wrap
}
>
<
div
className=
{
styles
.
img_list
}
>
{
honorPics
.
map
((
item
,
index
)
=>
(
<
div
key=
{
index
}
className=
{
cx
(
styles
.
upload_btn
,
styles
.
large
,
styles
.
upload
)
}
>
<
div
className=
{
styles
.
delete_btn
}
onClick=
{
()
=>
handleDeleteHonorPicsItem
(
item
)
}
><
DeleteOutlined
/></
div
>
<
img
className=
{
styles
.
upload_img
}
src=
{
item
}
/>
</
div
>
))
}
<
UploadImage
imgUrl=
{
""
}
large=
{
true
}
fileMaxSize=
{
100
}
size=
"106x107"
onChange=
{
(
url
)
=>
handleAddhonorPics
(
url
)
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"shopId"
label=
{
<
RequireItem
label=
"店铺链接"
/>
}
// rules={[{ required: true, message: "请输入客服链接" }]}
>
<
Select
allowClear
value=
{
shopId
}
className=
{
styles
.
form_item
}
onChange=
{
handleMallSelectChange
}
>
{
allMallList
.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
{
getSelectMallStoreUrl
()
}
</
Form
.
Item
>
<
Form
.
Item
labelAlign=
"left"
name=
"customerUrl"
label=
{
<
RequireItem
label=
"客服链接"
/>
}
rules=
{
[{
pattern
:
/
(
http|ftp|https
)
:
\/\/[\w\-
_
]
+
(\.[\w\-
_
]
+
)
+
([\w\-
.,@?^=%&:
/
~+#
]
*
[\w\-
@?^=%&
/
~+#
])?
/
,
message
:
'请输入正确的客服链接'
}]
}
>
<
Input
allowClear
className=
{
styles
.
form_item
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
{
<
RequireItem
label=
""
/>
}
>
<
Button
type=
"primary"
style=
{
{
marginRight
:
16
}
}
onClick=
{
handleSave
}
>
保存
</
Button
>
</
Form
.
Item
>
</
Form
>
</
div
>
</
PageHeaderWrapper
>
)
}
export
default
inject
(
'SiteStore'
)(
ShopInfo
)
src/pages/systemSetting/message/index.less
View file @
7f7cc051
.customList{
:global{
.ant-list-item-meta{
align-items: center;
}
}
.messageText{
font-size: 14px;
font-weight: 400;
// color: #606266;
cursor: pointer;
}
.messageTitle{
margin: 0px 0px 0px 30px;
font-size: 14px;
font-weight: 500;
// color: #303133;
display: inline-block;
cursor: pointer;
}
}
.customList{
:global{
.ant-list-item-meta{
align-items: center;
}
}
.messageText{
font-size: 14px;
font-weight: 400;
// color: #606266;
cursor: pointer;
}
.messageTitle{
margin: 0px 0px 0px 30px;
font-size: 14px;
font-weight: 500;
// color: #303133;
display: inline-block;
cursor: pointer;
}
.time {
margin-left: 20px;
}
.section {
margin-left: 20px;
display: flex;
flex-direction: row;
align-items: center;
}
}
src/pages/systemSetting/message/index.tsx
View file @
7f7cc051
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Card
,
List
,
Avatar
}
from
'antd'
;
import
{
Card
,
List
,
Avatar
,
Button
}
from
'antd'
;
import
styles
from
'./index.less'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
StatusTag
from
'@/components/StatusTag'
;
...
...
@@ -8,42 +8,33 @@ import { PublicApi } from '@/services/api';
import
moment
from
'moment'
;
import
msg_system
from
'@/assets/imgs/msg_system.png'
import
msg_platform
from
'@/assets/imgs/msg_platform.png'
;
import
{
BookOutlined
,
ReadOutlined
}
from
'@ant-design/icons'
;
const
Message
:
React
.
FC
<
{}
>
=
()
=>
{
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
(
[]
)
const
pagation
=
{
const
[
dataSource
,
setDataSource
]
=
useState
<
any
>
(
{
totalCount
:
0
,
data
:
[]}
)
const
[
pagination
,
setPagination
]
=
useState
(
{
current
:
1
,
pageSize
:
10
,
}
}
)
useEffect
(()
=>
{
// @ts-ignore
async
function
init
()
{
const
data
=
await
getList
(
pagation
);
setDataSource
(
data
);
}
init
()
getList
(
pagination
)
},
[])
const
getList
=
async
(
params
)
=>
{
///report/message/member/page
const
res
=
await
PublicApi
.
getReportMessageMemberPage
(
params
);
if
(
res
.
code
===
1000
)
{
return
res
.
data
}
return
{
totalCount
:
0
,
data
:
[]
}
const
getList
=
(
params
)
=>
{
PublicApi
.
getReportMessageMemberPage
(
params
).
then
(({
data
,
code
})
=>
{
if
(
code
===
1000
)
{
setDataSource
(
data
)
}
})
}
const
handlePaginationChange
=
(
page
,
pageSize
)
=>
{
getList
({
page
,
pageSize
})
.
then
((
data
)
=>
{
console
.
log
(
data
);
setDataSource
(
data
);
})
setPagination
({
current
:
page
,
pageSize
});
getList
({
current
:
page
,
pageSize
})
}
const
handleRead
=
(
id
,
url
:
string
)
=>
{
...
...
@@ -56,14 +47,17 @@ const Message: React.FC<{}> = () => {
}
else
{
history
.
push
(
url
);
}
}
else
{
getList
(
pagination
);
}
})
}
const
renderMessage
=
(
data
)
=>
{
const
type
=
data
.
type
return
(
<>
<
StatusTag
type=
{
data
.
type
==
1
?
'primary'
:
'success'
}
title=
{
data
.
type
==
1
?
'系统消息'
:
'平台消息'
}
/>
<
StatusTag
type=
{
type
==
1
?
'primary'
:
'success'
}
title=
{
type
==
1
?
'系统消息'
:
'平台消息'
}
/>
<
span
className=
{
styles
.
messageTitle
}
style=
{
{
minWidth
:
'100px'
,
fontWeight
:
600
,
color
:
!
data
.
status
?
'#303133'
:
'#606266'
,
marginRight
:
"15px"
}
}
>
{
data
.
title
}
</
span
>
<
span
className=
{
styles
.
messageText
}
style=
{
{
color
:
!
data
.
status
?
'#303133'
:
'#606266'
,
marginRight
:
"15px"
}
}
onClick=
{
()
=>
handleRead
(
data
.
id
,
data
.
url
)
}
>
{
data
.
content
}
</
span
>
</>
...
...
@@ -78,6 +72,9 @@ const Message: React.FC<{}> = () => {
<
PageHeaderWrapper
>
<
Card
title=
"消息列表"
extra=
{
(
<
div
><
Button
>
全部已读
</
Button
></
div
>
)
}
>
<
List
itemLayout=
"horizontal"
...
...
@@ -89,7 +86,8 @@ const Message: React.FC<{}> = () => {
size
:
"small"
,
showQuickJumper
:
true
,
total
:
dataSource
.
totalCount
,
showTotal
:
showTotal
showTotal
:
showTotal
,
current
:
pagination
.
current
}
}
renderItem=
{
(
item
:
any
)
=>
(
<
List
.
Item
>
...
...
@@ -97,7 +95,16 @@ const Message: React.FC<{}> = () => {
avatar=
{
<
Avatar
src=
{
item
.
type
==
1
?
msg_system
:
msg_platform
}
/>
}
title=
{
renderMessage
(
item
)
}
/>
<
div
style=
{
{
marginLeft
:
"25px"
}
}
>
{
moment
(
item
.
sendTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
div
>
<
div
className=
{
styles
.
section
}
>
{
item
.
status
===
0
?
<
BookOutlined
style=
{
{
fontSize
:
'20px'
,
color
:
'#909090'
}
}
/>
:
<
ReadOutlined
style=
{
{
fontSize
:
'24px'
,
color
:
'#909090'
}
}
/>
}
<
span
className=
{
styles
.
time
}
>
{
moment
(
item
.
sendTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
</
span
>
</
div
>
</
List
.
Item
>
)
}
/>
...
...
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