Commit 5698db1b authored by GuanHua's avatar GuanHua

feat:修改渠道商城和渠道自由商城根路由为根据pass平台配置域名

parent 44e2ec5b
......@@ -5,11 +5,22 @@ const shopInfo = BASE_CONFIG.web.shopInfo
let webChannelInfo = shopInfo.filter(item => item.environment === 1 && item.type === 3)[0] // 渠道商城
let webChannelPointInfo = shopInfo.filter(item => item.environment === 1 && item.type === 5)[0] // 渠道积分商城
const checkUrl = (url, defaultUrl) => {
if (url) {
if (url.indexOf('/') > -1) {
return url
} else {
return `/${url}`
}
} else {
return defaultUrl
}
}
const defaultChannelRoute = '/channelmall' // 默认渠道商城根路径
const defaultIChannelPointRoute = '/pointsMall' // 默认渠道积分商城路径
const rootRoute = MALL_ROUTE_USE_CONFIG ? webChannelInfo.url || defaultChannelRoute : defaultChannelRoute
const pointMallRoute = MALL_ROUTE_USE_CONFIG ? webChannelPointInfo.url || defaultIChannelPointRoute : defaultIChannelPointRoute
const rootRoute = MALL_ROUTE_USE_CONFIG ? checkUrl(webChannelInfo.url, defaultChannelRoute) : defaultChannelRoute
const pointMallRoute = MALL_ROUTE_USE_CONFIG ? checkUrl(webChannelPointInfo.url, defaultIChannelPointRoute) : defaultIChannelPointRoute
const ChannelRoute = {
path: rootRoute,
......
......@@ -5,10 +5,22 @@ const shopInfo = BASE_CONFIG.web.shopInfo
let webIChannelInfo = shopInfo.filter(item => item.environment === 1 && item.type === 4)[0] // 渠道自有商城
let webChannelPointInfo = shopInfo.filter(item => item.environment === 1 && item.type === 5)[0] // 渠道积分商城
const checkUrl = (url, defaultUrl) => {
if (url) {
if (url.indexOf('/') > -1) {
return url
} else {
return `/${url}`
}
} else {
return defaultUrl
}
}
const defaultIChannelRoute = '/ichannelmall' // 默认渠道商城根路径
const defaultIChannelPointRoute = '/pointsMall' // 默认渠道积分商城路径
const rootRoute = MALL_ROUTE_USE_CONFIG ? webIChannelInfo.url || defaultIChannelRoute : defaultIChannelRoute
const pointMallRoute = MALL_ROUTE_USE_CONFIG ? webChannelPointInfo.url || defaultIChannelPointRoute : defaultIChannelPointRoute
const rootRoute = MALL_ROUTE_USE_CONFIG ? checkUrl(webIChannelInfo.url, defaultIChannelRoute) : defaultIChannelRoute
const pointMallRoute = MALL_ROUTE_USE_CONFIG ? checkUrl(webChannelPointInfo.url, defaultIChannelPointRoute) : defaultIChannelPointRoute
const selfChannelRoute = {
path: rootRoute,
......
......@@ -18,7 +18,7 @@
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
"test:coverage": "umi-test --coverage",
"start:cross": "cross-env SITE_ID=352 USE_ROUTE_CONFIG=true yarn start",
"start:cross": "cross-env SITE_ID=352 USE_ROUTE_CONFIG=false yarn start",
"start:url": "cross-env SITE_ID=1 BACK_GATEWAY=http://lingxi-all.wg.shushangyun.com USE_ROUTE_CONFIG=true yarn start",
"start:10": "cross-env SITE_ID=1 BACK_GATEWAY=http://10.0.0.10:8100 USE_ROUTE_CONFIG=true yarn start"
},
......
......@@ -26,6 +26,9 @@ const userLoginLists = [
'/user/agreement'
]
const channelRootRoute = GlobalConfig.channelRootRoute // 渠道商城路由
const ichannelRootRoute = GlobalConfig.ichannelRootRoute // 渠道自有商城路由
// 商城相关路由
const mallLists = [
'/',
......@@ -50,28 +53,28 @@ const mallLists = [
'/shop/infomation/search',
'/shop/infomation/detail',
'/shop/about',
`${GlobalConfig.channelRootRoute}`,
`${GlobalConfig.channelRootRoute}/commodity`,
`${GlobalConfig.channelRootRoute}/commodity/search`,
`${GlobalConfig.channelRootRoute}/commodity/detail`,
`${GlobalConfig.channelRootRoute}/pointsMall`,
`${GlobalConfig.channelRootRoute}/infomation`,
`${GlobalConfig.channelRootRoute}/infomation/detail`,
`${GlobalConfig.channelRootRoute}/infomation/search`,
`${GlobalConfig.channelRootRoute}/about`,
`${GlobalConfig.channelRootRoute}/purchaseOrder`,
`${GlobalConfig.channelRootRoute}/order`,
`${GlobalConfig.ichannelRootRoute}`,
`${GlobalConfig.ichannelRootRoute}/commodity`,
`${GlobalConfig.ichannelRootRoute}/commodity/search`,
`${GlobalConfig.ichannelRootRoute}/commodity/detail`,
`${GlobalConfig.ichannelRootRoute}/pointsMall`,
`${GlobalConfig.ichannelRootRoute}/infomation`,
`${GlobalConfig.ichannelRootRoute}/infomation/detail`,
`${GlobalConfig.ichannelRootRoute}/infomation/search`,
`${GlobalConfig.ichannelRootRoute}/about`,
`${GlobalConfig.ichannelRootRoute}/purchaseOrder`,
`${GlobalConfig.ichannelRootRoute}/order`,
`${channelRootRoute}`,
`${channelRootRoute}/commodity`,
`${channelRootRoute}/commodity/search`,
`${channelRootRoute}/commodity/detail`,
`${channelRootRoute}/pointsMall`,
`${channelRootRoute}/infomation`,
`${channelRootRoute}/infomation/detail`,
`${channelRootRoute}/infomation/search`,
`${channelRootRoute}/about`,
`${channelRootRoute}/purchaseOrder`,
`${channelRootRoute}/order`,
`${ichannelRootRoute}`,
`${ichannelRootRoute}/commodity`,
`${ichannelRootRoute}/commodity/search`,
`${ichannelRootRoute}/commodity/detail`,
`${ichannelRootRoute}/pointsMall`,
`${ichannelRootRoute}/infomation`,
`${ichannelRootRoute}/infomation/detail`,
`${ichannelRootRoute}/infomation/search`,
`${ichannelRootRoute}/about`,
`${ichannelRootRoute}/purchaseOrder`,
`${ichannelRootRoute}/order`,
]
// let routeAuthUrls: any[] = []
......
......@@ -8,6 +8,24 @@
import SELF_CONFIG from '../../../config/base.config.json'
import { RootObject } from './global'
interface newRootObject extends RootObject {
channelRootRoute: string;
ichannelRootRoute: string;
}
const checkUrl = (url, defaultUrl) => {
if (url) {
if (url.indexOf('/') > -1) {
return url
} else {
return `/${url}`
}
} else {
return defaultUrl
}
}
const MALL_ROUTE_USE_CONFIG = process.env.USE_ROUTE_CONFIG || true
let webChannelInfo = SELF_CONFIG.web.shopInfo.filter(item => item.environment === 1 && item.type === 3)[0] // 渠道商城
......@@ -15,11 +33,13 @@ let webIChannelInfo = SELF_CONFIG.web.shopInfo.filter(item => item.environment =
const defaultChannelRoute = '/channelmall' // 默认渠道商城根路径
const defaultIChannelRoute = '/ichannelmall' // 默认渠道自有商城根路径
const channelRootRoute = MALL_ROUTE_USE_CONFIG ? webChannelInfo.url || defaultChannelRoute : defaultChannelRoute
const ichannelRootRoute = MALL_ROUTE_USE_CONFIG ? webIChannelInfo.url || defaultIChannelRoute : defaultIChannelRoute
const channelRootRoute = MALL_ROUTE_USE_CONFIG ? checkUrl(webChannelInfo.url, defaultChannelRoute) : defaultChannelRoute
const ichannelRootRoute = MALL_ROUTE_USE_CONFIG ? checkUrl(webIChannelInfo.url, defaultIChannelRoute) : defaultIChannelRoute
SELF_CONFIG.channelRootRoute = channelRootRoute // 渠道商城路由根路径
SELF_CONFIG.ichannelRootRoute = ichannelRootRoute // 渠道自有商城路由根路径
export const GlobalConfig: RootObject = SELF_CONFIG
export const GlobalConfig: newRootObject = SELF_CONFIG
......@@ -14,6 +14,7 @@ import cx from 'classnames'
import styles from './index.less'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { isEmpty } from '@formily/antd/esm/shared'
import { GlobalConfig } from '@/global/config'
interface ShopInfoPropsType {
SiteStore: {
......@@ -143,7 +144,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
message.error("店铺链接不能为空")
return
}
value.storeUrl = storeUrl || `${siteUrl}/channelmall`
value.storeUrl = storeUrl || `${siteUrl}/${GlobalConfig.channelRootRoute}`
value.shopId = shopId
setConfirmLoading(true)
//@ts-ignore
......@@ -236,14 +237,11 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
if (mallItem.environment === 1) {
switch (mallItem.type) {
case 3:
result = `${newSiteUrl}/channelmall?channelId=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`
result = `${newSiteUrl}${GlobalConfig.channelRootRoute}?channelId=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`
break
case 4:
result = `${newSiteUrl}/ichannelmall?channelId=${btoa(JSON.stringify({ shopId: shopInfo.shopId, memberId: shopInfo.memberId }))}`
result = `${newSiteUrl}${GlobalConfig.ichannelRootRoute}?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
......
......@@ -4,6 +4,7 @@ import { Card, Space, Row, Col, Descriptions, Table, Avatar } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
import styles from "./index.less"
import { GlobalConfig } from '@/global/config'
import { PublicApi } from '@/services/api'
const ViewDriectChannel: React.FC<{}> = () => {
......@@ -14,12 +15,12 @@ const ViewDriectChannel: React.FC<{}> = () => {
useEffect(() => {
const { id } = history.location.query
PublicApi.getProductChannelCommodityGetChannelCommodity({id: id}).then(res => {
PublicApi.getProductChannelCommodityGetChannelCommodity({ id: id }).then(res => {
const { data } = res
setChannelDetails(data)
constructTable(data)
})
PublicApi.getProductChannelCommodityGetShop({id: id}).then(res => {
PublicApi.getProductChannelCommodityGetShop({ id: id }).then(res => {
setShopList(res.data)
})
......@@ -28,51 +29,51 @@ const ViewDriectChannel: React.FC<{}> = () => {
const constructTable = (param: any) => {
const { unitPriceAndPicList, channelCommodity } = param
const { commodity } = channelCommodity
if(unitPriceAndPicList.length > 0){
if (unitPriceAndPicList.length > 0) {
let col: any = []
let temp: any = []
unitPriceAndPicList[0].attributeAndValueList.map(_item => {
temp.push({title: _item.customerAttribute.name, dataIndex: [_item.customerAttribute.name, 'value'], key: _item.customerAttribute.name})
temp.push({ title: _item.customerAttribute.name, dataIndex: [_item.customerAttribute.name, 'value'], key: _item.customerAttribute.name })
})
col.push({
title: 'ID',
dataIndex: 'id',
key: 'id'
},
{
title: 'GoodsId',
dataIndex: 'goodsId',
col.push({
title: 'ID',
dataIndex: 'id',
key: 'id'
},
{
title: 'GoodsId',
dataIndex: 'goodsId',
key: 'id',
className: 'commonHide'
},
{
title: '索引',
dataIndex: '索引',
{
title: '索引',
dataIndex: '索引',
key: '索引',
className: 'commonHide'
},
{
title: '商品名称',
dataIndex: '商品名称',
{
title: '商品名称',
dataIndex: '商品名称',
key: '商品名称'
},
},
{
title: '对应货品',
dataIndex: '对应货品',
title: '对应货品',
dataIndex: '对应货品',
key: '对应货品'
},
...temp,
{
title: commodity.priceType === 3 ? '积分' : '单价',
dataIndex: '单价',
},
...temp,
{
title: commodity.priceType === 3 ? '积分' : '单价',
dataIndex: '单价',
key: '单价',
render: (text, record) => {
if (!text || JSON.stringify(text)==='{}') return null
if (!text || JSON.stringify(text) === '{}') return null
return Object.keys(text).map((v, i) => {
return <><span key={i}>{v==='0-0'?'':`${v}:`} <span style={{color:'red'}}>{commodity.priceType===3?'':'¥'}{text[v]}</span></span><br /></>
return <><span key={i}>{v === '0-0' ? '' : `${v}:`} <span style={{ color: 'red' }}>{commodity.priceType === 3 ? '' : '¥'}{text[v]}</span></span><br /></>
})
}
})
})
setPrcieTableColumn(col)
// 构建table 数据Data
......@@ -80,7 +81,7 @@ const ViewDriectChannel: React.FC<{}> = () => {
unitPriceAndPicList.map((item, index) => {
let temp: any = {}
item.attributeAndValueList.map(_item => {
temp[_item.customerAttribute.name] = {value: _item.customerAttributeValue.value, vId: _item.customerAttributeValue.id, id: _item.customerAttribute.id }
temp[_item.customerAttribute.name] = { value: _item.customerAttributeValue.value, vId: _item.customerAttributeValue.id, id: _item.customerAttribute.id }
})
_tableData.push({
"id": item.id, // 行数据id
......@@ -98,18 +99,18 @@ const ViewDriectChannel: React.FC<{}> = () => {
}
const renderStatus = (status: any) => {
if(status === 5)
if (status === 5)
return <span className={styles.pruductStatus}>已上架</span>
if(status === 6)
return <span style={{padding:'2px 5px',background:'rgba(244,245,247,1)',borderRadius:'4px'}}>已下架</span>
if(status === 7)
return <span style={{color:'#E63F3B',padding:'2px 5px',background:'rgba(255,235,230,1)',borderRadius:'4px'}}>未上架</span>
if (status === 6)
return <span style={{ padding: '2px 5px', background: 'rgba(244,245,247,1)', borderRadius: '4px' }}>已下架</span>
if (status === 7)
return <span style={{ color: '#E63F3B', padding: '2px 5px', background: 'rgba(255,235,230,1)', borderRadius: '4px' }}>未上架</span>
else
return null
}
const content = <>
<Descriptions colon={true} style={{marginTop:50}}>
<Descriptions colon={true} style={{ marginTop: 50 }}>
{
renderStatus(channelDetails?.status) && <Descriptions.Item label="商品状态">{renderStatus(channelDetails?.status)}</Descriptions.Item>
}
......@@ -120,10 +121,10 @@ const ViewDriectChannel: React.FC<{}> = () => {
channelDetails?.channelCommodity?.commodity?.customerCategory?.name && <Descriptions.Item label="商品品类">{channelDetails?.channelCommodity?.commodity?.customerCategory?.name}</Descriptions.Item>
}
{
shopList.length>0 &&
shopList.length > 0 &&
<Descriptions.Item label="上架商城">
{
shopList.map((item, index)=> item.isCheck && <span key={index}><img width="24" height="24" style={{borderRadius: '50%', marginRight: 4}} src={item.logoUrl} title={item.name} alt={item.name}/></span>)
shopList.map((item, index) => item.isCheck && <span key={index}><img width="24" height="24" style={{ borderRadius: '50%', marginRight: 4 }} src={item.logoUrl} title={item.name} alt={item.name} /></span>)
}
</Descriptions.Item>
}
......@@ -140,30 +141,30 @@ const ViewDriectChannel: React.FC<{}> = () => {
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
backIcon={<ReutrnEle description="返回"/>}
backIcon={<ReutrnEle description="返回" />}
title="渠道直采商品详情"
>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="商品信息">
<Space direction="vertical" style={{ width: '100%' }}>
<Card headStyle={{ borderBottom: 'none' }} title="商品信息">
<p>
<Avatar size={48} shape="square" src={channelDetails?.channelCommodity?.commodity?.mainPic} />
<span style={{color:'rgba(23,43,77,1)',fontSize:18,fontWeight:500,marginLeft:16}}>{channelDetails?.name}</span>
<span style={{color:'#E63F3B',padding:'2px 5px',background:'rgba(255,235,230,1)',borderRadius:'4px',marginLeft:16,marginRight:16}}>{channelDetails?.channelCommodity?.source === 1 ? "上级渠道" : "渠道自有"}</span>
<span style={{ color: 'rgba(23,43,77,1)', fontSize: 18, fontWeight: 500, marginLeft: 16 }}>{channelDetails?.name}</span>
<span style={{ color: '#E63F3B', padding: '2px 5px', background: 'rgba(255,235,230,1)', borderRadius: '4px', marginLeft: 16, marginRight: 16 }}>{channelDetails?.channelCommodity?.source === 1 ? "上级渠道" : "渠道自有"}</span>
{/* <a>去查看 &gt;</a> */}
<a
<a
href={
channelDetails?.channelCommodity?.source === 1 ?
`/channelmall/commodity/detail?id=${channelDetails?.channelCommodity?.commodity?.id}&channelId=${btoa(JSON.stringify({ shopId: '', memberId: channelDetails?.channelCommodity?.parentMemberId }))}` :
`/memberCenter/commodityAbility/commodity/products/detail?id=${channelDetails?.channelCommodity?.commodity?.id}`
}
// target="blank"
channelDetails?.channelCommodity?.source === 1 ?
`${GlobalConfig.channelRootRoute}/commodity/detail?id=${channelDetails?.channelCommodity?.commodity?.id}&channelId=${btoa(JSON.stringify({ shopId: '', memberId: channelDetails?.channelCommodity?.parentMemberId }))}` :
`/memberCenter/commodityAbility/commodity/products/detail?id=${channelDetails?.channelCommodity?.commodity?.id}`
}
// target="blank"
>去查看 &gt;</a>
</p>
{content}
</Card>
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="单价设置">
<Space direction="vertical" style={{ width: '100%' }}>
<Card headStyle={{ borderBottom: 'none' }} title="单价设置">
<Row>
<Col span={3}>
<p>会员折扣:</p>
......@@ -175,10 +176,10 @@ const ViewDriectChannel: React.FC<{}> = () => {
<Table dataSource={priceTableData} columns={priceTableDataColumn} pagination={false} />
</Card>
</Space>
<Space direction="vertical" style={{width:'100%'}}>
<Card headStyle={{borderBottom:'none'}} title="适用渠道">
<Space direction="vertical" style={{ width: '100%' }}>
<Card headStyle={{ borderBottom: 'none' }} title="适用渠道">
<Row>
<Col span={3}>
<Col span={3}>
<p>渠道会员角色:</p>
</Col>
<Col span={21}>
......
......@@ -9,6 +9,7 @@ import { inject, observer } from 'mobx-react'
import { PublicApi } from '@/services/api'
import { LAYOUT_TYPE } from '@/constants'
import { GetTemplatePlatformFindAllFirstCategoryResponse, GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface ChannelIndexPropsType {
......@@ -118,7 +119,7 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
let categoryDetail: any = await fetchCategoryById(item.id, templateId)
result.push(
<ShopFloorLine
linkUrl={`/channelmall/commodity?channelId=${shopUrlParam}&categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
linkUrl={`${GlobalConfig.channelRootRoute}/commodity?channelId=${shopUrlParam}&categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`}
anchor={`floorline_${item.id}`}
key={item.id}
title={item.name}
......@@ -126,11 +127,11 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
<ShopFloorLine.Category
categoryAdvertPicUrl={categoryDetail.categoryAdvertPicUrl}
categoryList={categoryDetail.categoryBOList}
linkUrl={`/channelmall/commodity?channelId=${shopUrlParam}`}
linkUrl={`${GlobalConfig.channelRootRoute}/commodity?channelId=${shopUrlParam}`}
/>
<ShopFloorLine.Goods
goodsList={categoryDetail.goodsBOList}
linkUrl={`/channelmall/commodity/detail?channelId=${shopUrlParam}`}
linkUrl={`${GlobalConfig.channelRootRoute}/commodity/detail?channelId=${shopUrlParam}`}
/>
</ShopFloorLine>
)
......
......@@ -5,6 +5,7 @@ import { LAYOUT_TYPE } from '@/constants'
import { PostSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi'
import { priceFormat, numFormat } from '@/utils/numberFomat'
import creditIcon from '@/assets/imgs/credit_icon.png'
import { GlobalConfig } from '@/global/config'
import styles from './list.less'
interface CommodityListPropsType {
......@@ -46,10 +47,10 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
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 }))}`
link = `${GlobalConfig.channelRootRoute}/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 }))}`
link = `${GlobalConfig.ichannelRootRoute}/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 }))}`
......
......@@ -15,7 +15,7 @@ import { LAYOUT_TYPE } from '@/constants'
import { useLocalStore, observer } from 'mobx-react'
import { PostSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi'
import arrowDownIcon from '@/assets/imgs/arrow_down.png'
import arrowDownActiveIcon from '@/assets/imgs/arrow_down_active.png'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface CommodityPropsType {
......@@ -162,10 +162,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}`)
history.push(`${GlobalConfig.channelRootRoute}/commodity/search?shopId=${shopUrlParam}`)
break
case LAYOUT_TYPE.ichannel:
history.push(`/ichannelmall/commodity/search?channelId=${shopUrlParam}`)
history.push(`${GlobalConfig.ichannelRootRoute}/commodity/search?channelId=${shopUrlParam}`)
break
}
......
......@@ -6,6 +6,7 @@ import { COMMODITY_TYPE, LAYOUT_TYPE } from '@/constants'
import { priceFormat, numFormat } from '@/utils/numberFomat'
import { arrayGroupsByCount } from '@/utils'
import ImageBox from '@/components/ImageBox'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface BrowseRecordsPropsType {
......@@ -30,10 +31,10 @@ const BrowseRecords: React.FC<BrowseRecordsPropsType> = (props) => {
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 }))}`
link = `${GlobalConfig.channelRootRoute}/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 }))}`
link = `${GlobalConfig.ichannelRootRoute}/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 }))}`
......
import React from 'react'
import { LAYOUT_TYPE } from '@/constants'
import ImageBox from '@/components/ImageBox'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface RecommandPropsTyep {
......@@ -15,10 +16,10 @@ const Recommand: React.FC<RecommandPropsTyep> = (props) => {
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 }))}`
link = `${GlobalConfig.channelRootRoute}/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 }))}`
link = `${GlobalConfig.ichannelRootRoute}/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 }))}`
......
......@@ -19,7 +19,9 @@ import { getAuth } from '@/utils/auth'
import { numFormat, priceFormat } from '@/utils/numberFomat'
import jinhuodanIcon from '@/assets/imgs/jinhuodan.png'
import styles from './index.less'
import { GlobalConfig } from '@/global/config'
import { isEmpty } from 'lodash'
import { LAYOUT_TYPE, COMMODITY_TYPE, OrderModalType } from '@/constants'
const Logistics_Type = {
......@@ -367,10 +369,10 @@ const CommodityDetail = (props) => {
let link = ""
switch (layoutType) {
case LAYOUT_TYPE.channel:
link = `/channelmall/order?spam_id=${sessionKey}&type=${priceType}&channelId=${shopUrlParam}`
link = `${GlobalConfig.channelRootRoute}/order?spam_id=${sessionKey}&type=${priceType}&channelId=${shopUrlParam}`
break
case LAYOUT_TYPE.ichannel:
link = `/ichannelmall/order?spam_id=${sessionKey}&type=${priceType}&channelId=${shopUrlParam}`
link = `${GlobalConfig.ichannelRootRoute}/order?spam_id=${sessionKey}&type=${priceType}&channelId=${shopUrlParam}`
break
default:
link = `/order?spam_id=${sessionKey}&type=${priceType}`
......@@ -384,10 +386,10 @@ const CommodityDetail = (props) => {
let link = ""
switch (layoutType) {
case LAYOUT_TYPE.channel:
link = `/channelmall/purchaseOrder?channelId=${shopUrlParam}`
link = `${GlobalConfig.channelRootRoute}/purchaseOrder?channelId=${shopUrlParam}`
break
case LAYOUT_TYPE.ichannel:
link = `/ichannelmall/purchaseOrder?channelId=${shopUrlParam}`
link = `${GlobalConfig.ichannelRootRoute}/purchaseOrder?channelId=${shopUrlParam}`
break
default:
link = `/purchaseOrder`
......
......@@ -4,6 +4,7 @@ import { Link } from 'umi'
import { ArrowRightOutlined } from '@ant-design/icons'
import { Carousel } from 'antd'
import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
enum TAB_TYPE {
......@@ -34,7 +35,10 @@ const AboutUs: React.FC<AboutUsPropsType> = (props) => {
link = `/shop/about?shopId=${shopUrlParam}`
break
case LAYOUT_TYPE.channel:
link = `/channelmall/about?id=${shopUrlParam}`
link = `${GlobalConfig.channelRootRoute}/about?id=${shopUrlParam}`
break
case LAYOUT_TYPE.ichannel:
link = `${GlobalConfig.ichannelRootRoute}/about?id=${shopUrlParam}`
break
}
return link
......
......@@ -5,7 +5,7 @@ import { Link } from 'umi'
import cx from 'classnames'
import { LAYOUT_TYPE } from '@/constants'
import { PublicApi } from '@/services/api'
import isEmpty from 'lodash/isEmpty'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface CategoryPropsType {
......@@ -73,7 +73,9 @@ const Category: React.FC<CategoryPropsType> = (props) => {
case LAYOUT_TYPE.shop:
return `/shop/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&shopId=${shopUrlParam}`
case LAYOUT_TYPE.channel:
return `/channelmall/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&id=${shopUrlParam}`
return `${GlobalConfig.channelRootRoute}/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&id=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `${GlobalConfig.ichannelRootRoute}/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}&id=${shopUrlParam}`
default:
return `/commodity?categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.title))}`
}
......@@ -84,7 +86,9 @@ const Category: React.FC<CategoryPropsType> = (props) => {
case LAYOUT_TYPE.shop:
return `/shop/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&shopId=${shopUrlParam}`
case LAYOUT_TYPE.channel:
return `/channelmall/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&id=${shopUrlParam}`
return `${GlobalConfig.channelRootRoute}/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&id=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `${GlobalConfig.ichannelRootRoute}/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}&id=${shopUrlParam}`
default:
return `/commodity?brandId=${item.brandId}&brandName=${btoa(encodeURIComponent(item.brandName))}`
}
......
......@@ -5,6 +5,7 @@ import { GetTemplateChannelFindChannelResponse } 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: GetTemplateChannelFindChannelResponse,
......@@ -30,19 +31,19 @@ const Header: React.FC<HeaderPropsType> = (props) => {
if (!isEmpty(searchValue)) {
switch (type) {
case LAYOUT_TYPE.channel:
history.push(`/channelmall/commodity/search?channelId=${shopUrlParam}&search=${encodeURIComponent(searchValue)}`)
history.push(`${GlobalConfig.channelRootRoute}/commodity/search?channelId=${shopUrlParam}&search=${encodeURIComponent(searchValue)}`)
break
case LAYOUT_TYPE.ichannel:
history.push(`/ichannelmall/commodity/search?channelId=${shopUrlParam}&search=${encodeURIComponent(searchValue)}`)
history.push(`${GlobalConfig.ichannelRootRoute}/commodity/search?channelId=${shopUrlParam}&search=${encodeURIComponent(searchValue)}`)
break
}
} else {
switch (type) {
case LAYOUT_TYPE.channel:
history.push(`/channelmall/commodity/search?channelId=${shopUrlParam}`)
history.push(`${GlobalConfig.channelRootRoute}/commodity/search?channelId=${shopUrlParam}`)
break
case LAYOUT_TYPE.ichannel:
history.push(`/ichannelmall/commodity/search?channelId=${shopUrlParam}`)
history.push(`${GlobalConfig.ichannelRootRoute}/commodity/search?channelId=${shopUrlParam}`)
break
}
}
......
import React from 'react'
import { Link } from 'umi'
import styles from './index.less'
import { LAYOUT_TYPE } from '@/constants'
......@@ -12,22 +11,7 @@ interface ShopHeaderPropsType {
const CommonHeader: React.FC<ShopHeaderPropsType> = (props) => {
const { title, type, logoUrl, shopUrlParam } = props
const getHomeLink = () => {
let link = '/'
switch (type) {
case LAYOUT_TYPE.channel:
link = `/channelmall?channelId=${shopUrlParam}`
break
case LAYOUT_TYPE.mall:
case LAYOUT_TYPE.shop:
default:
link = '/'
break
}
return link
}
const { title, logoUrl } = props
return (
<div className={styles.common_header}>
......
......@@ -5,6 +5,7 @@ import ImageBox from '@/components/ImageBox'
import { RightOutlined } from '@ant-design/icons'
import moment from 'moment'
import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface InformationPropsType {
......@@ -90,9 +91,9 @@ const Information: React.FC<InformationPropsType> = (props) => {
const toDetailLink = (id) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.channelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.ichannelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
default:
return `/infomation/detail?id=${id}`
}
......@@ -101,9 +102,9 @@ const Information: React.FC<InformationPropsType> = (props) => {
const toMoreLink = () => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall/infomation?channelId=${shopUrlParam}`
return `${GlobalConfig.channelRootRoute}/infomation?channelId=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall/infomation?channelId=${shopUrlParam}`
return `${GlobalConfig.ichannelRootRoute}/infomation?channelId=${shopUrlParam}`
default:
return `/infomation`
}
......
......@@ -4,6 +4,7 @@ import cx from 'classnames'
import ImageBox from '@/components/ImageBox'
import { LAYOUT_TYPE } from '@/constants'
import { priceFormat } from '@/utils/numberFomat'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface InterestedCommodityPropsType {
......@@ -34,10 +35,10 @@ const InterestedCommodity: React.FC<InterestedCommodityPropsType> = (props) => {
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 }))}`
link = `${GlobalConfig.channelRootRoute}/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 }))}`
link = `${GlobalConfig.ichannelRootRoute}/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 }))}`
......
......@@ -5,6 +5,7 @@ import { inject, observer } from 'mobx-react'
import { message } from 'antd'
import { LAYOUT_TYPE } from '@/constants'
import { priceFormat } from '@/utils/numberFomat'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface RecommandPropsType {
......@@ -136,10 +137,10 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
let link = ""
switch (layoutType) {
case LAYOUT_TYPE.channel:
link = `/channelmall/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
link = `${GlobalConfig.channelRootRoute}/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
break
case LAYOUT_TYPE.ichannel:
link = `/ichannelmall/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
link = `${GlobalConfig.ichannelRootRoute}/commodity/detail?id=${item.id}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
break
default:
link = `/shop/commodity/detail?id=${item.id}&shopId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
......
......@@ -3,6 +3,7 @@ import { history } from 'umi'
import { createFromIconfontCN } from '@ant-design/icons'
import { LAYOUT_TYPE } from '@/constants'
import FootPrint from './footprint'
import { GlobalConfig } from '@/global/config'
import './index.less'
const MyIcon = createFromIconfontCN({
......@@ -26,10 +27,10 @@ const SideNav: React.FC<SideNavPropsType> = (props) => {
let link = '/purchaseOrder'
switch (type) {
case LAYOUT_TYPE.channel:
link = `/channelmall/purchaseOrder?channelId=${shopUrlParam}`
link = `${GlobalConfig.channelRootRoute}/purchaseOrder?channelId=${shopUrlParam}`
break
case LAYOUT_TYPE.ichannel:
link = `/ichannelmall/purchaseOrder?channelId=${shopUrlParam}`
link = `${GlobalConfig.ichannelRootRoute}/purchaseOrder?channelId=${shopUrlParam}`
break
default:
link = '/purchaseOrder'
......
......@@ -11,7 +11,8 @@ import memberBenefitsIcon from './imgs/member_benefits_icon.png'
import memberInfoIcon from './imgs/member_info_icon.png'
import { LAYOUT_TYPE } from '@/constants'
import { numFormat } from '@/utils/numberFomat'
import { removeAuth, removeRouters } from '@/utils/auth';
import { removeAuth, removeRouters } from '@/utils/auth'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
interface TopBarPropsType {
......@@ -32,9 +33,9 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
case LAYOUT_TYPE.mall:
return '/'
case LAYOUT_TYPE.channel:
return `/channelmall?channelId=${shopUrlParam}`
return `${GlobalConfig.channelRootRoute}?channelId=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall?channelId=${shopUrlParam}`
return `${GlobalConfig.ichannelRootRoute}?channelId=${shopUrlParam}`
}
}
......
......@@ -5,6 +5,7 @@ import { SearchOutlined } from '@ant-design/icons'
import cx from 'classnames'
import styles from './index.less'
import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
interface BreadCrumbsPropsType {
pathname?: string;
......@@ -25,9 +26,9 @@ const BreadCrumbs: React.FC<BreadCrumbsPropsType> = (props) => {
const getLink = (path, param?) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall${path}${param ? param : ''}&channelId=${shopUrlParam}`
return `${GlobalConfig.channelRootRoute}${path}${param ? param : ''}&channelId=${shopUrlParam}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall${path}${param ? param : ''}&channelId=${shopUrlParam}`
return `${GlobalConfig.ichannelRootRoute}${path}${param ? param : ''}&channelId=${shopUrlParam}`
default:
return `${path}${param ? param : ''}`
}
......
import React, { useState, useEffect, Fragment } from 'react'
import cx from 'classnames'
import informationImg2 from '@/assets/imgs/information_2.png'
import ImageBox from '@/components/ImageBox'
import { PublicApi } from '@/services/api'
import { Link } from 'umi'
import { GlobalConfig } from '@/global/config'
import moment from 'moment'
import {
GetManageContentLabelHotResponse
......@@ -80,9 +79,9 @@ const InformationRight: React.FC<InformationRightPropsType> = (props) => {
const getLink = (path, param?) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall${path}?channelId=${shopUrlParam}${param ? `&${param}` : ''}`
return `${GlobalConfig.channelRootRoute}${path}?channelId=${shopUrlParam}${param ? `&${param}` : ''}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall${path}?channelId=${shopUrlParam}${param ? `&${param}` : ''}`
return `${GlobalConfig.ichannelRootRoute}${path}?channelId=${shopUrlParam}${param ? `&${param}` : ''}`
default:
return `${path}${param ? `?${param}` : ''}`
}
......
......@@ -14,6 +14,7 @@ import { getAuth } from '@/utils/auth'
import moment from 'moment'
import styles from './detail.less'
import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
interface InformationDetailPropsType {
location: any;
......@@ -84,9 +85,9 @@ const InformationDetail: React.FC<InformationDetailPropsType> = (props) => {
const toDetailLink = (id) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.channelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.ichannelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
default:
return `/infomation/detail?id=${id}`
}
......
......@@ -13,6 +13,7 @@ import {
GetManageContentInformationFindAllByRecommendLabelResponse,
GetManageContentColumnAllResponse,
} from '@/services/PassApi'
import { GlobalConfig } from '@/global/config'
import { numFormat } from '@/utils/numberFomat'
import styles from './index.less'
......@@ -137,9 +138,9 @@ const Information: React.FC<InformationPropsType> = (props) => {
const toDetailLink = (id) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.channelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.ichannelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
default:
return `/infomation/detail?id=${id}`
}
......
......@@ -13,6 +13,7 @@ import { numFormat } from '@/utils/numberFomat'
import { PublicApi } from '@/services/api'
import styles from './index.less'
import { LAYOUT_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
interface InformationPropsType {
location: any;
......@@ -168,9 +169,9 @@ const InformationSearch: React.FC<InformationPropsType> = (props) => {
const toDetailLink = (id) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.channelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall/infomation/detail?channelId=${shopUrlParam}&id=${id}`
return `${GlobalConfig.ichannelRootRoute}/infomation/detail?channelId=${shopUrlParam}&id=${id}`
default:
return `/infomation/detail?id=${id}`
}
......
......@@ -4,6 +4,7 @@ import { Skeleton } from 'antd'
import { LAYOUT_TYPE } from '@/constants'
import { PostSearchShopEnterpriseGetCommodityListResponseDetail } from '@/services/SearchApi'
import { numFormat } from '@/utils/numberFomat'
import { GlobalConfig } from '@/global/config'
import styles from './list.less'
interface CommodityListPropsType {
......@@ -18,9 +19,9 @@ const CommodityList: React.FC<CommodityListPropsType> = (props) => {
const getCommodityDetailUrl = (item) => {
switch (layoutType) {
case LAYOUT_TYPE.channel:
return `/channelmall/commodity/detail?id=${item.id}&type=${item.priceType}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
return `${GlobalConfig.channelRootRoute}/commodity/detail?id=${item.id}&type=${item.priceType}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
case LAYOUT_TYPE.ichannel:
return `/ichannelmall/commodity/detail?id=${item.id}&type=${item.priceType}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
return `${GlobalConfig.ichannelRootRoute}/commodity/detail?id=${item.id}&type=${item.priceType}&channelId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
case LAYOUT_TYPE.mall:
case LAYOUT_TYPE.shop:
return `/shop/commodity/detail?id=${item.id}&type=${item.priceType}&shopId=${btoa(JSON.stringify({ shopId: item.storeId, memberId: item.memberId }))}`
......
......@@ -15,6 +15,7 @@ import { LAYOUT_TYPE } from '@/constants'
import { GetSearchShopPurchaseGetPurchaseListResponse } from '@/services/SearchApi'
import { GetTemplateChannelFindChannelResponse } from '@/services/TemplateApi'
import { isEmpty } from 'lodash'
import { GlobalConfig } from '@/global/config'
interface PurchaseOrderPropsType {
layoutType: LAYOUT_TYPE,
......@@ -604,10 +605,10 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
let linkUrl = ""
switch (layoutType) {
case LAYOUT_TYPE.channel:
linkUrl = `/channelmall/commodity/detail?id=${info.commodityUnitPrice.commodity.id}&channelId=${btoa(JSON.stringify({ shopId: info.commodityUnitPrice.commodity.storeId, memberId: info.commodityUnitPrice.commodity.memberId }))}`
linkUrl = `${GlobalConfig.channelRootRoute}/commodity/detail?id=${info.commodityUnitPrice.commodity.id}&channelId=${btoa(JSON.stringify({ shopId: info.commodityUnitPrice.commodity.storeId, memberId: info.commodityUnitPrice.commodity.memberId }))}`
break
case LAYOUT_TYPE.ichannel:
linkUrl = `/ichannelmall/commodity/detail?id=${info.commodityUnitPrice.commodity.id}&channelId=${btoa(JSON.stringify({ shopId: info.commodityUnitPrice.commodity.storeId, memberId: info.commodityUnitPrice.commodity.memberId }))}`
linkUrl = `${GlobalConfig.ichannelRootRoute}/commodity/detail?id=${info.commodityUnitPrice.commodity.id}&channelId=${btoa(JSON.stringify({ shopId: info.commodityUnitPrice.commodity.storeId, memberId: info.commodityUnitPrice.commodity.memberId }))}`
break
default:
linkUrl = `/shop/commodity/detail?id=${info.commodityUnitPrice.commodity.id}&shopId=${btoa(JSON.stringify({ shopId: info.commodityUnitPrice.commodity.storeId, memberId: info.commodityUnitPrice.commodity.memberId }))}`
......
......@@ -8,6 +8,7 @@ import { PublicApi } from '@/services/api'
import { numFormat } from '@/utils/numberFomat'
import moment from 'moment'
import { COMMODITY_TYPE } from '@/constants'
import { GlobalConfig } from '@/global/config'
const Commodity: React.FC = () => {
const [list, setList] = useState([])
......@@ -44,11 +45,11 @@ const Commodity: React.FC = () => {
el.href = `/shop/commodity/detail?id=${detail.commodity.id}&shopId=${btoa(JSON.stringify({ shopId: detail.storeId, memberId: detail.memberId }))}`;
break
case 3:
el.href = `/channelmall/commodity/detail?id=${detail.commodity.id}&channelId=${btoa(JSON.stringify({ memberId: detail.channelMemberId }))}`;
el.href = `${GlobalConfig.channelRootRoute}/commodity/detail?id=${detail.commodity.id}&channelId=${btoa(JSON.stringify({ memberId: detail.channelMemberId }))}`;
case 4:
el.href = `/ichannelmall/commodity/detail?id=${detail.commodity.id}&channelId=${btoa(JSON.stringify({ memberId: detail.channelMemberId }))}`;
el.href = `${GlobalConfig.ichannelRootRoute}/commodity/detail?id=${detail.commodity.id}&channelId=${btoa(JSON.stringify({ memberId: detail.channelMemberId }))}`;
case 5:
el.href = `/channelmall/commodity/detail?id=${detail.commodity.id}&channelId=${btoa(JSON.stringify({ memberId: detail.channelMemberId }))}`;
el.href = `${GlobalConfig.channelRootRoute}/commodity/detail?id=${detail.commodity.id}&channelId=${btoa(JSON.stringify({ memberId: detail.channelMemberId }))}`;
break
}
el.target = '_blank';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment