Browse Source

优化

master
陈裕财 4 years ago
parent
commit
7146216fb6
  1. 13
      src/views/xm/core/xmTaskOrder/ToPay.vue

13
src/views/xm/core/xmTaskOrder/ToPay.vue

@ -22,7 +22,7 @@
<el-row class="page-bottom bottom-fixed"> <el-row class="page-bottom bottom-fixed">
<el-button @click.native="handleCancel">取消</el-button> <el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="createOrder" :disabled="load.edit==true">提交</el-button>
<el-button v-loading="load.add" type="primary" @click.native="createOrder" :disabled="load.add==true">提交</el-button>
</el-row> </el-row>
<el-dialog <el-dialog
title="微信支付" title="微信支付"
@ -129,8 +129,14 @@
}) })
}, },
createOrder() { createOrder() {
if(!this.agreementChecked){
this.$notify({position:'bottom-left',showClose:true,message:"请仔细阅读协议,并勾选同意",type: 'error'})
return;
}
this.load.add=true;
var params={taskId:this.taskId,payType:this.payType,bizType:this.bizType} var params={taskId:this.taskId,payType:this.payType,bizType:this.bizType}
addXmTaskOrder(params).then(res => { addXmTaskOrder(params).then(res => {
this.load.add=false;
if(res.data.tips.isOk){ if(res.data.tips.isOk){
// //
Object.assign(this.editForm,res.data.data) Object.assign(this.editForm,res.data.data)
@ -154,12 +160,15 @@
}, },
toAliPay(orderId) { toAliPay(orderId) {
this.load.add=true;
let params = { let params = {
id: orderId, id: orderId,
otype: '3', otype: '3',
returnUrl: `${window.location.protocol+"//"+window.location.host}/${process.env.CONTEXT}/${process.env.VERSION}/#/my/order/paySuccess` returnUrl: `${window.location.protocol+"//"+window.location.host}/${process.env.CONTEXT}/${process.env.VERSION}/#/my/order/paySuccess`
} }
aliPay(params).then(res => { aliPay(params).then(res => {
this.load.add=false;
if(res.data.tips.isOk) { if(res.data.tips.isOk) {
const div = document.createElement("divform"); const div = document.createElement("divform");
div.innerHTML = res.data.data.htmlStr; div.innerHTML = res.data.data.htmlStr;
@ -176,12 +185,14 @@
}, },
toWeixinPay(orderId) { toWeixinPay(orderId) {
this.load.add=true;
let params = { let params = {
id: orderId, id: orderId,
otype: '3', otype: '3',
returnUrl: "" returnUrl: ""
} }
weixinPay(params).then(res => { weixinPay(params).then(res => {
this.load.add=false;
if(res.data.tips.isOk) { if(res.data.tips.isOk) {
this.codeUrl = res.data.data.codeUrl; this.codeUrl = res.data.data.codeUrl;
this.weixinPayVisible = true; this.weixinPayVisible = true;

Loading…
Cancel
Save