Browse Source

添加按钮

test
Enzo 4 years ago
parent
commit
fd06e76e17
  1. 4
      common/api.js
  2. 1
      pages/order/confirm_order.vue
  3. 22
      pages/order/order_details.vue

4
common/api.js

@ -1,8 +1,8 @@
// appId: 正式 null | 测试 wxb35ef055a4dd8ad4 // appId: 正式 null | 测试 wxb35ef055a4dd8ad4
export const DEV = "dev"; // dev 测试 | prod 正式 export const DEV = "dev"; // dev 测试 | prod 正式
export const VERSION = '1.0.0'; // 版本号 export const VERSION = '1.0.0'; // 版本号
// export const DEVURL = 'http://hainan.lanzulive.com'; // 测试服请求地址
export const DEVURL = 'http://hainan.com'; // 测试服请求地址
export const DEVURL = 'http://hainan.lanzulive.com'; // 测试服请求地址
// export const DEVURL = 'http://hainan.com'; // 测试服请求地址
export const PRODURL = ''; // 正式服请求地址 export const PRODURL = ''; // 正式服请求地址

1
pages/order/confirm_order.vue

@ -130,6 +130,7 @@
this.getGoodsData(this.pay_type); this.getGoodsData(this.pay_type);
} }
if(this.order_id && this.enter_type == 1) { if(this.order_id && this.enter_type == 1) {
console.log('立即付款')
this.payOnce(); this.payOnce();
} }
}, },

22
pages/order/order_details.vue

@ -104,6 +104,10 @@
<text class="lf-font-32 text-white">立即使用</text> <text class="lf-font-32 text-white">立即使用</text>
</button> </button>
<button class="btn bg-green" v-if="orderDetails.status == 0" @click="payAtonce()">
<text class="lf-font-32 text-white">立即付款</text>
</button>
<button class="btn bg-blue" v-if="orderDetails.status == 16"> <button class="btn bg-blue" v-if="orderDetails.status == 16">
<text class="lf-font-32 text-white">已使用</text> <text class="lf-font-32 text-white">已使用</text>
</button> </button>
@ -176,6 +180,24 @@
this.getOrderDetails() this.getOrderDetails()
this.$msg('刷新成功') this.$msg('刷新成功')
}, },
payAtonce() {
this.$http(this.API.API_ORDERPAY,{id: this.order_id}).then(res => {
uni.requestPayment({
orderInfo: res.data.order_num,
timeStamp: res.data.timeStamp,
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: (res) => {
this.$url('/pages/payState/paystate?ifSuccess=1&order_id='+this.order_id,{type: 'redirect'})
},
fail: (err) => {
this.$url('/pages/payState/paystate?ifSuccess=2&order_id='+this.order_id,{type: 'redirect'})
},
})
}).catch(err => {})
},
// //
qrR(data) { qrR(data) {
this.base64Img = data; this.base64Img = data;

Loading…
Cancel
Save