| | |
| | | this.setData({ |
| | | bookDetail: res.datas, |
| | | buyIdList: res.datas.purchasedSaleMethodIdList, |
| | | pageLoading: false |
| | | }); |
| | | if (res.datas.cmsDatas && res.datas.cmsDatas.length) { |
| | | this.setData({ |
| | |
| | | "bookDetail.paperPrice": this.numFormat( |
| | | this.data.bookDetail.paperPrice |
| | | ), |
| | | pageLoading: false, |
| | | |
| | | }); |
| | | console.log("图书信息", this.data.bookClass); |
| | | }); |
| | |
| | | }) |
| | | } else if (options && options.productId) { |
| | | this.setData({ |
| | | src: 'https://jsek.bnuic.com/bookshelf/#/bookDetail?productId=' + |
| | | src: 'http://jsysf.bnuic.com/bookshelf/#/bookDetail?productId=' + |
| | | options.productId |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | src: 'https://jsek.bnuic.com/bookshelf/#/index' |
| | | src: 'http://jsysf.bnuic.com/bookshelf/#/index' |
| | | }) |
| | | } |
| | | }, |
| | |
| | | // pages/index/bookDetail.js |
| | | import request from '../../assets/request/index' |
| | | |
| | | const app = getApp() |
| | | import { |
| | | loginInfo |
| | |
| | | |
| | | }, |
| | | getBookList() { |
| | | const obj = { |
| | | // storeInfo: app.config.jslx, |
| | | path: "*", |
| | | queryType: '*', |
| | | coverSize: { |
| | | width: 150 |
| | | }, |
| | | paging: { |
| | | start: 0, |
| | | size: 6 |
| | | }, |
| | | filterList: [{ |
| | | value: 'Normal', |
| | | field: 'state' |
| | | }], |
| | | fields: { |
| | | author: [], |
| | | let url = '/store/api/ApiQueryProductByAppUser' |
| | | let fields = { |
| | | Name: [], |
| | | 'RefCodes': [this.data.refcode] |
| | | } |
| | | let queryBook = { |
| | | AccessControl: { |
| | | Path: '*', |
| | | StoreRefCode: `defaultGoodsStore${app.config.appId}`, |
| | | Type: '*', |
| | | LinkType: '' |
| | | }, |
| | | PageQuery: { |
| | | Start: 0, |
| | | Size: 3, |
| | | }, |
| | | SortQuery: [{ |
| | | LinkOrder: 'Desc' |
| | | }], |
| | | Name: [], |
| | | RefCode: [], |
| | | ...fields |
| | | } |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | console.log(res.datas, '图书信息') |
| | | let book = res.datas[0] |
| | | let body = { |
| | | query: JSON.stringify({ |
| | | Query: [{ |
| | | queryBook: queryBook |
| | | }] |
| | | }) |
| | | } |
| | | request({ |
| | | url: url, |
| | | method: 'post', |
| | | data: body |
| | | }).then((res) => { |
| | | console.log(res[0], 'resp'); |
| | | let book = res[0].datas[0] |
| | | wx.redirectTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.datas.Name}`, |
| | | }); |
| | | }) |
| | | }, |