This commit is contained in:
2022-10-12 10:08:17 +08:00
parent c8159718c4
commit 510a6e15a9
2 changed files with 13 additions and 21 deletions

View File

@@ -6,26 +6,18 @@
<view>共力生态</view>
<view>即可开始共力人生</view>
</view>
<view class="auth-input">
<input v-model="phone" type="number" maxlength="11" placeholder="输入手机号码">
</view>
<view class="auth-input"> <input v-model="phone" type="number" maxlength="11" placeholder="输入手机号码"> </view>
<view class="auth-input auth-code">
<input v-model="code" type="number" maxlength="4" placeholder="输入验证码">
<button :disabled="getSms" size="mini" @click="getCaptcha">{{sendCode}}</button>
</view>
<view class="auth-input" v-if="isShowParent">
<input v-model="parentId" placeholder="输入邀请码">
</view>
<view class="auth-button">
<button @click="login('code')">登录</button>
</view>
<view class="auth-input" v-if="isShowParent"> <input v-model="parentId" placeholder="输入邀请码"> </view>
<view class="auth-button"> <button @click="login('code')">登录</button> </view>
<view class="auth-agreement">
登录即表示同意<navigator hover-class="none" url="/pages/vip/agreement?id=3">用户协议</navigator><navigator
hover-class="none" url="/pages/vip/agreement?id=4">隐私政策</navigator>
</view>
<view class="auth-other" v-if="isKeyAuth">
<button @click="login('Akey')">使用本机号码一键登录</button>
</view>
<view class="auth-other" v-if="isKeyAuth"> <button @click="login('Akey')">使用本机号码一键登录</button> </view>
</view>
<u-popup :show="showCaptchaCode" :round='10' mode='center' @close='close' @open="open">
<view class="showImgCode">
@@ -105,8 +97,8 @@
icon: 'none',
mask: true,
duration: 2000
})
})
},
// 获取图片验证码
@@ -128,7 +120,6 @@
this.captchaKey = res.key;
this.captchaImg = res.img;
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon: 'none',
@@ -138,7 +129,6 @@
})
},
// 获取验证码
getPhoneCode() {
if (this.phone.length != 11) {
uni.showToast({
@@ -182,7 +172,6 @@
this.captchaKey = ''
this.captchaCode = ''
}).catch((err) => {
console.log(err)
this.captchaCode = ''
this.captchaKey = ''
uni.showToast({
@@ -202,12 +191,10 @@
code: this.code,
parent_id: this.parentId
}
console.log(data);
smsAuth(data).then((res) => {
this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new)
uni.hideLoading()
}).catch((err) => {
console.log(err)
uni.showToast({
title: err.message,
icon: "none",
@@ -264,7 +251,12 @@
}
},
fail: err => {
console.log(err)
uni.showToast({
title:err.message,
icon:'none',
mask:true,
duration:2000
})
}
})
},