商品下单
This commit is contained in:
		@@ -1,6 +1,5 @@
 | 
			
		||||
// pages/shop/myOrder.js
 | 
			
		||||
 | 
			
		||||
const goodService = require("../../services/good")
 | 
			
		||||
const orderService = require("../../services/order")
 | 
			
		||||
 | 
			
		||||
Page({
 | 
			
		||||
 
 | 
			
		||||
@@ -112,10 +112,23 @@ Page({
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (res.confirm) {
 | 
			
		||||
          wx.showToast({
 | 
			
		||||
            title: '支付成功',
 | 
			
		||||
            icon: 'success',
 | 
			
		||||
          })
 | 
			
		||||
          (async () => {
 | 
			
		||||
            let payResult = await orderService.payOrder(this.data.orderId)
 | 
			
		||||
            console.log("payResult", payResult)
 | 
			
		||||
            wx.showModal({
 | 
			
		||||
              title: '支付结果',
 | 
			
		||||
              content: payResult,
 | 
			
		||||
              showCancel: false,
 | 
			
		||||
              complete: (res) => {
 | 
			
		||||
                wx.navigateBack({
 | 
			
		||||
                  delta: getCurrentPages().length - 1
 | 
			
		||||
                })
 | 
			
		||||
                wx.navigateTo({
 | 
			
		||||
                  url: "/pages/shop/orderDetail?orderId=" + this.data.orderId,
 | 
			
		||||
                })
 | 
			
		||||
              }
 | 
			
		||||
            })
 | 
			
		||||
          })();
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
@@ -165,4 +178,4 @@ Page({
 | 
			
		||||
      })
 | 
			
		||||
    })();
 | 
			
		||||
  }
 | 
			
		||||
})
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user