| | |
| | | const app = getApp(); |
| | | import { loginInfo } from "../../../../assets/js/login"; |
| | | import { |
| | | loginInfo |
| | | } from "../../../../assets/js/login"; |
| | | Page({ |
| | | /** |
| | | * 页面的初始数据 |
| | |
| | | bookList: [], |
| | | stairList: { |
| | | value: "", |
| | | options: [ |
| | | { |
| | | value: "", |
| | | label: "一级", |
| | | }, |
| | | ], |
| | | options: [], |
| | | }, |
| | | secondList: { |
| | | value: [], |
| | |
| | | }, |
| | | sortList: { |
| | | value: "default", |
| | | options: [ |
| | | { |
| | | options: [{ |
| | | value: "default", |
| | | label: "默认排序", |
| | | }, |
| | |
| | | if (options.secondCode) { |
| | | this.setData({ |
| | | secondCode: options.secondCode, |
| | | pathList: [ |
| | | { |
| | | pathList: [{ |
| | | Path: options.secondCode, |
| | | Type: "*", |
| | | StoreRefCode: app.config.goodsStore, |
| | | }, |
| | | ], |
| | | }, ], |
| | | }); |
| | | } |
| | | // 获取二级分类 |
| | |
| | | }, |
| | | }; |
| | | app.MG.store.getStoreChannelList(query).then(async (res) => { |
| | | const options = [ |
| | | { |
| | | const options = [{ |
| | | value: "", |
| | | label: "一级", |
| | | }, |
| | | ]; |
| | | label: "一级分类", |
| | | }, ]; |
| | | for (let index = 0; index < res.datas.length; index++) { |
| | | const item = res.datas[index]; |
| | | options.push({ |
| | |
| | | } |
| | | const query = { |
| | | ...pathObj, |
| | | filterList: [ |
| | | { |
| | | filterList: [{ |
| | | value: "Normal", |
| | | field: "state", |
| | | }, |
| | | ], |
| | | }, ], |
| | | sort, |
| | | paging: { |
| | | start: 0, |
| | |
| | | }, |
| | | // 一级分类切换 |
| | | onChangeStair(e) { |
| | | const path = e.detail.value.length |
| | | ? `${this.data.assortCheck.code}\\${e.detail.value}` |
| | | : this.data.assortCheck.code; |
| | | const path = e.detail.value.length ? |
| | | `${this.data.assortCheck.code}\\${e.detail.value}` : |
| | | this.data.assortCheck.code; |
| | | console.log(this.data.path); |
| | | |
| | | this.setData({ |
| | |
| | | }, |
| | | // 跳转图书详情 |
| | | goDetail(e) { |
| | | const { book } = e.currentTarget.dataset; |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | }); |