绿满眶商城微信小程序-uniapp
peng
13 小时以前 89efee9a2e20fc04b4537d859917b47cf68a814c
pages/product/goods.vue
@@ -187,7 +187,7 @@
          <storeLayout v-if="false" id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
          <!-- 宝贝详情 -->
          <GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
         <GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
            v-if="goodsDetail.id" />
          <!-- 宝贝推荐 -->
@@ -305,6 +305,7 @@
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 { getSessionId, userAction } from "@/api/userAction.js";
   import {
      getSTSToken
   } from '@/api/common.js'
@@ -444,6 +445,23 @@
      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"
      }
    };
  },
@@ -512,8 +530,11 @@
        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)
@@ -527,7 +548,28 @@
    });
    // #endif
  },
  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)
  },
  async onShow () {
     getSessionId().then(res=>{
        this.pageSessionNo = res.data.data
        if(this.pageSessionNo){
        let   param = this.actionParam;
           param.sessionId = this.pageSessionNo
           userAction(param)
        }
     })
    this.goodsDetail = {};
    //如果有参数ids说明事分销短连接,需要获取参数
    if (this.routerVal.scene) {