|
|
@@ -3,28 +3,28 @@
|
|
|
<view class="login-top">
|
|
|
<image class="login-bg" src="/static/login/login_top_backgroud.png"></image>
|
|
|
<view class="login-top-content">
|
|
|
- <image class="login-icon" src="/static/i2_icon.png"></image>
|
|
|
- <text class="login-title"> {{ loginStr }} </text>
|
|
|
+ <image class="login-icon" src="/static/logo.png"></image>
|
|
|
+ <text class="login-title"> {{ $t('login') }} </text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 登录框 -->
|
|
|
<view class="login-card cu-card padding radius shadow bg-white">
|
|
|
<view class="flex padding-tb justify-between">
|
|
|
- <view class="u-border-bottom text-xl text-red"> {{ $t('login') }} </view>
|
|
|
+ <view class="u-border-bottom text-xl text-red"> {{ $t('userLogin') }} </view>
|
|
|
<view class="text-xl" @click="changeToEnglish"> {{ $t('switchLanguage') }} </view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 输入框 -->
|
|
|
<u-gap height="20"/>
|
|
|
- <u--input v-model="user.account" placeholder="用户名" clearable prefixIcon="account" border="bottom" prefixIconStyle="font-size: 22px;color: #909399" @clear="clearInput"/>
|
|
|
+ <u--input v-model="user.account" :placeholder="$t('userName')" clearable prefixIcon="account" border="bottom" prefixIconStyle="font-size: 22px;color: #909399" @clear="clearInput(true)"/>
|
|
|
<u-gap height="10"/>
|
|
|
- <u--input v-model="user.password" placeholder="密码" clearable password prefixIcon="lock" border="bottom" prefixIconStyle="font-size: 22px;color: #909399" @clear="clearInput"/>
|
|
|
+ <u--input v-model="user.password" :placeholder="$t('password')" clearable password prefixIcon="lock" border="bottom" prefixIconStyle="font-size: 22px;color: #909399" @clear="clearInput(false)"/>
|
|
|
|
|
|
<!-- 登录按钮 -->
|
|
|
<u-gap height="40"/>
|
|
|
<button class="cu-btn block bg-red margin-tb-sm lg radio" @click="startLogin">
|
|
|
- <text v-show="loading" class="cuIcon-loading2 cuIconfont-spin"></text>
|
|
|
+ <text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>
|
|
|
<text> {{ $t('logIn') }} </text>
|
|
|
</button>
|
|
|
|
|
|
@@ -41,7 +41,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <text class="version-text self-center">版本号:1.1.1</text>
|
|
|
+ <text class="version-text self-center"> {{ $t('appVersion', {version: '1.0.0'}) }} </text>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -52,8 +52,8 @@
|
|
|
loading: false,
|
|
|
loginStr: '登录',
|
|
|
user: {
|
|
|
- account: '2333333',
|
|
|
- password: '123456',
|
|
|
+ account: '',
|
|
|
+ password: '',
|
|
|
},
|
|
|
animation: '',
|
|
|
aggred: false,
|
|
|
@@ -61,6 +61,22 @@
|
|
|
},
|
|
|
methods: {
|
|
|
startLogin() {
|
|
|
+
|
|
|
+ if (this.user.account == '') return uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title: this.$i18n.t('pleaseInput') + this.$i18n.t('userName')
|
|
|
+ })
|
|
|
+
|
|
|
+ if (this.user.password == '') return uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title: this.$i18n.t('pleaseInput') + this.$i18n.t('password')
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!this.aggred) return uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title: this.$i18n.t('pleaseReadAndAggreeThePrivacyPolicy')
|
|
|
+ })
|
|
|
+
|
|
|
this.loading = true
|
|
|
setTimeout(() => {
|
|
|
this.loading = false
|
|
|
@@ -70,16 +86,16 @@
|
|
|
}, 2.0*1000);
|
|
|
},
|
|
|
changeToEnglish() {
|
|
|
- console.log('changeToEnglish')
|
|
|
+ let locale = this.$i18n.locale
|
|
|
+ locale === 'zh' ? this.$i18n.locale = 'en' : this.$i18n.locale = 'zh'
|
|
|
},
|
|
|
/// 清除输入框
|
|
|
- clearInput() {
|
|
|
- console.log('fuck')
|
|
|
- // if (isUserAccount) {
|
|
|
+ clearInput(isUserAccount) {
|
|
|
+ if (isUserAccount) {
|
|
|
this.user.account = ''
|
|
|
- // } else {
|
|
|
+ } else {
|
|
|
this.user.password = ''
|
|
|
- // }
|
|
|
+ }
|
|
|
},
|
|
|
aggreeBtnClick() {
|
|
|
this.aggred = !this.aggred
|