| | |
| | | }); |
| | | this.getResourceClass() |
| | | console.log(options); |
| | | this.getResourceData({ productLinkPath: options.productLinkPath, refCode: options.refCode }) |
| | | this.getResourceData({ |
| | | productLinkPath: options.productLinkPath, |
| | | refCode: options.refCode |
| | | }) |
| | | this.getShoppingCartProductGet() |
| | | this.getBookInfo(options.bookId) |
| | | }, |
| | |
| | | checkAll() { |
| | | const child = this.selectComponent('#tree') |
| | | child.checkAll() |
| | | |
| | | }, |
| | | //购买按钮 |
| | | batchPurchase() { |
| | | |
| | | |
| | | |
| | | let saleMethodIds = [] |
| | | let requests = [] |
| | | let item = [] |
| | | let selectAllId = [] |
| | | const child = this.selectComponent('#tree') |
| | | |
| | | console.log(child.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId'); |
| | | console.log(child.data.sonPurchaseSaleMethodId, 'child.data'); |
| | | // console.log(child.data.selectAll, 'selectAll'); |
| | | item = child.data.superiorPurchaseSaleMethodId |
| | | const sonItem = child.data.sonPurchaseSaleMethodId |
| | | let selectAll = child.data.selectAll |
| | | if (selectAll) { |
| | | // console.log(selectAll); |
| | | selectAll.forEach(item => { |
| | | if (item.saleMethod != 0) { |
| | | // console.log(item, 'item'); |
| | | selectAllId.push(item.saleMethod[0].Id) |
| | | } |
| | | }) |
| | | console.log(selectAllId); |
| | | app.MG.store.initOrder({ |
| | | requests: selectAllId.map(id => ({ |
| | | saleMethodId: id, |
| | | count: 1, |
| | | })), |
| | | }).then(res => { |
| | | if (res) { |
| | | wx.navigateTo({ |
| | | url: '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber, |
| | | }) |
| | | selectAllId = [] |
| | | child.setData({ |
| | | selectAll: [] |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | } |
| | | if (item) { |
| | | console.log(item, 'sadsdasd'); |
| | | // 拿到id |
| | |
| | | wx.navigateTo({ |
| | | url: '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber, |
| | | }) |
| | | this.setData({ |
| | | superior: true |
| | | }) |
| | | |
| | | child.setData({ |
| | | superiorPurchaseSaleMethodId: [] // 使用setData方法清空sonPurchaseSaleMethodId数据 |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if (item.length == 0 && sonItem) { |
| | | |
| | | |
| | | app.MG.store.initOrder({ |
| | | requests: sonItem.map(id => ({ |
| | | saleMethodId: id, |
| | |
| | | this.setData({ |
| | | paymentPage: true |
| | | }) |
| | | |
| | | child.setData({ |
| | | sonPurchaseSaleMethodId: [] // 使用setData方法清空sonPurchaseSaleMethodId数据 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | import Message from 'tdesign-miniprogram/message/message'; |
| | | const util = require('./components/util') // 引入封装过的加载提示 |
| | | const app = getApp() |
| | |
| | | openIds: { |
| | | type: Array, |
| | | value: [], |
| | | } |
| | | , |
| | | }, |
| | | isShowCheck: { |
| | | type: Boolean, |
| | | value: false, |
| | |
| | | superiorPurchaseSaleMethodId: [], |
| | | activeValues: [1, 2], |
| | | webpageSrc: '', |
| | | cloudShoppingCart: [] |
| | | cloudShoppingCart: [], |
| | | selectAll: [] |
| | | }, |
| | | ready() { |
| | | this.setData({ |
| | |
| | | }) |
| | | console.log('准备'); |
| | | }, |
| | | onShow() { |
| | | debugger |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: '' |
| | | }) |
| | | }, |
| | | |
| | | onLoad() { |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: '' |
| | | sonPurchaseSaleMethodId: [] |
| | | }) |
| | | console.log(this.data.sonPurchaseSaleMethodId, 'sonPurchaseSaleMethodId789'); |
| | | }, |
| | | observers: { |
| | | 'openIds': function (newValue) { |
| | |
| | | // 拿到所有项 |
| | | getAllChildren(id) { |
| | | let result = []; |
| | | |
| | | function findChildren(item) { |
| | | if (item.id === id) { |
| | | if (item.children && item.children.length > 0) { |
| | |
| | | // 拿到当前项子项 |
| | | flattenTree(tree) { |
| | | let result = []; |
| | | |
| | | function flatten(node) { |
| | | result.push(node); |
| | | if (node.children && node.children.length > 0) { |
| | |
| | | const element = node.children[index]; |
| | | findAndUpdate(element) |
| | | } |
| | | } |
| | | else if (id == node.id && node.sysType == "CmsItem") { |
| | | } else if (id == node.id && node.sysType == "CmsItem") { |
| | | node.checked = !node.checked // 将目标项的 check 属性设置为 true |
| | | } |
| | | } |
| | |
| | | checkAll() { |
| | | const ids = [] |
| | | const list = [] |
| | | let checked = '' |
| | | this.properties.treeList.forEach(item => { |
| | | if (item.children && item.children.length > 0) { |
| | | list.push(...this.flattenTree([item])) |
| | |
| | | }) |
| | | list.forEach(item => { |
| | | ids.push(item.id) |
| | | |
| | | checked = item.checked |
| | | }) |
| | | |
| | | |
| | | const updataList = this.findAndUpdateItemsByIds(this.properties.treeList, ids); |
| | | |
| | | console.log(checked, 'list'); |
| | | if (!checked) { |
| | | this.setData({ |
| | | selectAll: list |
| | | }) |
| | | |
| | | } |
| | | |
| | | this.setData({ |
| | | treeList: updataList |
| | | }) |
| | |
| | | this.setData({ |
| | | treeList: updatedTreeList // 更新 treeList 数据 |
| | | }); |
| | | |
| | | console.log(list, 'list.checked'); |
| | | if (!list.checked) { |
| | | if (this.properties.superior) { |
| | | console.log(852); |
| | | |
| | | this.properties.superior = false |
| | | this.setData({ |
| | | superiorPurchaseSaleMethodId: [] |
| | | }) |
| | | } |
| | | if (!this.properties.superior) { |
| | | |
| | | this.setData({ |
| | | superiorPurchaseSaleMethodId: list |
| | | }) |
| | | } |
| | | |
| | | } |
| | | |
| | | // console.log(this.data.superiorPurchaseSaleMethodId, 'superiorPurchaseSaleMethodId'); |
| | |
| | | if (!this.properties.paymentPage) { |
| | | sonPurchaseSaleMethodId.push(citem.saleMethod[0].Id) |
| | | } |
| | | |
| | | |
| | | this.setData({ |
| | | sonPurchaseSaleMethodId: sonPurchaseSaleMethodId |
| | | }) |
| | | console.log(this.data.sonPurchaseSaleMethodId); |
| | | } else { |
| | | // 取消选中的时候删除id |
| | | |
| | | } |
| | | |
| | | this.setData({ |
| | | treeList: updataList, |
| | | |
| | | }) |
| | | }, |
| | | // 加入购物车 |
| | |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view class="listBox"> |
| | | |
| | | <view wx:for="{{seminarData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="listItemBox"> |
| | | <view class="listItem"> |
| | | <view wx:for="{{seminarData}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="listItemBox"> |
| | | <view class="listItem" bindtap="goSubjectDetail" data-book="{{item}}"> |
| | | <view class="specialSubject-img"> |
| | | <image src="{{item.icon}}" mode="aspectFill" class="img" /> |
| | | </view> |
| | | <view class="body-info"> |
| | | <view class="name">{{item.name}}</view> |
| | | <view class="time" wx:if="{{item.liveTime}}">直播时间:<text>{{item.liveTime}}</text></view> |
| | | <view class="time" wx:if="{{item.startTime}}">开播时间:<text>{{ item.startTime }}</text></view> |
| | | <view class="time" wx:if="{{item.liveTime}}">直播时间:{{item.liveTime}}</view> |
| | | <view class="time" wx:if="{{item.startTime}}">开播时间:{{ item.startTime }}</view> |
| | | <view class="time" wx:if="{{!item.liveTime && !item.startTime}}">开播时间:<text class="grey">待定</text></view> |
| | | <view class="flex jc-sb"> |
| | | <text class="author">{{item.lecturer}}</text> |
| | | <text class="author">{{item.lecturer}} {{item.position}}</text> |
| | | <text class="price" wx:if="{{item.price == 0}}">免费</text> |
| | | <text class="price" wx:if="{{item.price !== 0}}">¥{{item.price}}</text> |
| | | </view> |
| | |
| | | overflow: hidden; |
| | | } |
| | | |
| | | |
| | | .listBox { |
| | | padding: 20rpx 0; |
| | | display: flex; |
| | | flex-flow: row wrap; |
| | | justify-content: space-between; |
| | | margin: 20rpx; |
| | | |
| | | } |
| | | |
| | | .listBox .listItemBox { |
| | | width: 49%; |
| | | margin-bottom: 50rpx; |
| | | |
| | | } |
| | | |
| | | .listItemBox .listItem { |
| | | background: #fff; |
| | | box-sizing: border-box; |
| | | border-radius: 5px; |
| | | overflow: hidden; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | min-height: 170rpx; |
| | | } |
| | | |
| | | |
| | | .listBox .specialSubject-img { |
| | | width: 100%; |
| | | height: 120rpx; |
| | | } |
| | | |
| | | .specialSubject-img image { |
| | | width: 176.63px; |
| | | height: 109px; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .body-info { |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | min-height: 110rpx; |
| | | width: 148px; |
| | | } |
| | | |
| | | .body-info .name { |
| | | font-size: 25rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | display: -webkit-box; |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .body-info .time { |
| | | font-size: 26rpx; |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .body-info .author { |
| | | font-size: 26rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .body-info .price { |
| | | font-size: 26rpx; |
| | | color: #ff6d00; |
| | | } |
| | | |
| | | .flex { |
| | | display: flex; |
| | | } |
| | |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | margin: 15px; |
| | | |
| | | |
| | | } |
| | | |
| | | .contentBox { |
| | | width: 330rpx; |
| | | /* height: 231rpx; */ |
| | | /* border: 1px #000 solid; */ |
| | | margin: 10px 0; |
| | | background-color: #fff; |
| | | |
| | | } |
| | | |
| | | .textBox { |
| | | width: 280rpx; |
| | | /* height: 75rpx; */ |
| | | font-size: 25rpx; |
| | | |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | /* text-align: center; */ |
| | | margin: 20rpx; |
| | | |
| | | } |
| | | |
| | | .bookFairImage { |
| | |
| | | |
| | | .higherBox { |
| | | width: 220rpx; |
| | | /* height: 390rpx; */ |
| | | box-shadow: 10rpx 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.08); |
| | | margin: 30rpx 15rpx; |
| | | } |
| | | |
| | | .outsideHigherImageBox { |
| | | |
| | | position: relative; |
| | | } |
| | | |
| | |
| | | .downloadIcon { |
| | | width: 34rpx; |
| | | height: 34rpx; |
| | | |
| | | border-radius: 5rpx 5rpx 5rpx 5rpx; |
| | | background: rgba(0, 0, 0, 0.3); |
| | | position: absolute; |
| | |
| | | padding: 10rpx; |
| | | } |
| | | |
| | | |
| | | .download { |
| | | /* background-color: #8bc34a; */ |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | |
| | | |
| | | .t-tabs__item--active { |
| | | color: #FF6C00 !important; |
| | | |
| | | } |
| | | |
| | | .t-tabs__track { |
| | |
| | | } |
| | | |
| | | .noDataBox { |
| | | /* display: flex; |
| | | justify-content: center; |
| | | align-items: center */ |
| | | margin: 0 auto; |
| | | margin-top: 250rpx; |
| | | } |
| | |
| | | .tabsBox { |
| | | margin-top: 300rpx; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /* 专题 */ |
| | | .listBox { |
| | | padding: 20rpx 0; |
| | | display: flex; |
| | | flex-flow: row wrap; |
| | | justify-content: space-between; |
| | | margin: 20rpx; |
| | | } |
| | | |
| | | .listBox .listItemBox { |
| | | width: 49%; |
| | | margin-bottom: 30rpx; |
| | | } |
| | | |
| | | .listItemBox .listItem { |
| | | background: #fff; |
| | | box-sizing: border-box; |
| | | border-radius: 5px; |
| | | overflow: hidden; |
| | | box-shadow: 0px 0px 20rpx 2px #f1f1f1; |
| | | } |
| | | |
| | | .listBox .specialSubject-img { |
| | | width: 100%; |
| | | height: 120rpx; |
| | | } |
| | | |
| | | .specialSubject-img image { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .body-info { |
| | | padding: 16rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .body-info .name { |
| | | font-size: 30rpx; |
| | | height: 80rpx; |
| | | color: #333333; |
| | | font-weight: bold; |
| | | line-height: 40rpx; |
| | | display: -webkit-box; |
| | | margin-bottom: 10rpx; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .body-info .time { |
| | | font-size: 26rpx; |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .body-info .author { |
| | | font-size: 26rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | display: -webkit-box; |
| | | /* 使用弹性盒子布局模型 */ |
| | | -webkit-line-clamp: 1; |
| | | /* 控制文本的行数 */ |
| | | -webkit-box-orient: vertical; |
| | | /* 设置盒子的子元素排列方向 */ |
| | | overflow: hidden; |
| | | /* 超出部分隐藏 */ |
| | | text-overflow: ellipsis; |
| | | /* 超出部分显示省略号 */ |
| | | white-space: normal; |
| | | flex: 1; |
| | | } |
| | | |
| | | .body-info .price { |
| | | font-size: 26rpx; |
| | | color: #ff6d00; |
| | | } |