提交代码

This commit is contained in:
zpc 2024-07-07 17:32:52 +08:00
parent 96f7d6408e
commit d0bed931e8
4 changed files with 28 additions and 4 deletions

View File

@ -20,7 +20,7 @@ Component({
"pagePath": "/pages/mall/index", "pagePath": "/pages/mall/index",
"iconPath": "/static/tabbar/m5.png", "iconPath": "/static/tabbar/m5.png",
"selectedIconPath": "/static/tabbar/s5.png", "selectedIconPath": "/static/tabbar/s5.png",
"text": "" "text": ""
}, },
{ {
"pagePath": "/pages/sangdai/sangdai", "pagePath": "/pages/sangdai/sangdai",
@ -42,6 +42,7 @@ Component({
switchTab(e) { switchTab(e) {
const data = e.currentTarget.dataset const data = e.currentTarget.dataset
const url = data.path const url = data.path
console.log(e,data,url)
wx.switchTab({ url }) wx.switchTab({ url })
this.setData({ this.setData({
selected: data.index selected: data.index

View File

@ -2,4 +2,27 @@
<view> <view>
123OL 123OL
</view> </view>
</template> </template>
<script>
export default {
data() {
return {
}
},
onShow() {
this.current = 0
const curPages = getCurrentPages()[0]; //
if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {
this.$mp.page.getTabBar().setData({
selected: 2
});
}
},
methods: {
}
}
</script>

View File

@ -399,7 +399,7 @@
const curPages = getCurrentPages()[0]; // const curPages = getCurrentPages()[0]; //
if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) { if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {
this.$mp.page.getTabBar().setData({ this.$mp.page.getTabBar().setData({
selected: 2 selected: 3
}); });
} }
}, },

View File

@ -421,7 +421,7 @@
const curPages = getCurrentPages()[0]; // const curPages = getCurrentPages()[0]; //
if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) { if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {
this.$mp.page.getTabBar().setData({ this.$mp.page.getTabBar().setData({
selected: 3 selected: 4
}); });
} }
}, },