| | |
| | | import { getMemberInfo, getDictData } from '../../api/index' |
| | | import { |
| | | getMemberInfo, |
| | | getDictData |
| | | } from '../../api/index' |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | clientTop: 0, |
| | | |
| | | member: {}, |
| | | housetype: '', |
| | | houseType: {}, |
| | | IMG_LIUCHENG: '', |
| | | MINE_BG: '' |
| | | }, |
| | |
| | | */ |
| | | onLoad(options) { |
| | | const res = wx.getMenuButtonBoundingClientRect() |
| | | this.setData({clientHeight: res.height}) |
| | | this.setData({clientTop: res.top}) |
| | | this.setData({ |
| | | clientHeight: res.height |
| | | }) |
| | | this.setData({ |
| | | clientTop: res.top |
| | | }) |
| | | }, |
| | | onShow(){ |
| | | this.initData() |
| | | }, |
| | | initData() { |
| | | getMemberInfo().then(res => { |
| | | this.setData({member: res.data}) |
| | | console.log('res', res); |
| | | if (res.code == 200) { |
| | | this.setData({ |
| | | member: res.data |
| | | }) |
| | | if(res.data.housetype){ |
| | | const temp = res.data.housetype.split('-') |
| | | let houseType = { |
| | |
| | | val4: temp[3], |
| | | val5: temp[4], |
| | | } |
| | | this.setData({houseType}) |
| | | this.setData({ |
| | | houseType |
| | | }) |
| | | }else{ |
| | | this.setData({ houseType: {} }) |
| | | } |
| | | }else{ |
| | | this.setData({ member: {}, houseType: {} }) |
| | | } |
| | | |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'IMG_LIUCHENG' |
| | | }).then(res => { |
| | | this.setData({ IMG_LIUCHENG: res.data.code }) |
| | | this.setData({ |
| | | IMG_LIUCHENG: res.data.code |
| | | }) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'MINE_BG' |
| | | }).then(res => { |
| | | this.setData({ MINE_BG: res.data.code }) |
| | | this.setData({ |
| | | MINE_BG: res.data.code |
| | | }) |
| | | }) |
| | | }, |
| | | changePath(e) { |