| | |
| | | } |
| | | }, |
| | | data: { |
| | | sonPurchaseSaleMethodId: '', |
| | | superiorPurchaseSaleMethodId: [], |
| | | activeValues: [1, 2], |
| | | webpageSrc: '', |
| | | cloudShoppingCart: [] |
| | |
| | | // 章节勾选 |
| | | checkResourceTitle(e) { |
| | | // 这个时候checked的值是fals |
| | | let checkResourceTitleList = [] |
| | | const item = e.currentTarget.dataset.item |
| | | // |
| | | let list = this.flattenTree([item]) |
| | | let ids = [] |
| | | list.forEach(item => { |
| | | ids.push(item.id) |
| | | }) |
| | | // console.log(list, 'list789'); |
| | | const updatedTreeList = this.findAndUpdateItemsByIds(this.properties.treeList, ids); |
| | | this.setData({ |
| | | treeList: updatedTreeList // 更新 treeList 数据 |
| | | }); |
| | | console.log(list, 'list'); |
| | | |
| | | |
| | | this.setData({ |
| | | superiorPurchaseSaleMethodId: list |
| | | }) |
| | | console.log(this.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId'); |
| | | list.forEach(items => { |
| | | console.log(items.checked, 'itesasd'); |
| | | if (!items.checked) { |
| | |
| | | // 子项勾选 |
| | | checkResource(e) { |
| | | const citem = e.currentTarget.dataset.item |
| | | console.log(e); |
| | | // console.log(e); |
| | | |
| | | |
| | | const updataList = this.checkResoucrceInfo(this.properties.treeList, citem.id) |
| | | console.log(updataList); |
| | | this.setData({ |
| | | treeList: updataList |
| | | treeList: updataList, |
| | | sonPurchaseSaleMethodId: citem.saleMethod[0].Id |
| | | }) |
| | | |
| | | }, |
| | | // 加入购物车 |
| | | async onCloudShoppingCart() { |
| | |
| | | }, |
| | | }, |
| | | onCheckAllChange(e) { |
| | | debugger |
| | | console.log('checkbox', e.detail.value); |
| | | // debugger |
| | | // console.log('checkbox', e.detail.value); |
| | | // this.setData({ |
| | | // checkAllValues: event.detail, |
| | | // }); |