vue_zhongyou 1.0.16 → 1.0.18

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue_zhongyou",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "keywords": [],
@@ -629,9 +629,9 @@ const openAddressPicker = (field) => {
629
629
  const fieldValue = formData[field.field]
630
630
  let code = ''
631
631
 
632
- // 如果fieldValue是一个对象且包含code属性
633
- if (fieldValue && typeof fieldValue === 'object' && fieldValue.code) {
634
- code = fieldValue.code
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是一个对象且包含code属性
653
- if (typeof code === 'object' && code.code) {
654
- code = 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
- // 构造包含codetext的对象
688
- const addressText = selectedOptions.map(opt => opt.text).join('')
687
+ // 构造包含destinationCodedestination的对象
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
- code: code,
691
- text: addressText
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是一个对象且包含text属性,直接返回text
705
- if (value && typeof value === 'object' && value.text) {
706
- return value.text
708
+ // 如果value是一个对象且包含destination属性,直接返回destination
709
+ if (value && typeof value === 'object' && value.destination) {
710
+ return value.destination
707
711
  }
708
712
 
709
- // 如果value是一个对象且包含code属性
710
- if (value && typeof value === 'object' && value.code) {
711
- return getCodeToAddressText(value.code)
713
+ // 如果value是一个对象且包含destinationCode属性
714
+ if (value && typeof value === 'object' && value.destinationCode) {
715
+ return getCodeToAddressText(value.destinationCode)
712
716
  }
713
717
 
714
718
  // 如果value是一个字符串(直接是code值)