|
@@ -13,7 +13,7 @@
|
|
|
<image class="module-header-bg" src="/static/giftcard/module-header-bg.png"></image>
|
|
|
<view class="giftcard-main recharge-code">
|
|
|
<view class="inp-con">
|
|
|
- <u-input v-model="rechargeCode" placeholder="请输入充值码" :maxlength="8" input-align="center" />
|
|
|
+ <u-input v-model="rechargeCode" @input="vailRcode" placeholder="请输入充值码(8位字母或数字)" :maxlength="8" input-align="center" />
|
|
|
</view>
|
|
|
<u-button class="recharge-btn" shape="circle" :custom-style="customBtnStyle" hover-class="none" @click="goRecharge">立即充值</u-button>
|
|
|
</view>
|
|
@@ -78,6 +78,11 @@
|
|
|
this.rechargeCode = ''
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 校验卡号输入,只能输入字母和数字
|
|
|
+ vailRcode(event){
|
|
|
+ console.log(event)
|
|
|
+ this.rechargeCode = event.replace(/[^\w\.\/]/ig,'')
|
|
|
+ },
|
|
|
// 立即充值
|
|
|
goRecharge(){
|
|
|
if(!this.rechargeCode){
|