toPay(){
let postData={
order_no:this.orderNo,
pay_channel:this.payChannel
}
console.log(postData);
axios.post(this.globalAPI.setPay, postData).then(res=>{
if(res.data.code == 401){//支付前先验证一遍登录
this.$toast.success(res.data.msg)
this.$router.push({path: '/Login'})
}
if(this.payChannel ==1){ //余额支付
console.log(res)
if(res.data.code == 200){
this.$toast.success(res.data.msg)
this.$router.push({path: '/MyOrder'})
}else {
this.$toast.fail(res.data.msg)
}
}else if(this.payChannel == 2){//微信支付
console.log("微信支付")
}else if(this.payChannel == 3){//支付宝支付
console.log(res)
if (res.status === 200) {
console.log("支付宝支付")
const div = document.createElement('div')
/* 此处form就是后台返回接收到的数据 */
div.innerHTML = res.data
document.body.appendChild(div)
document.forms[0].submit()
}
}
}, error => {
console.log(error)
}
)
},
微信暂没开发