绿满眶商城微信小程序-uniapp
peng
11 小时以前 89efee9a2e20fc04b4537d859917b47cf68a814c
pages/order/fillorder.vue
@@ -148,6 +148,11 @@
            "
            :span="3"
          >
<!--         <video v-if="val.goodsSku.goodsVideo" :src="val.goodsSku.goodsVideo"
        style="width: 200rpx;height: 200rpx;border-radius: 10rpx;"
       :initial-time="0"
          :controls="false" object-fit="contain" :show-play-btn="false" :show-center-play-btn="false"
        ></video> -->
            <u-image
              borderRadius="10rpx"
              width="200rpx"
@@ -379,13 +384,15 @@
        <div class="tabbar-right">提交订单</div>
        <!-- #endif -->
        <!-- #ifdef MP-WEIXIN -->
        <div class="tabbar-right">微信支付</div>
        <div class="tabbar-right">立即支付</div>
        <!-- #endif -->
      </div>
    </div>
  </div>
</template>
<script>
import '@/components/uview-components/uview-ui'
import * as API_Address from "@/api/address";
import * as API_Order from "@/api/order";
import * as API_Trade from "@/api/trade";
@@ -393,9 +400,11 @@
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
import invoices from "@/pages/order/invoice/setInvoice";
import { mapState } from "vuex";
import { getSessionId, userAction } from "@/api/userAction.js";
export default {
  onLoad: function (val) {
    this.routerVal = val;
   this.actionParam.pageParams = JSON.stringify(val)
  },
  components: {
    invoices,
@@ -447,6 +456,17 @@
      storeAddress: "",
      originOrderData:"", // 原始订单数据
     pageSessionNo:"",
    sendOnShow:false,
     actionParam:{
           sessionId:'',
           actionType:"PAGE",
           joinType:"SELF",
           pageCode:"FILL_ORDER",
           pageParams:"{}",
           pageStatus:"JOIN",
           pageType:"DETAIL"
        }
    };
  },
  watch: {
@@ -509,8 +529,28 @@
      return true; //阻止默认返回行为
    }
  },
  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)
        }
     })
    // 判断是否存在写过备注信息的商品
    if (this.remark && this.remark.length > 0) {
      this.remarkFlag = true;
@@ -534,6 +574,7 @@
  mounted() {},
  methods: {
    //发票回调 选择发票之后刷新购物车
    async callbackInvoice(val) {
      this.invoiceFlag = false;
@@ -704,16 +745,9 @@
                url: "/pages/order/myOrder?status=0",
              });
            } else {
              // #ifdef MP-WEIXIN
              // 微信小程序中点击创建订单直接开始支付
              this.pay(res.data.result.sn);
              // #endif
              // #ifndef MP-WEIXIN
              this.navigateTo(
                `/pages/cart/payment/payOrder?trade_sn=${res.data.result.sn}`
              );
              // #endif
            }
          } else {
            uni.showToast({