Ver a proveniência

upload

newCard
HolyKnightIX há 2 anos
ascendente
cometimento
bb00a96032
2 ficheiros alterados com 17 adições e 16 eliminações
  1. +11
    -16
      pages/exchangeCard/exchangeCard.js
  2. +6
    -0
      pages/exchangeCard/exchangeCard.wxml

+ 11
- 16
pages/exchangeCard/exchangeCard.js Ver ficheiro

@@ -59,10 +59,7 @@ Page({
const phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ const phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/
const phoneValid = phoneReg.test(this.data.phone) const phoneValid = phoneReg.test(this.data.phone)
if (!phoneValid) { if (!phoneValid) {
wx.showToast({
title: '请输入正确的手机号!',
icon: 'none'
})
this.Toast('请输入正确的手机号!', 'none')
return return
} }
this.setData({ this.setData({
@@ -139,10 +136,7 @@ Page({
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
wx.showToast({
title: err.message,
icon: "none"
})
this.Toast(err.message, 'none')
}) })
}, },


@@ -203,16 +197,10 @@ Page({
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.eCardId}`, url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.eCardId}`,
}) })
} else { } else {
wx.showToast({
title: '当前用户不是该卡的持有者,无法转赠!',
icon: 'none'
})
this.Toast('当前用户不是该卡的持有者,无法转赠!', 'none')
} }
} else { } else {
wx.showToast({
title: '该卡未绑定',
icon: 'error'
})
this.Toast('该卡未绑定', 'none')
} }
}, },


@@ -239,6 +227,13 @@ Page({
} }
}) })
}, },

Toast(message, icon) {
wx.showToast({
title: message,
icon: icon
})
},
onLoad() { onLoad() {
setTimeout(() => { setTimeout(() => {
this.checkPhoneStatus() this.checkPhoneStatus()


+ 6
- 0
pages/exchangeCard/exchangeCard.wxml Ver ficheiro

@@ -35,6 +35,12 @@
<!-- <text class="changePhone" bindtap="changePhone">更改</text> --> <!-- <text class="changePhone" bindtap="changePhone">更改</text> -->
</view> </view>


<view class="name">
激活状态:
<text wx:if="{{ownerUserId}}" style="color: #ff0000;">已激活</text>
<text wx:else style="color: #1aad19;">未激活</text>
</view>

<view wx:if="{{isChangePhone}}" class="phone">持卡人手机号: <view wx:if="{{isChangePhone}}" class="phone">持卡人手机号:
<input class="phoneInput" type="text" placeholder="请填写手机号" focus="true" bindinput="phoneInput" /> <input class="phoneInput" type="text" placeholder="请填写手机号" focus="true" bindinput="phoneInput" />
<text class="confirmPhone" bindtap="confirmPhone">确定</text> <text class="confirmPhone" bindtap="confirmPhone">确定</text>


Carregando…
Cancelar
Guardar