| | |
| | | barHeight: '', |
| | | navBarHeight: '', |
| | | searchVal: '', |
| | | scoll: false, |
| | | isWhite: false, |
| | | userInfo: {}, |
| | | tabList: [], //目录 |
| | |
| | | shoppingCartGetId: [], |
| | | baseRefresh: { |
| | | value: false |
| | | } |
| | | }, |
| | | loading: true |
| | | }, |
| | | onShow() { |
| | | this.setData({ |
| | | searchVal: "", |
| | | }); |
| | | console.log(this.data.searchVal) |
| | | this.loadHomePage(); |
| | | this.getBannerList() |
| | | |
| | |
| | | const item = res.datas[i] |
| | | list.push({ |
| | | value: item.icon, |
| | | link: item.jsek_link |
| | | link: item.jsek_link, |
| | | |
| | | }) |
| | | } |
| | | this.setData({ |
| | | bannerList: list |
| | | bannerList: list, |
| | | loading: false |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | //点击目录 |
| | | toPages(item) { |
| | | let info = item.target.dataset.info |
| | | console.log(info); |
| | | if (info.url) { |
| | | if (info.text == "图书服务") { |
| | | wx.switchTab({ |
| | |
| | | |
| | | }, |
| | | |
| | | |
| | | // 监听滚动条 |
| | | onScroll(e) { |
| | | this.setData({ |
| | | isWhite: true |
| | | }) |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 20 ? true : false |
| | | // 扫一扫 |
| | | onIconScanTap() { |
| | | wx.scanCode({ |
| | | success(res) { |
| | | console.log(res); |
| | | if (res.errMsg == "scanCode:ok" && res.path) { |
| | | console.log(res.path, 2) |
| | | wx.redirectTo({ |
| | | url: '/' + res.path, |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onScrollToTop(e) { |
| | | |
| | | |
| | | // 监听滚动条 |
| | | onScroll(e) { |
| | | if (this.data.scoll) { |
| | | if (e.detail.scrollTop < 20) { |
| | | this.data.scoll = false |
| | | this.isChange(false); |
| | | } |
| | | } else { |
| | | if (e.detail.scrollTop > 20) { |
| | | this.data.scoll = true |
| | | this.isChange(true); |
| | | } |
| | | } |
| | | }, |
| | | isChange(data) { |
| | | this.setData({ |
| | | isWhite: e.detail.scrollTop > 50 ? true : false |
| | | isWhite: data |
| | | }) |
| | | }, |
| | | |