<ulclass="way_list">
<li v-if="!isWeixinBrowser"
class="group alipay"
">支付宝支付
<i class="fr" :class="selete_payway? 'mCheck':'mCheckNo'"></i>
</li>
<li class="group wechat"
">微信支付
<i class="fr" :class="selete_payway? 'mCheckNo':'mCheck'"></i>
</li>
</ul>
<!-- 支付宝支付必须 -->
<div class="goalipay_box" style="display:none" v-html="goalipayHtml"></div>
<div class="mFooter mBorderBox">
<div class="mBtn_hole" @click="realPay()">确认支付</div>
</div>
data() {
return {
isloading:true,
? : ,
serve_item:false,
showPay:false,//支付中间弹窗
showNonet:false,//支付失败
'goalipayHtml':'',
'allowClickStu':true,//允许点击
}
},
/*=====================
支付
=====================
*/
methods: {
// 判断是否完成支付流程
is_pay(){
// 完成弹出是否支付弹框
if(this.$route.query.is_payed){
this.showPay=true;
}
},
//支付宝支付selete_payway:1 微信支付selete_payway:0
realPay(){
){
window.localStorage.DSQS_PAY_WAY=this.selete_payway;
){//支付宝
this.goaliPay();
}else{
this.wxjsPay();
}
}else{
this.$api.post( '/v1/Order/cancelOrder' , {'ordercode':this.$route.query.ordercode}, res => {
){
)
}
})
return false;
}
},
noPay(){//点击未支付
this.showPay=false;
// this.$Glb.PlMessage('支付失败',800)
},
hasPay(){//点击已支付
this.showPay=false;
// 点击已支付查询是否支付, 若支付跳转,未支付停留于本页面
this.$api.post( '/v1/Order/queryOrder' , {'ordercode':this.$route.query.ordercode}, res => {
){
if(res.data.pay_status=='success'){
window.location.href=this.$route.query.success_url;
}else{
)
}
}
});
},
noNet(){
this.showNonet=false;
},
// 处理重复点击
allowClick(ts){
const that = this ;
if(this.allowClickStu===true){
this.allowClickStu = false;
,function(){
)
that.allowClickStu = true
});
return true
}
if(this.allowClickStu === false){
return false
}
},
// 微信支付
wxjsPay(){
// 处理重复点击
if(!this.allowClick())return false;
let that = this;
if(window.navigator.userAgent.match(/micromessenger/i)){
this.$api.post( 'https://xxxxxxxx/pay/wxjspay' , {'ordercode':this.$route.query.ordercode}, res => {
){
window.location.href=res.data.url
}
){
// 成功
}
){
alert(res.msg)
}
})
}else{
this.$api.post( 'https://xxxxxx/pay/gowxpay' , {'ordercode':this.$route.query.ordercode}, res => {
){
this.axiosWxH5payData=res;
window.location.href = res.data.url;//微信支付页。
}
})
}
},
// 支付宝
goaliPay(){
// 处理重复点击
if(!this.allowClick())return false;
this.$api.post( 'https://pay.xxxx.cn/pay/goalipay' , {'ordercode':this.$route.query.ordercode}, res => {
this.goalipayHtml = res
setTimeout(function(){
window.document.forms['alipaysubmit'].submit();
},)
})
}
}