Commit 97655819 authored by Smile's avatar Smile Committed by wux

客户端设置、创建订单部分样式多语言适配

parent d85fae76
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<view> <view>
<dHeader :title="$lang.lang.addressInfo.addInfo"></dHeader> <dHeader :title="$lang.lang.addressInfo.addInfo"></dHeader>
<view class="container"> <view class="container">
<uni-forms ref="form" :model="form" :label-width="80" :rules="rules"> <uni-forms ref="form" :model="form" :rules="rules">
<uni-forms-item <uni-forms-item class="custom-label-width"
:label="$lang.lang.addressInfo.consignee" :label="$lang.lang.addressInfo.consignee"
required required
name="name" name="name"
...@@ -121,8 +121,22 @@ export default { ...@@ -121,8 +121,22 @@ export default {
created() { created() {
this.getCountry(); this.getCountry();
}, },
mounted() {
this.updateLabels();
},
methods: { methods: {
updateLabels() {
this.$nextTick(() => {
const labels = this.$el.querySelectorAll('.uni-forms-item__label');
labels.forEach(label => {
// 移除 width 样式
label.style.removeProperty('width');
// 设置 min-width 样式
label.style.minWidth = '70px';
});
console.log(labels);
});
},
saveAddress() { saveAddress() {
this.$refs.form.validate().then(async (valid) => { this.$refs.form.validate().then(async (valid) => {
if (valid) { if (valid) {
...@@ -162,12 +176,8 @@ export default { ...@@ -162,12 +176,8 @@ export default {
}); });
if (i >= 0) this.areaIndex = i; if (i >= 0) this.areaIndex = i;
data.forEach((item) => { data.forEach((item) => {
const str = item.tel + " " + item.nameZh; const str = item.tel + " " + item[this.$lang.name];
if (this.$lang.locale == "zh") {
this.areaName.push(str);
} else {
this.areaName.push(str); this.areaName.push(str);
}
}); });
} }
} catch (error) {} } catch (error) {}
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
if(res.code == 0 && res.data.length > 0){ if(res.code == 0 && res.data.length > 0){
for(let i in res.data){ for(let i in res.data){
that.areaData.push(res.data[i].tel) that.areaData.push(res.data[i].tel)
that.areaName.push('+'+res.data[i].tel + ' ' + res.data[i][this.$lang.name]) that.areaName.push('+'+res.data[i].tel + ' ' + res.data[i][that.$lang.name])
} }
} }
}) })
...@@ -287,7 +287,7 @@ page{ ...@@ -287,7 +287,7 @@ page{
padding: 0 10upx; padding: 0 10upx;
margin-right: 20upx; margin-right: 20upx;
font-size: var(--f26); font-size: var(--f26);
width: 20%; min-width: 21%;
} }
.login-phone .login-area text{ .login-phone .login-area text{
margin-right: 10upx; margin-right: 10upx;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view @click="hiddeDatePicker" class="pickerCancel">{{ $lang.lang.myInfo.cancel }}</view> <view @click="hiddeDatePicker" class="pickerCancel">{{ $lang.lang.myInfo.cancel }}</view>
<!-- 输入框 --> <!-- 输入框 -->
<input <input
style="width: 70%" class="pickerInput"
:placeholder="$lang.lang.myInfo.placeholder" :placeholder="$lang.lang.myInfo.placeholder"
:show-action="false" :show-action="false"
v-model="searchValue" v-model="searchValue"
...@@ -175,7 +175,10 @@ export default { ...@@ -175,7 +175,10 @@ export default {
text-decoration: none; text-decoration: none;
padding: 0rpx 8rpx; padding: 0rpx 8rpx;
} }
.pickerInput{
width: 60%;
text-align: center;
}
.pickerConfirm { .pickerConfirm {
font-size: 30rpx; font-size: 30rpx;
color: #2979ff; color: #2979ff;
......
...@@ -418,6 +418,7 @@ export default { ...@@ -418,6 +418,7 @@ export default {
const data = this.languages[e.detail.value].value; const data = this.languages[e.detail.value].value;
this.locale = data this.locale = data
uni.setStorageSync('locale', data) uni.setStorageSync('locale', data)
uni.setLocale(data);
this.$lang.setLang(data) this.$lang.setLang(data)
this.getIdcard() this.getIdcard()
;(this.companyNotice = this.$lang.lang.site.unauth), ;(this.companyNotice = this.$lang.lang.site.unauth),
......
...@@ -249,15 +249,16 @@ page{ ...@@ -249,15 +249,16 @@ page{
.login-phone .login-area{ .login-phone .login-area{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: left;
font-size: var(--f30); font-size: var(--f30);
/* background-color: #27417C; */ /* background-color: #27417C; */
border-radius: 60upx; border-radius: 60upx;
height: 50upx; height: 50upx;
margin-top: 24upx; margin-top: 24upx;
padding: 0 10upx; //padding: 0 10upx;
margin-right: 20upx; margin-right: 20upx;
font-size: var(--f26); font-size: var(--f26);
min-width: 12%;
} }
.login-phone .login-area text{ .login-phone .login-area text{
margin-right: 10upx; margin-right: 10upx;
......
...@@ -403,7 +403,7 @@ textarea{ ...@@ -403,7 +403,7 @@ textarea{
width: 48upx; width: 48upx;
} }
.corder-checkbox label{ .corder-checkbox label{
width: 45%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 12px; font-size: 12px;
......
...@@ -440,7 +440,7 @@ page{ ...@@ -440,7 +440,7 @@ page{
position: absolute; position: absolute;
top:4upx; top:4upx;
right: 44upx; right: 44upx;
width: 18upx !important; width: 20upx !important;
height: 18upx !important; height: 18upx !important;
border-radius: 50%; border-radius: 50%;
background-color: #FF0000; background-color: #FF0000;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment