绿满眶商城微信小程序-uniapp
peng
2025-11-06 d68fb476c248c6c3ab974ea6b18d6bba638f12d8
pages/product/goods.vue
@@ -212,10 +212,10 @@
            <u-icon size="34" class="red" name="home-fill"></u-icon>
            <view class="red icon-btn-name">店铺</view>
          </view>
          <view class="icon-btn-item" @click="linkMsgDetail()">
<!--          <view class="icon-btn-item" @click="linkMsgDetail()">
            <u-icon size="34" name="kefu-ermai"></u-icon>
            <view class="icon-btn-name">客服</view>
          </view>
          </view> -->
          <view class="icon-btn-item" @click="reluchToCart()">
            <u-icon size="34" name="storeping-cart"></u-icon>
            <view class="icon-btn-name">购物车</view>
@@ -529,7 +529,7 @@
 onShareAppMessage(e) {
       console.log("开始分享")
       console.log(this.goodsDetail)
       console.log(JSON.stringify(this.goodsDetail))
       // 返回一个Promise
       return new Promise((resolve) => {
          
@@ -581,6 +581,16 @@
         }
      });
   }
   const shareId =   uni.getStorageSync("shareId");
   if(shareId){
   let param = {
      addType:"SHARE_USER_REGISTRY",
      extend:"",
   }
   let extend = {shareId:shareId}
   param.extend = JSON.stringify(extend)
   addPrizeNum(param);
   }
   this.actionParam.pageParams = JSON.stringify(options)
     if(options.q){
        const queryParam = {
@@ -609,6 +619,18 @@
    // #ifdef MP-WEIXIN
    // #endif
   this.goodsDetail = {};
   //如果有参数ids说明事分销短连接,需要获取参数
   if (this.routerVal.scene) {
     getMpScene(this.routerVal.scene).then((res) => {
       if (res.data.success) {
         let data = res.data.result.split(","); // skuId,goodsId,distributionId
         this.init(data[0], data[1], data[2]);
       }
     });
   } else {
     this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
   }
  },
  
  onUnload() {
@@ -634,18 +656,18 @@
           userAction(param)
        }
     })   
    this.goodsDetail = {};
    //如果有参数ids说明事分销短连接,需要获取参数
    if (this.routerVal.scene) {
      getMpScene(this.routerVal.scene).then((res) => {
        if (res.data.success) {
          let data = res.data.result.split(","); // skuId,goodsId,distributionId
          this.init(data[0], data[1], data[2]);
        }
      });
    } else {
      this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
    }
    // this.goodsDetail = {};
    // //如果有参数ids说明事分销短连接,需要获取参数
    // if (this.routerVal.scene) {
    //   getMpScene(this.routerVal.scene).then((res) => {
    //     if (res.data.success) {
    //       let data = res.data.result.split(","); // skuId,goodsId,distributionId
    //       this.init(data[0], data[1], data[2]);
    //     }
    //   });
    // } else {
    //   this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
    // }
  },
  methods: {