Commit b55b9aa5 by zeyang

1.优化目录跳转逻辑

parent 153a5abb
......@@ -32,7 +32,10 @@
目录
</view>
<view v-for="item in showList" @click="accessLogSave(item.id)">
<a :href="'#catalogue'+item.id">{{indexList[item.no-1]}}{{item.id==7?'':':'}}{{item.name}}</a>
<!-- 第{{indexList[item.no-1]}}{{item.id==7?'':':'}}{{item.name}} -->
<a href="javascript:void(0);">{{indexList[item.no-1]}}{{item.id==7?'':':'}}{{item.name}}</a>
</view>
<!-- <view @click="accessLogSave(2)" v-if="powerCodes.includes('2') || powerCodes.includes('0')">
<a href="#catalogue2">第二篇:民法典婚姻家庭编</a>
......@@ -1751,6 +1754,23 @@
let isNeedLogin=ref(false);
const c_scrollInfoView = (id)=>{
uni.pageScrollTo({
duration: 300, // 滚动动画过渡时间
// scrollTop: data['top'], // 滚动的值
selector:id,
})
// document.querySelector(id).scrollIntoView({ behavior: "smooth" })
// uni.createSelectorQuery().select(id).boundingClientRect(data => {
// console.log(data);
// // 调用页面滚动的api
// uni.pageScrollTo({
// duration: 300, // 滚动动画过渡时间
// scrollTop: data['top'], // 滚动的值
// })
// }).exec();
}
//点击发送验证码
const c_sendCode = () => {
let phoneRs = common.mobileNoValid(mobile.value);
......@@ -1846,6 +1866,10 @@
}
//保存访问记录
const accessLogSave = (type) => {
if(type!=0){
c_scrollInfoView('#catalogue'+type);
}
api.accessLogSave({ "userId": isNeedLogin?userId.value:null, "sessionId": sessionId.value, "accessUrl": cffpURL + "/myPackageA/lawManual/lawManual", "accessType": type }).then(res => {
if (res['success']) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment