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

File diff suppressed because one or more lines are too long