shish 1 年之前
父節點
當前提交
2c03cb0239
共有 1 個文件被更改,包括 12 次插入5 次删除
  1. 12 5
      mallApp/src/pages/item/detail.vue

+ 12 - 5
mallApp/src/pages/item/detail.vue

@@ -85,7 +85,8 @@ export default {
       loginShow: false,
       showShare: false,
 			pageType: "cg",
-      autoLoad:false
+      autoLoad:false,
+      hdId:0
     };
   },
 	watch: {
@@ -111,15 +112,18 @@ export default {
     nextFn(num){
       let customData = {...this.data,bigCount: Number(num),smallCount:0,itemPrice:this.data.skPrice,bigPrice:this.data.skPrice,smallPrice:0}
       this.addItemEvent(customData)
-      let hdId = this.option.hdId ? this.option.hdId : 0
-      this.$util.pageTo({url:"/pages/billing/affirmGhs?account="+this.option.account+'&hdId='+hdId,type:2})
+      this.$util.pageTo({url:"/pages/billing/affirmGhs?account="+this.option.account+'&hdId='+this.hdId,type:2})
     },
     goShopIndex(){
-      let hdId = this.option.hdId ? this.option.hdId : 0
-      this.$util.pageTo({url:"/pages/item/item?account="+this.option.account+'&hdId='+hdId,type:2})
+      this.$util.pageTo({url:"/pages/item/item?account="+this.option.account+'&hdId='+this.hdId,type:2})
     },
     init() {
       let that = this
+
+      if(this.option.hdId && Number(this.option.hdId) > 0){
+        this.hdId = this.option.hdId
+      }
+
 			//扫码进来
 			if(this.option.scene){
 				const scene = decodeURIComponent(this.option.scene);
@@ -139,6 +143,9 @@ export default {
           uni.setStorageSync('account',account)
           getHdInfo().then(res=>{
             if(res.code == 1){
+              if(res.data.hd && res.data.hd.id){
+                this.hdId = res.data.hd.id
+              }
               that.getItemDetail(id,account)
             }
           })