| | |
| | | const app = getApp(); |
| | | import { |
| | | loginInfo |
| | | } from "../../../../assets/js/login"; |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | disabledNewForms: false, |
| | | triggered: false, |
| | | backTop: "", |
| | | isshowLoading: true |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | |
| | | triggered: true, |
| | | }); |
| | | this.setData({ |
| | | isshowLoading: false, |
| | | "pageCount.page": 1, |
| | | }); |
| | | this.getBookList(this.data.path); |
| | |
| | | this.setData({ |
| | | isMore: true, |
| | | "pageCount.page": this.data.pageCount.page + 1, |
| | | isshowLoading: false |
| | | }); |
| | | this.getBookList(this.data.path); |
| | | } |
| | |
| | | return false; |
| | | } |
| | | this.setData({ |
| | | loading: true, |
| | | noData: false, |
| | | isRequesting: true, |
| | | disabledSecondList: false |
| | | }); |
| | | if (this.data.isshowLoading) { |
| | | this.setData({ |
| | | loading: true |
| | | }) |
| | | } |
| | | let sort; |
| | | let pathObj = {}; |
| | | if (this.data.pathList.length) { |
| | |
| | | }, |
| | | }; |
| | | app.MG.store.getProductList(query).then((res) => { |
| | | if (!res.datas.length && !this.data.pathList.length) { |
| | | this.setData({ |
| | | disabledSecondList: true |
| | | }) |
| | | } |
| | | this.setData({ |
| | | bookList: res.datas, |
| | | isMore: null, |
| | |
| | | "pageCount.total": res.total, |
| | | loading: false, |
| | | isRequesting: false, |
| | | isshowLoading: true |
| | | }); |
| | | if (!res.datas.length) { |
| | | this.setData({ |
| | |
| | | const path = e.detail.value.length ? |
| | | `${this.data.assortCheck.code}\\${e.detail.value}` : |
| | | this.data.assortCheck.code; |
| | | console.log(this.data.path); |
| | | |
| | | this.setData({ |
| | | backTop: "#assort-title", |
| | | pathList: [], |
| | |
| | | secondCode: "", |
| | | path: path, |
| | | "stairList.value": e.detail.value, |
| | | disabledSecondList: false |
| | | }); |
| | | |
| | | if (e.detail.value == "") { |
| | | this.setData({ |
| | | disabledSecondList: true, |
| | |
| | | this.getSecondList(path); |
| | | } |
| | | this.getBookList(path); |
| | | console.log(this.data.disabledSecondList); |
| | | }, |
| | | // 二级分类切换 |
| | | onChangeSecond(e) { |
| | |
| | | this.getBookList(this.data.path); |
| | | }, |
| | | openDropdown() { |
| | | console.log("展开哦"); |
| | | this.setData({ |
| | | showDropdown: true, |
| | | }); |
| | | }, |
| | | closeDropdown() { |
| | | console.log("关闭"); |
| | | this.setData({ |
| | | showDropdown: false, |
| | | }); |