@@ -309,6 +309,10 @@ var config = { | |||||
* 根据code查询接口 | * 根据code查询接口 | ||||
*/ | */ | ||||
findByCode: "/merchant/findByCode", | findByCode: "/merchant/findByCode", | ||||
/** | |||||
* 设置密码 | |||||
*/ | |||||
updatePayPassword: "/couponOrder/updatePayPassword", | |||||
/** | /** | ||||
* 参与砍价 | * 参与砍价 | ||||
*/ | */ | ||||
@@ -162,6 +162,58 @@ Page({ | |||||
}) | }) | ||||
}, | }, | ||||
goSetSecurity() { | |||||
wx.showModal({ | |||||
title: '设置支付密码', | |||||
placeholderText: '请设置密码,不设则默认为无密码', | |||||
editable: true, | |||||
complete: (res) => { | |||||
if (res.cancel) { | |||||
console.log(res); | |||||
} | |||||
if (res.confirm) { | |||||
const numReg = /^\d+$/ | |||||
const isNum = numReg.test(res.content) | |||||
if (res.content) { | |||||
if (!isNum || (res.content.length != 6)) { | |||||
wx.showToast({ | |||||
title: '密码只能为6位数字', | |||||
icon: 'none' | |||||
}) | |||||
return | |||||
} else { | |||||
this.setPassword(1, res.content) | |||||
} | |||||
} else { | |||||
this.setPassword(0, '') | |||||
} | |||||
} | |||||
} | |||||
}) | |||||
}, | |||||
setPassword(payCheck, pwd) { | |||||
Http.post({ | |||||
url: config.api.updatePayPassword, | |||||
data: { | |||||
id: this.data.data.id, | |||||
payCheck: payCheck, | |||||
payPassword: pwd | |||||
} | |||||
}).then(res => { | |||||
wx.showToast({ | |||||
title: '设置成功!', | |||||
icon: 'success' | |||||
}) | |||||
}).catch(err => { | |||||
wx.showToast({ | |||||
title: err.message, | |||||
icon: 'error' | |||||
}) | |||||
}) | |||||
}, | |||||
goCheck() { | goCheck() { | ||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.data.id}`, | url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.data.id}`, | ||||
@@ -150,6 +150,7 @@ | |||||
</view> --> | </view> --> | ||||
<view class="bottomBtn"> | <view class="bottomBtn"> | ||||
<!-- wx:if="{{showImg=='0'}}" --> | <!-- wx:if="{{showImg=='0'}}" --> | ||||
<button class="btn" bindtap='goSetSecurity'>支付安全设置</button> | |||||
<button class="btn" bindtap='goCheck'>查看交易记录</button> | <button class="btn" bindtap='goCheck'>查看交易记录</button> | ||||
<button wx:if="{{isShowQR && showImg=='1'}}" class="btn" bindtap='gotoPay'>扫一扫付款</button> | <button wx:if="{{isShowQR && showImg=='1'}}" class="btn" bindtap='gotoPay'>扫一扫付款</button> | ||||
<button wx:if="{{(data.supportTransfer==1) && showImg=='1'}}" class="btn" bindtap="goGive">转送给微信好友</button> | <button wx:if="{{(data.supportTransfer==1) && showImg=='1'}}" class="btn" bindtap="goGive">转送给微信好友</button> | ||||
@@ -372,7 +372,7 @@ page { | |||||
.bottomBtn { | .bottomBtn { | ||||
position: sticky; | position: sticky; | ||||
bottom: 0; | bottom: 0; | ||||
padding: 50rpx; | |||||
padding: 70rpx; | |||||
z-index: 99999; | z-index: 99999; | ||||
} | } | ||||
@@ -172,10 +172,13 @@ Page({ | |||||
}, | }, | ||||
getCouponOrderByPassword(password) { | getCouponOrderByPassword(password) { | ||||
const that = this | |||||
Http.post({ | Http.post({ | ||||
url: config.api.getCouponOrderByPassword, | url: config.api.getCouponOrderByPassword, | ||||
data: { | data: { | ||||
password, | password, | ||||
payCheck: that.data.pdwSwitch, | |||||
payPassword: that.data.password | |||||
} | } | ||||
}) | }) | ||||
.then(res => { | .then(res => { | ||||
@@ -217,6 +220,26 @@ Page({ | |||||
}, | }, | ||||
submit() { | submit() { | ||||
if (this.data.pdwSwitch) { | |||||
const password = this.data.password | |||||
const numReg = /^\d+$/ | |||||
if (!password) { | |||||
wx.showToast({ | |||||
title: '密码不能为空!', | |||||
icon: 'none' | |||||
}) | |||||
return | |||||
} | |||||
if (!numReg.test(password) || password.length != 6) { | |||||
wx.showToast({ | |||||
title: '密码只能为6位数字!', | |||||
icon: 'none' | |||||
}) | |||||
return | |||||
} | |||||
} | |||||
const e = { | const e = { | ||||
detail: { value: { code: this.data.code } } | detail: { value: { code: this.data.code } } | ||||
} | } | ||||
@@ -55,7 +55,7 @@ | |||||
<text class="cancelChangePhone" bindtap="cancelChangePhone">取消</text> | <text class="cancelChangePhone" bindtap="cancelChangePhone">取消</text> | ||||
</view> | </view> | ||||
<!-- <view class="security"> | |||||
<view class="security"> | |||||
<text>支付安全设置:</text> | <text>支付安全设置:</text> | ||||
<radio-group wx:if="{{tabIndex == 0}}" class="radioGroup" bindchange="securityChange"> | <radio-group wx:if="{{tabIndex == 0}}" class="radioGroup" bindchange="securityChange"> | ||||
<label> | <label> | ||||
@@ -71,7 +71,7 @@ | |||||
<radio value="0" checked="true" />无验证 | <radio value="0" checked="true" />无验证 | ||||
</label> | </label> | ||||
</radio-group> | </radio-group> | ||||
</view> --> | |||||
</view> | |||||
<view wx:if="{{pdwSwitch && tabIndex == 0}}" class="pwdBox"> | <view wx:if="{{pdwSwitch && tabIndex == 0}}" class="pwdBox"> | ||||
<view wx:if="{{!isShowPwd}}" style="margin-bottom: 0;"> | <view wx:if="{{!isShowPwd}}" style="margin-bottom: 0;"> | ||||
@@ -7,7 +7,7 @@ | |||||
"preloadBackgroundData": false, | "preloadBackgroundData": false, | ||||
"useIsolateContext": true | "useIsolateContext": true | ||||
}, | }, | ||||
"libVersion": "2.11.2", | |||||
"libVersion": "2.30.2", | |||||
"condition": { | "condition": { | ||||
"miniprogram": { | "miniprogram": { | ||||
"list": [ | "list": [ | ||||