|
|
@@ -52,16 +52,37 @@
|
|
|
<div class="pay-list">
|
|
|
<div class="pay-info">
|
|
|
<el-radio-group v-model="payMethods">
|
|
|
- <el-radio v-for="item in payList" border :label="item.type" :key="item.type">
|
|
|
+ <el-radio
|
|
|
+ :disabled="flag"
|
|
|
+ v-for="item in payList"
|
|
|
+ border
|
|
|
+ :label="item.type"
|
|
|
+ :key="item.type"
|
|
|
+ >
|
|
|
<img :src="item.icon" alt="" />
|
|
|
<span> {{ item.name }}</span>
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="status == 'NOT_PAID'">
|
|
|
+ <!-- <div v-if="status === 'NOT_PAID'">
|
|
|
+ <vue-qrcode :value="payUrl2" :options="{ width: 140, margin: 1 }" class="code"></vue-qrcode>
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <div v-if="status === 'NOT_PAID'">
|
|
|
<div class="qrcode">
|
|
|
- <vue-qrcode :value="payUrl" :options="{ width: 140, margin: 1 }" class="code"></vue-qrcode>
|
|
|
+ <vue-qrcode
|
|
|
+ v-if="payMethods === 'WEIXIN'"
|
|
|
+ :value="payUrl"
|
|
|
+ :options="{ width: 140, margin: 1 }"
|
|
|
+ class="code"
|
|
|
+ ></vue-qrcode>
|
|
|
+ <vue-qrcode
|
|
|
+ v-if="payMethods === 'ALIPAY'"
|
|
|
+ :value="payUrl2"
|
|
|
+ :options="{ width: 140, margin: 1 }"
|
|
|
+ class="code"
|
|
|
+ ></vue-qrcode>
|
|
|
</div>
|
|
|
<h3 class="qrcode-text">
|
|
|
二维码有效时常为5分钟,<span v-if="minters < 10">0</span>{{ minters }}分<span
|
|
|
@@ -69,7 +90,6 @@
|
|
|
>0</span
|
|
|
>{{ seconds }} 请尽快支付
|
|
|
</h3>
|
|
|
- <!-- <div class="qrcode-text">手机微信扫描二维码下单</div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -140,6 +160,7 @@ export default {
|
|
|
org: '',
|
|
|
empty: false,
|
|
|
payMethods: 'WEIXIN',
|
|
|
+ flag: false,
|
|
|
minters: 0,
|
|
|
seconds: 0,
|
|
|
allTime: 5 * 60 - 1,
|
|
|
@@ -151,12 +172,12 @@ export default {
|
|
|
icon: require('../assets/weixin.png'),
|
|
|
name: '微信',
|
|
|
type: 'WEIXIN'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: require('../assets/alipay.png'),
|
|
|
+ name: '支付宝',
|
|
|
+ type: 'ALIPAY'
|
|
|
}
|
|
|
- // {
|
|
|
- // icon: require('../assets/alipay.png'),
|
|
|
- // name: '支付宝',
|
|
|
- // type: 'ALIPAY'
|
|
|
- // },
|
|
|
|
|
|
// {
|
|
|
// icon: require('../assets/dcep.png'),
|
|
|
@@ -168,10 +189,12 @@ export default {
|
|
|
info: {},
|
|
|
gas: 0,
|
|
|
id: 0,
|
|
|
- status: ''
|
|
|
+ status: '',
|
|
|
+ payUrl2: ''
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ // 微信
|
|
|
payUrl() {
|
|
|
return resolveUrl(
|
|
|
this.$baseUrl,
|
|
|
@@ -277,9 +300,6 @@ export default {
|
|
|
},
|
|
|
all() {
|
|
|
this.show2 = true;
|
|
|
- // if (this.listAll.length === 0) {
|
|
|
- // this.empty = true;
|
|
|
- // }
|
|
|
},
|
|
|
choose(info) {
|
|
|
console.log(info);
|
|
|
@@ -288,6 +308,7 @@ export default {
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.show = false;
|
|
|
+ this.flag = false;
|
|
|
if (this.payTimeout) {
|
|
|
clearInterval(this.payTimeout);
|
|
|
}
|
|
|
@@ -296,10 +317,11 @@ export default {
|
|
|
//监控支付状态
|
|
|
this.payTimeout = setInterval(() => {
|
|
|
this.$http.get('/order/get/' + this.id).then(res => {
|
|
|
- console.log(res);
|
|
|
+ // console.log(res);
|
|
|
if (res.status === 'FINISH') {
|
|
|
clearInterval(this.payTimeout);
|
|
|
this.show = false;
|
|
|
+ this.flag = false;
|
|
|
setTimeout(() => {
|
|
|
this.init2();
|
|
|
}, 1000);
|
|
|
@@ -316,10 +338,12 @@ export default {
|
|
|
}).then(() => {});
|
|
|
},
|
|
|
submit() {
|
|
|
+ // clearInterval(this.payTimeout);
|
|
|
// console.log(this.$baseUrl);
|
|
|
// if (this.payMethods === 'DCEP') {
|
|
|
// this.wait();
|
|
|
// }
|
|
|
+ this.flag = true;
|
|
|
let url = '/order/create?collectionId=' + this.$route.query.id + '&qty=1';
|
|
|
if (this.couponInfo) {
|
|
|
url += '&couponId=' + this.couponInfo.id;
|
|
|
@@ -328,18 +352,27 @@ export default {
|
|
|
.post(url)
|
|
|
.then(res => {
|
|
|
if (this.money) {
|
|
|
- // 没有代金券
|
|
|
+ // 没有兑换券
|
|
|
this.initTime(res.id, res.createdAt);
|
|
|
this.status = res.status;
|
|
|
this.id = res.id;
|
|
|
this.payWatch();
|
|
|
} else {
|
|
|
- // 有代金券
|
|
|
+ // 兑换券
|
|
|
this.$message.success('支付成功');
|
|
|
setTimeout(() => {
|
|
|
this.$router.replace('/collectionorder');
|
|
|
}, 1000);
|
|
|
}
|
|
|
+ if (this.payMethods === 'ALIPAY') {
|
|
|
+ this.$http
|
|
|
+ .get('/payOrder/alipay_qr', {
|
|
|
+ id: res.id
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.payUrl2 = res;
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
.catch(e => {
|
|
|
if (e) {
|
|
|
@@ -403,6 +436,9 @@ export default {
|
|
|
/deep/ .el-dialog__body {
|
|
|
padding: 4px 20px 0;
|
|
|
}
|
|
|
+/deep/ .el-radio__inner {
|
|
|
+ background-color: #fff !important;
|
|
|
+}
|
|
|
.border {
|
|
|
height: 1px;
|
|
|
background: #f2f3f5;
|