| | |
| | | "pages/bookServices/examination/examination", |
| | | "pages/bookServices/webpage/index", |
| | | "pages/components/webView/index", |
| | | "pages/bookServices/detail/buyResource/index" |
| | | "pages/bookServices/detail/buyResource/index", |
| | | "pages/bookServices/detail/components/learnTask/index" |
| | | ] |
| | | } |
| | | ], |
| | |
| | | this.setData({ |
| | | buy: type |
| | | }) |
| | | }, |
| | | goLearnTask() { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}`, |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | |
| | | <!--pages/bookServices/detail/components/learnResource/learnResource.wxml--> |
| | | <view |
| | | class="learnResource" |
| | | theme="primary" |
| | | style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};" |
| | | > |
| | | <t-button |
| | | wx:if="{{isshowDrawBtn}}" |
| | | loading="{{receive}}" |
| | | class="btn" |
| | | theme="primary" |
| | | style="height: 72rpx; font-size: 28rpx" |
| | | t-class="external-class" |
| | | bind:tap="getFreeResource" |
| | | > |
| | | <view class="learnResource" theme="primary" style="justify-content: {{!isshowDrawBtn ? 'flex-end' : ''}};"> |
| | | <t-button wx:if="{{isshowDrawBtn}}" loading="{{receive}}" class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx" t-class="external-class" bind:tap="getFreeResource"> |
| | | <view slot="content" class="btn-content"> |
| | | <image src=" /static/images/bookService/detail/yijianlingqu.png" /> |
| | | <text>领取查看</text> |
| | | </view> |
| | | </t-button> |
| | | <t-button |
| | | loading="{{buy}}" |
| | | class="btn" |
| | | theme="primary" |
| | | style="height: 72rpx; font-size: 28rpx" |
| | | bind:tap="goBuyResource" |
| | | style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 30rpx' : ''}}" |
| | | > |
| | | <t-button loading="{{buy}}" class="btn" theme="primary" bind:tap="goBuyResource" style="height: 72rpx; font-size: 28rpx;margin: {{!isshowDrawBtn ? '0 20rpx' : ''}}"> |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/yijiangoumai.png" /> |
| | | <text>资源购买</text> |
| | | </view> |
| | | </t-button> |
| | | <!-- <t-button |
| | | class="btn" |
| | | theme="primary" |
| | | style="height: 72rpx; font-size: 28rpx" |
| | | wx:if="{{false}}" |
| | | > |
| | | <image src="/static/images/bookService/detail/renwudan/icon.png" /> |
| | | 学习任务单 |
| | | <!-- <t-button class="btn" theme="primary" style="height: 72rpx; font-size: 28rpx;margin:0 20rpx" bind:tap="goLearnTask"> |
| | | <view slot="content" class="btn-content"> |
| | | <image src="/static/images/bookService/detail/renwudan/icon.png" /> |
| | | <text>学习任务单</text> |
| | | </view> |
| | | </t-button> --> |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | |
| | | .btn { |
| | | width: 300rpx; |
| | | width: 220rpx; |
| | | font-size: 28rpx; |
| | | --td-button-primary-bg-color: #fff; |
| | | --td-button-primary-border-color: #FF6C00; |
New file |
| | |
| | | const app = getApp(); |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | bookId: '', |
| | | consumer: '', |
| | | bookInfo: {}, |
| | | menuList: [], |
| | | loading: true, |
| | | name: '', |
| | | school: '', |
| | | class: '', |
| | | learnTime: '2', |
| | | taskShow: false, |
| | | dataList: [], //任务单 |
| | | tasksListData: [], //已填写任务单messsge |
| | | taskInfo: {}, //选中任务单目录 |
| | | tasksData: {}, //已填写任务单 |
| | | userId: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).id, |
| | | isUpdate: false, |
| | | taskId: 0, //默认选中目录id |
| | | autosize: { |
| | | maxHeight: 120, |
| | | minHeight: 80, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | if (options) { |
| | | this.setData({ |
| | | bookId: options.bookId, |
| | | consumer: options.consumer |
| | | }); |
| | | this.getResourceData() |
| | | } |
| | | |
| | | }, |
| | | |
| | | getResourceData() { |
| | | this.setData({ |
| | | loading: true, |
| | | }); |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.data.bookId, |
| | | cmsPath: 'jsek_learningTasks', |
| | | // cmsType: '*', |
| | | itemFields: { |
| | | SysType: 'CmsFolder' |
| | | }, |
| | | pading: { |
| | | start: 0, |
| | | size: 999 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | this.setData({ |
| | | bookInfo: res.datas, |
| | | }); |
| | | if (res.datas.cmsDatas[0].datas) { |
| | | let list = res.datas.cmsDatas[0].datas |
| | | let dataLists = [] |
| | | list.forEach(async (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 |
| | | } |
| | | } |
| | | const data = await app.MG.store.getProductDetail(query).then((res1) => { |
| | | // item.children = res1.datas.cmsDatas[0].datas |
| | | return res1.datas.cmsDatas[0].datas |
| | | }) |
| | | item.children = data |
| | | } |
| | | dataLists.push(item) |
| | | }) |
| | | this.setData({ |
| | | menuList: dataLists, |
| | | loading: false |
| | | }); |
| | | console.log(this.data.menuList) |
| | | } |
| | | this.getTasksList() |
| | | }) |
| | | }, |
| | | |
| | | getTask(e) { |
| | | console.log(e, 123) |
| | | let data = e.currentTarget.dataset.item |
| | | this.setData({ |
| | | taskShow: true, |
| | | }); |
| | | this.taskSelect(data) |
| | | }, |
| | | onVisibleChange(e) { |
| | | this.setData({ |
| | | taskShow: e.detail.visible, |
| | | }); |
| | | }, |
| | | onCloseTask() { |
| | | this.setData({ |
| | | taskShow: false, |
| | | dataList: [] |
| | | }); |
| | | }, |
| | | |
| | | getTasksList() { |
| | | let query = { |
| | | start: 0, |
| | | size: 999, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: 'learningTasks' |
| | | } |
| | | app.MG.ugc.getTopicMessageList(query).then((res) => { |
| | | this.setData({ |
| | | tasksListData: res.datas, |
| | | }); |
| | | }) |
| | | }, |
| | | taskSelect(item) { |
| | | if (!item.children) { |
| | | this.setData({ |
| | | taskInfo: item, |
| | | dataList: [] |
| | | }); |
| | | if (this.data.tasksListData.length > 0) { |
| | | this.data.tasksListData.forEach((item1) => { |
| | | let content = JSON.parse(item1.content) |
| | | if (content.id == this.data.taskInfo.id && content.userId == this.data.userId) { |
| | | isUpdate.value = true |
| | | tasksData.value = item1 |
| | | form.name = content.userName |
| | | form.school = content.school |
| | | form.class = content.class |
| | | form.learnTime = content.learnTime |
| | | this.setData({ |
| | | isUpdate: true, |
| | | tasksData: item1, |
| | | name: content.userName, |
| | | school: content.school, |
| | | class: content.class, |
| | | learnTime: content.learnTime |
| | | }); |
| | | this.getChildTasksList() |
| | | if (content.evaluate.length > 0) { |
| | | content.evaluate.forEach((element) => { |
| | | if (this.data.consumer == 'classmate') { |
| | | element.mateEvaluation = '' |
| | | } |
| | | if (this.data.consumer == 'teacher') { |
| | | element.teacherEvaluation = '' |
| | | } |
| | | }) |
| | | this.setData({ |
| | | dataList: content.evaluate |
| | | }); |
| | | } |
| | | console.log(1111) |
| | | } else { |
| | | this.goDetail(item) |
| | | } |
| | | }) |
| | | } else { |
| | | this.goDetail(item) |
| | | } |
| | | } |
| | | }, |
| | | goDetail(item) { |
| | | this.setData({ |
| | | dataList: [] |
| | | }); |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: this.data.bookId, |
| | | cmsPath: item.productLinkPath, |
| | | // cmsType: '*', |
| | | itemFields: { |
| | | SysType: 'CmsFolder', |
| | | subtaskDescription: [], |
| | | learningSuggestions: [] |
| | | }, |
| | | pading: { |
| | | start: 0, |
| | | size: 99 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetailNoChildren(query).then((res) => { |
| | | if (res.datas.cmsDatas[0].datas.length > 0) { |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | item.introspection = '' |
| | | item.completion = '' |
| | | item.selfEvaluation = '' |
| | | item.mateEvaluation = '' |
| | | item.teacherEvaluation = '' |
| | | }) |
| | | } |
| | | this.setData({ |
| | | dataList: res.datas.cmsDatas[0].datas |
| | | }); |
| | | console.log(this.data.dataList, 444) |
| | | }) |
| | | }, |
| | | getChildTasksList() { |
| | | let query = { |
| | | start: 0, |
| | | size: 999, |
| | | sort: { |
| | | type: 'Desc', |
| | | field: 'CreateDate' |
| | | }, |
| | | appRefCode: app.config.appRefCode, |
| | | topicIdOrRefCode: 'learningTasks', |
| | | parentId: this.data.tasksData.id |
| | | } |
| | | app.MG.ugc.getChildTopicMessageList(query).then((res) => { |
| | | if (res.datas.length > 0) { |
| | | this.data.dataList.forEach((item) => { |
| | | console.log(item, 1) |
| | | res.datas.forEach((item1) => { |
| | | let content = JSON.parse(item1.content) |
| | | if (content.teacherComment) { |
| | | content.teacherComment.forEach((item2) => { |
| | | if (item.id == item2.childTaskId) { |
| | | item.teacherEvaluation.push(item2) |
| | | } |
| | | }) |
| | | } |
| | | if (content.mateComment) { |
| | | content.mateComment.forEach((item3) => { |
| | | if (item.id == item3.childTaskId) { |
| | | item.mateEvaluation.push(item3) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //任务填写 |
| | | //反思 |
| | | onIntrospectionInput(e) { |
| | | console.log(e) |
| | | |
| | | }, |
| | | //完成情况 |
| | | onCompletionInput(e) { |
| | | |
| | | }, |
| | | //自己评价 |
| | | onSelfInput(e) { |
| | | |
| | | }, |
| | | //同伴评价 |
| | | onMateInput(e) { |
| | | |
| | | }, |
| | | //老师评价 |
| | | onTeacherInput(e) { |
| | | |
| | | }, |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() { |
| | | |
| | | } |
| | | }) |
New file |
| | |
| | | { |
| | | "navigationBarTitleText": "学习任务单", |
| | | "usingComponents": { |
| | | "t-input": "tdesign-miniprogram/input/input", |
| | | "t-textarea": "tdesign-miniprogram/textarea/textarea", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-popup": "tdesign-miniprogram/popup/popup", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "empty": "/components/empty/index" |
| | | } |
| | | } |
New file |
| | |
| | | <view class="container"> |
| | | <view class="page-body"> |
| | | <view class="from-item"> |
| | | <view class="label"><text class="icon"></text> 图书名称: </view> |
| | | <view class="item-content"> |
| | | {{bookInfo.name}} |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"><text class="icon">*</text> 姓名: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入姓名" borderless value="{{name}}" bindchange="bindTnputBlur" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"> <text class="icon">*</text>学校: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="输学校名称" borderless value="{{school}}" type="number" bindchange="onSchoolInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"><text class="icon">*</text> 班级: </view> |
| | | <view class="item-content"> |
| | | <t-input placeholder="请输入班级" borderless value="{{class}}" bindchange="bindClassBlur" /> |
| | | </view> |
| | | </view> |
| | | <view class="from-item"> |
| | | <view class="label"><text class="icon">*</text> 学习时长: </view> |
| | | <view class="item-content"> |
| | | {{learnTime}} |
| | | </view> |
| | | </view> |
| | | <!-- <view class="from-item"> |
| | | <view class="label"> <text class="icon">*</text>反馈内容: </view> |
| | | <view class="item-content"> |
| | | |
| | | <t-textarea placeholder="请输入反馈内容" value="{{content}}" disableDefaultPadding="{{true}}" autosize="{{true}}" bind:line-change="onLineChange" maxlength="300" indicator bindchange="bindTextAreaBlur" /> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | <view class="content-Box"> |
| | | <view class="item-title"> |
| | | <image src="/static/images/bookService/detail/renwudan/icon.png" class="icon" /> |
| | | <view>学习任务单</view> |
| | | </view> |
| | | <view class="item-box" wx:if="{{menuList.length > 0 && !loading}}"> |
| | | <view wx:for="{{menuList}}" wx:for-item="item" wx:for-index="index" wx:key="id" class="item"> |
| | | <view class="itemCon"> |
| | | <view> |
| | | </view> |
| | | <view bind:tap="getTask" data-item="{{item}}">{{ item.name }}</view> |
| | | </view> |
| | | <view class="childBox"> |
| | | <view wx:for="{{item.children}}" wx:for-item="item1" wx:for-index="index" wx:key="id" class="item"> |
| | | <view bind:tap="getTask" data-item="{{item}}">{{ item1.name }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="popupBox"> |
| | | <t-popup visible="{{taskShow}}" bind:visible-change="onVisibleChange" placement="center"> |
| | | <view class="block"> |
| | | <scroll-view class="srcolbox" scroll-y scroll-height-animation="true"> |
| | | <view class="dataList"> |
| | | <view wx:if="{{dataList.length > 0}}"> |
| | | <view wx:for="{{dataList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="item-Con-Box"> |
| | | <view class="description"> |
| | | <view class="label"> |
| | | <view>{{ index + 1 }}、</view> |
| | | <view class="des">任务描述</view> |
| | | </view> |
| | | <view class="name">{{ item.subtaskDescription }}</view> |
| | | </view> |
| | | <view class="pointer"> |
| | | <view class="name">图书建议:</view> |
| | | <view>{{ item.learningSuggestions }}</view> |
| | | </view> |
| | | <view class="evaluateBox"> |
| | | <view class="box-list"> |
| | | <view class="lable"><text class="icon">*</text>学习反思:</view> |
| | | <view class="inputBox"> |
| | | <t-textarea placeholder="请输入学习反思" value="{{item.introspection}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" data-index="{{index}}" bindchange="onIntrospectionInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="box-list"> |
| | | <view class="lable"><text class="icon">*</text>完成情况:</view> |
| | | <view class="inputBox"> |
| | | <t-textarea placeholder="请输入完成情况" value="{{item.completion}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onCompletionInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="box-list"> |
| | | <view class="lable"><text class="icon">*</text>自己评:</view> |
| | | <view class="inputBox"> |
| | | <t-textarea placeholder="请输入评价" value="{{item.selfEvaluation}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onSelfInput" /> |
| | | </view> |
| | | </view> |
| | | <view class="box-list" wx:if="{{consumer == 'classmate' || !consumer}}"> |
| | | <view class="lable">同伴评:</view> |
| | | <view class="inputBox"> |
| | | <t-textarea placeholder="请输入评价" value="{{item.mateEvaluation}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onMateInput" wx:if="{{consumer == 'classmate'}}" /> |
| | | <view wx:if="{{isUpdate && item.mateEvaluation.length > 0}}" class="rateList"> |
| | | <view wx:for="{{item.mateEvaluation}}" wx:for-item="mateItem" wx:key="index"> |
| | | <view class="userName">{{ mateItem.userName }}</view> |
| | | <view>{{ mateItem.evaluation }}</view> |
| | | </view> |
| | | </view> |
| | | <text wx:if="{{consumer != 'classmate' && item.mateEvaluation.length == 0}}">暂无数据</text> |
| | | </view> |
| | | </view> |
| | | <view class="box-list" wx:if="{{consumer == 'teacher' || !consumer}}"> |
| | | <view class="lable">老师评:</view> |
| | | <view class="inputBox"> |
| | | <t-textarea placeholder="请输入评价" value="{{item.teacherEvaluation}}" disableDefaultPadding="{{true}}" autosize="{{autosize}}" bindchange="onTeacherInput" wx:if="{{consumer == 'teacher'}}" /> |
| | | <view wx:if="{{isUpdate && item.teacherEvaluation.length > 0}}" class="rateList"> |
| | | <view wx:for="{{item.teacherEvaluation}}" wx:for-item="mateItem" wx:key="index"> |
| | | <view class="userName">{{ mateItem.userName }}</view> |
| | | <view>{{ mateItem.evaluation }}</view> |
| | | </view> |
| | | </view> |
| | | <text wx:if="{{consumer != 'teacher' && item.teacherEvaluation.length == 0}}">暂无数据</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view wx:if="{{dataList.length == 0}}" class="empyt"> |
| | | <empty /> |
| | | </view> |
| | | <view class="buttonBox"> |
| | | <t-button class="btn" theme="primary" bind:tap="submitComment" wx:if="{{consumer}}"> |
| | | <view slot="content" class="btn-content">提交</view> |
| | | </t-button> |
| | | <t-button class="btn" theme="primary" bind:tap="updateSubmit" wx:if="{{isUpdate && !consumer}}"> |
| | | <view slot="content" class="btn-content">邀请评价</view> |
| | | </t-button> |
| | | <t-button class="btn" theme="primary" bind:tap="inviteBtn" wx:if="{{!isUpdate && !consumer}}"> |
| | | <view slot="content" class="btn-content">邀请评价</view> |
| | | </t-button> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="onCloseTask" /> |
| | | </view> |
| | | </t-popup> |
| | | </view> |
| | | </view> |
New file |
| | |
| | | /* packageBookService/pages/bookServices/detail/components/learnTask/index.wxss */ |
| | | page { |
| | | box-sizing: border-box; |
| | | padding: 0 24rpx; |
| | | } |
| | | |
| | | .page-body { |
| | | padding: 20rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .from-item { |
| | | margin-bottom: 20rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .from-item .label { |
| | | width: 180rpx; |
| | | height: 68rpx; |
| | | line-height: 68rpx; |
| | | } |
| | | |
| | | .t-input__content, |
| | | .t-textarea { |
| | | border: 2rpx solid #D9D9D9 !important; |
| | | padding: 10rpx !important; |
| | | } |
| | | |
| | | .t-textarea { |
| | | min-height: 200rpx; |
| | | } |
| | | |
| | | .t-input { |
| | | padding: 0 !important; |
| | | } |
| | | |
| | | .t-input__tips, |
| | | .from-item .label .icon { |
| | | color: #f56c6c !important; |
| | | margin-right: 5rpx; |
| | | } |
| | | |
| | | .t-input__placeholder, |
| | | .t-textarea__placeholder { |
| | | font-size: 28rpx !important; |
| | | } |
| | | |
| | | .content-Box { |
| | | padding: 20rpx; |
| | | } |
| | | |
| | | .item-title { |
| | | padding: 20rpx; |
| | | font-weight: bold; |
| | | display: flex; |
| | | align-items: center; |
| | | background: #fff6f0; |
| | | } |
| | | |
| | | .icon { |
| | | width: 36rpx; |
| | | height: 36rpx; |
| | | margin-right: 10rpx; |
| | | } |
| | | |
| | | .item-box { |
| | | padding: 10rpx; |
| | | } |
| | | |
| | | .item { |
| | | padding: 10rpx 0; |
| | | } |
| | | |
| | | .block { |
| | | position: relative; |
| | | width: 90vw; |
| | | height: 80vh; |
| | | background: var(--td-bg-color-container); |
| | | border-radius: 16rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .srcolbox { |
| | | width: 100%; |
| | | height: 80vh; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .dataList { |
| | | width: 100%; |
| | | height: 100%; |
| | | white-space: pre-wrap; |
| | | } |
| | | |
| | | .item-Con-Box { |
| | | padding: 20rpx; |
| | | } |
| | | |
| | | .description { |
| | | padding: 10rpx 0; |
| | | } |
| | | |
| | | .label { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .des { |
| | | padding: 2px 5px; |
| | | background: rgba(255, 108, 0, 0.1); |
| | | color: #ff6d00; |
| | | } |
| | | |
| | | .description .name { |
| | | margin: 10rpx 0; |
| | | margin-left: 40rpx; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .pointer { |
| | | margin-left: 40rpx; |
| | | } |
| | | |
| | | .pointer .name { |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .box-list { |
| | | margin-top: 30rpx; |
| | | margin-left: 10rpx; |
| | | } |
| | | |
| | | .box-list .lable { |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .lable .icon { |
| | | color: #f56c6c; |
| | | } |
| | | |
| | | .buttonBox { |
| | | text-align: center; |
| | | padding: 30rpx; |
| | | } |
| | | |
| | | .btn { |
| | | width: 200rpx; |
| | | font-size: 28rpx; |
| | | height: 68rpx !important; |
| | | font-size: 28rpx; |
| | | --td-button-primary-bg-color: #fff; |
| | | --td-button-primary-border-color: #FF6C00; |
| | | --td-button-primary-color: #ff6c00; |
| | | --td-button-primary-active-bg-color: #fff0e6; |
| | | --td-button-primary-active-border-color: #ff6c00; |
| | | padding: 0; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .close-btn { |
| | | position: absolute; |
| | | left: 50%; |
| | | margin-left: -32rpx; |
| | | bottom: calc(-1 * (48rpx + 64rpx)); |
| | | } |
| | | |
| | | |
| | | .submit { |
| | | background: #ff6c00; |
| | | color: #fff; |
| | | } |
| | |
| | | <view class="teach-btn"> |
| | | <t-button theme="primary" style="width: 120px; height: 36px" class="btn-upload" bind:tap="uploadBtn"> |
| | | <!-- <t-button theme="primary" style="width: 120px; height: 36px" class="btn-upload" bind:tap="uploadBtn"> |
| | | <t-image src="/static/images/bookService/detail/upload.png" style="margin-top: 20rpx"></t-image> |
| | | <text>上传资源</text> |
| | | </t-button> |
| | | </t-button> --> |
| | | <!-- <t-button theme="primary" style="width: 120px; height: 36px"> |
| | | <t-image src="/static/images/bookService/detail/download.png"></t-image> |
| | | 批量下载 |
| | |
| | | productLinkPath: '', |
| | | threeLeveData: [], |
| | | showData: '', |
| | | showDataVod: '', |
| | | src: '', |
| | | selectedId: null, |
| | | topicId: '', |
| | |
| | | showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey), |
| | | titleName: items.name |
| | | }) |
| | | this.aliVod(file, this.data.showData) |
| | | |
| | | } else { |
| | | this.setData({ |
| | | showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile, |
| | | titleName: items.name |
| | | }) |
| | | this.aliVod(items.file, this.data.showData) |
| | | } |
| | | let selectedIndex = index; // 存储选中项的索引 |
| | | this.setData({ |
| | |
| | | this.setData({ |
| | | showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey) |
| | | }) |
| | | this.aliVod(file, this.data.showData) |
| | | } else { |
| | | this.setData({ |
| | | showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile, |
| | | }) |
| | | this.aliVod(item.file, this.data.showData) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | aliVod(md5, currentVideo) { |
| | | let query = { |
| | | md5: md5, |
| | | appRefCode: config.appRefCode |
| | | } |
| | | MG.file.getAliVod(query).then((res) => { |
| | | if (res) { |
| | | this.setData({ |
| | | showDataVod: res, |
| | | }) |
| | | } else if (currentVideo) { |
| | | this.setData({ |
| | | showDataVod: currentVideo, |
| | | }) |
| | | } else { |
| | | return ElMessage.error('无法获取视频资源') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | timeUpdate(e) { |
| | | console.log(2); |
| | | let { |
| | |
| | | <t-loading theme="circular" size="60rpx" class="wrapper" loading="{{videoLoaidng}}" /> |
| | | </view> |
| | | <!-- <video show-center-play-btn="{{false}}" src="{{showData}}" bindloadedmetadata="loadedmetadata" bindtimeupdate="timeUpdate"></video> --> |
| | | <t-video id="tvd" src="{{showData}}" style="width:100%;" bindvideoloaded="loadedmetadata" bindtimeupdate="timeUpdate" wx:if="{{!videoLoaidng}}"> |
| | | <t-video id="tvd" src="{{showDataVod}}" style="width:100%;" bindvideoloaded="loadedmetadata" bindtimeupdate="timeUpdate" wx:if="{{!videoLoaidng}}"> |
| | | </t-video> |
| | | </view> |
| | | |
| | |
| | | width: 100%; |
| | | height: 78vh; |
| | | white-space: nowrap; |
| | | |
| | | } |
| | | |
| | | .block-content { |
| | |
| | | orderGoods: res.orderNumber |
| | | }) |
| | | this.setData({ |
| | | price: res.payPrice, |
| | | price: res.payPrice.toFixed(2), |
| | | payPrice: res.payPrice.toFixed(2), |
| | | ImmediatelyReceive: res.payPrice |
| | | }) |
| | |
| | | this.setData({ |
| | | payId: res.payList[0].id, |
| | | payPrice: res.payPrice, |
| | | deduct: (this.data.price - this.data.payPrice).toFixed(2), |
| | | deduct: (this.data.currentBalance / 100).toFixed(2), |
| | | integral: this.data.integral - this.data.currentBalance, |
| | | showIntegral: true |
| | | }); |
| | | console.log(this.data.price, this.data.payPrice, 123) |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | const app = getApp() |
| | | import SparkMD5 from 'spark-md5' |
| | | import FormData from '../../../utils/formdata/index.js'; |
| | | // import Wxml2Canvas from 'wxml2canvas'; |
| | | import Wxml2Canvas from 'wxml2canvas'; |
| | | import { |
| | | worksDataBytool |
| | | } from "../../../assets/js/toolClass.js"; |
| | |
| | | publishingUnit: '', |
| | | pubCertificateHide: true, |
| | | cbzsImg: '', //出版证书base64 |
| | | rzzsImg: '' //认证证书base64 |
| | | |
| | | rzzsImg: '', //认证证书base64 |
| | | imageWidth: '', //画在画布上的图片的宽度 |
| | | imageHeight: '', //画在画布上的图片的高度 |
| | | }, |
| | | formatDate(dateString) { |
| | | if (!dateString) { |
| | |
| | | expire: res.false |
| | | }) |
| | | } |
| | | res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY年MM月DD日') |
| | | res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY年MM月') |
| | | res.datas.price = res.datas.price.toFixed(2) |
| | | |
| | | wx.setNavigationBarTitle({ |
| | |
| | | } |
| | | this.getAboutBook(res.datas.productLinkInfo[res.datas.productLinkInfo.length - 1].LinkPath) |
| | | this.getCertificateList() |
| | | res.datas.content = res.datas.content.replace('../', app.config.requestCtx + '/') |
| | | this.setData({ |
| | | lecturerList: lecturer, |
| | | digitalsData: res.datas, |
| | |
| | | tabValue: value |
| | | }) |
| | | if (this.data.tabValue == 1) { |
| | | // this.saveAsImage() |
| | | this.saveAsImage() |
| | | } |
| | | if (this.data.tabValue == 2) { |
| | | this.getResource() |
| | |
| | | }, |
| | | //申请证书 |
| | | async saveAsImage() { |
| | | let query = wx.createSelectorQuery().in(this); |
| | | query.select("#pubCertificate").boundingClientRect(); |
| | | query.exec(function (res) { |
| | | console.log("View 的信息:", res[0]); |
| | | }); |
| | | console.log(value, 123) |
| | | let drawImage = new Wxml2Canvas({ |
| | | element: 'pubCertificate', // canvas节点的id, |
| | | obj: that, // 在组件中使用时,需要传入当前组件的this |
| | | width: this.width * 2, // 宽高 |
| | | height: this.height * 2, |
| | | background: '#fff', // 默认背景色 |
| | | progress(percent) { // 绘制进度 |
| | | }, |
| | | const that = this |
| | | const query = wx.createSelectorQuery().in(this) |
| | | query |
| | | .select('#pubCertificate') |
| | | .fields({ |
| | | // 选择需要生成canvas的范围 |
| | | size: true, |
| | | node: true, |
| | | scrollOffset: true, |
| | | }, |
| | | (data) => { |
| | | let width = data.width |
| | | let height = data.height |
| | | console.log(width, height) |
| | | that.setData({ |
| | | imageWidth: width, |
| | | imageHeight: height, |
| | | }) |
| | | }, |
| | | ) |
| | | .exec() |
| | | this.drawImage1() |
| | | |
| | | }, |
| | | drawImage1() { |
| | | let that = this; |
| | | let drawMyImage = new Wxml2Canvas({ |
| | | // width: 230, |
| | | // height: 325, |
| | | width: that.data.imageWidth, |
| | | height: that.data.imageHeight, |
| | | element: 'myCanvas', |
| | | background: '#f0f0f0', |
| | | progress(percent) {}, |
| | | finish(url) { |
| | | console.log("创建的图片", url); |
| | | console.log("生成的图片地址", url) |
| | | wx.getFileSystemManager().readFile({ |
| | | filePath: url, |
| | | encoding: 'base64', |
| | | success: (res) => { |
| | | let MyImageBase64 = 'data:image/jpg;base64,' + res.data |
| | | console.log('MyImageBase64', MyImageBase64) |
| | | that.setData({ |
| | | cbzsImg: MyImageBase64, |
| | | pubCertificateHide: false, |
| | | }) |
| | | }, |
| | | }) |
| | | }, |
| | | error(res) { |
| | | console.log(res); |
| | | // uni.hideLoading() |
| | | // 画失败的原因 |
| | | console.log("生成的图片失败", res) |
| | | } |
| | | }, this); |
| | | // const canvas = Wxml2Canvas.wxmlToCanvas(value); |
| | | // // 转换为图片 |
| | | // const img = Wxml2Canvas.canvasToTempImage(canvas); |
| | | // const path = Wxml2Canvas.canvasToTempFilePath(canvas); |
| | | // console.log(canvas) |
| | | // Wxml2Canvas(value).then((canvas) => { |
| | | // const img = canvas.toDataURL('image/png') |
| | | // this.setData({ |
| | | // cbzsImg: img, |
| | | // }) |
| | | // }) |
| | | |
| | | // Wxml2Canvas(textCertificate.value).then((canvas1) => { |
| | | // const img1 = canvas1.toDataURL('image/png') |
| | | // rzzsImg.value = img1 |
| | | // }) |
| | | this.setData({ |
| | | pubCertificateHide: false, |
| | | }) |
| | | let data = { |
| | | list: [{ |
| | | type: 'wxml', |
| | | class: '.my_canvas .my_draw_canvas', //.my_draw_canvas每个要绘制元素的类名 |
| | | limit: '.my_canvas', //my_canvas根元素类名 |
| | | x: 0, |
| | | y: 0 |
| | | }] |
| | | } |
| | | drawMyImage.draw(data, that); |
| | | }, |
| | | //获取字段 |
| | | getType() { |
| | |
| | | //证书查看 |
| | | onClick1() { |
| | | this.setData({ |
| | | images: ['https://jsek.bnuic.com/home/certificate/szkc.jpg'], |
| | | images: [this.data.cbzsImg], |
| | | showIndex: true, |
| | | visible: true, |
| | | }) |
| | |
| | | <view class="course-content"> |
| | | <view class="certificateChart"> |
| | | <view class="chart" bind:tap="onClick1"> |
| | | <image src="https://jsek.bnuic.com/home/certificate/szkc.jpg" mode="" /> |
| | | <image src="{{cbzsImg}}" mode="" /> |
| | | </view> |
| | | <view class="chart" bind:tap="onClick2"> |
| | | <image src="https://jsek.bnuic.com/home/certificate/kczs.jpg" mode="" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- <canvas canvas-id="share"></canvas> |
| | | <view id="pubCertificate" wx:if="pubCertificateHide"> |
| | | <image src="https://jsek.bnuic.com/home/certificate/szkc.jpg" mode="" class="bgImg" /> |
| | | <view class="certificateInfo"> |
| | | <view class="bookName">{{digitalsData.name}}</view> |
| | | <view class="author">{{digitalsData.courseLeader || '-' }}</view> |
| | | <view class="affiliatedUnit">{{digitalsData.affiliatedUnit || '-'}}</view> |
| | | <view class="affiliatedUnit"> {{ digitalsData.isbn || '-'}}</view> |
| | | <view class="affiliatedUnit">{{digitalsData.publicationDate}}</view> |
| | | <view class="affiliatedUnit">{{publishingUnit}}</view> |
| | | <view class="website">{{website}}</view> |
| | | <canvas canvas-id="myCanvas" style="height:845px;width:595px" wx:if="{{pubCertificateHide}}"></canvas> |
| | | <view id="pubCertificate" class="my_canvas" wx:if="{{pubCertificateHide}}"> |
| | | <image data-type="image" data-url="https://jsek.bnuic.com/home/certificate/szkc.jpg" src="https://jsek.bnuic.com/home/certificate/szkc.jpg" mode="" class="bgImg" /> |
| | | <view class="certificateInfo my_draw_canvas"> |
| | | <view class="bookName my_draw_canvas" data-type="text" data-text="{{digitalsData.name}}">{{digitalsData.name}}</view> |
| | | <view class="author my_draw_canvas" data-type="text" data-text="{{digitalsData.courseLeader}}">{{digitalsData.courseLeader || '-' }}</view> |
| | | <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{digitalsData.affiliatedUnit}}">{{digitalsData.affiliatedUnit || '-'}}</view> |
| | | <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{digitalsData.isbn}}"> {{ digitalsData.isbn || '-'}}</view> |
| | | <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{digitalsData.publicationDate}}">{{digitalsData.publicationDate}}</view> |
| | | <view class="affiliatedUnit my_draw_canvas" data-type="text" data-text="{{publishingUnit}}">{{publishingUnit}}</view> |
| | | <view class="website my_draw_canvas" data-type="text" data-text="{{website}}">{{website}}</view> |
| | | <view class="codeBox"></view> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel icon="{{ tabValue == '2' ? courseLearningClick : courseLearning}}" label="课程学习" value="2"> |
| | | <view class="course-content"> |
| | |
| | | width: 595px; |
| | | height: 845px; |
| | | position: relative; |
| | | background-image: url('https://jsek.bnuic.com/home/certificate/szkc.jpg'); |
| | | /* background-image: url('https://jsek.bnuic.com/home/certificate/szkc.jpg'); */ |
| | | } |
| | | |
| | | .bgImg { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | } |
| | | |
| | | .certificateInfo { |
| | |
| | | // // 搜索框 |
| | | if (this.data.searchValue) { |
| | | searchObj = { |
| | | 'Name*': this.data.searchValue.trim() |
| | | // '||subtitle*': searchInputValue.value.trim() |
| | | 'Name*': this.data.searchValue.trim(), |
| | | '||isbn*': searchInputValue.value.trim(), |
| | | '||courseLeader*': searchInputValue.value.trim() |
| | | } |
| | | } |
| | | |
| | |
| | | <view> |
| | | <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> |
| | | </view> |
| | | <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> |
| | | <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入课程名称/ISBN/课程负责人" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> |
| | | </view> |
| | | <view class="heardTab"> |
| | | <view class="tabBox"> |
| | |
| | | <view> |
| | | <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> |
| | | </view> |
| | | <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入关键词/书名/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> |
| | | <t-search model:value="{{searchValue}}" shape="round" placeholder="请输入教材名称/ISBN/作者" class="navBar-search" style="width: 464rpx" bind:submit="searchBook" /> |
| | | </view> |
| | | <view class="heardTab"> |
| | | <view class="tabBox"> |
| | |
| | | const obj = { |
| | | storeInfo: "app.config.goodsStore", |
| | | path: item.pathList + '\\' + item.id, |
| | | coverSize: { |
| | | width: 260 |
| | | }, |
| | | // coverSize: { |
| | | // height: 205 |
| | | // }, |
| | | paging: { |
| | | start: 0, |
| | | size: 4 |
| | |
| | | }); |
| | | }, |
| | | goSubjectDetail(e) { |
| | | return wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | const item = e.currentTarget.dataset.book |
| | | console.log(item); |
| | | wx.navigateTo({ |
| | |
| | | }); |
| | | }, |
| | | goCourseDetail(e) { |
| | | return wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | const { |
| | | book |
| | | } = e.currentTarget.dataset; |
| | |
| | | url: '/pages/home/digitalRead/index' |
| | | }) |
| | | } else if (type == "zhuantitaolun") { |
| | | return wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | wx.navigateTo({ |
| | | url: '/pages/specialDiscussion/index' |
| | | }) |
| | | |
| | | } else if (type == "jingxuankecheng") { |
| | | return wx.showToast({ |
| | | title: "建设中", |
| | | icon: 'none', |
| | | duration: 1000 |
| | | }) |
| | | wx.navigateTo({ |
| | | url: '/pages/digitalCourses/index?courseTypeActive=' + this.data.courseTypeActive |
| | | }) |
| | |
| | | width: 336rpx; |
| | | height: 205rpx; |
| | | flex: 1; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .listBox1 .body-info { |
| | |
| | | { |
| | | title: '我的证书', |
| | | icon: '/static/images/personal/certificate.png', |
| | | url: '/pages/personalCenter/certificate/index', |
| | | url: '', |
| | | // url: '/pages/personalCenter/certificate/index', |
| | | type: 'certificate', |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: '我的上传', |
| | | icon: '/static/images/personal/upload.png', |
| | | url: '/pages/personalCenter/myUpload/index', |
| | | url: '', |
| | | // url: '/pages/personalCenter/myUpload/index', |
| | | type: 'upload', |
| | | }, |
| | | { |
| | | title: '出书申请', |
| | | icon: '/static/images/personal/chushu.png', |
| | | url: '/packagePersonal/pages/publishBooks/index', |
| | | url: '', |
| | | // url: '/packagePersonal/pages/publishBooks/index', |
| | | type: 'publishBooks', |
| | | } |
| | | ]; |
| | |
| | | text: '数字课程', |
| | | key: 2, |
| | | icon: '/static/images/home/shuzikecheng@2x.png', |
| | | url: '/pages/digitalCourses/index', |
| | | // url: '' |
| | | // url: '/pages/digitalCourses/index', |
| | | url: '' |
| | | }, |
| | | { |
| | | text: '数字教材', |
| | |
| | | text: '专题活动', |
| | | key: 4, |
| | | icon: '/static/images/home/zhuantitaolun@2x.png', |
| | | url: '/pages/specialDiscussion/index', |
| | | // url: '' |
| | | // url: '/pages/specialDiscussion/index', |
| | | url: '' |
| | | }, |
| | | { |
| | | text: '线上书展', |
| | |
| | | text: '我要出书', |
| | | key: 9, |
| | | icon: '/static/images/home/xueshuzhuzuo@2x.png', |
| | | url: '/packageDomain/pages/publickBookForm/index', |
| | | // url: '', |
| | | // url: '/packageDomain/pages/publickBookForm/index', |
| | | url: '', |
| | | }, |
| | | ], |
| | | }; |