zhongtianhaoyuan 2 years ago
parent
commit
05f79ddb08
2 changed files with 15 additions and 4 deletions
  1. 10 3
      pages/public/code.vue
  2. 5 1
      pages/public/register.vue

+ 10 - 3
pages/public/code.vue

@@ -35,8 +35,8 @@
 		<view class="top_four">
 			<input type="number" class="input_show" maxlength="6" @input='submit' v-model="inputList" focus="true" />
 		</view>
-		<!-- 重新获取 -->
-		<view class="top_five" @click='regain' :class="!status ? 'active' : '' "><text v-if="!status">重新发送</text><text
+		<!-- 重新获取 regain-->
+		<view class="top_five" @click='judge' :class="!status ? 'active' : '' "><text v-if="!status">重新发送</text><text
 				v-if="status">{{count_down}}秒后重新发送</text></view>
 	</view>
 </template>
@@ -73,8 +73,15 @@
 			navBack() {
 				uni.navigateBack();
 			},
+			judge(){
+				if(this.count_down > 0){
+					return
+				}else{
+					this.regain()
+				}
+			},
 			regain() {
-				console.log("regain", this.phone);
+				this.count_down = 60
 				this.status = true
 				// console.log(e)150500
 				// 设定一个定时器 1000是1秒的意思

+ 5 - 1
pages/public/register.vue

@@ -22,7 +22,8 @@
 					<input placeholder-style="color:#AFB3BF" border="none" maxlength="6" v-model='verifyCode' style=''
 						placeholder="请输入验证码" type="number" class="Regular" />
 				</view>
-				<button :class='codestatus?"activeCode":""' @click='getcode'
+				<!--  -->
+				<button :class='codestatus?"activeCode":""' @click='getcode' 
 					class='getcode Regular'>{{sendText}}</button>
 			</view>
 			<view style='border-bottom:1px solid #E8E9ED;padding:10px 0;position:relative;'>
@@ -163,6 +164,9 @@
 			},
 			getcode() {
 				var that = this
+				if(this.sendText != "获取验证码" ){
+					return
+				}
 				if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)) {
 					that.$request.baseRequest('get', '/commonUser/sendVerifyCode', {
 							phone: this.phone