Commit c91dd126 authored by youjie's avatar youjie
parents d5f781d4 8b586ce1
......@@ -667,7 +667,7 @@
}
},
SetAlipayBind(){
if(this.AlipayBindMsg.ShareCode.length==0){
if(this.AlipayBindMsg.Identity.length==0){
this.$message.error("请输入支付宝登陆账号");
return ;
}
......
<template>
<div class="templatePayURL" style="display: inline-block; float: right; margin-right: 10px;">
<el-popover width="320" trigger="manual" v-model="visible">
<div>
<div v-if="QrCodeType==0">
<p style="margin:0 0 15px 0;">{{$t('objFill.erwmask')}}
<i class="el-icon-circle-close-outline fr" style="cursor: pointer; margin: 3px 0 0 0;" @click="closePic()"></i>
</p>
......@@ -29,6 +30,32 @@
<p class="fz12 color333">{{$t('objFill.daojishi')}}</p>
<p style="color: #E95252; font-weight: bold; font-size: 12px; margin: 8px 0;" >{{descMin}}{{$t('objFill.fen')}}{{descSecond}}{{$t('objFill.miao')}}</p>
</div>
</div>
<div v-if="QrCodeType==1">
<p style="margin:0 0 15px 0;">支付宝二维码收款
<i class="el-icon-circle-close-outline fr" style="cursor: pointer; margin: 3px 0 0 0;" @click="closePic()"></i>
</p>
<div style="margin: 15px 0;" v-show="!isShowPic">
<el-input placeholder="请输入金额" v-model="payMoney"
@input="payMoney=/^\d+\.?\d{0,2}$/.test(payMoney)||payMoney == '' ? payMoney : payMoney=''">
</el-input>
<p style="margin-top:5px;">
<input type="button" @click="getAliPayDetail(item,2)" class="normalBtn w280" value="生成收款码" />
</p>
</div>
<div v-show="isShowPic">
<img :src="'data:image/png;base64,'+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>二维码有效时间为
<template v-if="QrCodeType==1">2小时</template>
<template v-else> 5分钟</template>,为了不影响客户支付,请及时转发,以免失效
</p>
<template >
<p class="fz12 color333">倒计时</p>
<p style="color: #E95252; font-weight: bold; font-size: 12px; margin: 8px 0;" >{{descMin}}{{descSecond}}</p>
</template>
</div>
</div>
<el-select slot="reference" v-model="value" class='w80' :placeholder="$t('rule.skfangshi')" @change='chanceType(item)'>
<!-- <el-option label="二维码" value="1"></el-option> -->
......@@ -37,6 +64,7 @@
<el-option :label="$t('objFill.tuanduixiaofei')" value="4"></el-option>
<el-option v-if="photoF" :label="$t('objFill.zhaopianfwf')" value="5"></el-option>
<el-option :label="$t('objFill.yuejieptf')" value="6"></el-option>
<el-option label="支付宝二维码" value="7" v-if="false"></el-option>
</el-select>
</el-popover>
</div>
......@@ -49,6 +77,7 @@
return {
value:'',
visible:false,
alipayVisible:false,
payObj: {},
payWay: '3',
minpay: '0',
......@@ -67,7 +96,8 @@
begin:0,
nowDate:new Date(),
timer:null,
chaTime:0
chaTime:0,
QrCodeType:0,
};
},
watch:{
......@@ -93,7 +123,8 @@
},
methods: {
closePic(){
this.visible=false
this.visible=false;
this.alipayVisible=false;
this.value=''
if(this.timer)
{
......@@ -216,6 +247,13 @@
}
});
}
else if(this.value==='7')
{
this.alipayVisible=true;
this.QrCodeType=1;
//this.getAliPayDetail(obj,2)
//this.$emit("childByValue",obj.orderId)
}
this.value = ''
},
getPayDetail(obj, Type) {
......@@ -257,7 +295,36 @@
// }
},
getAliPayDetail(obj, Type) {
let nowTime = new Date()
let ExpireDate = ''
this.apipost('alipay_post_AlipayTradePrecreate', {
orderId: obj.orderId,
PayMoney:this.payMoney,
//OrderType: obj.OrderType,
}, res => {
if(res.data.resultCode == 1) {
this.lastTime = new Date();//res.data.data.ExpireDate
this.nowDate =this.lastTime;//res.data.data.ExpireDate
this.lastTime= new Date(this.lastTime.valueOf() + 2*60* 60 * 1000);//=new Date();//res.data.data.NowDate
//this.lastTime.getHours()+2;
this.lastTime= new Date(this.lastTime.valueOf() - 5000);
console.log("this.lastTime",this.lastTime);
console.log("this.nowDate",this.nowDate);
this.chaTime=this.lastTime-this.nowDate
ExpireDate = new Date(res.data.data.ExpireDate)
this.timer=setInterval(() => {
this.descTime(this.chaTime)
}, 1000);
this.payPic=res.data.data.QrCode
this.isShowPic = true
}
else{
this.$message.warning('获取支付宝二维码失败')
}
}, err => {})
},
getCodeUrl(obj) {
this.apipost('Financial_post_GetLowPrice', {
OrderID: obj.orderId,
......@@ -332,6 +399,7 @@
// // 一秒后递归
// },
descTime() {
console.log("this.chaTime",this.chaTime);
let day = parseInt(this.chaTime / 1000 / 60 / 60 / 24)
let hr = parseInt(this.chaTime / 1000 / 60 / 60 % 24)
let min = parseInt(this.chaTime / 1000 / 60 % 60)
......
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