|
@@ -39,7 +39,8 @@
|
|
|
<view class="name">验证码:</view>
|
|
|
<view class="item">
|
|
|
<input type="text" class="input" v-model="code" placeholder="请输入验证码" maxlength="6" />
|
|
|
- <view class="btn">获取验证码</view>
|
|
|
+ <view class="btn" v-if="captchaTime === 0" @click="getCode">获取验证码</view>
|
|
|
+ <view class="btn" v-if="captchaTime > 0">{{captchaTime}}秒后重试</view>
|
|
|
</view>
|
|
|
<view class="other_list">
|
|
|
<text class="left"></text>
|
|
@@ -82,7 +83,7 @@
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- title: '',
|
|
|
+ skey: '',
|
|
|
sel: 1,
|
|
|
is_agree: 0,
|
|
|
type: 'pass',
|
|
@@ -100,6 +101,7 @@
|
|
|
mobile: '',
|
|
|
password: '',
|
|
|
code: '',
|
|
|
+ captchaTime: 0,
|
|
|
push_token: '',
|
|
|
lat: '',
|
|
|
lng: '',
|
|
@@ -241,7 +243,7 @@
|
|
|
});
|
|
|
console.log("host", this.$apiHost + method);
|
|
|
uni.request({
|
|
|
- url: this.$apiHost + method, //仅为示例,并非真实接口地址。
|
|
|
+ url: this.$apiHost + method,
|
|
|
data: {
|
|
|
uuid: getApp().globalData.uuid,
|
|
|
loginType: this.type,
|
|
@@ -293,6 +295,47 @@
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ getCode() {
|
|
|
+ if (this.mobile.length != 11) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '请输入手机号',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.captchaTime > 0) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '不能重复获取',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.captchaTime = 60;
|
|
|
+
|
|
|
+ uni.request({
|
|
|
+ url: this.$apiHost + '/Web/getcode', //仅为示例,并非真实接口地址。
|
|
|
+ data: {
|
|
|
+ skey: this.skey,
|
|
|
+ mobile: this.mobile,
|
|
|
+ },
|
|
|
+ header: {
|
|
|
+ 'content-type': 'application/json' //自定义请求头信息
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log("----", res.data)
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.str,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ if (res.data.success == 'yes') {
|
|
|
+ this.getCodeTime();
|
|
|
+ } else {
|
|
|
+ this.captchaTime = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|