From 266c7278841d2cbae5e9ab969ffd2efae1d0dda5 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期五, 06 九月 2024 10:08:55 +0800 Subject: [PATCH] renwu --- pages/digitalTextbooks/index.wxml | 2 pages/home/home.js | 26 + packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml | 40 - pages/digitalCourses/digitalCoursesDetails/index.js | 109 ++++-- packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxss | 2 packageBookService/pages/bookServices/detail/components/learnTask/index.js | 305 +++++++++++++++++++ packageBookService/pages/bookServices/detail/components/learnTask/index.wxss | 173 ++++++++++ packageBookService/pages/bookServices/detail/components/learnTask/index.wxml | 147 +++++++++ packageBookService/pages/bookServices/detail/components/learnTask/index.json | 12 packageBookService/pages/bookServices/detail/components/teachResource/index.wxml | 4 packageDomain/pages/resourceDetails/myVideo/index.js | 26 + packagePersonal/pages/publishBooks/index.wxss | 1 services/home/home.js | 12 pages/digitalCourses/index.wxml | 2 pages/digitalCourses/digitalCoursesDetails/index.wxss | 3 pages/digitalCourses/index.js | 5 app.json | 3 pages/digitalCourses/digitalCoursesDetails/index.wxml | 26 packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js | 5 packageDomain/pages/resourceDetails/myVideo/index.wxml | 2 pages/cart/paymentPage/index.js | 5 pages/personalCenter/index.js | 9 pages/home/home.wxss | 1 23 files changed, 807 insertions(+), 113 deletions(-) diff --git a/app.json b/app.json index 7c9e747..d1fbd39 100644 --- a/app.json +++ b/app.json @@ -76,7 +76,8 @@ "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" ] } ], diff --git a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js index 9d5ee0d..716486a 100644 --- a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js +++ b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js @@ -63,6 +63,11 @@ this.setData({ buy: type }) + }, + goLearnTask() { + wx.navigateTo({ + url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}`, + }) } } }) \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml index ed858eb..ae932ee 100644 --- a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml +++ b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxml @@ -1,43 +1,21 @@ <!--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锛廼con.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锛廼con.png" /> + <text>瀛︿範浠诲姟鍗�</text> + </view> </t-button> --> -</view> +</view> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxss b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxss index 17eda23..88206ab 100644 --- a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxss +++ b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.wxss @@ -8,7 +8,7 @@ } .btn { - width: 300rpx; + width: 220rpx; font-size: 28rpx; --td-button-primary-bg-color: #fff; --td-button-primary-border-color: #FF6C00; diff --git a/packageBookService/pages/bookServices/detail/components/learnTask/index.js b/packageBookService/pages/bookServices/detail/components/learnTask/index.js new file mode 100644 index 0000000..e3a9020 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/learnTask/index.js @@ -0,0 +1,305 @@ +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() { + + } +}) \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/learnTask/index.json b/packageBookService/pages/bookServices/detail/components/learnTask/index.json new file mode 100644 index 0000000..e46006e --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/learnTask/index.json @@ -0,0 +1,12 @@ +{ + "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" + } +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/learnTask/index.wxml b/packageBookService/pages/bookServices/detail/components/learnTask/index.wxml new file mode 100644 index 0000000..7e3d008 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/learnTask/index.wxml @@ -0,0 +1,147 @@ +<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锛廼con.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> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/learnTask/index.wxss b/packageBookService/pages/bookServices/detail/components/learnTask/index.wxss new file mode 100644 index 0000000..69260f4 --- /dev/null +++ b/packageBookService/pages/bookServices/detail/components/learnTask/index.wxss @@ -0,0 +1,173 @@ +/* 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; +} \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml b/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml index c101bbe..c475deb 100644 --- a/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml +++ b/packageBookService/pages/bookServices/detail/components/teachResource/index.wxml @@ -1,8 +1,8 @@ <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> 鎵归噺涓嬭浇 diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index 4fc32a4..24c52d0 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -25,6 +25,7 @@ productLinkPath: '', threeLeveData: [], showData: '', + showDataVod: '', src: '', selectedId: null, topicId: '', @@ -255,11 +256,14 @@ 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({ @@ -290,14 +294,36 @@ 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 { diff --git a/packageDomain/pages/resourceDetails/myVideo/index.wxml b/packageDomain/pages/resourceDetails/myVideo/index.wxml index 9d6c8ab..41d0ae0 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.wxml +++ b/packageDomain/pages/resourceDetails/myVideo/index.wxml @@ -14,7 +14,7 @@ <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> diff --git a/packagePersonal/pages/publishBooks/index.wxss b/packagePersonal/pages/publishBooks/index.wxss index 5fc4769..66c666a 100644 --- a/packagePersonal/pages/publishBooks/index.wxss +++ b/packagePersonal/pages/publishBooks/index.wxss @@ -95,7 +95,6 @@ width: 100%; height: 78vh; white-space: nowrap; - } .block-content { diff --git a/pages/cart/paymentPage/index.js b/pages/cart/paymentPage/index.js index 2b42ac5..818666c 100644 --- a/pages/cart/paymentPage/index.js +++ b/pages/cart/paymentPage/index.js @@ -157,7 +157,7 @@ orderGoods: res.orderNumber }) this.setData({ - price: res.payPrice, + price: res.payPrice.toFixed(2), payPrice: res.payPrice.toFixed(2), ImmediatelyReceive: res.payPrice }) @@ -224,10 +224,11 @@ 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 { diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index 7066a1d..c41e720 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.js +++ b/pages/digitalCourses/digitalCoursesDetails/index.js @@ -2,7 +2,7 @@ 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"; @@ -98,8 +98,9 @@ publishingUnit: '', pubCertificateHide: true, cbzsImg: '', //鍑虹増璇佷功base64 - rzzsImg: '' //璁よ瘉璇佷功base64 - + rzzsImg: '', //璁よ瘉璇佷功base64 + imageWidth: '', //鐢诲湪鐢诲竷涓婄殑鍥剧墖鐨勫搴� + imageHeight: '', //鐢诲湪鐢诲竷涓婄殑鍥剧墖鐨勯珮搴� }, formatDate(dateString) { if (!dateString) { @@ -282,7 +283,7 @@ expire: res.false }) } - res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY骞碝M鏈圖D鏃�') + res.datas.publicationDate = moment(res.datas.publicationDate).format('YYYY骞碝M鏈�') res.datas.price = res.datas.price.toFixed(2) wx.setNavigationBarTitle({ @@ -310,6 +311,7 @@ } 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, @@ -346,7 +348,7 @@ tabValue: value }) if (this.data.tabValue == 1) { - // this.saveAsImage() + this.saveAsImage() } if (this.data.tabValue == 2) { this.getResource() @@ -823,48 +825,69 @@ }, //鐢宠璇佷功 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鑺傜偣鐨刬d, - 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({ + // 閫夋嫨闇�瑕佺敓鎴恈anvas鐨勮寖鍥� + 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() { @@ -1135,7 +1158,7 @@ //璇佷功鏌ョ湅 onClick1() { this.setData({ - images: ['https://jsek.bnuic.com/home/certificate/szkc.jpg'], + images: [this.data.cbzsImg], showIndex: true, visible: true, }) diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxml b/pages/digitalCourses/digitalCoursesDetails/index.wxml index 9ee9fa2..ea1cde4 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxml +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxml @@ -94,27 +94,27 @@ <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"> diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxss b/pages/digitalCourses/digitalCoursesDetails/index.wxss index 2de52ef..8c5e864 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxss +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxss @@ -429,13 +429,12 @@ 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 { diff --git a/pages/digitalCourses/index.js b/pages/digitalCourses/index.js index 9175e6e..4abba99 100644 --- a/pages/digitalCourses/index.js +++ b/pages/digitalCourses/index.js @@ -171,8 +171,9 @@ // // 鎼滅储妗� 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() } } diff --git a/pages/digitalCourses/index.wxml b/pages/digitalCourses/index.wxml index 7a1efb3..c8e87c7 100644 --- a/pages/digitalCourses/index.wxml +++ b/pages/digitalCourses/index.wxml @@ -6,7 +6,7 @@ <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"> diff --git a/pages/digitalTextbooks/index.wxml b/pages/digitalTextbooks/index.wxml index bb029f5..ca81055 100644 --- a/pages/digitalTextbooks/index.wxml +++ b/pages/digitalTextbooks/index.wxml @@ -7,7 +7,7 @@ <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"> diff --git a/pages/home/home.js b/pages/home/home.js index b6977fe..cfeb887 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -248,9 +248,9 @@ const obj = { storeInfo: "app.config.goodsStore", path: item.pathList + '\\' + item.id, - coverSize: { - width: 260 - }, + // coverSize: { + // height: 205 + // }, paging: { start: 0, size: 4 @@ -446,6 +446,11 @@ }); }, goSubjectDetail(e) { + return wx.showToast({ + title: "寤鸿涓�", + icon: 'none', + duration: 1000 + }) const item = e.currentTarget.dataset.book console.log(item); wx.navigateTo({ @@ -453,6 +458,11 @@ }); }, goCourseDetail(e) { + return wx.showToast({ + title: "寤鸿涓�", + icon: 'none', + duration: 1000 + }) const { book } = e.currentTarget.dataset; @@ -577,11 +587,21 @@ 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 }) diff --git a/pages/home/home.wxss b/pages/home/home.wxss index b23f2a5..b152de7 100644 --- a/pages/home/home.wxss +++ b/pages/home/home.wxss @@ -310,6 +310,7 @@ width: 336rpx; height: 205rpx; flex: 1; + margin: 0 auto; } .listBox1 .body-info { diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js index 2820193..da20ca8 100644 --- a/pages/personalCenter/index.js +++ b/pages/personalCenter/index.js @@ -18,7 +18,8 @@ { title: '鎴戠殑璇佷功', icon: '/static/images/personal/certificate.png', - url: '/pages/personalCenter/certificate/index', + url: '', + // url: '/pages/personalCenter/certificate/index', type: 'certificate', }, { @@ -42,13 +43,15 @@ { 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', } ]; diff --git a/services/home/home.js b/services/home/home.js index a9919ea..612511b 100644 --- a/services/home/home.js +++ b/services/home/home.js @@ -21,8 +21,8 @@ text: '鏁板瓧璇剧▼', key: 2, icon: '/static/images/home/shuzikecheng@2x.png', - url: '/pages/digitalCourses/index', - // url: '' + // url: '/pages/digitalCourses/index', + url: '' }, { text: '鏁板瓧鏁欐潗', @@ -35,8 +35,8 @@ text: '涓撻娲诲姩', key: 4, icon: '/static/images/home/zhuantitaolun@2x.png', - url: '/pages/specialDiscussion/index', - // url: '' + // url: '/pages/specialDiscussion/index', + url: '' }, { text: '绾夸笂涔﹀睍', @@ -66,8 +66,8 @@ text: '鎴戣鍑轰功', key: 9, icon: '/static/images/home/xueshuzhuzuo@2x.png', - url: '/packageDomain/pages/publickBookForm/index', - // url: '', + // url: '/packageDomain/pages/publickBookForm/index', + url: '', }, ], }; -- Gitblit v1.9.1