@tplc/business 0.5.59 → 0.5.60

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,8 @@
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.60](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.59...v0.5.60) (2025-12-02)
6
+
5
7
  ### [0.5.59](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v0.5.58...v0.5.59) (2025-12-02)
6
8
 
7
9
 
@@ -204,7 +204,7 @@ const onActionClick = async () => {
204
204
  case 16:
205
205
  if (url) {
206
206
  const windowInfo = uni.getWindowInfo()
207
- const navbarHeight = (windowInfo.statusBarHeight || 0) + 44
207
+ const navbarHeight = (windowInfo.statusBarHeight || 0) + 44 + 24
208
208
  const offsetTop =
209
209
  'offsetTopNavbar' in props && props.offsetTopNavbar !== false ? navbarHeight : 0
210
210
  onPageScrollSelector(url, offsetTop)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.5.59",
3
+ "version": "0.5.60",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
package/utils/utils.ts CHANGED
@@ -74,22 +74,24 @@ export const getFinalUrl = (url: string, urlParams?: string) => {
74
74
  })}`
75
75
  }
76
76
 
77
- export const onPageScrollSelector = (selector: string, offsetTop?: number) => {
77
+ export const onPageScrollSelector = (selector: string, offsetTop = 0) => {
78
78
  const prefix = (uni.$lcb.layoutId ? `#${uni.$lcb.layoutId} >>> #` : '#') + selector
79
- uni
80
- .createSelectorQuery()
81
- .in(getCurrentInstance()?.proxy)
82
- .select(prefix)
83
- .boundingClientRect()
84
- .exec((res) => {
85
- console.log(res)
86
- if (res && res[0]) {
87
- uni.pageScrollTo({
88
- // selector: `${prefix}${selector}`,
89
- scrollTop: res[0].top + offsetTop,
90
- })
91
- }
92
- })
79
+ const query = uni.createSelectorQuery().in(getCurrentInstance()?.proxy)
80
+ // @ts-ignore
81
+ query.selectViewport().scrollOffset()
82
+ query.select(prefix).boundingClientRect()
83
+ query.exec((res) => {
84
+ const scrollRes = res[0]
85
+ const rect = res[1]
86
+ const currentScrollTop = scrollRes?.scrollTop || 0
87
+ if (rect) {
88
+ const absoluteTop = rect.top + currentScrollTop
89
+ const adjustedScrollTop = absoluteTop - offsetTop
90
+ uni.pageScrollTo({
91
+ scrollTop: adjustedScrollTop,
92
+ })
93
+ }
94
+ })
93
95
  }
94
96
 
95
97
  export const getPreviewImageUrl = (url: string, width = 200) => {