Browse Source

卡号校验

Signed-off-by: lilei <530624206@qq.com>
lilei 4 years ago
parent
commit
77934bcf35
1 changed files with 3 additions and 2 deletions
  1. 3 2
      pagesA/giftCard/giftCard.vue

+ 3 - 2
pagesA/giftCard/giftCard.vue

@@ -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" @input="vailRcode" placeholder="请输入充值码(8位字母或数字)" :maxlength="8" input-align="center" />
+						<u-input v-model="rechargeCode" placeholder="请输入充值码" :maxlength="9" input-align="center" />
 					</view>
 					<u-button class="recharge-btn" shape="circle" :custom-style="customBtnStyle" hover-class="none" @click="goRecharge">立即充值</u-button>
 				</view>
@@ -92,7 +92,8 @@
 					})
 					return
 				}
-				giftCardUseCard({ sequence: this.rechargeCode }).then(res => {
+				let sequence = this.rechargeCode.replace(/[^\w\.\/]/ig,'')
+				giftCardUseCard({ sequence }).then(res => {
 					if(res.status == 200){
 						this.ldNum = res.data
 						this.messagePop = true