【类 型】:feat
【原 因】:主页点击 ”商品购买按钮“ 跳转页面时候跳转到 指定的'shop'标签的导航的高度位置 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
1cd4d15bac
commit
754963fe17
@ -33,7 +33,7 @@
|
||||
<view class="flex mse" style="margin-top: 30rpx;">
|
||||
<mainBut url="/pages/shop/list" bg="#D43030" imgSrc="/static/icons/ordernow.svg" butBt="开始点餐"
|
||||
butSt="Order Now" />
|
||||
<mainBut url="/pages/shop/list" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品"
|
||||
<mainBut url="/pages/shop/list?tag=shop" bg="#FF8D1A" imgSrc="/static/icons/buggoods.svg" butBt="购买商品"
|
||||
butSt="Buy Goods" />
|
||||
<!-- <mainBut bg="#FFC300" imgSrc="/static/icons/franchise.svg" butBt="项目介绍" butSt="Introduction" /> -->
|
||||
</view>
|
||||
|
@ -97,8 +97,22 @@
|
||||
scrollingTiemout: null, //timeout对象
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
//get参数里面有shop 页面加载完成后 跳转对应标签的导航高度位置
|
||||
if (options.tag === 'shop') {
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
const index = this.menuList.findIndex(item => item.tag === 'shop')
|
||||
if (index !== -1) {
|
||||
this.swichMenu(index)
|
||||
}
|
||||
}, 300) // 延迟300ms确保menuList有时间加载
|
||||
})
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.getMenuItemTop()
|
||||
//this.swichMenu(this.menuList.length - 1) // 激活最后一项
|
||||
},
|
||||
onShow() {
|
||||
// 当页面显示时,设置tabber的激活项
|
||||
|
Loading…
Reference in New Issue
Block a user