|
|
@ -21,14 +21,15 @@ |
|
|
</template> |
|
|
</template> |
|
|
</countdown-timer> --> |
|
|
</countdown-timer> --> |
|
|
<countdown-time :minute="last_pay_time[2]" :second="last_pay_time[3]" :showDay="false" :showHour="false" color="#FF9D9D" splitorColor="#FF9D9D"> |
|
|
<countdown-time :minute="last_pay_time[2]" :second="last_pay_time[3]" :showDay="false" :showHour="false" color="#FF9D9D" splitorColor="#FF9D9D"> |
|
|
|
|
|
|
|
|
</countdown-time> |
|
|
</countdown-time> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<label class="card lf-row-between" v-for="(item, index) in pay_list" :key="index" style="padding: 16rpx 40rpx;"> |
|
|
|
|
|
|
|
|
<label class="card lf-row-between" v-for="(item, index) in pay_list" :key="index" |
|
|
|
|
|
style="padding: 16rpx 40rpx;"> |
|
|
<view> |
|
|
<view> |
|
|
<text class="lf-iconfont lf-font-50 lf-text-vertical" :class="item.icon" :style="{color: item.color}"></text> |
|
|
|
|
|
|
|
|
<text class="lf-iconfont lf-font-50 lf-text-vertical" :class="item.icon" |
|
|
|
|
|
:style="{color: item.color}"></text> |
|
|
<text class="lf-m-l-10 lf-font-28 lf-color-222">{{ item.name }}</text> |
|
|
<text class="lf-m-l-10 lf-font-28 lf-color-222">{{ item.name }}</text> |
|
|
</view> |
|
|
</view> |
|
|
<radio-group @change="checkChange($event, index)"> |
|
|
<radio-group @change="checkChange($event, index)"> |
|
|
@ -50,7 +51,7 @@ |
|
|
countdownTime, |
|
|
countdownTime, |
|
|
lfPayPassword |
|
|
lfPayPassword |
|
|
}, |
|
|
}, |
|
|
data(){ |
|
|
|
|
|
|
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
pay_list: [{ |
|
|
pay_list: [{ |
|
|
name: '余额支付', |
|
|
name: '余额支付', |
|
|
@ -58,7 +59,7 @@ |
|
|
type: 'balance', |
|
|
type: 'balance', |
|
|
checked: false, |
|
|
checked: false, |
|
|
color: '#15716E' |
|
|
color: '#15716E' |
|
|
},{ |
|
|
|
|
|
|
|
|
}, { |
|
|
name: '微信支付', |
|
|
name: '微信支付', |
|
|
icon: 'icon-weixinzhifu', |
|
|
icon: 'icon-weixinzhifu', |
|
|
type: 'wx_lite', |
|
|
type: 'wx_lite', |
|
|
@ -73,10 +74,11 @@ |
|
|
balance_sum: 0, |
|
|
balance_sum: 0, |
|
|
show_pw: false, |
|
|
show_pw: false, |
|
|
user_pw: '', |
|
|
user_pw: '', |
|
|
|
|
|
clickContinue: true, |
|
|
last_pay_time: [] |
|
|
last_pay_time: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad(options){ |
|
|
|
|
|
|
|
|
onLoad(options) { |
|
|
this.token = this.$cookieStorage.get('user_token'); |
|
|
this.token = this.$cookieStorage.get('user_token'); |
|
|
this.last_pay_time = this.$cookieStorage.get('last_pay_time') || [0,0,29,58]; |
|
|
this.last_pay_time = this.$cookieStorage.get('last_pay_time') || [0,0,29,58]; |
|
|
this.amount = options.amount; |
|
|
this.amount = options.amount; |
|
|
@ -88,7 +90,7 @@ |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 获取余额 |
|
|
// 获取余额 |
|
|
getBalanceSum(){ |
|
|
|
|
|
|
|
|
getBalanceSum() { |
|
|
this.$http.get({ |
|
|
this.$http.get({ |
|
|
api: 'api/users/balance/sum', |
|
|
api: 'api/users/balance/sum', |
|
|
header: { |
|
|
header: { |
|
|
@ -99,11 +101,11 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 改变支付方式 |
|
|
// 改变支付方式 |
|
|
checkChange(event, current){ |
|
|
|
|
|
|
|
|
checkChange(event, current) { |
|
|
let list = this.pay_list.map((item, index) => { |
|
|
let list = this.pay_list.map((item, index) => { |
|
|
if(index == current){ |
|
|
|
|
|
|
|
|
if (index == current) { |
|
|
item.checked = true; |
|
|
item.checked = true; |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
item.checked = false; |
|
|
item.checked = false; |
|
|
} |
|
|
} |
|
|
return item; |
|
|
return item; |
|
|
@ -111,28 +113,32 @@ |
|
|
this.pay_list = list; |
|
|
this.pay_list = list; |
|
|
}, |
|
|
}, |
|
|
// 倒计时结束 |
|
|
// 倒计时结束 |
|
|
dateFinish(){ |
|
|
|
|
|
|
|
|
dateFinish() { |
|
|
console.log("倒计时结束"); |
|
|
console.log("倒计时结束"); |
|
|
this.is_date_finish = true; |
|
|
this.is_date_finish = true; |
|
|
this.$msg('订单超时', {icon: 'error'}).then(() => { |
|
|
|
|
|
|
|
|
this.$msg('订单超时', { |
|
|
|
|
|
icon: 'error' |
|
|
|
|
|
}).then(() => { |
|
|
this.$toBack(); |
|
|
this.$toBack(); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 支付密码输入完成 |
|
|
// 支付密码输入完成 |
|
|
payComfirm(event){ |
|
|
|
|
|
|
|
|
payComfirm(event) { |
|
|
this.user_pw = event; |
|
|
this.user_pw = event; |
|
|
this.confirm(); |
|
|
this.confirm(); |
|
|
}, |
|
|
}, |
|
|
// 支付 |
|
|
// 支付 |
|
|
confirm(){ |
|
|
|
|
|
if(this.is_date_finish) return this.$msg('订单超时未支付'); |
|
|
|
|
|
|
|
|
confirm() { |
|
|
|
|
|
if (this.clickContinue == true) { |
|
|
|
|
|
this.clickContinue = false; |
|
|
|
|
|
if (this.is_date_finish) return this.$msg('订单超时未支付'); |
|
|
let channel = ''; |
|
|
let channel = ''; |
|
|
this.pay_list.map(item => { |
|
|
this.pay_list.map(item => { |
|
|
if(item.checked){ |
|
|
|
|
|
|
|
|
if (item.checked) { |
|
|
channel = item.type; |
|
|
channel = item.type; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if(channel == 'balance' && !this.user_pw){ |
|
|
|
|
|
|
|
|
if (channel == 'balance' && !this.user_pw) { |
|
|
this.show_pw = true; |
|
|
this.show_pw = true; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
@ -144,7 +150,7 @@ |
|
|
order_no: this.order_no, |
|
|
order_no: this.order_no, |
|
|
balance: 0 |
|
|
balance: 0 |
|
|
}; |
|
|
}; |
|
|
if(channel == 'balance'){ |
|
|
|
|
|
|
|
|
if (channel == 'balance') { |
|
|
data.pay_pwd = this.user_pw; |
|
|
data.pay_pwd = this.user_pw; |
|
|
data.balance = Number(this.amount); |
|
|
data.balance = Number(this.amount); |
|
|
data.channel = 'wx_lite'; |
|
|
data.channel = 'wx_lite'; |
|
|
@ -169,8 +175,10 @@ |
|
|
this.newcharge(false, res.message); |
|
|
this.newcharge(false, res.message); |
|
|
this.show_pw = false; |
|
|
this.show_pw = false; |
|
|
} |
|
|
} |
|
|
|
|
|
this.clickContinue = true; |
|
|
}) |
|
|
}) |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
|
|
|
this.clickContinue = true; |
|
|
this.show_pw = false; |
|
|
this.show_pw = false; |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
loading: false |
|
|
loading: false |
|
|
@ -180,6 +188,7 @@ |
|
|
showCancel: false |
|
|
showCancel: false |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 获取openid |
|
|
// 获取openid |
|
|
getOpenid() { |
|
|
getOpenid() { |
|
|
@ -235,7 +244,8 @@ |
|
|
// url: `/pages/store/success/success?order_no=${that.order_no}&amount=${that.amount}&channel=${that.channel}&formId=${this.formId}` //&charge_id=${charge.charge_id} charge_id 支付测试使用 |
|
|
// url: `/pages/store/success/success?order_no=${that.order_no}&amount=${that.amount}&channel=${that.channel}&formId=${this.formId}` //&charge_id=${charge.charge_id} charge_id 支付测试使用 |
|
|
// }); |
|
|
// }); |
|
|
uni.redirectTo({ |
|
|
uni.redirectTo({ |
|
|
url: '/pages/aboutpay/paystate?payState=1&amount='+ that.amount |
|
|
|
|
|
|
|
|
url: '/pages/aboutpay/paystate?payState=1&amount=' + that |
|
|
|
|
|
.amount |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
wx.showModal({ |
|
|
wx.showModal({ |
|
|
@ -285,18 +295,18 @@ |
|
|
// url: `/pages/store/success/success?order_no=${this.order_no}&amount=${this.amount}&channel=${this.channel}&formId=${this.formId}` |
|
|
// url: `/pages/store/success/success?order_no=${this.order_no}&amount=${this.amount}&channel=${this.channel}&formId=${this.formId}` |
|
|
// }); |
|
|
// }); |
|
|
uni.redirectTo({ |
|
|
uni.redirectTo({ |
|
|
url: '/pages/aboutpay/paystate?payState=1&amount='+ this.amount |
|
|
|
|
|
|
|
|
url: '/pages/aboutpay/paystate?payState=1&amount=' + this.amount |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
setData: function (obj) { |
|
|
|
|
|
|
|
|
setData: function(obj) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
let keys = []; |
|
|
let keys = []; |
|
|
let val, data; |
|
|
let val, data; |
|
|
Object.keys(obj).forEach(function (key) { |
|
|
|
|
|
|
|
|
Object.keys(obj).forEach(function(key) { |
|
|
keys = key.split('.'); |
|
|
keys = key.split('.'); |
|
|
val = obj[key]; |
|
|
val = obj[key]; |
|
|
data = that.$data; |
|
|
data = that.$data; |
|
|
keys.forEach(function (key2, index) { |
|
|
|
|
|
|
|
|
keys.forEach(function(key2, index) { |
|
|
if (index + 1 == keys.length) { |
|
|
if (index + 1 == keys.length) { |
|
|
that.$set(data, key2, val); |
|
|
that.$set(data, key2, val); |
|
|
} else { |
|
|
} else { |
|
|
@ -314,35 +324,40 @@ |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|
page{ |
|
|
|
|
|
|
|
|
page { |
|
|
background-color: #F8F8F8; |
|
|
background-color: #F8F8F8; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
<style lang="scss" scoped="scoped"> |
|
|
<style lang="scss" scoped="scoped"> |
|
|
.content{ |
|
|
|
|
|
|
|
|
.content { |
|
|
padding: 30rpx 32rpx; |
|
|
padding: 30rpx 32rpx; |
|
|
width: 750rpx; |
|
|
width: 750rpx; |
|
|
height: max-content; |
|
|
height: max-content; |
|
|
box-sizing: border-box; |
|
|
box-sizing: border-box; |
|
|
.card{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.card { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: max-content; |
|
|
height: max-content; |
|
|
padding: 30rpx 40rpx; |
|
|
padding: 30rpx 40rpx; |
|
|
background-color: #FFFFFF; |
|
|
background-color: #FFFFFF; |
|
|
border-radius: 20rpx; |
|
|
border-radius: 20rpx; |
|
|
&:nth-child(n+2){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:nth-child(n+2) { |
|
|
margin-top: 30rpx; |
|
|
margin-top: 30rpx; |
|
|
} |
|
|
} |
|
|
.symbol{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.symbol { |
|
|
color: #15716E; |
|
|
color: #15716E; |
|
|
font-size: 32rpx; |
|
|
font-size: 32rpx; |
|
|
} |
|
|
} |
|
|
.price{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.price { |
|
|
font-size: 72rpx; |
|
|
font-size: 72rpx; |
|
|
color: #15716E; |
|
|
color: #15716E; |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
} |
|
|
} |
|
|
.tips{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.tips { |
|
|
font-size: 24rpx; |
|
|
font-size: 24rpx; |
|
|
color: #FF9D9D; |
|
|
color: #FF9D9D; |
|
|
display: flex; |
|
|
display: flex; |
|
|
@ -360,7 +375,7 @@ |
|
|
width: 168rpx; |
|
|
width: 168rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.fixed-btn{ |
|
|
|
|
|
|
|
|
.fixed-btn { |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
bottom: 10vh; |
|
|
bottom: 10vh; |
|
|
left: calc(50% - 275rpx); |
|
|
left: calc(50% - 275rpx); |
|
|
|