Commit fc50a519 authored by lijiongliang's avatar lijiongliang

优化支付页面

parent 4329bd4b
...@@ -192,6 +192,10 @@ export default { ...@@ -192,6 +192,10 @@ export default {
addressId: this.addressId, addressId: this.addressId,
commodityList: list, commodityList: list,
} }
uni.showLoading({
title: '加载中',
mask:true
});
let that = this let that = this
let opts = { let opts = {
url: '/app/mall/create/order', url: '/app/mall/create/order',
...@@ -213,6 +217,7 @@ export default { ...@@ -213,6 +217,7 @@ export default {
that.http.httpTokenRequest(opts, that.orderSubmit).then(res => { that.http.httpTokenRequest(opts, that.orderSubmit).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
let paymentData = res.data.data.invokeResponse; let paymentData = res.data.data.invokeResponse;
uni.hideLoading()
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', // 服务提提供商 provider: 'wxpay', // 服务提提供商
timeStamp: paymentData.timeStamp, timeStamp: paymentData.timeStamp,
......
...@@ -107,6 +107,10 @@ export default { ...@@ -107,6 +107,10 @@ export default {
nums: 1, nums: 1,
}], }],
} }
uni.showLoading({
title: '加载中',
mask:true
});
let that = this let that = this
let opts = { url: '/app/mall/create/order', method: 'post' }; let opts = { url: '/app/mall/create/order', method: 'post' };
this.http.httpTokenRequest(opts, this.createOrder).then(res => { this.http.httpTokenRequest(opts, this.createOrder).then(res => {
...@@ -123,7 +127,7 @@ export default { ...@@ -123,7 +127,7 @@ export default {
//console.log(res); //console.log(res);
if (res.data.code == 200) { if (res.data.code == 200) {
let paymentData = res.data.data.invokeResponse; let paymentData = res.data.data.invokeResponse;
uni.hideLoading()
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', // 服务提提供商 provider: 'wxpay', // 服务提提供商
timeStamp: paymentData.timeStamp, timeStamp: paymentData.timeStamp,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment