需求修改
This commit is contained in:
@@ -1,23 +1,16 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<nav-bar :title="$t('login.settings')" :inner2="true" @goIn="goIn" :show1="false"></nav-bar>
|
||||
<nav-bar title="设置" :inner2="true" @goIn="goIn" :show1="false"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="input-wrap">
|
||||
<view class="input-label">{{$t('setting.language')}}</view>
|
||||
<view class="select_wrap">
|
||||
<uni-data-select v-model="index1" :localdata="options1" :clear="false"
|
||||
@change="selectChange1"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<view class="input-label">{{$t('setting.server')}}</view>
|
||||
<view class="input-label">服务器地址</view>
|
||||
<input type="text" class="setup-input" v-model="addrip">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-22 button-primary" @click="_submit">{{$t('button.confirm')}}</button>
|
||||
<button class="zd-col-22 button-primary" @click="_submit">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -30,48 +23,15 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addrip: this.$store.getters.baseUrl,
|
||||
options1: [{text: '中文',value: 'zh-Hans'}, {text: 'English', value: 'en'}, {text: '한국어', value: 'ko'}],
|
||||
index1: '',
|
||||
systemLocale: '',
|
||||
applicationLocale: ''
|
||||
addrip: this.$store.getters.baseUrl
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
let systemInfo = uni.getSystemInfoSync();
|
||||
this.systemLocale = systemInfo.language;
|
||||
this.applicationLocale = uni.getLocale();
|
||||
this.index1 = this.applicationLocale.split('-')[0]
|
||||
this.isAndroid = systemInfo.platform.toLowerCase() === 'android';
|
||||
uni.onLocaleChange((e) => {
|
||||
this.applicationLocale = e.locale;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
onLocaleChange(e) {
|
||||
if (this.isAndroid) {
|
||||
uni.showModal({
|
||||
content: this.$t('setting.language-change-confirm'),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.setLocale(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.setLocale(e);
|
||||
this.$i18n.locale = e;
|
||||
}
|
||||
},
|
||||
goIn () {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
},
|
||||
selectChange1(e) {
|
||||
this.onLocaleChange(e)
|
||||
this.index1 = e
|
||||
},
|
||||
_submit () {
|
||||
if (this.addrip === '') {
|
||||
uni.showToast({
|
||||
@@ -97,13 +57,13 @@
|
||||
margin 20rpx 0
|
||||
_fj()
|
||||
.input-label
|
||||
_wh(210rpx, 80rpx)
|
||||
_wh(190rpx, 80rpx)
|
||||
_font(28rpx,80rpx,#464646)
|
||||
text-align:justify;
|
||||
text-align-last: justify;
|
||||
text-justify: inter-ideograph;/*兼容ie*/
|
||||
.setup-input
|
||||
_wh(calc(100% - 220rpx), 80rpx)
|
||||
_wh(calc(100% - 240rpx), 80rpx)
|
||||
background #fff
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 10rpx;
|
||||
|
||||
Reference in New Issue
Block a user