yiming
2024-04-28 04acf6421dded7b6f6eef9d2cf41d0b4a0e8dd0d
pages/cart/paymentPage/index.js
@@ -5,7 +5,7 @@
import {
  getPublicImage
} from '../../../assets/js/middleGround/tool';
import drawQrcode from './js/weapp.qrcode'
Page({
  /**
@@ -26,13 +26,20 @@
    isPaySuccess: false,
    isPayComplete: false,
    type: '',
    onNorderSaleMethod: ''
    onNorderSaleMethod: '',
    ImmediatelyReceive: ''
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    wx.setNavigationBarTitle({
      title: '提交订单'
    });
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
    const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度
@@ -108,8 +115,6 @@
      fields: {
        content: [],
        subtitle: [],
      }
    }
    app.MG.store.getOrderByOrderNum(query).then(res => {
@@ -121,10 +126,12 @@
      console.log(res.payPrice);
      this.setData({
        payPrice: res.payPrice.toFixed(2)
        payPrice: res.payPrice.toFixed(2),
        ImmediatelyReceive: res.payPrice
      })
      console.log(this.data.ImmediatelyReceive);
      res.saleMethodLinks.forEach(item => {
        console.log(item.type, 'item.type');
        // console.log(item.type, 'item.type');
        const type = item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product';
        item.type = type; // 将type设置为item对象的属性,而不是使用setData
@@ -241,4 +248,19 @@
    // 返回
    wx.navigateBack()
  },
  onReceive() {
    let query = {
      orderNum: this.data.orderGoods
    }
    app.MG.store.confirmOrder(query).then(res => {
      Toast({
        context: this,
        selector: '#t-toast',
        message: '领取成功',
        theme: 'success',
        direction: 'column',
      });
      wx.navigateBack()
    })
  }
})