packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -352,7 +352,7 @@ }) } }) // this.onCloudShoppingCart() }, // 子项勾选 checkResource(e) { @@ -384,34 +384,36 @@ }) }, // 加入购物车 async onCloudShoppingCart() { let requests = [] const item = this.data.cloudShoppingCart console.log(item, 'item'); item.forEach((items) => { if (items.saleMethod.length) { requests.push({ saleMethodId: items.saleMethod[0].Id, count: 1 }) } }) async onCloudShoppingCart(e) { let shoppingCartGetId = [] const saleMethodId = e.currentTarget.dataset.item.saleMethod[0].Id console.log(saleMethodId); let query = { remarks: '云学习', requests start: 0, size: 999, filterList: [], searchList: [] } // 查询订单 let initOrderRes = await app.MG.store.initOrder(query) let parameter = { orderNum: initOrderRes.orderNumber const res = await app.MG.store.getShoppingCartProductList(query) res.datas.forEach(item => { shoppingCartGetId.push(item.saleMethod.id) }) if (shoppingCartGetId.includes(saleMethodId)) { console.log(111); } else { let query = { requests: [{ saleMethodId: saleMethodId, storeEventId: null, // agentCode: '电子书' }] } const confirmOrderRes = await app.MG.store.confirmOrder(parameter) // if (confirmOrderRes.orderNumber) { // wx.navigateTo({ // url: `/pages/cart/paymentPage/index?orderNumber=${confirmOrderRes.orderNumber}`, // }) // requests = [] // } const addRes = await app.MG.store.addShoppingCart(query) console.log(addRes, 'addRes'); } }, }, onCheckAllChange(e) { packageBookService/pages/bookServices/detail/components/tree/index.wxml
@@ -1,175 +1,61 @@ <view class="tree"> <t-collapse default-value="{{openIds}}" bind:change="handleChange"> <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" > <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}"> <view slot="header" class="header-title"> <view class="title-checkBox"> <t-checkbox icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" bind:change="checkResourceTitle" wx:if="{{isShowCheck}}" /> <t-checkbox icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" bind:change="checkResourceTitle" wx:if="{{isShowCheck}}" /> <!-- <t-checkbox icon="rectangle" checked="{{true}}" data-item="{{item}}" bind:change="checkResourceTitle" /> --> <text>{{item.name}} </text ><text wx:if="{{item.sysType =='CmsFolder'}}" >({{item.children ? item.children.length : 0}})</text > <text>{{item.name}} </text><text wx:if="{{item.sysType =='CmsFolder'}}">({{item.children ? item.children.length : 0}})</text> </view> </view> <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex" > <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex"> <!-- // 判断 无子项 且为商品item 直接显示 --> <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}" > <view class="itemsInfo" wx:if="{{citem.name}}" data-item="{{citem}}" data-index="{{cindex}}" > <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}" > <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}"> <view class="itemsInfo" wx:if="{{citem.name}}" data-item="{{citem}}" data-index="{{cindex}}"> <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}"> <!-- 教学资源 云学习 图标 --> <view class="box-image" style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}" > <view class="box-image" style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}"> <view class="checkBox" wx:if="{{isShowCheck}}"> <!-- checked="{{citem.checked}}" --> <!-- <t-checkbox icon="rectangle" checked="{{citem.checked}}" disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" catch:change="checkResource" data-item="{{citem}}" /> --> <t-checkbox icon="rectangle" checked="{{citem.checked}}" data-item="{{citem}}" catch:change="checkResource" /> <t-checkbox icon="rectangle" checked="{{citem.checked}}" data-item="{{citem}}" catch:change="checkResource" /> </view> <!-- 教学资源图标 --> <view class="teach-icon"> <image wx:if="{{citem.selectType == 'audio' || citem.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'video' || citem.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'doc' || citem.fileMap[citem.file].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.file].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'ppt' || citem.fileMap[citem.file].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> <image wx:if="{{citem.selectType == 'audio' || citem.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'video' || citem.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'doc' || citem.fileMap[citem.file].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.file].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'ppt' || citem.fileMap[citem.file].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> </view> <!-- 云学习图标 --> <view> </view> <!-- 名称 --> <text class="name" style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}" >{{citem.name}}</text > <text class="name" style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}">{{citem.name}}</text> </view> <!-- 教学资源类型 --> <view class="teachClass"> {{citem.resourceClass}} </view> <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}" > <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}"> <!-- 下载按钮 --> <image src="/static/images/bookService/detail/download-icon.png" class="download-image" data-value="{{citem}}" catchtap="downloadTeach" ></image> <image src="/static/images/bookService/detail/download-icon.png" class="download-image" data-value="{{citem}}" catchtap="downloadTeach"></image> </view> <view wx:if="{{tab == 'jsek_cloudLearning'}}"> <!-- 云学习试看图标 --> <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}" ></image> <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}"></image> <!-- 云学习加入购物车图标 --> <image src="/static/images/bookService/detail/cart.png" wx:if="{{citem.isShopCar}}" class="shopCar" bind:tap="onCloudShoppingCart" ></image> <image src="/static/images/bookService/detail/cart.png" wx:if="{{citem.isShopCar}}" class="shopCar" data-item="{{citem}}" bind:tap="onCloudShoppingCart"></image> <!-- 云学习购买图标 --> <image bind:tap="onCloudShoppingCart" src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{citem.isbuy }}" ></image> <image src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{citem.isbuy }}"></image> </view> </view> </view> </view> <!-- // 判断 不是商品 有子项 递归组件 --> <tree wx:else isShowCheck="{{isShowCheck}}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" itemId="{{itemId}}" tab="{{tab}}" buyIds="{{buyIds}}" openTeachids="{{openTeachids}}" openLearnids="{{openLearnids}}" ></tree> <tree wx:else isShowCheck="{{isShowCheck}}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" itemId="{{itemId}}" tab="{{tab}}" buyIds="{{buyIds}}" openTeachids="{{openTeachids}}" openLearnids="{{openLearnids}}"></tree> </view> <!-- 暂无数据 --> <view wx:if="{{!item.children || !item.children.length}}" class="noData"> packageDomain/pages/resourceDetails/myAudio/index.js
@@ -44,11 +44,22 @@ speed: 1.0, myAudioPos: '' }, // 时间格式化 format(t) { let time = Math.floor(t / 60) >= 10 ? Math.floor(t / 60) : '0' + Math.floor(t / 60); t = time + ':' + ((t % 60) / 100).toFixed(2).slice(-2); return t; // // 时间格式化 // format(t) { // let time = Math.floor(t / 60) >= 10 ? Math.floor(t / 60) : '0' + Math.floor(t / 60); // t = time + ':' + ((t % 60) / 100).toFixed(2).slice(-2); // return t; // }, // 转化时间 format(time) { let minute = Math.floor(time / 60); let second = Math.floor(time % 60); minute = minute < 10 ? ("0" + minute) : minute; second = second < 10 ? ("0" + second) : second; let res = minute + ":" + second; return res; }, audio: null, // 格式化笔记时间 @@ -90,7 +101,13 @@ this.getNoteList() this.setData({ myAudioPos: '', isplay: false, //是否默认播放, myAudioCurrent: '00:00', // 当前播放进度 showData: '', }); myAudio.src = '' }, /** @@ -150,7 +167,8 @@ onTabsClick(event) { }, handleChange(e) { }, handleChange(e) { this.setData({ activeValues: e.detail.value, }); @@ -241,7 +259,10 @@ // console.log(e, 'e'); this.setData({ myAudioCurrent: '00:00', myAudioPos: '' myAudioPos: '', isplay: false }) const item = e.currentTarget.dataset.item @@ -416,7 +437,9 @@ success: (res) => { if (res.confirm) { app.MG.ugc .delTopicMessage({ messageIds }) .delTopicMessage({ messageIds }) .then((res) => { wx.showToast({ title: '删除成功', @@ -520,7 +543,6 @@ }, // 播放公共代码 pubulicPlayFun() { myAudio.src = this.data.showData console.log(myAudio.src); // 在onCanplay里获取并设置音频时长和播放进度 @@ -528,7 +550,6 @@ myAudio.duration; //必须写,不然获取不到。。。 setTimeout(() => { console.log(myAudio.duration, 'myAudio.duration'); this.setData({ myAudioDuration: this.format(myAudio.duration), myAudioCurrent: this.format(myAudio.currentTime) @@ -557,6 +578,7 @@ myAudioCurrent: this.format(myAudio.currentTime) }); }) }, packageDomain/pages/resourceDetails/myAudio/index.wxml
@@ -27,12 +27,20 @@ </view> --> <!-- 暂停播放 --> <<<<<<< Updated upstream <view class="audioIconBox color" style="margin-left: 30rpx; margin-right: 10rpx" > <view wx:if="{{!isplay}}" bind:tap="play"> <t-icon name="play-circle-stroke" size="24" /> ======= <view class="audioIconBox color" style="margin-left: 30rpx; margin-right: 10rpx;"> <view wx:if="{{!isplay}}" bind:tap='play' class="pauseCircleBox"> <!-- <t-icon name="play-circle-stroke" size="24" /> --> <image src="/static/images/resourceDetailsMyAudio/play@2x.png" mode="" /> >>>>>>> Stashed changes </view> <view wx:else bind:tap="stop" class="pauseCircleBox"> <!-- <t-icon name="pause-circle-stroke" size="24" /> --> packageDomain/pages/resourceDetails/myAudio/index.wxss
@@ -351,8 +351,8 @@ } .pauseCircleBox { width: 50rpx; height: 50rpx; width: 45rpx; height: 45rpx; } .pauseCircleBox image { packageDomain/pages/resourceDetails/myVideo/index.js
@@ -34,6 +34,8 @@ style: 'height: 248rpx', submitType: "new", // 新建 or 编辑 noteId: '', videoChange: true }, // 格式化笔记时间 convertTimestamp(timestamp) { @@ -194,6 +196,11 @@ this.data.threeLeveData.forEach((items, index) => { // 修改此处添加index参数 if (this.data.productLinkPath == items.productLinkPath) { if (!items.file) { console.log(1111); } this.setData({ showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file, titleName: items.name @@ -221,6 +228,7 @@ showData: '' }) } this.setData({ selectedId: e.currentTarget.dataset.index, }) @@ -230,9 +238,15 @@ }) if (item.selectType == "video") { // if (!item.file) { // console.log(1111); // } this.setData({ showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file }) console.log(this.data.showData, 'item.file'); } }, @@ -387,7 +401,9 @@ success: (res) => { if (res.confirm) { app.MG.ugc .delTopicMessage({ messageIds }) .delTopicMessage({ messageIds }) .then((res) => { wx.showToast({ title: '删除成功', packageDomain/pages/resourceDetails/myVideo/index.wxml
@@ -6,11 +6,13 @@ <view class="navbar-title">资源详情-视频</view> </view> <!-- 视频 --> <view class="videoBox"> <view class="videoBox" wx:if="{{videoChange}}"> <!-- autoplay='false' 是否自动播放 --> <video src="{{showData}}" play-btn-position='center' object-fit='fill' controls enable-play-gesture enable-auto-rotation></video> </view> <view wx:if="{{!videoChange}}" class="videoSubsidiaryBox"></view> <!-- 标题 --> <view class="titleBox">{{titleName}}</view> <view class="contentBox"> packageDomain/pages/resourceDetails/myVideo/index.wxss
@@ -24,6 +24,13 @@ width: 100vw; } .videoSubsidiaryBox { width: 750rpx; height: 450rpx; background-color: #000; /* 1.6 1 */ } .titleBox { margin: 30rpx; border-bottom: 1px #f4f4f4 solid; pages/cart/index.js
@@ -78,9 +78,13 @@ // console.log(item, 'item456'); item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); this.setData({ type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' }) // this.setData({ // type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' // }) const type = item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'; item.type = type; // 将type设置为item对象的属性,而不是使用setData // debugger }); pages/cart/index.wxml
@@ -17,8 +17,8 @@ <t-cell bordered="{{false}}"> <view slot="title" class="titleBox"> <view class="labelBox"> <view class="eBook" wx:if="{{type == 'product'}}">电子书</view> <view wx:if="{{type == 'item'}}" class="cloudLearning">云学习</view> <view class="eBook" wx:if="{{item.type == 'product'}}">电子书</view> <view wx:if="{{item.type == 'item'}}" class="cloudLearning">云学习</view> </view> <view class="boosName"> {{item.productMonWithLinkDto.product.name}} pages/cart/paymentPage/index.js
@@ -20,6 +20,7 @@ orderGoods: '', isPaySuccess: false, isPayComplete: false, type: '' }, /** @@ -115,14 +116,17 @@ }) res.saleMethodLinks.forEach(item => { const type = item.type == 'createProductItemSaleMethod' ? 'item' : 'product'; item.type = type; // 将type设置为item对象的属性,而不是使用setData item.paymentIcon = getPublicImage(item.orderSaleMethod.product.icon) console.log(item.orderSaleMethod.type); console.log(item.type, 'item'); }) this.setData({ productList: res.saleMethodLinks, type: item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' }) // type: item.orderSaleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' }) }) }, pages/cart/paymentPage/index.wxml
@@ -20,15 +20,15 @@ <view class="cartListContent"> <view class="cartListDetails"> <view class="labelBox"> <view class="eBook" wx:if="{{type == 'product'}}">电子书</view> <view wx:if="{{type == 'item'}}" class="cloudLearning">云学习</view> <view class="eBook" wx:if="{{item.type == 'product'}}">电子书</view> <view wx:if="{{item.type == 'item'}}" class="cloudLearning">云学习</view> </view> <view class="boosName"> {{item.orderSaleMethod.product.name}} </view> </view> <view class="textBox" wx:if="{{type == 'product'}}">图书服务-电子书</view> <view class="textBox" wx:if="{{type == 'item'}}">图书服务-云学习</view> <view class="textBox" wx:if="{{item.type == 'product'}}">图书服务-电子书</view> <view class="textBox" wx:if="{{item.type == 'item'}}">图书服务-云学习</view> <view class="priceBox">¥{{item.payPrice}}</view> </view> </view> static/images/resourceDetailsMyAudio/play@2x.png