shish 2 месяцев назад
Родитель
Сommit
746604dcf7
2 измененных файлов с 10 добавлено и 3 удалено
  1. 8 2
      hdApp/src/admin/goods/list.vue
  2. 2 1
      mallApp/src/pages/goods/detail.vue

+ 8 - 2
hdApp/src/admin/goods/list.vue

@@ -400,15 +400,21 @@ export default {
     shareGoods() {
     shareGoods() {
       const that = this
       const that = this
       const id = this.currentInfo.id
       const id = this.currentInfo.id
+      const account = that.loginInfo.shopId
+      const categoryId = this.currentInfo.categoryId || this.catId || 0
       this.closeRightShow()
       this.closeRightShow()
-      const sharePath = 'pages/goods/detail?shopId=' + that.loginInfo.shopId + '&ghsShopAdminId=' + that.loginInfo.shopAdminId + '&id=' + id
+      // 商城花束详情需 account(门店)才能通过 /hd/info 建立会员 custom,与 category/mall 页跳转一致
+      let sharePath = 'pages/goods/detail?id=' + id + '&account=' + account + '&shopId=' + account
+      if (Number(categoryId) > 0) {
+        sharePath += '&categoryId=' + categoryId
+      }
       // #ifdef MP-WEIXIN
       // #ifdef MP-WEIXIN
       uni.navigateToMiniProgram({
       uni.navigateToMiniProgram({
         appId: that.getAppIdList.mall.miniAppId,
         appId: that.getAppIdList.mall.miniAppId,
         path: sharePath,
         path: sharePath,
         envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
         envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
         extraData: {
         extraData: {
-          shopId: that.loginInfo.shopId,
+          shopId: account,
           id: 0,
           id: 0,
           name: ''
           name: ''
         },
         },

+ 2 - 1
mallApp/src/pages/goods/detail.vue

@@ -157,7 +157,8 @@ export default {
       }
       }
       this.initializeOption(this.option);
       this.initializeOption(this.option);
       this.hdId = this.option.hdId || 0;
       this.hdId = this.option.hdId || 0;
-      this.account = this.option.account || 0;
+      // 外链/跨小程序进入时可能只带 shopId(与花材详情分享一致),需映射为 account
+      this.account = this.option.account || this.option.shopId || 0;
       const id = Number(this.option.id) || 0;
       const id = Number(this.option.id) || 0;
       const account = Number(this.option.account) || 0;
       const account = Number(this.option.account) || 0;
       if (id > 0 && account > 0) {
       if (id > 0 && account > 0) {