|
|
@@ -1,9 +1,9 @@
|
|
|
<!-- 账户管理-收货地址管理-编辑 -->
|
|
|
<template>
|
|
|
- <app-drawer :title="selectedRow?.autoid ? '修改地址' : '新增地址'" :width="800" v-model:show="show" :loading="loading"
|
|
|
+ <app-drawer :title="selectedRow?.autoid ? t('mine.address.modifyaddressinfo') : t('mine.address.addaddressinfo')" :width="800" v-model:show="show" :loading="loading"
|
|
|
:refresh="refresh">
|
|
|
<el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
|
|
|
- <el-form-item label="收货人" prop="ReceiverName">
|
|
|
+ <el-form-item :label="t('mine.address.receiverName')" prop="ReceiverName">
|
|
|
<el-input :placeholder="t('common.pleaseenter')" v-model="formData.ReceiverName" />
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="证件类型" prop="CardTypeID">
|
|
|
@@ -12,18 +12,18 @@
|
|
|
:key="index" />
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="联系电话" prop="PhoneNum">
|
|
|
+ <el-form-item :label="t('mine.address.phoneNum')" prop="PhoneNum">
|
|
|
<el-input :placeholder="t('common.pleaseenter')" v-model="formData.PhoneNum" />
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="证件号码" prop="CardNum">
|
|
|
<el-input :placeholder="t('common.pleaseenter')" v-model="formData.CardNum" />
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item class="el-form-item--row" label="收货地址" prop="area">
|
|
|
+ <el-form-item class="el-form-item--row" :label="t('mine.address.address')" prop="area">
|
|
|
<app-region class="el-form-item--col" v-model:province="formData.ProvinceID"
|
|
|
v-model:city="formData.CityID" v-model:district="formData.DistrictID" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item class="el-form-item--row" label="详细地址" prop="Address">
|
|
|
- <el-input placeholder="请输入详细地址" v-model="formData.Address" />
|
|
|
+ <el-form-item class="el-form-item--row" :label="t('mine.address.detail')" prop="Address">
|
|
|
+ <el-input :placeholder="t('mine.address.tips4')" v-model="formData.Address" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
@@ -57,11 +57,11 @@ const refresh = ref(false)
|
|
|
const formRef = ref<FormInstance>()
|
|
|
|
|
|
const formRules: FormRules = {
|
|
|
- ReceiverName: [{ required: true, message: '请输入收货人', trigger: 'blur' }],
|
|
|
- CardTypeID: [{ required: true, message: '请选择证件类型' }],
|
|
|
- PhoneNum: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
|
|
|
- CardNum: [{ required: true, message: '请输入证件号码', trigger: 'blur' }],
|
|
|
- Address: [{ required: true, message: '请输入详细地址', trigger: 'blur' }],
|
|
|
+ ReceiverName: [{ required: true, message: t('mine.address.tips1'), trigger: 'blur' }],
|
|
|
+ // CardTypeID: [{ required: true, message: '请选择证件类型' }],
|
|
|
+ PhoneNum: [{ required: true, message: t('mine.address.tips2'), trigger: 'blur' }],
|
|
|
+ // CardNum: [{ required: true, message: '请输入证件号码', trigger: 'blur' }],
|
|
|
+ Address: [{ required: true, message: t('mine.address.tips4'), trigger: 'blur' }],
|
|
|
area: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -70,7 +70,7 @@ const formRules: FormRules = {
|
|
|
if ((formData.ProvinceID && formData.CityID && formData.DistrictID) || ids.includes(formData.ProvinceID ?? 0)) {
|
|
|
callback()
|
|
|
} else {
|
|
|
- callback(new Error('请选择收货地区'))
|
|
|
+ callback(new Error(t('mine.address.tips3')))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -86,10 +86,10 @@ const onSubmit = () => {
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
addOrUpdate().then(() => {
|
|
|
- ElMessage.success('提交成功')
|
|
|
+ ElMessage.success(t('common.submitsuccess'))
|
|
|
onCancel(true)
|
|
|
}).catch((err) => {
|
|
|
- ElMessage.error('提交失败:' + err)
|
|
|
+ ElMessage.error(t('common.submitfailure') + err)
|
|
|
})
|
|
|
}
|
|
|
})
|