| | |
| | | // pages/mine/mine.js |
| | | import { getMemberInfo, getDictData } from '../../api/index' |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | clientHeight: 0, |
| | | clientTop: 0, |
| | | |
| | | member: {}, |
| | | housetype: '', |
| | | IMG_LIUCHENG: '', |
| | | MINE_BG: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | const res = wx.getMenuButtonBoundingClientRect() |
| | | this.setData({clientHeight: res.height}) |
| | | this.setData({clientTop: res.top}) |
| | | |
| | | this.initData() |
| | | }, |
| | | initData() { |
| | | getMemberInfo().then(res => { |
| | | this.setData({member: res.data}) |
| | | if(res.data.housetype){ |
| | | const temp = res.data.housetype.split('-') |
| | | let houseType = { |
| | | val1: temp[0], |
| | | val2: temp[1], |
| | | val3: temp[2], |
| | | val4: temp[3], |
| | | val5: temp[4], |
| | | } |
| | | this.setData({houseType}) |
| | | } |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'IMG_LIUCHENG' |
| | | }).then(res => { |
| | | this.setData({ IMG_LIUCHENG: res.data.code }) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'MINE_BG' |
| | | }).then(res => { |
| | | this.setData({ MINE_BG: res.data.code }) |
| | | }) |
| | | }, |
| | | changePath(e) { |
| | | // 页面跳转 |
| | | let temp = ['mysub', 'collect', 'favorite', 'index'] |
| | | const index = e.currentTarget.dataset.index |
| | | if(index == '4'){ |
| | | |
| | | } |
| | | if(index == '5'){ |
| | | wx.navigateTo({ |
| | | url: `/pages/sets/index`, |
| | | }) |
| | | } |
| | | wx.navigateTo({ |
| | | url: `/pages/userinfo/${temp[index]}`, |
| | | }) |