@tplc/business 0.7.2 → 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 +14 -0
- package/action.d.ts +1 -1
- package/components/lcb-nav/AddressCommunity/index.vue +36 -3
- package/components/lcb-nav/lcb-nav.vue +0 -21
- package/components/lcb-nav/types.ts +1 -0
- package/package.json +13 -13
- package/types/components/lcb-nav/AddressCommunity/index.vue.d.ts +2 -0
- package/types/components/lcb-nav/types.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
12
|
+
### [0.7.3](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.2...v0.7.3) (2025-12-12)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ✨ Features | 新功能
|
|
16
|
+
|
|
17
|
+
* 更新版本 ([71a7e8a](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/71a7e8ab13cc71ae43c0e6152df26a55a6faa996))
|
|
18
|
+
|
|
5
19
|
### [0.7.2](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.7.1...v0.7.2) (2025-12-11)
|
|
6
20
|
|
|
7
21
|
### [0.7.1](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.90...v0.7.1) (2025-12-11)
|
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) => void
|
|
76
|
+
setAddressId: (addressId: string, switchType?: 'merchant' | 'address') => void
|
|
77
77
|
getAddressId: () => string
|
|
78
78
|
}
|
|
79
79
|
messageStore?: () => {
|
|
@@ -40,12 +40,20 @@ const props = withDefaults(defineProps<AddressCommunityProps>(), {
|
|
|
40
40
|
width: 240,
|
|
41
41
|
mode: 'normal',
|
|
42
42
|
popupWidth: 240,
|
|
43
|
+
switchType: 'address',
|
|
43
44
|
})
|
|
45
|
+
type Merchant = { merchantName: string; pageDecorationId: string }
|
|
44
46
|
const value = defineModel<string>('')
|
|
45
47
|
const constantsStore = uni.$lcb.constantsStore?.()
|
|
46
48
|
const title = ref<string>('')
|
|
49
|
+
const merchantList = ref<Merchant[]>([])
|
|
47
50
|
const options = computed(() => {
|
|
48
|
-
return
|
|
51
|
+
return props.switchType === 'merchant'
|
|
52
|
+
? (merchantList.value || []).map((item) => ({
|
|
53
|
+
addressName: item.merchantName,
|
|
54
|
+
addressId: item.pageDecorationId,
|
|
55
|
+
}))
|
|
56
|
+
: constantsStore?.mainConfig?.addressList
|
|
49
57
|
})
|
|
50
58
|
const setCurrentAddress = (address: { addressName: string; addressId: string }) => {
|
|
51
59
|
if (address) {
|
|
@@ -63,14 +71,30 @@ watch(
|
|
|
63
71
|
deep: true,
|
|
64
72
|
},
|
|
65
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
|
+
)
|
|
66
86
|
|
|
67
87
|
const handleChange = (e: any) => {
|
|
68
|
-
uni.$lcb.constantsStore?.()?.setAddressId(e.selectedItem.addressId)
|
|
88
|
+
uni.$lcb.constantsStore?.()?.setAddressId(e.selectedItem.addressId, props.switchType)
|
|
69
89
|
}
|
|
70
90
|
|
|
71
91
|
const onChooseAddress = () => {
|
|
72
92
|
if (props.mode === 'normal') {
|
|
73
|
-
|
|
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
|
+
}
|
|
74
98
|
}
|
|
75
99
|
}
|
|
76
100
|
const containerStyle = computed(() => {
|
|
@@ -83,6 +107,15 @@ const containerStyle = computed(() => {
|
|
|
83
107
|
[props.mode === 'normal' ? 'max-width' : 'width']: `${props.width}rpx`,
|
|
84
108
|
}
|
|
85
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
|
+
}
|
|
86
119
|
</script>
|
|
87
120
|
|
|
88
121
|
<style lang="scss" scoped>
|
|
@@ -296,27 +296,6 @@ const onCapsule = ({ action }: ICapsule) => {
|
|
|
296
296
|
})
|
|
297
297
|
break
|
|
298
298
|
case 'scanCode':
|
|
299
|
-
// Taro.scanCode({
|
|
300
|
-
// success: ({result:url}) => {
|
|
301
|
-
// if(url.includes('plugin://kivicube-slam/scene')){
|
|
302
|
-
// Taro.redirectTo({
|
|
303
|
-
// url,
|
|
304
|
-
// });
|
|
305
|
-
// }else{
|
|
306
|
-
// Taro.navigateBack({
|
|
307
|
-
// success:()=>{
|
|
308
|
-
// Taro.showToast({
|
|
309
|
-
// title:'请扫描正确的二维码',
|
|
310
|
-
// icon:'none',
|
|
311
|
-
// duration:1500
|
|
312
|
-
// })
|
|
313
|
-
// }
|
|
314
|
-
// })
|
|
315
|
-
// }
|
|
316
|
-
|
|
317
|
-
// },
|
|
318
|
-
// fail:()=>Taro.navigateBack({})
|
|
319
|
-
// });
|
|
320
299
|
uni.scanCode({
|
|
321
300
|
success: (res) => {
|
|
322
301
|
const { result } = res
|
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
|
+
}
|
|
@@ -13,6 +13,7 @@ declare const _default: import('vue').DefineComponent<
|
|
|
13
13
|
width: number
|
|
14
14
|
mode: string
|
|
15
15
|
popupWidth: number
|
|
16
|
+
switchType: string
|
|
16
17
|
}
|
|
17
18
|
>,
|
|
18
19
|
{},
|
|
@@ -32,6 +33,7 @@ declare const _default: import('vue').DefineComponent<
|
|
|
32
33
|
color: string
|
|
33
34
|
fontSize: number
|
|
34
35
|
popupWidth: number
|
|
36
|
+
switchType: 'merchant' | 'address'
|
|
35
37
|
},
|
|
36
38
|
{}
|
|
37
39
|
>
|