| | |
| | | selectAll: [], |
| | | shoppingCart: true, |
| | | stop: false, |
| | | cart: true |
| | | }, |
| | | ready() {}, |
| | | |
| | |
| | | goPlayer(e) { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | // 登录成功,自动记录token和用户信息,并返回true |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }); |
| | | } else { |
| | | if (token) { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | | let url; |
| | |
| | | }); |
| | | } |
| | | wx.navigateTo({ |
| | | url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}`, |
| | | url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}`, |
| | | }); |
| | | if (item.selectType == "document" || item.selectType == "pdf") { |
| | | const fileLink = |
| | |
| | | // 加入购物车 |
| | | async onCloudShoppingCart(e) { |
| | | let shoppingCartGetId = []; |
| | | |
| | | const item = e.currentTarget.dataset.item |
| | | console.log(item.isShopCar); |
| | | const saleMethodId = e.currentTarget.dataset.item.saleMethod[0].Id; |
| | | console.log(saleMethodId); |
| | | let query = { |
| | |
| | | }; |
| | | const addRes = await app.MG.store.addShoppingCart(query); |
| | | console.log(addRes, "addRes"); |
| | | wx.showToast({ |
| | | icon: "success", |
| | | title: "添加成功", |
| | | }); |
| | | if (addRes) { |
| | | wx.showToast({ |
| | | icon: "success", |
| | | title: "添加成功", |
| | | }); |
| | | item.isShopCar = false |
| | | this.triggerEvent("updateCloudLearning") |
| | | } |
| | | |
| | | } |
| | | }, |
| | | sadd() { |