|
@@ -23,7 +23,7 @@ Page({
|
|
|
this.setData({
|
|
|
orderId: orderId
|
|
|
})
|
|
|
- let order = await orderApi.getOrderById(orderId);
|
|
|
+ // let order = await orderApi.getOrderById(orderId);
|
|
|
|
|
|
|
|
|
|
|
@@ -122,6 +122,10 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: async function () {
|
|
|
+ await this.orderInfo()
|
|
|
+
|
|
|
+ },
|
|
|
+ orderInfo: async function(){
|
|
|
var orderId = this.data.orderId;
|
|
|
let order = await orderApi.getOrderById(orderId);
|
|
|
this.setData({
|
|
@@ -135,7 +139,6 @@ Page({
|
|
|
if (order.info.status == 2) {
|
|
|
this.drawCode(order.info.writeOffCode)
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
rpxToPx(data) {
|
|
|
return data / 750 * wx.getSystemInfoSync().windowWidth
|
|
@@ -174,6 +177,29 @@ Page({
|
|
|
*/
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
+ },
|
|
|
+ payOrder: async function(){
|
|
|
+ const self = this
|
|
|
+ let orderId = this.data.orderId
|
|
|
+ const data = {
|
|
|
+ orderId
|
|
|
+ }
|
|
|
+ const rs = await orderApi.payOrderAgain(data)
|
|
|
+
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp: rs.timeStamp,
|
|
|
+ nonceStr: rs.nonceStr,
|
|
|
+ package: rs.package,
|
|
|
+ signType: rs.signType,
|
|
|
+ paySign: rs.paySign,
|
|
|
+ success: async function (res) {
|
|
|
+ console.log(res)
|
|
|
+ await self.orderInfo()
|
|
|
+ },
|
|
|
+ fail: async function (res) {
|
|
|
+ await self.orderInfo()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
})
|