绿满眶商城微信小程序-uniapp
peng
2025-10-11 f1d0c08bbef3ffef0b9bbd0c181d2047c9866a7f
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,46 @@
            walletValue: 0.0,
            // 支付倒计时
            autoCancel: 0,
            pageSessionNo:"",
            actionParam:{
                  sessionId:'',
                  actionType:"PAGE",
                  joinType:"SELF",
                  pageCode:"PAY_ORDER",
                  pageParams:"{}",
                  pageStatus:"JOIN",
                  pageType:"DETAIL"
               }
         
         };
      },
    onUnload() {
      let param = Object.assign({}, this.actionParam);
      if (this.sendOnShow)return
      param.pageStatus = "LEAVE"
      userAction(param)
    },
    onHide() {
      this.startHidenTime = Date.now()
      let param = Object.assign({}, this.actionParam);
      this.sendOnShow = true;
      param.pageStatus = "LEAVE"
      userAction(param)
    },
      onShow() {
      getSessionId().then(res=>{
         this.pageSessionNo = res.data.data
         this.actionParam.sessionId = this.pageSessionNo
         if(this.pageSessionNo){
         let param = Object.assign({}, this.actionParam);
            userAction(param)
         }
      })
      },
      onLoad(val) {
         this.routerVal = val;
         this.actionParam.pageParams = JSON.stringify(val)
         console.log('获取解密的参数',JSON.stringify(val),decodeURIComponent(this.routerVal.template))
         //初始化参数
         // #ifdef APP-PLUS
         this.paymentType = "APP";
@@ -126,7 +161,7 @@
               paymentMethod +
               "&payPrice=" +
               this.cashierParams.price+
               "&orderType="+this.orderType
               "&orderType="+this.orderType +"&orderSn="+this.cashierParams.orderSns
            });
         },
         
@@ -151,12 +186,19 @@
            parms.sn = this.sn;
            parms.orderType = this.orderType;
            parms.clientType = this.paymentType;
            if(!this.routerVal.template){
            const template = decodeURIComponent(this.routerVal.template)
            parms.templateId = template.templateId;
            parms.templateName = template.templateName;
            parms.chooseImage = template.chooseImage;
            parms.templateForm = template.templateForm;
            }
            API_Trade.getCashierData(parms).then((res) => {
            
               if(res.data.success){
               this.cashierParams = res.data.result;
               console.log('获取订单信息------------------>',this.cashierParams.orderSns)
               // #ifdef MP-WEIXIN
               this.payList = res.data.result.support.filter((item) => {
                  return item != "ALIPAY";