绿满眶商城微信小程序-uniapp
zhanghua
2025-10-15 50eac4101c827bc7202b8259534eed70aa909a49
Merge branch 'dev_fix_sub' of http://42.193.1.25:9521/r/lmk-shop-wx into dev_fix_sub
27个文件已修改
4个文件已添加
2447 ■■■■■ 已修改文件
api/members.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/prize.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/store-coupon.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/userAction.js 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/coupon/couponCenter.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/coupon/myCoupon.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/payment/payOrder.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cart/payment/success.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/commodity-square/commoditySquare.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cusbar/cart/cartList.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/cusbar/video/video.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/health/healthVideo.vue 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/kitchen/KitchenVideo.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mine/activity/detail.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mine/activity/reportActivity.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/afterSales/afterSales.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/afterSales/afterSalesDetail.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/afterSales/afterSalesSelect.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/fillorder.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/myOrder.vue 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/orderDetail.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/prize/PrizeDetail/PrizeDetail.vue 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/product/goods.vue 133 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/storeClaim/store-claim.vue 365 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/storeClaim/storePrizeClaim.vue 401 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tabbar/index/home.vue 112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tabbar/user/my.vue 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/video/video-goods-detail-swiper.vue 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/video/video-goods-detail.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/video/video-similar.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/members.js
@@ -481,3 +481,10 @@
        data:params
    });
}
export function bindMemberAndStore(params){
  return http.request({
    url: '/lmk/member/bindMemberAndStore',
    method: Method.PUT,
    data:params
  });
}
api/prize.js
@@ -57,4 +57,17 @@
        method: Method.POST,
        needToken: true
    });
}
/**
 * 增加抽奖机会
 *
 * @param params
 */
export function addPrizeNum(data) {
    return http.request({
        url: `/lmk/prize/addPrizeNum`,
        method: Method.POST,
        needToken: true,
        data:data
    });
}
api/store-coupon.js
New file
@@ -0,0 +1,52 @@
import { http, Method } from "@/utils/request.js";
/**
 * 根据店铺优惠券关联ID获取优惠券详情
 * @param {string|number} storeCoupRef - 店铺优惠券关联ID
 * @returns {Promise} 返回优惠券详情
 */
export function getStoreCouponDetail(storeCoupRef) {
  return http.request({
    url: `/lmk/store/coupon/${storeCoupRef}`,
    method: Method.GET,
    needToken: true,
  });
}
/**
 * 领取店铺优惠券
 * @param {string|number} storeCoupRef - 店铺优惠券关联ID
 * @returns {Promise} 返回领取结果
 */
export function claimStoreCoupon(storeCoupRef) {
  return http.request({
    url: `/lmk/store/coupon/${storeCoupRef}`,
    method: Method.POST,
    needToken: true,
  });
}
/**
 * 根据店铺优惠券关联ID获取优惠券详情
 * @param {string|number} storeCoupRef - 店铺优惠券关联ID
 * @returns {Promise} 返回优惠券详情
 */
export function getStorePrize(storeCoupRef) {
  return http.request({
    url: `/lmk/store/prize/${storeCoupRef}`,
    method: Method.GET,
    needToken: true,
  });
}
/**
 * 领取店铺优惠券
 * @param {string|number} storeCoupRef - 店铺优惠券关联ID
 * @returns {Promise} 返回领取结果
 */
export function claimPrize(storeCoupRef) {
  return http.request({
    url: `/lmk/store/prize/${storeCoupRef}`,
    method: Method.POST,
    needToken: true,
  });
}
api/userAction.js
New file
@@ -0,0 +1,45 @@
/**
 * 活动相关API
 */
import { http, Method } from "@/utils/request.js";
import api from "@/config/api.js";
/**
 * 获取会话id
 *
 * @param params
 */
 export function getSessionId() {
  return http.request({
    url: "/lmk/action-record/sessionId",
    method: Method.GET,
    needToken: true
  });
}
/**
 * 插入用户行为
 *
 * @param params
 */
 export function userAction(data) {
  return http.request({
    url: "/lmk/action-record",
    method: Method.POST,
    needToken: true,
    data:data
  });
}
/**
 * 分享和点击分享
 *
 * @param params
 */
 export function userShare(data) {
  return http.request({
    url: "/lmk/action-record/share",
    method: Method.POST,
    needToken: true,
    data:data
  });
}
pages.json
@@ -198,6 +198,7 @@
    //   "path": "pages/tabbar/user/my",
    //   "style": {
    //     "navigationBarTextStyle": "white",
    //     "navigationBarTextStyle": "white",
    //     "enablePullDownRefresh": true,
    //     "navigationStyle": "custom",
    //     "componentPlaceholder": {
@@ -1569,7 +1570,13 @@
        {
          "path": "complain/complainInfo",
          "style": {
            "navigationBarTitleText": "投诉详情"
            "navigationBarTitleText": "投诉详情",
            "componentPlaceholder": {
              "u-image": "view",
              "u-cell-group": "view",
              "u-cell-item": "view",
              "u-input": "view"
            }
          }
        },
        {
@@ -2247,7 +2254,44 @@
          }
        }
      ]
    }
    },
    {
      "root": "pages/storeClaim",
      "pages": [{
          "path" : "store-claim",
          "style" :
          {
              "navigationBarTitleText" : "优惠卷领取",
            "componentPlaceholder":{
                "u-card": "view",
                "u-navbar": "view",
                "u-tag": "view",
                "u-icon": "view",
                "u-button": "view",
                "u-empty": "view"
            }
          }
      },
      {
          "path" : "storePrizeClaim",
          "style" :
          {
              "navigationBarTitleText" : "领取抽奖机会",
            "componentPlaceholder":{
                "u-card": "view",
                "u-navbar": "view",
                "u-tag": "view",
                "u-icon": "view",
                "u-button": "view",
                "u-empty": "view",
                "u-image":"view"
            }
          }
      }]
    }
  ],
  "globalStyle": {
    "navigationBarTextStyle": "black",
pages/cart/coupon/couponCenter.vue
@@ -54,6 +54,7 @@
    import {
        getAllCoupons
    } from "@/api/promotions.js";
    import { getSessionId, userAction } from "@/api/userAction.js";
    export default {
        data() {
            return {
@@ -65,10 +66,45 @@
                    pageSize: 10,
                },
                storeId: "", //店铺 id,
                couponData: ""
                couponData: "",
        sendOnShow:false,
                  pageSessionNo:"",
                  actionParam:{
                        sessionId:'',
                        actionType:"PAGE",
                        joinType:"SELF",
                        pageCode:"COUPON_CENTER",
                        pageParams:"{}",
                        pageStatus:"JOIN",
                        pageType:"LIST"
                    }
            };
        },
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
        onShow() {
          getSessionId().then(res=>{
            this.pageSessionNo = res.data.data
            this.actionParam.sessionId = this.pageSessionNo
            if(this.pageSessionNo){
            let param = Object.assign({}, this.actionParam);
                userAction(param)
            }
          })
        },
        onLoad(option) {
            this.actionParam.pageParams = JSON.stringify(option)
            this.storeId = option.storeId;
            this.getCoupon();
        },
pages/cart/coupon/myCoupon.vue
@@ -126,6 +126,7 @@
import '@/components/uview-components/uview-ui';
import { getMemberCoupons } from "@/api/members.js";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  data() {
@@ -171,10 +172,44 @@
        },
      ],
      couponList: [], //优惠券列表
      pageSessionNo:"",
      actionParam:{
            sessionId:'',
            actionType:"PAGE",
            joinType:"SELF",
            pageCode:"MY_COUPON",
            pageParams:"{}",
            pageStatus:"JOIN",
            pageType:"LIST"
        }
    };
  },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
  },
  onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let param = Object.assign({}, this.actionParam);
            userAction(param)
        }
      })
    this.navList[this.tabCurrentIndex].params.pageNumber = 1;
    this.navList[this.tabCurrentIndex].dataList = [];
    this.getData();
pages/cart/payment/payOrder.vue
@@ -46,6 +46,7 @@
    import '@/components/uview-components/uview-ui'
    import * as API_Trade from "@/api/trade";
    import {payCallback} from '@/api/members'
    import { getSessionId, userAction } from "@/api/userAction.js";
    export default {
        data() {
            return {
@@ -71,12 +72,45 @@
                walletValue: 0.0,
                // 支付倒计时
                autoCancel: 0,
                pageSessionNo:"",
                actionParam:{
                        sessionId:'',
                        actionType:"PAGE",
                        joinType:"SELF",
                        pageCode:"PAY_ORDER",
                        pageParams:"{}",
                        pageStatus:"JOIN",
                        pageType:"DETAIL"
                    }
            
            };
        },
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
        onShow() {
        getSessionId().then(res=>{
            this.pageSessionNo = res.data.data
            this.actionParam.sessionId = this.pageSessionNo
            if(this.pageSessionNo){
            let param = Object.assign({}, this.actionParam);
                userAction(param)
            }
        })
        },
        onLoad(val) {
            this.routerVal = val;
            this.actionParam.pageParams = JSON.stringify(val)
            //初始化参数
            // #ifdef APP-PLUS
            this.paymentType = "APP";
@@ -126,7 +160,7 @@
                    paymentMethod +
                    "&payPrice=" +
                    this.cashierParams.price+
                    "&orderType="+this.orderType
                    "&orderType="+this.orderType +"&orderSn="+this.cashierParams.orderSns
                });
            },
            
