|
-
- let app = getApp();
- Component({
- data: {
- home_a_img:[],
- selected: 0,
- "color": "#abb1be",
- "selectedColor": "#FD782D",
- "list": [{
- "pagePath": "/pages/index/index",
- "iconPath": "assets/images/home_btn_ic_sy.png",
- "selectedIconPath": "assets/images/home_btn_ic_sy1.png",
- "text": "首页"
- },
- {
- "pagePath": "/pages/course/course",
- "iconPath": "assets/images/home_btn_ic_kc.png",
- "selectedIconPath": "assets/images/home_btn_ic_kc1.png",
- "text": "课程"
- },
- {
- "pagePath": "/pages/user/user",
- "iconPath": "assets/images/home_btn_ic_wd.png",
- "selectedIconPath": "assets/images/home_btn_ic_wd1.png",
- "text": "我的"
- },
- ]
- },
-
- // lifetimes: {
- // attached: function () {
- // // 在组件实例进入页面节点树时执行
-
- // },
- // },
- attached() {
- },
- methods: {
- switchTab(e) {
-
- // this.setData({
- // list: this.data.home_a_img
- // })
- // console.log(this.data.home_a_img)
-
- const data = e.currentTarget.dataset;
- this.setData({
- selected: data.index
- })
- console.log(data.index)
- const url = data.path;
- if (data.index == 0 || data.index == 3) {
- this.getTemplateId()
- }
-
- tt.switchTab({
- url
- });
- },
- }
-
- })
|