Commit 14cfbb61 authored by honghy's avatar honghy Committed by wux

国家下拉框多国语,协议多国语

parent 85f15bdb
......@@ -205,9 +205,11 @@ export default {
that.areaData.push(res.data[i].tel)
if (that.locale == 'zh') {
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameZh)
} else {
} else if (that.locale == 'en'){
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameEn)
}
} else {
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameFr)
}
}
}
})
......@@ -230,9 +232,11 @@ export default {
if (res.code == 0 && res.data) {
if (that.$lang.locale == 'zh') {
that.leviteInfo = res.data.contentZh
} else {
} else if($lang.locale == 'en'){
that.leviteInfo = res.data.contentEn
}
} else {
that.leviteInfo = res.data.contentFr
}
}
})
},
......
......@@ -219,9 +219,11 @@ export default {
that.areaData.push(res.data[i].tel)
if (that.locale == 'zh') {
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameZh)
} else {
}else if (that.locale == 'en'){
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameEn)
}
} else {
that.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameFr)
}
}
}
})
......
......@@ -23,7 +23,7 @@
>
<picker-view-column>
<view v-for="item in list" :key="item.id" class="u-column-item"
>{{ rangeKey == 'zh' ? item.titleZh : item.titleEn }}
>{{ rangeKey == 'zh' ? item.titleZh : rangeKey == 'en' ? item.titleEn :item.titleFr}}
</view>
</picker-view-column>
</picker-view>
......@@ -53,7 +53,7 @@ export default {
},
computed: {
rangeKey() {
return this.$lang.locale == 'zh' ? 'zh' : 'en'
return this.$lang.locale == 'zh' ? 'zh' : this.$lang.locale =='en'?'en':'fr'
}
},
data() {
......
......@@ -85,7 +85,7 @@
<picker
style="width: 100%"
:range="countryArray"
:range-key="rangeKey == 'zh' ? 'titleZh' : 'titleEn'"
:range-key="rangeKey == 'zh' ? 'titleZh' : rangeKey == 'en'?'titleEn':'titleFr'"
@change="bindCountyChange"
>
<view :class="{ placeholder: !params.country }">{{
......@@ -197,7 +197,7 @@ export default {
return this.getDate('end')
},
rangeKey() {
return this.$lang.locale == 'zh' ? 'zh' : 'en'
return this.$lang.locale == 'zh' ? 'zh' : this.$lang.locale =='en'?'en':'fr'
}
},
watch: {
......@@ -279,7 +279,7 @@ export default {
if (res.data.birthday) {
this.date = res.data.birthday
}
const { city, country, countryTitleZh, countryTitleEn, cityTitleZh, cityTitleEn } =
const { city, country, countryTitleZh, countryTitleEn, countryTitleFr, cityTitleZh, cityTitleEn, cityTitleFr } =
res.data
if (this.first) {
......@@ -288,8 +288,8 @@ export default {
}
this.params.city = city
this.params.country = country
this.params.cityValue = this.rangeKey == 'zh' ? cityTitleZh : cityTitleEn
this.params.countryValue = this.rangeKey == 'zh' ? countryTitleZh : countryTitleEn
this.params.cityValue = this.rangeKey == 'zh' ? cityTitleZh : this.rangeKey == 'en' ? cityTitleEn :cityTitleFr
this.params.countryValue = this.rangeKey == 'zh' ? countryTitleZh : this.rangeKey == 'en' ? countryTitleEn : countryTitleFr
this.getCountryList()
this.getCityList()
this.Country()
......@@ -310,9 +310,11 @@ export default {
}
if (that.$lang.locale == 'zh') {
that.areaName.push(res.data[i].tel + ' ' + res.data[i].nameZh)
} else {
} else if (that.$lang.locale == 'en') {
that.areaName.push(res.data[i].tel + ' ' + res.data[i].nameEn)
}
} else {
that.areaName.push(res.data[i].tel + ' ' + res.data[i].nameFr)
}
}
}
})
......@@ -356,8 +358,8 @@ export default {
// 国家选择 change
bindCountyChange(e) {
const index = e.detail.value
const { titleZh, titleEn, id } = this.countryArray[index]
const value = this.rangeKey == 'zh' ? titleZh : titleEn
const { titleZh, titleEn, titleFr, id } = this.countryArray[index]
const value = this.rangeKey == 'zh' ? titleZh : this.rangeKey == 'zh' ? titleEn :titleFr
if (this.params.country != id) {
this.$set(this.params, 'cityValue', '')
this.$set(this.params, 'city', '')
......
......@@ -178,11 +178,15 @@ export default {
this.areaName.push(
"+" + res.data[i].tel + " " + res.data[i].nameZh
);
} else {
} else if(this.$lang.locale == "en"){
this.areaName.push(
"+" + res.data[i].tel + " " + res.data[i].nameEn
);
}
} else {
this.areaName.push(
"+" + res.data[i].tel + " " + res.data[i].nameFr
);
}
}
}
});
......
......@@ -173,9 +173,11 @@ export default {
this.areaData.push(res.data[i].tel)
if (this.$lang.locale == 'zh') {
this.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameZh)
} else {
} else if (this.$lang.locale == 'en'){
this.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameEn)
}
} else {
this.areaName.push('+' + res.data[i].tel + ' ' + res.data[i].nameFr)
}
}
}
})
......
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