| | |
| | | onLoad(options) { |
| | | console.log(options) |
| | | this.initDictData() |
| | | this.initData() |
| | | // this.initData() |
| | | }, |
| | | changePath(e) { |
| | | let index = e.currentTarget.dataset.type |
| | |
| | | url: '/pages/design/design' |
| | | }) |
| | | } else { |
| | | wx.setStorageSync('tempPath', '/pages/auth/auth') |
| | | wx.setStorageSync('tempPath', '/pages/design/design') |
| | | wx.navigateTo({ |
| | | url: '/pages/auth/auth', |
| | | }) |
| | |
| | | initData() { |
| | | // 轮播 |
| | | getHomeBanner().then(res => { |
| | | this.setData({ |
| | | bannerList: res.data |
| | | }) |
| | | if(res.data){ |
| | | this.setData({ bannerList: res.data }) |
| | | } |
| | | }) |
| | | // 产品视频 |
| | | getZhongTaiVideoPage({ |
| | | pageSize: 1, |
| | | pageNum: 1 |
| | | }).then(res => { |
| | | if (res.data.records && res.data.records.length > 0) { |
| | | if (res.data && res.data.records && res.data.records.length > 0) { |
| | | this.setData({ |
| | | productVideo: res.data.records |
| | | }) |
| | |
| | | pageSize: 6, |
| | | pageNum: 1 |
| | | }).then(res => { |
| | | if (res.data) { |
| | | if (res.data && res.data.records) { |
| | | this.setData({ |
| | | consultList: res.data.records |
| | | }) |
| | |
| | | }, |
| | | onPageScroll(e) { |
| | | const { videoTop, windowHeight, videoPlay } = this.data |
| | | if(e.scrollTop - 100 > videoTop - (windowHeight / 2) && videoPlay ){ |
| | | if(e.scrollTop + 100 > videoTop - (windowHeight / 2) && videoPlay ){ |
| | | this.setData({ videoPlay: false }) |
| | | let videoplay = wx.createVideoContext('myvideo', this) |
| | | videoplay.play(); |
| | | } |
| | | |
| | | let scrollTop = e.scrollTop / 100 |
| | | if (scrollTop <= 0.1) { |
| | | this.setData({ |