@tplc/business 0.7.3 → 0.7.4
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 +7 -0
- package/action.d.ts +1 -1
- package/components/lcb-nav/AddressCommunity/index.vue +35 -3
- package/components/lcb-nav/types.ts +1 -1
- package/package.json +13 -13
- package/types/components/lcb-nav/AddressCommunity/index.vue.d.ts +1 -1
- package/types/components/lcb-nav/types.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.4](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.3...v0.7.4) (2025-12-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* 支持切换模式 ([2983347](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/2983347d57b86c5cb99e0a7a93550c438bbd829c))
|
|
11
|
+
|
|
5
12
|
### [0.7.3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.2...v0.7.3) (2025-12-12)
|
|
6
13
|
|
|
7
14
|
|
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?: '
|
|
76
|
+
setAddressId: (addressId: string, switchType?: 'merchant' | 'address') => void
|
|
77
77
|
getAddressId: () => string
|
|
78
78
|
}
|
|
79
79
|
messageStore?: () => {
|
|
@@ -40,13 +40,20 @@ const props = withDefaults(defineProps<AddressCommunityProps>(), {
|
|
|
40
40
|
width: 240,
|
|
41
41
|
mode: 'normal',
|
|
42
42
|
popupWidth: 240,
|
|
43
|
-
switchType: '
|
|
43
|
+
switchType: 'address',
|
|
44
44
|
})
|
|
45
|
+
type Merchant = { merchantName: string; pageDecorationId: string }
|
|
45
46
|
const value = defineModel<string>('')
|
|
46
47
|
const constantsStore = uni.$lcb.constantsStore?.()
|
|
47
48
|
const title = ref<string>('')
|
|
49
|
+
const merchantList = ref<Merchant[]>([])
|
|
48
50
|
const options = computed(() => {
|
|
49
|
-
return
|
|
51
|
+
return props.switchType === 'merchant'
|
|
52
|
+
? (merchantList.value || []).map((item) => ({
|
|
53
|
+
addressName: item.merchantName,
|
|
54
|
+
addressId: item.pageDecorationId,
|
|
55
|
+
}))
|
|
56
|
+
: constantsStore?.mainConfig?.addressList
|
|
50
57
|
})
|
|
51
58
|
const setCurrentAddress = (address: { addressName: string; addressId: string }) => {
|
|
52
59
|
if (address) {
|
|
@@ -64,6 +71,18 @@ watch(
|
|
|
64
71
|
deep: true,
|
|
65
72
|
},
|
|
66
73
|
)
|
|
74
|
+
watch(
|
|
75
|
+
() => props.switchType,
|
|
76
|
+
(switchType) => {
|
|
77
|
+
if (switchType === 'merchant') {
|
|
78
|
+
getMerchantList()
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
immediate: true,
|
|
83
|
+
deep: true,
|
|
84
|
+
},
|
|
85
|
+
)
|
|
67
86
|
|
|
68
87
|
const handleChange = (e: any) => {
|
|
69
88
|
uni.$lcb.constantsStore?.()?.setAddressId(e.selectedItem.addressId, props.switchType)
|
|
@@ -71,7 +90,11 @@ const handleChange = (e: any) => {
|
|
|
71
90
|
|
|
72
91
|
const onChooseAddress = () => {
|
|
73
92
|
if (props.mode === 'normal') {
|
|
74
|
-
|
|
93
|
+
if (props.switchType === 'address') {
|
|
94
|
+
uni.$lcb.navigateTo(`/pages-sub/index/store`)
|
|
95
|
+
} else if (props.switchType === 'merchant') {
|
|
96
|
+
uni.$lcb.navigateTo(`/pages-sub/index/merchant?switchMode=current`)
|
|
97
|
+
}
|
|
75
98
|
}
|
|
76
99
|
}
|
|
77
100
|
const containerStyle = computed(() => {
|
|
@@ -84,6 +107,15 @@ const containerStyle = computed(() => {
|
|
|
84
107
|
[props.mode === 'normal' ? 'max-width' : 'width']: `${props.width}rpx`,
|
|
85
108
|
}
|
|
86
109
|
})
|
|
110
|
+
const getMerchantList = async () => {
|
|
111
|
+
const { data } = await uni.$lcb.http.post('/merchant/page', {
|
|
112
|
+
pageSearch: {
|
|
113
|
+
limit: 1000,
|
|
114
|
+
page: 1,
|
|
115
|
+
},
|
|
116
|
+
})
|
|
117
|
+
merchantList.value = data as Merchant[]
|
|
118
|
+
}
|
|
87
119
|
</script>
|
|
88
120
|
|
|
89
121
|
<style lang="scss" scoped>
|
package/package.json
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tplc/business",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"业务组件"
|
|
6
6
|
],
|
|
7
7
|
"type": "module",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"pub": "pnpm dts && pnpm publish --no-git-checks",
|
|
10
|
-
"dts": "rm -rf types && vue-tsc --project ./tsconfig.dts.json && pnpm prettier --write types",
|
|
11
|
-
"release-major": "standard-version --release-as major ",
|
|
12
|
-
"release-minor": "standard-version --release-as minor",
|
|
13
|
-
"release-patch": "standard-version --release-as patch ",
|
|
14
|
-
"generateComponent": "node ./scripts/createComponent.mjs",
|
|
15
|
-
"generateGlobalDts": "node ./scripts/generateGlobalDts.mjs"
|
|
16
|
-
},
|
|
17
8
|
"publishConfig": {
|
|
18
9
|
"access": "public",
|
|
19
10
|
"registry": "https://registry.npmjs.org/"
|
|
20
11
|
},
|
|
21
12
|
"peerDependencies": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
13
|
+
"vue": ">=3.2.47",
|
|
14
|
+
"@tplc/wot": "1.0.14"
|
|
24
15
|
},
|
|
25
16
|
"engines": {
|
|
26
17
|
"node": ">=18",
|
|
@@ -33,5 +24,14 @@
|
|
|
33
24
|
},
|
|
34
25
|
"devDependencies": {
|
|
35
26
|
"standard-version": "^9.5.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"pub": "pnpm dts && pnpm publish --no-git-checks",
|
|
30
|
+
"dts": "rm -rf types && vue-tsc --project ./tsconfig.dts.json && pnpm prettier --write types",
|
|
31
|
+
"release-major": "standard-version --release-as major ",
|
|
32
|
+
"release-minor": "standard-version --release-as minor",
|
|
33
|
+
"release-patch": "standard-version --release-as patch ",
|
|
34
|
+
"generateComponent": "node ./scripts/createComponent.mjs",
|
|
35
|
+
"generateGlobalDts": "node ./scripts/generateGlobalDts.mjs"
|
|
36
36
|
}
|
|
37
|
-
}
|
|
37
|
+
}
|