| | |
| | | }; |
| | | app.MG.store.getProductList(obj).then((res) => { |
| | | if (res.datas && res.datas.length > 0) { |
| | | console.log(res.datas[0], 2); |
| | | this.setData({ |
| | | bookItemDetail: res.datas[0], |
| | | selectedIds: res.datas[0].defaultSaleMethod.id, |
| | |
| | | loading: false, |
| | | openTeachids: result, |
| | | }); |
| | | console.log("教学资源", list); |
| | | } else if (type.refCode == "jsek_cloudLearning") { |
| | | let arr = this.handleTreeData(list).filter( |
| | | (item) => item.saleMethod[0] |
| | |
| | | item.disabled = true; |
| | | } |
| | | } |
| | | if (item.file) { |
| | | if (item.file && item.fileMap && item.fileMap[item.file]) { |
| | | if (item.fileMap[item.file].protectType == "Private") |
| | | item.disabled = true; |
| | | } |
| | |
| | | }, |
| | | |
| | | async buyBook() { |
| | | console.log( |
| | | this.data.bookItemDetail.defaultSaleMethodId, |
| | | "this.data.bookItemDetail.defaultSaleMethodId" |
| | | ); |
| | | if (!this.data.expire) { |
| | | let bookOrdersId = ""; |
| | | let query = { |
| | |
| | | const res = await app.MG.store.initOrder(query); |
| | | // 获取订单号并赋值给 orderNumber.value |
| | | bookOrdersId = res.orderNumber; |
| | | console.log(bookOrdersId); |
| | | // 检查订单号是否存在 |
| | | if (bookOrdersId) { |
| | | if (this.data.bookDetail.price == "0.00") { |
| | |
| | | const isSHow = this.data.shoppingCartGetId.some( |
| | | (item) => item == data.saleMethod[0].Id |
| | | ); |
| | | console.log(isSHow); |
| | | return !isSHow; |
| | | }, |
| | | updateCloudLearning() { |
| | |
| | | (item) => item.refCode == "jsek_cloudLearning" |
| | | ); |
| | | this.getResourceData(checkData); |
| | | debugger; |
| | | console.log(55555); |
| | | }, |
| | | // 遍历树结构转换为数组方法 |
| | | handleTreeData(array) { |
| | |
| | | }, |
| | | }; |
| | | app.MG.store.getProductList(query).then((res) => { |
| | | console.log("完整相关图书", res.datas); |
| | | const Arr = res.datas.filter( |
| | | (item) => item.id != this.data.bookDetail.id |
| | | ); |
| | |
| | | |
| | | //申请电子样书 |
| | | appplyElectronicBook() { |
| | | console.log(this.data.bookDetail); |
| | | if ( |
| | | this.data.bookDetail.isApplyBook == 2 || |
| | | this.data.bookDetail.isApplyBook == 4 |