@ -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}`);
selected: n
});
@ -2,5 +2,8 @@
Page({
onShow() {
this.getTabBar().init();
@ -4,10 +4,9 @@ const app = getApp()
tabbar:{},
condition: ['二十四小时','最近七天','最近三十天','自定义'],
toplist: [
{
tabbar: {},
condition: ['二十四小时', '最近七天', '最近三十天', '自定义'],
toplist: [{
url: '',
title: '入库数据总量',
num: '0'
@ -46,10 +45,13 @@ Page({
],
onLoad: function (options) {
@ -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": {}