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
c3e407f1
Commit
c3e407f1
authored
Sep 17, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:新增渠道自由商城
parent
a776fdb9
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
386 additions
and
42 deletions
+386
-42
index.ts
config/channelRoutes/index.ts
+3
-3
router.ts
config/router.ts
+2
-0
index.ts
config/selfchannelRoutes/index.ts
+104
-0
index.ts
src/constants/index.ts
+5
-1
index.tsx
src/pages/channel/channelInfo/index.tsx
+5
-5
index.less
src/pages/channel/components/templateItem/index.less
+8
-0
index.tsx
src/pages/lxMall/commodity/index.tsx
+5
-1
list.tsx
src/pages/lxMall/commodity/list.tsx
+16
-1
search.tsx
src/pages/lxMall/commodity/search.tsx
+16
-5
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+35
-2
index.tsx
src/pages/lxMall/components/Category/index.tsx
+1
-0
index.tsx
src/pages/lxMall/components/ChannelHeader/index.tsx
+19
-3
index.tsx
...pages/lxMall/components/Filter/components/Brand/index.tsx
+6
-1
index.tsx
...es/lxMall/components/Filter/components/Category/index.tsx
+12
-8
index.tsx
...ges/lxMall/components/Filter/components/UseArea/index.tsx
+5
-2
index.tsx
src/pages/lxMall/components/MainNav/index.tsx
+1
-0
index.tsx
src/pages/lxMall/components/SideNav/index.tsx
+3
-0
LXChannelLayout.tsx
src/pages/lxMall/layouts/LXChannelLayout.tsx
+4
-6
LXIChannelLayout.tsx
src/pages/lxMall/layouts/LXIChannelLayout.tsx
+106
-0
index.tsx
src/pages/lxMall/order/index.tsx
+21
-3
index.tsx
src/pages/lxMall/purchaseOrder/index.tsx
+1
-1
index.less
src/pages/shop/components/templateItem/index.less
+8
-0
No files found.
config/channelRoutes/index.ts
View file @
c3e407f1
const
shop
Route
=
{
const
Channel
Route
=
{
path
:
'/channelmall'
,
component
:
'@/pages/lxMall/layouts/LXChannelLayout'
,
routes
:
[
...
...
@@ -100,4 +100,4 @@ const shopRoute = {
],
}
export
default
shopRoute
\ No newline at end of file
export
default
ChannelRoute
\ No newline at end of file
config/router.ts
View file @
c3e407f1
...
...
@@ -3,6 +3,7 @@ import memberCenterRoute from './routes'
import
mallRoute
from
'./mallRoutes'
import
shopRoute
from
'./shopRoutes'
import
channelRoute
from
'./channelRoutes'
import
ichannelRoute
from
'./selfchannelRoutes'
/**
* @description 路由配置页, 更多配置可查看 https://umijs.org/zh-CN/docs/routing#routes
...
...
@@ -50,6 +51,7 @@ const router = [
memberCenterRoute
,
shopRoute
,
channelRoute
,
ichannelRoute
,
mallRoute
,
{
component
:
'@/pages/404'
,
...
...
config/selfchannelRoutes/index.ts
0 → 100644
View file @
c3e407f1
const
selfChannelRoute
=
{
path
:
'/ichannelmall'
,
component
:
'@/pages/lxMall/layouts/LXIChannelLayout'
,
routes
:
[
{
// 店铺(渠道商城)
path
:
`/ichannelmall`
,
name
:
'shopHome'
,
key
:
'shopHome'
,
component
:
'@/pages/lxMall/channel'
,
},
{
// 商品商城
path
:
`/ichannelmall/commodity`
,
name
:
'shopCommodity'
,
key
:
'shopCommodity'
,
component
:
'@/pages/lxMall/commodity'
,
},
{
// 商品详情
path
:
`/ichannelmall/commodity/detail`
,
name
:
'channelCommodityDetail'
,
key
:
'channelCommodityDetail'
,
hide
:
true
,
component
:
'@/pages/lxMall/commodityDetail'
,
},
{
// 商品搜索
path
:
`/ichannelmall/commodity/search`
,
name
:
'channelmallCommoditySearch'
,
key
:
'channelmallCommoditySearch'
,
hide
:
true
,
component
:
'@/pages/lxMall/commodity/search'
,
},
{
// 积分商城
path
:
`/ichannelmall/pointsMall`
,
name
:
'shopPointsMall'
,
key
:
'channelmallPointsMall'
,
component
:
'@/pages/lxMall/pointsMall'
,
},
{
// 资讯
path
:
`/ichannelmall/infomation`
,
name
:
'shopInfomation'
,
key
:
'channelmallInfomation'
,
component
:
'@/pages/lxMall/information'
,
},
{
// 资讯详情
path
:
'/ichannelmall/infomation/detail'
,
name
:
'infomationDetail'
,
key
:
'infomationDetail'
,
hide
:
true
,
component
:
'@/pages/lxMall/information/detail'
,
},
{
// 资讯详情搜索
path
:
'/ichannelmall/infomation/search'
,
name
:
'infomationSearch'
,
key
:
'infomationSearch'
,
hide
:
true
,
component
:
'@/pages/lxMall/information/search'
,
},
{
// 关于我们
path
:
`/ichannelmall/about`
,
name
:
'shopAbout'
,
key
:
'channelmallAbout'
,
component
:
'@/pages/lxMall/shopAbout'
,
},
{
// 进货单
path
:
'/ichannelmall/purchaseOrder'
,
name
:
'purchaseOrder'
,
key
:
'purchaseOrder'
,
hide
:
true
,
hideHeader
:
true
,
component
:
'@/pages/lxMall/purchaseOrder'
,
},
{
// 渠道订单
path
:
`/ichannelmall/order`
,
name
:
'order'
,
key
:
'order'
,
hide
:
true
,
hideHeader
:
true
,
component
:
'@/pages/lxMall/order'
,
},
{
path
:
'/noAuth'
,
component
:
'@/pages/403'
,
},
// 商城页的404
{
component
:
'@/pages/404'
,
},
],
}
export
default
selfChannelRoute
\ No newline at end of file
src/constants/index.ts
View file @
c3e407f1
...
...
@@ -22,6 +22,10 @@ export enum LAYOUT_TYPE {
*/
channel
=
'channel'
,
/**
* 渠道自有商城
*/
ichannel
=
'ichannel'
,
/**
* 企业商城-积分商城
*/
scoreMall
=
'scoreMall'
,
...
...
@@ -338,7 +342,7 @@ export enum OrderModalType {
* 进货单下单
*/
PURCHASE_ORDER
=
5
,
/**
* 手工下单
*/
...
...
src/pages/channel/channelInfo/index.tsx
View file @
c3e407f1
...
...
@@ -234,11 +234,11 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
result
=
`
${
siteUrl
}
/channelmall?channelId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
shopId
,
memberId
:
shopInfo
.
memberId
}))}
`
break
case
4
:
result
=
`
${
siteUrl
}
/channelmall?channelId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
shopId
,
memberId
:
shopInfo
.
memberId
}))}
`
break
case
5
:
result
=
`
${
siteUrl
}
/channelmall/pointsMall?channelId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
shopId
,
memberId
:
shopInfo
.
memberId
}))}
`
result
=
`
${
siteUrl
}
/ichannelmall?channelId=
${
btoa
(
JSON
.
stringify
({
shopId
:
shopInfo
.
shopId
,
memberId
:
shopInfo
.
memberId
}))}
`
break
// case 5:
// result = `${siteUrl}/channelmall/pointsMall?channelId=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`
// break
default
:
result
=
""
break
...
...
@@ -262,7 +262,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
return
resUrl
?
(
<
div
className=
{
styles
.
shop_url
}
>
<
span
>
当前店铺链接:
</
span
>
<
label
>
{
resUrl
}
</
label
>
<
label
title=
{
resUrl
}
>
{
resUrl
}
</
label
>
<
CopyOutlined
className=
{
styles
.
copy_icon
}
onClick=
{
()
=>
handleCopyLinke
(
resUrl
)
}
/>
</
div
>
)
:
null
...
...
src/pages/channel/components/templateItem/index.less
View file @
c3e407f1
...
...
@@ -116,6 +116,8 @@
line-height: 22px;
.template_info_content_text_line {
display: flex;
&:not(:last-child) {
margin-bottom: 8px;
}
...
...
@@ -126,6 +128,12 @@
}
&>span {
flex: 1;
width: 0;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #172B4D;
}
}
...
...
src/pages/lxMall/commodity/index.tsx
View file @
c3e407f1
...
...
@@ -122,10 +122,14 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
param
.
channelMemberId
=
memberId
getFn
=
PublicApi
.
getSearchShopChannelGetCommodityList
break
case
LAYOUT_TYPE
.
ichannel
:
param
.
channelMemberId
=
memberId
getFn
=
PublicApi
.
getSearchShopChannelGetCommodityList
break
}
//@ts-ignore
getFn
(
param
).
then
(
res
=>
{
getFn
&&
getFn
(
param
).
then
(
res
=>
{
setLoading
(
false
)
if
(
res
.
code
===
1000
)
{
setCommodityList
(
res
.
data
.
data
)
...
...
src/pages/lxMall/commodity/list.tsx
View file @
c3e407f1
...
...
@@ -40,7 +40,22 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
default
:
break
}
}
const
getCommodityDetailLink
=
(
item
)
=>
{
let
link
=
""
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
channel
:
link
=
`/channelmall/commodity/detail?id=
${
item
.
id
}
&type=
${
item
.
priceType
}
&channelId=
${
btoa
(
JSON
.
stringify
({
shopId
:
item
.
storeId
,
memberId
:
item
.
memberId
}))}
`
break
case
LAYOUT_TYPE
.
ichannel
:
link
=
`/ichannelmall/commodity/detail?id=
${
item
.
id
}
&type=
${
item
.
priceType
}
&channelId=
${
btoa
(
JSON
.
stringify
({
shopId
:
item
.
storeId
,
memberId
:
item
.
memberId
}))}
`
break
default
:
link
=
`/shop/commodity/detail?id=
${
item
.
id
}
&type=
${
item
.
priceType
}
&shopId=
${
btoa
(
JSON
.
stringify
({
shopId
:
item
.
storeId
,
memberId
:
item
.
memberId
}))}
`
break
}
return
link
}
const
renderItem
=
()
=>
{
...
...
@@ -50,7 +65,7 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
{
commodityList
.
map
((
item
,
index
)
=>
(
<
div
key=
{
`commodity_list_item_${index}`
}
className=
{
cx
(
styles
.
commodity_list_item
,
styles
.
row
)
}
>
<
a
href=
{
`/${layoutType === LAYOUT_TYPE.channel ? 'channelmall' : 'shop'}/commodity/detail?id=${item.id}&type=${item.priceType}&${layoutType === LAYOUT_TYPE.channel ? 'channelId' : 'shopId'}=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
}
target=
"_blank"
>
<
a
href=
{
getCommodityDetailLink
(
item
)
}
target=
"_blank"
>
<
div
className=
{
styles
.
goods_img
}
>
{
item
.
mainPic
?
<
img
src=
{
item
.
mainPic
}
/>
:
<
Skeleton
.
Image
style=
{
{
width
:
220
,
height
:
220
}
}
/>
...
...
src/pages/lxMall/commodity/search.tsx
View file @
c3e407f1
...
...
@@ -20,9 +20,10 @@ import styles from './index.less'
interface
CommodityPropsType
{
location
:
any
,
layoutType
:
LAYOUT_TYPE
.
mall
|
LAYOUT_TYPE
.
shop
|
LAYOUT_TYPE
.
channel
,
layoutType
:
LAYOUT_TYPE
,
shopId
:
number
,
shopUrlParam
:
string
shopUrlParam
:
string
,
memberId
:
number
}
interface
filterQuery
{
...
...
@@ -39,6 +40,7 @@ interface filterQuery {
Max
?:
number
;
priceType
?:
number
;
storeId
?:
number
;
channelMemberId
?:
number
;
}
const
CommoditySearch
:
React
.
FC
<
CommodityPropsType
>
=
(
props
)
=>
{
...
...
@@ -46,7 +48,7 @@ const CommoditySearch: React.FC<CommodityPropsType> = (props) => {
const
FilterStore
=
useLocalStore
(()
=>
store
.
FilterStore
)
const
{
userInfo
}
=
UserStore
const
{
filterList
,
filterUpdate
,
filterParam
,
onDeleteFilterItem
,
onResetFilter
,
onFilterParamChange
}
=
FilterStore
const
{
layoutType
,
shopId
,
shopUrlParam
}
=
props
const
{
layoutType
,
shopId
,
shopUrlParam
,
memberId
}
=
props
const
{
query
:
{
search
=
""
}
}
=
props
.
location
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
true
)
const
[
showType
,
setShowType
]
=
useState
<
number
>
(
1
)
// 展示方式:1:矩阵排列; 2:列表排列
...
...
@@ -103,12 +105,17 @@ const CommoditySearch: React.FC<CommodityPropsType> = (props) => {
getFn
=
PublicApi
.
getSearchShopStoreGetCommodityList
break
case
LAYOUT_TYPE
.
channel
:
getFn
=
PublicApi
.
getSearchShopStoreGetCommodityList
param
.
channelMemberId
=
memberId
getFn
=
PublicApi
.
getSearchShopChannelGetCommodityList
break
case
LAYOUT_TYPE
.
ichannel
:
param
.
channelMemberId
=
memberId
getFn
=
PublicApi
.
getSearchShopChannelGetCommodityList
break
}
//@ts-ignore
getFn
(
param
).
then
(
res
=>
{
getFn
&&
getFn
(
param
).
then
(
res
=>
{
setLoading
(
false
)
if
(
res
.
code
===
1000
)
{
setCommodityList
(
res
.
data
.
data
)
...
...
@@ -153,6 +160,10 @@ const CommoditySearch: React.FC<CommodityPropsType> = (props) => {
history
.
push
(
`/shop/commodity/search?shopId=
${
shopUrlParam
}
`
)
break
case
LAYOUT_TYPE
.
channel
:
history
.
push
(
`/channelmall/commodity/search?shopId=
${
shopUrlParam
}
`
)
break
case
LAYOUT_TYPE
.
ichannel
:
history
.
push
(
`/ichannelmall/commodity/search?channelId=
${
shopUrlParam
}
`
)
break
}
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
c3e407f1
...
...
@@ -255,6 +255,39 @@ const CommodityDetail = (props) => {
}
}
const
getOrderLink
=
(
sessionKey
)
=>
{
let
link
=
""
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
channel
:
link
=
`/channelmall/order?spam_id=
${
sessionKey
}
&scence=channelPrompt&channelId=
${
shopUrlParam
}
`
break
case
LAYOUT_TYPE
.
ichannel
:
link
=
`/ichannelmall/order?spam_id=
${
sessionKey
}
&scence=channelPrompt&channelId=
${
shopUrlParam
}
`
break
default
:
link
=
`/order?spam_id=
${
sessionKey
}
&scence=channelPrompt`
break
}
return
link
}
const
getPurchaseOrderLink
=
()
=>
{
let
link
=
""
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
channel
:
link
=
`/channelmall/purchaseOrder?channelId=
${
shopUrlParam
}
`
break
case
LAYOUT_TYPE
.
ichannel
:
link
=
`/ichannelmall/purchaseOrder?channelId=
${
shopUrlParam
}
`
break
default
:
link
=
`/purchaseOrder`
break
}
return
link
}
/**
* 立即购买
*/
...
...
@@ -299,7 +332,7 @@ const CommodityDetail = (props) => {
}]
}
updateOrderInfo
(
buyOrderInfo
,
sessionKey
).
then
(()
=>
{
history
.
push
(
`
${
layoutType
===
LAYOUT_TYPE
.
channel
?
'/channelmall'
:
''
}
/order?spam_id=
${
sessionKey
}
&scence=prompt
${
layoutType
===
LAYOUT_TYPE
.
channel
?
'&channelId='
+
shopUrlParam
:
''
}
`
)
history
.
push
(
getOrderLink
(
sessionKey
)
)
})
clickFlag
=
true
}
else
{
...
...
@@ -726,7 +759,7 @@ const CommodityDetail = (props) => {
<
span
>
种商品
</
span
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
add_success_btn
,
styles
.
primary
)
}
onClick=
{
()
=>
history
.
push
(
`${layoutType === LAYOUT_TYPE.channel ? '/channelmall' : ''}/purchaseOrder${layoutType === LAYOUT_TYPE.channel ? '?channelId=' + shopUrlParam : ''}`
)
}
>
去结算
</
div
>
<
div
className=
{
cx
(
styles
.
add_success_btn
,
styles
.
primary
)
}
onClick=
{
()
=>
history
.
push
(
getPurchaseOrderLink
()
)
}
>
去结算
</
div
>
<
div
className=
{
styles
.
add_success_btn
}
onClick=
{
()
=>
setAddSuccessVisible
(
false
)
}
>
继续购物
</
div
>
</
div
>
<
InterestedCommodity
/>
...
...
src/pages/lxMall/components/Category/index.tsx
View file @
c3e407f1
...
...
@@ -42,6 +42,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
}
break
case
LAYOUT_TYPE
.
channel
:
case
LAYOUT_TYPE
.
ichannel
:
if
(
memberId
)
{
params
.
channelMemberId
=
memberId
getCategoryFn
=
PublicApi
.
getSearchShopChannelGetCustomerCategoryTree
...
...
src/pages/lxMall/components/ChannelHeader/index.tsx
View file @
c3e407f1
...
...
@@ -4,15 +4,17 @@ import { Input } from 'antd'
import
{
GetTemplateChannelFindChannelResponse
}
from
'@/services/TemplateApi'
import
isEmpty
from
'lodash/isEmpty'
import
'./index.less'
import
{
LAYOUT_TYPE
}
from
'@/constants'
interface
HeaderPropsType
{
shopInfo
:
GetTemplateChannelFindChannelResponse
,
id
:
number
,
shopUrlParam
:
string
,
type
:
LAYOUT_TYPE
}
const
Header
:
React
.
FC
<
HeaderPropsType
>
=
(
props
)
=>
{
const
{
id
,
shopUrlParam
,
shopInfo
}
=
props
const
{
id
,
shopUrlParam
,
shopInfo
,
type
}
=
props
const
[
searchValue
,
setSearchValue
]
=
useState
<
string
>
(
""
)
const
{
search
}
=
history
.
location
.
query
...
...
@@ -26,9 +28,23 @@ const Header: React.FC<HeaderPropsType> = (props) => {
const
handleSearchCommodity
=
()
=>
{
if
(
!
isEmpty
(
searchValue
))
{
history
.
push
(
`/channelmall/commodity/search?id=
${
shopUrlParam
}
&search=
${
encodeURIComponent
(
searchValue
)}
`
)
switch
(
type
)
{
case
LAYOUT_TYPE
.
channel
:
history
.
push
(
`/channelmall/commodity/search?channelId=
${
shopUrlParam
}
&search=
${
encodeURIComponent
(
searchValue
)}
`
)
break
case
LAYOUT_TYPE
.
ichannel
:
history
.
push
(
`/ichannelmall/commodity/search?channelId=
${
shopUrlParam
}
&search=
${
encodeURIComponent
(
searchValue
)}
`
)
break
}
}
else
{
history
.
push
(
`/channelmall/commodity/search?id=
${
shopUrlParam
}
`
)
switch
(
type
)
{
case
LAYOUT_TYPE
.
channel
:
history
.
push
(
`/channelmall/commodity/search?channelId=
${
shopUrlParam
}
`
)
break
case
LAYOUT_TYPE
.
ichannel
:
history
.
push
(
`/ichannelmall/commodity/search?channelId=
${
shopUrlParam
}
`
)
break
}
}
}
...
...
src/pages/lxMall/components/Filter/components/Brand/index.tsx
View file @
c3e407f1
...
...
@@ -33,12 +33,17 @@ const Brand: React.FC<BrandPropsType> = (props) => {
param
.
channelMemberId
=
memberId
getBrandFn
=
PublicApi
.
getSearchShopChannelGetBrand
break
case
LAYOUT_TYPE
.
ichannel
:
param
.
channelMemberId
=
memberId
getBrandFn
=
PublicApi
.
getSearchShopChannelGetBrand
break
}
getBrandFn
(
param
).
then
((
res
)
=>
{
getBrandFn
&&
getBrandFn
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
setBrandList
(
res
.
data
)
}
})
},
[
layoutType
])
const
handleSelectBrand
=
(
brandInfo
)
=>
{
...
...
src/pages/lxMall/components/Filter/components/Category/index.tsx
View file @
c3e407f1
...
...
@@ -91,16 +91,20 @@ const Category: React.FC<CategoryPropsType> = (props) => {
getAttributeFn
=
PublicApi
.
getSearchShopStoreGetCustomerAttributeByCategoryId
break
;
case
LAYOUT_TYPE
.
channel
:
getAttributeFn
=
PublicApi
.
getSearchShopStoreGetCustomerAttributeByCategoryId
param
.
channelMemberId
=
memberId
getAttributeFn
=
PublicApi
.
getSearchShopChannelGetCustomerAttributeByCategoryId
break
;
case
LAYOUT_TYPE
.
ichannel
:
param
.
channelMemberId
=
memberId
getAttributeFn
=
PublicApi
.
getSearchShopChannelGetCustomerAttributeByCategoryId
break
;
}
if
(
getAttributeFn
)
{
getAttributeFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAttributeList
(
initAttributeList
(
res
.
data
))
}
})
}
getAttributeFn
&&
getAttributeFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setAttributeList
(
initAttributeList
(
res
.
data
))
}
})
}
else
{
setAttributeList
([])
}
...
...
src/pages/lxMall/components/Filter/components/UseArea/index.tsx
View file @
c3e407f1
...
...
@@ -76,9 +76,12 @@ const UseArea: React.FC<UseAreaPropsType> = (props) => {
param
.
channelMemberId
=
memberId
getAreaFn
=
PublicApi
.
getSearchShopChannelGetArea
break
case
LAYOUT_TYPE
.
ichannel
:
param
.
channelMemberId
=
memberId
getAreaFn
=
PublicApi
.
getSearchShopChannelGetArea
break
}
getAreaFn
(
param
).
then
((
res
)
=>
{
getAreaFn
&&
getAreaFn
(
param
).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
setAreaList
(
initAreaData
(
res
.
data
))
}
...
...
src/pages/lxMall/components/MainNav/index.tsx
View file @
c3e407f1
...
...
@@ -22,6 +22,7 @@ const MainNav: React.FC<MainNavPropsType> = (props) => {
case
LAYOUT_TYPE
.
shop
:
return
`
${
item
.
path
}
?shopId=
${
shopUrlParam
}
`
case
LAYOUT_TYPE
.
channel
:
case
LAYOUT_TYPE
.
ichannel
:
return
`
${
item
.
path
}
?channelId=
${
shopUrlParam
}
`
default
:
return
item
.
path
...
...
src/pages/lxMall/components/SideNav/index.tsx
View file @
c3e407f1
...
...
@@ -28,6 +28,9 @@ const SideNav: React.FC<SideNavPropsType> = (props) => {
case
LAYOUT_TYPE
.
channel
:
link
=
`/channelmall/purchaseOrder?channelId=
${
shopUrlParam
}
`
break
case
LAYOUT_TYPE
.
ichannel
:
link
=
`/ichannelmall/purchaseOrder?channelId=
${
shopUrlParam
}
`
break
default
:
link
=
'/purchaseOrder'
break
...
...
src/pages/lxMall/layouts/LXChannelLayout.tsx
View file @
c3e407f1
...
...
@@ -16,7 +16,7 @@ import SideNav from '../components/SideNav'
import
Footer
from
'../components/Footer'
import
styles
from
'./index.less'
interface
LX
Mal
lLayoutPropsType
{
interface
LX
Channe
lLayoutPropsType
{
route
:
ProLayoutProps
[
'route'
]
&
{
authority
:
string
[];
routes
:
Array
<
any
>
...
...
@@ -25,7 +25,7 @@ interface LXMallLayoutPropsType {
SiteStore
?:
any
;
}
const
LXChannelLayout
:
React
.
FC
<
LX
Mal
lLayoutPropsType
>
=
(
props
)
=>
{
const
LXChannelLayout
:
React
.
FC
<
LX
Channe
lLayoutPropsType
>
=
(
props
)
=>
{
const
{
children
,
location
}
=
props
const
[
templateName
]
=
useState
<
string
>
(
'theme-channel-science'
)
const
{
channelId
}
=
location
.
query
...
...
@@ -36,6 +36,7 @@ const LXChannelLayout: React.FC<LXMallLayoutPropsType> = (props) => {
let
list
=
routes
.
filter
((
item
:
any
)
=>
pathname
.
indexOf
(
item
.
key
)
>
-
1
)
return
list
[
0
]
||
{}
}
const
{
formatMessage
}
=
useIntl
();
const
basicInfo
=
getMenuData
(
props
.
route
.
routes
,
{
locale
:
true
},
formatMessage
)
const
menuData
=
basicInfo
.
menuData
?
basicInfo
.
menuData
.
filter
(
item
=>
!
item
.
redirect
)
:
[]
...
...
@@ -48,16 +49,13 @@ const LXChannelLayout: React.FC<LXMallLayoutPropsType> = (props) => {
},
[])
useEffect
(()
=>
{
console
.
log
(
query
)
if
(
query
.
memberId
)
{
fetchShopInfo
(
query
.
memberId
)
}
},
[
query
])
const
fetchShopInfo
=
(
memberId
)
=>
{
//@ts-ignore
PublicApi
.
getTemplateChannelFindChannel
({
memberId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
...
...
@@ -81,7 +79,7 @@ const LXChannelLayout: React.FC<LXMallLayoutPropsType> = (props) => {
{
!
menuRouter
?.
hideHeader
&&
(
<>
<
ChannelHeader
id=
{
query
.
shopId
}
shopUrlParam=
{
channelId
}
shopInfo=
{
shopInfo
}
/>
<
ChannelHeader
id=
{
query
.
shopId
}
shopUrlParam=
{
channelId
}
shopInfo=
{
shopInfo
}
type=
{
LAYOUT_TYPE
.
channel
}
/>
<
MainNav
menuData=
{
menuData
}
pathname=
{
location
.
pathname
}
type=
{
LAYOUT_TYPE
.
channel
}
memberId=
{
query
.
memberId
}
shopId=
{
query
.
shopId
}
shopUrlParam=
{
channelId
}
/>
</>
)
...
...
src/pages/lxMall/layouts/LXIChannelLayout.tsx
0 → 100644
View file @
c3e407f1
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
BasicLayoutProps
as
ProLayoutProps
,
getMenuData
}
from
'@ant-design/pro-layout'
import
SelectLang
from
'@/layouts/components/SelectLang'
import
{
useIntl
}
from
'umi'
import
{
LAYOUT_TYPE
}
from
"@/constants"
import
{
inject
,
observer
}
from
'mobx-react'
import
TopBar
from
'../components/TopBar'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetTemplateChannelFindChannelResponse
}
from
'@/services/TemplateApi'
import
ChannelHeader
from
'../components/ChannelHeader'
import
MainNav
from
'../components/MainNav'
import
SideNav
from
'../components/SideNav'
import
Footer
from
'../components/Footer'
import
styles
from
'./index.less'
interface
LXIChannelLayoutPropsType
{
route
:
ProLayoutProps
[
'route'
]
&
{
authority
:
string
[];
routes
:
Array
<
any
>
};
location
:
any
;
SiteStore
?:
any
;
}
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
<
GetTemplateChannelFindChannelResponse
>
()
const
[
query
,
setQuery
]
=
useState
<
any
>
({})
const
getMenuRouter
=
(
routes
:
any
,
pathname
:
any
)
=>
{
let
list
=
routes
.
filter
((
item
:
any
)
=>
pathname
.
indexOf
(
item
.
key
)
>
-
1
)
return
list
[
0
]
||
{}
}
const
{
formatMessage
}
=
useIntl
();
const
basicInfo
=
getMenuData
(
props
.
route
.
routes
,
{
locale
:
true
},
formatMessage
)
const
menuData
=
basicInfo
.
menuData
?
basicInfo
.
menuData
.
filter
(
item
=>
!
item
.
redirect
)
:
[]
const
menuRouter
=
getMenuRouter
(
menuData
,
location
.
pathname
)
useEffect
(()
=>
{
let
queryParam
=
channelId
?
atob
(
channelId
)
:
undefined
queryParam
=
queryParam
?
JSON
.
parse
(
queryParam
)
:
{}
setQuery
(
queryParam
)
},
[])
useEffect
(()
=>
{
if
(
query
.
memberId
)
{
fetchShopInfo
(
query
.
memberId
)
}
},
[
query
])
const
fetchShopInfo
=
(
memberId
)
=>
{
//@ts-ignore
PublicApi
.
getTemplateChannelFindChannel
({
memberId
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setShopInfo
(
res
.
data
)
}
})
}
useEffect
(()
=>
{
let
body
=
document
.
getElementsByTagName
(
'body'
)[
0
];
if
(
shopInfo
)
{
body
.
className
=
shopInfo
.
fileName
?
`theme-channel-
${
shopInfo
.
fileName
}
`
:
templateName
;
}
else
{
body
.
className
=
templateName
}
},
[
shopInfo
])
return
(
<
div
className=
{
styles
.
lxmall_page
}
>
<
TopBar
langComponent=
{
<
SelectLang
/>
}
/>
<
div
className=
{
styles
.
content
}
>
{
!
menuRouter
?.
hideHeader
&&
(
<>
<
ChannelHeader
id=
{
query
.
shopId
}
shopUrlParam=
{
channelId
}
shopInfo=
{
shopInfo
}
type=
{
LAYOUT_TYPE
.
ichannel
}
/>
<
MainNav
menuData=
{
menuData
}
pathname=
{
location
.
pathname
}
type=
{
LAYOUT_TYPE
.
ichannel
}
memberId=
{
query
.
memberId
}
shopId=
{
query
.
shopId
}
shopUrlParam=
{
channelId
}
/>
</>
)
}
{
children
&&
React
.
Children
.
map
(
children
,
(
child
:
any
)
=>
{
return
React
.
cloneElement
(
child
,
{
layoutType
:
LAYOUT_TYPE
.
ichannel
,
shopId
:
query
.
shopId
,
memberId
:
query
.
memberId
,
shopUrlParam
:
channelId
,
shopInfo
},
);
})
}
</
div
>
<
Footer
/>
<
SideNav
type=
{
LAYOUT_TYPE
.
ichannel
}
shopUrlParam=
{
channelId
}
/>
</
div
>
)
}
export
default
inject
(
"SiteStore"
)(
observer
(
LXIChannelLayout
))
src/pages/lxMall/order/index.tsx
View file @
c3e407f1
...
...
@@ -134,6 +134,25 @@ const Order: React.FC<OrderPropsType> = (props) => {
}
/**
* 获取下单模式
*/
const
getOrderMode
=
()
=>
{
let
mode
=
OrderModalType
.
PURCHASE_ORDER
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
channel
:
mode
=
OrderModalType
.
CHANNEL_DIRECT_PURCHASE_ORDER
break
case
LAYOUT_TYPE
.
ichannel
:
mode
=
OrderModalType
.
CHANNEL_SPOT_PURCHASE_ORDER
break
default
:
mode
=
OrderModalType
.
PURCHASE_ORDER
break
}
return
mode
}
/**
* 提交订单
*/
const
submitOrder
=
()
=>
{
...
...
@@ -146,7 +165,7 @@ const Order: React.FC<OrderPropsType> = (props) => {
// return
// }
let
params
:
any
=
{
orderModel
:
layoutType
===
LAYOUT_TYPE
.
channel
?
OrderModalType
.
CHANNEL_SPOT_PURCHASE_ORDER
:
OrderModalType
.
PURCHASE_ORDER
,
// 下单模式
orderModel
:
getOrderMode
()
,
// 下单模式
deliveryAddresId
:
selectAddressInfo
.
id
,
addresName
:
selectAddressInfo
.
receiverName
,
isDefault
:
selectAddressInfo
.
isDefault
,
...
...
@@ -217,14 +236,13 @@ const Order: React.FC<OrderPropsType> = (props) => {
<
Spin
spinning=
{
spinningState
}
>
<
div
className=
{
styles
.
order
}
>
<
CommonHeader
logoUrl=
{
layoutType
===
LAYOUT_TYPE
.
channel
?
shopInfo
?.
logo
:
mallInfo
.
logoUrl
}
logoUrl=
{
(
layoutType
===
LAYOUT_TYPE
.
channel
||
layoutType
===
LAYOUT_TYPE
.
ichannel
)
?
shopInfo
?.
logo
:
mallInfo
.
logoUrl
}
title=
"订单结算"
/>
<
div
className=
{
styles
.
order_container
}
>
{
orderInfo
.
logistics
.
deliveryType
===
1
&&
(
<
Address
onChange=
{
(
selectItem
)
=>
{
console
.
log
(
selectItem
,
"selectItem"
)
setSelectAddressInfo
(
selectItem
)
}
}
/>
)
...
...
src/pages/lxMall/purchaseOrder/index.tsx
View file @
c3e407f1
...
...
@@ -512,7 +512,7 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
<
CommonHeader
title=
"我的进货单"
type=
{
layoutType
}
logoUrl=
{
layoutType
===
LAYOUT_TYPE
.
channel
?
shopInfo
?.
logo
:
mallInfo
.
logoUrl
}
logoUrl=
{
(
layoutType
===
LAYOUT_TYPE
.
channel
||
layoutType
===
LAYOUT_TYPE
.
ichannel
)
?
shopInfo
?.
logo
:
mallInfo
.
logoUrl
}
shopUrlParam=
{
shopUrlParam
}
/>
<
div
className=
{
styles
.
purchase_order_title
}
>
...
...
src/pages/shop/components/templateItem/index.less
View file @
c3e407f1
...
...
@@ -116,6 +116,8 @@
line-height: 22px;
.template_info_content_text_line {
display: flex;
&:not(:last-child) {
margin-bottom: 8px;
}
...
...
@@ -126,6 +128,12 @@
}
&>span {
flex: 1;
width: 0;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #172B4D;
}
}
...
...
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