Commit 8bf207a4 authored by GuanHua's avatar GuanHua

Merge branch 'test' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into mobile

parents 0946ac14 c67d5578
......@@ -393,21 +393,21 @@ const AddLogistics: React.FC<{}> = () => {
})
break;
case 4:
PublicApi.getAsReplaceGoodsPageReturnCommodityByLogistics({ ...params, dataId: query.shipmentOrderId ? query.shipmentOrderId : query.relevanceOrderId }).then(res => {
PublicApi.getAsReplaceGoodsPageReturnCommodityByLogistics({ ...params, dataId: query.relevanceOrderId ? query.relevanceOrderId : query.shipmentOrderId }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
break;
case 5:
PublicApi.getAsReplaceGoodsPageReplaceCommodityByLogistics({ ...params, dataId: query.shipmentOrderId ? query.shipmentOrderId : query.relevanceOrderId }).then(res => {
PublicApi.getAsReplaceGoodsPageReplaceCommodityByLogistics({ ...params, dataId: query.relevanceOrderId ? query.relevanceOrderId : query.shipmentOrderId }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
})
break;
case 6:
PublicApi.getAsReturnGoodsPageCommodityByLogistics({ ...params, dataId: query.shipmentOrderId ? query.shipmentOrderId : query.relevanceOrderId }).then(res => {
PublicApi.getAsReturnGoodsPageCommodityByLogistics({ ...params, dataId: query.relevanceOrderId ? query.relevanceOrderId : query.shipmentOrderId }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
......@@ -19,6 +19,10 @@
line-height: 32px;
right: 0;
bottom: 0;
&.hide {
display: none;
}
}
:global {
......@@ -68,4 +72,4 @@
}
}
}
\ No newline at end of file
}
......@@ -22,13 +22,26 @@ const ProductDescription: React.FC<ProductDescriptionPropsType> = (props) => {
const [productIds, setProductIds] = useState<number[]>([])
const [tradeRecordCount, setTradeRecordCount] = useState<number>(0)
const [commentCount, setCommentCount] = useState<number>(0)
const [backTopVisible, setBackTopVisible] = useState<boolean>(false)
const handleAnchorChange = (currentActiveLink: string) => {
if (currentActiveLink) {
setBackTopVisible(true)
setCurrentAnchor(currentActiveLink)
}
}
const handleScroll = () => {
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
if(scrollTop === 0) {
setBackTopVisible(false)
}
}
useEffect(() => {
window.addEventListener('scroll', handleScroll)
}, [])
useEffect(() => {
if (commodityDetail) {
if (commodityDetail.unitPricePicList) {
......@@ -47,7 +60,13 @@ const ProductDescription: React.FC<ProductDescriptionPropsType> = (props) => {
<Link className={cx(currentAnchor === "#introduction" ? 'active' : '')} href="#introduction" title="产品简介" />
<Link href="#trade_record" title={commodityDetail?.priceType === COMMODITY_TYPE.integral ? `兑换记录${tradeRecordCount ? `(${tradeRecordCount})` : `(0)`}` : `交易记录${tradeRecordCount ? `(${tradeRecordCount})` : `(0)`}`} />
<Link href="#comment" title={`交易评价(${commentCount > 999 ? '999+' : commentCount})`} />
<BackTop className={styles.buy_now_btn} visibilityHeight={800} >立即订购</BackTop>
<BackTop
className={cx(styles.buy_now_btn, !backTopVisible ? styles.hide : null)}
visibilityHeight={800}
onClick={() => setBackTopVisible(false)}
>
{commodityDetail?.priceType === COMMODITY_TYPE.integral ? '立即兑换' : '立即订购'}
</BackTop>
</Anchor>
<Introduction commodityDetail={commodityDetail} />
<TradeRecord productIds={productIds} setCount={(count) => setTradeRecordCount(count)} />
......
......@@ -4,6 +4,7 @@ import { inject, observer } from 'mobx-react'
import cx from 'classnames'
import ImageBox from '@/components/ImageBox'
import { LAYOUT_TYPE } from '@/constants'
import ImageBox from '@/components/ImageBox'
import { PublicApi } from '@/services/api'
import { GlobalConfig } from '@/global/config'
import styles from './index.less'
......
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