|
@@ -90,6 +90,9 @@ Page({
|
|
|
|
|
|
},
|
|
|
submitOrder(){
|
|
|
+ wx.showLoading({
|
|
|
+ title:'结算中...'
|
|
|
+ })
|
|
|
let that = this, goodsList = that.data.goodsList, address = that.data.address;
|
|
|
//生成订单
|
|
|
goodsList.forEach(res=>{
|
|
@@ -100,6 +103,7 @@ Page({
|
|
|
res['province'] = address.province;
|
|
|
res['consignee'] = address.consignee;
|
|
|
res['phone'] = address.phone;
|
|
|
+ res['openId'] = app.globalData.openid;
|
|
|
delete res.imgArray
|
|
|
});
|
|
|
wx.request({
|
|
@@ -108,8 +112,29 @@ Page({
|
|
|
data: {
|
|
|
shopCarList:JSON.stringify(goodsList)
|
|
|
},
|
|
|
- success(res){
|
|
|
+ success(el){
|
|
|
+ let res = el.data;
|
|
|
console.log(res)
|
|
|
+ wx.requestPayment({
|
|
|
+ timeStamp: res.timeStamp,
|
|
|
+ nonceStr: res.nonceStr,
|
|
|
+ package: res.pkg,
|
|
|
+ signType: res.signType,
|
|
|
+ paySign: res.sign,
|
|
|
+ success(res){
|
|
|
+ console.log(res,"结算结果")
|
|
|
+ },
|
|
|
+ fail(err){
|
|
|
+ wx.showToast({
|
|
|
+ title: err.errMsg,
|
|
|
+ icon:'error'
|
|
|
+ })
|
|
|
+ console.log(err)
|
|
|
+ },
|
|
|
+ complete(){
|
|
|
+ wx.hideLoading()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|