| | |
| | | if (subItem.productLinkInfo && subItem.productLinkInfo.length) { |
| | | let itemProductLinkInfo = subItem.productLinkInfo.find(citem => citem.Name == item.datas.Name) |
| | | subItem.productLinkPath = |
| | | itemProductLinkInfo.LinkPath + |
| | | itemProductLinkInfo?.LinkPath + |
| | | "\\" + |
| | | itemProductLinkInfo.CmsItemId; |
| | | itemProductLinkInfo?.CmsItemId; |
| | | } |
| | | if (subItem.linkInfo && subItem.linkInfo.length) |
| | | subItem.linkPath = |
| | |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | isShowBuyCloundBtn:{ |
| | | type:Boolean, |
| | | default:true |
| | | } |
| | | isShowBuyCloundBtn: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | learnTaskData: { |
| | | type: Object, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | |
| | | }, |
| | | goLearnTask() { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}`, |
| | | url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`, |
| | | }) |
| | | }, |
| | | buyCloudLearnClass() { |
| | |
| | | theme="primary" |
| | | style="height: 72rpx; font-size: 28rpx; margin: 0 20rpx" |
| | | bind:tap="goLearnTask" |
| | | wx:if="{{learnTaskData.name}}" |
| | | > |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/renwudan/icon.png" /> |
| | |
| | | data: { |
| | | height: '', //屏幕高度 |
| | | bookId: '', |
| | | cmsPath: '', |
| | | consumer: '', |
| | | bookInfo: {}, |
| | | menuList: [], |
| | |
| | | */ |
| | | onLoad(options) { |
| | | if (options) { |
| | | console.log(options, 666) |
| | | this.setData({ |
| | | bookId: options.bookId, |
| | | cmsPath: options.cmsPath, |
| | | taskId: options.bookId, |
| | | consumer: options.consumer, |
| | | userId: options.userId, |
| | |
| | | }); |
| | | if (options.consumer) { |
| | | this.setData({ |
| | | cmsPath: options.cmsPath, |
| | | bookId: options.bookId, |
| | | taskId: options.bookId, |
| | | consumer: options.consumer, |
| | |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.data.bookId, |
| | | cmsPath: 'jsek_learningTasks', |
| | | cmsPath: this.data.cmsPath, |
| | | // cmsType: '*', |
| | | itemFields: { |
| | | SysType: 'CmsFolder' |
| | |
| | | }); |
| | | if (res.datas.cmsDatas[0].datas) { |
| | | let list = res.datas.cmsDatas[0].datas |
| | | let dataList = [] |
| | | list.forEach((item) => { |
| | | if (item.childrenFolderCount > 0) { |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.data.bookId, |
| | | cmsPath: item.productLinkPath, |
| | | // cmsType: '*', |
| | | itemFields: { |
| | | SysType: 'CmsFolder' |
| | | }, |
| | | pading: { |
| | | start: 0, |
| | | size: 99 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | item.children = res.datas.cmsDatas[0].datas |
| | | }) |
| | | } |
| | | dataList.push(item) |
| | | }) |
| | | this.setData({ |
| | | menuList: list, |
| | | menuList: dataList, |
| | | loading: false, |
| | | }); |
| | | if (this.data.taskId) { |
| | | this.data.menuList.forEach((item) => { |
| | | if (item.id == this.data.taskId) { |
| | | setTimeout(() => { |
| | | this.data.menuList.forEach((item) => { |
| | | if (item.id == this.data.taskId) { |
| | | this.setData({ |
| | | taskInfo: item, |
| | | }); |
| | | } else if (item.children) { |
| | | item.children.forEach((item1) => { |
| | | if (item1.id == this.data.taskId) { |
| | | this.setData({ |
| | | taskInfo: item1, |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, 500) |
| | | } else { |
| | | setTimeout(() => { |
| | | if (this.data.menuList[0].children) { |
| | | this.setData({ |
| | | taskInfo: item, |
| | | taskInfo: this.data.menuList[0].children[0], |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | taskInfo: this.data.menuList[0], |
| | | }); |
| | | } |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | taskInfo: this.data.menuList[0], |
| | | }); |
| | | }, 500) |
| | | } |
| | | } |
| | | this.getTasksList() |
| | | }) |
| | | }, |
| | | |
| | | getTask(e) { |
| | | console.log(e, 123) |
| | | let data = e.currentTarget.dataset.item |
| | | if (data.childrenFolderCount > 0) { |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.data.bookId, |
| | | cmsPath: data.productLinkPath, |
| | | // cmsType: '*', |
| | | itemFields: { |
| | | SysType: 'CmsFolder' |
| | | }, |
| | | pading: { |
| | | start: 0, |
| | | size: 99 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then((res1) => { |
| | | this.data.menuList.forEach((item) => { |
| | | if (item.id == data.id) { |
| | | item.children = res1.datas.cmsDatas[0].datas |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | taskShow: true, |
| | | }); |
| | | } |
| | | this.taskSelect(data) |
| | | |
| | | }, |
| | | onVisibleChange(e) { |
| | | this.setData({ |
| | | taskShow: e.detail.visible, |
| | |
| | | this.setData({ |
| | | tasksListData: res.datas, |
| | | }); |
| | | this.taskSelect(this.data.taskInfo) |
| | | if (this.data.taskInfo) { |
| | | this.taskSelect(this.data.taskInfo) |
| | | } |
| | | }) |
| | | }, |
| | | taskSelect(item) { |
| | |
| | | if (this.data.tasksListData.length > 0) { |
| | | this.data.tasksListData.forEach((item1) => { |
| | | let content = JSON.parse(item1.content) |
| | | this.setData({ |
| | | name: content.userName, |
| | | school: content.school, |
| | | class: content.class, |
| | | learnTime: content.learnTime, |
| | | }); |
| | | if (content.id == this.data.taskInfo.id) { |
| | | if (content.userId == this.data.userId) { |
| | | this.setData({ |
| | |
| | | //任务填写 |
| | | //反思 |
| | | onIntrospectionInput(e) { |
| | | console.log(e) |
| | | let index = e.target.dataset.index |
| | | let data = 'dataList[' + index + '].introspection' |
| | | this.setData({ |
| | | [data]: e.detail.value |
| | | }); |
| | | console.log(this.data.dataList) |
| | | }, |
| | | //完成情况 |
| | | onCompletionInput(e) { |
| | |
| | | this.setData({ |
| | | [data]: e.detail.value |
| | | }); |
| | | console.log(this.data.dataList) |
| | | }, |
| | | //同伴评价 |
| | | onMateInput(e) { |
| | |
| | | }) |
| | | }, |
| | | onInviteeChange(e) { |
| | | console.log(e) |
| | | this.setData({ |
| | | invitee: e.detail.value |
| | | }); |
| | |
| | | wx.showShareMenu({ |
| | | withShareTicket: true |
| | | }); |
| | | console.log(888) |
| | | }, |
| | | submitComment() { |
| | | let mateEvaluationList = [] |
| | |
| | | isShowBuyCloundMenu: false, // 云学习全部购买按钮是否显示 |
| | | isCloundHaveSaleMethod: false, // 云学习是否有销售方式 |
| | | cloundMenuIsBuy: false, |
| | | learnTaskData: {}, |
| | | rejectCause: "", // 下载拒绝原因 |
| | | buyIdList: [], |
| | | shoppingCartGetId: [], // 已购买id列表 |
| | |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | this.setData({ |
| | | resourceCodeList: res.datas.cmsDatas[0].datas, |
| | | learnTaskData: res.datas.cmsDatas[0].datas.filter((item) => item.refCode == 'jsek_learningTasks')[0] |
| | | }) |
| | | console.log('refcode', this.data.resourceCodeList); |
| | | }) |
| | | }, |
| | | //请求子商品的文件 |
| | |
| | | isShowBuyCloundMenu="{{isShowBuyCloundMenu}}" |
| | | isShowBuyCloundBtn="{{isShowBuyCloundBtn}}" |
| | | bind:buyCloudLearnClass="buyCloudLearnClass" |
| | | learnTaskData="{{learnTaskData}}" |
| | | ></learn-resource> |
| | | |
| | | <tree |