fix(custom): 代客下单-参数传递

This commit is contained in:
maqian
2025-11-06 11:27:45 +08:00
parent ffd550571c
commit 8c8b651716
3 changed files with 11 additions and 7 deletions

View File

@@ -149,6 +149,8 @@ function CartCheckout(props) {
scene, // 情景值
goodType = routerParams.goodType
} = $instance?.router?.params || {}
const { scene: launchScene } = Taro.getLaunchOptionsSync()
const senceCode = [1011, 1012, 1013, 1047, 1048, 1049] // 扫码进来-代客下单
console.log('$instance.router?.params:', $instance.router)
useEffect(() => {
@@ -500,7 +502,7 @@ function CartCheckout(props) {
if (couponInfo?.coupon_code) {
url = `${url}&coupon=${couponInfo?.coupon_code}`
}
if (storageParams?.cxdid && scene) {
if (storageParams?.cxdid && senceCode.includes(launchScene)) {
url = `${url}&cxdid=${storageParams?.cxdid}`
}
Taro.navigateTo({
@@ -831,7 +833,7 @@ function CartCheckout(props) {
distributor_id: receiptType === 'ziti' && ziti_shopid ? ziti_shopid : shop_id
}
// 处理导购数据(旧)
if (storageParams?.cxdid && scene) {
if (storageParams?.cxdid && senceCode.includes(launchScene)) {
debugger
cus_parmas.cxdid = storageParams?.cxdid;
cus_parmas.distributor_id = storageParams?.dtid;

View File

@@ -96,15 +96,12 @@ function ShareIand() {
// 过滤掉内部使用的参数
const filteredParams = { ...otherParams }
// delete filteredParams.scene
delete filteredParams.scene
delete filteredParams.$taroTimestamp
if (router.params?.scene) { // 跳转的时候需要把scene参数传递过去,不然代客下单的时候会有问题
filteredParams.scene = router.params.scene
}
const queryString = qs.stringify(filteredParams)
const targetUrl = queryString ? `${welcomeRoutes[from_scene]}?${queryString}` : welcomeRoutes[from_scene]
console.log('导购任务分享跳转:', targetUrl)
console.log('导购任务分享跳转:', targetUrl, welcomeRoutes[from_scene])
if (welcomeRoutes[from_scene]) {
Taro.redirectTo({ url: targetUrl })

View File

@@ -12638,5 +12638,10 @@
"zh-cn": "开票失败",
"en": "",
"zh-tw": ""
},
"hp8xmu6": {
"zh-cn": "页面跳转失败",
"en": "",
"zh-tw": ""
}
}