|
@@ -16,14 +16,15 @@
|
|
|
<view style="margin-top: 30rpx;">
|
|
|
<u-field v-model="code" :placeholder="$t('login.code')" label-width="50" maxlength="6">
|
|
|
<u-icon slot="icon" name="lock" size="36" color="#666666"></u-icon>
|
|
|
- <u-button v-if="send!='zh'" size="mini" slot="right" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
|
|
|
+ <u-button v-if="send=='zh'" size="mini" slot="right" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
|
|
|
<u-button v-else size="mini" slot="right" type="primary" @click="getCode" shape="circle" :loading="codeLoading">{{codeText}}</u-button>
|
|
|
</u-field>
|
|
|
</view>
|
|
|
- <view class="" v-if="send!='zh'">
|
|
|
- <u-verification-code ref="uCode" @change="codeChange"></u-verification-code>
|
|
|
+ <view class="" v-if="send=='zh'">
|
|
|
+ <u-verification-code ref="uCode" @change="codeChange"></u-verification-code>
|
|
|
</view>
|
|
|
- <u-verification-code v-else ref="uCode" @change="codeChange" start-text="Send" change-text="Reacquire in X S" end-text="Reacquire"></u-verification-code>
|
|
|
+ <u-verification-code v-else ref="uCode" @change="codeChange" start-text="Send" change-text="Reacquire in X S"
|
|
|
+ end-text="Reacquire"></u-verification-code>
|
|
|
<view style="margin-top: 80rpx;">
|
|
|
<u-button type="primary" :ripple="true" ripple-bg-color="#99d4ff" shape="circle" @tap="$u.debounce(submit, 2000,immediate = true)"
|
|
|
:loading="loading">{{$t("login.login")}}</u-button>
|
|
@@ -43,8 +44,8 @@
|
|
|
</view>
|
|
|
<view class="foot">
|
|
|
<view class="u-flex u-row-center u-col-center">
|
|
|
- <!-- <u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30" @click="switchLang">{{$t("login.Lan")}}</u-divider> -->
|
|
|
- <u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30">赛轮集团</u-divider>
|
|
|
+ <u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30" @click="switchLang">{{$t("login.Lan")}}</u-divider>
|
|
|
+ <!-- <u-divider color="#0095FF" border-color="#0095FF" bg-color="#F4F4F4" fontSize="30">赛轮集团</u-divider> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -65,14 +66,14 @@
|
|
|
return {
|
|
|
tel: '',
|
|
|
code: '',
|
|
|
- codeText:"",
|
|
|
+ codeText: "",
|
|
|
pact: false,
|
|
|
loading: false,
|
|
|
codeLoading: false,
|
|
|
SystemInfo: '',
|
|
|
networkType: '',
|
|
|
version: '',
|
|
|
- send:'',
|
|
|
+ send: '',
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -109,12 +110,17 @@
|
|
|
uni.$on('loginphone', data => {
|
|
|
this.tel = data
|
|
|
})
|
|
|
+ this.send = this.$i18n.locale
|
|
|
+ console.log(this.send)
|
|
|
},
|
|
|
methods: {
|
|
|
switchLang() {
|
|
|
this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en';
|
|
|
- this.send= this.$i18n.locale == 'en' ? 'zh' : 'en';
|
|
|
-
|
|
|
+ this.send = this.$i18n.locale
|
|
|
+ uni.setStorage({
|
|
|
+ key: "lang",
|
|
|
+ data: this.$i18n.locale
|
|
|
+ })
|
|
|
},
|
|
|
...mapMutations(['login']),
|
|
|
judgeIosPermission() {
|
|
@@ -122,8 +128,8 @@
|
|
|
if (!result) {
|
|
|
uni.showModal({
|
|
|
title: this.$t('login.locationtitle'),
|
|
|
- content:this.$t('login.locationcontent'),
|
|
|
- cancelText:this.$t('login.locationcancelText'),
|
|
|
+ content: this.$t('login.locationcontent'),
|
|
|
+ cancelText: this.$t('login.locationcancelText'),
|
|
|
confirmText: this.$t('login.locationconfirmText'),
|
|
|
success: res => {
|
|
|
if (res.confirm) {
|
|
@@ -168,7 +174,7 @@
|
|
|
}
|
|
|
}).then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
-
|
|
|
+
|
|
|
this.toUser(res.data.data)
|
|
|
uni.$emit('login', {
|
|
|
msg: this.$t('login.suclogin')
|
|
@@ -178,7 +184,7 @@
|
|
|
this.$u.toast(res.data.msg);
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
-
|
|
|
+
|
|
|
this.$u.toast(this.$t('login.errlogin'));
|
|
|
}).finally(() => {
|
|
|
this.loading = false
|
|
@@ -212,7 +218,7 @@
|
|
|
this.$u.toast(res.data.msg);
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
-
|
|
|
+
|
|
|
}).finally(() => {
|
|
|
this.codeLoading = false
|
|
|
})
|
|
@@ -244,7 +250,7 @@
|
|
|
position: fixed;
|
|
|
bottom: 10rpx;
|
|
|
width: 100%;
|
|
|
- padding-bottom: 0;
|
|
|
+ padding-bottom: 0;
|
|
|
padding-bottom: constant(safe-area-inset-bottom);
|
|
|
padding-bottom: env(safe-area-inset-bottom);
|
|
|
}
|