信达小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.8 KiB

import { getCurrentPageUrl } from '@/utils/util'
const app = getApp()
9 months ago
Component({
properties: {},
data: {
imageUrl: app.globalData.imageUrl,
isChild: 0,
active: 0,
list: [
{
pagePath: '/patient/pages/index/index',
text: '首页',
icon: 'tab1',
iconActive: 'tab-active1',
9 months ago
},
{
pagePath: '/patient/pages/repository/index',
text: '了解TED',
icon: 'tab2',
iconActive: 'tab-active2',
9 months ago
},
{
pagePath: '/patient/pages/live/index',
text: '大咖说',
icon: 'tab5',
iconActive: 'tab-active5',
9 months ago
},
{
pagePath: '/patient/pages/my/index',
text: '我的',
icon: 'tab3',
iconActive: 'tab-active3',
9 months ago
},
],
userInfo: {},
showRed: false,
config: {} as any,
},
observers: {},
lifetimes: {
ready() {
app.zdGetTheme().then((res) => {
this.setData({
theme: res,
})
})
9 months ago
const pagePath = getCurrentPageUrl()
const active = this.data.list.findIndex((item) => item.pagePath === pagePath)
9 months ago
this.setData({
active,
})
9 months ago
this.setData({
showRed: app.globalData.showRed,
})
9 months ago
// getApp().registerListener(() => {
// wx.ajax({
// method: 'GET',
// url: '?r=zd/common/get-config',
// }).then((res) => {
// this.setData({
// config: res,
// });
// });
// });
},
},
methods: {
onChange() {},
handleNav(e) {
const { index } = e.currentTarget.dataset
const { list } = this.data
const pagePath = list[index].pagePath
app.globalData.BeginnerCardId = ''
wx.reLaunch({
url: pagePath,
})
9 months ago
},
},
})