@tplc/business 0.7.3 → 0.7.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.7.5](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.89...v0.7.5) (2025-12-13)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.5.88 ([147ff6e](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/147ff6e104f27f92690da8df5aca80e628fa9ed3))
11
+ * **release:** 0.5.89 ([414fcce](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/414fcce2d291ecfb1526eaf19512d745370f9893))
12
+ * **release:** 0.5.90 ([8965a49](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8965a49098b6e87bf49c496160b37efbcc369a1c))
13
+ * **release:** 0.5.91 ([c618ab3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/c618ab3e525bdc0faa81d69b64c5d560183fdb3d))
14
+ * **release:** 0.5.91 ([682a08c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/682a08cbd4be990feeaac7fe4dc9b7c4494acafd))
15
+ * **release:** 0.7.1 ([dc26746](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/dc26746c5e35bbca6e4becc9463dd63a85c18635))
16
+ * **release:** 0.7.2 ([0f3050c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/0f3050cc048955e83c1fc3af62dcbb2959785792))
17
+ * **release:** 0.7.3 ([5912bfd](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/5912bfdea30fa0c6a29ab9016f0e21bce040d135))
18
+ * **release:** 0.7.4 ([aeb4b94](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/aeb4b9483077e8796cece772c6f3e0f690b7d9d9))
19
+
20
+
21
+ ### ✨ Features | 新功能
22
+
23
+ * 地址切换修改 ([ef8042b](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/ef8042b422e59cc12090a80665504fbc17d65257))
24
+ * 支持切换模式 ([2983347](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/2983347d57b86c5cb99e0a7a93550c438bbd829c))
25
+ * 更新版本 ([71a7e8a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/71a7e8ab13cc71ae43c0e6152df26a55a6faa996))
26
+ * 更新版本 ([0fce71c](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/0fce71ccbb8387302b003f93b0108f98b1b0273e))
27
+ * 调整hover 才显示 ([59d3fac](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/59d3faca5f780005d1868bc6681a2cdc59c5d3c5))
28
+
29
+ ### [0.7.4](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.3...v0.7.4) (2025-12-12)
30
+
31
+
32
+ ### ✨ Features | 新功能
33
+
34
+ * 支持切换模式 ([2983347](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/2983347d57b86c5cb99e0a7a93550c438bbd829c))
35
+
5
36
  ### [0.7.3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.2...v0.7.3) (2025-12-12)
6
37
 
7
38
 
package/action.d.ts CHANGED
@@ -73,7 +73,7 @@ export interface LcbGlobal {
73
73
  mainConfig?: Record<string, any>
74
74
  otherConfig?: Record<string, any>
75
75
  addressId?: string
76
- setAddressId: (addressId: string, switchType?: 'current' | 'global') => void
76
+ setAddressId: (addressId: string, switchType?: 'merchant' | 'address') => void
77
77
  getAddressId: () => string
78
78
  }
79
79
  messageStore?: () => {
@@ -25,6 +25,7 @@
25
25
  <script setup lang="ts">
26
26
  import { ref, watch, computed } from 'vue'
27
27
  import { AddressCommunityProps } from '../types'
28
+ import { getCurrentPage } from '../../../utils/utils'
28
29
  defineOptions({
29
30
  name: 'AddressCommunity',
30
31
  options: {
@@ -40,13 +41,20 @@ const props = withDefaults(defineProps<AddressCommunityProps>(), {
40
41
  width: 240,
41
42
  mode: 'normal',
42
43
  popupWidth: 240,
43
- switchType: 'global',
44
+ switchType: 'address',
44
45
  })
46
+ type Merchant = { merchantName: string; pageDecorationId: string }
45
47
  const value = defineModel<string>('')
46
48
  const constantsStore = uni.$lcb.constantsStore?.()
47
49
  const title = ref<string>('')
50
+ const merchantList = ref<Merchant[]>([])
48
51
  const options = computed(() => {
49
- return constantsStore?.mainConfig?.addressList
52
+ return props.switchType === 'merchant'
53
+ ? (merchantList.value || []).map((item) => ({
54
+ addressName: item.merchantName,
55
+ addressId: item.pageDecorationId,
56
+ }))
57
+ : constantsStore?.mainConfig?.addressList
50
58
  })
51
59
  const setCurrentAddress = (address: { addressName: string; addressId: string }) => {
52
60
  if (address) {
@@ -64,14 +72,38 @@ watch(
64
72
  deep: true,
65
73
  },
66
74
  )
75
+ watch(
76
+ () => props.switchType,
77
+ (switchType) => {
78
+ if (switchType === 'merchant') {
79
+ getMerchantList()
80
+ }
81
+ },
82
+ {
83
+ immediate: true,
84
+ deep: true,
85
+ },
86
+ )
67
87
 
68
88
  const handleChange = (e: any) => {
69
- uni.$lcb.constantsStore?.()?.setAddressId(e.selectedItem.addressId, props.switchType)
89
+ if (props.switchType === 'merchant') {
90
+ // 刷新当前页面
91
+ uni.$emit('refreshSchemaPage', {
92
+ pageDecorationId: e.selectedItem.addressId,
93
+ pageId: getCurrentPage().pageId,
94
+ })
95
+ } else {
96
+ uni.$lcb.constantsStore?.()?.setAddressId(e.selectedItem.addressId, props.switchType)
97
+ }
70
98
  }
71
99
 
72
100
  const onChooseAddress = () => {
73
101
  if (props.mode === 'normal') {
74
- uni.$lcb.navigateTo(`/pages-sub/index/store?switchType=${props.switchType}`)
102
+ if (props.switchType === 'address') {
103
+ uni.$lcb.navigateTo(`/pages-sub/index/store`)
104
+ } else if (props.switchType === 'merchant') {
105
+ uni.$lcb.navigateTo(`/pages-sub/index/merchant?pageId=${getCurrentPage().pageId}`)
106
+ }
75
107
  }
76
108
  }
77
109
  const containerStyle = computed(() => {
@@ -84,6 +116,15 @@ const containerStyle = computed(() => {
84
116
  [props.mode === 'normal' ? 'max-width' : 'width']: `${props.width}rpx`,
85
117
  }
86
118
  })
119
+ const getMerchantList = async () => {
120
+ const { data } = await uni.$lcb.http.post('/merchant/page', {
121
+ pageSearch: {
122
+ limit: 1000,
123
+ page: 1,
124
+ },
125
+ })
126
+ merchantList.value = data as Merchant[]
127
+ }
87
128
  </script>
88
129
 
89
130
  <style lang="scss" scoped>
@@ -24,7 +24,7 @@ export interface AddressCommunityProps {
24
24
  width?: number
25
25
  mode: 'normal' | 'menu'
26
26
  popupWidth?: number
27
- switchType?: 'current' | 'global'
27
+ switchType?: 'merchant' | 'address'
28
28
  }
29
29
 
30
30
  export interface NavTitleProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -33,7 +33,7 @@ declare const _default: import('vue').DefineComponent<
33
33
  color: string
34
34
  fontSize: number
35
35
  popupWidth: number
36
- switchType: 'current' | 'global'
36
+ switchType: 'merchant' | 'address'
37
37
  },
38
38
  {}
39
39
  >
@@ -22,7 +22,7 @@ export interface AddressCommunityProps {
22
22
  width?: number
23
23
  mode: 'normal' | 'menu'
24
24
  popupWidth?: number
25
- switchType?: 'current' | 'global'
25
+ switchType?: 'merchant' | 'address'
26
26
  }
27
27
  export interface NavTitleProps {
28
28
  /** 模式 */