pages/cart/payment/success.vue
@@ -54,6 +54,8 @@
</template>
<script>
// import goodsRecommend from "@/pages/cart/m-goods-recommend/index.vue";
import { getSessionId, userAction } from "@/api/userAction.js";
import {addPrizeNum} from '@/api/prize.js'
export default {
  data() {
    return {
@@ -64,6 +66,16 @@
      payPrice: 0,
      goodsList: [],
      activeColor: this.$mainColor,
      pageSessionNo:"",
      actionParam:{
              sessionId:'',
              actionType:"PAGE",
              joinType:"SELF",
              pageCode:"PAY_SUCCESS",
              pageParams:"{}",
              pageStatus:"JOIN",
              pageType:"DETAIL"
          }
    };
  },
  // components: {
@@ -83,12 +95,61 @@
      }
    },
  },
  onUnload() {
    let    param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onShow() {
      getSessionId().then(res=>{
          this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
          if(this.pageSessionNo){
          let    param = Object.assign({}, this.actionParam);
              userAction(param)
          }
      })
  },
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
    this.paymentMethod = options.paymentMethod || "";
    this.from = options.from || "";
    this.payPrice = options.payPrice || 0;
    this.orderType = options.orderType;
    let param = {
        addType:"USER_BUY_ORDER_NUM",
        extend:"",
    }
    let extend = {orderSn:options.orderSn}
    param.extend = JSON.stringify(extend)
    addPrizeNum(param);
    let param2 = {
        addType:"USER_BUY_SUM_PRICE",
        extend:"",
    }
    let extend2 = {orderSn:options.orderSn}
    param2.extend = JSON.stringify(extend2)
    addPrizeNum(param2);
    const shareId =  uni.getStorageSync("shareId")
    if(shareId){
        let param3 = {
            addType:"SHARE_USER_SHOPPING",
            extend:"",
        }
        let extend3 = {orderSn:options.orderSn,
                        shareId:shareId}
        param3.extend = JSON.stringify(extend3)
        addPrizeNum(param3);
    }
  },
  methods: {
    checkOrder() {
pages/commodity-square/commoditySquare.vue
@@ -100,6 +100,7 @@
<script>
    import TopBar from "@/components/TopBar.vue";
    import { getSessionId, userAction } from "@/api/userAction.js";
    import {
        getCategoryList,
        getGoodsList,
@@ -155,6 +156,17 @@
                    order: 'asc',
                    sort: 'goodsSort'
                },
                  pageSessionNo:"",
          sendOnShow:false,
                  actionParam:{
                        sessionId:'',
                        actionType:"PAGE",
                        joinType:"SELF",
                        pageCode:"SHOPPING_SQUARE",
                        pageParams:"{}",
                        pageStatus:"JOIN",
                        pageType:"LIST"
                    }
            }
        },
        methods: {
@@ -413,8 +425,32 @@
                console.log(this.maxPages)
            }
        },
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
        onShow() {
          getSessionId().then(res=>{
            this.pageSessionNo = res.data.data
            this.actionParam.sessionId = this.pageSessionNo
            if(this.pageSessionNo){
            let param = Object.assign({}, this.actionParam);
                userAction(param)
            }
          })
        },
        async onLoad(options) {
            this.actionParam.pageParams = JSON.stringify(options)
        async onLoad() {
            await this.getCartList();
            // 获取状态栏高度
            const systemInfo = uni.getSystemInfoSync();
pages/cusbar/cart/cartList.vue
@@ -188,6 +188,7 @@
import '@/components/uview-components/uview-ui';
import * as API_Trade from "@/api/trade";
import { debounce } from "@/utils/tools.js";
import { getSessionId, userAction } from "@/api/userAction.js";
// import uniNumberBox from '@/components/uni-number-box'
export default {
  data() {
@@ -220,7 +221,18 @@
      checkout: false, //全选按钮
      WEIXIN_num: "", //购物车兼容微信步进器
      marginBottom: 0 ,// 底部安全区域
      windowHeight: 0 // 可使用屏幕高度
      windowHeight: 0 ,// 可使用屏幕高度
      pageSessionNo:"",
    sendOnShow:false,
      actionParam:{
            sessionId:'',
            actionType:"PAGE",
            joinType:"SELF",
            pageCode:"CART_LIST",
            pageParams:"{}",
            pageStatus:"JOIN",
            pageType:"DETAIL"
        }
    };
  },
@@ -235,10 +247,35 @@
  onPullDownRefresh(){
    this.getCardData();
  },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onLoad(options) {
          this.actionParam.pageParams = JSON.stringify(options)
  },
  /**
   * 初始化信息
   */
  onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let param = Object.assign({}, this.actionParam);
            userAction(param)
        }
      })
    this.deleteShow ? (this.deleteShow = false) : true;
    this.getCardData();
        // if (this.$refs.swiperAction) {
pages/cusbar/video/video.vue
@@ -213,6 +213,7 @@
import { getRecommendTag3 } from "@/api/video-tag.js";
import { getFileKey } from "@/utils/file.js";
import { getVideoGoodsList } from "@/api/goods.js";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  components: {MyTag},
@@ -267,7 +268,17 @@
      screenWidth: 375,
      gap: 10, // 图片间距
      windowHeight: 0,
      marginBottom: 0
      marginBottom: 0,
      pageSessionNo:"",
      actionParam:{
            sessionId:'',
            actionType:"PAGE",
            joinType:"SELF",
            pageCode:"PUBLISH_VIDEO",
            pageParams:"{}",
            pageStatus:"JOIN",
            pageType:"LIST"
        }
    };
  },
  computed: {
@@ -288,7 +299,22 @@
      return (this.screenWidth - (this.gap * 4) - 20) / 3
    }
  },
  onLoad() {
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
    // 获取屏幕宽度
    const systemInfo = uni.getSystemInfoSync()
    this.screenWidth = systemInfo.windowWidth
@@ -299,6 +325,14 @@
    this.getVideoGoodsByEs()
  },
  onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let param = Object.assign({}, this.actionParam);
            userAction(param)
        }
      })
      this.initCOS()
    // 初始化推荐标签
    this.getRecommendTags()
pages/health/healthVideo.vue
@@ -264,6 +264,7 @@
import { silentLogin } from "@/api/connect.js";
import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js";
import { getSessionId, userAction,userShare } from "@/api/userAction.js";
export default {
  components: {TopBar},
  computed: {
@@ -353,10 +354,34 @@
        similarlyNomore: false, // 是否还有更多相似视频
        similaryVideoIndex: 0, // 相似视频的播放位置
        similarlyLoading: false, // 相似视频加载
        marginBottom: 0 // 底部安全区域
        marginBottom: 0 ,// 底部安全区域
          pageSessionNo:"",
          actionParam:{
                sessionId:'',
                actionType:"PAGE",
                joinType:"SELF",
                pageCode:"HEALTH_VIDEO",
                pageParams:"{}",
                pageStatus:"JOIN",
                pageType:"DETAIL"
            },
            shareParam:{
                pageCode:"HEALTH_VIDEO",
                shareOption:"{}",
                pageType:"DETAIL"
            },
            shareId:'',
    }
  },
  onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let    param = Object.assign({}, this.actionParam);
            userAction(param)
        }
      })
      // const token = storage.getAccessToken();
      // if (! token) {
         //  this.wxSilentLogin(() => {
