提交 a97c8337 作者: 方治民

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

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