| | |
| | | const util = require("./components/util"); // 引入封装过的加载提示 |
| | | import { loginInfo } from "../../../../../../assets/js/login"; |
| | | import { |
| | | loginInfo |
| | | } from "../../../../../../assets/js/login"; |
| | | const app = getApp(); |
| | | Component({ |
| | | // checked: false, |
| | |
| | | shoppingCart: true, |
| | | stop: false, |
| | | }, |
| | | ready() { |
| | | this.setData({}); |
| | | console.log("准备"); |
| | | }, |
| | | ready() {}, |
| | | |
| | | onLoad() { |
| | | this.setData({ |
| | |
| | | treeList: function (newValue) { |
| | | const list = []; |
| | | let checked = ""; |
| | | console.log("新值", this.properties.treeList); |
| | | this.properties.treeList.forEach((item) => { |
| | | if (item.children && item.children.length > 0) { |
| | | list.push(...this.flattenTree([item])); |
| | |
| | | handleList(tree) { |
| | | for (let index = 0; index < tree.length; index++) { |
| | | const item = tree[index]; |
| | | if (item.sysType == "CmsItem" && !item.checked) { |
| | | } |
| | | if (item.sysType == "CmsItem" && !item.checked) {} |
| | | if (item.children && item.children.length > 0) { |
| | | this.handleList(item.children); |
| | | } |
| | |
| | | ) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: |
| | | item.saleMethod[0].Price > 0 |
| | | ? "请先购买该资源" |
| | | : "请先点击领取查看按钮", |
| | | title: item.saleMethod[0].Price > 0 ? |
| | | "请先购买该资源" : |
| | | "请先点击领取查看按钮", |
| | | }); |
| | | } |
| | | wx.navigateTo({ |
| | |
| | | this.properties.treeList, |
| | | citem.id |
| | | ); |
| | | console.log(citem.checked, "citem.checked"); |
| | | if (!citem.checked) { |
| | | //选中的时候添加id |
| | | let sonPurchaseSaleMethodId = this.data.sonPurchaseSaleMethodId || []; |
| | | console.log(this.properties.paymentPage, "this.properties.paymentPage"); |
| | | if (this.properties.paymentPage) { |
| | | console.log(789987); |
| | | sonPurchaseSaleMethodId = []; |
| | | this.properties.paymentPage = false; |
| | | } |
| | |
| | | }); |
| | | } else { |
| | | let query = { |
| | | requests: [ |
| | | { |
| | | saleMethodId: saleMethodId, |
| | | storeEventId: null, |
| | | // agentCode: '电子书' |
| | | }, |
| | | ], |
| | | requests: [{ |
| | | saleMethodId: saleMethodId, |
| | | storeEventId: null, |
| | | // agentCode: '电子书' |
| | | }, ], |
| | | }; |
| | | const addRes = await app.MG.store.addShoppingCart(query); |
| | | console.log(addRes, "addRes"); |
| | |
| | | }, |
| | | |
| | | catchtap() {}, |
| | | }); |
| | | }); |