dev
xiaowen 3 years ago
parent 9bd3320273
commit 842a29b7eb

@ -1,6 +1,6 @@
Component({
data: {
selected: 0, //当前选中的tab下标
selected: null, //当前选中的tab下标
color: "#1E1E1E",
selectedColor: "#646464", //tabbar选中字体颜色
list: [{
@ -40,13 +40,19 @@ Component({
switchTab(e) {
const data = e.currentTarget.dataset;
const url = data.path
console.log(url)
this.setData({
selected: data.index
})
// this.setData({
// selected: data.index
// })
wx.switchTab({
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({
data: {
}
},
onShow() {
this.getTabBar().init();
},
});

@ -6,8 +6,7 @@ Page({
data: {
tabbar: {},
condition: ['二十四小时', '最近七天', '最近三十天', '自定义'],
toplist: [
{
toplist: [{
url: '',
title: '入库数据总量',
num: '0'
@ -48,6 +47,9 @@ Page({
],
},
onShow() {
this.getTabBar().init();
},
onLoad: function (options) {
},

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

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

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

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