| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options); |
| | | this.getDataList(false) |
| | | }, |
| | | |
| | |
| | | |
| | | getDataList(isReachBottom) { |
| | | var searchArr = []; |
| | | console.log(this.data.searchText, "earch") |
| | | if (this.data.searchText != undefined && this.data.searchText != "") { |
| | | searchArr.push({ |
| | | compareType: "Contains", |
| | |
| | | loading: false |
| | | }) |
| | | } else { |
| | | wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂无数据', |
| | | }) |
| | | this.setData({ |
| | | list: [], |
| | | skeletonLoding: false, |
| | | loading: false |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | onSearchOrder(e) { |
| | | console.log(e.detail.value); |
| | | this.setData({ |
| | | searchText: e.detail.value, |
| | | }) |
| | | this.getDataList(false); |
| | | }, |
| | | async goBookDetails(e) { |
| | | console.log(e.currentTarget.dataset); |
| | | const { |
| | | book, |
| | | remarks |
| | | } = e.currentTarget.dataset; |
| | | let parentData = null; |
| | | let bookId = book.orderSaleMethod.product.id; |
| | | if (remarks == null) { |
| | | parentData = await app.MG.store.getProductBySaleMethod({ |
| | | 'saleMethodId': book.orderSaleMethod.id |
| | | }) |
| | | |
| | | parentData = await app.MG.store.getProductBySaleMethod({ |
| | | 'saleMethodId': book.orderSaleMethod.id |
| | | }) |
| | | if (parentData.parentProduct.length > 0) { |
| | | bookId = parentData.parentProduct[parentData.parentProduct.length - 1].id; |
| | | } else if (remarks != null && JSON.stringify(remarks).slice(1, -1) == 'object' && JSON.parse(remarks).pId) { |
| | | bookId = JSON.parse(remarks).pId |
| | | } |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${bookId}&name=${book.name}`, |