绿满眶商城微信小程序-uniapp
peng
2 天以前 d50a3ed44e2edab2a7a661c43491c3aa42c57794
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 = 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(val) {
         this.routerVal = val;
         this.actionParam.pageParams = JSON.stringify(val)
         //初始化参数
         // #ifdef APP-PLUS
         this.paymentType = "APP";