Commit eda47d95 authored by IvyXia123's avatar IvyXia123

支付

parent af8786c0
......@@ -84,6 +84,7 @@
</ul>
</div>
<footer>
<div class="sub-block">
<span v-if="groupDetail.goods_desc">{{priceTotal}}</span>
......@@ -91,11 +92,11 @@
class="tips-price"
v-if="groupDetail.goods_desc"
>{{groupDetail.goods_desc.tips?groupDetail.goods_desc.tips:''}}</span>
<div class="pay-btn" @click="payOrder(orderFlag)">提交订单</div>
<!--<div class="pay-btn" @click="payOrder(orderFlag)"
v-clipboard:copy="payIndex !== 0 ? payUrl : ''"
<!-- <div class="pay-btn" @click="payOrder(orderFlag)">提交订单</div>-->
<div class="pay-btn" @click="payOrder(orderFlag)"
v-clipboard:copy="payUrl"
v-clipboard:success="copy"
v-clipboard:error="onError">提交订单</div>-->
v-clipboard:error="onError">提交订单</div>
</div>
</footer>
<transition name="slide-fade">
......@@ -213,7 +214,8 @@ export default {
{ icon: zhifubao, title: '支付宝支付', value: 1 }
],
payIndex: 0,
payUrl: ''
payUrl: '',
ui: ''
};
},
mounted() {
......@@ -248,8 +250,6 @@ export default {
copy(e) {
if(this.payIndex === 1) {
Toast("支付宝支付获取成功,请把粘贴到支付宝里");
}else if(this.payIndex === 2) {
Toast("信用卡支付获取成功");
}
},
onError() {
......@@ -259,7 +259,11 @@ export default {
},
// 支付方式
payListClick(val) {
this.orderFlag = true;
this.payIndex = val
/* if(val === 1) {
this.payOrder(true)
}*/
},
recursion() {
getCourseInfoApi().then(res => {
......@@ -328,6 +332,7 @@ export default {
this.bindMobile.show = false;
},
payOrder(flag) {
console.log(flag)
let type = this.type ? 0 : 1;
let that = this;
this.orderCancel = false;
......@@ -377,7 +382,7 @@ export default {
json.group_order_id = this.$route.query.group_order_id;
}
this.orderFlag = false;
console.log(this.payIndex)
if(this.payIndex === 0) {
payApi(json).then(res => {
this.orderNo = res.out_trade_no;
......@@ -429,8 +434,7 @@ export default {
let data = { pay_type: 'ALI', return_url: window.location.href, buy_type: this.groupDetail.goods_type }
let dataObj = Object.assign({}, data, json)
postPayBillApi(dataObj).then(res => {
location.href = res.pay_url;
this.payUrl = res.pay_url
})
}
return ;
......
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