|
@@ -0,0 +1,39 @@
|
|
|
+const app = getApp()
|
|
|
+Component({
|
|
|
+ data: {
|
|
|
+ selected: 2,
|
|
|
+ color: "#7A7E83",
|
|
|
+ selectedColor: "#45A6B5",
|
|
|
+ list: [{
|
|
|
+ pagePath: "/pages/index/index",
|
|
|
+ iconPath: "/imaes/home_nor@2x.png",
|
|
|
+ selectedIconPath: "/imaes/home_sel@2x.png",
|
|
|
+ text: "首页"
|
|
|
+ }, {
|
|
|
+ pagePath: "/pages/report/report",
|
|
|
+ iconPath: "/imaes/baogao_nor@2x.png",
|
|
|
+ selectedIconPath: "/imaes/baogao_sel@2x.png",
|
|
|
+ text: "报告"
|
|
|
+ },{
|
|
|
+ pagePath: "/pages/my/my",
|
|
|
+ iconPath: "/imaes/me_nor@2x.png",
|
|
|
+ selectedIconPath: "/imaes/me_sel@2x.png",
|
|
|
+ text: "我的"
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ attached() {
|
|
|
+ },
|
|
|
+ ready () {
|
|
|
+ this.setData({
|
|
|
+ selected: app.globalData.selectedInex
|
|
|
+ })
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ switchTab(e) {
|
|
|
+ const data = e.currentTarget.dataset
|
|
|
+ const url = data.path
|
|
|
+ app.globalData.selectedInex = data.index
|
|
|
+ wx.switchTab({url})
|
|
|
+ }
|
|
|
+ }
|
|
|
+})
|