From eccbc8fe09ee3e7bc0adb2ba47b8c841a3c27675 Mon Sep 17 00:00:00 2001 From: maqian Date: Wed, 22 Oct 2025 16:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sp-poster/dw-distribution.alipay.js | 4 +- src/components/sp-poster/dw-distribution.js | 4 +- .../sp-poster/dw-goodsdetail.alipay.js | 2 +- src/components/sp-poster/dw-goodsdetail.js | 2 +- .../sp-poster/dw-guidecheckout.alipay.js | 2 +- src/components/sp-poster/dw-guidecheckout.js | 2 +- .../sp-poster/dw-guidegoodsdetail.alipay.js | 2 +- .../sp-poster/dw-guidegoodsdetail.js | 2 +- src/components/sp-poster/dw-invite.js | 2 +- src/components/sp-poster/dw-placeAnOrder.js | 4 +- src/components/sp-poster/dw-storeCode.js | 4 +- src/pages/custom/custom-page.js | 2 +- src/pages/index.js | 2 +- src/pages/item/espier-detail.js | 2 +- src/pages/recommend/detail.js | 2 +- src/pages/share-land.js | 69 ++++++++++++------- src/subpages/community/espier-detail.js | 2 +- src/subpages/community/group-leaderdetail.js | 2 +- src/subpages/guide/coupon-home/index.js | 2 +- src/subpages/guide/custom/custom-page.js | 2 +- src/subpages/guide/item/espier-detail.js | 2 +- src/subpages/guide/recommend/detail.js | 2 +- src/subpages/mdugc/note-detail.js | 2 +- src/subpages/member/index.js | 2 +- src/subpages/pointshop/espier-detail.js | 2 +- src/subpages/purchase/index.js | 2 +- src/subpages/store/index.js | 2 +- src/utils/index.js | 7 +- 28 files changed, 77 insertions(+), 59 deletions(-) diff --git a/src/components/sp-poster/dw-distribution.alipay.js b/src/components/sp-poster/dw-distribution.alipay.js index d33c8feb5..265fffd0a 100755 --- a/src/components/sp-poster/dw-distribution.alipay.js +++ b/src/components/sp-poster/dw-distribution.alipay.js @@ -32,12 +32,12 @@ class DistributionPoster { const { isOpenShop, shop_status, qrcode_bg_img } = this.info const { user_id, avatar } = this.userInfo // const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=${`pages/item/espier-detail`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}` - const url = (isOpenShop && shop_status == 1) ? `marketing/pages/distribution/shop-home` : `pages/index` + const type = (isOpenShop && shop_status == 1) ? `poster_shop_home` : `poster_home` let wxappCode // TODO 获取微信二维码的接口,需要换alipay https://ecshopx1.shopex123.com/api/h5app/alipaymini/qrcode.png?company_id=1&page=page/index // const res = await api.alipay.alipay_qrcode(`page=${`pages/item/espier-detail`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}`) const res = await Taro.request({ - url: `${host}/api/h5app/alipaymini/qrcode.png?path=pages/share-land&appid=${appid}&company_id=${company_id}&user_id=${user_id}target_path=${url}`, //仅为示例,并非真实的接口地址 + url: `${host}/api/h5app/alipaymini/qrcode.png?path=pages/share-land&appid=${appid}&company_id=${company_id}&user_id=${user_id}from_scene=${type}`, //仅为示例,并非真实的接口地址 header: { 'content-type': 'application/json' // 默认值 }, diff --git a/src/components/sp-poster/dw-distribution.js b/src/components/sp-poster/dw-distribution.js index 48ae2f070..9b46d6d6a 100644 --- a/src/components/sp-poster/dw-distribution.js +++ b/src/components/sp-poster/dw-distribution.js @@ -31,8 +31,8 @@ class DistributionPoster { // const { dtid } = // const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=${`pages/item/espier-detail`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}` - const url = (isOpenShop && shop_status == 1) ? `marketing/pages/distribution/shop-home` : `pages/index` - const wxappCode = `${process.env.APP_BASE_URL}/promoter/qrcode.png?path=pages/share-land&appid=${appid}&company_id=${company_id}&user_id=${user_id}&target_path=${url}` + const type = (isOpenShop && shop_status == 1) ? `poster_shop_home` : `poster_home` + const wxappCode = `${process.env.APP_BASE_URL}/promoter/qrcode.png?path=pages/share-land&appid=${appid}&company_id=${company_id}&user_id=${user_id}&from_scene=${type}` console.log('wxappCode:', wxappCode) const pic = qrcode_bg_img || `${process.env.APP_IMAGE_CDN}/fenxiao_bk.png` diff --git a/src/components/sp-poster/dw-goodsdetail.alipay.js b/src/components/sp-poster/dw-goodsdetail.alipay.js index 9bf992f61..7392fb874 100644 --- a/src/components/sp-poster/dw-goodsdetail.alipay.js +++ b/src/components/sp-poster/dw-goodsdetail.alipay.js @@ -39,7 +39,7 @@ class GoodsDetailPoster { // TODO 获取微信二维码的接口,需要换alipay https://ecshopx1.shopex123.com/api/h5app/alipaymini/qrcode.png?company_id=1&page=page/index // const res = await api.alipay.alipay_qrcode(`page=${`pages/item/espier-detail`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}`) const res = await Taro.request({ - url: `${host}/api/h5app/alipaymini/qrcode.png?page=${`pages/share-land`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}&target_path=pages/item/espier-detail`, //仅为示例,并非真实的接口地址 + url: `${host}/api/h5app/alipaymini/qrcode.png?page=${`pages/share-land`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}&from_scene=poster_espier_detail`, //仅为示例,并非真实的接口地址 header: { 'content-type': 'application/json' // 默认值 }, diff --git a/src/components/sp-poster/dw-goodsdetail.js b/src/components/sp-poster/dw-goodsdetail.js index 9e6cf15a0..f2119a6e9 100644 --- a/src/components/sp-poster/dw-goodsdetail.js +++ b/src/components/sp-poster/dw-goodsdetail.js @@ -39,7 +39,7 @@ class GoodsDetailPoster { const { itemId, imgs, price, distributorId } = this.info const { user_id, avatar } = this.userInfo || {} - const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=${`pages/share-land`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}&dtid=${distributorId}&target_path=pages/item/espier-detail` + const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=${`pages/share-land`}&appid=${appid}&company_id=${company_id}&id=${itemId}&uid=${user_id}&dtid=${distributorId}&from_scene=poster_espier_detail` // TODO 获取微信二维码的接口,需要换alipay https://ecshopx1.shopex123.com/api/h5app/alipaymini/qrcode.png?company_id=1&page=page/index const pic = imgs[0].replace('http:', 'https:') diff --git a/src/components/sp-poster/dw-guidecheckout.alipay.js b/src/components/sp-poster/dw-guidecheckout.alipay.js index 47fd91bf9..914f2be28 100644 --- a/src/components/sp-poster/dw-guidecheckout.alipay.js +++ b/src/components/sp-poster/dw-guidecheckout.alipay.js @@ -40,7 +40,7 @@ class GuideCheckoutPoster { * distributor_id: 103,//门店id */ const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land& - appid=${appid}&company_id=${company_id}&cxdid=${salesPromotionId}&smid=${salesperson_id}&distributor_id=${distributor_id}&gu=${gu}&target_path=pages/cart/espier-checkout` + appid=${appid}&company_id=${company_id}&cxdid=${salesPromotionId}&smid=${salesperson_id}&distributor_id=${distributor_id}&gu=${gu}&from_scene=poster_espier_checkout` console.log('GuideCheckoutPoster-wxappCode:', wxappCode) // 太阳码 diff --git a/src/components/sp-poster/dw-guidecheckout.js b/src/components/sp-poster/dw-guidecheckout.js index 9dd863aa6..6169afb8d 100644 --- a/src/components/sp-poster/dw-guidecheckout.js +++ b/src/components/sp-poster/dw-guidecheckout.js @@ -40,7 +40,7 @@ class GuideCheckoutPoster { * distributor_id: 103,//门店id */ const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land& - appid=${appid}&company_id=${company_id}&cxdid=${salesPromotionId}&smid=${salesperson_id}&distributor_id=${distributor_id}&gu=${gu}&target_path=pages/cart/espier-checkout` + appid=${appid}&company_id=${company_id}&cxdid=${salesPromotionId}&smid=${salesperson_id}&distributor_id=${distributor_id}&gu=${gu}&from_scene=poster_espier_checkout` console.log('wxappCode:', wxappCode) // 太阳码 diff --git a/src/components/sp-poster/dw-guidegoodsdetail.alipay.js b/src/components/sp-poster/dw-guidegoodsdetail.alipay.js index 94265cff5..36f695fb4 100644 --- a/src/components/sp-poster/dw-guidegoodsdetail.alipay.js +++ b/src/components/sp-poster/dw-guidegoodsdetail.alipay.js @@ -29,7 +29,7 @@ class GuideGoodsDetailPoster { const { itemId, imgs, price, subtaskId } = this.info const { salesperson_id, avatar, company_id, work_userid, shop_code } = this.userInfo const gu = `${work_userid}_${shop_code}` - const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&id=${itemId}&smid=${salesperson_id}&subtask_id=${subtaskId}&gu=${gu}&target_path=pages/item/espier-detail` + const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&id=${itemId}&smid=${salesperson_id}&subtask_id=${subtaskId}&gu=${gu}&from_scene=poster_espier_detail` console.log('GuideGoodsDetailPoster-wxappCode:', wxappCode) const pic = imgs[0].replace('http:', 'https:') diff --git a/src/components/sp-poster/dw-guidegoodsdetail.js b/src/components/sp-poster/dw-guidegoodsdetail.js index d84bf9b71..7ffb69c68 100644 --- a/src/components/sp-poster/dw-guidegoodsdetail.js +++ b/src/components/sp-poster/dw-guidegoodsdetail.js @@ -39,7 +39,7 @@ class GuideGoodsDetailPoster { const { itemId, imgs, price, subtaskId } = this.info const { salesperson_id, avatar, company_id, work_userid, shop_code } = this.userInfo const gu = `${work_userid}_${shop_code}` - const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&id=${itemId}&smid=${salesperson_id}&subtask_id=${subtaskId}&gu=${gu}&target_path=pages/item/espier-detail` + const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&id=${itemId}&smid=${salesperson_id}&subtask_id=${subtaskId}&gu=${gu}&from_scene=poster_espier_detail` console.log('wxappCode:', wxappCode) const pic = imgs[0].replace('http:', 'https:') diff --git a/src/components/sp-poster/dw-invite.js b/src/components/sp-poster/dw-invite.js index 3934586f3..ccb8904ed 100644 --- a/src/components/sp-poster/dw-invite.js +++ b/src/components/sp-poster/dw-invite.js @@ -30,7 +30,7 @@ class GoodsDetailPoster { const data = await api.purchase.getEmployeeInviteCode({ enterprise_id, activity_id }) debugger - const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&code=${data.invite_code}&eid=${enterprise_id}&aid=${activity_id}&target_path=pages/purchase/auth` + const wxappCode = `${host}/wechatAuth/wxapp/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&code=${data.invite_code}&eid=${enterprise_id}&aid=${activity_id}&from_scene=poster_purchase_auth` console.log('wxappCode:', wxappCode) const pic = sharePic diff --git a/src/components/sp-poster/dw-placeAnOrder.js b/src/components/sp-poster/dw-placeAnOrder.js index e3c741d9d..f0bb214f5 100644 --- a/src/components/sp-poster/dw-placeAnOrder.js +++ b/src/components/sp-poster/dw-placeAnOrder.js @@ -26,9 +26,9 @@ class StoreCode { async drawPoster() { const { orderId, detailInfo, totalInfo } = this.info const { appid, company_id } = getExtConfigData() - const path = `subpages/trade/detail` + const path = `poster_trade_detail` // const path = `subpages/member/index` - const wxappCode = `${process.env.APP_BASE_URL}/promoter/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&order_id=${orderId}&target_path=${path}` + const wxappCode = `${process.env.APP_BASE_URL}/promoter/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&order_id=${orderId}&from_scene=${path}` const pic = `${process.env.APP_IMAGE_CDN}/bg_fxhb.png` // 背景图片 diff --git a/src/components/sp-poster/dw-storeCode.js b/src/components/sp-poster/dw-storeCode.js index e9c21e989..de59473fc 100644 --- a/src/components/sp-poster/dw-storeCode.js +++ b/src/components/sp-poster/dw-storeCode.js @@ -25,8 +25,8 @@ class StoreCode { async drawPoster() { const { appid, company_id } = getExtConfigData() - const path = `subpages/store/index` - const wxappCode = `${process.env.APP_BASE_URL}/promoter/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&uid=${this.info.user_id}&dtid=${this.info.distributor_id}&qr=Y&target_path=${path}` + const path = `poster_store_index` + const wxappCode = `${process.env.APP_BASE_URL}/promoter/qrcode.png?page=pages/share-land&appid=${appid}&company_id=${company_id}&uid=${this.info.user_id}&dtid=${this.info.distributor_id}&qr=Y&from_scene=${path}` const pic = `${process.env.APP_IMAGE_CDN}/bg_fxhb.png` console.log('goods pic:', pic) diff --git a/src/pages/custom/custom-page.js b/src/pages/custom/custom-page.js index 06a15488b..99eec088c 100644 --- a/src/pages/custom/custom-page.js +++ b/src/pages/custom/custom-page.js @@ -111,7 +111,7 @@ function CustomPage(props) { if (userId) { params.uid = userId } - const path = buildSharePath('/pages/custom/custom-page', params) + const path = buildSharePath('poster_custom_page', params) log.debug(`getAppShareInfo: ${path}`) return { diff --git a/src/pages/index.js b/src/pages/index.js index 70d62f1d3..00704149b 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -146,7 +146,7 @@ function Home() { if (VERSION_STANDARD) { params = Object.assign(params, { dtid: getCurrentShopId() }) } - const path = buildSharePath('/pages/index', params) + const path = buildSharePath('poster_home', params) console.log('useShareAppMessage path:', path, params) diff --git a/src/pages/item/espier-detail.js b/src/pages/item/espier-detail.js index 0f81a7f1b..fa07ff9d1 100644 --- a/src/pages/item/espier-detail.js +++ b/src/pages/item/espier-detail.js @@ -240,7 +240,7 @@ function EspierDetail(props) { if (userInfo) { query['uid'] = userInfo.user_id } - const path = buildSharePath('/pages/item/espier-detail', query) + const path = buildSharePath('poster_espier_detail', query) log.debug(`share path: ${path}`) return { title: itemName, diff --git a/src/pages/recommend/detail.js b/src/pages/recommend/detail.js index ac64701fb..c5fd785c1 100644 --- a/src/pages/recommend/detail.js +++ b/src/pages/recommend/detail.js @@ -47,7 +47,7 @@ function GuideRecommendDetail(props) { gu: `${work_userid}_${shop_code}`, subtask_id } - const sharePath = buildSharePath('/pages/recommend/detail', query) + const sharePath = buildSharePath('poster_recommend_detail', query) log.debug(`【/pages/recommend/detail】onShareAppMessage path: ${sharePath}`) return { title: title, diff --git a/src/pages/share-land.js b/src/pages/share-land.js index facc2b2d0..debe53f6b 100644 --- a/src/pages/share-land.js +++ b/src/pages/share-land.js @@ -9,11 +9,10 @@ import { entryLaunch, showToast } from '@/utils' /** * 统一分享落地页 * 参数说明: - * - target_path: 目标页面路径 (必传, 如: target_path=pages/index) - * - 其余参数会自动携带到目标页面 target_path=pages/item/espier-detail&id=123 + * - from_scene: 目标页面类型 (必传, 如: from_scene=xxxx_xxx_xxx) + * - 通过from_scene匹配对应的页面进行跳转 * * 兼容旧的场景: - * - from_scene: 导购欢迎语场景 * - t: 特殊场景标识(如处方药) * @returns */ @@ -36,47 +35,65 @@ function ShareIand() { entryLaunch.postGuideTask() // 导购任务上报 } } - debugger - // 处理导购欢迎语场景 - if (/^guide_welcome/.test(routeParams?.from_scene)) { - handleGuideWelcome(routeParams) - return - } - - // 处理处方药场景 if (routeParams?.t == 1) { handlePrescription(routeParams) - return + } else { + handleShareLand(routeParams) } - - // 处理通用分享场景 - if (routeParams?.target_path) { - debugger - handleGeneralShare(routeParams) - return - } - - // 默认跳转到首页 - Taro.redirectTo({ url: '/pages/index' }) } - // 处理导购欢迎语 - const handleGuideWelcome = (routeParams) => { + // 处理落地页类型 + const handleShareLand = (routeParams) => { + const { from_scene, ...otherParams } = routeParams const welcomeRoutes = { + // 导购欢迎语 'guide_welcome_home': '/pages/index', // 导购欢迎语--商城首页 'guide_welcome_category': '/pages/category/index', // 导购欢迎语--商城分类页 'guide_welcome_couponlist': '/subpages/marketing/coupon-center', // 导购欢迎语--商城优惠券中心 'guide_welcome_recommend': '/pages/recommend/list', // 导购欢迎语--商城种草 'guide_welcome_member': '/subpages/member/index', // 导购欢迎语--商城会员中心 - 'guide_welcome_itemlist': '/pages/item/list' // 导购欢迎语--商城商品列表 + 'guide_welcome_itemlist': '/pages/item/list', // 导购欢迎语--商城商品列表 + + // 导购任务 + 'guide_task_home': '/pages/index', // 导购任务-管理端-小程序首页 + 'guide_task_gucustom': '/subpages/guide/custom/custom-page', // 导购任务-管理端-导购货架自定义页 + 'guide_task_gucoupon': '/subpages/guide/coupon-home/index', // 导购任务-小程序-优惠券转发 + 'guide_task_gugoods': '/subpages/guide/item/espier-detail', // 导购任务-小程序-商品转发 + 'guide_task_goods': '/pages/item/espier-detail', // 导购任务-小程序-商品海报 + + // 商城小程序 + 'poster_home': '/pages/index', // 小程序-海报分享&页面转发-店务小店 + 'poster_shop_home': '/marketing/pages/distribution/shop-home', // 小程序-海报分享&页面转发-店务小店 + 'poster_espier_detail': '/pages/item/espier-detail', // 小程序-海报分享-商品详情 + 'poster_espier_checkout': '/pages/cart/espier-checkout', // 小程序-海报分享&页面转发-商品详情 + 'poster_purchase_auth': '/pages/purchase/auth', // 小程序-海报分享&页面转发-内购邀请 + 'poster_trade_detail': '/subpages/trade/detail', // 小程序-海报分享&页面转发-交易详情 + 'poster_store_index': '/subpages/store/index', // 小程序-海报分享&页面转发-店铺首页 + 'poster_custom_page': '/pages/custom/custom-page', // 小程序-海报分享&页面转发-自定义页 + 'poster_recommend_detail': '/pages/recommend/detail', // 小程序-海报分享&页面转发-种草详情 + 'poster_community_memberdetail': '/subpages/community/group-memberdetail', // 小程序-海报分享&页面转发-社区 + 'poster_coupon_center': '/subpages/marketing/coupon-center', // 小程序-海报分享&页面转发-领券中心 + 'poster_mdugc_detail': '/subpages/mdugc/note-detail', // 小程序-海报分享&页面转发-笔记详情 + 'poster_pointshop_espier_detail': '/subpages/pointshop/espier-detail', // 小程序-海报分享&页面转发-积分商品详情 } - const targetUrl = welcomeRoutes[routeParams.from_scene] + // 过滤掉内部使用的参数 + const filteredParams = { ...otherParams } + delete filteredParams.scene + delete filteredParams.$taroTimestamp + const queryString = qs.stringify(filteredParams) + + const targetUrl = queryString ? `${welcomeRoutes[from_scene]}?${queryString}` : welcomeRoutes[from_scene] + console.log('导购任务分享跳转:', targetUrl) + if (targetUrl) { Taro.redirectTo({ url: targetUrl }) } else { showToast('未匹配到参数') + setTimeout(() => { + Taro.redirectTo({ url: '/pages/index' }) + }, 1500); } } diff --git a/src/subpages/community/espier-detail.js b/src/subpages/community/espier-detail.js index 371c8195b..303feab92 100644 --- a/src/subpages/community/espier-detail.js +++ b/src/subpages/community/espier-detail.js @@ -184,7 +184,7 @@ function EspierDetail(props) { if (userInfo) { query['uid'] = userInfo.uid } - const path = buildSharePath('/pages/item/espier-detail', query) + const path = buildSharePath('poster_espier_detail', query) log.debug(`share path: ${path}`) return { title: itemName, diff --git a/src/subpages/community/group-leaderdetail.js b/src/subpages/community/group-leaderdetail.js index 2aabd6ba6..ef5408e8f 100644 --- a/src/subpages/community/group-leaderdetail.js +++ b/src/subpages/community/group-leaderdetail.js @@ -52,7 +52,7 @@ function GroupLeaderDetail(props) { } useShareAppMessage(() => { - const path = buildSharePath('/subpages/community/group-memberdetail', { activity_id: detail.activityId }) + const path = buildSharePath('poster_community_memberdetail', { activity_id: detail.activityId }) log.debug(`share path: ${path}`) return { imageUrl: shareImageUrl, diff --git a/src/subpages/guide/coupon-home/index.js b/src/subpages/guide/coupon-home/index.js index 872a34d3b..8f881da4f 100644 --- a/src/subpages/guide/coupon-home/index.js +++ b/src/subpages/guide/coupon-home/index.js @@ -72,7 +72,7 @@ function GuideCouponIndex(props) { // subtask_id: subtaskId } - const path = buildSharePath('/subpages/marketing/coupon-center', query) + const path = buildSharePath('poster_coupon_center', query) log.debug(`getAppShareInfo: ${path}`) return { title: title, diff --git a/src/subpages/guide/custom/custom-page.js b/src/subpages/guide/custom/custom-page.js index 7c0f38cf8..21e0c624d 100644 --- a/src/subpages/guide/custom/custom-page.js +++ b/src/subpages/guide/custom/custom-page.js @@ -78,7 +78,7 @@ function GuideCustomPage() { gu: `${work_userid}_${shop_code}`, subtask_id } - const path = buildSharePath('/pages/custom/custom-page', query) + const path = buildSharePath('poster_custom_page', query) log.debug(`share path: ${path}`) return { diff --git a/src/subpages/guide/item/espier-detail.js b/src/subpages/guide/item/espier-detail.js index 57a6294e0..24caf032f 100644 --- a/src/subpages/guide/item/espier-detail.js +++ b/src/subpages/guide/item/espier-detail.js @@ -201,7 +201,7 @@ function EspierDetail(props) { gu: `${work_userid}_${shop_code}`, subtask_id: subtaskId } - const path = buildSharePath('/pages/item/espier-detail', query) + const path = buildSharePath('poster_espier_detail', query) console.log('gu---------------------',path) log.debug(`share path: ${path}`) return { diff --git a/src/subpages/guide/recommend/detail.js b/src/subpages/guide/recommend/detail.js index 4b1e16435..ce6c5b338 100644 --- a/src/subpages/guide/recommend/detail.js +++ b/src/subpages/guide/recommend/detail.js @@ -46,7 +46,7 @@ function GuideRecommendDetail(props) { gu: `${work_userid}_${shop_code}`, subtask_id } - const sharePath = buildSharePath('/pages/recommend/detail', query) + const sharePath = buildSharePath('poster_recommend_detail', query) log.debug(`【guide/recommend/detail】onShareAppMessage path: ${sharePath}`) return { title: title, diff --git a/src/subpages/mdugc/note-detail.js b/src/subpages/mdugc/note-detail.js index b7ccb1657..a0eea39d2 100644 --- a/src/subpages/mdugc/note-detail.js +++ b/src/subpages/mdugc/note-detail.js @@ -131,7 +131,7 @@ function UgcNoteDetail(props) { draft.info['shareNums'] = shareInfo.share_nums }) } - const path = buildSharePath('/subpages/mdugc/note-detail', { post_id }) + const path = buildSharePath('poster_mdugc_detail', { post_id }) console.log(`useShareAppMessage:`, path) return { title: info.title, diff --git a/src/subpages/member/index.js b/src/subpages/member/index.js index 2abdcb67e..e221aa462 100644 --- a/src/subpages/member/index.js +++ b/src/subpages/member/index.js @@ -186,7 +186,7 @@ function MemberIndex(props) { const { logo } = await api.distribution.getDistributorInfo({ distributor_id: 0 }) - const path = buildSharePath('/pages/index', {}) + const path = buildSharePath('poster_home', {}) return { title: share_title, imageUrl: share_pic_wechatapp || logo, diff --git a/src/subpages/pointshop/espier-detail.js b/src/subpages/pointshop/espier-detail.js index 41bedd70d..60b5f279b 100644 --- a/src/subpages/pointshop/espier-detail.js +++ b/src/subpages/pointshop/espier-detail.js @@ -168,7 +168,7 @@ function PointShopEspierDetail(props) { if (userInfo) { query['uid'] = userInfo.user_id } - const path = buildSharePath('/subpages/pointshop/espier-detail', query) + const path = buildSharePath('poster_pointshop_espier_detail', query) log.debug(`share path: ${path}`) return { title: itemName, diff --git a/src/subpages/purchase/index.js b/src/subpages/purchase/index.js index cfe368726..d06f4c29c 100644 --- a/src/subpages/purchase/index.js +++ b/src/subpages/purchase/index.js @@ -174,7 +174,7 @@ function Home() { enterprise_id, activity_id } - const path = buildSharePath('/pages/purchase/auth', params) + const path = buildSharePath('poster_purchase_auth', params) log.debug(path) resolve({ title: activityInfo.name, diff --git a/src/subpages/store/index.js b/src/subpages/store/index.js index 72f119a59..3fe356287 100644 --- a/src/subpages/store/index.js +++ b/src/subpages/store/index.js @@ -270,7 +270,7 @@ function StoreIndex() { const query = { dtid } - const path = buildSharePath('/subpages/store/index', query) + const path = buildSharePath('poster_store_index', query) log.debug(`share path: ${path}`) return { title: storeInfo?.name, diff --git a/src/utils/index.js b/src/utils/index.js index 0d6d92ff5..21db51f17 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -885,16 +885,17 @@ export const pxToUnitRpx = (px) => { /** * 构建统一分享路径 - * @param {string} target_path - 目标页面路径 + * @param {string} from_scene - 目标页面类型 * @param {object} params - 路径参数 * @returns {string} 统一的分享落地页路径 */ -export function buildSharePath(target_path, params = {}) { +export function buildSharePath(from_scene, params = {}) { const shareParams = { - target_path: target_path, + from_scene: from_scene, ...params } const queryString = qs.stringify(shareParams) + debugger return `/pages/share-land${queryString ? '?' + queryString : ''}` }