✨ MK公开页、预结算体验优化、地图选址与认证密码规则完善
This commit is contained in:
@@ -194,10 +194,11 @@
|
||||
<el-input
|
||||
v-model="form.detailAddress"
|
||||
class="detail-address-input"
|
||||
clearable
|
||||
readonly
|
||||
maxlength="255"
|
||||
show-word-limit
|
||||
placeholder="请输入"
|
||||
placeholder="点击选择地图地址"
|
||||
@click="openAddressMapPicker"
|
||||
/>
|
||||
</template>
|
||||
<template #remark-form>
|
||||
@@ -244,6 +245,13 @@
|
||||
</template>
|
||||
</avue-form>
|
||||
</el-dialog>
|
||||
<address-map-picker
|
||||
v-model="addressMapPickerVisible"
|
||||
:address="form.detailAddress"
|
||||
:longitude="form.longitude"
|
||||
:latitude="form.latitude"
|
||||
@confirm="handleAddressMapConfirm"
|
||||
/>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -264,12 +272,16 @@ import { openImportDialog } from '@/utils/import-excel';
|
||||
import { formatUpdateUserName } from '@/utils/audit';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getCoordinateValidationMessage, normalizeCoordinateInput } from '@/utils/coordinate';
|
||||
import AddressMapPicker from '@/components/address-map-picker/main.vue';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
const DEFAULT_COUNTRY_CODE = '+86';
|
||||
const newLocal = '请选择类型';
|
||||
export default {
|
||||
components: {
|
||||
AddressMapPicker,
|
||||
},
|
||||
data() {
|
||||
const validateCode = (rule, value, callback) => {
|
||||
const code = String(value || '').toUpperCase();
|
||||
@@ -315,6 +327,7 @@ export default {
|
||||
loading: true,
|
||||
data: [],
|
||||
excelBox: false,
|
||||
addressMapPickerVisible: false,
|
||||
excelForm: {},
|
||||
portOptions: [],
|
||||
countryOptions: [],
|
||||
@@ -572,11 +585,11 @@ export default {
|
||||
minWidth: 220,
|
||||
overHidden: false,
|
||||
order: 85,
|
||||
placeholder: '请输入',
|
||||
placeholder: '点击选择地图地址',
|
||||
maxlength: 255,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
||||
{ required: true, message: '请选择详细地址', trigger: 'change' },
|
||||
{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
@@ -1040,6 +1053,21 @@ export default {
|
||||
handleCoordinateInput(prop, value) {
|
||||
this.form[prop] = normalizeCoordinateInput(value);
|
||||
},
|
||||
openAddressMapPicker() {
|
||||
this.addressMapPickerVisible = true;
|
||||
},
|
||||
handleAddressMapConfirm(payload) {
|
||||
const selection = typeof payload === 'string' ? { address: payload } : payload || {};
|
||||
if (selection.address) {
|
||||
this.form.detailAddress = selection.address;
|
||||
}
|
||||
if (selection.longitude !== undefined && selection.longitude !== null && selection.longitude !== '') {
|
||||
this.form.longitude = Number(selection.longitude).toFixed(6);
|
||||
}
|
||||
if (selection.latitude !== undefined && selection.latitude !== null && selection.latitude !== '') {
|
||||
this.form.latitude = Number(selection.latitude).toFixed(6);
|
||||
}
|
||||
},
|
||||
resolveCountryCode(country) {
|
||||
if (!country) {
|
||||
return Promise.resolve('');
|
||||
@@ -1107,7 +1135,7 @@ export default {
|
||||
return false;
|
||||
}
|
||||
if (isBlank(row.detailAddress)) {
|
||||
this.$message.warning('请输入详细地址');
|
||||
this.$message.warning('请选择详细地址');
|
||||
return false;
|
||||
}
|
||||
if (isBlank(row.longitude)) {
|
||||
@@ -1399,6 +1427,15 @@ export default {
|
||||
line-height: 20px;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
.detail-address-input {
|
||||
cursor: pointer;
|
||||
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-input__inner) {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user