dev
xiaowen 3 years ago
parent 9bd3320273
commit 842a29b7eb

@ -1,6 +1,6 @@
Component({ Component({
data: { data: {
selected: 0, //当前选中的tab下标 selected: null, //当前选中的tab下标
color: "#1E1E1E", color: "#1E1E1E",
selectedColor: "#646464", //tabbar选中字体颜色 selectedColor: "#646464", //tabbar选中字体颜色
list: [{ list: [{
@ -40,13 +40,19 @@ 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(url) // this.setData({
this.setData({ // selected: data.index
selected: data.index // })
})
wx.switchTab({ wx.switchTab({
url: "/" + url url: "/" + url
}) })
} },
init() {
const page = getCurrentPages().pop();
let n = this.data.list.findIndex(item => item.pagePath === `${page.route}`);
this.setData({
selected: n
});
}
}, },
}) })

@ -2,5 +2,8 @@
Page({ Page({
data: { data: {
} },
onShow() {
this.getTabBar().init();
},
}); });

@ -4,10 +4,9 @@ const app = getApp()
Page({ Page({
data: { data: {
tabbar:{}, tabbar: {},
condition: ['二十四小时','最近七天','最近三十天','自定义'], condition: ['二十四小时', '最近七天', '最近三十天', '自定义'],
toplist: [ toplist: [{
{
url: '', url: '',
title: '入库数据总量', title: '入库数据总量',
num: '0' num: '0'
@ -46,10 +45,13 @@ Page({
num: '0' num: '0'
}, },
], ],
},
onShow() {
this.getTabBar().init();
}, },
onLoad: function (options) { onLoad: function (options) {
}, },
}) })

@ -2,5 +2,8 @@
Page({ Page({
data: { data: {
} },
onShow() {
this.getTabBar().init();
},
}); });

@ -2,5 +2,8 @@
Page({ Page({
data: { data: {
} },
onShow() {
this.getTabBar().init();
},
}); });

@ -2,5 +2,8 @@
Page({ Page({
data: { data: {
} },
onShow() {
this.getTabBar().init();
},
}); });

@ -51,13 +51,13 @@
"ignoreUploadUnusedFiles": true "ignoreUploadUnusedFiles": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.19.4", "libVersion": "2.24.7",
"appid": "wxc7ec43a0959453fb", "appid": "wxc7ec43a0959453fb",
"projectname": "miniprogram-92", "projectname": "miniprogram-92",
"condition": {},
"editorSetting": { "editorSetting": {
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
"tabSize": 4 "tabSize": 4
}, },
"simulatorPluginLibVersion": {} "simulatorPluginLibVersion": {},
"condition": {}
} }
Loading…
Cancel
Save