闫增涛
2024-04-03 34dd2d10cf26c86ed170a59aa36718f7c27f24d0
pages/cart/paymentPage/index.js
@@ -1,6 +1,8 @@
// pages/cart/paymentPage/index.js
const app = getApp()
import { getPublicImage } from '../../../assets/js/middleGround/tool';
import {
  getPublicImage
} from '../../../assets/js/middleGround/tool';
import drawQrcode from './js/weapp.qrcode'
Page({
@@ -18,6 +20,7 @@
    orderGoods: '',
    isPaySuccess: false,
    isPayComplete: false,
    type: ''
  },
  /**
@@ -91,6 +94,7 @@
  getOrderByOrderNumData() {
    console.log(this.data.orderNumber, 'this.data.orderNumber');
    let query = {
      orderNum: this.data.orderNumber,
      fields: {
@@ -112,15 +116,16 @@
        payPrice: res.payPrice.toFixed(2)
      })
      res.saleMethodLinks.forEach(item => {
        console.log(item.type, 'item.type');
        const type = item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product';
        item.type = type; // 将type设置为item对象的属性,而不是使用setData
        item.paymentIcon = getPublicImage(item.orderSaleMethod.product.icon)
        console.log(item.orderSaleMethod.type);
        this.setData({
          productList: res.saleMethodLinks,
          type: item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'
        })
        console.log(item.type, 'item');
      })
      this.setData({
        productList: res.saleMethodLinks,
        // type: item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'
      })
    })
  },
@@ -134,6 +139,7 @@
      if (res.orderNumber) {
        let resOrderNum = {
          orderNum: res.orderNumber,
          platform: "WeChatAppCustom"
        };
        console.log(resOrderNum, 'resOrderNum');
        // 用户未绑定微信 报500