Browse Source

upload

newCard
HolyKnightIX 2 years ago
parent
commit
45019d7b8a
7 changed files with 84 additions and 4 deletions
  1. +4
    -0
      config/config.js
  2. +52
    -0
      pages/cardorder/cardUse/cardUse.js
  3. +1
    -0
      pages/cardorder/cardUse/cardUse.wxml
  4. +1
    -1
      pages/cardorder/cardUse/cardUse.wxss
  5. +23
    -0
      pages/exchangeCard/exchangeCard.js
  6. +2
    -2
      pages/exchangeCard/exchangeCard.wxml
  7. +1
    -1
      project.private.config.json

+ 4
- 0
config/config.js View File

@@ -309,6 +309,10 @@ var config = {
* 根据code查询接口
*/
findByCode: "/merchant/findByCode",
/**
* 设置密码
*/
updatePayPassword: "/couponOrder/updatePayPassword",
/**
* 参与砍价
*/


+ 52
- 0
pages/cardorder/cardUse/cardUse.js View File

@@ -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() {
wx.navigateTo({
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.data.id}`,


+ 1
- 0
pages/cardorder/cardUse/cardUse.wxml View File

@@ -150,6 +150,7 @@
</view> -->
<view class="bottomBtn">
<!-- wx:if="{{showImg=='0'}}" -->
<button class="btn" bindtap='goSetSecurity'>支付安全设置</button>
<button class="btn" bindtap='goCheck'>查看交易记录</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>


+ 1
- 1
pages/cardorder/cardUse/cardUse.wxss View File

@@ -372,7 +372,7 @@ page {
.bottomBtn {
position: sticky;
bottom: 0;
padding: 50rpx;
padding: 70rpx;
z-index: 99999;
}



+ 23
- 0
pages/exchangeCard/exchangeCard.js View File

@@ -172,10 +172,13 @@ Page({
},

getCouponOrderByPassword(password) {
const that = this
Http.post({
url: config.api.getCouponOrderByPassword,
data: {
password,
payCheck: that.data.pdwSwitch,
payPassword: that.data.password
}
})
.then(res => {
@@ -217,6 +220,26 @@ Page({
},

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 = {
detail: { value: { code: this.data.code } }
}


+ 2
- 2
pages/exchangeCard/exchangeCard.wxml View File

@@ -55,7 +55,7 @@
<text class="cancelChangePhone" bindtap="cancelChangePhone">取消</text>
</view>

<!-- <view class="security">
<view class="security">
<text>支付安全设置:</text>
<radio-group wx:if="{{tabIndex == 0}}" class="radioGroup" bindchange="securityChange">
<label>
@@ -71,7 +71,7 @@
<radio value="0" checked="true" />无验证
</label>
</radio-group>
</view> -->
</view>

<view wx:if="{{pdwSwitch && tabIndex == 0}}" class="pwdBox">
<view wx:if="{{!isShowPwd}}" style="margin-bottom: 0;">


+ 1
- 1
project.private.config.json View File

@@ -7,7 +7,7 @@
"preloadBackgroundData": false,
"useIsolateContext": true
},
"libVersion": "2.11.2",
"libVersion": "2.30.2",
"condition": {
"miniprogram": {
"list": [


Loading…
Cancel
Save