|
@@ -14,13 +14,14 @@
|
|
<van-field v-model="clientId" name="设备唯一码" label="设备唯一码" placeholder="设备唯一码" left-icon="setting-o"
|
|
<van-field v-model="clientId" name="设备唯一码" label="设备唯一码" placeholder="设备唯一码" left-icon="setting-o"
|
|
:rules="[{ required: true, message: '设备唯一码不能为空' }]" />
|
|
:rules="[{ required: true, message: '设备唯一码不能为空' }]" />
|
|
|
|
|
|
- <van-field v-model="country" is-link readonly name="发往国家" label="发往国家" placeholder="发往国家" left-icon="guide-o"
|
|
|
|
- :rules="[{ required: true, message: '请填写发往国家' }]" @click="showPicker = true" />
|
|
|
|
|
|
+ <van-field v-model="country" is-link readonly name="发往国家" label="发往国家" placeholder="发往国家"
|
|
|
|
+ left-icon="guide-o" :rules="[{ required: true, message: '请填写发往国家' }]" @click="showPicker = true" />
|
|
<van-popup v-model:show="showPicker" round position="bottom">
|
|
<van-popup v-model:show="showPicker" round position="bottom">
|
|
<van-picker :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" />
|
|
<van-picker :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" />
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
|
|
- <van-field v-model="location" name="地区名称" label="地区名称" placeholder="城市/地区名称" left-icon="location-o"/>
|
|
|
|
|
|
+ <van-field v-model="location" name="地区名称" label="地区名称" placeholder="省市/地区名称" left-icon="location-o"
|
|
|
|
+ :required="isRequired" :rules="[{ required: isRequired, message: '国内必须精确到省市' }]" />
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
<div style="margin: 16px; display: flex; justify-content: center; align-items: center;">
|
|
<div style="margin: 16px; display: flex; justify-content: center; align-items: center;">
|
|
<van-button round class="custom-button" type="primary" size="small" native-type="submit" block>
|
|
<van-button round class="custom-button" type="primary" size="small" native-type="submit" block>
|
|
@@ -37,6 +38,7 @@ import sHeader from "@/components/SimpleHeader";
|
|
import { updateLocInfo } from "../../service/fife/modifyLoc";
|
|
import { updateLocInfo } from "../../service/fife/modifyLoc";
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
import { Toast } from "vant";
|
|
import { Toast } from "vant";
|
|
|
|
+import { computed } from "vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: { sHeader },
|
|
components: { sHeader },
|
|
@@ -50,6 +52,7 @@ export default {
|
|
const clientId = ref('');
|
|
const clientId = ref('');
|
|
const showPicker = ref(false);
|
|
const showPicker = ref(false);
|
|
const columns = [
|
|
const columns = [
|
|
|
|
+ { text: '中国', value: '中国' },
|
|
{ text: '英国', value: '英国' },
|
|
{ text: '英国', value: '英国' },
|
|
{ text: '美国', value: '美国' },
|
|
{ text: '美国', value: '美国' },
|
|
{ text: '加拿大', value: '加拿大' },
|
|
{ text: '加拿大', value: '加拿大' },
|
|
@@ -124,6 +127,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const isRequired = computed(() => {
|
|
|
|
+ return country.value === '中国';
|
|
|
|
+ });
|
|
|
|
+
|
|
return {
|
|
return {
|
|
onSubmit,
|
|
onSubmit,
|
|
clientId,
|
|
clientId,
|
|
@@ -136,6 +143,7 @@ export default {
|
|
// modUsername,
|
|
// modUsername,
|
|
modPhone,
|
|
modPhone,
|
|
location,
|
|
location,
|
|
|
|
+ isRequired
|
|
};
|
|
};
|
|
}
|
|
}
|
|
}
|
|
}
|