|
@@ -8,13 +8,11 @@
|
|
|
</ujp-navbar>
|
|
|
<view class="recharge">
|
|
|
<view class="recharge-text">
|
|
|
- <p v-show="!queryCard.query">充值手机号
|
|
|
-
|
|
|
- </p >
|
|
|
+ <p >充值手机号 </p >
|
|
|
<p v-show="queryCard.query&&queryCard.name">
|
|
|
用户姓名:{{queryCard.name}}
|
|
|
</p>
|
|
|
- <u-input v-model="phone" v-show="!queryCard.query"
|
|
|
+ <u-input v-model="phone" style=" border-bottom: 1px solid rgb(220, 223, 230);"
|
|
|
:custom-style="{
|
|
|
'font-size': '48rpx',
|
|
|
'line-height': '48rpx',
|
|
@@ -25,24 +23,15 @@
|
|
|
'color':' rgba(204, 204, 204, 1)',
|
|
|
}"
|
|
|
height="82" placeholder="请输入充值手机号" ></u-input>
|
|
|
+ <view style="
|
|
|
+ color: red;
|
|
|
+ font-size: 16px;
|
|
|
+">{{errorText}}</view>
|
|
|
</view>
|
|
|
- <view class="rechargePhone" v-show="queryCard.query">
|
|
|
- <view>
|
|
|
- <h1 style="font-size: 48rpx;line-height: 48rpx;height:82rpx; display: flex;align-items: center;" >{{phone}}</h1>
|
|
|
-
|
|
|
- </view>
|
|
|
- <view
|
|
|
- @click="queryCard.query=false,phone=''"
|
|
|
- class="recharge-btn">
|
|
|
- 更换
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
- <view style="padding: 30rpx;" v-show="!queryCard.query" >
|
|
|
|
|
|
- <u-button type="primary" @click="findByPhone" :custom-style="customStyle" shape="square">查询用户</u-button>
|
|
|
</view>
|
|
|
+
|
|
|
+
|
|
|
<view class="rechargeBk" v-if="queryCard.query&&queryCard.chargingCardList&&queryCard.chargingCardList.length">
|
|
|
<view class="rechargeBkInfo" >
|
|
|
|
|
@@ -86,7 +75,7 @@
|
|
|
</view>
|
|
|
|
|
|
|
|
|
- <view v-show="queryCard.query">
|
|
|
+ <view >
|
|
|
<view class="charge" >
|
|
|
<view class="chargeTit">
|
|
|
选择充值金额
|
|
@@ -126,7 +115,7 @@
|
|
|
<u-icon name="tikuan" custom-prefix="custom-icon" color="#FF9502" size="48"></u-icon>
|
|
|
<span>支付 {{amount}} 元</span>
|
|
|
</view>
|
|
|
- <u-button type="primary" @click="submit" :custom-style="customStyle" shape="square">确定充值</u-button>
|
|
|
+ <u-button type="primary" @click="submit" :custom-style="customStyle" shape="square">{{btnText}}</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -160,6 +149,8 @@
|
|
|
list:[5,10,20,50,100,200],
|
|
|
amount:5,
|
|
|
phone:"",
|
|
|
+ btnText:"请输入手机号",
|
|
|
+ errorText:"",
|
|
|
}
|
|
|
},
|
|
|
onLoad(op){
|
|
@@ -170,11 +161,33 @@
|
|
|
},
|
|
|
onReady() {
|
|
|
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ phone(old){
|
|
|
+ if(old&&old.length==11){
|
|
|
+ var checkPhoneResult = checkPhone(old);
|
|
|
+
|
|
|
+ if ( checkPhoneResult !== true) {
|
|
|
+ this.btnText=checkPhoneResult
|
|
|
+ }else{
|
|
|
+ this.findByPhone()
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.btnText="请输入手机号"
|
|
|
+ this.queryCard={
|
|
|
+ query:false,
|
|
|
+ chargingCardList:[]
|
|
|
+ }
|
|
|
+ this.errorText="";
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
showCardBtn(num){
|
|
|
if(num>5){
|
|
|
this.showCard=!this.showCard
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -211,14 +224,14 @@
|
|
|
}else{
|
|
|
this.showCard=true
|
|
|
}
|
|
|
-
|
|
|
+ this.btnText="充值"
|
|
|
}).catch(error => {
|
|
|
uni.hideLoading()
|
|
|
- uni.showModal({
|
|
|
- title:"提示",
|
|
|
- content:error,
|
|
|
- showCancel:false,
|
|
|
- })
|
|
|
+ this.queryCard={
|
|
|
+ query:false,
|
|
|
+ chargingCardList:[]
|
|
|
+ }
|
|
|
+ this.errorText=error;
|
|
|
})
|
|
|
},
|
|
|
customBack(){
|
|
@@ -232,15 +245,24 @@
|
|
|
})
|
|
|
},
|
|
|
submit(){
|
|
|
+
|
|
|
+ if(!this.queryCard.query){
|
|
|
+ uni.showModal({
|
|
|
+ title:"提示",
|
|
|
+ content:this.errorText?this.errorText:this.btnText,
|
|
|
+ showCancel:false,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
var checkPhoneResult = checkPhone(this.phone);
|
|
|
|
|
|
- if ( checkPhoneResult !== true) {
|
|
|
- uni.showToast({
|
|
|
- title: checkPhoneResult,
|
|
|
+ // if ( checkPhoneResult !== true) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: checkPhoneResult,
|
|
|
|
|
|
- })
|
|
|
- return;
|
|
|
- }
|
|
|
+ // })
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|