提交 a97c8337 作者: 方治民

fix: 修复链接跳转到指定元素位置 APP 不兼容问题

上级 5b3a66ca
...@@ -304,11 +304,17 @@ ...@@ -304,11 +304,17 @@
Navigate.webview(item.jump_target, item.name) Navigate.webview(item.jump_target, item.name)
} else { } else {
if (item.jump_target?.startsWith('#')) { if (item.jump_target?.startsWith('#')) {
const value = item.jump_target?.substring(1)
if (/^[+-]?\d+(\.\d+)?$/.test(value)) {
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: Number(item.jump_target?.substring(1) || 0), scrollTop: Number(value),
duration: 300,
}) })
} else { } else {
uni.pageScrollTo({
selector: item.jump_target,
})
}
} else {
uni.showModal({ uni.showModal({
title: item.name, title: item.name,
content: '功能暂未开放', content: '功能暂未开放',
...@@ -803,7 +809,7 @@ ...@@ -803,7 +809,7 @@
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
height: 100%; height: auto !important;
padding-bottom: 20rpx; padding-bottom: 20rpx;
.section { .section {
......
...@@ -297,11 +297,17 @@ ...@@ -297,11 +297,17 @@
Navigate.webview(item.jump_target, item.name) Navigate.webview(item.jump_target, item.name)
} else { } else {
if (item.jump_target?.startsWith('#')) { if (item.jump_target?.startsWith('#')) {
const value = item.jump_target?.substring(1)
if (/^[+-]?\d+(\.\d+)?$/.test(value)) {
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: Number(item.jump_target?.substring(1) || 0), scrollTop: Number(value),
duration: 300,
}) })
} else { } else {
uni.pageScrollTo({
selector: item.jump_target,
})
}
} else {
uni.showModal({ uni.showModal({
title: item.name, title: item.name,
content: '功能暂未开放', content: '功能暂未开放',
...@@ -614,7 +620,7 @@ ...@@ -614,7 +620,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="codefun-flex-col group_21"> <view class="codefun-flex-col group_21" id="monitorWarning">
<view class="codefun-flex-row codefun-justify-between codefun-items-center group_22"> <view class="codefun-flex-row codefun-justify-between codefun-items-center group_22">
<text class="font text_42">监测预警</text> <text class="font text_42">监测预警</text>
<text class="font_6 text_43 text_44" @click="onViewMoreMonitoring">更多</text> <text class="font_6 text_43 text_44" @click="onViewMoreMonitoring">更多</text>
...@@ -750,7 +756,7 @@ ...@@ -750,7 +756,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="codefun-flex-col group_28"> <view class="codefun-flex-col group_28" id="creditCenter">
<text class="codefun-self-start font text_61">信用中心</text> <text class="codefun-self-start font text_61">信用中心</text>
<view <view
class="codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch section_19 mt-21" class="codefun-flex-row codefun-justify-between codefun-items-center codefun-self-stretch section_19 mt-21"
...@@ -944,7 +950,7 @@ ...@@ -944,7 +950,7 @@
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
height: 100%; height: auto !important;
padding-bottom: 30rpx; padding-bottom: 30rpx;
.group { .group {
......
...@@ -383,11 +383,17 @@ ...@@ -383,11 +383,17 @@
Navigate.webview(item.jump_target, item.name) Navigate.webview(item.jump_target, item.name)
} else { } else {
if (item.jump_target?.startsWith('#')) { if (item.jump_target?.startsWith('#')) {
const value = item.jump_target?.substring(1)
if (/^[+-]?\d+(\.\d+)?$/.test(value)) {
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: Number(item.jump_target?.substring(1) || 0), scrollTop: Number(value),
duration: 300,
}) })
} else { } else {
uni.pageScrollTo({
selector: item.jump_target,
})
}
} else {
uni.showModal({ uni.showModal({
title: item.name, title: item.name,
content: '功能暂未开放', content: '功能暂未开放',
...@@ -905,7 +911,7 @@ ...@@ -905,7 +911,7 @@
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
height: 100%; height: auto !important;
padding-bottom: 20rpx; padding-bottom: 20rpx;
.group { .group {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论