瀏覽代碼

fix bug: 获取 customId,传输正确的customId

shizhongqi 1 年之前
父節點
當前提交
e555bf0a96
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      mallApp/src/pages/goods/detail.vue

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

@@ -114,6 +114,7 @@ export default {
       popupShow: false,
       hdId: 0,
       account:0,
+      customId:0,
       title: "",
       previewContent: [],
       common_title: "",
@@ -170,6 +171,7 @@ export default {
         this.imgList = newArr;
         res.data.stock = res.data.stock ? parseInt(res.data.stock) : 0;
         this.data = res.data;
+        this.customId = res.data.customId;
 
         //商品描述
         this.title = res.data.picTextGoods && res.data.picTextGoods.title || "";
@@ -210,10 +212,13 @@ export default {
       // #endif
     },
     goChat(){
-      const account = uni.getStorageSync('account') || this.account || (this.shopUser && this.shopUser.account) || '';
+      if(!this.customId){
+        this.$msg("数据异常,请稍后再试");
+        return;
+      }
       this.$util.pageTo({
         url: "/pages/chat/chatPage",
-        query: { customId: this.loginInfo.id, shopId: this.shopInfo.shopId, name: this.shopInfo.name, account: this.shopInfo.account, avatar: this.shopInfo.avatar }
+        query: { customId: this.customId, shopId: this.shopInfo.shopId, name: this.shopInfo.name, account: this.shopInfo.account, avatar: this.shopInfo.avatar }
       });
     }
   },