Commit 3a334f51 authored by GuanHua's avatar GuanHua

feat:进货单商品添加链接

parent d0b1a0dc
......@@ -96,7 +96,7 @@ const CommodityDetail = (props) => {
case LAYOUT_TYPE.shop:
switch (priceType) {
case COMMODITY_TYPE.prompt:
getListFn = PublicApi.postSearchShopEnterpriseGetCommodityList
getListFn = PublicApi.postSearchShopStoreGetCommodityList
break
case COMMODITY_TYPE.inquiry:
getListFn = PublicApi.postSearchShopScoreGetCommodityList
......@@ -184,8 +184,8 @@ const CommodityDetail = (props) => {
initAttributeAndValueList(res.data)
getPayWayListByMemberId(res.data?.memberId)
if (res.data.customerCategory.category) {
fetchCommonCategoryCommodityList(res.data.customerCategory.category.id, res.data.priceType)
if (res.data.customerCategory) {
fetchCommonCategoryCommodityList(res.data.customerCategory.id, res.data.priceType)
}
if (getAuth() && res.data?.isMemberPrice) {
......
......@@ -82,7 +82,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
getListFn = PublicApi.postSearchShopChannelGetCommodityList
break
default:
getListFn = PublicApi.postSearchShopEnterpriseGetCommodityList
getListFn = PublicApi.postSearchShopStoreGetCommodityList
break
}
getListFn && getListFn(param, { headers }).then(res => {
......
......@@ -98,6 +98,10 @@
&_name {
color: #303133;
margin-bottom: 12px;
a {
color: #303133;
}
}
&_category {
......
......@@ -5,7 +5,7 @@ import Recommand from '../components/Recommand'
import cx from 'classnames'
import { Checkbox, Affix, message, Modal, Button } from 'antd'
import styles from './index.less'
import { history } from 'umi'
import { history, Link } from 'umi'
import { PublicApi } from '@/services/api'
import { priceFormat, numFormat } from "@/utils/numberFomat"
import { useLocalStore, observer } from 'mobx-react'
......@@ -597,6 +597,22 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
return maxItem
}
const getDetailLink = (info) => {
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 }))}`
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 }))}`
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 }))}`
break
}
return linkUrl
}
return (
<div className={styles.purchase_order}>
<div className={styles.purchase_order_container}>
......@@ -650,7 +666,9 @@ const PurchaseOrder: React.FC<PurchaseOrderPropsType> = (props) => {
<ImageBox width={80} height={80} imgUrl={childItem.commodityUnitPrice.commodityPic[0]} direction="column" />
</div>
<div>
<div className={styles.order_list_item_item_name}>{childItem.commodityUnitPrice.commodity.name}</div>
<div className={styles.order_list_item_item_name}>
<Link to={getDetailLink(childItem)}>{childItem.commodityUnitPrice.commodity.name}</Link>
</div>
<div className={styles.order_list_item_item_category}>
{
childItem.commodityUnitPrice.attributeAndValueList.map(attrItem => (
......
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