|
@@ -30,7 +30,7 @@
|
|
|
</Select>
|
|
|
<!-- 如果国际站选择的地区是台湾则要显示台湾的城市和区选择 -->
|
|
|
<template v-if="isShowTw">
|
|
|
- <Select v-model="curTwCityIndex" filterable :placeholder="$t('settings.applyForm.place6')" @on-change="onTwCitySelect" style="margin: 10px 0;">
|
|
|
+ <Select v-model="curTwCityIndex" filterable :placeholder="$t('settings.applyForm.place6')" @on-change="onTwCitySelect" style="margin: 0 10px;">
|
|
|
<Option v-for="(city,index) in twCityArr" :value="index" :key="index" >{{ city.city }}</Option>
|
|
|
</Select>
|
|
|
<Select v-model="curTwAreaIndex" filterable :placeholder="$t('settings.applyForm.place6')">
|
|
@@ -71,7 +71,9 @@
|
|
|
|
|
|
<script>
|
|
|
import countries from '@/static/countries.js'
|
|
|
+ import enCountries from '@/static/countryCodeData.js'
|
|
|
import twCitys from '@/static/twJson.js'
|
|
|
+ import twTCitys from '@/static/twJsonT.js'
|
|
|
export default {
|
|
|
data(vm) {
|
|
|
return {
|
|
@@ -136,16 +138,37 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.countryArr = countries
|
|
|
- this.twCityArr = twCitys
|
|
|
+ let curLocal = localStorage.getItem('local')
|
|
|
+ let attr = 'CountryEn'
|
|
|
+ if (curLocal.includes('cn') || curLocal.includes('CN')) {
|
|
|
+ this.countryArr = countries
|
|
|
+ this.twCityArr = twCitys
|
|
|
+ } else if (curLocal.includes('tw') || curLocal.includes('TW')) {
|
|
|
+ this.twCityArr = twTCitys
|
|
|
+ for (const key in enCountries) {
|
|
|
+ this.countryArr.push(
|
|
|
+ {
|
|
|
+ cn: enCountries[key].CountryTw,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.twCityArr = twTCitys
|
|
|
+ for (const key in enCountries) {
|
|
|
+ this.countryArr.push(
|
|
|
+ {
|
|
|
+ cn: enCountries[key].CountryEn,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
// 提交建立学校申请
|
|
|
onSubmit() {
|
|
|
this.$refs.applyForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- console.log(this.curCountry)
|
|
|
- console.log(this.isChinaSite)
|
|
|
let hasFullAddress = false
|
|
|
let fullAddress = ''
|
|
|
if(this.isChinaSite){
|
|
@@ -153,11 +176,9 @@
|
|
|
hasFullAddress = pickResult.province && pickResult.city && pickResult.area
|
|
|
fullAddress = hasFullAddress ? (pickResult.province + pickResult.city + pickResult.area + this.applyForm.address) : ''
|
|
|
}else{
|
|
|
- console.log(this.curCountry)
|
|
|
hasFullAddress = this.curCountry
|
|
|
- fullAddress = this.isShowTw ? (this.curCountry + this.curTwCity.city + this.curTwCity.area[this.curTwAreaIndex] + this.applyForm.address) : (this.curCountry + this.applyForm.address)
|
|
|
+ fullAddress = this.isShowTw ? (this.curCountry + this.curTwCity.city + this.curTwCity.areas[this.curTwAreaIndex].area + this.applyForm.address) : (this.curCountry + this.applyForm.address)
|
|
|
}
|
|
|
- console.log(fullAddress)
|
|
|
if(hasFullAddress){
|
|
|
this.isBtnLoading = true
|
|
|
let formInfo = this.applyForm
|
|
@@ -206,7 +227,7 @@
|
|
|
},
|
|
|
/* 国家选择 */
|
|
|
onCountrySelect(val){
|
|
|
- if(val === '台湾' || val === '台灣'){
|
|
|
+ if(val === '台湾' || val === '臺灣'){
|
|
|
this.isShowTw = true
|
|
|
this.curTwCity = this.twCityArr[0]
|
|
|
}else{
|
|
@@ -232,7 +253,7 @@
|
|
|
padding: 50px 20px 0 20px;
|
|
|
|
|
|
.country-select{
|
|
|
- width: 200px;
|
|
|
+ display: flex;
|
|
|
margin: 10px 0;
|
|
|
}
|
|
|
|