Commit 7d1c67f2 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 对接待发货订单拼团链接分享

parent e361acf8
......@@ -637,3 +637,9 @@ export const PurchaseOrderInsideWorkStateTexts = {
19: '已归档',
20: '待确认电子合同',
}
/** 需要app扫码 访问的h5下载链接地址 */
export const h5PageAddressByScan = 'http://download-h5.shushangyun.com:13880/download'
/** 需要app扫码 访问拼团详情链接地址 */
export const groupDetailByScan = 'http://pt-h5.shushangyun.com:13880/'
......@@ -26,9 +26,18 @@
span {
font-size: 12px;
}
.originPrice {
text-decoration: line-through;
color: #91959B;
margin-left: 5px;
}
}
& > p {
margin-bottom: 0;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}
}
}
......
......@@ -7,10 +7,10 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { getOrderBuyerValidateDeliveryPage } from '@/services/OrderNewV2Api'
import { getOrderBuyerDeliveryMiniAppCode, getOrderBuyerValidateDeliveryPage } from '@/services/OrderNewV2Api'
import { useIntl, history } from 'umi'
import TableOperation from '@/components/TableOperation'
import { ORDER_TYPE_POINTS } from '@/constants/order'
import { groupDetailByScan, ORDER_TYPE_POINTS } from '@/constants/order'
import SaleAfter from '../components/saleAfter'
import styles from './index.less'
import appImg from '@/assets/icons/app.png'
......@@ -73,23 +73,23 @@ const ReadyDelevedOrder:React.FC<ReadyDelevedOrderProps> = () => {
const [activityInfo, setActivityInfo] = useState<any>()
useEffect(() => {
console.log(activityInfo, 'aaa')
if(payModel === STORE_ENV_MAP["WEB"]) {
console.log(activityInfo, 'activityInfo')
const element = document.getElementById('linkInput')
element['value'] = `原价¥${activityInfo.price}${activityInfo.assembleNum}人团 ,只需¥${activityInfo.activityPrice}${activityInfo.productName} http://lx-${activityInfo.shopPrefix}.${TOP_DOMAIN}/shop/${activityInfo.supplierMemberId}_${activityInfo.supplierRoleId}/group/detail/${activityInfo.productId}?groupId=${activityInfo.groupId}`;
} else if(payModel === STORE_ENV_MAP["APP"]) {
// 生成二维码
QRCode.toDataURL(`lingxi://detail/${activityInfo.productId}/${activityInfo.shopId}/${activityInfo.skuId}/${activityInfo.groupId}`).then((url:any) => {
QRCode.toDataURL(`${groupDetailByScan}?commodityId=${activityInfo.skuId}&teamId=${activityInfo.groupId}&shopId=${activityInfo.shopId}&shopType=${activityInfo.shopType}`).then((url:any) => {
setQrCode(url)
}).catch((err) => {
console.error(err)
})
} else if(payModel === STORE_ENV_MAP["小程序"]){
// getOrderVendorMiniAppCode({orderId: currentPayRef.current.orderId + ''}).then(res => {
// setQrCode(res.data)
// })
getOrderBuyerDeliveryMiniAppCode({orderId: currentOrderRef.current.orderId + ''}).then(res => {
setQrCode(res.data)
})
}
}, [payModel])
}, [payModel, currentOrderRef.current])
// 售后唤起弹窗
const handleSaleAfter = ({ orderId, orderType }) => {
......@@ -148,7 +148,14 @@ const ReadyDelevedOrder:React.FC<ReadyDelevedOrderProps> = () => {
currentPayRef.current = data
currentOrderRef.current = record
// 加入商城链接前缀 拼团id和商城id
setActivityInfo({...data, shopPrefix: shopInfo.filter(item => item.id === record.shopId)[0]['url'], groupId: record.groupId, shopId: record.shopId})
const shop = shopInfo.filter(item => item.id === record.shopId)[0]
setActivityInfo({
...data,
shopPrefix: shop['url'],
groupId: record.groupId,
shopId: record.shopId,
shopType: shop['type']
})
setPayModel(data.environmentList[0])
})
setShareVisible(true)
......@@ -253,15 +260,14 @@ const ReadyDelevedOrder:React.FC<ReadyDelevedOrderProps> = () => {
footer={false}
width={600}
destroyOnClose={true}
afterClose={()=>setQrCode('')}
>
<div>
<div style={{marginBottom: 10}}>
<p>{intl.formatMessage({ id: 'saleOrder.xuanzeleixin', defaultMessage: '选择类型:' })}</p>
<Radio.Group onChange={onChangePayModel} value={payModel}>
{
activityInfo?.environmentList.map(item => Object.keys(EnvironmentStore).includes(item+'') && <>
<Radio value={item}>{EnvironmentStore[item]}</Radio>
</>)
activityInfo?.environmentList.map(item => Object.keys(EnvironmentStore).includes(item+'') && <Radio key={item} value={item}>{EnvironmentStore[item]}</Radio>)
}
</Radio.Group>
<p style={{marginTop: 24}}>
......@@ -302,11 +308,11 @@ const ReadyDelevedOrder:React.FC<ReadyDelevedOrderProps> = () => {
<Col span={16}>
<div className={styles.appPayCommodity}>
<div className={styles.commodityImage}>
<img src={activityInfo?.productImgUrl} alt="" width={88} height={88} />
<img src={activityInfo?.productImgUrl} alt={activityInfo?.productName} width={88} height={88} />
</div>
<div className={styles.commodityDescription}>
<p><Tag color="red">{activityInfo?.assembleNum}人团</Tag><span>{activityInfo?.productName}</span></p>
<p className={styles.commodityPrice}><span>{intl.formatMessage({ id: 'commodity.products.directChannel.columns.currency'})}</span>3580.00</p>
<p className={styles.commodityPrice}><span>{intl.formatMessage({ id: 'commodity.products.directChannel.columns.currency'})}</span>{Number(activityInfo?.activityPrice).toFixed(2)}<span className={styles.originPrice}>{Number(activityInfo?.price).toFixed(2)}</span></p>
</div>
</div>
</Col>
......@@ -334,17 +340,17 @@ const ReadyDelevedOrder:React.FC<ReadyDelevedOrderProps> = () => {
<Col span={16}>
<div className={styles.appPayCommodity}>
<div className={styles.commodityImage}>
<img src={miniappImg} alt="" width={88} height={88} />
<img src={activityInfo?.productImgUrl} alt={activityInfo?.productName} width={88} height={88} />
</div>
<div className={styles.commodityDescription}>
<p><Tag color="red">3人团</Tag><span>普卷 Q235B 4.5*1500 沧州铁直普卷 Q235B 4.5*1500 沧州铁直普卷 Q235B 4.5*1500 沧州铁直</span></p>
<p className={styles.commodityPrice}><span>{intl.formatMessage({ id: 'commodity.products.directChannel.columns.currency'})}</span>3580.00</p>
<p><Tag color="red">{activityInfo?.assembleNum}人团</Tag><span>{activityInfo?.productName}</span></p>
<p className={styles.commodityPrice}><span>{intl.formatMessage({ id: 'commodity.products.directChannel.columns.currency'})}</span>{Number(activityInfo?.activityPrice).toFixed(2)}<span className={styles.originPrice}>{Number(activityInfo?.price).toFixed(2)}</span></p>
</div>
</div>
</Col>
<Col span={8}>
<div className={styles.appPayQrCode}>
<img src={miniappImg} alt="" width={128} height={128} />
<div>{qrCode ? <img id="qrcodeElement" src={qrCode} alt="" width={130} height={130} /> : <Spin />}</div>
<p><img src={scanImg} alt="" width={16} height={16} />{intl.formatMessage({ id: 'saleOrder.saomacanyupintuan', defaultMessage: '扫码参与拼团' })}</p>
</div>
</Col>
......
......@@ -22,6 +22,7 @@ import { getOrderVendorGeneratePayLink, getOrderVendorMiniAppCode, getOrderVendo
import appImg from '@/assets/icons/app.png'
import miniappImg from '@/assets/icons/miniapp.png'
import scanImg from '@/assets/icons/scan.png'
import { h5PageAddressByScan } from '@/constants/order';
// 销售订单查询
......@@ -117,12 +118,7 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
payForm.setFieldsValue({'payChart': `${window.location.origin}/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${currentPayRef.current.orderId}`})
} else if(payModel === "app") {
// 生成二维码
QRCode.toDataURL(JSON.stringify({
path: 'MycommodityDetails',
orderId: currentPayRef.current.orderId,
buyerMemberId: currentPayRef.current.buyerMemberId,
buyerRoleId: currentPayRef.current.buyerRoleId
})).then((url:any) => {
QRCode.toDataURL(`${h5PageAddressByScan}?path=MycommodityDetails&orderId=${currentPayRef.current.orderId}`).then((url:any) => {
setQrCode(url)
}).catch((err:any) => {
console.error(err)
......
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