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
黄庭坚
jinfa-platform
Commits
4f1574be
Commit
4f1574be
authored
Dec 25, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改店铺和渠道相关接口路径
parent
3ed824e3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
230 additions
and
232 deletions
+230
-232
MenuSlider.less
src/layouts/styles/MenuSlider.less
+1
-0
index.tsx
src/pages/channel/channelInfo/index.tsx
+4
-4
index.tsx
src/pages/channel/channelTemplate/index.tsx
+2
-2
index.tsx
src/pages/editor/channelEdit/index.tsx
+5
-5
index.tsx
...ngsPanel/propsSettings/components/AdvertSetting/index.tsx
+2
-2
index.tsx
...ingsPanel/propsSettings/components/BrandSetting/index.tsx
+6
-6
index.tsx
...opsSettings/components/CategoryreCommendSetting/index.tsx
+9
-9
index.tsx
...ingsPanel/propsSettings/components/GoodsSetting/index.tsx
+6
-8
index.tsx
src/pages/editor/shopEdit/index.tsx
+5
-5
index.tsx
src/pages/lxMall/channel/index.tsx
+6
-6
index.tsx
...ages/lxMall/commodityDetail/components/ShopInfo/index.tsx
+1
-1
index.tsx
src/pages/lxMall/components/ChannelHeader/index.tsx
+3
-3
index.tsx
...ges/lxMall/components/Filter/components/NewJoin/index.tsx
+3
-3
index.tsx
src/pages/lxMall/components/Recommand/index.tsx
+3
-3
index.tsx
src/pages/lxMall/components/ShopHeader/index.tsx
+1
-1
LXChannelLayout.tsx
src/pages/lxMall/layouts/LXChannelLayout.tsx
+3
-3
LXIChannelLayout.tsx
src/pages/lxMall/layouts/LXIChannelLayout.tsx
+3
-3
LXShopLayout.tsx
src/pages/lxMall/layouts/LXShopLayout.tsx
+0
-1
index.tsx
src/pages/lxMall/purchaseOrder/index.tsx
+2
-2
index.tsx
src/pages/lxMall/shop/index.tsx
+4
-4
index.tsx
src/pages/lxMall/shopAbout/index.tsx
+7
-7
index.tsx
src/pages/lxMall/shopList/index.tsx
+4
-4
list.tsx
src/pages/lxMall/shopList/list.tsx
+1
-1
index.tsx
src/pages/preview/channelPreview/index.tsx
+5
-5
index.tsx
src/pages/preview/shopPreview/index.tsx
+0
-0
index.tsx
src/pages/shop/shopTemplate/index.tsx
+1
-1
shops.tsx
src/pages/systemSetting/collection/shops.tsx
+143
-143
No files found.
src/layouts/styles/MenuSlider.less
View file @
4f1574be
...
...
@@ -57,6 +57,7 @@
.wrapperSilder {
background-color: #38414A !important;
min-height: 100vh;
.menuBox {
padding: 0;
...
...
src/pages/channel/channelInfo/index.tsx
View file @
4f1574be
...
...
@@ -12,7 +12,7 @@ import { MALL_TYPE } from '@/constants'
import
copy
from
'copy-to-clipboard'
import
cx
from
'classnames'
import
styles
from
'./index.less'
import
{
GetTemplate
ChannelFind
ChannelResponse
}
from
'@/services/TemplateApi'
import
{
GetTemplate
WebMemberChannelWebFindCurrMember
ChannelResponse
}
from
'@/services/TemplateApi'
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
import
{
GlobalConfig
}
from
'@/global/config'
import
{
getAuth
}
from
'@/utils/auth'
...
...
@@ -37,7 +37,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const
[
workshopPics
,
setWorkshopPics
]
=
useState
([])
// 厂房照片
const
[
honorPics
,
setHonorPics
]
=
useState
([])
// 资质荣誉
const
[
logo
,
setLogo
]
=
useState
<
string
>
(
""
)
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplate
ChannelFind
ChannelResponse
>
()
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplate
WebMemberChannelWebFindCurrMember
ChannelResponse
>
()
const
[
shopId
,
setShopId
]
=
useState
<
number
>
()
useEffect
(()
=>
{
...
...
@@ -66,7 +66,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const
param
:
any
=
{
memberId
}
PublicApi
.
getTemplate
ChannelFind
Channel
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
WebMemberChannelWebFindCurrMember
Channel
(
param
).
then
(
res
=>
{
const
data
=
res
.
data
if
(
res
.
code
===
1000
)
{
setShopInfo
(
data
)
...
...
@@ -156,7 +156,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
value
.
shopId
=
shopId
setConfirmLoading
(
true
)
PublicApi
.
postTemplate
ChannelSave
Channel
(
value
).
then
(
res
=>
{
PublicApi
.
postTemplate
WebMemberChannelWebSaveCurrMember
Channel
(
value
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
fetchShopInfo
()
setFormIsHalfFilledOut
(
false
)
...
...
src/pages/channel/channelTemplate/index.tsx
View file @
4f1574be
...
...
@@ -19,11 +19,11 @@ const ShopTemplate: React.FC = () => {
PublicApi
.
getTemplateWebPageTemplateWebFindAllShelfChannelTemplate
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTemplateList
(
res
.
data
)
}
else
if
(
res
.
code
===
47001
)
{
}
else
{
message
.
destroy
()
message
.
info
(
"您还未创建渠道商城,请先创建渠道商城"
)
setTimeout
(()
=>
{
history
.
push
(
'/memberCenter/channe
k
Ability/infoManage'
)
history
.
push
(
'/memberCenter/channe
l
Ability/infoManage'
)
},
2000
);
}
})
...
...
src/pages/editor/channelEdit/index.tsx
View file @
4f1574be
...
...
@@ -53,7 +53,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
...
...
@@ -71,7 +71,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
...
...
@@ -89,7 +89,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const
params
:
any
=
{
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplateChannelFindAllFirstCategory
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAllFirstCategory
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
@@ -108,7 +108,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplate
ChannelFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebChannelMemberCategoryAdorn
(
param
).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
...
...
@@ -123,7 +123,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const
params
:
any
=
{
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplate
ChannelFind
Channel
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
WebMemberChannelWebFindCurrMember
Channel
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
src/pages/editor/settingsPanel/propsSettings/components/AdvertSetting/index.tsx
View file @
4f1574be
...
...
@@ -255,9 +255,9 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
}
let
postFn
;
if
(
templateType
===
'channel'
)
{
postFn
=
PublicApi
.
postTemplateChannelSaveAdvert
postFn
=
PublicApi
.
postTemplate
AdornWeb
ChannelSaveAdvert
}
else
{
postFn
=
PublicApi
.
postTemplate
Shop
SaveAdvert
postFn
=
PublicApi
.
postTemplate
AdornWebStore
SaveAdvert
}
postFn
(
param
).
then
(
res
=>
{
...
...
src/pages/editor/settingsPanel/propsSettings/components/BrandSetting/index.tsx
View file @
4f1574be
...
...
@@ -88,7 +88,7 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const
handleSearch
=
()
=>
{
setCurrent
(
1
)
le
t
param
=
filterProps
(
form
.
getFieldsValue
())
cons
t
param
=
filterProps
(
form
.
getFieldsValue
())
setFilterParam
(
param
)
}
...
...
@@ -130,13 +130,13 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const
saveBrand
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
param
:
any
=
{
cons
t
param
:
any
=
{
templateId
:
templateid
,
categoryId
:
categoryid
,
}
le
t
ids
:
number
[]
=
[]
cons
t
ids
:
number
[]
=
[]
for
(
le
t
item
of
selectBrandList
)
{
for
(
cons
t
item
of
selectBrandList
)
{
ids
.
push
(
item
.
brandId
)
}
param
.
brandIds
=
ids
...
...
@@ -152,8 +152,8 @@ const BrandSetting: React.FC<ShopSettingPropsType> = (props) => {
const
handleChangeOprationType
=
(
type
:
string
)
=>
{
setOprationType
(
type
)
le
t
keys
:
number
[]
=
[]
for
(
le
t
item
of
selectBrandList
)
{
cons
t
keys
:
number
[]
=
[]
for
(
cons
t
item
of
selectBrandList
)
{
keys
.
push
(
item
.
brandId
)
}
setBrandIds
(
keys
)
...
...
src/pages/editor/settingsPanel/propsSettings/components/CategoryreCommendSetting/index.tsx
View file @
4f1574be
...
...
@@ -40,23 +40,23 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
},
[])
const
initSelectKeys
=
()
=>
{
le
t
result
:
number
[]
=
[]
for
(
le
t
item
of
categoryList
)
{
cons
t
result
:
number
[]
=
[]
for
(
cons
t
item
of
categoryList
)
{
result
.
push
(
item
.
categoryId
)
}
setSelectKeys
(
result
)
}
const
fetchCategoryList
=
()
=>
{
le
t
param
=
{
cons
t
param
=
{
categoryId
:
categoryid
,
templateId
:
templateid
}
let
getFn
;
if
(
templateType
===
'channel'
)
{
getFn
=
PublicApi
.
getTemplateChannelFindCategoryList
getFn
=
PublicApi
.
getTemplate
AdornWeb
ChannelFindCategoryList
}
else
{
getFn
=
PublicApi
.
getTemplate
Shop
FindCategoryList
getFn
=
PublicApi
.
getTemplate
AdornWebStore
FindCategoryList
}
//@ts-ignore
...
...
@@ -68,7 +68,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
const
handleSecondCategoryChange
=
(
keys
:
any
)
=>
{
setSelectKeys
(
keys
)
le
t
result
=
categoryResponseList
.
filter
(
item
=>
keys
.
includes
(
item
.
categoryId
))
cons
t
result
=
categoryResponseList
.
filter
(
item
=>
keys
.
includes
(
item
.
categoryId
))
changeNewProps
(
'categoryList'
,
result
)
}
...
...
@@ -108,7 +108,7 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
message
.
error
(
'最多推荐4个二级品类'
)
return
}
le
t
param
=
{
cons
t
param
=
{
templateId
:
templateid
,
categoryId
:
categoryid
,
categoryAdvertPicUrl
,
...
...
@@ -116,9 +116,9 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
}
let
postFn
;
if
(
templateType
===
'channel'
)
{
postFn
=
PublicApi
.
postTemplateChannelSaveCategory
postFn
=
PublicApi
.
postTemplate
AdornWeb
ChannelSaveCategory
}
else
{
postFn
=
PublicApi
.
postTemplate
Shop
SaveCategory
postFn
=
PublicApi
.
postTemplate
AdornWebStore
SaveCategory
}
//@ts-ignore
postFn
(
param
).
then
(
res
=>
{
...
...
src/pages/editor/settingsPanel/propsSettings/components/GoodsSetting/index.tsx
View file @
4f1574be
...
...
@@ -60,7 +60,7 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
current
:
1
,
pageSize
:
100
}
PublicApi
.
getTemplate
Shop
FindCategoryList
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindCategoryList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
data
=
res
.
data
setCategoryResponseList
(
data
.
categoryBOList
||
[])
...
...
@@ -73,10 +73,8 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
type
:
2
,
templateId
:
templateid
,
categoryId
:
categoryid
,
current
:
1
,
pageSize
:
100
}
PublicApi
.
getTemplate
Shop
FindBrandList
(
param
).
then
((
res
:
any
)
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindBrandList
(
param
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
1000
)
{
const
dataInfo
=
res
.
data
setNoSelectBrands
(
dataInfo
.
data
||
[])
...
...
@@ -102,9 +100,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
}
let
getFn
;
if
(
templateType
===
'channel'
)
{
getFn
=
PublicApi
.
getTemplateChannelFindGoodsList
getFn
=
PublicApi
.
getTemplate
AdornWeb
ChannelFindGoodsList
}
else
{
getFn
=
PublicApi
.
getTemplate
Shop
FindGoodsList
getFn
=
PublicApi
.
getTemplate
AdornWebStore
FindGoodsList
}
setSpinLoading
(
true
)
...
...
@@ -235,9 +233,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
let
postFn
;
if
(
templateType
===
'channel'
)
{
postFn
=
PublicApi
.
postTemplateChannelSaveGoods
postFn
=
PublicApi
.
postTemplate
AdornWeb
ChannelSaveGoods
}
else
{
postFn
=
PublicApi
.
postTemplate
Shop
SaveGoods
postFn
=
PublicApi
.
postTemplate
AdornWebStore
SaveGoods
}
postFn
(
param
).
then
(
res
=>
{
...
...
src/pages/editor/shopEdit/index.tsx
View file @
4f1574be
...
...
@@ -55,7 +55,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId
:
memberRoleId
}
PublicApi
.
getTemplate
Shop
FindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
...
...
@@ -74,7 +74,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId
:
memberRoleId
}
PublicApi
.
getTemplate
Shop
FindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
...
...
@@ -93,7 +93,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplate
Shop
FindAllFirstCategory
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindAllFirstCategory
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
@@ -113,7 +113,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
roleId
:
memberRoleId
}
PublicApi
.
getTemplate
ShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStoreMemberCategoryAdorn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
@@ -127,7 +127,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
const
fetchShopInfo
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
const
param
:
any
=
{
memberId
,
memberId
,
roleId
:
memberRoleId
}
PublicApi
.
getTemplateShopFindShop
(
param
).
then
(
res
=>
{
...
...
src/pages/lxMall/channel/index.tsx
View file @
4f1574be
...
...
@@ -8,7 +8,7 @@ import AboutUs from '../components/AboutUs'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
PublicApi
}
from
'@/services/api'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
{
GetTemplatePlatformFindAllFirstCategoryResponse
,
GetTemplate
ChannelFind
ChannelResponse
}
from
'@/services/TemplateApi'
import
{
GetTemplatePlatformFindAllFirstCategoryResponse
,
GetTemplate
WebMemberChannelWebFindCurrMember
ChannelResponse
}
from
'@/services/TemplateApi'
import
{
GlobalConfig
}
from
'@/global/config'
import
styles
from
'./index.less'
...
...
@@ -17,7 +17,7 @@ interface ChannelIndexPropsType {
memberId
:
number
;
shopId
:
number
;
shopUrlParam
:
string
;
shopInfo
:
GetTemplate
ChannelFind
ChannelResponse
;
shopInfo
:
GetTemplate
WebMemberChannelWebFindCurrMember
ChannelResponse
;
layoutType
:
LAYOUT_TYPE
}
...
...
@@ -59,7 +59,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setFirstAdvertList
(
res
.
data
)
}
...
...
@@ -73,7 +73,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setSecondAdvertList
(
res
.
data
)
}
...
...
@@ -89,7 +89,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi
.
getTemplateChannelFindAllFirstCategory
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAllFirstCategory
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setCategoryList
(
res
.
data
)
resolve
(
res
.
data
)
...
...
@@ -109,7 +109,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
}
PublicApi
.
getTemplate
ChannelFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebChannelMemberCategoryAdorn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
src/pages/lxMall/commodityDetail/components/ShopInfo/index.tsx
View file @
4f1574be
...
...
@@ -45,7 +45,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
shopId
:
shopInfo
.
id
,
status
}
PublicApi
.
postTemplate
Shop
Collect
(
param
).
then
(
res
=>
{
PublicApi
.
postTemplate
WebMemberShopWeb
Collect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
updateShopInfo
()
message
.
destroy
()
...
...
src/pages/lxMall/components/ChannelHeader/index.tsx
View file @
4f1574be
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
import
{
Input
}
from
'antd'
import
{
GetTemplate
ChannelFindChannel
Response
}
from
'@/services/TemplateApi'
import
{
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
}
from
'@/services/TemplateApi'
import
isEmpty
from
'lodash/isEmpty'
import
styles
from
'./index.less'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
{
GlobalConfig
}
from
'@/global/config'
interface
HeaderPropsType
{
shopInfo
:
GetTemplate
ChannelFindChannel
Response
,
shopInfo
:
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
,
id
:
number
,
shopUrlParam
:
string
,
type
:
LAYOUT_TYPE
...
...
@@ -20,7 +20,7 @@ const Header: React.FC<HeaderPropsType> = (props) => {
const
{
search
}
=
history
.
location
.
query
useEffect
(()
=>
{
if
(
!!
search
)
{
if
(
search
)
{
setSearchValue
(
search
)
}
else
{
setSearchValue
(
""
)
...
...
src/pages/lxMall/components/Filter/components/NewJoin/index.tsx
View file @
4f1574be
/*
* 最新加入
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Author: ghua
* @Date: 2020-08-20 16:23:39
* @Last Modified by: ghua
* @Last Modified time: 2020-10-22 17:49:07
*/
...
...
@@ -24,7 +24,7 @@ const NewJoin: React.FC<NewJoinPropsType> = (props) => {
},
[])
const
fetchNewJoinShopList
=
()
=>
{
PublicApi
.
getTemplate
ShopFindNewAdd
Shop
().
then
(
res
=>
{
PublicApi
.
getTemplate
WebMemberShopWebNewAddMember
Shop
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setNewJoinShopList
(
res
.
data
)
}
...
...
src/pages/lxMall/components/Recommand/index.tsx
View file @
4f1574be
...
...
@@ -107,7 +107,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
case
LAYOUT_TYPE
.
channel
:
case
LAYOUT_TYPE
.
ichannel
:
param
.
memberId
=
memberId
getFn
=
PublicApi
.
getTemplateChannelFindAllFirstCategory
getFn
=
PublicApi
.
getTemplate
AdornWeb
ChannelFindAllFirstCategory
break
;
default
:
getFn
=
PublicApi
.
getTemplatePlatformFindAllFirstCategory
...
...
@@ -137,12 +137,12 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
case
LAYOUT_TYPE
.
channel
:
param
.
memberId
=
memberId
templateId
=
shopInfo
.
channelShopTemplateId
getFn
=
PublicApi
.
getTemplate
ChannelFindFirstCategoryDetail
getFn
=
PublicApi
.
getTemplate
AdornWebChannelMemberCategoryAdorn
break
;
case
LAYOUT_TYPE
.
ichannel
:
param
.
memberId
=
memberId
templateId
=
shopInfo
.
channelOwnShopTemplateId
getFn
=
PublicApi
.
getTemplate
ChannelFindFirstCategoryDetail
getFn
=
PublicApi
.
getTemplate
AdornWebChannelMemberCategoryAdorn
break
default
:
getFn
=
PublicApi
.
getTemplatePlatformFindFirstCategoryDetail
...
...
src/pages/lxMall/components/ShopHeader/index.tsx
View file @
4f1574be
...
...
@@ -67,7 +67,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
shopId
:
shopInfo
.
id
,
status
}
PublicApi
.
postTemplate
Shop
Collect
(
param
).
then
(
res
=>
{
PublicApi
.
postTemplate
WebMemberShopWeb
Collect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
updateShopInfo
()
message
.
destroy
()
...
...
src/pages/lxMall/layouts/LXChannelLayout.tsx
View file @
4f1574be
...
...
@@ -9,7 +9,7 @@ import { LAYOUT_TYPE } from "@/constants"
import
{
inject
,
observer
}
from
'mobx-react'
import
TopBar
from
'../components/TopBar'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetTemplate
ChannelFindChannel
Response
}
from
'@/services/TemplateApi'
import
{
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
}
from
'@/services/TemplateApi'
import
SearchShopResult
from
'../components/SearchShopResult'
import
ChannelHeader
from
'../components/ChannelHeader'
import
MainNav
from
'../components/MainNav'
...
...
@@ -30,7 +30,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const
{
children
,
location
}
=
props
const
[
templateName
]
=
useState
<
string
>
(
'theme-channel-science'
)
const
{
channelId
}
=
location
.
query
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplate
ChannelFindChannel
Response
>
()
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
>
()
const
[
query
,
setQuery
]
=
useState
<
any
>
({})
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
...
...
@@ -62,7 +62,7 @@ const LXChannelLayout: React.FC<LXChannelLayoutPropsType> = (props) => {
const
fetchShopInfo
=
(
memberId
)
=>
{
PublicApi
.
getTemplate
ChannelFindChannel
({
memberId
}).
then
(
res
=>
{
PublicApi
.
getTemplate
WebMemberChannelWebMemberChannelMain
({
memberId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
}
...
...
src/pages/lxMall/layouts/LXIChannelLayout.tsx
View file @
4f1574be
...
...
@@ -9,7 +9,7 @@ import { LAYOUT_TYPE } from "@/constants"
import
{
inject
,
observer
}
from
'mobx-react'
import
TopBar
from
'../components/TopBar'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetTemplate
ChannelFindChannel
Response
}
from
'@/services/TemplateApi'
import
{
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
}
from
'@/services/TemplateApi'
import
SearchShopResult
from
'../components/SearchShopResult'
import
ChannelHeader
from
'../components/ChannelHeader'
import
MainNav
from
'../components/MainNav'
...
...
@@ -30,7 +30,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const
{
children
,
location
}
=
props
const
[
templateName
]
=
useState
<
string
>
(
'theme-channel-science'
)
const
{
channelId
}
=
location
.
query
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplate
ChannelFindChannel
Response
>
()
const
[
shopInfo
,
setShopInfo
]
=
useState
<
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
>
()
const
[
query
,
setQuery
]
=
useState
<
any
>
({})
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
...
...
@@ -62,7 +62,7 @@ const LXIChannelLayout: React.FC<LXIChannelLayoutPropsType> = (props) => {
const
fetchShopInfo
=
(
memberId
)
=>
{
PublicApi
.
getTemplate
ChannelFindChannel
({
memberId
}).
then
(
res
=>
{
PublicApi
.
getTemplate
WebMemberChannelWebMemberChannelMain
({
memberId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
}
...
...
src/pages/lxMall/layouts/LXShopLayout.tsx
View file @
4f1574be
...
...
@@ -73,7 +73,6 @@ const LXShopLayout: React.FC<LXMallLayoutPropsType> = (props) => {
param
.
roleId
=
roleId
getShopInfoFn
=
PublicApi
.
getTemplateWebMemberShopWebFindByMemberIdAndRoleId
}
console
.
log
(
param
,
"param"
)
getShopInfoFn
&&
getShopInfoFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
...
...
src/pages/lxMall/purchaseOrder/index.tsx
View file @
4f1574be
...
...
@@ -13,7 +13,7 @@ import ImageBox from '@/components/ImageBox'
import
{
store
}
from
'@/store'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
{
GetSearchShopPurchaseGetPurchaseListResponse
}
from
'@/services/SearchApi'
import
{
GetTemplate
ChannelFindChannel
Response
}
from
'@/services/TemplateApi'
import
{
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
}
from
'@/services/TemplateApi'
import
{
isEmpty
}
from
'lodash'
import
{
getAuth
}
from
'@/utils/auth'
import
{
GlobalConfig
}
from
'@/global/config'
...
...
@@ -21,7 +21,7 @@ import useStoreId from '@/hooks/useStoreId'
interface
PurchaseOrderPropsType
{
layoutType
:
LAYOUT_TYPE
,
shopInfo
:
GetTemplate
ChannelFindChannel
Response
,
shopInfo
:
GetTemplate
WebMemberChannelWebMemberChannelMain
Response
,
shopUrlParam
:
string
,
mallInfo
:
any
,
location
:
any
...
...
src/pages/lxMall/shop/index.tsx
View file @
4f1574be
...
...
@@ -47,7 +47,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
roleId
:
shopInfo
.
roleId
}
PublicApi
.
getTemplate
Shop
FindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setFirstAdvertList
(
res
.
data
)
}
...
...
@@ -62,7 +62,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
roleId
:
shopInfo
.
roleId
}
PublicApi
.
getTemplate
Shop
FindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setSecondAdvertList
(
res
.
data
)
}
...
...
@@ -78,7 +78,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
memberId
,
roleId
:
shopInfo
.
roleId
}
PublicApi
.
getTemplate
Shop
FindAllFirstCategory
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStore
FindAllFirstCategory
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setCategoryList
(
res
.
data
)
resolve
(
res
.
data
)
...
...
@@ -99,7 +99,7 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
roleId
:
shopInfo
.
roleId
}
PublicApi
.
getTemplate
ShopFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebStoreMemberCategoryAdorn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
src/pages/lxMall/shopAbout/index.tsx
View file @
4f1574be
...
...
@@ -34,8 +34,8 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
}
const
handleNext
=
()
=>
{
le
t
imgLength
=
shopInfo
?.
honorPics
.
length
le
t
maxDistance
=
(
imgLength
-
3
)
*
unitDistance
cons
t
imgLength
=
shopInfo
?.
honorPics
.
length
cons
t
maxDistance
=
(
imgLength
-
3
)
*
unitDistance
if
(
maxDistance
>
Math
.
abs
(
offSetLeft
))
{
setOffSetLeft
(
offSetLeft
-
unitDistance
)
...
...
@@ -50,7 +50,7 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
content
:
layoutType
===
LAYOUT_TYPE
.
shop
?
`是否申请成为该店铺会员?`
:
'是否申请成为该渠道所属下级渠道会员?'
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
le
t
param
=
{
cons
t
param
=
{
memberId
:
shopInfo
.
memberId
,
roleId
:
shopInfo
.
roleId
}
...
...
@@ -61,7 +61,7 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
}
else
{
reject
()
}
setApplyLoading
(
false
)
}).
catch
(()
=>
{
setApplyLoading
(
false
)
...
...
@@ -76,12 +76,12 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
}
const
handleCollect
=
()
=>
{
le
t
status
=
!
collectState
le
t
param
=
{
cons
t
status
=
!
collectState
cons
t
param
=
{
shopId
:
shopInfo
.
id
,
status
}
PublicApi
.
postTemplate
Shop
Collect
(
param
).
then
(
res
=>
{
PublicApi
.
postTemplate
WebMemberShopWeb
Collect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
updateShopInfo
()
message
.
destroy
()
...
...
src/pages/lxMall/shopList/index.tsx
View file @
4f1574be
...
...
@@ -12,7 +12,7 @@ import { store } from '@/store'
import
isEmpty
from
'lodash/isEmpty'
import
styles
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetTemplate
ShopFind
ShopListResponseDetail
}
from
'@/services/TemplateApi'
import
{
GetTemplate
WebMemberShopWebMember
ShopListResponseDetail
}
from
'@/services/TemplateApi'
interface
ShopListPropsType
{
location
:
any
...
...
@@ -26,7 +26,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
]
=
useState
<
number
>
(
10
)
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
shopList
,
setShopList
]
=
useState
<
GetTemplate
ShopFind
ShopListResponseDetail
[]
>
([])
const
[
shopList
,
setShopList
]
=
useState
<
GetTemplate
WebMemberShopWebMember
ShopListResponseDetail
[]
>
([])
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
//FILTER_TYPE.activeStores,
const
filterConfig
=
[
FILTER_TYPE
.
category
,
FILTER_TYPE
.
useArea
,
FILTER_TYPE
.
activeStores
,
FILTER_TYPE
.
newJoin
]
...
...
@@ -48,7 +48,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
current
:
currentParam
?
currentParam
:
current
,
pageSize
}
if
(
!!
search
)
{
if
(
search
)
{
param
.
memberName
=
search
}
...
...
@@ -57,7 +57,7 @@ const ShopList: React.FC<ShopListPropsType> = (props) => {
}
setLoading
(
true
)
PublicApi
.
getTemplate
ShopFind
ShopList
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
WebMemberShopWebMember
ShopList
(
param
).
then
(
res
=>
{
setLoading
(
false
)
if
(
res
.
code
===
1000
)
{
setShopList
(
res
.
data
.
data
)
...
...
src/pages/lxMall/shopList/list.tsx
View file @
4f1574be
...
...
@@ -61,7 +61,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
</
div
>
<
div
className=
{
styles
.
shop_list_info_about_item
}
>
<
i
className=
{
styles
.
icon
}
><
img
src=
{
shop_icon
}
/></
i
>
<
span
className=
{
styles
.
red
}
>
{
item
.
registerYears
}
</
span
>
<
span
className=
{
styles
.
red
}
>
{
item
.
registerYears
||
0
}
</
span
>
<
span
>
年
</
span
>
</
div
>
</
div
>
...
...
src/pages/preview/channelPreview/index.tsx
View file @
4f1574be
...
...
@@ -52,7 +52,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
...
...
@@ -70,7 +70,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
...
...
@@ -88,7 +88,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
const
params
:
any
=
{
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplateChannelFindAllFirstCategory
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWeb
ChannelFindAllFirstCategory
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
else
{
...
...
@@ -109,7 +109,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplate
ChannelFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebChannelMemberCategoryAdorn
(
param
).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
...
...
@@ -124,7 +124,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
const
params
:
any
=
{
memberId
:
userInfo
.
memberId
}
PublicApi
.
getTemplate
ChannelFind
Channel
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
WebMemberChannelWebFindCurrMember
Channel
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
src/pages/preview/shopPreview/index.tsx
View file @
4f1574be
This diff is collapsed.
Click to expand it.
src/pages/shop/shopTemplate/index.tsx
View file @
4f1574be
...
...
@@ -19,7 +19,7 @@ const ShopTemplate: React.FC = () => {
PublicApi
.
getTemplateWebPageTemplateWebFindAllShelfShopTemplate
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTemplateList
(
res
.
data
)
}
else
if
(
res
.
code
===
47001
)
{
}
else
{
message
.
destroy
()
message
.
info
(
"您还未创建店铺,请先创建店铺"
)
setTimeout
(()
=>
{
...
...
src/pages/systemSetting/collection/shops.tsx
View file @
4f1574be
import
React
,
{
useEffect
,
useState
}
from
'react'
import
cx
from
'classnames'
import
{
Rate
,
Pagination
,
Modal
,
message
}
from
'antd'
import
{
StarFilled
}
from
'@ant-design/icons'
import
shop_icon
from
'@/assets/imgs/shop_icon.png'
import
credit_icon
from
'@/assets/imgs/credit_icon.png'
import
{
PublicApi
}
from
'@/services/api'
import
moment
from
'moment'
import
styles
from
'./index.less'
const
Shops
:
React
.
FC
=
()
=>
{
const
[
list
,
setList
]
=
useState
([])
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
)
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
useEffect
(()
=>
{
fetchCollectShopList
()
},
[
current
])
/**
* 获取收藏的店铺列表
*/
const
fetchCollectShopList
=
()
=>
{
let
param
=
{
current
,
pageSize
}
//@ts-ignore
PublicApi
.
getTemplate
ShopCollectList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setList
(
res
.
data
.
data
)
setTotalCount
(
res
.
data
.
totalCount
)
}
})
}
const
handleChange
=
(
page
)
=>
{
setCurrent
(
page
)
}
const
handleCancelCollect
=
(
detail
)
=>
{
Modal
.
confirm
({
centered
:
true
,
className
:
styles
.
mallComfirm
,
content
:
`是否要取消收藏?`
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
param
=
{
shopId
:
detail
.
id
,
status
:
false
}
PublicApi
.
postTemplate
ShopCollect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
// fetchPurchaseList()
fetchCollectShopList
()
resolve
()
}
else
{
reject
()
}
}).
catch
(()
=>
{
reject
()
})
})
}
})
}
const
linkToDetail
=
(
detail
)
=>
{
if
(
detail
.
status
===
1
)
{
let
el
=
document
.
createElement
(
'a'
)
el
.
href
=
`/shop?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
detail
.
id
,
memberId
:
detail
.
memberId
}))}
`
;
el
.
target
=
'_blank'
;
el
.
click
()
}
else
{
message
.
destroy
()
message
.
info
(
"该店铺已冻结"
)
}
}
return
(
<>
<
div
className=
{
styles
.
shops_list
}
>
{
list
&&
list
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
shops_list_item
}
key=
{
`shops_list_item_${index}`
}
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
,
styles
.
morehalf
)
}
>
<
div
className=
{
styles
.
shop_header_info
}
>
<
div
className=
{
styles
.
shop_header_info_logo
}
>
<
img
src=
{
item
.
logo
}
/>
</
div
>
<
div
className=
{
styles
.
shop_header_info_content
}
>
<
div
className=
{
styles
.
shop_header_info_content_name
}
onClick=
{
()
=>
linkToDetail
(
item
)
}
>
<
span
>
{
item
.
memberName
}
</
span
>
</
div
>
<
div
className=
{
styles
.
shop_header_info_content_about
}
>
<
div
className=
{
styles
.
shop_header_info_content_about_item
}
>
<
i
className=
{
styles
.
icon
}
><
img
src=
{
shop_icon
}
/></
i
>
<
span
className=
{
styles
.
red
}
>
{
item
.
registerYears
}
</
span
>
<
span
>
年
</
span
>
</
div
>
<
div
className=
{
styles
.
shop_header_info_content_about_item
}
>
<
i
className=
{
styles
.
icon
}
><
img
src=
{
credit_icon
}
/></
i
>
<
span
>
{
item
.
integral
}
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
)
}
>
{
/* <i className={cx(styles.level_icon, styles.level3)}></i> */
}
<
div
className=
{
styles
.
rate_wrap
}
>
<
span
>
满意度:
</
span
>
<
Rate
disabled
defaultValue=
{
item
.
satisfied
}
/>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
)
}
>
<
span
className=
{
styles
.
date
}
>
{
moment
(
item
.
collectTime
).
format
(
"YYYY-MM-DD HH:mm"
)
}
</
span
>
</
div
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
)
}
>
<
div
className=
{
cx
(
styles
.
collection_state
)
}
onClick=
{
()
=>
handleCancelCollect
(
item
)
}
>
<
StarFilled
/>
<
label
>
收藏
</
label
>
</
div
>
</
div
>
</
div
>
))
}
</
div
>
{
totalCount
>
0
&&
(
<
div
className=
{
styles
.
pagination_wrap
}
>
<
Pagination
showSizeChanger=
{
false
}
current=
{
current
}
total=
{
totalCount
}
pageSize=
{
pageSize
}
onChange=
{
handleChange
}
/>
</
div
>
)
}
</>
)
}
export
default
Shops
import
React
,
{
useEffect
,
useState
}
from
'react'
import
cx
from
'classnames'
import
{
Rate
,
Pagination
,
Modal
,
message
}
from
'antd'
import
{
StarFilled
}
from
'@ant-design/icons'
import
shop_icon
from
'@/assets/imgs/shop_icon.png'
import
credit_icon
from
'@/assets/imgs/credit_icon.png'
import
{
PublicApi
}
from
'@/services/api'
import
moment
from
'moment'
import
styles
from
'./index.less'
const
Shops
:
React
.
FC
=
()
=>
{
const
[
list
,
setList
]
=
useState
([])
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
,
setPageSize
]
=
useState
<
number
>
(
10
)
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
useEffect
(()
=>
{
fetchCollectShopList
()
},
[
current
])
/**
* 获取收藏的店铺列表
*/
const
fetchCollectShopList
=
()
=>
{
const
param
:
any
=
{
current
,
pageSize
}
PublicApi
.
getTemplate
WebMemberShopWebCollectList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setList
(
res
.
data
.
data
)
setTotalCount
(
res
.
data
.
totalCount
)
}
})
}
const
handleChange
=
(
page
)
=>
{
setCurrent
(
page
)
}
const
handleCancelCollect
=
(
detail
)
=>
{
Modal
.
confirm
({
centered
:
true
,
className
:
styles
.
mallComfirm
,
content
:
`是否要取消收藏?`
,
onOk
:
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
param
=
{
shopId
:
detail
.
id
,
status
:
false
}
PublicApi
.
postTemplate
WebMemberShopWebCollect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
// fetchPurchaseList()
fetchCollectShopList
()
resolve
()
}
else
{
reject
()
}
}).
catch
(()
=>
{
reject
()
})
})
}
})
}
const
linkToDetail
=
(
detail
)
=>
{
if
(
detail
.
status
===
1
)
{
const
el
=
document
.
createElement
(
'a'
)
el
.
href
=
`/shop?shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
detail
.
id
,
memberId
:
detail
.
memberId
}))}
`
;
el
.
target
=
'_blank'
;
el
.
click
()
}
else
{
message
.
destroy
()
message
.
info
(
"该店铺已冻结"
)
}
}
return
(
<>
<
div
className=
{
styles
.
shops_list
}
>
{
list
&&
list
.
map
((
item
,
index
)
=>
(
<
div
className=
{
styles
.
shops_list_item
}
key=
{
`shops_list_item_${index}`
}
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
,
styles
.
morehalf
)
}
>
<
div
className=
{
styles
.
shop_header_info
}
>
<
div
className=
{
styles
.
shop_header_info_logo
}
>
<
img
src=
{
item
.
logo
}
/>
</
div
>
<
div
className=
{
styles
.
shop_header_info_content
}
>
<
div
className=
{
styles
.
shop_header_info_content_name
}
onClick=
{
()
=>
linkToDetail
(
item
)
}
>
<
span
>
{
item
.
memberName
}
</
span
>
</
div
>
<
div
className=
{
styles
.
shop_header_info_content_about
}
>
<
div
className=
{
styles
.
shop_header_info_content_about_item
}
>
<
i
className=
{
styles
.
icon
}
><
img
src=
{
shop_icon
}
/></
i
>
<
span
className=
{
styles
.
red
}
>
{
item
.
registerYears
}
</
span
>
<
span
>
年
</
span
>
</
div
>
<
div
className=
{
styles
.
shop_header_info_content_about_item
}
>
<
i
className=
{
styles
.
icon
}
><
img
src=
{
credit_icon
}
/></
i
>
<
span
>
{
item
.
integral
}
</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
)
}
>
{
/* <i className={cx(styles.level_icon, styles.level3)}></i> */
}
<
div
className=
{
styles
.
rate_wrap
}
>
<
span
>
满意度:
</
span
>
<
Rate
disabled
defaultValue=
{
item
.
satisfied
}
/>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
)
}
>
<
span
className=
{
styles
.
date
}
>
{
moment
(
item
.
collectTime
).
format
(
"YYYY-MM-DD HH:mm"
)
}
</
span
>
</
div
>
<
div
className=
{
cx
(
styles
.
shops_list_item_item
)
}
>
<
div
className=
{
cx
(
styles
.
collection_state
)
}
onClick=
{
()
=>
handleCancelCollect
(
item
)
}
>
<
StarFilled
/>
<
label
>
收藏
</
label
>
</
div
>
</
div
>
</
div
>
))
}
</
div
>
{
totalCount
>
0
&&
(
<
div
className=
{
styles
.
pagination_wrap
}
>
<
Pagination
showSizeChanger=
{
false
}
current=
{
current
}
total=
{
totalCount
}
pageSize=
{
pageSize
}
onChange=
{
handleChange
}
/>
</
div
>
)
}
</>
)
}
export
default
Shops
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