vue_zhongyou 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -629,9 +629,9 @@ const openAddressPicker = (field) => {
|
|
|
629
629
|
const fieldValue = formData[field.field]
|
|
630
630
|
let code = ''
|
|
631
631
|
|
|
632
|
-
// 如果fieldValue是一个对象且包含
|
|
633
|
-
if (fieldValue && typeof fieldValue === 'object' && fieldValue.
|
|
634
|
-
code = fieldValue.
|
|
632
|
+
// 如果fieldValue是一个对象且包含destinationCode属性
|
|
633
|
+
if (fieldValue && typeof fieldValue === 'object' && fieldValue.destinationCode) {
|
|
634
|
+
code = fieldValue.destinationCode
|
|
635
635
|
}
|
|
636
636
|
// 如果fieldValue是一个字符串(直接是code值)
|
|
637
637
|
else if (fieldValue && typeof fieldValue === 'string') {
|
|
@@ -649,9 +649,9 @@ const openAddressPicker = (field) => {
|
|
|
649
649
|
const getCodeToAreaValue = (code) => {
|
|
650
650
|
if (!code) return ''
|
|
651
651
|
|
|
652
|
-
// 如果code是一个对象且包含
|
|
653
|
-
if (typeof code === 'object' && code.
|
|
654
|
-
code = code.
|
|
652
|
+
// 如果code是一个对象且包含destinationCode属性
|
|
653
|
+
if (typeof code === 'object' && code.destinationCode) {
|
|
654
|
+
code = code.destinationCode
|
|
655
655
|
}
|
|
656
656
|
|
|
657
657
|
// 确保code是字符串且长度为6
|
|
@@ -684,11 +684,15 @@ const onAddressConfirm = ({ selectedOptions }) => {
|
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
-
// 构造包含
|
|
688
|
-
|
|
687
|
+
// 构造包含destinationCode和destination的对象
|
|
688
|
+
// 过滤掉"请选择"的选项,只保留有效的地址文本
|
|
689
|
+
const addressText = selectedOptions
|
|
690
|
+
.filter(opt => opt && opt.text && opt.text !== '请选择')
|
|
691
|
+
.map(opt => opt.text)
|
|
692
|
+
.join('')
|
|
689
693
|
const addressObject = {
|
|
690
|
-
|
|
691
|
-
|
|
694
|
+
destinationCode: code,
|
|
695
|
+
destination: addressText
|
|
692
696
|
}
|
|
693
697
|
|
|
694
698
|
updateFieldValue(addressPopup.value.field.field, addressObject)
|
|
@@ -701,14 +705,14 @@ const onAddressConfirm = ({ selectedOptions }) => {
|
|
|
701
705
|
|
|
702
706
|
const getAddressText = (field) => {
|
|
703
707
|
const value = formData[field.field]
|
|
704
|
-
// 如果value是一个对象且包含
|
|
705
|
-
if (value && typeof value === 'object' && value.
|
|
706
|
-
return value.
|
|
708
|
+
// 如果value是一个对象且包含destination属性,直接返回destination
|
|
709
|
+
if (value && typeof value === 'object' && value.destination) {
|
|
710
|
+
return value.destination
|
|
707
711
|
}
|
|
708
712
|
|
|
709
|
-
// 如果value是一个对象且包含
|
|
710
|
-
if (value && typeof value === 'object' && value.
|
|
711
|
-
return getCodeToAddressText(value.
|
|
713
|
+
// 如果value是一个对象且包含destinationCode属性
|
|
714
|
+
if (value && typeof value === 'object' && value.destinationCode) {
|
|
715
|
+
return getCodeToAddressText(value.destinationCode)
|
|
712
716
|
}
|
|
713
717
|
|
|
714
718
|
// 如果value是一个字符串(直接是code值)
|