| | |
| | | "pages/bookServices/detail/index", |
| | | "pages/bookServices/examination/examination", |
| | | "pages/bookServices/webpage/index", |
| | | "pages/components/webView/index", |
| | | "pages/bookServices/buyResource/index", |
| | | "pages/bookServices/detail/buyResource/index" |
| | | "pages/components/webView/index" |
| | | ] |
| | | } |
| | | ], |
| | |
| | | openLearnids: [], |
| | | bookId: '', |
| | | loading: false, |
| | | shoppingList: [], |
| | | shoppingCartGetId: [], |
| | | }, |
| | | |
| | | /** |
| | |
| | | this.getResourceClass() |
| | | console.log(options); |
| | | this.getResourceData({ productLinkPath: options.productLinkPath, refCode: options.refCode }) |
| | | this.getShoppingCartProductGet() |
| | | this.getBookInfo(options.bookId) |
| | | }, |
| | | |
| | | /** |
| | |
| | | }); |
| | | |
| | | }, |
| | | // 获取已购买商品 |
| | | getShoppingCartProductGet() { |
| | | let query = { |
| | | start: 0, |
| | | size: 999, |
| | | filterList: [], |
| | | searchList: [] |
| | | } |
| | | app.MG.store.getShoppingCartProductList(query).then((res) => { |
| | | const list = [] |
| | | res.datas.forEach((item) => { |
| | | list.push(item.saleMethod.id) |
| | | }) |
| | | this.setData({ |
| | | shoppingList: res.datas, |
| | | shoppingCartGetId: list |
| | | }) |
| | | }) |
| | | }, |
| | | // 判断资源是否购买 |
| | | resourceIsBuy(data) { |
| | | if (data.saleMethod && data.saleMethod.length) { |
| | |
| | | return false |
| | | } |
| | | }, |
| | | // 判断资源加入购物车按钮是否显示 |
| | | isShoppingCart(data) { |
| | | if (data.saleMethod && data.saleMethod.length) { |
| | | if (data.saleMethod[0].Price <= 0) return false |
| | | // 再判断是否购买 |
| | | const isBuy = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id) |
| | | if (isBuy) { |
| | | // 购买了 |
| | | return false |
| | | } else { |
| | | // 判断是否加入购物车 |
| | | const isSHow = this.data.shoppingCartGetId.some((item) => item == data.saleMethod[0].Id) |
| | | return !isSHow |
| | | } |
| | | } else { |
| | | return false |
| | | } |
| | | }, |
| | | // 获取展开项 |
| | | findChildIds(data, result) { |
| | | let index = 0 |