@@ -371,10 +396,32 @@
          this.totalHidenTime += duration
      }
  },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
      this.startHidenTime = Date.now()
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onLoad(option) {
      if(option.shareId){
        console.log('触发onLoad')
          this.actionParam.shareId = option.shareId;
          this.actionParam.joinType = 'SHARE'
          uni.setStorage({
              key: 'shareId',
              data: option.shareId,
              success: function () {
                  console.log('缓存shareId成功');
              }
          });
      }
      this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
      let queryParam = this.videoQuery;
      if (option.q) {
@@ -392,12 +439,16 @@
        queryParam.shareType = shareType
        queryParam.source = source
        console.log('解析参数:', { shareType, videoId,source });
        this.actionParam.pageParams = JSON.stringify(params)
        this.actionParam.joinType = 'SHARE'
      }
      const token = storage.getAccessToken();
      if (! token) {
          this.wxSilentLogin(() => {
              // 判断是不是点击分享链接进来的
              if (option.userId && option.videoId) {
                  this.actionParam.pageParams = JSON.stringify(option)
                  this.actionParam.joinType = 'SCAN'
                    queryParam.videoId = option.videoId
                  // 保存分享点击记录
                  saveShareClickRecord({refId: option.videoId, shareUserId: option.userId})
@@ -427,11 +478,42 @@
        shareUser: userInfo.id
    }
    saveShare(data)
      return {
          title: videoInfo.title,
          path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
          imageUrl: videoInfo.coverUrl
      }
      // return {
      //     title: videoInfo.title,
      //     path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
      //     imageUrl: videoInfo.coverUrl
      // }
    return new Promise((resolve) => {
                this.shareId = '';
                let shareObj ={
                    videoId:videoInfo.id,
                    userId:userInfo.id
                }
                this.shareParam.shareOption = JSON.stringify(shareObj)
                userShare(this.shareParam).then(res => {
                  this.shareId = res.data.data;
                  // 当获取到shareId后,再resolve分享配置
                  resolve({
                    title: videoInfo.title,
                    path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}&shareId=${this.shareId}`,
                    imageUrl: videoInfo.coverUrl,
                    success(e) {
                      console.log("分享成功", e);
                    },
                    fail(e) {
                      console.log('分享失败', e);
                    }
                  });
                }).catch(err => {
                  // 处理错误情况,例如使用默认参数
                  console.error('获取分享ID失败', err);
                  resolve({
                        title: videoInfo.title,
                        path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
                        imageUrl: videoInfo.coverUrl
                  });
                });
    });
  },
  methods: {
      // 解析URL参数
pages/kitchen/KitchenVideo.vue
@@ -285,7 +285,7 @@
} from "@/api/collect.js";
import { saveShare, saveShareClickRecord } from "@/api/share.js";
import storage from "@/utils/storage.js";
import { getSessionId, userAction,userShare } from "@/api/userAction.js";
export default {
  computed: {
    hasPlayTime() {
@@ -387,10 +387,35 @@
      similarlyNomore: false, // 是否还有更多相似视频
      similaryVideoIndex: 0, // 相似视频的播放位置
      similarlyLoading: false, // 相似视频加载
      marginBottom: 0 // 底部安全区域
      marginBottom: 0 ,// 底部安全区域
      pageSessionNo:"",
      actionParam:{
        sessionId:'',
        actionType:"PAGE",
        joinType:"SELF",
        pageCode:"KITCHEN_VIDEO",
        pageParams:"{}",
        pageStatus:"JOIN",
        pageType:"LIST"
        },
        shareParam:{
            pageCode:"KITCHEN_VIDEO",
            shareOption:"{}",
            pageType:"DETAIL"
        },
        shareId:'',
    }
  },
  onShow() {
      getSessionId().then(res=>{
              this.pageSessionNo = res.data.data
            this.actionParam.sessionId = this.pageSessionNo
              if(this.pageSessionNo){
              let param = Object.assign({}, this.actionParam);
                  userAction(param)
              }
      })
    // this.showDrawer('showLeft')
    this.loadVideos()
    // 如果视频按下暂停后切换页面再回到页面时,只算暂停时间(因为暂停时间和离开页面时间是重复的,只算一个)
@@ -399,10 +424,32 @@
      this.totalHidenTime += duration
    }
  },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onLoad(option) {
      if(option.shareId){
              console.log('触发onLoad')
          this.actionParam.shareId = option.shareId;
          this.actionParam.joinType = 'SHARE'
          uni.setStorage({
              key: 'shareId',
              data: option.shareId,
              success: function () {
                  console.log('缓存shareId成功');
              }
          });
      }
        this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom;
        // 获取状态栏高度
        const systemInfo = uni.getSystemInfoSync();
@@ -429,12 +476,16 @@
            queryParam.shareType = shareType
            queryParam.source = source
            console.log('解析参数:', { shareType, videoId,source });
            this.actionParam.pageParams = JSON.stringify(params)
            this.actionParam.joinType = 'SHARE'
        }
        const token = storage.getAccessToken();
        if(!token){
            this.wxSilentLogin(() => {
                // 判断是不是点击分享链接进来的
                if (option.userId && option.videoId) {
                    this.actionParam.pageParams = JSON.stringify(option)
                    this.actionParam.joinType = 'SCAN'
                    queryParam.videoId = option.videoId
                    // 保存分享点击记录
                    saveShareClickRecord({refId: option.videoId, shareUserId: option.userId})
@@ -468,11 +519,43 @@
        shareUser: userInfo.id
    }
    saveShare(data)
      return {
          title: videoInfo.title,
          path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
          imageUrl: videoInfo.coverUrl
      }
      // return {
      //     title: videoInfo.title,
      //     path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
      //     imageUrl: videoInfo.coverUrl
      // }
    return new Promise((resolve) => {
                this.shareId = '';
                let shareObj ={
                    videoId:videoInfo.id,
                    userId:userInfo.id
                }
                this.shareParam.shareOption = JSON.stringify(shareObj)
                userShare(this.shareParam).then(res => {
                  this.shareId = res.data.data;
                  // 当获取到shareId后,再resolve分享配置
                  resolve({
                    title: videoInfo.title,
                    path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}&shareId=${this.shareId}`,
                    imageUrl: videoInfo.coverUrl,
                    success(e) {
                      console.log("分享成功", e);
                    },
                    fail(e) {
                      console.log('分享失败', e);
                    }
                  });
                }).catch(err => {
                  // 处理错误情况,例如使用默认参数
                  console.error('获取分享ID失败', err);
                  resolve({
                        title: videoInfo.title,
                        path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
                        imageUrl: videoInfo.coverUrl
                  });
                });
    });
  },
  methods: {
      // 解析URL参数
pages/mine/activity/detail.vue
@@ -75,6 +75,7 @@
        getActivityDetail,
        activityReport
    } from '@/api/activity.js';
    import { getSessionId, userAction } from "@/api/userAction.js";
    export default {
        data() {
            return {
@@ -103,9 +104,44 @@
                    collectType: '',
                    refId: '',
                },
                  pageSessionNo:"",
          sendOnShow:false,
                  actionParam:{
                        sessionId:'',
                        actionType:"PAGE",
                        joinType:"SELF",
                        pageCode:"ACTIVITY_DETAIL",
                        pageParams:"{}",
                        pageStatus:"JOIN",
                        pageType:"DETAIL"
                    }
            };
        },
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
        onShow() {
          getSessionId().then(res=>{
            this.pageSessionNo = res.data.data
            this.actionParam.sessionId = this.pageSessionNo
            if(this.pageSessionNo){
            let param = Object.assign({}, this.actionParam);
                userAction(param)
            }
          })
        },
        onLoad(options) {
            this.actionParam.pageParams = JSON.stringify(options)
            // 接收 URL 参数
            if (options.id) {
                this.detailId = options.id;
pages/mine/activity/reportActivity.vue
@@ -55,6 +55,7 @@
    import TopBar from "@/components/TopBar.vue";
    import '@/components/uview-components/uview-ui';
    import {getActivityReportList} from '@/api/activity.js';
    import { getSessionId, userAction } from "@/api/userAction.js";
    export default {
        components: {TopBar},
        data() {
@@ -75,10 +76,44 @@
                },
                loading: false, // 是否正在加载
                noMore: false, // 是否没有更多数据
                total: 0 // 总数据量
                total: 0 ,// 总数据量
                  pageSessionNo:"",
                  actionParam:{
                        sessionId:'',
                        actionType:"PAGE",
                        joinType:"SELF",
                        pageCode:"ACTIVITY_LIST",
                        pageParams:"{}",
                        pageStatus:"JOIN",
                        pageType:"LIST"
                    }
            };
        },
        onLoad() {
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
        onShow() {
          getSessionId().then(res=>{
            this.pageSessionNo = res.data.data
            this.actionParam.sessionId = this.pageSessionNo
            if(this.pageSessionNo){
            let param = Object.assign({}, this.actionParam);
                userAction(param)
            }
          })
        },
        onLoad(options) {
            this.actionParam.pageParams = JSON.stringify(options)
            this.getActivityList();
        },
        methods: {
pages/order/afterSales/afterSales.vue
@@ -204,6 +204,7 @@
import { getAfterSaleList, cancelAfterSale } from "@/api/after-sale.js";
import { getOrderList } from "@/api/order.js";
import storage from "@/utils/storage";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
@@ -240,9 +241,44 @@
      },
      status: "loadmore",
      keywords: "", // 搜索订单sn
      pageSessionNo:"",
    sendOnShow:false,
      actionParam:{
            sessionId:'',
            actionType:"PAGE",
            joinType:"SELF",
            pageCode:"AFTER_SALE",
            pageParams:"{}",
            pageStatus:"JOIN",
            pageType:"LIST"
        }
    };
  },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let param = Object.assign({}, this.actionParam);
            userAction(param)
        }
      })
  },
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
    this.orderList = [];
    this.params.pageNumber = 1;
    if (options.orderSn) this.params.keywords = options.orderSn;
pages/order/afterSales/afterSalesDetail.vue
@@ -108,6 +108,7 @@
import { upload } from "@/api/common.js";
import { checkBankno } from "@/utils/Foundation";
import storage from "@/utils/storage.js";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  component: {
    city,
@@ -169,13 +170,47 @@
        refundWay: "",
        serviceType: "", //申请类型
      },
      pageSessionNo:"",
    sendOnShow:false,
      actionParam:{
                  sessionId:'',
                  actionType:"PAGE",
                  joinType:"SELF",
                  pageCode:"REFUND_ORDER",
                  pageParams:"{}",
                  pageStatus:"JOIN",
                  pageType:"DETAIL"
              }
    };
  },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
    onShow() {
        getSessionId().then(res=>{
                this.pageSessionNo = res.data.data
                this.actionParam.sessionId = this.pageSessionNo
                if(this.pageSessionNo){
                let param = Object.assign({}, this.actionParam);
                    userAction(param)
                }
        })
    },
  /**
   * 判断当前内容并生成数据
   */
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
    let navTitle = "申请售后";
    this.form.serviceType = "RETURN_GOODS";
    if (options.value == 1) {
pages/order/afterSales/afterSalesSelect.vue
@@ -58,15 +58,51 @@
import '@/components/uview-components/uview-ui'
import { getAfterSaleInfo } from "@/api/after-sale";
import storage from "@/utils/storage";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  data() {
    return {
      sn: "",
      sku: {}, //sku
      applyInfo:""
      applyInfo:"",
      pageSessionNo:"",
    sendOnShow:false,
      actionParam:{
            sessionId:'',
            actionType:"PAGE",
            joinType:"SELF",
            pageCode:"APPLY_SALE",
            pageParams:"{}",
            pageStatus:"JOIN",
            pageType:"LIST"
        }
    };
  },
  onUnload() {
    let    param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let    param = Object.assign({}, this.actionParam);
            userAction(param)
        }
      })
  },
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
    this.sn = options.sn;
    this.sku = storage.getAfterSaleData();
    // 查看当前商品是否支持退款退货
