绿满眶商城微信小程序-uniapp
peng
2025-11-06 d68fb476c248c6c3ab974ea6b18d6bba638f12d8
pages/prize/PrizeDetail/PrizeDetail.vue
@@ -77,7 +77,7 @@
            </view>
            <view class="modal-buttons" v-if="currentPrize.id !== 'notWIn'">
               <button class="confirm-btn" @tap="useItNow">去购物</button>
               <button class="confirm-btn" @tap="useItNow">去兑换</button>
            </view>
            <view class="modal-buttons" v-else>
               <button class="confirm-btn" @tap="closePrizeModal">确定</button>
@@ -254,19 +254,36 @@
        let extend = {shareId:shareId}
        param.extend = JSON.stringify(extend)
        addPrizeNum(param);    
        }
        
        let param2 = {
           addType:"USER_STAY_TIME",
           extend:"",
        }
        addPrizeNum(param2);
        }
      },
      async onLoad(option) {
         if(option.shareId){
            this.actionParam.shareId = option.shareId;
            this.actionParam.joinType = 'SHARE'
            console.log('触发onLoad')
            uni.setStorage({
               key: 'shareId',
               data: option.shareId,
               success: function () {
                  console.log('缓存shareId成功');
               }
            });
         }
         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(option)