app.json
@@ -138,9 +138,6 @@ "permission": { "scope.userLocation": { "desc": "你的位置信息将用于小程序位置接口的效果展示" }, "clipboard": { "desc": "用于复制内容到剪贴板" } } } packageBookService/pages/bookServices/detail/buyResource/index.js
@@ -209,32 +209,50 @@ return flattenedArray; }, // 递归树结构,如果父级有销售方式(有效期),去掉所有子集的销售方式 clearTreeSealmethod(clearSaleMethod, tree) { clearTreeSealmethod(tree, data, parent) { for (let item of tree) { const saleData = item.saleMethod && item.saleMethod.length ? item.saleMethod.find((citem) => citem.SaleType == 'Normal') : null if ( ((saleData && new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime()) || clearSaleMethod) && item.children && item.children.length ) { item.children.forEach((ditem) => (ditem.saleMethod = [])) // 是否显示按钮 item.isShowIcon = false; if (item.sysType == 'CmsItem') { // 查找目录下资源销售方式,目录下资源没有销售方式 if (item.saleMethod?.length == 0) { // 查看其父级是否有销售方式 if (parent.saleMethod?.length > 0) { // 父级是有销售方式直接显示按钮 // const index = data.findIndex(i => i.id == parent.id) parent.isShowIcon = true } // else { // // 父级没有销售方式,查找该资源父级 // const arr = parent.productLinkPath.split('\\') // const linkData = arr[arr.length - 1] // arr[arr.length - 1] 排除自己 // linkData.reverse() // const dataList = linkData.map(ritem => { // const parentData = data.find(citem => citem.id == ritem); // if (parentData) return parentData; // }) // if (dataList?.length > 0) { // const index = data.findIndex(i => i.id == dataList[0].id) // data[index].isShowIcon = true // } // } } else { item.isShowIcon = true } } else { this.clearTreeSealmethod(item.children, data, item) } if (item.children && item.children.length) this.clearTreeSealmethod( saleData && new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime(), item.children ) } return tree }, // 勾选禁用 handleTreeCheck(tree) { for (const item of tree) { const isbuy = this.resourceIsBuy(item) const saleData = item.saleMethod && item.saleMethod.length ? item.saleMethod.find((citem) => citem.SaleType == 'Normal') : undefined if (saleData && new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime()) { if (saleData && new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime() && !isbuy && item.isShowIcon) { item.disabled = false } else { item.disabled = true @@ -280,6 +298,9 @@ loading: false, }); } this.setData({ cacheData: res.datas.cmsDatas[0].datas }) let list = [] res.datas.cmsDatas[0].datas.forEach((item) => { item.checked = false; @@ -292,13 +313,13 @@ this.getTreeList(res.datas.cmsDatas[0].datas, list, query.cmsPath) list = this.ensureTreeConsistency(list) list = this.changeResourceChildren(list) list = this.clearTreeSealmethod(false, list) list = this.clearTreeSealmethod(list, list, null) list = this.handleTreeCheck(list) this.handleTreeData(list).forEach(item => { item.isbuy = this.resourceIsBuy(item); item.isShopCar = this.isShoppingCart(item); }) console.log('修改后云', list); // console.log('修改后云', list); let result = []; let arr = res.datas.cmsDatas[0].datas.filter( (item) => item.saleMethod[0] @@ -385,28 +406,55 @@ }, // 判断资源是否购买 resourceIsBuy(data) { if (data.saleMethod && data.saleMethod.length) { const saleData = data.saleMethod.find((item) => item.SaleType == 'Normal') if (saleData.State == 'Disable') return false const isShow = this.data.buyIdList.some( (item) => item == saleData.Id ); // 已经购买 if (isShow) return false // 未购买,查看销售方式是否过期 if (!isShow) { const flag = new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime() if (flag) { // 为过期 ,需要购买 return true } else { // 已过期 无需购买 return false // if (data.saleMethod && data.saleMethod.length) { // const saleData = data.saleMethod.find((item) => item.SaleType == 'Normal') // if (saleData.State == 'Disable') return false // const isShow = this.data.buyIdList.some( // (item) => item == saleData.Id // ); // // 已经购买 // if (isShow) return false // // 未购买,查看销售方式是否过期 // if (!isShow) { // const flag = new Date(saleData.EndDate).getTime() >= new Date().getTime() && // new Date(saleData.BeginDate).getTime() <= new Date().getTime() // if (flag) { // // 为过期 ,需要购买 // return true // } else { // // 已过期 无需购买 // return false // } // } // } else { // return false; // } let linkData = data.productLinkPath.split("\\"); linkData.reverse() let dataList = linkData.map(item => { let data = this.data.cacheData.find(citem => citem.id == item); if (data) return data; }) let isBuy = 1; for (let i = 0; i < dataList.length; i++) { const dataItem = dataList[i]; if (dataItem) { if (dataItem.saleMethod.length > 0) { isBuy = 2; if (this.data.bookDetail.purchasedSaleMethodIdList.indexOf(dataItem.saleMethod[0].Id) > -1 || dataItem.saleMethod[0].Price == 0) { isBuy = 3; break; } else { break; } } } } if (isBuy == 2) { // 未购买 return false } else { return false; return true } }, packageBookService/pages/bookServices/detail/buyResource/index.wxml
@@ -7,11 +7,7 @@ <view class="flex"> <view class="back-icon"> <!-- <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> --> <image src="/static/images/digitalTextbooks/chevron-left.png" bind:tap="goBack" mode="aspectFit" /> <image src="/static/images/digitalTextbooks/chevron-left.png" bind:tap="goBack" mode="aspectFit" /> </view> <view class="navbar-title">资源购买</view> </view> @@ -21,36 +17,16 @@ <!-- 内容 --> <view class="buy-resource" wx:if="{{!loading}}"> <tree id="tree" paymentPage="{{paymentPage}}" superior="{{superior}}" treeList="{{learn}}" learnList="{{learn}}" tab="{{'jsek_cloudLearning'}}" isShowCheck="{{true}}" openIds="{{openLearnids}}" checkAllState="{{checkAllState}}" bind:changeCheckAll="changeCheckAll" bind:changeListChecked="changeListChecked" bind:changeResourceChecked="changeResourceChecked" bind:updateCloudLearning="updateCloudLearning" /> <tree id="tree" paymentPage="{{paymentPage}}" superior="{{superior}}" treeList="{{learn}}" learnList="{{learn}}" tab="{{'jsek_cloudLearning'}}" isShowCheck="{{true}}" openIds="{{openLearnids}}" checkAllState="{{checkAllState}}" bind:changeCheckAll="changeCheckAll" bind:changeListChecked="changeListChecked" bind:changeResourceChecked="changeResourceChecked" bind:updateCloudLearning="updateCloudLearning" /> <view class="noData" wx:if="{{noData}}"> <!-- <t-empty icon="folder-open" description="暂无数据" /> --> <empty /> </view> </view> <view class="page-bottom"> <t-button theme="primary" size="large" class="btn-buy" bindtap="batchPurchase" >批量购买</t-button > <t-button theme="primary" size="large" class="btn-buy" bindtap="batchPurchase">批量购买</t-button> </view> </view> <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> <template is="skeleton" wx:if="{{loading}}" /> packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -142,7 +142,7 @@ this.properties.bookInfo.rootCmsItemId }&idPathList=${JSON.stringify(idPathList)}&answerTitle=${ value.name }&answerType=option&storeInfo=${this.properties.storeInfo}&jslx=${this.properties.jslx}`, }&answerType=${value.refCode || 'option'}&storeInfo=${this.properties.storeInfo}&jslx=${this.properties.jslx}`, }); } }, packageBookService/pages/bookServices/detail/components/testResource/testResource.wxml
@@ -2,57 +2,29 @@ <view class="test-resource"> <view class="top-btn"> <view class="test-radio"> <view class="test-btn card {{radioItem == 'test' ? 'card--active' : ''}}" bind:tap="testBtn" > <view class="test-btn card {{radioItem == 'test' ? 'card--active' : ''}}" bind:tap="testBtn"> <view class="image-box"> <image class="test-icon" src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}" mode="aspectFit" ></image> <image class="test-icon" src="{{ radioItem == 'test' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}" mode="aspectFit"></image> </view> <view class="btn-content-text">练习</view> </view> <view class="test-btn card {{radioItem == 'mock' ? 'card--active' : ''}}" bind:tap="mockBtn" > <view class="test-btn card {{radioItem == 'mock' ? 'card--active' : ''}}" bind:tap="mockBtn"> <view class="image-box"> <image src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}" ></image> <image src="{{ radioItem == 'mock' ? '/static/images/bookService/detail/checkpaper.png' : '/static/images/bookService/detail/zujuan.png'}}"></image> </view> <view class="btn-content-text">组卷</view> </view> </view> <view class="btn-box"> <t-button class="error-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="goMycollect" data-answerType="errorQuestion" > <t-button class="error-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="goMycollect" data-answerType="errorQuestion"> <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/cuoti.png"></image> <text class="primary-color">我的错题</text> </view> </t-button> <t-button class="collect-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="goMycollect" data-answerType="collectQuestion" > <t-button class="collect-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="goMycollect" data-answerType="collectQuestion"> <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/wodeshoucang.png" ></image> <image src="/static/images/bookService/detail/wodeshoucang.png"></image> <text class="primary-color"> 我的收藏</text> </view> </t-button> @@ -70,51 +42,23 @@ </view> --> <!-- 练习列表树结构 --> <view wx:if="{{radioItem == 'test'}}"> <view class="buy-question-btn" wx:if="{{!isBuyBank}}"> <t-button wx:if="{{!isShoppingBank}}" class="error-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="handleShoppingBank" data-answerType="errorQuestion" > <view class="buy-question-btn" wx:if="{{!isBuyBank && !bookInfo.IsTextbook}}"> <t-button wx:if="{{!isShoppingBank}}" class="error-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="handleShoppingBank" data-answerType="errorQuestion"> <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/cart.png" /> <text class="primary-color">加入购物车</text> </view> </t-button> <t-button class="error-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="buyBank" data-answerType="errorQuestion" > <t-button class="error-btn" theme="default" size="medium" style="padding: 0 12rpx" bind:tap="buyBank" data-answerType="errorQuestion"> <view slot="content" class="btn-content"> <image src="/static/images/bookService/detail/yijiangoumai.png" /> <text class="primary-color" >{{bankSaleData.Price > 0 ? "全部购买" : "免费领取"}}</text > <text class="primary-color">{{bankSaleData.Price > 0 ? "全部购买" : "免费领取"}}</text> </view> </t-button> </view> <tree id="test-tree" openIds="{{openIds}}" bookInfo="{{bookInfo}}" tab="{{tab}}" treeList="{{list}}" bind:goTest="goTest" ></tree> <tree id="test-tree" openIds="{{openIds}}" bookInfo="{{bookInfo}}" tab="{{tab}}" treeList="{{list}}" bind:goTest="goTest"></tree> </view> <view wx:if="{{noResources}}" class="noData" wx:if="{{radioItem == 'test' && !list.length}}" > <view wx:if="{{noResources}}" class="noData" wx:if="{{radioItem == 'test' && !list.length}}"> <!-- <t-empty icon="folder-open" description="暂无数据" /> --> <empty /> </view> @@ -127,49 +71,29 @@ <t-button class="buy-mock-btn" bind:tap="buyMock">购买组卷</t-button> </view> <view class="mock-list" wx:if="{{mockData.mockList.length}}"> <view class="mock-list-box" wx:for="{{mockData.mockList}}" wx:key="id" data-item="{{item}}" bind:tap="goMackPaper" > <view class="mock-list-box" wx:for="{{mockData.mockList}}" wx:key="id" data-item="{{item}}" bind:tap="goMackPaper"> <view class="mock-title">{{item.name}}</view> <view class="mock-message"> <view class="message-box"> <view class="mack-state"> <text wx:if="{{item.state == '3'}}" class="complete state-pad" >已完成</text > <text wx:elif="{{item.state == '2' || item.state == '1'}}" class="Incomplete state-pad" >未完成</text > <text wx:if="{{item.state == '3'}}" class="complete state-pad">已完成</text> <text wx:elif="{{item.state == '2' || item.state == '1'}}" class="Incomplete state-pad">未完成</text> <text wx:else class="Incomplete state-pad">未开始</text> </view> <view class="mock-time">{{item.createDate}}</view> </view> <view class="mock-score" wx:if="{{item.state == '3'}}" >{{item.report.userScore}}分</view > <view class="mock-score" wx:if="{{item.state == '3'}}">{{item.report.userScore}}分</view> </view> </view> </view> <view wx:else class="not-mock"> <image src="/static/images/bookService/examination/zhuangtai-icon.png" ></image> <view class="not-mock-message note-mock-text" >组卷是收费功能,请购买后使用!</view > <view class="note-mock-price note-mock-text" >价格:<text class="mock-price">¥{{mockData.price}}</text> 元/次</view > <image src="/static/images/bookService/examination/zhuangtai-icon.png"></image> <view class="not-mock-message note-mock-text">组卷是收费功能,请购买后使用!</view> <view class="note-mock-price note-mock-text">价格:<text class="mock-price">¥{{mockData.price}}</text> 元/次</view> <t-button class="buy-mock-btn" bind:tap="buyMock">购买组卷</t-button> </view> </view> <view class="loading-box" wx:if="{{}}"> <t-loading loading="{{}}" /> </view> </view> </view> packageBookService/pages/bookServices/detail/components/testTree/index.wxml
@@ -7,7 +7,7 @@ <view class="box-image fl-cn" style="width: 80%"> <!-- 测试题 --> <view class="teach-icon fl-cn"> <image src="/static/images/bookService/detail/test-icon.png" mode="" class="test-icon"/> <image src="/static/images/bookService/detail/test-icon.png" mode="" class="test-icon" /> </view> <!-- 名称 --> <text class="name" style="width: 100%">{{item.name || '-'}}</text> packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -109,6 +109,7 @@ } }); const flag = list.findIndex((item) => item.checked == true); console.log(this.properties.treeList) }, }, methods: { @@ -221,6 +222,7 @@ // 跳转音视频播放器 goPlayer(e) { // 检查登录状态 // if (this.properties.bookInfo.IsTextbook) return const goPlayerFun = async () => { const item = e.currentTarget.dataset.item; const parent = e.currentTarget.dataset.parent; @@ -316,7 +318,7 @@ } wx.navigateTo({ url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, // url: '/packageDomain/pages/resourceDetails/myVideo/index?formPath=jsek_cloudLearning&parentName=gggg&cmsId=137103&productLinkPath=137103\\137105\\159492&activeId=159492&parentProductLinkPath=137105&source=qrcode&bookName=fffff&bookId=6745' // url: '/packageDomain/pages/resourceDetails/myVideo/index?formPath=jsek_cloudLearning&parentName=YDHYD&cmsId=161974&productLinkPath=161974\\161976\\162006&activeId=162006&parentProductLinkPath=161976&source=qrcode&bookName=fffff&bookId=7136' }); } const token = wx.getStorageSync(app.config.tokenKey); @@ -358,8 +360,10 @@ // 拿到当前项子项 flattenTree(tree) { let result = []; let that = this function flatten(node) { result.push(node); if (node.children && node.children.length > 0) { node.children.forEach((child) => { packageBookService/pages/bookServices/detail/components/tree/index.wxml
@@ -1,92 +1,27 @@ <view class="tree"> <t-collapse default-value="{{openIds}}" catchchange="handleChange"> <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{item.sysType== 'CmsItem' }}" > <view class="listItems {{'cms-' + item.id}}" wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}" > <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{item.sysType== 'CmsItem' }}"> <view class="listItems {{'cms-' + item.id}}" wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}"> <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}"> <view class="contentBox" bind:tap="goPlayer" data-item="{{item}}" data-parent="{{''}}" > <view class="contentBox" bind:tap="goPlayer" data-item="{{item}}" data-parent="{{''}}"> <!-- 教学资源 云学习 图标 --> <view class="box-image fl-cn" style="width: 80%"> <view class="checkBox" wx:if="{{isShowCheck}}" catchtap="catchTap" > <t-checkbox disabled="{{item.disabled}}" icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" data-parent="{{item}}" catch:change="checkResource" /> <view class="checkBox" wx:if="{{isShowCheck}}" catchtap="catchTap"> <t-checkbox disabled="{{item.disabled}}" icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" data-parent="{{item}}" catch:change="checkResource" /> </view> <!-- 教学资源图标 --> <view class="teach-icon fl-cn"> <image wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'pdf' || item.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'webpage' || item.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'picture' || item.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'zip' || item.learnSelectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'doc' || item.fileMap[item.file].extension == 'docx' || item.fileMap[item.freeFile].extension == 'doc' || item.fileMap[item.freeFile].extension == 'docx' || item.fileMap[item.protectedFile].extension == 'doc' || item.fileMap[item.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'xls' || item.fileMap[item.file].extension == 'xlsx' || item.fileMap[item.freeFile].extension == 'xls' || item.fileMap[item.freeFile].extension == 'xlsx' || item.fileMap[item.protectedFile].extension == 'xls' || item.fileMap[item.protectedFile].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'ppt' || item.fileMap[item.file].extension == 'pptx' || item.fileMap[item.freeFile].extension == 'ppt' || item.fileMap[item.freeFile].extension == 'pptx' || item.fileMap[item.protectedFile].extension == 'ppt' || item.fileMap[item.protectedFile].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> <image wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'pdf' || item.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'webpage' || item.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'picture' || item.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'zip' || item.learnSelectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'doc' || item.fileMap[item.file].extension == 'docx' || item.fileMap[item.freeFile].extension == 'doc' || item.fileMap[item.freeFile].extension == 'docx' || item.fileMap[item.protectedFile].extension == 'doc' || item.fileMap[item.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'xls' || item.fileMap[item.file].extension == 'xlsx' || item.fileMap[item.freeFile].extension == 'xls' || item.fileMap[item.freeFile].extension == 'xlsx' || item.fileMap[item.protectedFile].extension == 'xls' || item.fileMap[item.protectedFile].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'ppt' || item.fileMap[item.file].extension == 'pptx' || item.fileMap[item.freeFile].extension == 'ppt' || item.fileMap[item.freeFile].extension == 'pptx' || item.fileMap[item.protectedFile].extension == 'ppt' || item.fileMap[item.protectedFile].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> <!-- 资源无文件内容图标 --> <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> </view> <!-- 名称 --> <text class="name" style="width: 100%">{{item.name || '-'}}</text> @@ -104,49 +39,20 @@ </view> <view wx:if="{{tab == 'jsek_cloudLearning'}}"> <!-- 云学习试看图标 --> <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!item.isbuy ? false : item.freeFile ? true : false}}" ></image> <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!item.isbuy ? false : item.freeFile ? true : false}}"></image> <!-- 云学习加入购物车图标 --> <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{item.isShopCar}}" class="shopCar" data-item="{{item}}" catch:tap="onCloudShoppingCart" ></image> <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{item.isShopCar && !bookInfo.IsTextbook}}" class="shopCar" data-item="{{item}}" catch:tap="onCloudShoppingCart"></image> <!-- 云学习购买图标 --> <image src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{item.isbuy }}" ></image> <image src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{item.isbuy && !bookInfo.IsTextbook }}"></image> </view> </view> </view> </view> </view> <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.sysType == 'CmsFolder' }}" > <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.sysType == 'CmsFolder' }}"> <view slot="header" class=" {{'cms-' + item.id}} header-title"> <view class="title-checkBox" catchtap="catchTap"> <t-checkbox style="align-items: center" icon="rectangle" disabled="{{item.disabled}}" checked="{{item.checked}}" data-item="{{item}}" catchchange="checkResourceTitle" wx:if="{{isShowCheck}}" /> <t-checkbox style="align-items: center" icon="rectangle" disabled="{{item.disabled}}" checked="{{item.checked}}" data-item="{{item}}" catchchange="checkResourceTitle" wx:if="{{isShowCheck}}" /> <!-- 章节名 --> <view class="title-box"> <view class="title-t"> @@ -157,166 +63,57 @@ </view> <view class="title-icon"> <!-- 云学习加入购物车图标 --> <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{item.isShopCar}}" class="shopCar" data-item="{{item}}" catch:tap="onCloudShoppingCart" ></image> <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{item.isShopCar && !bookInfo.IsTextbook && item.isShowIcon}}" class="shopCar" data-item="{{item}}" catch:tap="onCloudShoppingCart"></image> <!-- 云学习购买图标 --> <image src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{item.isbuy }}" ></image> <image src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{!item.isbuy && !bookInfo.IsTextbook && item.isShowIcon }}"></image> </view> </view> </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 {{'cms-' + citem.id}}" wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}" > <view class="listItems {{'cms-' + citem.id}}" wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}"> <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}"> <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}" > <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}"> <!-- 教学资源 图标 --> <view class="box-image fl-cn"> <view class="checkBox" wx:if="{{isShowCheck}}" catchtap="catchTap" > <t-checkbox disabled="{{citem.disabled}}" icon="rectangle" checked="{{citem.checked}}" data-item="{{citem}}" data-parent="{{item}}" catch:change="checkResource" /> <view class="checkBox" wx:if="{{isShowCheck}}" catchtap="catchTap"> <t-checkbox disabled="{{citem.disabled}}" icon="rectangle" checked="{{citem.checked}}" data-item="{{citem}}" data-parent="{{item}}" catch:change="checkResource" /> </view> <!-- 教学资源图标 --> <view class="teach-icon fl-cn"> <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' || citem.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'webpage' || citem.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'picture' || citem.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'zip' || citem.learnSelectType == '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' || citem.fileMap[citem.freeFile].extension == 'doc' || citem.fileMap[citem.freeFile].extension == 'docx' || citem.fileMap[citem.protectedFile].extension == 'doc' || citem.fileMap[citem.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'xls' || citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.freeFile].extension == 'xls' || citem.fileMap[citem.freeFile].extension == 'xlsx' || citem.fileMap[citem.protectedFile].extension == 'xls' || citem.fileMap[citem.protectedFile].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' || citem.fileMap[citem.freeFile].extension == 'ppt' || citem.fileMap[citem.freeFile].extension == 'pptx' || citem.fileMap[citem.protectedFile].extension == 'ppt' || citem.fileMap[citem.protectedFile].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' || citem.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'webpage' || citem.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'picture' || citem.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'zip' || citem.learnSelectType == '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' || citem.fileMap[citem.freeFile].extension == 'doc' || citem.fileMap[citem.freeFile].extension == 'docx' || citem.fileMap[citem.protectedFile].extension == 'doc' || citem.fileMap[citem.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'xls' || citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.freeFile].extension == 'xls' || citem.fileMap[citem.freeFile].extension == 'xlsx' || citem.fileMap[citem.protectedFile].extension == 'xls' || citem.fileMap[citem.protectedFile].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' || citem.fileMap[citem.freeFile].extension == 'ppt' || citem.fileMap[citem.freeFile].extension == 'pptx' || citem.fileMap[citem.protectedFile].extension == 'ppt' || citem.fileMap[citem.protectedFile].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> <!-- 资源无文件内容图标 --> <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> </view> <!-- 名称 --> <text class="name" style="{{ tab == 'jsek_teachingResources' ? citem.resourceClass ? 'width: 400rpx' : 'width: 420rpx;' : (citem.isShopCar &&citem.isbuy ) ? 'width: 300rpx;' : (citem.isShopCar ||citem.isbuy) ? 'width:360rpx' : 'width:420rpx'}}" >{{citem.name || '-'}}</text > <text class="name" style="{{ tab == 'jsek_teachingResources' ? citem.resourceClass ? 'width: 400rpx' : 'width: 420rpx;' : (citem.isShopCar && citem.isbuy ) ? 'width: 300rpx;' : (citem.isShopCar || citem.isbuy) ? 'width:360rpx' : 'width:420rpx'}}">{{citem.name || '-'}}</text> </view> <!-- 教学资源类型 --> <view class="teachClass fl-cn" wx:if="{{citem.resourceClass && tab == 'jsek_teachingResources'}}" > <view class="teachClass fl-cn" wx:if="{{citem.resourceClass && tab == 'jsek_teachingResources'}}"> {{citem.resourceClass}} </view> <view wx:if="{{tab == 'jsek_cloudLearning'}}" class="clound-icon"> <!-- 云学习试看图标 --> <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 && citem.freeFile && citem.isShowIcon}}"></image> <!-- 云学习加入购物车图标 --> <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{citem.isShopCar}}" class="shopCar" data-item="{{citem}}" catch:tap="onCloudShoppingCart" ></image> <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{citem.isShopCar && !bookInfo.IsTextbook && citem.isShowIcon}}" class="shopCar" data-item="{{citem}}" catch:tap="onCloudShoppingCart"></image> <!-- 云学习购买图标 --> <image 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 && !bookInfo.IsTextbook && citem.isShowIcon}}"></image> </view> </view> </view> </view> <!-- // 判断 不是商品 有子项 递归组件 --> <tree wx:if="{{ citem.sysType == 'CmsFolder' }}" isShowCheck="{{isShowCheck}}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" learnList="{{learnList}}" itemId="{{itemId}}" tab="{{tab}}" buyIds="{{buyIds}}" openIds="{{openIds}}" learnMenu="{{learnMenu}}" activeId="{{activeId}}" isCloundHaveSaleMethod="{{isCloundHaveSaleMethod}}" ></tree> <tree wx:if="{{ citem.sysType == 'CmsFolder' }}" isShowCheck="{{isShowCheck}}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" learnList="{{learnList}}" itemId="{{itemId}}" tab="{{tab}}" buyIds="{{buyIds}}" openIds="{{openIds}}" learnMenu="{{learnMenu}}" activeId="{{activeId}}" isCloundHaveSaleMethod="{{isCloundHaveSaleMethod}}"></tree> </view> <!-- 暂无数据 --> <view wx:if="{{!item.children || !item.children.length}}" class="noData"> @@ -334,4 +131,4 @@ </view> <web-view wx:if="{{webpageSrc}}" src="{{webpageSrc}}"></web-view> <!-- <button bind:tap="sadd"> 65498</button> --> <!-- <button bind:tap="sadd"> 65498</button> --> packageBookService/pages/bookServices/detail/index.js
@@ -216,7 +216,8 @@ scrollTop: 0, // 扫码进资源滚动 source: '', activeId: '', qrTabValue: '' qrTabValue: '', cacheData: [], // 云学习初始数据 }, // 扫码到资源列表,滚动到该资源位置 handleScrollTop(e) { @@ -459,9 +460,11 @@ freeEpubPage: [], //epub试读百分比 bookEditor: [], //图书编辑 contactInformation: [], //联系方式 IsTextbook: [] // 是否为教材 如果是教材禁止显示所有购买按钮 }, }; app.MG.store.getProductDetail(query).then(async (res) => { res.datas.IsTextbook = res.datas.IsTextbook == '1' ? true : false this.getResourceCode(id, res.datas.rootCmsItemId) res.datas.bookEditor = res.datas.bookEditor ? res.datas.bookEditor : '-' res.datas.contactInformation = res.datas.contactInformation ? res.datas.contactInformation : '-' @@ -990,23 +993,40 @@ // 返回更新后的数组 return array; }, // 递归树结构,如果父级有销售方式(有效期),去掉所有子集的销售方式 clearTreeSealmethod(clearSaleMethod, tree) { // 递归树结构 handleSalmethodBtn(tree, data, parent) { for (let item of tree) { const saleData = item.saleMethod && item.saleMethod.length ? item.saleMethod.find((citem) => citem.SaleType == 'Normal') : null if ( ((saleData && new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime()) || clearSaleMethod) && item.children && item.children.length ) { item.children.forEach((ditem) => (ditem.saleMethod = [])) // 是否显示按钮 item.isShowIcon = false; if (item.sysType == 'CmsItem') { // 查找目录下资源销售方式,目录下资源没有销售方式 if (item.saleMethod?.length == 0) { // 查看其父级是否有销售方式 if (parent.saleMethod?.length > 0) { // 父级是有销售方式直接显示按钮 // const index = data.findIndex(i => i.id == parent.id) parent.isShowIcon = true } // else { // // 父级没有销售方式,查找该资源父级 // const arr = parent.productLinkPath.split('\\') // const linkData = arr[arr.length - 1] // arr[arr.length - 1] 排除自己 // linkData.reverse() // const dataList = linkData.map(ritem => { // const parentData = data.find(citem => citem.id == ritem); // if (parentData) return parentData; // }) // if (dataList?.length > 0) { // const index = data.findIndex(i => i.id == dataList[0].id) // data[index].isShowIcon = true // } // } } else { item.isShowIcon = true } } else { this.handleSalmethodBtn(item.children, data, item) } if (item.children && item.children.length) this.clearTreeSealmethod( saleData && new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime(), item.children ) } return tree }, @@ -1047,6 +1067,9 @@ loading: false, }); } this.setData({ cacheData: res.datas.cmsDatas[0].datas }) let list = [] // 判断云学习有无销售方式和有效期 const cloundSaleMethod = @@ -1111,8 +1134,8 @@ teach: list, }); } else if (type.refCode == "jsek_cloudLearning") { // 云学习上无销售方式,走目录 资源 销售方式去除方法 if (!flags) list = this.clearTreeSealmethod(false, list) // 控制按钮显示 list = this.handleSalmethodBtn(list, list, null) // 判断领取查看是否显示(云学习,或资源目录,有售价为0) let isshowDrawBtn = res.datas.cmsDatas[0].datas.some( (item) => @@ -1122,12 +1145,12 @@ new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime() ) || (flags && cloundSaleMethod.Price == 0) // 判断云学习全部购买按钮是否显示 let isShowBuyCloundMenu = flags && cloundSaleMethod.Price > 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id) let isShowBuyCloundMenu = flags && cloundSaleMethod.Price > 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id) && !this.data.bookDetail.IsTextbook // 判断资源购买按钮是否显示 (云学习无销售方式,资源和目录中有销售方式,且售价大于0) let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(item => item.saleMethod.length && item.saleMethod.find((citem) => citem.SaleType == 'Normal').Price > 0 && new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').EndDate).getTime() >= new Date().getTime() && new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime()) new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime()) && !this.data.bookDetail.IsTextbook // 判断购物车按钮和锁按钮是否显示 this.handleTreeData(list).forEach(item => { item.isbuy = this.resourceIsBuy(item); @@ -1149,7 +1172,6 @@ learnPath: type.productLinkPath }); } console.log('1', result); }) }, // 获取 云测试 @@ -1715,28 +1737,55 @@ }, // 判断资源是否购买 resourceIsBuy(data) { if (data.saleMethod && data.saleMethod.length) { const saleData = data.saleMethod.find((item) => item.SaleType == 'Normal') if (saleData.State == 'Disable') return false const isShow = this.data.buyIdList.some( (item) => item == saleData.Id ); // 已经购买 if (isShow || saleData.Price == 0) return false // 未购买,查看销售方式是否过期 if (!isShow) { const flag = new Date(saleData.EndDate).getTime() >= new Date().getTime() && new Date(saleData.BeginDate).getTime() <= new Date().getTime() if (flag) { // 为过期 ,需要购买 return true } else { // 已过期 无需购买 return false // if (data.saleMethod && data.saleMethod.length) { // const saleData = data.saleMethod.find((item) => item.SaleType == 'Normal') // if (saleData.State == 'Disable') return false // const isShow = this.data.buyIdList.some( // (item) => item == saleData.Id // ); // // 已经购买 // if (isShow || saleData.Price == 0) return false // // 未购买,查看销售方式是否过期 // if (!isShow) { // const flag = new Date(saleData.EndDate).getTime() >= new Date().getTime() && // new Date(saleData.BeginDate).getTime() <= new Date().getTime() // if (flag) { // // 为过期 ,需要购买 // return true // } else { // // 已过期 无需购买 // return false // } // } // } else { // return false; // } let linkData = data.productLinkPath.split("\\"); linkData.reverse() let dataList = linkData.map(item => { let data = this.data.cacheData.find(citem => citem.id == item); if (data) return data; }) let isBuy = 1; for (let i = 0; i < dataList.length; i++) { const dataItem = dataList[i]; if (dataItem) { if (dataItem.saleMethod.length > 0) { isBuy = 2; if (this.data.bookDetail.purchasedSaleMethodIdList.indexOf(dataItem.saleMethod[0].Id) > -1 || dataItem.saleMethod[0].Price == 0) { isBuy = 3; break; } else { break; } } } } if (isBuy == 2) { // 未购买 return false } else { return false; return true } }, // 云学习资源是否显示锁图标(未购买,且资源售价大于零) packageBookService/pages/bookServices/detail/index.wxml
@@ -184,8 +184,8 @@ <view class="btn-text">试读</view> </view> <view class="shopCar shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">加入购物车</view> <view class="buy buyColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}">立即购买</view> <view class="shopCar shopCarColor" bind:tap="addBookShopcCar" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1' && !bookDetail.IsTextbook}}">加入购物车</view> <view class="buy buyColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1' && !bookDetail.IsTextbook}}">立即购买</view> <view class="buy receiveColor" bind:tap="buyBtn" wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell == '1'}}">免费领取</view> <view class="buy read" bind:tap="goRead" data-type="file" wx:if="{{bookBuy || applicationState == 'Normal'}}">立即查看</view> </view> packageBookService/pages/bookServices/examination/components/joinGroupDialog/index.wxml
@@ -6,40 +6,15 @@ <view class="warning-txt"> 检测到您未加入班级,如您不加入班级,提交的答案将不能提交到班级老师处: </view> <t-radio allow-uncheck icon="dot" label="加入班级" value="1" data-value="1" checked="{{joinGroup == 1}}" bind:change="onChangeRadio" /> <t-radio allow-uncheck icon="dot" label="加入班级" value="1" data-value="1" checked="{{joinGroup == 1}}" bind:change="onChangeRadio" /> <view class="phone-input"> <input value="{{inputvalue}}" placeholder="请输入班级邀请码" bind:change="inputChange" type="text" class="phone" style="{{inputStyle}}" /> <input value="{{inputvalue}}" placeholder="请输入班级邀请码" bind:change="inputChange" type="text" class="phone" style="{{inputStyle}}" /> </view> <t-radio allow-uncheck icon="dot" label="不加入班级" value="0" data-value="2" checked="{{joinGroup == 2}}" bind:change="onChangeRadio" /> <t-radio allow-uncheck icon="dot" label="不加入班级" value="0" data-value="2" checked="{{joinGroup == 2}}" bind:change="onChangeRadio" /> <t-checkbox label="不再提示加入班级" icon="rectangle" value="{{noTip}}" /> </view> <view class="submit-btn"> <t-button theme="primary" size="large" block bind:tap="confirmSuggest" >确认</t-button > <t-button theme="primary" size="large" block bind:tap="confirmSuggest">确认</t-button> </view> </view> </view> </view> packageBookService/pages/bookServices/examination/examination.js
@@ -951,7 +951,7 @@ let oldObj = ""; if (oldList) oldObj = oldList.find((oldItem) => oldItem.id == item.id); console.log(item.Embedded_QuestionBank_Stem, 111) // console.log(item.Embedded_QuestionBank_Stem, 111) let questionObj = { // num: index, // 题号 id: item.id, @@ -1488,7 +1488,7 @@ questionObj.questionType == "completion" || questionObj.questionType == "multipleChoice" ) { console.log(questionObj.answer, "111") // console.log(questionObj.answer, "111") try { questionObj.answer = JSON.parse(questionObj.answer).toString(); } catch (error) { @@ -1821,7 +1821,7 @@ if (src) { questionObj.src = src questionObj.stem.stemTxt = this.removeVideoAndAudioTags(questionObj.stem.stemTxt) console.log('题干', questionObj.stem.stemTxt); // console.log('题干', questionObj.stem.stemTxt); } } if (item.Embedded_QuestionBank_QuestionType == "judge") { @@ -1868,7 +1868,7 @@ cardList: cardList, loading: false, }); console.log(this.data.questionDataList, "questionDataList"); // console.log(this.data.questionDataList, "questionDataList"); }); }, // 获取组卷结果 @@ -2220,7 +2220,7 @@ JSON.parse(res[0].value).time : 1000, "mockData.answer": JSON.parse(res[0].value).answerData, }); console.log(JSON.parse(res[0].value)); // console.log(JSON.parse(res[0].value)); data = JSON.parse(res[0].value).answerData; } }); @@ -2275,7 +2275,7 @@ this.setData({ saveTime: 20, }); console.log("模考答题数据已记录"); // console.log("模考答题数据已记录"); }); }, @@ -2495,8 +2495,9 @@ // 做完了且加入了班级,提交到message if (this.data.classList.length && this.data.joinGroup) { this.data.classList.forEach(item => { if (item.linkProductDto.product.id == this.data.bookId && item.topicId) if (item.linkProductDto.product.id == this.data.bookId && item.topicId) { this.newTopicMessage(item.topicId) } }) this.setinteractionInfo() } else { packageBookService/pages/bookServices/examination/examination.wxml
@@ -3,82 +3,20 @@ <import src="examination.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> <view class="page" wx:if="{{!loading}}" style="background-color:{{isNight ? '#222' : ''}}" > <view class="page" wx:if="{{!loading}}" style="background-color:{{isNight ? '#222' : ''}}"> <view class="page-content" style="background-color:{{isNight ? '#222' : ''}}"> <question-schedule wx:if="{{!loading}}" id="countDownRef" isNight="{{isNight}}" answerType="{{answerType}}" countdownTime="{{countdownTime}}" currentIndex="{{currentIndex}}" questionList="{{questionDataList}}" submitStatus="{{submitStatus}}" subjectiveGrade="{{subjectiveGrade}}" subjectiveNum="{{subjectiveNum}}" ></question-schedule> <question-list wx:if="{{!loading}}" sliderValue="{{sliderValue}}" isNight="{{isNight}}" answerType="{{answerType}}" currentIndex="{{currentIndex}}" questionList="{{questionDataList}}" submitStatus="{{submitStatus}}" noData="{{noData}}" bind:onChangeRadio="onChangeRadio" bind:onChangeInput="onChangeInput" bind:changeSwiper="changeSwiper" bind:viewParsing="viewParsing" ></question-list> <question-schedule wx:if="{{!loading}}" id="countDownRef" isNight="{{isNight}}" answerType="{{answerType}}" countdownTime="{{countdownTime}}" currentIndex="{{currentIndex}}" questionList="{{questionDataList}}" submitStatus="{{submitStatus}}" subjectiveGrade="{{subjectiveGrade}}" subjectiveNum="{{subjectiveNum}}"></question-schedule> <question-list wx:if="{{!loading}}" sliderValue="{{sliderValue}}" isNight="{{isNight}}" answerType="{{answerType}}" currentIndex="{{currentIndex}}" questionList="{{questionDataList}}" submitStatus="{{submitStatus}}" noData="{{noData}}" bind:onChangeRadio="onChangeRadio" bind:onChangeInput="onChangeInput" bind:changeSwiper="changeSwiper" bind:viewParsing="viewParsing"></question-list> </view> <!-- 底部区域--> <view class="page-bottom" style="background-color:{{isNight ? '#202020' : ''}}" wx:if="{{answerType !== 'errorQuestion' || (answerType == 'errorQuestion' && !loading)}}" > <question-options id="question-options" isShowDialog="{{isShowDialog}}" isNight="{{isNight}}" submitStatus="{{submitStatus}}" answerType="{{answerType}}" countdownTime="{{countdownTime}}" currentIndex="{{currentIndex}}" questionDataList="{{questionDataList}}" cardList="{{cardList}}" subjectiveTotal="{{subjectiveTotal}}" subjectiveNum="{{subjectiveNum}}" subjectiveGrade="{{subjectiveGrade}}" correctNum="{{correctNum}}" mockSumTime="{{mockData.sumTime}}" joinGroup="{{joinGroup}}" showId="{{showId}}" bind:setCollect="setCollect" bind:submitPaper="submitPaper" bind:restart="restart" bind:goQuestion="goQuestion" bind:changeBGColor="changeBGColor" bind:onChangeSlider="onChangeSlider" bind:changeLoadingState="changeLoadingState" bind:changeNavBarColor="changeNavBarColor" ></question-options> <view class="page-bottom" style="background-color:{{isNight ? '#202020' : ''}}" wx:if="{{answerType !== 'errorQuestion' || (answerType == 'errorQuestion' && !loading)}}"> <question-options id="question-options" isShowDialog="{{isShowDialog}}" isNight="{{isNight}}" submitStatus="{{submitStatus}}" answerType="{{answerType}}" countdownTime="{{countdownTime}}" currentIndex="{{currentIndex}}" questionDataList="{{questionDataList}}" cardList="{{cardList}}" subjectiveTotal="{{subjectiveTotal}}" subjectiveNum="{{subjectiveNum}}" subjectiveGrade="{{subjectiveGrade}}" correctNum="{{correctNum}}" mockSumTime="{{mockData.sumTime}}" joinGroup="{{joinGroup}}" showId="{{showId}}" bind:setCollect="setCollect" bind:submitPaper="submitPaper" bind:restart="restart" bind:goQuestion="goQuestion" bind:changeBGColor="changeBGColor" bind:onChangeSlider="onChangeSlider" bind:changeLoadingState="changeLoadingState" bind:changeNavBarColor="changeNavBarColor"></question-options> </view> </view> <page-container show="{{showDialog}}" duration="{{false}}" overlay="{{false}}" bind:beforeleave="beforeleave" ></page-container> <page-container show="{{showDialog}}" duration="{{false}}" overlay="{{false}}" bind:beforeleave="beforeleave"></page-container> <!-- 加入班级弹窗 --> <join-dialog visible="{{visible}}" bind:joinClass="joinClass"> </join-dialog> <join-dialog visible="{{visible}}" bind:joinClass="joinClass"> </join-dialog> packageBookService/pages/bookServices/examination/questionList/index.wxml
@@ -1,67 +1,32 @@ <!--pages/bookServices/examination/questionList/index.wxml--> <view class="question-list" style="background-color:{{isNight ? '#222' : '#fff'}}" > <view class="question-list" style="background-color:{{isNight ? '#222' : '#fff'}}"> <!-- 题型title --> <view class="question-title" wx:if="{{questionList[showIndex].type}}" style="background-color:{{isNight ? '#222' : '#fff'}}" > <text class="title-name">{{questionList[showIndex].type}}</text ><text wx:if="{{questionList[showIndex].score}}" class="title-score" style="color: {{isNight ? '#fff' : '#000'}};" >(每题{{questionList[showIndex].score}}分)</text > <view class="question-title" wx:if="{{questionList[showIndex].type}}" style="background-color:{{isNight ? '#222' : '#fff'}}"> <text class="title-name">{{questionList[showIndex].type}}</text><text wx:if="{{questionList[showIndex].score}}" class="title-score" style="color: {{isNight ? '#fff' : '#000'}};">(每题{{questionList[showIndex].score}}分)</text> </view> <!-- 题目列表 --> <swiper class="swiper" bindanimationfinish="changeSwiper" current="{{currentIndex}}" > <swiper class="swiper" bindanimationfinish="changeSwiper" current="{{currentIndex}}"> <swiper-item wx:for="{{questionList}}" wx:key="id" style="overflow-y: auto"> <!-- 题干 --> <view class="question-stem title-score" style="color: {{isNight ? '#fff' : '#000'}}; font-size: {{sliderValue || 32}}rpx;" > <view class="question-stem title-score" style="color: {{isNight ? '#fff' : '#000'}}; font-size: {{sliderValue || 32}}rpx;"> <!-- 题号 --> <text>{{item.number}}.</text> <!-- 听力题 --> <view wx:if="{{item.questionType == 'singleChoice' && item.src}}"> <rich-text nodes="{{item.stem.stemTxt }}" /> <view style="margin-top: {{item.stem.stemTxt ? '10rpx' : ''}};" class="audio-play-box" bind:tap="audioPlay" data-src="{{item.src}}" > <image src="{{isPlay ? '/static/images/resourceDetailsMyAudio/zanting@2x.png' : '/static/images/resourceDetailsMyAudio/play@2x.png'}}" mode="aspectFit" ></image> <view style="margin-top: {{item.stem.stemTxt ? '10rpx' : ''}};" class="audio-play-box" bind:tap="audioPlay" data-src="{{item.src}}"> <image src="{{isPlay ? '/static/images/resourceDetailsMyAudio/zanting@2x.png' : '/static/images/resourceDetailsMyAudio/play@2x.png'}}" mode="aspectFit"></image> </view> </view> <!-- 仅文字 --> <view class="title-content text-space" wx:elif="{{item.stemStyle == 'Txt' && item.questionType != 'completion'}}" >{{item.stem.stemTxt}}</view > <view class="title-content text-space" wx:elif="{{item.stemStyle == 'Txt' && item.questionType != 'completion'}}">{{item.stem.stemTxt}}</view> <!-- 仅图片 --> <view wx:elif="{{item.stemStyle == 'Image'}}" class="title-content"> <image src="{{item.stem.stemImage}}" mode="aspectFit" /> </view> <!-- 图片加文字 --> <view wx:elif="{{item.stemStyle == 'TxtAndImage'}}" class="title-content text-space" > <view wx:elif="{{item.stemStyle == 'TxtAndImage'}}" class="title-content text-space"> <view>{{item.stem.stemTxt}}</view> <image src="{{item.stem.stemImage}}" mode="aspectFit" /> </view> @@ -71,98 +36,37 @@ </view> <!-- 填空题 --> <view wx:if="{{item.questionType == 'completion'}}"> <view class="completion-box" wx:for="{{item.stem}}" wx:for-item="inputItem" wx:for-index="inputIndex" wx:key="inputIndex" > <t-input disabled="{{item.isComplete}}" borderless bind:change="onChangeInput" data-value="{{item.option}}" data-id="{{item.id}}" data-index="{{inputItem.num}}" class="title-input {{isNight ? 'input-night-color' : ''}}" style="border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;background-color:{{isNight ? '#000' : '#fff'}}; " placeholder-style="{{placeholderstyle}}" wx:if="{{inputItem.data == 'input'}}" placeholder="请输入文字" value="{{item.userAnswer[inputItem.num]}}" ></t-input> <view class="completion-box" wx:for="{{item.stem}}" wx:for-item="inputItem" wx:for-index="inputIndex" wx:key="inputIndex"> <t-input disabled="{{item.isComplete}}" borderless bind:change="onChangeInput" data-value="{{item.option}}" data-id="{{item.id}}" data-index="{{inputItem.num}}" class="title-input {{isNight ? 'input-night-color' : ''}}" style="border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;background-color:{{isNight ? '#000' : '#fff'}}; " placeholder-style="{{placeholderstyle}}" wx:if="{{inputItem.data == 'input'}}" placeholder="请输入文字" value="{{item.userAnswer[inputItem.num]}}"></t-input> <text wx:else class="text-space">{{inputItem}}</text> </view> </view> </view> <!-- 答题区域 --> <view class="question-answer {{item.questionType == 'shortAnswer' ? 'textarea-center' : ''}}" > <view class="question-answer {{item.questionType == 'shortAnswer' ? 'textarea-center' : ''}}"> <!-- 单选题 --> <t-radio-group wx:if="{{item.questionType == 'singleChoice' || item.questionType == 'judge'}}" defaultValue="{{item.userAnswer}}" disabled="{{item.isComplete}}" bind:change="onChangeRadio" class="radio-group" data-value="{{item.option}}" data-id="{{item.id}}" > <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex" > <t-radio value="{{contentItem.value}}" icon="none" placement="right" borderless style="background-color: {{isNight ? '#222' : '#fff'}}" > <view style="font-size: {{sliderValue || 32}}rpx;" class="radio-item {{(answerType == 'option' || answerType == 'mock' ) && !submitStatus && item.userAnswer == contentItem.value ? 'radio-active' : isNight ? 'night' :''}} {{item.userAnswer == contentItem.value && submitStatus ? item.isRight ? 'radio-correct' : 'radio-error' :''}}" > <t-radio-group wx:if="{{item.questionType == 'singleChoice' || item.questionType == 'judge'}}" defaultValue="{{item.userAnswer}}" disabled="{{item.isComplete}}" bind:change="onChangeRadio" class="radio-group" data-value="{{item.option}}" data-id="{{item.id}}"> <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex"> <t-radio value="{{contentItem.value}}" icon="none" placement="right" borderless style="background-color: {{isNight ? '#222' : '#fff'}}"> <view style="font-size: {{sliderValue || 32}}rpx;" class="radio-item {{(answerType == 'option' || answerType == 'mock' || answerType == 'interaction' ) && !submitStatus && item.userAnswer == contentItem.value ? 'radio-active' : isNight ? 'night' :''}} {{item.userAnswer == contentItem.value && submitStatus ? item.isRight ? 'radio-correct' : 'radio-error' :''}}"> <!-- 仅文字 --> <text wx:if="{{item.optionStyle == 'Txt' && item.questionType == 'singleChoice'}}" class="text-space" >{{contentItem.value}}、{{contentItem.txt}}</text > <text wx:if="{{item.optionStyle == 'Txt' && item.questionType == 'judge'}}" class="text-space" >{{contentItem.value}}、{{contentItem.txt}}</text > <text wx:if="{{item.optionStyle == 'Txt' && item.questionType == 'singleChoice'}}" class="text-space">{{contentItem.value}}、{{contentItem.txt}}</text> <text wx:if="{{item.optionStyle == 'Txt' && item.questionType == 'judge'}}" class="text-space">{{contentItem.value}}、{{contentItem.txt}}</text> <!-- 仅图片 --> <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center"> <text>{{contentItem.value}}、</text> <image src="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 文字加图片 --> <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center" class="TxtAndImage-box" > <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center" class="TxtAndImage-box"> <text class="text-space">{{contentItem.value}}、</text> <view class="radio-textimg">{{contentItem.txt}}</view> <image src="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 富文本 --> <view wx:if="{{item.optionStyle == 'RichText'}}" class="judge-rich-box" > <view wx:if="{{item.optionStyle == 'RichText'}}" class="judge-rich-box"> <text>{{contentItem.value}}、</text> <rich-text nodes="{{ contentItem.txt}}" style="display: flex; align-items: center; width: 100%" ></rich-text> <rich-text nodes="{{ contentItem.txt}}" style="display: flex; align-items: center; width: 100%"></rich-text> </view> <!-- <text wx:if="{{submitStatus && (item.answer == contentItem.value && item.answer == item.userAnswer)}}" @@ -177,225 +81,77 @@ </view> </t-radio-group> <!-- 多选题 --> <t-checkbox-group class="checkbox-group" wx:elif="{{item.questionType == 'multipleChoice'}}" t-class="box" borderless bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" defaultValue="{{item.userAnswer}}" > <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex" > <t-checkbox disabled="{{item.isComplete}}" icon="rectangle" block="{{false}}" class="t-checkbox" value="{{contentItem.value}}" style="background-color:{{isNight ? '#222' :'#F9F9F9'}}; " > <t-checkbox-group class="checkbox-group" wx:elif="{{item.questionType == 'multipleChoice'}}" t-class="box" borderless bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" defaultValue="{{item.userAnswer}}"> <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex"> <t-checkbox disabled="{{item.isComplete}}" icon="rectangle" block="{{false}}" class="t-checkbox" value="{{contentItem.value}}" style="background-color:{{isNight ? '#222' :'#F9F9F9'}}; "> <!-- 仅文字 --> <view class="fl-center mh text-space" wx:if="{{item.optionStyle == 'Txt'}}" style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" > <view class="fl-center mh text-space" wx:if="{{item.optionStyle == 'Txt'}}" style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;"> <text>{{contentItem.value}}</text> <text class="check-text-box">{{contentItem.txt}}</text> </view> <!-- 仅图片 --> <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center mh" > <text style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" >{{contentItem.value}}、</text > <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center mh"> <text style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;">{{contentItem.value}}、</text> <image src="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 文字加图片 --> <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center mh text-space" > <text style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" >{{contentItem.value}}、</text > <text style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" >{{contentItem.txt}}</text > <image src="{{contentItem.img}}" wx:if="{{contentItem.img}}" mode="aspectFit" /> <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center mh text-space"> <text style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;">{{contentItem.value}}、</text> <text style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;">{{contentItem.txt}}</text> <image src="{{contentItem.img}}" wx:if="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 富文本 --> <view wx:if="{{item.optionStyle == 'RichText'}}" class="check-rich-box mh" > <view wx:if="{{item.optionStyle == 'RichText'}}" class="check-rich-box mh"> <text>{{contentItem.value}}、</text> <rich-text nodes="{{contentItem.txt}}" class="multipleChoice" ></rich-text> <rich-text nodes="{{contentItem.txt}}" class="multipleChoice"></rich-text> </view> </t-checkbox> </view> </t-checkbox-group> <!-- 简答 翻译 --> <t-textarea disabled="{{item.isComplete}}" value="{{item.userAnswer}}" bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" class="option-textarea {{isNight ? 'textarea-night-color' :''}}" wx:elif="{{item.questionType == 'shortAnswer'}}" t-class="external-class" placeholder="请输入文字" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="background-color:{{isNight ? '#000' : '#fff'}}; " /> <t-textarea disabled="{{item.isComplete}}" value="{{item.userAnswer}}" bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" class="option-textarea {{isNight ? 'textarea-night-color' :''}}" wx:elif="{{item.questionType == 'shortAnswer'}}" t-class="external-class" placeholder="请输入文字" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="background-color:{{isNight ? '#000' : '#fff'}}; " /> </view> <!-- 我的错题、收藏模式下,查看解析按钮 --> <view wx:if="{{(answerType == 'collectQuestion' || answerType == 'errorQuestion') && (item.questionType == 'multipleChoice' || item.questionType == 'completion' || item.questionType == 'shortAnswer')}}" style="margin-left: 40rpx" > <t-button theme="primary" class="view-parsing" bind:tap="viewParsing" >查看解析</t-button > <view wx:if="{{(answerType == 'collectQuestion' || answerType == 'errorQuestion') && (item.questionType == 'multipleChoice' || item.questionType == 'completion' || item.questionType == 'shortAnswer')}}" style="margin-left: 40rpx"> <t-button theme="primary" class="view-parsing" bind:tap="viewParsing">查看解析</t-button> </view> <!-- 单选、多选解析 --> <view class="analysis" wx:if="{{item.isComplete && (item.questionType == 'singleChoice' || item.questionType == 'judge' || item.questionType == 'multipleChoice')}}" > <view class="analysis" wx:if="{{item.isComplete && (item.questionType == 'singleChoice' || item.questionType == 'judge' || item.questionType == 'multipleChoice')}}"> <view class="analysis-answer {{sliderValue >35 ? 'fl-cl' : '' }}"> <view class="answer-correct answer-center" style="font-size: {{sliderValue || 32}}rpx;" > <view class="answer-correct answer-center" style="font-size: {{sliderValue || 32}}rpx;"> <text class="analysis-title-box">正确答案:</text> <text style="font-size: {{sliderValue || 40}}rpx;" >{{item.answer}}</text > <text style="font-size: {{sliderValue || 40}}rpx;">{{item.answer}}</text> <!-- <rich-text nodes="{{item.answer}}" style="font-size: {{sliderValue || 40}}rpx;"></rich-text> --> </view> <view class="answer-center {{item.isRight ? 'answer-correct' : 'answer-error'}} {{sliderValue <= 35 ? 'marginL' : ''}}" wx:if="{{item.questionType !== 'shortAnswer'}}" > <text class="analysis-title-box" style="font-size: {{sliderValue || 32}}rpx;" >您的答案:</text ><text class="answer-text" style="font-size: {{sliderValue || 40}}rpx;" >{{item.userAnswer}}</text > <view class="answer-center {{item.isRight ? 'answer-correct' : 'answer-error'}} {{sliderValue <= 35 ? 'marginL' : ''}}" wx:if="{{item.questionType !== 'shortAnswer'}}"> <text class="analysis-title-box" style="font-size: {{sliderValue || 32}}rpx;">您的答案:</text><text class="answer-text" style="font-size: {{sliderValue || 40}}rpx;">{{item.userAnswer}}</text> </view> </view> <view class="analysis-text" wx:if="{{item.analysisCon}}" style="color: {{isNight ? '#fff' : '#000'}};" > <text style="font-size: {{sliderValue || 32}}rpx;" class="answer-analysis" >答案解析:</text > <rich-text wx:if="item.analysisCon" style="font-size: {{sliderValue || 32}}rpx;" nodes="{{item.analysisCon}}" class="analysis-content" ></rich-text> <view class="analysis-text" wx:if="{{item.analysisCon}}" style="color: {{isNight ? '#fff' : '#000'}};"> <text style="font-size: {{sliderValue || 32}}rpx;" class="answer-analysis">答案解析:</text> <rich-text wx:if="item.analysisCon" style="font-size: {{sliderValue || 32}}rpx;" nodes="{{item.analysisCon}}" class="analysis-content"></rich-text> <text wx:else style="font-size: {{sliderValue || 32}}rpx;">-</text> </view> </view> <!-- 填空、简答解析 --> <view class="analysis" wx:if="{{(item.questionType == 'shortAnswer' || item.questionType == 'completion') && item.isComplete}}" > <view style="display: {{item.questionType == 'completion' ? 'flex' : 'block'}}" > <text wx:if="{{item.questionType == 'completion'}}" class="short-answer-fz answer-correct" style="font-size:{{sliderValue || 32}}rpx;" >正确答案:</text > <text wx:if="{{item.questionType == 'shortAnswer'}}" class="short-answer-fz" style="color:{{isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" > <view class="analysis" wx:if="{{(item.questionType == 'shortAnswer' || item.questionType == 'completion') && item.isComplete}}"> <view style="display: {{item.questionType == 'completion' ? 'flex' : 'block'}}"> <text wx:if="{{item.questionType == 'completion'}}" class="short-answer-fz answer-correct" style="font-size:{{sliderValue || 32}}rpx;">正确答案:</text> <text wx:if="{{item.questionType == 'shortAnswer'}}" class="short-answer-fz" style="color:{{isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;"> 参考答案: </text> <rich-text wx:if="{{item.questionType == 'shortAnswer'}}" nodes="{{item.answer}}" style="font-size:{{sliderValue || 28}}rpx; color:{{item.questionType == 'completion' ? '#1FBC1F' : isNight ? '#fff' : '#000'}}" ></rich-text> <view wx:if="{{item.questionType == 'completion'}}" style="font-size:{{sliderValue || 28}}rpx;" class="short-answer-fz answer-correct" >{{item.answer}}</view > <rich-text wx:if="{{item.questionType == 'shortAnswer'}}" nodes="{{item.answer}}" style="font-size:{{sliderValue || 28}}rpx; color:{{item.questionType == 'completion' ? '#1FBC1F' : isNight ? '#fff' : '#000'}}"></rich-text> <view wx:if="{{item.questionType == 'completion'}}" style="font-size:{{sliderValue || 28}}rpx;" class="short-answer-fz answer-correct">{{item.answer}}</view> </view> <view wx:if="{{item.questionType == 'completion'}}" class="short-answer-mr" style="display: {{item.questionType == 'completion' ? 'flex' : 'block'}}" > <text class="short-answer-fz {{item.isRight ? 'answer-correct' : 'answer-error'}}" style="font-size:{{sliderValue || 32}}rpx;" >您的答案:</text > <view class="short-answer-fz {{item.isRight ? 'answer-correct' : 'answer-error'}}" style="color:{{isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 28}}rpx;" >{{item.userAnswer}}</view > <view wx:if="{{item.questionType == 'completion'}}" class="short-answer-mr" style="display: {{item.questionType == 'completion' ? 'flex' : 'block'}}"> <text class="short-answer-fz {{item.isRight ? 'answer-correct' : 'answer-error'}}" style="font-size:{{sliderValue || 32}}rpx;">您的答案:</text> <view class="short-answer-fz {{item.isRight ? 'answer-correct' : 'answer-error'}}" style="color:{{isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 28}}rpx;">{{item.userAnswer}}</view> </view> <view class="short-answer-mr" style="margin-bottom: 50rpx"> <text class="short-answer-fz;" style="color:{{isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" >答案解析:</text > <rich-text wx:if="item.analysisCon" nodes="{{item.analysisCon}}" style="font-size:{{sliderValue || 28}}rpx;;color:{{isNight ? '#fff' : '#000'}}" ></rich-text> <text wx:else style="font-size:{{sliderValue || 28}}rpx;;color:{{isNight ? '#fff' : '#000'}}" > <text class="short-answer-fz;" style="color:{{isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;">答案解析:</text> <rich-text wx:if="item.analysisCon" nodes="{{item.analysisCon}}" style="font-size:{{sliderValue || 28}}rpx;;color:{{isNight ? '#fff' : '#000'}}"></rich-text> <text wx:else style="font-size:{{sliderValue || 28}}rpx;;color:{{isNight ? '#fff' : '#000'}}"> - </text> </view> @@ -408,4 +164,4 @@ </view> </swiper-item> </swiper> </view> </view> packageBookService/pages/bookServices/examination/questionOptions/index.js
@@ -58,8 +58,8 @@ isShowDialog: { type: Boolean }, joinGroup:{ type:Boolean joinGroup: { type: Boolean } }, @@ -186,7 +186,6 @@ // 滑块变化 onChangeSlider(e) { const value = e.detail.value; console.log(value); this.triggerEvent("onChangeSlider", { value }); packageBookService/pages/bookServices/examination/questionSchedule/index.wxml
@@ -1,28 +1,16 @@ <!--pages/bookServices/examination/questionSchedule/questionSchedule.wxml--> <view wx:if="{{((answerType == 'option' || answerType == 'mock' || answerType == 'interaction') && !submitStatus) || answerType == 'collectQuestion' || answerType =='errorQuestion'}}" class="schedule" id="schedule" style="background-color:{{isNight ? '#1a1a1a' : '#fff'}}" > <view wx:if="{{((answerType == 'option' || answerType == 'mock' || answerType == 'interaction') && !submitStatus) || answerType == 'collectQuestion' || answerType =='errorQuestion'}}" class="schedule" id="schedule" style="background-color:{{isNight ? '#1a1a1a' : '#fff'}}"> <view class="schedule-top"> <!-- 答题进度 --> <view class="question-schedule" style="color: {{isNight ? '#fff' : '#000'}};" >{{(answerType == 'option' || answerType == 'mock' || answerType == <view class="question-schedule" style="color: {{isNight ? '#fff' : '#000'}};">{{(answerType == 'option' || answerType == 'mock' || answerType == 'interaction') ? '答题进度' : answerType == 'collectQuestion' ? '收藏数量' : '错题数量' }}<text class="parimary-color question-num">{{ready}}</text> <text>/{{questionList.length}}</text> </view> <view class="remainder" wx:if="{{!submitStatus && (answerType == 'option' || answerType == 'mock' || answerType == 'interaction')}}" style="color: {{isNight ? '#fff' : '#000'}};" > <view class="remainder" wx:if="{{!submitStatus && (answerType == 'option' || answerType == 'mock' || answerType == 'interaction')}}" style="color: {{isNight ? '#fff' : '#000'}};"> <view class="remainder-text">剩余时间 </view> <view class="parimary-color remaining-time">{{showTime}}</view></view > <view class="parimary-color remaining-time">{{showTime}}</view> </view> </view> <!-- 进度条 --> <view class="schedule-progress"> @@ -31,14 +19,10 @@ </view> <!-- 练习、组卷 提交后 --> <view wx:else class="schedule submit-message" style="background-color:{{isNight ? '#1a1a1a' : '#fff'}};color: {{isNight ? '#fff' : '#000'}}; " > <view wx:else class="schedule submit-message" style="background-color:{{isNight ? '#1a1a1a' : '#fff'}};color: {{isNight ? '#fff' : '#000'}}; "> <view> 客观题得分:<text class="parimary-color">{{subjectiveNum}}分</text> / {{subjectiveGrade}}分 </view> <view> {{ready}} /{{questionList.length}} </view> </view> </view> packageCourse/components/questionDom/index.wxml
@@ -31,21 +31,15 @@ </view> <view class="judge" wx:if="{{item.questionType == 'judge'}}"> <t-radio-group> <t-radio block="{{false}}" wx:for="{{item.questionOption}}" wx:for-item="{{ritem}}" wx:index="{{ritem.index}}" label="{{ritem.value}}" value="{{ritem.value}}" /> <t-radio block="{{false}}" wx:for="{{item.questionOption}}" wx:for-item="{{ritem}}" wx:key="index" label="{{ritem.value}}" value="{{ritem.value}}" /> </t-radio-group> </view> <view class="singleChoice" wx:if="{{item.questionType == 'singleChoice'}}"> <t-radio-group> <t-radio block="{{false}}" wx:for="{{item.questionOption}}" wx:for-item="{{ritem}}" wx:index="{{ritem.index}}" label="{{ritem.value}}" value="{{ritem.value}}"> <text>{{ritem.value}}</text>. <text>{{ritem.txt}}</text> </t-radio> <t-radio-group value="{{item.userAnswer}}" bind:change="getData" options="{{item.questionOption}}"> </t-radio-group> </view> <view class="multipleChoice" wx:if="{{item.questionType == 'multipleChoice'}}"> <t-checkbox-group> <t-checkbox block="{{false}}" wx:for="{{item.questionOption}}" wx:for-item="{{mitem}}" wx:index="{{mitem.index}}" label="{{mitem.value}}" value="{{mitem.value}}"> <text>{{mitem.value}}</text>. <text>{{mitem.txt}}</text> </t-checkbox> <t-checkbox-group value="{{item.userAnswer}}" bind:change="getData" options="{{item.questionOption}}"> </t-checkbox-group> </view> </view> packageCourse/components/questionDom/index.wxss
@@ -26,4 +26,4 @@ border-radius: 5px; font-size: 28rpx; box-sizing: border-box; } } packageCourse/pages/teachClass/detail/index.js
@@ -93,6 +93,7 @@ }] } app.MG.ugc.getTopicMessageList(data).then((res) => { debugger const list = res.datas.map((item, i) => { item.question = [] item.bookId = null @@ -101,7 +102,14 @@ try { const obj = JSON.parse(item.content) if (obj.bookId) { item.question = obj.content item.question = obj.content.map((citem) => { return { ...citem, updateDate: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss'), userId: item.appUserCreator.userId } }) // item.question = obj.content item.bookId = obj.bookId item.path = obj.path item.userName = obj.userName ?? '-' @@ -114,12 +122,15 @@ questionTime: moment(item.updateDate).format('YYYY-MM-DD HH:mm:ss') } }) console.log(JSON.stringify(list), 'dialog') this.setData({ dataList: list, loading: false }) }) }, // 获取题目列表 getQuestions(item) { @@ -237,6 +248,14 @@ const qusObj = item.question.find((citem) => citem.cmsItemId == ele.id) if (qusObj?.cmsItemId) { ele.userAnswer = qusObj.answer if (ele.questionType == 'singleChoice' || ele.questionType == 'multipleChoice' || ele.questionType == 'judge') { ele.questionOption = ele.questionOption.map(item => { return { ...item, label: item.txt } }) } const index = this.findIndexByValue(questionTypeList, ele.questionType) if (index > -1) { item.questionTypeList[index].data.push(ele) packageCourse/pages/teachClass/detail/index.wxss
@@ -89,4 +89,47 @@ .block-question .t-input__placeholder, .block-question .t-textarea__placeholder { font-size: 26rpx !important; } .t-checkbox__title { line-height: 36rpx !important; } .t-checkbox { font-size: 26rpx !important; } .t-checkbox__icon { position: relative; display: block; width: var(--td-checkbox-icon-size, 36rpx) !important; height: var(--td-checkbox-icon-size, 36rpx) !important; color: var(--td-checkbox-icon-color, var(--td-component-border, var(--td-gray-color-4, #dcdcdc))); font-size: var(--td-checkbox-icon-size, 36rpx) !important; margin-top: calc((var(--td-checkbox-title-line-height, 36rpx) - var(--td-checkbox-icon-size, 36rpx)) / 2) !important; } .t-checkbox__icon-circle { width: calc((var(--td-checkbox-icon-size, 36rpx) - 4rpx) * 2) !important; height: calc((var(--td-checkbox-icon-size, 36rpx) - 4rpx) * 2) !important; } .t-radio__icon { width: var(--td-radio-icon-size, 36rpx) !important; height: var(--td-radio-icon-size, 36rpx) !important; font-size: var(--td-radio-icon-size, 36rpx) !important; } .t-radio__icon-circle { width: var(--td-radio-icon-size, 36rpx) !important; height: var(--td-radio-icon-size, 36rpx) !important; } .t-radio__title { line-height: var(--td-radio-label-line-height, 36rpx) !important; } .t-radio { font-size: var(--td-radio-font-size, 26rpx) !important; } packageDomain/pages/resourceDetails/document/index.json
@@ -1,4 +1,4 @@ { { "component": true, "usingComponents": { "t-icon": "tdesign-miniprogram/icon/icon", packageDomain/pages/resourceDetails/myAudio/index.js
@@ -124,7 +124,6 @@ }) this.getLearnTime() } this.resourceDetailsData() this.getBookInfo(options.bookId) }, /** @@ -267,7 +266,9 @@ coverSize: { height: 1, }, fields: {}, fields: { IsTextbook: [] }, }; if (this.data.storeInfo) query['storeInfo'] = this.data.storeInfo app.MG.store.getProductDetail(query).then(async (res) => { @@ -277,6 +278,7 @@ buyIdList: res.datas.purchasedSaleMethodIdList, learnClassData: res.datas.cmsDatas[0].datas.find(item => item.refCode == "jsek_cloudLearning") }) this.resourceDetailsData() this.getResourceDataList(this.data.learnClassData) }); }, @@ -401,6 +403,7 @@ if (isBuy == 2) { // 未购买 if (dataList[0].freeFile) { dataList[0].isFreeFile = true; // 这个资源可以试看 cmsItemData = dataList[0] } else { wx.hideLoading(); @@ -482,7 +485,13 @@ if (selectedId !== -1) { let datas = this.data.threeLeveData[selectedId]; if (this.data.formPath == 'jsek_cloudLearning') { let file = this.cmsItemIsBuy(datas) ? datas.protectedFile || datas.freeFile : datas.freeFile // let file = this.cmsItemIsBuy(datas) ? datas.protectedFile || datas.freeFile : datas.freeFile let file if (!datas.isFreeFile) { file = datas.protectedFile } else { file = datas.freeFile } showDataUrl = app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey); } else { showDataUrl = datas.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + datas.freeFile @@ -520,7 +529,12 @@ }) if (item.selectType == "audio" || item.learnSelectType === "audio") { if (this.data.formPath == 'jsek_cloudLearning') { let file = item.protectedFile ? item.protectedFile : item.freeFile let file if (!item.isFreeFile) { file = item.protectedFile } else { file = item.freeFile } // 这里处理云学习的 this.setData({ showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey) packageDomain/pages/resourceDetails/myVideo/index.js
@@ -382,6 +382,7 @@ if (isBuy == 2) { // 未购买 if (dataList[0].freeFile) { dataList[0].isFreeFile = true; // 这个资源可以试看 cmsItemData = dataList[0] } else { wx.hideLoading(); @@ -464,9 +465,9 @@ this.data.threeLeveData.forEach((items, index) => { // 修改此处添加index参数 if (this.data.productLinkPath == items.productLinkPath) { if (this.data.formPath === "jsek_cloudLearning") { const flag = this.cmsItemIsBuy(items) // const flag = this.cmsItemIsBuy(items) let file if (flag) { if (!items.isFreeFile) { file = items.protectedFile || items.file ? file = items.protectedFile || items.file : file = items.freeFile } else { if (items.freeFile) { @@ -500,6 +501,7 @@ loading: false, hidden: false, toView: 'activeName' + this.data.selectedId, threeLeveData: this.data.threeLeveData }) }) }, @@ -511,9 +513,9 @@ }) if (item.selectType == "video" || item.learnSelectType === "video") { if (this.data.formPath === "jsek_cloudLearning") { const flag = this.cmsItemIsBuy(item) // const flag = this.cmsItemIsBuy(item) let file if (flag) { if (!item.isFreeFile) { file = item.protectedFile || item.file ? file = item.protectedFile || item.file : file = item.freeFile } else { packageDomain/pages/resourceDetails/myVideo/index.wxml
@@ -4,22 +4,9 @@ <!-- autoplay='false' 是否自动播放 --> <!-- <video binderror="videoErrorCallback" src="{{showData}}" play-btn-position='center' object-fit='fill' controls enable-play-gesture enable-auto-rotation></video> --> <view wx:if="{{videoLoading}}" class="video-loading"> <t-loading theme="circular" size="60rpx" class="wrapper" loading="{{videoLoading}}" /> <t-loading theme="circular" size="60rpx" class="wrapper" loading="{{videoLoading}}" /> </view> <t-video id="tvd" src="{{showDataVod}}" style="width: 100%" bindvideoloaded="loadedmetadata" bindEnded="videoEnd" bindTimeupdate="timeUpdate" wx:if="{{!videoLoading}}" > <t-video id="tvd" src="{{showDataVod}}" style="width: 100%" bindvideoloaded="loadedmetadata" bindEnded="videoEnd" bindTimeupdate="timeUpdate" wx:if="{{!videoLoading}}"> </t-video> </view> @@ -30,50 +17,18 @@ <!-- 标题 --> <view class="titleBox">{{titleName}}</view> <view class="contentBox"> <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" split="{{false}}" > <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" split="{{false}}"> <!-- 资源列表 --> <t-tab-panel label="资源列表" value="0" style="{{tabPanelstyle}}" style="width: 750rpx" > <t-tab-panel label="资源列表" value="0" style="{{tabPanelstyle}}" style="width: 750rpx"> <view class="demo-section__content" wx:if="{{loading}}"> <t-skeleton theme="paragraph" animation="gradient" loading="true" ></t-skeleton> <t-skeleton theme="paragraph" animation="gradient" loading="true"></t-skeleton> </view> <scroll-view style="height: 700rpx" scroll-y scroll-into-view="{{toView}}" > <scroll-view style="height: 700rpx" scroll-y scroll-into-view="{{toView}}"> <view class="wrapper" wx:if="{{!loading}}"> <view class="outsideDetailsName"> <view class="titleBox">{{parentName}}</view> <view wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}" class="detailsName" id="{{selectedId == index ? 'activeName'+index : ''}}" > <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}" >{{item.name}}</view > <!-- <view class="titleBox">{{parentName}}</view> --> <view wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}" class="detailsName" id="{{selectedId == index ? 'activeName'+index : ''}}"> <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}">{{item.name}}</view> </view> </view> </view> @@ -87,17 +42,9 @@ <empty /> </view> <t-collapse value="{{activeValues}}" bind:change="handleChange"> <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}" wx:key="id" > <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}" wx:key="id"> <view slot="header" class="collapse-header"> <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png" ></t-image> <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> <view class="header-name">{{item.name}}</view> </view> <view> @@ -105,19 +52,9 @@ <view class="note-bottom"> <view class="note-time">{{item.createDate}}</view> <view class="bottom-btn"> <t-image src="/static/images/bookService/detail/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}" ></t-image> <t-image src="/static/images/bookService/detail/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}"></t-image> <view></view> <t-image src="/static/images/bookService/detail/deleteHover.png" class="delete" bind:tap="deleteNote" data-id="{{item.id}}" ></t-image> <t-image src="/static/images/bookService/detail/deleteHover.png" class="delete" bind:tap="deleteNote" data-id="{{item.id}}"></t-image> </view> </view> </view> @@ -130,10 +67,7 @@ <!-- 记笔记 --> <view class="takeNotes" data-key="showCloseBtn" bind:tap="showDialog"> <view class="takeNotesLining"> <image src="/static/images/resourceDetails/jibiji/icon@2x.png" mode="" /> <image src="/static/images/resourceDetails/jibiji/icon@2x.png" mode="" /> 记笔记 </view> </view> @@ -141,71 +75,29 @@ </view> <!-- 记笔记弹窗 --> <t-popup visible="{{dialogKey}}" bind:visible-change="onVisibleChange" placement="center" > <t-popup visible="{{dialogKey}}" bind:visible-change="onVisibleChange" placement="center"> <view class="popup"> <view slot="title"> <view class="title-text" wx:if="{{!flag}}"> <text class="note-title">{{submitTitle}}</text> <t-image src="/static/images/bookService/detail/edit.png" class="edit-icon" bind:tap="changeTitle" data-value="{{true}}" ></t-image> <t-image src="/static/images/bookService/detail/edit.png" class="edit-icon" bind:tap="changeTitle" data-value="{{true}}"></t-image> </view> <view wx:else> <t-input value="{{submitTitle}}" style="{{inputStyle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" maxlength="{{50}}" bind:change="inputChange" ></t-input> <t-input value="{{submitTitle}}" style="{{inputStyle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" maxlength="{{50}}" bind:change="inputChange"></t-input> </view> </view> <view slot="content"> <view class="textarea-example"> <text class="textarea-example__label">内容:</text> <t-textarea value="{{textvalue}}" t-class="external-class" placeholder="请输入文字" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{inputStyle}}" bind:change="textareaChange" /> <t-textarea value="{{textvalue}}" t-class="external-class" placeholder="请输入文字" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{inputStyle}}" bind:change="textareaChange" /> </view> <view class="submit-btn"> <t-button theme="primary" size="large" block bind:tap="confirmSuggest" >提交</t-button > <t-button theme="primary" size="large" block bind:tap="confirmSuggest">提交</t-button> </view> </view> </view> <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> </t-popup> </view> <t-dialog class="prompDialog" visible="{{promptVisable}}" title="提示" content="试看结束,请购买正式资源" confirm-btn="{{ confirmBtn }}" bind:confirm="closePromapDialog" /> <t-dialog class="prompDialog" visible="{{promptVisable}}" title="提示" content="试看结束,请购买正式资源" confirm-btn="{{ confirmBtn }}" bind:confirm="closePromapDialog" /> packagePersonal/pages/activateProduct/index.js
@@ -94,25 +94,43 @@ oldlist.forEach(istrue => { istrue.icon = getPublicImage(istrue.icon, "", 400) }) item.typeList = [] item.saleMethodList.forEach(async (i) => { if (i.type != 'defaultSaleMethod') { var index = i.name.indexOf('-') if (index !== -1) { item.type = i.name.substring(0, index) } else { item.type = i.name } } else { let parentData = await app.MG.store.getProductBySaleMethod({ saleMethodId: i.id }) if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { item.type = '数字课程' } if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') { item.type = '数字教材' } // if (i.type != 'defaultSaleMethod') { // var index = i.name.indexOf('-') // if (index !== -1) { // item.type = i.name.substring(0, index) // } else { // item.type = i.name // } // } else { // let parentData = await app.MG.store.getProductBySaleMethod({ // saleMethodId: i.id // }) // if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { // item.type = '数字课程' // } // if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') { // item.type = '数字教材' // } // } const obj = { icon: item.productList[0]?.icon, id: item.productList[0]?.id, name: item.productList[0]?.name, type: i.type == 'defaultSaleMethod' ? '电子书' : i.name.split('-')[0], defaultSaleMethodId: item.productList[0]?.defaultSaleMethodId } let parentData = await app.MG.store.getProductBySaleMethod({ saleMethodId: i.id }) if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { obj.type = '数字课程' } if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') { obj.type = '数字教材' } item.typeList.push(obj) }) }) setTimeout(() => { packagePersonal/pages/activateProduct/index.wxml
@@ -33,8 +33,8 @@ </view> <view class="listBox"> <scroll-view class="srcolbox" scroll-x scroll-with-animation='true'> <view class="order-centent" wx:if="{{items.productList.length > 0}}"> <view class="bookBox" wx:for="{{items.productList}}" wx:for-item="itemes" wx:for-index="idx" wx:key="idx" bindtap="goBookDetails" data-book="{{itemes}}" data-type="{{items.type}}"> <view class="order-centent" wx:if="{{items.typeList.length > 0}}"> <view class="bookBox" wx:for="{{items.typeList}}" wx:for-item="itemes" wx:for-index="idx" wx:key="idx" bindtap="goBookDetails" data-book="{{itemes}}" data-type="{{itemes.type}}"> <view class="leftCon"> <!-- 获取图片 --> <image class="purchasedIcon" wx:if="{{itemes.icon}}" src="{{itemes.icon}}" mode="aspectFit" /> @@ -44,7 +44,7 @@ <view class="rightCon"> <view class="productTitle">{{itemes.name}}</view> <view class="typeBox"> <text class="typeCon">{{items.type ? items.type : '电子书' }}</text> <text class="typeCon">{{itemes.type }}</text> </view> </view> </view> pages/digitalCourses/digitalCoursesDetails/components/tree/index.wxml
@@ -1,110 +1,37 @@ <view class="tree"> <t-collapse default-value="{{openIds}}" catchchange="handleChange"> <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{item.sysType== 'CmsItem' }}" > <view class="listItems" wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}" > <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{item.sysType== 'CmsItem' }}"> <view class="listItems" wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}"> <view class="itemsInfo"> <view class="contentBox"> <!-- 云学习 图标 --> <view class="box-image fl-cn" style="width: 80%" bind:tap="goPlayer" data-item="{{item}}" data-parent="{{''}}" > <view class="box-image fl-cn" style="width: 80%" bind:tap="goPlayer" data-item="{{item}}" data-parent="{{''}}"> <view class="teach-icon fl-cn"> <image wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'pdf' || item.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'webpage' || item.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'picture' || item.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'zip' || item.learnSelectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'doc' || item.fileMap[item.file].extension == 'docx' || item.fileMap[item.freeFile].extension == 'doc' || item.fileMap[item.freeFile].extension == 'docx' || item.fileMap[item.protectedFile].extension == 'doc' || item.fileMap[item.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'xls' || item.fileMap[item.file].extension == 'xlsx' || item.fileMap[item.freeFile].extension == 'xls' || item.fileMap[item.freeFile].extension == 'xlsx' || item.fileMap[item.protectedFile].extension == 'xls' || item.fileMap[item.protectedFile].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'ppt' || item.fileMap[item.file].extension == 'pptx' || item.fileMap[item.freeFile].extension == 'ppt' || item.fileMap[item.freeFile].extension == 'pptx' || item.fileMap[item.protectedFile].extension == 'ppt' || item.fileMap[item.protectedFile].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> <image wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'pdf' || item.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'webpage' || item.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'picture' || item.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{item.selectType == 'zip' || item.learnSelectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'doc' || item.fileMap[item.file].extension == 'docx' || item.fileMap[item.freeFile].extension == 'doc' || item.fileMap[item.freeFile].extension == 'docx' || item.fileMap[item.protectedFile].extension == 'doc' || item.fileMap[item.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'xls' || item.fileMap[item.file].extension == 'xlsx' || item.fileMap[item.freeFile].extension == 'xls' || item.fileMap[item.freeFile].extension == 'xlsx' || item.fileMap[item.protectedFile].extension == 'xls' || item.fileMap[item.protectedFile].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> <image wx:elif="{{ item.fileMap[item.file].extension == 'ppt' || item.fileMap[item.file].extension == 'pptx' || item.fileMap[item.freeFile].extension == 'ppt' || item.fileMap[item.freeFile].extension == 'pptx' || item.fileMap[item.protectedFile].extension == 'ppt' || item.fileMap[item.protectedFile].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> <!-- 资源无文件内容图标 --> <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> </view> <!-- 名称 --> <text class="name" style="width: 100%">{{item.name || '-'}}</text> <text>{{item.progress ? item.progress : 0}}%</text> </view> <view class="seeBox" wx:if="{{!isBuy && citem.freeFile ? true : false}}" bind:tap="goPlayer" data-item="{{citem}}" data-parent="" data-isTry="{{true}}" > <view class="seeBox" wx:if="{{!isBuy && citem.freeFile ? true : false}}" bind:tap="goPlayer" data-item="{{citem}}" data-parent="" data-isTry="{{true}}"> <!-- 云学习试看图标 --> <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!isBuy && item.freeFile ? true : false}}" ></image> <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!isBuy && item.freeFile ? true : false}}"></image> </view> </view> </view> </view> </view> <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.sysType == 'CmsFolder' }}" > <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.sysType == 'CmsFolder' }}"> <view slot="header" class="header-title"> <view class="title-checkBox" catchtap="catchTap"> <!-- 章节名 --> @@ -113,113 +40,39 @@ </view> </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.sysType == 'CmsItem'}}" > <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}"> <view class="itemsInfo"> <view class="contentBox"> <!-- 云学习 图标 --> <view class="box-image fl-cn" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}" > <view class="box-image fl-cn" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}"> <view class="teach-icon fl-cn"> <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' || citem.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'webpage' || citem.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'picture' || citem.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'zip' || citem.learnSelectType == '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' || citem.fileMap[citem.freeFile].extension == 'doc' || citem.fileMap[citem.freeFile].extension == 'docx' || citem.fileMap[citem.protectedFile].extension == 'doc' || citem.fileMap[citem.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'xls' || citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.freeFile].extension == 'xls' || citem.fileMap[citem.freeFile].extension == 'xlsx' || citem.fileMap[citem.protectedFile].extension == 'xls' || citem.fileMap[citem.protectedFile].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' || citem.fileMap[citem.freeFile].extension == 'ppt' || citem.fileMap[citem.freeFile].extension == 'pptx' || citem.fileMap[citem.protectedFile].extension == 'ppt' || citem.fileMap[citem.protectedFile].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' || citem.learnSelectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'webpage' || citem.learnSelectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'picture' || citem.learnSelectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> <image wx:elif="{{citem.selectType == 'zip' || citem.learnSelectType == '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' || citem.fileMap[citem.freeFile].extension == 'doc' || citem.fileMap[citem.freeFile].extension == 'docx' || citem.fileMap[citem.protectedFile].extension == 'doc' || citem.fileMap[citem.protectedFile].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> <image wx:elif="{{ citem.fileMap[citem.file].extension == 'xls' || citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.freeFile].extension == 'xls' || citem.fileMap[citem.freeFile].extension == 'xlsx' || citem.fileMap[citem.protectedFile].extension == 'xls' || citem.fileMap[citem.protectedFile].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' || citem.fileMap[citem.freeFile].extension == 'ppt' || citem.fileMap[citem.freeFile].extension == 'pptx' || citem.fileMap[citem.protectedFile].extension == 'ppt' || citem.fileMap[citem.protectedFile].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> <!-- 资源无文件内容图标 --> <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> <text class="name" style="width: 400rpx" >{{citem.name || '-'}}</text > <image wx:else src="/static/images/bookService/detail/word.png" mode="" /> <text class="name" style="width: 400rpx">{{citem.name || '-'}}</text> </view> <!-- 名称 --> <text>{{citem.progress ? citem.progress : 0}}%</text> </view> <view class="seeBox" wx:if="{{!isBuy && citem.freeFile ? true : false}}" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}" data-isTry="{{true}}" > <view class="seeBox" wx:if="{{!isBuy && citem.freeFile ? true : false}}" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}" data-isTry="{{true}}"> <!-- 云学习试看图标 --> <image src="/static/images/bookService/detail/shikan.png" class="testSee" ></image> <image src="/static/images/bookService/detail/shikan.png" class="testSee"></image> </view> </view> </view> </view> <!-- // 判断 不是商品 有子项 递归组件 --> <tree wx:if="{{ citem.sysType == 'CmsFolder' }}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" learnList="{{learnList}}" itemId="{{itemId}}" openIds="{{openIds}}" isBuy="{{isBuy}}" ></tree> <tree wx:if="{{ citem.sysType == 'CmsFolder' }}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" learnList="{{learnList}}" itemId="{{itemId}}" openIds="{{openIds}}" isBuy="{{isBuy}}"></tree> </view> <!-- 暂无数据 --> <view wx:if="{{!item.children || !item.children.length}}" class="noData"> @@ -234,4 +87,4 @@ </view> </t-collapse-panel> </t-collapse> </view> </view> pages/scanResult/index.wxml
@@ -1,54 +1,29 @@ <!--pages/index/scanResult/index.wxml--> <view class="content" wx:if="{{!isOther}}"> <view class="productWall" wx:if="{{productInfo.length > 0}}"> <view class="product" wx:for="{{productInfo}}" wx:for-item="item" wx:for-index="index" wx:key="index" > <view class="product" wx:for="{{productInfo}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <view class="productImg"> <image class="icon" src="{{item.icon}}" mode="aspectFit" /> </view> <view class="productInfo"> <text wx:if="{{item.name}}" class="publicCss">{{ item.name }}</text> <text wx:if="{{item.price}}" class="publicCss" <!-- <text wx:if="{{item.price}}" class="publicCss" >价格:<text style="color: red">¥{{ item.price }}</text></text > > --> <text class="type-box">{{item.itemType}}</text> </view> </view> </view> <view class="selectCard" wx:if="{{activeCodeAndStoreChannelLinks.length>0}}"> <t-cell title="{{description?description:'选择激活商品'}}" bordered="{{false}}" bindtap="selectPage" description="{{activeInfo && activeInfo.productIds.length>0?'已选择'+ activeInfo.productIds.length +'件商品':''}}" data-info="{{activeCodeAndStoreChannelLinks}}" arrow /> <t-cell title="{{description?description:'选择激活商品'}}" bordered="{{false}}" bindtap="selectPage" description="{{activeInfo && activeInfo.productIds.length>0?'已选择'+ activeInfo.productIds.length +'件商品':''}}" data-info="{{activeCodeAndStoreChannelLinks}}" arrow /> </view> <view class="couponWall" wx:if="{{couponList.length > 0}}"> <view class="coupon" wx:for="{{couponList}}" wx:for-item="item" wx:for-index="index" wx:key="index" > <image class="couponIcon" src="/static/images/web/coupon.png" mode="aspectFit" /> <view class="coupon" wx:for="{{couponList}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <image class="couponIcon" src="/static/images/web/coupon.png" mode="aspectFit" /> <view class="price">¥{{ item.value }}元</view> <view class="couponInfo"> <text>{{ item.name }}</text> <text class="timer" >{{ item.isForAllProduct ? "全场可用" : "仅可购买指定商品" }}</text > <text class="timer">{{ item.isForAllProduct ? "全场可用" : "仅可购买指定商品" }}</text> <view class="timer"> <text>{{ item.start }}</text> <text>~</text> @@ -57,13 +32,8 @@ </view> </view> </view> <view class="button-example" wx:if="{{productInfo.length > 0 || couponList.length > 0}}" > <t-button bindtap="useActiveCode" size="large" block >{{textValue}}</t-button > <view class="button-example" wx:if="{{productInfo.length > 0 || couponList.length > 0}}"> <t-button bindtap="useActiveCode" size="large" block>{{textValue}}</t-button> </view> <view class="text"> <rich-text space="emsp" nodes="{{rules.tourism_content}}" /> @@ -75,4 +45,4 @@ </view> <view wx:else class="empyt"> <t-empty icon="error-circle" description="请扫描正确的二维码" /> </view> </view>