pages/order/fillorder.vue
@@ -400,9 +400,11 @@
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
import invoices from "@/pages/order/invoice/setInvoice";
import { mapState } from "vuex";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  onLoad: function (val) {
    this.routerVal = val;
    this.actionParam.pageParams = JSON.stringify(val)
  },
  components: {
    invoices,
@@ -454,6 +456,17 @@
      storeAddress: "",
      originOrderData:"", // 原始订单数据
      pageSessionNo:"",
    sendOnShow:false,
      actionParam:{
              sessionId:'',
              actionType:"PAGE",
              joinType:"SELF",
              pageCode:"FILL_ORDER",
              pageParams:"{}",
              pageStatus:"JOIN",
              pageType:"DETAIL"
          }
    };
  },
  watch: {
@@ -516,8 +529,28 @@
      return true; //阻止默认返回行为
    }
  },
  onUnload() {
    let    param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  async onShow() {
      getSessionId().then(res=>{
          this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
          if(this.pageSessionNo){
          let    param = Object.assign({}, this.actionParam);
              userAction(param)
          }
      })
    // 判断是否存在写过备注信息的商品
    if (this.remark && this.remark.length > 0) {
      this.remarkFlag = true;
pages/order/myOrder.vue
@@ -175,6 +175,14 @@
                  </u-button> -->
                </view>
              </view>
                <view style="display: flex;justify-content: space-around;">
                    <view class="" @click="callPhone">
                         客服热线: 19980834650
                    </view>
                    <view class="" @click="copyToClipboard">
                         客服微信: meiyikuang
                    </view>
                </view>
            </view>
          </view>
          <uni-load-more :status="tabItem.loadStatus"></uni-load-more>
@@ -241,6 +249,7 @@
import { getClearReason } from "@/api/after-sale.js";
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
import {buyBack} from "@/api/trade.js";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  data() {
@@ -327,6 +336,16 @@
      reason: "", //取消原因
      cancelList: "", //取消列表
      rogShow: false, //显示是否收货
      pageSessionNo:"",
      actionParam:{
              sessionId:'',
              actionType:"PAGE",
              joinType:"SELF",
              pageCode:"ORDER_LIST",
              pageParams:"{}",
              pageStatus:"JOIN",
              pageType:"DETAIL"
          }
    };
  },
@@ -349,7 +368,28 @@
    }
    // this.loadData(this.status);
  },
  onUnload() {
    let    param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onShow() {
      getSessionId().then(res=>{
          this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
          if(this.pageSessionNo){
          let    param = Object.assign({}, this.actionParam);
              userAction(param)
          }
      })
    if(this.$options.filters.tipsToLogin()){
      if (!this.tabCurrentIndex) {
        this.initData(0);
@@ -359,6 +399,7 @@
  },
  onLoad(options) {
      this.actionParam.pageParams = JSON.stringify(options)
    /**
     * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
     * 替换onLoad下代码即可
@@ -386,6 +427,29 @@
    },
  },
  methods: {
      copyToClipboard(){
          uni.setClipboardData({
              data:'meiyikuang',
              success() {
                  uni.showToast({
                title: '复制成功',
                icon: 'none'
                  })
              }
          })
      },
      callPhone(){
          uni.showModal({
              title:'确认联系客服吗?',
              success(e) {
                  if(e.confirm){
                      uni.makePhoneCall({
                          phoneNumber:'19980834650'
                      })
                  }
              }
          })
      },
      openCouponPackage(order){
          console.log(order)
        uni.navigateTo({
@@ -654,6 +718,10 @@
        url:
          "/pages/mine/msgTips/packageMsg/logisticsDetail?order_sn=" + order.sn,
      });
      // uni.navigateTo({
      //   url:
      //       `/pages/order/deliverDetail?order_sn=${order.sn}`,
      // });
    },
  },
};
pages/order/orderDetail.vue
@@ -10,7 +10,7 @@
    </div>
    <!-- 物流信息 -->
    <view class="info-view logistics-view">
      <view class="logistics-List" v-if="logisticsList && logisticsList.traces && logisticsList.traces.length != 0 ">
      <view class="logistics-List" v-if="logisticsList && logisticsList.traces && logisticsList.traces.length != 0 && !(orderPackage && orderPackage.length)">
        <view class="logistics-List-title">
          {{ logisticsList.traces[logisticsList.traces.length - 1].AcceptStation }}
        </view>
@@ -270,7 +270,7 @@
import shares from "@/pages/order/m-share/index.vue"; //分享
import { getClearReason } from "@/api/after-sale.js";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  components: {
    shares,
@@ -325,9 +325,43 @@
      orderPackage:"",
      //商品信息再来一单使用
      skuList:[],
      pageSessionNo:"",
      actionParam:{
              sessionId:'',
              actionType:"PAGE",
              joinType:"SELF",
              pageCode:"ORDER_DETAIL",
              pageParams:"{}",
              pageStatus:"JOIN",
              pageType:"DETAIL"
          }
    };
  },
  onUnload() {
    let    param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onShow() {
      getSessionId().then(res=>{
          this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
          if(this.pageSessionNo){
          let    param = Object.assign({}, this.actionParam);
              userAction(param)
          }
      })
  },
  onLoad(options) {
    this.actionParam.pageParams = JSON.stringify(options)
    this.loadData(options.sn);
    this.sn = options.sn;
  },
pages/prize/PrizeDetail/PrizeDetail.vue
@@ -96,7 +96,6 @@
                    <button class="chance-item" open-type="share">
                        <view class="chance-icon">👥</view>
                        <text class="chance-title">分享好友</text>
                        <text class="chance-subtitle">+1次机会</text>
                    </button>
                    <!--                     <view class="chance-item" @tap="shareToTimeline">
                        <view class="chance-icon">🌐</view>
@@ -106,17 +105,14 @@
                    <view class="chance-item" @tap="watchVideo">
                        <view class="chance-icon">🎬</view>
                        <text class="chance-title">浏览视频</text>
                        <text class="chance-subtitle">+1次机会</text>
                    </view>
                    <view class="chance-item" @tap="browseProduct">
                        <view class="chance-icon">🛍️</view>
                        <text class="chance-title">浏览商品</text>
                        <text class="chance-subtitle">+1次机会</text>
                    </view>
                    <view class="chance-item " @tap="goShopping">
                        <view class="chance-icon">🛒</view>
                        <text class="chance-title">去购物</text>
                        <text class="chance-subtitle">享受购物乐趣</text>
                    </view>
                </view>
@@ -148,11 +144,14 @@
</template>
<script>
    import bgConfig from '@/pages/prize/PrizeDetail/prize-bgConfig.js'
    import { getSessionId, userAction ,userShare } from "@/api/userAction.js";
    import {
        prizeInfo,
        prizeNum,
        prize,
        grantRecord
        grantRecord,
        addPrizeNum
    } from '@/api/prize.js'
    export default {
        data() {
@@ -212,7 +211,23 @@
                shareTimelineAttempt: false,
                activityCover: '',
                activityName: '',
                couponId: ''
                couponId: '',
                pageSessionNo:"",
                actionParam:{
                    sessionId:'',
                    actionType:"PAGE",
                    joinType:"SELF",
                    pageCode:"PRIZE_DETAIL",
                    pageParams:"{}",
                    pageStatus:"JOIN",
                    pageType:"DETAIL"
                },
                shareParam:{
                    pageCode:"PRIZE_DETAIL",
                    shareOption:"{}",
                    pageType:"DETAIL"
                },
                shareId:'',
            };
        },
        computed: {
@@ -221,7 +236,54 @@
                return [...this.originalWinners]
            }
        },
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let    param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
        onShow() {
          getSessionId().then(res=>{
            this.pageSessionNo = res.data.data
            this.actionParam.sessionId = res.data.data
            if(this.pageSessionNo){
            let    param = Object.assign({}, this.actionParam);
                param.sessionId = this.pageSessionNo
                userAction(param)
            }
          })
          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);
          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')
            }
            this.actionParam.pageParams = JSON.stringify(option)
            const pages = getCurrentPages()
            console.log('================pages ', pages)
            this.activityId = option.id
@@ -266,17 +328,38 @@
            // this.startAutoScroll()
        },
        onShareAppMessage() {
            return {
          // 返回一个Promise
          return new Promise((resolve) => {
            this.shareId = '';
            this.shareParam.shareOption = JSON.stringify({
                id:this.activityId
            })
            userShare(this.shareParam).then(res => {
              this.shareId = res.data.data;
              console.log('------------------1》', this.shareId);
              // 当获取到shareId后,再resolve分享配置
              resolve({
                title: this.activityName,
                path: '/pages/prize/PrizeDetail/PrizeDetail?id=' + this.activityId,
                path: '/pages/prize/PrizeDetail/PrizeDetail?id=' + this.activityId + '&shareId=' + this.shareId,
                imageUrl: this.activityCover,
                success(e) {
                    console.log("分享成功", e)
                  console.log("分享成功", e);
                },
                fail(e) {
                    console.log('分享失败', e)
                  console.log('分享失败', e);
                }
            }
              });
            }).catch(err => {
              // 处理错误情况,例如使用默认参数
              console.error('获取分享ID失败', err);
              resolve({
                title: this.activityName,
                path: '/pages/prize/PrizeDetail/PrizeDetail?id=' + this.activityId,
                imageUrl: this.activityCover
              });
            });
          });
        },
        beforeDestroy() {
            this.stopAutoScroll()
pages/product/goods.vue
@@ -6,13 +6,15 @@
    <!-- 仅h5有效 打开App -->
    <!-- 分享 -->
    <shares v-if="enableShare && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="
<!--    <shares v-if="enableShare && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="
      '/pages/product/goods?id=' +
      this.routerVal.id +
      '&goodsId=' +
      this.routerVal.goodsId
    " :thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods"
      @close="enableShare = false" />
      -->
    <popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
      :y="navbarListY" placement="top-start" />
    <view class="index">
@@ -114,10 +116,18 @@
                    </span>
                  </view>
                  <view class="icons share" @click="shareChange()">
            <!--      <view class="icons share" @click="shareChange()">
                    <u-icon size="30" name="share-fill"></u-icon>
                    <view>分享</view>
                  </view>
                  </view> -->
                  <view class="icons share"  style="margin-top: -15px;">
                         <button open-type="share" class="custom-share-btn" plain="true" style="border: none;">
                              <u-icon size="30" name="share-fill"></u-icon>
                         </button>
                          <view style="margin-top: -14px;">分享</view>
                        </view>
                  <view class="icons" @click="clickFavorite(goodsDetail.id)">
                    <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
                      :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
@@ -301,17 +311,16 @@
import GoodsSwiper from "@/pages/product/product/goods/-goods-swiper.vue"; //轮播图组件
import popupGoods from "@/pages/product/m-buy/goods.vue"; //购物车商品的模块
import popupAddress from "@/pages/product/product/popup/address.vue"; //地址选择模块
import shares from "@/pages/product/m-share/index.vue"; //分享
import popups from "@/pages/product/popups/popups.vue"; //气泡框
import takeDownFormSaleGoods from "@/pages/product/m-take-down-sale-goods/index.vue"; //下架框
import setup from "./product/popup/popup";
    import {
        getSTSToken
    } from '@/api/common.js'
import { getSessionId, userAction,userShare } from "@/api/userAction.js";
import { getSTSToken } from '@/api/common.js'
import {addPrizeNum} from '@/api/prize.js'
export default {
  components: {
    popups,
    shares,
    PromotionLayout,
    PromotionDetailsLayout,
    PromotionAssembleLayout,
@@ -444,6 +453,24 @@
      IMLink: "", // IM地址
      wholesaleList: [],
      takeDownFromSale: false, // 下架销售状态
      pageSessionNo:"",
    sendOnShow:false,
      actionParam:{
              sessionId:'',
              actionType:"PAGE",
              joinType:"SELF",
              pageCode:"GOODS_DETAILS",
              pageParams:"{}",
              pageStatus:"JOIN",
              pageType:"DETAIL",
            shareId:null,
          },
        shareParam:{
            pageCode:"GOODS_DETAILS",
            shareOption:"{}",
            pageType:"DETAIL"
        },
        shareId:'',
    };
  },
@@ -496,8 +523,64 @@
    this.productRefHeight = windowHeight - bottomHeight + "px";
  },
 onShareAppMessage(e) {
         console.log("开始分享")
         console.log(this.goodsDetail)
         // 返回一个Promise
         return new Promise((resolve) => {
                     this.shareId = '';
                     this.shareParam.shareOption = JSON.stringify(this.routerVal)
                     userShare(this.shareParam).then(res => {
                       this.shareId = res.data.data;
                        let param = {
                            addType:"SHARE_GOODS_VIDEO",
                            extend:"",
                        }
                        let extend = {shareId:this.shareId}
                        param.extend = JSON.stringify(extend)
                        addPrizeNum(param);
                       // 当获取到shareId后,再resolve分享配置
                       resolve({
                         title: this.goodsDetail.goodsName,
                         path: '/pages/product/goods' +'?id='+ this.routerVal.id + '&goodsId=' + this.routerVal.goodsId +'&shareId=' + this.shareId,
                         imageUrl: this.goodsDetail.goodsGalleryList[0],
                         success(e) {
                           console.log("分享成功", e);
                         },
                         fail(e) {
                           console.log('分享失败', e);
                         }
                       });
                     }).catch(err => {
                       // 处理错误情况,例如使用默认参数
                       console.error('获取分享ID失败', err);
                       resolve({
                         title: this.goodsDetail.goodsName,
                         path: '/pages/product/goods' +'?id='+ this.routerVal.id + '&goodsId=' + this.routerVal.goodsId,
                         imageUrl: this.goodsDetail.goodsGalleryList[0],
                       });
                     });
         });
     },
  async onLoad (options) {
    if(options.shareId){
        this.actionParam.shareId = options.shareId;
        this.actionParam.joinType = 'SHARE'
        console.log('触发onLoad')
        uni.setStorage({
            key: 'shareId',
            data: options.shareId,
            success: function () {
                console.log('缓存shareId成功');
            }
        });
    }
    this.actionParam.pageParams = JSON.stringify(options)
      if(options.q){
          const queryParam = {
              id:'',
@@ -512,22 +595,44 @@
          queryParam.id = id;
          queryParam.goodsId = gooodsId;
          this.routerVal = queryParam;
          this.actionParam.pageParams = JSON.stringify(params)
          this.actionParam.joinType = 'SCAN'
      }else{
          this.routerVal = options;
          this.actionParam.pageParams = JSON.stringify(options)
      }
      console.log('打印信息')
       console.log(options)
      console.log(this.routerVal)
    
    // #ifdef MP-WEIXIN
    // 小程序默认分享
    uni.showShareMenu({
      withShareTicket: true,
      menus: ["shareAppMessage", "shareTimeline"],
    });
    // #endif
  },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  async onShow () {
      getSessionId().then(res=>{
          this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        this.actionParam.sessionId = res.data.data
          if(this.pageSessionNo){
          let    param = Object.assign({}, this.actionParam);
              userAction(param)
          }
      })
    this.goodsDetail = {};
    //如果有参数ids说明事分销短连接,需要获取参数
    if (this.routerVal.scene) {
pages/storeClaim/store-claim.vue
New file
@@ -0,0 +1,365 @@
<template>
    <view class="container">
        <!-- 优惠券卡片 -->
        <view class="coupon-card" v-if="couponInfo.storeCoupRef">
            <u-card :border="false" :head-style="{ padding: '30rpx' }" :body-style="{ padding: '0 30rpx 30rpx' }">
                <!-- 头部:店铺信息 -->
                <view slot="head" class="card-head">
                    <view class="store-info">
                        <u-icon name="home" size="36" color="#999"></u-icon>
                        <text class="store-name">{{ couponInfo.storeName }}</text>
                    </view>
                    <u-tag v-if="couponInfo.claimStatus === 'NOT_CLAIM'" text="未领取" type="warning" mode="plain" size="mini" />
                    <u-tag v-else-if="couponInfo.claimStatus === 'CLAIM'" text="已领取" type="success" mode="plain" size="mini" />
                    <u-tag v-else text="已过期" type="info" mode="plain" size="mini" />
                </view>
                <!-- 主体:优惠券信息 -->
                <view slot="body" class="card-body">
                    <view class="coupon-title">
                        <text class="title">{{ couponInfo.couponName }}</text>
                        <text class="coupon-no">编号:{{ couponInfo.couponNo }}</text>
                    </view>
                    <view class="coupon-desc" v-if="couponInfo.couponDesc">
                        <text class="desc">{{ couponInfo.couponDesc }}</text>
                    </view>
                    <view class="coupon-rule" v-if="couponInfo.couponRule">
                        <text class="rule-title">使用规则:</text>
                        <text class="rule-content">{{ couponInfo.couponRule }}</text>
                    </view>
                    <view class="coupon-time" v-if="couponInfo.startTime && couponInfo.endTime">
                        <u-icon name="clock" size="28" color="#999"></u-icon>
                        <text class="time-text">有效期:{{ formatDate(couponInfo.startTime) }} 至 {{ formatDate(couponInfo.endTime) }}</text>
                    </view>
                    <view class="coupon-condition" v-if="couponInfo.consumeThreshold > 0">
                        <u-icon name="coupon" size="28" color="#999"></u-icon>
                        <text class="condition-text">满{{ formatAmount(couponInfo.consumeThreshold) }}元可用</text>
                    </view>
                </view>
                <!-- 底部:操作按钮 -->
                <view slot="foot" class="card-foot">
                    <u-button
                        :type="couponInfo.claimStatus === 'NOT_CLAIM' ? 'primary' : 'default'"
                        :disabled="couponInfo.claimStatus !== 'NOT_CLAIM'"
                        :loading="loading"
                        @click="claimCoupon"
                        :ripple="true"
                        :hair-line="false"
                    >
                        {{ couponInfo.claimStatus === 'NOT_CLAIM' ? '立即领取' : couponInfo.claimStatus === 'CLAIM' ? '已领取' : '已过期' }}
                    </u-button>
                </view>
            </u-card>
        </view>
        <!-- 空状态 -->
        <view class="empty-state" v-else>
            <u-empty text="优惠券信息不存在" mode="coupon" :icon-size="200"></u-empty>
        </view>
        <!-- 使用说明 -->
        <view class="instructions">
            <view class="instructions-title">
                <u-icon name="info-circle" size="28" color="#999"></u-icon>
                <text class="title-text">使用说明</text>
            </view>
            <view class="instructions-content">
                <text class="content-text">1. 优惠券仅限在指定店铺使用\n2. 每个用户限领一张\n3. 优惠券不可兑换现金\n4. 请在有效期内使用</text>
            </view>
        </view>
        <!-- 空白占位 -->
        <view class="placeholder"></view>
    </view>
</template>
<script>
    import { getStoreCouponDetail, claimStoreCoupon } from '@/api/store-coupon.js';
    import { formatPrice } from '@/utils/Foundation.js';
    export default {
        data() {
            return {
                loading: false,
                storeCoupRef: '', // 店铺优惠券关联ID
                couponInfo: {
                    id: "",
                    storeCoupRef: "",
                    storeId: "",
                    storeName: "",
                    couponId: "",
                    couponName: "",
                    couponNo: "",
                    couponAmount: 0, // 优惠金额
                    couponDesc: "", // 优惠券描述
                    couponRule: "", // 使用规则
                    startTime: "", // 开始时间
                    endTime: "", // 结束时间
                    consumeThreshold: 0, // 消费门槛
                    claimStatus: "NOT_CLAIM", // 领取状态
                }
            }
        },
        onShow() {
        this.getCouponDetail(this.storeCoupRef);
        },
        onLoad(options) {
            // 获取传递的店铺优惠券关联ID
            if (options.storeCoupRef) {
                this.storeCoupRef = options.storeCoupRef;
                this.getCouponDetail(options.storeCoupRef);
            } else if (options.id) {
                // 兼容旧参数
                this.storeCoupRef = options.id;
                this.getCouponDetail(options.id);
            }else if(options.q){
                // 双重解码:微信对URL进行了两次编码
                const decodedUrl = decodeURIComponent(decodeURIComponent(options.q));
                console.log('原始URL:', decodedUrl);
                // 解析URL中的查询参数
                const params = this.parseUrlParams(decodedUrl);
                this.storeCoupRef = params.id;
                this.getCouponDetail(this.storeCoupRef);
            }
             else {
                this.$u.toast('参数错误');
            }
        },
        methods: {
            // 解析URL参数
            parseUrlParams(url) {
                const params = {};
                // 处理可能存在的hash(如果有的话)
                const cleanUrl = url.split('#')[0];
                const queryStr = cleanUrl.split('?')[1] || '';
                queryStr.split('&').forEach(pair => {
                    const [key, value] = pair.split('=');
                    if (key) {
                        // 如果值存在,则解码,否则设为空字符串
                        params[key] = value ? decodeURIComponent(value) : '';
                    }
                });
                return params;
            },
            // 格式化金额
            formatAmount(amount) {
                if (!amount) return '0';
                return formatPrice(parseFloat(amount));
            },
            // 格式化日期
            formatDate(dateStr) {
                if (!dateStr) return '';
                return dateStr.split(' ')[0];
            },
            // 获取优惠券详情
            async getCouponDetail(storeCoupRef) {
                uni.showLoading({
                    title: '加载中...'
                });
                try {
                    const res = await getStoreCouponDetail(storeCoupRef);
                    console.log(JSON.stringify(res))
                    if (res.data.code === 200) {
                        this.couponInfo = {
                            ...this.couponInfo,
                            ...res.data.data,
                            couponAmount: res.data.data.couponAmount || 0,
                            consumeThreshold: res.data.data.consumeThreshold || 0
                        };
                    } else {
                        this.$u.toast(res.data.message || '获取优惠券详情失败');
                    }
                } catch (err) {
                    this.$u.toast('获取优惠券详情失败,请稍后重试');
                    console.error('获取优惠券详情失败:', err);
                } finally {
                    uni.hideLoading();
                }
            },
            // 领取优惠券
            async claimCoupon() {
                if (this.couponInfo.claimStatus !== 'NOT_CLAIM') {
                    return;
                }
                // 确认领取
                uni.showModal({
                    title: '提示',
                    content: `确定要领取"${this.couponInfo.couponName}"优惠券吗?`,
                    success: (res) => {
                        if (res.confirm) {
                            this.doClaimCoupon();
                        }
                    }
                });
            },
            // 执行领取优惠券操作
            async doClaimCoupon() {
                this.loading = true;
                try {
                    // 调用领取优惠券接口
                    const res = await claimStoreCoupon(this.storeCoupRef);
                    if (res.data.code === 200) {
                        this.$u.toast('领取成功');
                        this.couponInfo.claimStatus = 'CLAIM';
                        // 延迟返回上一页,让用户看到领取成功的提示
                        setTimeout(() => {
                            uni.navigateBack();
                        }, 1500);
                    } else {
                        this.$u.toast(res.data.message || '领取失败');
                    }
                } catch (err) {
                    this.$u.toast('领取失败,请稍后重试');
                    console.error('领取优惠券失败:', err);
                } finally {
                    this.loading = false;
                }
            }
        }
    }
</script>
<style lang="scss" scoped>
.container {
    background-color: #f5f5f5;
    min-height: 100vh;
}
.coupon-card {
    margin: 20rpx;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.store-info {
    display: flex;
    align-items: center;
}
.store-name {
    margin-left: 10rpx;
    font-size: 32rpx;
    font-weight: bold;
    color: #333;
}
.card-body {
    padding-top: 20rpx;
}
.coupon-title {
    margin-bottom: 30rpx;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.title {
    font-size: 36rpx;
    font-weight: bold;
    color: #333;
}
.coupon-no {
    font-size: 24rpx;
    color: #999;
    margin-left: 20rpx;
}
.coupon-desc {
    margin-bottom: 30rpx;
}
.desc {
    font-size: 28rpx;
    color: #666;
}
.coupon-rule {
    margin-bottom: 30rpx;
}
.rule-title {
    font-size: 28rpx;
    color: #333;
    font-weight: bold;
}
.rule-content {
    font-size: 26rpx;
    color: #666;
}
.coupon-time, .coupon-condition {
    display: flex;
    align-items: center;
    margin-bottom: 20rpx;
}
.time-text, .condition-text {
    font-size: 24rpx;
    color: #999;
    margin-left: 10rpx;
}
.card-foot {
    padding: 20rpx 0;
}
.instructions {
    background-color: #ffffff;
    margin: 20rpx;
    padding: 30rpx;
    border-radius: 16rpx;
}
.instructions-title {
    display: flex;
    align-items: center;
    margin-bottom: 20rpx;
}
.title-text {
    margin-left: 10rpx;
    font-size: 30rpx;
    font-weight: bold;
    color: #333;
}
.instructions-content {
    padding-left: 40rpx;
}
.content-text {
    font-size: 26rpx;
    color: #666;
    line-height: 1.6;
}
.placeholder {
    height: 40rpx;
}
.empty-state {
    margin-top: 200rpx;
}
</style>
pages/storeClaim/storePrizeClaim.vue
New file
@@ -0,0 +1,401 @@
<template>
    <view class="container">
        <!-- 抽奖机会卡片 -->
        <view class="prize-card" v-if="prizeInfo.id">
            <u-card :border="false" :head-style="{ padding: '30rpx' }" :body-style="{ padding: '0 30rpx 30rpx' }">
                <!-- 头部:店铺信息 -->
                <view slot="head" class="card-head">
                    <view class="store-info">
                        <u-icon name="home" size="36" color="#999"></u-icon>
                        <text class="store-name">{{ prizeInfo.storeName || '默认店铺' }}</text>
                    </view>
                    <u-tag v-if="prizeInfo.claimStatus === 'NOT_CLAIM'" text="未领取" type="warning" mode="plain" size="mini" />
                    <u-tag v-else-if="prizeInfo.claimStatus === 'CLAIM'" text="已领取" type="success" mode="plain" size="mini" />
                    <u-tag v-else text="已过期" type="info" mode="plain" size="mini" />
                </view>
                <!-- 主体:抽奖机会信息 -->
                <view slot="body" class="card-body">
                    <!-- 封面图片 -->
                    <view class="cover-image" v-if="prizeInfo.activityCover">
                        <u-image
                            :src="prizeInfo.activityCover"
                            width="100%"
                            height="300rpx"
                            mode="aspectFill"
                            border-radius="10"
                            :fade="true"
                            duration="450"
                        ></u-image>
                    </view>
                    <view class="prize-title">
                        <text class="title">{{ prizeInfo.activityName || prizeInfo.prizeName || '抽奖机会' }}</text>
                    </view>
                    <view class="prize-desc" v-if="prizeInfo.activityDes || prizeInfo.prizeDesc">
                        <text class="desc">{{ prizeInfo.activityDes || prizeInfo.prizeDesc }}</text>
                    </view>
                    <view class="prize-rule" v-if="prizeInfo.prizeRule">
                        <text class="rule-title">使用说明:</text>
                        <text class="rule-content">{{ prizeInfo.prizeRule }}</text>
                    </view>
                    <view class="prize-time" v-if="prizeInfo.beginTime && prizeInfo.endTime">
                        <u-icon name="clock" size="28" color="#999"></u-icon>
                        <text class="time-text">有效期:{{ formatDate(prizeInfo.beginTime) }} 至 {{ formatDate(prizeInfo.endTime) }}</text>
                    </view>
                </view>
                <!-- 底部:操作按钮 -->
                <view slot="foot" class="card-foot">
                    <u-button
                        :type="prizeInfo.claimStatus === 'NOT_CLAIM' ? 'primary' : 'default'"
                        :disabled="prizeInfo.claimStatus !== 'NOT_CLAIM'"
                        :loading="loading"
                        @click="claimPrize"
                        :ripple="true"
                        :hair-line="false"
                    >
                        {{ prizeInfo.claimStatus === 'NOT_CLAIM' ? '立即领取' : prizeInfo.claimStatus === 'CLAIM' ? '已领取' : '已过期' }}
                    </u-button>
                </view>
            </u-card>
        </view>
        <!-- 空状态 -->
        <view class="empty-state" v-else>
            <u-empty text="抽奖机会信息不存在" mode="coupon" :icon-size="200"></u-empty>
        </view>
        <!-- 使用说明 -->
        <view class="instructions">
            <view class="instructions-title">
                <u-icon name="info-circle" size="28" color="#999"></u-icon>
                <text class="title-text">使用说明</text>
            </view>
            <view class="instructions-content">
                <text class="content-text">1. 抽奖机会仅限在指定店铺使用\n2. 抽奖机会不可转让\n3. 请在有效期内使用</text>
            </view>
        </view>
        <!-- 空白占位 -->
        <view class="placeholder"></view>
    </view>
</template>
<script>
    import { getStorePrize, claimPrize } from '@/api/store-coupon.js';
    export default {
        data() {
            return {
                loading: false,
                prizeId: '', // 抽奖机会ID
                prizeInfo: {
                    id: "",
                    storeId: "",
                    storeName: "",
                    activityName: "", // 活动名称
                    prizeName: "抽奖机会",
                    prizeNo: "",
                    activityDes: "", // 活动描述
                    prizeDesc: "获得一次抽奖机会,可在指定活动中使用", // 抽奖机会描述
                    prizeRule: "每次抽奖消耗一次抽奖机会,抽中奖品后需及时领取", // 使用规则
                    beginTime: "", // 开始时间
                    endTime: "", // 结束时间
                    claimStatus: "NOT_CLAIM", // 领取状态
                    activityCover: "", // 封面图片
                    enableStatus: "ON" // 启用状态
                }
            }
        },
        onShow() {
            if (this.prizeId) {
                this.getPrizeDetail(this.prizeId);
            }
        },
        onLoad(options) {
            console.log('页面参数:', JSON.stringify(options));
            // 获取传递的抽奖机会ID
            if (options.id) {
                this.prizeId = options.id;
                this.getPrizeDetail(options.id);
            } else if(options.q){
                // 双重解码:微信对URL进行了两次编码
                const decodedUrl = decodeURIComponent(decodeURIComponent(options.q));
                console.log('原始URL:', decodedUrl);
                // 解析URL中的查询参数
                const params = this.parseUrlParams(decodedUrl);
                this.prizeId = params.id;
                this.getPrizeDetail(this.prizeId);
            } else {
                this.$u.toast('参数错误');
            }
        },
        methods: {
            // 解析URL参数
            parseUrlParams(url) {
                const params = {};
                // 处理可能存在的hash(如果有的话)
                const cleanUrl = url.split('#')[0];
                const queryStr = cleanUrl.split('?')[1] || '';
                queryStr.split('&').forEach(pair => {
                    const [key, value] = pair.split('=');
                    if (key) {
                        // 如果值存在,则解码,否则设为空字符串
                        params[key] = value ? decodeURIComponent(value) : '';
                    }
                });
                return params;
            },
            // 格式化日期
            formatDate(dateStr) {
                if (!dateStr) return '';
                // 处理带时区的时间格式
                const date = new Date(dateStr);
                if (isNaN(date.getTime())) {
                    // 如果日期解析失败,返回原始字符串的日期部分
                    return dateStr.split('T')[0];
                }
                // 格式化为 YYYY-MM-DD
                const year = date.getFullYear();
                const month = String(date.getMonth() + 1).padStart(2, '0');
                const day = String(date.getDate()).padStart(2, '0');
                return `${year}-${month}-${day}`;
            },
            // 获取抽奖机会详情
            async getPrizeDetail(prizeId) {
                uni.showLoading({
                    title: '加载中...'
                });
                try {
                    console.log('请求奖品详情,ID:', prizeId);
                    const res = await getStorePrize(prizeId);
                    console.log('接口返回数据:', JSON.stringify(res));
                    if (res.statusCode === 200) {
                        // 根据你提供的接口数据结构处理
                        if (res.data && res.data.code === 200 && res.data.data) {
                            this.prizeInfo = {
                                ...this.prizeInfo,
                                ...res.data.data,
                                // 确保字段映射正确
                                id: res.data.data.id || "",
                                storeId: res.data.data.storeId || "",
                                storeName: res.data.data.storeName || "默认店铺",
                                activityName: res.data.data.activityName || "抽奖活动",
                                prizeName: res.data.data.prizeName || "抽奖机会",
                                prizeNo: res.data.data.no || "",
                                activityDes: res.data.data.activityDes || "获得一次抽奖机会,可在指定活动中使用",
                                prizeDesc: res.data.data.prizeDesc || "获得一次抽奖机会,可在指定活动中使用",
                                beginTime: res.data.data.beginTime || res.data.data.startTime || "",
                                endTime: res.data.data.endTime || "",
                                activityCover: res.data.data.activityCover || "",
                                enableStatus: res.data.data.enableStatus || "ON",
                                claimStatus: "NOT_CLAIM" // 默认为未领取状态
                            };
                            console.log('设置后的prizeInfo:', JSON.stringify(this.prizeInfo));
                        } else {
                            this.$u.toast(res.data.message || '获取抽奖机会详情失败');
                        }
                    } else {
                        this.$u.toast(res.data.message);
                    }
                } catch (err) {
                    this.$u.toast('获取抽奖机会详情失败,请稍后重试');
                    console.error('获取抽奖机会详情失败:', err.message);
                } finally {
                    uni.hideLoading();
                }
            },
            // 领取抽奖机会
            async claimPrize() {
                if (this.prizeInfo.claimStatus !== 'NOT_CLAIM') {
                    this.$u.toast('该抽奖机会无法领取');
                    return;
                }
                // 确认领取
                uni.showModal({
                    title: '提示',
                    content: `确定要领取"${this.prizeInfo.activityName || this.prizeInfo.prizeName || '本次抽奖机会'}"吗?`,
                    success: (res) => {
                        if (res.confirm) {
                            this.doClaimPrize();
                        }
                    }
                });
            },
            // 执行领取抽奖机会操作
            async doClaimPrize() {
                this.loading = true;
                try {
                    // 调用领取抽奖机会接口
                    const res = await claimPrize(this.prizeId);
                    console.log('领取接口返回:', JSON.stringify(res));
                    // 根据接口返回处理结果
                    if (res.statusCode === 200) {
                        // 检查返回的数据结构
                        if (res.data && res.data.code === 200) {
                            this.$u.toast('领取成功');
                            this.prizeInfo.claimStatus = 'CLAIM';
                            // 延迟返回上一页,让用户看到领取成功的提示
                            setTimeout(() => {
                                uni.navigateBack();
                            }, 1500);
                        } else {
                            this.$u.toast(res.data.message || '领取失败');
                        }
                    } else {
                        this.$u.toast('领取失败: ' + (res.data.message || '未知错误'));
                    }
                } catch (err) {
                    this.$u.toast('领取失败,请稍后重试');
                    console.error('领取抽奖机会失败:', err.message);
                } finally {
                    this.loading = false;
                }
            }
        }
    }
</script>
<style lang="scss" scoped>
.container {
    background-color: #f5f5f5;
    min-height: 100vh;
}
.prize-card {
    margin: 20rpx;
}
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.store-info {
    display: flex;
    align-items: center;
}
.store-name {
    margin-left: 10rpx;
    font-size: 32rpx;
    font-weight: bold;
    color: #333;
}
.card-body {
    padding-top: 20rpx;
}
.cover-image {
    margin-bottom: 30rpx;
}
.prize-title {
    margin-bottom: 30rpx;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.title {
    font-size: 36rpx;
    font-weight: bold;
    color: #333;
}
.prize-desc {
    margin-bottom: 30rpx;
}
.desc {
    font-size: 28rpx;
    color: #666;
}
.prize-rule {
    margin-bottom: 30rpx;
}
.rule-title {
    font-size: 28rpx;
    color: #333;
    font-weight: bold;
}
.rule-content {
    font-size: 26rpx;
    color: #666;
}
.prize-time {
    display: flex;
    align-items: center;
    margin-bottom: 20rpx;
}
.time-text {
    font-size: 24rpx;
    color: #999;
    margin-left: 10rpx;
}
.card-foot {
    padding: 20rpx 0;
}
.instructions {
    background-color: #ffffff;
    margin: 20rpx;
    padding: 30rpx;
    border-radius: 16rpx;
}
.instructions-title {
    display: flex;
    align-items: center;
    margin-bottom: 20rpx;
}
.title-text {
    margin-left: 10rpx;
    font-size: 30rpx;
    font-weight: bold;
    color: #333;
}
.instructions-content {
    padding-left: 40rpx;
}
.content-text {
    font-size: 26rpx;
    color: #666;
    line-height: 1.6;
}
.placeholder {
    height: 40rpx;
}
.empty-state {
    margin-top: 200rpx;
}
</style>
pages/tabbar/index/home.vue
@@ -267,13 +267,15 @@
import { mapState, mapMutations } from 'vuex'
import { setPopupRedisTime, getPopupAcitivty } from '@/api/popup.js'
import { changeCollect } from "@/api/collect.js";
import { saveShare, saveShareClickRecord } from "@/api/share.js";
import { saveShare, saveShareClickRecord} from "@/api/share.js";
import { getSessionId, userAction,userShare  } from "@/api/userAction.js";
import { silentLogin } from "@/api/connect.js";
import { getUserInfo } from "@/api/members";
import storage from "@/utils/storage.js";
import TopBar from "@/components/TopBar.vue";
import { nextTick } from "vue";
import { getVideoCover } from "@/api/common.js"
import {addPrizeNum} from '@/api/prize.js'
export default {
    components: { TopBar, ActivityPopup },
    computed: {
@@ -370,10 +372,36 @@
            similarlyNomore: false, // 是否还有更多相似视频
            similaryVideoIndex: 0, // 相似视频的播放位置
            similarlyLoading: false, // 相似视频加载
            marginBottom: 0 // 底部安全区域
            marginBottom: 0 ,// 底部安全区域
            pageSessionNo:"",
            shareId:"",
            actionParam:{
                    sessionId:'',
                    actionType:"PAGE",
                    joinType:"SELF",
                    pageCode:"RECOMMEND_VIDEO",
                    pageParams:"{}",
                    pageStatus:"JOIN",
                    pageType:"LIST"
                },
                shareParam:{
                    pageCode:"RECOMMEND_VIDEO",
                    shareOption:"{}",
                    pageType:"LIST"
                },
        }
    },
    onShow() {
        getSessionId().then(res=>{
            console.log('res',JSON.stringify(res))
            this.pageSessionNo = res.data.data
            if(this.pageSessionNo){
            let    param = Object.assign({},this.actionParam);
            this.actionParam.sessionId = this.pageSessionNo
            param.sessionId = this.pageSessionNo
                userAction(param)
            }
        })
        this.openActivityPopup()
@@ -401,11 +429,32 @@
            this.totalHidenTime += duration
        }
    },
    onHide() {
        this.startHidenTime = Date.now()
    },
  onUnload() {
    let    param = Object.assign({},this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param = Object.assign({},this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
    onLoad(option) {
        if(option.shareId){
            console.log('触发onLoad')
            this.actionParam.shareId = option.shareId;
            this.actionParam.joinType = 'SHARE'
            uni.setStorage({
                key: 'shareId',
                data: option.shareId,
                success: function () {
                    console.log('缓存shareId成功');
                }
            });
        }
        console.log('-----------分享出的数据---------->', option)
        //处理扫码出来的视频
        this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
@@ -421,6 +470,9 @@
            const shareType = params.shareType;
            const videoId = params.videoId;
            queryParam.videoId = videoId
            this.actionParam.joinType = "SCAN";
            this.actionParam.pageParams = JSON.stringify(params);
            console.log('解析参数:', { shareType, videoId });
        }
        const token = storage.getAccessToken();
@@ -428,6 +480,8 @@
            this.wxSilentLogin(() => {
                // 判断是不是点击分享链接进来的
                if (option.userId && option.videoId) {
                    this.actionParam.joinType = "SHARE";
                    this.actionParam.pageParams = JSON.stringify(option);
                    queryParam.videoId = option.videoId
                    // 保存分享点击记录
                    saveShareClickRecord({ refId: option.videoId, shareUserId: option.userId })
@@ -471,13 +525,47 @@
        //     }
        // })
        console.log(videoInfo)
        return {
            title: videoInfo.title,
            path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
            imageUrl: videoInfo.coverUrl
        }
        // 保存分享记录
        // 返回一个Promise
        return new Promise((resolve) => {
                    this.shareId = '';
                    let shareObj ={
                        videoId:videoInfo.id,
                        userId:userInfo.id
                    }
                    this.shareParam.shareOption = JSON.stringify(shareObj)
                    userShare(this.shareParam).then(res => {
                      this.shareId = res.data.data;
                      let param = {
                          addType:"SHARE_GOODS_VIDEO",
                          extend:"",
                      }
                      let extend = {shareId:this.shareId}
                      param.extend = JSON.stringify(extend)
                      addPrizeNum(param);
                      // 当获取到shareId后,再resolve分享配置
                      resolve({
                        title: videoInfo.title,
                        path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}&shareId=${this.shareId}`,
                        imageUrl: videoInfo.coverUrl,
                        success(e) {
                          console.log("分享成功", e);
                        },
                        fail(e) {
                          console.log('分享失败', e);
                        }
                      });
                    }).catch(err => {
                      // 处理错误情况,例如使用默认参数
                      console.error('获取分享ID失败', err);
                      resolve({
                            title: videoInfo.title,
                            path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
                            imageUrl: videoInfo.coverUrl
                      });
                    });
        });
    },
    methods: {
        async openActivityPopup() {
pages/tabbar/user/my.vue
@@ -140,10 +140,11 @@
import '@/pages/subComponents/uview-components/uview-ui';
import tool from "@/pages/tabbar/user/utils/tool.vue";
import { getSTSToken } from "@/api/common.js";
import { getCouponsNum, getFootprintNum } from "@/api/members.js";
import { getCouponsNum, getFootprintNum,bindMemberAndStore } from "@/api/members.js";
import { getUserWallet } from "@/api/members";
import configs from '@/config/config'
import storage from '@/utils/storage.js'
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  components: {
    tool
@@ -160,12 +161,82 @@
      couponNum: "",
      footNum: "",
      walletNum: "",
      pageSessionNo:"",
      actionParam:{
            sessionId:'',
            actionType:"PAGE",
            joinType:"SELF",
            pageCode:"TBA_BAR_MY",
            pageParams:"{}",
            pageStatus:"JOIN",
            pageType:"DETAIL"
        }
    };
  },
  onLoad() {
      this.initCOS()
  onLoad(option) {
    this.actionParam.pageParams = JSON.stringify(option)
    console.log('-----------分享出的数据---------->', option)
    let shareStoreId = null;
    let shareTime = null;
    // 检查是否存在q参数
    if (option.q) {
      // 双重解码:微信对URL进行了两次编码
      const decodedUrl = decodeURIComponent(decodeURIComponent(option.q));
      console.log('原始URL:', decodedUrl);
      // 解析URL中的查询参数
      const params = this.parseUrlParams(decodedUrl);
      shareStoreId = params.shareStoreId;
      try {
        // 将数据存储到本地缓存
        uni.setStorageSync('shareStoreId', shareStoreId);
        //创建一个扫码的时间
        // 获取当前时间并格式化为 yyyy-MM-dd HH:mm:ss
        const now = new Date();
        const year = now.getFullYear();
        const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要+1
        const day = String(now.getDate()).padStart(2, '0');
        const hours = String(now.getHours()).padStart(2, '0');
        const minutes = String(now.getMinutes()).padStart(2, '0');
        const seconds = String(now.getSeconds()).padStart(2, '0');
        shareTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
        uni.setStorageSync('shareTime', shareTime);
        console.log('数据存储成功');
      } catch (e) {
        console.error('存储失败:', e);
      }
    }
    this.initCOS()
    },
  onUnload() {
    let    param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let    param =Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  // onLoad(options) {
    //
    //   this.initCOS()
  // },
  onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = res.data.data
        if(this.pageSessionNo){
        let    param = Object.assign({}, this.actionParam);
            param.sessionId = this.pageSessionNo
            userAction(param)
        }
      })
    this.userInfo = this.$options.filters.isLogin() || {};
    if (this.$options.filters.isLogin("auth")) {
      this.getUserOrderNum();
@@ -174,6 +245,16 @@
      this.couponNum = 0;
      this.footNum = 0;
    }
    let shareStoreId = uni.getStorageSync('shareStoreId');
    let shareTime = uni.getStorageSync('shareTime');
    console.log('从缓存读取参数:', { shareStoreId, shareTime });
    if (shareStoreId && shareTime) {
      console.log('检测到有效参数,调用后端接口');
      this.bindMemberAndStore(shareStoreId, shareTime);
    } else {
      console.log('无有效参数,执行正常逻辑');
    }
  },
  onPullDownRefresh() {
    this.getUserOrderNum();
@@ -190,6 +271,44 @@
  mounted() { },
  methods: {
      // 解析URL参数
      parseUrlParams(url) {
          const params = {};
          // 处理可能存在的hash(如果有的话)
          const cleanUrl = url.split('#')[0];
          const queryStr = cleanUrl.split('?')[1] || '';
          queryStr.split('&').forEach(pair => {
              const [key, value] = pair.split('=');
              if (key) {
                  // 如果值存在,则解码,否则设为空字符串
                  params[key] = value ? decodeURIComponent(value) : '';
              }
          });
          return params;
      },
    async bindMemberAndStore(shareStoreId, shareTime){
      let form ={
        shareStoreId: shareStoreId,
        shareTime: shareTime
      }
      // let form ={
      //               shareStoreId: "1376433565247471616",
      //               shareTime: "2025-09-26 16:18:00"
      // }
      try {
        const res = await bindMemberAndStore(form);
        if(res.statusCode === 200){
          //清除缓存
          uni.removeStorageSync('shareStoreId');
          uni.removeStorageSync('shareTime');
        }
      }
      catch(error) {
        console.error('出错:', error);
      };
    },
      // goTOSuccess(){
      //          uni.redirectTo({
      //             url:"/pages/cart/payment/success?paymentMethod=WECHAT" +
pages/video/video-goods-detail-swiper.vue
@@ -95,10 +95,18 @@
                                                    </span>
                                                </view>
                                                <view class="icons share" @click="shareChange()">
                                        <!--         <view class="icons share" @click="shareChange()">
                                                    <u-icon size="30" name="share-fill"></u-icon>
                                                    <view>分享</view>
                                                </view>
                                                </view> -->
                                                <view class="icons share"  style="margin-top: -15px;">
                                                       <button open-type="share" class="custom-share-btn" plain="true" style="border: none;">
                                                            <u-icon size="30" name="share-fill" :data-obj="item"></u-icon>
                                                       </button>
                                                        <view style="margin-top: -14px;">分享</view>
                                                      </view>
                                                <view class="icons" @click="clickFavorite(goodsDetail.id)">
                                                    <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
                                                        :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
@@ -293,6 +301,7 @@
import popups from "@/pages/product/popups/popups.vue"; //气泡框
import takeDownFormSaleGoods from "@/pages/product/m-take-down-sale-goods/index.vue"; //下架框
import setup from "@/pages/product/product/popup/popup.js";
import { getSessionId, userAction,userShare } from "@/api/userAction.js";
import { getGoodsDetail } from "@/api/video.js"
import {
@@ -439,6 +448,22 @@
            touchStartX: 0,
            touchEndX: 0,
            minSwipeDistance: 100, // 最小滑动距离,用于判断是否为有效滑动
            pageSessionNo:"",
            actionParam:{
                sessionId:'',
                actionType:"PAGE",
                joinType:"SELF",
                pageCode:"RECOMMEND_VIDEO_LEFT_GOODS",
                pageParams:"{}",
                pageStatus:"JOIN",
                pageType:"DETAIL"
            },
            shareParam:{
                pageCode:"RECOMMEND_VIDEO_LEFT_GOODS",
                shareOption:"{}",
                pageType:"DETAIL"
            },
            shareId:'',
        };
    },
@@ -481,18 +506,53 @@
        this.productRefHeight = windowHeight - bottomHeight + "px";
    },
    async onLoad(options) {
        if(options.shareId){
            this.actionParam.shareId = options.shareId;
            this.actionParam.joinType = 'SHARE';
            uni.setStorage({
                key: 'shareId',
                data: options.shareId,
                success: function () {
                    console.log('缓存shareId成功');
                }
            });
            console.log('触发onLoad')
        }
        this.actionParam.pageParams = JSON.stringify(options)
        this.videoId = options.videoId;
        this.getGoodsList();
        // #ifdef MP-WEIXIN
        // 小程序默认分享
        uni.showShareMenu({
            withShareTicket: true,
            menus: ["shareAppMessage", "shareTimeline"],
        });
        // uni.showShareMenu({
        //     withShareTicket: true,
        //     menus: ["shareAppMessage", "shareTimeline"],
        // });
        // #endif
    },
  onUnload() {
    let param = Object.assign({}, this.actionParam);
    if (this.sendOnShow)return
    param.pageStatus = "LEAVE"
    userAction(param)
  },
  onHide() {
    this.startHidenTime = Date.now()
    let param = Object.assign({}, this.actionParam);
    this.sendOnShow = true;
    param.pageStatus = "LEAVE"
    userAction(param)
  },
    async onShow() {
      getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        this.actionParam.sessionId = this.pageSessionNo
        if(this.pageSessionNo){
        let param = Object.assign({}, this.actionParam);
            userAction(param)
        }
      })
        // this.goodsDetail = {};
        // debugger
        // //如果有参数ids说明事分销短连接,需要获取参数
@@ -507,7 +567,41 @@
        //     this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
        // }
    },
    onShareAppMessage(e){
        const goodsInfo = e.target.dataset.obj;
        console.log(goodsInfo)
        return new Promise((resolve) => {
                    this.shareId = '';
                    let shareObj ={
                        id:goodsInfo.id,
                        goodsId:goodsInfo.goodsId
                    }
                    this.shareParam.shareOption = JSON.stringify(shareObj)
                    userShare(this.shareParam).then(res => {
                      this.shareId = res.data.data;
                      // 当获取到shareId后,再resolve分享配置
                      resolve({
                        title: this.goodsDetail.goodsName,
                        path: '/pages/product/goods' +'?id='+ goodsInfo.id + '&goodsId=' + goodsInfo.goodsId +'&shareId=' + this.shareId,
                        imageUrl: this.goodsDetail.goodsGalleryList[0],
                        success(e) {
                          console.log("分享成功", e);
                        },
                        fail(e) {
                          console.log('分享失败', e);
                        }
                      });
                    }).catch(err => {
                      // 处理错误情况,例如使用默认参数
                      console.error('获取分享ID失败', err);
                      resolve({
                        title: this.goodsDetail.goodsName,
                        path: '/pages/product/goods' +'?id='+ goodsInfo.id+ '&goodsId=' + goodsInfo.goodsId,
                        imageUrl: this.goodsDetail.goodsGalleryList[0],
                      });
                    });
        });
    },
    methods: {
        // 获取商品列表
        async getGoodsList() {
pages/video/video-goods-detail.vue
@@ -31,6 +31,7 @@
    import {getGoodsDetail} from "@/api/video.js"
    import { buyBack } from "@/api/trade.js";
    import '@/components/uview-components/uview-ui';
    import { getSessionId, userAction } from "@/api/userAction.js";
    export default {
        computed: {
            totalMoney() {
@@ -45,11 +46,45 @@
        data() {
            return {
                videoId: '',
                goodsList: []
                goodsList: [],
                pageSessionNo:"",
                actionParam:{
                        sessionId:'',
                        actionType:"PAGE",
                        joinType:"SELF",
                        pageCode:"RECOMMEND_VIDEO_GOODS",
                        pageParams:"{}",
                        pageStatus:"JOIN",
                        pageType:"DETAIL"
                    }
            }
        },
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
        onShow() {
            getSessionId().then(res=>{
                this.pageSessionNo = res.data.data
                this.actionParam.sessionId = this.pageSessionNo
                if(this.pageSessionNo){
                let param = Object.assign({}, this.actionParam);
                    userAction(param)
                }
            })
        },
        onLoad(option) {
            this.videoId = option.videoId;
            this.actionParam.pageParams = JSON.stringify(option)
            this.getGoodsList();
        },
        methods: {
pages/video/video-similar.vue
@@ -108,7 +108,7 @@
<script>
import { getGoodsSimilarlyVideos, savePlayRecord, changeCollect, changeThumbsUp } from "@/api/video.js"
import { getSessionId, userAction ,userShare } from "@/api/userAction.js";
export default {
    data() {
        return {
@@ -146,10 +146,41 @@
            // 右滑返回首页相关
            touchStartX: 0,
            touchEndX: 0,
            minSwipeDistance: 100 // 最小滑动距离
            minSwipeDistance: 100 ,// 最小滑动距离
            pageSessionNo:"",
            actionParam:{
                sessionId:'',
                actionType:"PAGE",
                joinType:"SELF",
                pageCode:"RECOMMEND_VIDEO_RIGHT_VIDEO",
                pageParams:"{}",
                pageStatus:"JOIN",
                pageType:"DETAIL"
            },
            shareParam:{
                pageCode:"RECOMMEND_VIDEO_RIGHT_VIDEO",
                shareOption:"{}",
                pageType:"DETAIL"
            },
            shareId:'',
        }
    },
    onLoad(options) {
        if(options.shareId){
            this.actionParam.shareId = options.shareId;
            this.actionParam.joinType = 'SHARE'
            console.log('触发onLoad')
            uni.setStorage({
                key: 'shareId',
                data: options.shareId,
                success: function () {
                    console.log('缓存shareId成功');
                }
            });
        }
        this.actionParam.pageParams = JSON.stringify(options)
        // 获取传递的商品信息
        if (options.goodsId) {
            this.loadSimilarVideos(options.goodsId, options.currentVideoId);
@@ -161,6 +192,15 @@
            const videoContext = uni.createVideoContext(`video${this.currentIndex}`, this);
            videoContext.play();
        }
        getSessionId().then(res=>{
                    this.pageSessionNo = res.data.data
                    this.actionParam.sessionId = res.data.data
                    if(this.pageSessionNo){
                    let    param = Object.assign({}, this.actionParam);
                        param.sessionId = this.pageSessionNo
                        userAction(param)
                    }
        })
    },
    onHide() {
        // 页面隐藏时暂停视频
@@ -168,6 +208,49 @@
            const videoContext = uni.createVideoContext(`video${this.currentIndex}`, this);
            videoContext.pause();
        }
        this.startHidenTime = Date.now()
        let param = Object.assign({}, this.actionParam);
        this.sendOnShow = true;
        param.pageStatus = "LEAVE"
        userAction(param)
    },
    onShareAppMessage(e){
        const userInfo = storage.getUserInfo();
        if (!userInfo) {
            console.log("未登录不能分享");
            return
        }
        const videoInfo = e.target.dataset.obj;
        return new Promise((resolve) => {
                    this.shareId = '';
                    let shareObj ={
                        videoId:videoInfo.id,
                        userId:userInfo.id
                    }
                    this.shareParam.shareOption = JSON.stringify(shareObj)
                    userShare(this.shareParam).then(res => {
                      this.shareId = res.data.data;
                      resolve({
                        title: videoInfo.title,
                        path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}&shareId=${this.shareId}`,
                        imageUrl: videoInfo.coverUrl,
                        success(e) {
                          console.log("分享成功", e);
                        },
                        fail(e) {
                          console.log('分享失败', e);
                        }
                      });
                    }).catch(err => {
                      // 处理错误情况,例如使用默认参数
                      console.error('获取分享ID失败', err);
                      resolve({
                            title: videoInfo.title,
                            path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
                            imageUrl: videoInfo.coverUrl
                      });
                    });
        });
    },
    methods: {
        // 加载相似视频