Commit f68914d3 authored by zhengke's avatar zhengke

修改

parent dec6a896
<template>
<div class="templatePayURL" style=" float: right; margin-right: 10px;">
<div class="templatePayURL" style="margin-right: 10px;">
<div>
<p style="margin:0 0 15px 0;">二维码收款</p>
<div style="margin: 15px 0;">
<el-input :disabled="true" v-model="item.TotalPrice">
</el-input>
<p style="margin: 15px 0; text-indent:5px;">
<el-radio v-model="payWay" label="3">支付宝</el-radio>
<el-radio v-model="payWay" label="1">微信</el-radio>
</p>
<p>
<input type="button" @click="getPayPic(item)" class="normalBtn w280" value="生成收款码" />
</p>
</div>
<div>
<img :src="payPic"
style="float: left; margin-right: 15px; width: 150px; height: 150px; border: 1px solid #ccc;" />
<p style="padding-right: 10px; font-size: 12px; line-height: 20px; margin-bottom: 10px;">
<span style="color: #E95252;">{{payWay=="1"?'微信':'支付宝'}}</span>二维码有效时间为5分钟,为了不影响客户支付,请及时转发,以免失效
</p>
<p class="fz12 color333">倒计时</p>
<p style="color: #E95252; font-weight: bold; font-size: 12px; margin: 8px 0;">{{descMin}}{{descSecond}}</p>
</div>
<template v-if="!isShowPic">
<div style="margin: 15px 0;">
<!-- <el-input :disabled="true" v-model="item.TotalPrice">
</el-input> -->
<div>
总金额:<span style="color:red;">{{item.TotalPrice}}</span>
</div>
<p style="margin: 25px 0;">
<el-radio v-model="payWay" label="3">支付宝</el-radio>
<el-radio v-model="payWay" label="1">微信</el-radio>
</p>
<p>
<input type="button" @click="getPayPic(item)" style="width:100%;margin-left:0;" class="normalBtn"
value="生成收款码" />
</p>
</div>
</template>
<template v-if="isShowPic">
<div>
<img :src="payPic"
style="float: left; margin-right: 15px; width: 150px; height: 150px; border: 1px solid #ccc;" />
<p style="padding-right: 10px; font-size: 12px; line-height: 20px; margin-bottom: 10px;">
<span style="color: #E95252;">{{payWay=="1"?'微信':'支付宝'}}</span>二维码有效时间为5分钟,为了不影响客户支付,请及时转发,以免失效
</p>
<p class="fz12 color333">倒计时</p>
<p style="color: #E95252; font-weight: bold; font-size: 12px; margin: 8px 0;">{{descMin}}{{descSecond}}</p>
</div>
<div style="color:red;font-size:13px;margin-top:50px;">请不要刷新页面,否则无法支付成功,订单自动取消!</div>
</template>
</div>
</div>
</template>
......@@ -35,7 +43,7 @@
payWay: '3',
payType: 211,
lastTime: '',
isShowPic: true,
isShowPic: false,
payPic: '',
isDesc: false,
descMin: 0,
......@@ -44,17 +52,18 @@
begin: 0,
nowDate: new Date(),
timer: null,
chaTime: 0
timer2: null,
chaTime: 0,
};
},
mounted() {
},
methods: {
getPayPic(obj) {
let msg = {}
msg.OrderSource = 16
msg.body = "支付赞羊商品订单:"+obj.orderId;
msg.body = "支付赞羊商品订单:" + obj.orderId;
msg.attach = this.payType + '|' + obj.contactName + '|' + obj.orderId + '|' + obj.customerId + '|' + obj
.outBranchId
msg.total_fee = obj.TotalPrice
......@@ -69,12 +78,56 @@
this.timer = setInterval(() => {
this.descTime(this.chaTime)
}, 1000);
this.isShowPic = true
this.isShowPic = true;
//重复调用支付状态
this.timer2 = setInterval(() => {
this.getPayStatus()
}, 2000);
} else {
this.$message.error(res.data.message)
this.Error(res.data.message)
}
}, err => {})
},
//获取付款状态
getPayStatus() {
console.log(this.item, 'item');
let msg = {
OrderId: 40010
}
var myPay = this.payWay;
if(myPay==3){
myPay=2
}
this.apipost('OnlinePay_post_CheckOrderPay', msg, res => {
if (res.data.resultCode == 1) {
var data = res.data.data;
let mallMsg={
OrderId:data.OrderId,
MerchantsNo:data.Pay_Order,
User_Id:this.item.User_Id,
Out_Trade_No:data.Trade_Order,
Transaction_Id:'',
PayWay:myPay,
Money:this.item.TotalPrice,
Remarks:"支付赞羊商品订单:" + this.item.orderId
}
this.mallapipost("/api/AppletOrder/UpdateERPGoodsOrderInfo", mallMsg, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
}else{
this.Error(res.data.message);
}
})
this.$emit('closeDia')
clearInterval(this.timer2);
} else {
// this.Error(res.data.message)
}
}, err => {})
},
descTime() {
let day = parseInt(this.chaTime / 1000 / 60 / 60 / 24)
let hr = parseInt(this.chaTime / 1000 / 60 / 60 % 24)
......@@ -101,6 +154,9 @@
this.chaTime -= 1000
// 一秒后递归
},
parentHandleclick() {
this.isShowPic = false;
}
},
};
......
......@@ -195,10 +195,10 @@
<el-button size="small" type="danger" @click="saveInfo('AddressMsg')">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="立即支付" :visible.sync="payVisible" width="400px">
<payMall :item="payObj"></payMall>
<el-dialog title="二维码收款" :visible.sync="payVisible" width="400px">
<payMall :item="payObj" @closeDia="closeDia" ref="payChild"></payMall>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="payVisible = false">取 消</el-button>
<el-button size="small" @click="cancelPay()">取 消</el-button>
</span>
</el-dialog>
</div>
......@@ -215,6 +215,7 @@
contactName: "",
customerId: 0,
outBranchId: 0,
User_Id:0
},
statusValue: 0, //请选择
//数据列表
......@@ -539,6 +540,7 @@
this.payObj.contactName = userInfo.emName;
this.payObj.customerId = userInfo.EmployeeId;
this.payObj.outBranchId = userInfo.RB_Branch_id;
this.payObj.User_Id = this.orderMsg.mallUserId;
this.payVisible = true;
this.Success("下单成功!");
this.clreaMsg();
......@@ -643,9 +645,16 @@
return false;
}
});
},
//调用取消
cancelPay(){
this.payVisible=false;
this.$refs.payChild.parentHandleclick();
},
//关闭
closeDia(){
this.payVisible=false;
}
},
mounted() {
this.getCategroy();
......
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