@tplc/business 0.5.61 → 0.5.63

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,10 @@
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.63](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.62...v0.5.63) (2025-12-02)
6
+
7
+ ### [0.5.62](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.61...v0.5.62) (2025-12-02)
8
+
5
9
  ### [0.5.61](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.60...v0.5.61) (2025-12-02)
6
10
 
7
11
  ### [0.5.60](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.59...v0.5.60) (2025-12-02)
@@ -67,7 +67,7 @@
67
67
  </template>
68
68
 
69
69
  <script setup lang="ts">
70
- import { computed, ref, inject, Ref, onMounted, getCurrentInstance } from 'vue'
70
+ import { computed, ref, inject, Ref, onMounted } from 'vue'
71
71
  import { jumpTypeMap, LcbActionViewProps } from './types'
72
72
  import { uploadFile } from '../../hooks/useUpload'
73
73
  import { getFinalUrl, onPageScrollSelector, getExposed, getCurrentPage } from '../../utils/utils'
@@ -88,11 +88,11 @@ defineOptions({
88
88
  })
89
89
 
90
90
  const props = defineProps<LcbActionViewProps>()
91
+ const { offsetTopNavbar = true } = props as { offsetTopNavbar?: boolean }
91
92
  const basicInfo = inject(USER_BASIC_INFO, {}) as unknown as Ref<Record<string, any>>
92
93
  const pageInfo = inject(PAGE_PROVIDE_KEY) as unknown as Ref<Record<string, any>>
93
94
  const showPoster = ref(false)
94
95
  const showPay = ref(false)
95
- const { proxy } = getCurrentInstance() as any
96
96
  const emits = defineEmits<{
97
97
  (e: 'phone', value: { detail: { errMsg: string; encryptedData: string; iv: string } }): void
98
98
  (e: 'avatar', value: string): void
@@ -205,10 +205,9 @@ const onActionClick = async () => {
205
205
  case 16:
206
206
  if (url) {
207
207
  const windowInfo = uni.getWindowInfo()
208
- const navbarHeight = (windowInfo.statusBarHeight || 0) + 44 + 24
209
- const offsetTop =
210
- 'offsetTopNavbar' in props && props.offsetTopNavbar !== false ? navbarHeight : 0
211
- onPageScrollSelector(url, offsetTop, proxy)
208
+ const navbarHeight = (windowInfo.statusBarHeight || 0) + 44
209
+ const offsetTop = offsetTopNavbar ? navbarHeight : 0
210
+ onPageScrollSelector(url, offsetTop)
212
211
  }
213
212
  break
214
213
  case 17:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.5.61",
3
+ "version": "0.5.63",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -11,11 +11,7 @@ export declare const getCurrentPage: () => {
11
11
  export declare const getPreviousPageId: () => string | number
12
12
  /** 合并url参数 url = /pages/data/index?id=1&name=2 urlParams = id=1&name=2&type=1 */
13
13
  export declare const getFinalUrl: (url: string, urlParams?: string) => string
14
- export declare const onPageScrollSelector: (
15
- selector: string,
16
- offsetTop: number | undefined,
17
- proxy: any,
18
- ) => void
14
+ export declare const onPageScrollSelector: (selector: string, offsetTop?: number) => void
19
15
  export declare const getPreviewImageUrl: (url: string, width?: number) => string
20
16
  /** 根据屏幕宽度 图片高度宽度比例 列数与 间隙宽度 计算图片高度 */
21
17
  export declare const calculateImageHeight: (
package/utils/utils.ts CHANGED
@@ -74,9 +74,10 @@ export const getFinalUrl = (url: string, urlParams?: string) => {
74
74
  })}`
75
75
  }
76
76
 
77
- export const onPageScrollSelector = (selector: string, offsetTop = 0, proxy: any) => {
77
+ export const onPageScrollSelector = (selector: string, offsetTop = 0) => {
78
78
  const prefix = (uni.$lcb.layoutId ? `#${uni.$lcb.layoutId} >>> #` : '#') + selector
79
- const query = uni.createSelectorQuery().in(proxy)
79
+ // #ifdef H5
80
+ const query = uni.createSelectorQuery().in(getCurrentInstance()?.proxy as any)
80
81
  // @ts-ignore
81
82
  query.selectViewport().scrollOffset()
82
83
  query.select(prefix).boundingClientRect()
@@ -92,6 +93,13 @@ export const onPageScrollSelector = (selector: string, offsetTop = 0, proxy: any
92
93
  })
93
94
  }
94
95
  })
96
+ // #endif
97
+ // #ifdef MP
98
+ uni.pageScrollTo({
99
+ selector: prefix,
100
+ offsetTop: -offsetTop,
101
+ })
102
+ // #endif
95
103
  }
96
104
 
97
105
  export const getPreviewImageUrl = (url: string, width = 200) => {