绿满眶商城微信小程序-uniapp
peng
1 天以前 d50a3ed44e2edab2a7a661c43491c3aa42c57794
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 = this.actionParam;
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let   param = this.actionParam;
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
      onShow() {
         getSessionId().then(res=>{
            this.pageSessionNo = res.data.data
            if(this.pageSessionNo){
            let   param = this.actionParam;
               param.sessionId = this.pageSessionNo
               userAction(param)
            }
         })
      },
      onLoad(option) {
         this.videoId = option.videoId;
         this.actionParam.pageParams = JSON.stringify(option)
         this.getGoodsList();
      },
      methods: {