绿满眶商城微信小程序-uniapp
peng
2 天以前 d50a3ed44e2edab2a7a661c43491c3aa42c57794
pages/cart/payment/success.vue
@@ -54,6 +54,7 @@
</template>
<script>
// import goodsRecommend from "@/pages/cart/m-goods-recommend/index.vue";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  data() {
    return {
@@ -64,6 +65,16 @@
      payPrice: 0,
      goodsList: [],
      activeColor: this.$mainColor,
     pageSessionNo:"",
     actionParam:{
           sessionId:'',
           actionType:"PAGE",
           joinType:"SELF",
           pageCode:"PAY_SUCCESS",
           pageParams:"{}",
           pageStatus:"JOIN",
           pageType:"DETAIL"
        }
    };
  },
  // components: {
@@ -83,7 +94,31 @@
      }
    },
  },
  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(options) {
   this.actionParam.pageParams = JSON.stringify(options)
    this.paymentMethod = options.paymentMethod || "";
    this.from = options.from || "";
    this.payPrice = options.payPrice || 0;