| | |
| | | // index.js |
| | | import { getDictData, getDailyUpdates, getZSZXCatalogs } from '../../api/index' |
| | | Page({ |
| | | data: { |
| | | searchValue: '', |
| | | clientHeight: 0, |
| | | clientTop: 0, |
| | | |
| | | DailyUpdates: {}, //每日上新 |
| | | everydayTop: ['../../static/ic_top1@2x.png', '../../static/ic_top2@2x.png', '../../static/ic_top3@2x.png'], |
| | | bannerList: [ |
| | | {imgurl: ''}, |
| | | {imgurl: 'adsa.png'}, |
| | |
| | | const res = wx.getMenuButtonBoundingClientRect() |
| | | this.setData({clientHeight: res.height}) |
| | | this.setData({clientTop: res.top}) |
| | | } |
| | | |
| | | this.initData() |
| | | }, |
| | | initData() { |
| | | // 每日上新 |
| | | getDailyUpdates({ |
| | | fileType: '0' |
| | | }).then(res => { |
| | | this.setData({ DailyUpdates: res.data }) |
| | | }) |
| | | getZSZXCatalogs().then(res => { //志说装修 |
| | | this.setData({ |
| | | ZSZXCata: res.data || {} |
| | | }) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'HOME_CLASS_A' |
| | | }).then(res => { |
| | | this.setData({ HOME_CLASS_A: res.data.code }) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'HOME_CLASS_B' |
| | | }).then(res => { |
| | | this.setData({ HOME_CLASS_B: res.data.code }) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'HOME_CLASS_B2' |
| | | }).then(res => { |
| | | this.setData({ HOME_CLASS_B2: res.data.code }) |
| | | }) |
| | | getDictData({ |
| | | code: 'WEIXIN_DEFAULT_IMGS', |
| | | label: 'HOME_CLASS_C' |
| | | }).then(res => { |
| | | this.setData({ HOME_CLASS_C: res.data.code }) |
| | | }) |
| | | }, |
| | | changeStrategy(e) { |
| | | let item = e.currentTarget.dataset.item |
| | | wx.navigateTo({ |
| | | url: `/pages/homeId/index?code=${item.code}&name=${item.name}` , |
| | | }) |
| | | }, |
| | | }) |