@tplc/business 0.5.29 → 0.5.30
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 +8 -0
- package/components/lcb-action-view/components/CustomPopup/index.vue +71 -0
- package/components/lcb-action-view/lcb-action-view.vue +11 -1
- package/components/lcb-action-view/types.ts +1 -0
- package/package.json +1 -1
- package/types/components/lcb-action-view/components/CustomPopup/index.vue.d.ts +37 -0
- package/types/components/lcb-action-view/types.d.ts +1 -0
- package/types/utils/utils.d.ts +13 -6
- package/utils/utils.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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.5.30](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.29...v0.5.30) (2025-10-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features | 新功能
|
|
9
|
+
|
|
10
|
+
* 新增render-view ([03b80da](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/03b80da7835eb28fb639046ab247db6f5af63d50))
|
|
11
|
+
* 暂时提交custompopup ([8c1b8b2](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/commit/8c1b8b29eac78d265d045772a4e393ee33353e3e))
|
|
12
|
+
|
|
5
13
|
### [0.5.29](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.28...v0.5.29) (2025-10-25)
|
|
6
14
|
|
|
7
15
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wd-popup
|
|
3
|
+
v-model="show"
|
|
4
|
+
:z-index="1000"
|
|
5
|
+
closable
|
|
6
|
+
position="center"
|
|
7
|
+
custom-class="!bg-transparent"
|
|
8
|
+
>
|
|
9
|
+
<view
|
|
10
|
+
:style="{ width: transformValueUnit(pageInfo?.page.popupWidth || '500') }"
|
|
11
|
+
class="mx-auto"
|
|
12
|
+
>
|
|
13
|
+
<lcb-render-view
|
|
14
|
+
v-for="(element, index) in pageInfo?.modules"
|
|
15
|
+
:key="index"
|
|
16
|
+
:element="element"
|
|
17
|
+
/>
|
|
18
|
+
</view>
|
|
19
|
+
</wd-popup>
|
|
20
|
+
</template>
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { transformValueUnit } from '../../../../utils/transform'
|
|
23
|
+
import { TextRenderViewItem } from '../../../../action'
|
|
24
|
+
import { provide, ref, watch } from 'vue'
|
|
25
|
+
import { PAGE_PROVIDE_KEY } from '../../../../constants'
|
|
26
|
+
defineOptions({
|
|
27
|
+
name: 'ActionCustomPopup',
|
|
28
|
+
options: {
|
|
29
|
+
addGlobalClass: true,
|
|
30
|
+
virtualHost: true,
|
|
31
|
+
styleIsolation: 'shared',
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const props = defineProps<{
|
|
36
|
+
jumpType?: string
|
|
37
|
+
}>()
|
|
38
|
+
const popupInfo = ref<Record<string, any>>({})
|
|
39
|
+
provide(PAGE_PROVIDE_KEY, popupInfo)
|
|
40
|
+
const show = defineModel({ default: false })
|
|
41
|
+
const pageInfo = ref<{
|
|
42
|
+
modules: TextRenderViewItem['items']
|
|
43
|
+
page: {
|
|
44
|
+
popupWidth: number
|
|
45
|
+
requestApi: string
|
|
46
|
+
}
|
|
47
|
+
}>()
|
|
48
|
+
|
|
49
|
+
watch(
|
|
50
|
+
() => show.value,
|
|
51
|
+
async (newVal) => {
|
|
52
|
+
if (newVal) {
|
|
53
|
+
const { data } = (await uni.$lcb.http.post('/pageDecoration/page/detail', {
|
|
54
|
+
pageType: props.jumpType,
|
|
55
|
+
})) as any
|
|
56
|
+
pageInfo.value = data
|
|
57
|
+
if (pageInfo.value?.page?.requestApi) {
|
|
58
|
+
uni.$lcb.http.post<Record<string, any>>(pageInfo.value?.page?.requestApi).then((res) => {
|
|
59
|
+
popupInfo.value = {
|
|
60
|
+
...pageInfo.value,
|
|
61
|
+
...res.data,
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
immediate: true,
|
|
69
|
+
},
|
|
70
|
+
)
|
|
71
|
+
</script>
|
|
@@ -59,6 +59,11 @@
|
|
|
59
59
|
v-if="[144].includes(getJumpType(jumpType)) && showPay && requestInfo && submitRequestInfo"
|
|
60
60
|
/>
|
|
61
61
|
<SharePopup v-model="showPoster" :params="requestParam" />
|
|
62
|
+
<CustomPopup
|
|
63
|
+
v-model="showCustomPopup"
|
|
64
|
+
v-if="[145].includes(getJumpType(jumpType)) && showCustomPopup"
|
|
65
|
+
:jumpType="getJumpType(jumpType)"
|
|
66
|
+
/>
|
|
62
67
|
</template>
|
|
63
68
|
|
|
64
69
|
<script setup lang="ts">
|
|
@@ -66,7 +71,8 @@ import { computed, ref, inject, Ref, onMounted } from 'vue'
|
|
|
66
71
|
import { jumpTypeMap, LcbActionViewProps } from './types'
|
|
67
72
|
import { uploadFile } from '../../hooks/useUpload'
|
|
68
73
|
import { getFinalUrl, onPageScrollSelector, getExposed, getCurrentPage } from '../../utils/utils'
|
|
69
|
-
import SharePopup from '
|
|
74
|
+
import SharePopup from '../../components/lcb-nav/SharePopup/index.vue'
|
|
75
|
+
import CustomPopup from './components/CustomPopup/index.vue'
|
|
70
76
|
import { useTranslate } from '@tplc/wot'
|
|
71
77
|
import { PAGE_PROVIDE_KEY, USER_BASIC_INFO } from '../../constants'
|
|
72
78
|
import { getTemplateMessageList, TemplateMessage } from '../../api/user'
|
|
@@ -110,6 +116,7 @@ onMounted(async () => {
|
|
|
110
116
|
routeFullPath.value = getCurrentPage()?.fullPath
|
|
111
117
|
})
|
|
112
118
|
const show = ref(false)
|
|
119
|
+
const showCustomPopup = ref(false)
|
|
113
120
|
const openType = computed(() => {
|
|
114
121
|
return {
|
|
115
122
|
88: 'getPhoneNumber',
|
|
@@ -307,6 +314,9 @@ const onActionClick = async () => {
|
|
|
307
314
|
case 144:
|
|
308
315
|
showPay.value = true
|
|
309
316
|
break
|
|
317
|
+
case 145:
|
|
318
|
+
showCustomPopup.value = true
|
|
319
|
+
break
|
|
310
320
|
default:
|
|
311
321
|
emits('click', props)
|
|
312
322
|
break
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare let __VLS_typeProps: {
|
|
2
|
+
jumpType?: string
|
|
3
|
+
}
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: any
|
|
6
|
+
} & typeof __VLS_typeProps
|
|
7
|
+
declare const _default: import('vue').DefineComponent<
|
|
8
|
+
__VLS_TypePropsToOption<__VLS_PublicProps>,
|
|
9
|
+
{},
|
|
10
|
+
unknown,
|
|
11
|
+
{},
|
|
12
|
+
{},
|
|
13
|
+
import('vue').ComponentOptionsMixin,
|
|
14
|
+
import('vue').ComponentOptionsMixin,
|
|
15
|
+
{
|
|
16
|
+
'update:modelValue': (modelValue: any) => void
|
|
17
|
+
},
|
|
18
|
+
string,
|
|
19
|
+
import('vue').PublicProps,
|
|
20
|
+
Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
|
|
21
|
+
'onUpdate:modelValue'?: ((modelValue: any) => any) | undefined
|
|
22
|
+
},
|
|
23
|
+
{},
|
|
24
|
+
{}
|
|
25
|
+
>
|
|
26
|
+
export default _default
|
|
27
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
|
|
28
|
+
type __VLS_TypePropsToOption<T> = {
|
|
29
|
+
[K in keyof T]-?: {} extends Pick<T, K>
|
|
30
|
+
? {
|
|
31
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
|
|
32
|
+
}
|
|
33
|
+
: {
|
|
34
|
+
type: import('vue').PropType<T[K]>
|
|
35
|
+
required: true
|
|
36
|
+
}
|
|
37
|
+
}
|
package/types/utils/utils.d.ts
CHANGED
|
@@ -2,12 +2,19 @@ import { UploadMethod } from '@tplc/wot/types/components/wd-upload/types'
|
|
|
2
2
|
export declare function formatJson(str: string | object | undefined, defVal?: {}): {}
|
|
3
3
|
/** 获取上个页面Exposed */
|
|
4
4
|
export declare const getExposed: () => any
|
|
5
|
-
export declare const getCurrentPage: () =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export declare const getCurrentPage: () =>
|
|
6
|
+
| {
|
|
7
|
+
pageId: number
|
|
8
|
+
fullPath: string
|
|
9
|
+
options: {}
|
|
10
|
+
route: string
|
|
11
|
+
}
|
|
12
|
+
| {
|
|
13
|
+
pageId: string
|
|
14
|
+
fullPath: string
|
|
15
|
+
options: any
|
|
16
|
+
route: string
|
|
17
|
+
}
|
|
11
18
|
export declare const getPreviousPageId: () => string | number
|
|
12
19
|
/** 合并url参数 url = /pages/data/index?id=1&name=2 urlParams = id=1&name=2&type=1 */
|
|
13
20
|
export declare const getFinalUrl: (url: string, urlParams?: string) => string
|
package/utils/utils.ts
CHANGED
|
@@ -27,6 +27,7 @@ export const getCurrentPage = () => {
|
|
|
27
27
|
id: string
|
|
28
28
|
fullPath: string
|
|
29
29
|
}
|
|
30
|
+
__wxWebviewId__: string
|
|
30
31
|
route: string
|
|
31
32
|
getPageId: () => number
|
|
32
33
|
}
|
|
@@ -41,9 +42,9 @@ export const getCurrentPage = () => {
|
|
|
41
42
|
|
|
42
43
|
const fullPath = decodeURIComponent(page.$page?.fullPath?.split('?')[1] || '')
|
|
43
44
|
return {
|
|
44
|
-
pageId: isH5 ? page.$page.id : page.
|
|
45
|
+
pageId: isH5 ? page.$page.id : page.__wxWebviewId__,
|
|
45
46
|
fullPath: page.$page?.fullPath,
|
|
46
|
-
options: parse(fullPath),
|
|
47
|
+
options: parse(fullPath) as any,
|
|
47
48
|
route: page.route,
|
|
48
49
|
}
|
|
49
50
|
}
|