绿满眶商城微信小程序-uniapp
peng
1 天以前 d50a3ed44e2edab2a7a661c43491c3aa42c57794
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 = 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)
  },
  onLoad(options) {
   this.actionParam.pageParams = JSON.stringify(options)
  },
  onShow() {
     getSessionId().then(res=>{
      this.pageSessionNo = res.data.data
      if(this.pageSessionNo){
      let   param = this.actionParam;
         param.sessionId = this.pageSessionNo
         userAction(param)
      }
     })
    this.navList[this.tabCurrentIndex].params.pageNumber = 1;
    this.navList[this.tabCurrentIndex].dataList = [];
    this.getData();