| | |
| | | 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])); |
| | |
| | | ) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "请先购买该资源", |
| | | title: item.saleMethod[0].Price > 0 ? |
| | | "请先购买该资源" : "请先点击领取查看按钮", |
| | | }); |
| | | } |
| | | wx.navigateTo({ |
| | |
| | | // 子项勾选 |
| | | checkResource(e) { |
| | | const citem = e.currentTarget.dataset.item; |
| | | console.log(citem, "5648"); |
| | | const parent = e.currentTarget.dataset.parent |
| | | const childrenList = parent.children.filter(item => item.id !== citem.id) |
| | | const flag = childrenList.findIndex(item => item.checked == false) |
| | | const updataList = this.checkResoucrceInfo( |
| | | this.properties.treeList, |
| | | citem.id |
| | | ); |
| | | console.log(citem.checked, "citem.checked"); |
| | | if (flag == -1) { |
| | | if (citem.checked == false) { |
| | | this.findAndUpdateItemsByIds(this.properties.treeList, [parent.id], true) |
| | | } else { |
| | | this.findAndUpdateItemsByIds(this.properties.treeList, [parent.id], false) |
| | | } |
| | | } |
| | | 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; |
| | | } |
| | |
| | | } |
| | | }, |
| | | sadd() { |
| | | this.triggerEvent('updateShoppingCartHidden'); |
| | | this.triggerEvent('updateCloudLearning'); |
| | | this.triggerEvent("updateShoppingCartHidden"); |
| | | this.triggerEvent("updateCloudLearning"); |
| | | console.log(789); |
| | | }, |
| | | |
| | | }, |
| | | |
| | | |
| | | catchtap() {} |
| | | }) |
| | | catchtap() {}, |
| | | }); |