|
@@ -92,7 +92,13 @@
|
|
|
<text class="num-big">{{totalPrice}}</text>乐豆
|
|
|
</view>
|
|
|
<view class="footer">
|
|
|
- <u-input v-model="password" maxlength="30" input-align="center" type="password" placeholder="请输入支付密码" />
|
|
|
+ <u-input v-model="password" maxlength="30"
|
|
|
+ input-align="center" type="password"
|
|
|
+ placeholder="请输入支付密码"
|
|
|
+ @confirm="toPayOrder"/>
|
|
|
+ </view>
|
|
|
+ <view class="fot-btn">
|
|
|
+ <u-button @click="toPayOrder" type="error" >确认支付</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
@@ -162,8 +168,6 @@
|
|
|
showLeavePsw: false, // 打开确定放弃弹窗
|
|
|
}
|
|
|
},
|
|
|
- onShow() {
|
|
|
- },
|
|
|
onLoad() {
|
|
|
// 监听设置密码是否成功
|
|
|
uni.$once('setPswSuccess', this.setPsw)
|
|
@@ -274,11 +278,11 @@
|
|
|
},
|
|
|
// 支付剩余时间
|
|
|
filterTime (time) {
|
|
|
- console.log(time,'tttttt')
|
|
|
+ // console.log(time,'tttttt')
|
|
|
let nowT = new Date().valueOf() // 现在时间戳
|
|
|
let orderT = new Date(time).valueOf() // 下单时间戳
|
|
|
let tt = (1800 * 1000) - (nowT - orderT) // 距离30分钟支付 相差时间戳
|
|
|
- console.log(tt,'tttttt')
|
|
|
+ // console.log(tt,'tttttt')
|
|
|
return tt
|
|
|
},
|
|
|
|
|
@@ -304,12 +308,35 @@
|
|
|
this.showLeavePsw = false
|
|
|
this.showInputPsw = true
|
|
|
},
|
|
|
- // 支付
|
|
|
+ // 支付 判断用户是否设置过支付密码
|
|
|
toPay(item) {
|
|
|
- // this.totalPrice = item.payGold
|
|
|
- // this.showSetPswModal = true
|
|
|
- // return
|
|
|
- signPay({id:item.id}).then(res=>{
|
|
|
+ this.orderId = item.id
|
|
|
+ // 判断用户是否设置过支付密码
|
|
|
+ existPayPwd().then(res=>{
|
|
|
+ console.log(res,'rrrrrr')
|
|
|
+ if(res.status == 200) {
|
|
|
+ // 设置过支付密码,输入密码
|
|
|
+ if(res.data) {
|
|
|
+ this.showInputPsw = true
|
|
|
+ } else {
|
|
|
+ // 没设置过支付密码,提示设置密码
|
|
|
+ this.showSetPswModal = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 支付
|
|
|
+ toPayOrder() {
|
|
|
+ let params = {
|
|
|
+ payPwd: this.password,
|
|
|
+ id: this.orderId
|
|
|
+ }
|
|
|
+ signPay(params).then(res=>{
|
|
|
this.btnLoading = false
|
|
|
if(res.status == 200) {
|
|
|
// 跳转到支付完成界面
|
|
@@ -460,6 +487,7 @@
|
|
|
>view {
|
|
|
&:last-child {
|
|
|
flex: 1;
|
|
|
+ padding: 10upx 0;
|
|
|
margin-left: 20upx;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
@@ -497,13 +525,26 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 物流弹窗
|
|
|
- .slot-content {
|
|
|
- padding: 40upx 60upx;
|
|
|
- font-size: 28upx;
|
|
|
-
|
|
|
- >view {
|
|
|
- line-height: 60upx;
|
|
|
+ // 支付密码弹窗
|
|
|
+ .slot-content{
|
|
|
+ padding: 30upx 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ .text-cont{
|
|
|
+ width: 100%;
|
|
|
+ padding: 60upx 0;
|
|
|
+ text-align: center;
|
|
|
+ .num-big{
|
|
|
+ font-size: 40upx;
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .footer{
|
|
|
+ width: 80%;
|
|
|
+ border-bottom: 1px solid #b1b1b1;
|
|
|
+ margin-bottom: 30upx;
|
|
|
}
|
|
|
}
|
|
|
}
|