miniprogram/pages/order-details/index.js

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

const APP = getApp();
const WXAPI = require('apifm-wxapi')
APP.configLoadOK = () => {
  wx.setNavigationBarTitle({
    title: wx.getStorageSync('mallName')
  })
}
const wxbarcode = require('wxbarcode')
const wxpay = require('../../utils/pay.js')

Page({
    data:{
      
    },
    onLoad:function(e){
      // e.id = 601144
      this.setData({
        orderId: e.id
      })
      this.orderDetail()
    },
    onShow : function () {
      
    },
    async orderDetail() {
      const res = await WXAPI.orderDetail(wx.getStorageSync('token'), this.data.orderId)
      if (res.code != 0) {
        wx.showModal({
          title: '错误',
          content: res.msg,
          showCancel: false
        })
        return
      }
      // 绘制核销码
      if (res.data.orderInfo.hxNumber && res.data.orderInfo.status == 1) {
        wxbarcode.qrcode('qrcode', res.data.orderInfo.hxNumber, 400, 400);
      }        
      this.setData({
        orderDetail: res.data
      })
      if (res.data.orderInfo.shopIdZt) {
        this.shopSubdetail()
      }
    },
    async shopSubdetail() {
      const res = await WXAPI.shopSubdetail(this.data.orderDetail.orderInfo.shopIdZt)
      if (res.code == 0) {
        this.setData({
          shopSubdetail: res.data
        })
      }
    },
    async toPayTap() {
      // 立即支付
      let res = await WXAPI.userAmount(wx.getStorageSync('token'))
      if (res.code != 0) {
        wx.showToast({
          title: res.msg,
          icon: 'none'
后面还有 78 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。