From 3af1a4c3f1712445a17376205b9ee3c4d7768da6 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期二, 24 九月 2024 19:29:33 +0800 Subject: [PATCH] zs --- pages/digitalCourses/digitalCoursesDetails/index.wxss | 24 ++ pages/personalCenter/certificate/index.wxss | 8 pages/digitalCourses/digitalCoursesDetails/index.js | 175 ++++++++++++----- pages/digitalCourses/digitalCoursesDetails/index.wxml | 294 ++++++++++++++-------------- packageBookService/pages/bookServices/detail/components/learnTask/index.js | 17 + packageBookService/pages/bookServices/detail/components/learnTask/index.wxml | 8 pages/personalCenter/certificate/index.wxml | 7 package.json | 3 packageBookService/pages/bookServices/detail/components/learnTask/index.json | 3 pages/personalCenter/certificate/index.js | 25 ++ assets/js/config.js | 5 11 files changed, 358 insertions(+), 211 deletions(-) diff --git a/assets/js/config.js b/assets/js/config.js index 99f07e7..00895c5 100644 --- a/assets/js/config.js +++ b/assets/js/config.js @@ -23,7 +23,7 @@ export const reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; // 鐢佃瘽鍙锋鍒� export const reg_telphone = /^0\d{2}-\d{8}$|^0\d{3}-\d{7}$/; //搴ф満鍙锋鍒� - +export const shareUrl = "https://jsek.bnuic.com/QRCodePorject/#/otherJumpPage"; //寰俊鍒嗕韩杩涘叆灏忕▼搴� const config = { requestCtx, requestTimeOut, @@ -41,6 +41,7 @@ epubUrl, pdfUrl, appId, - textReaderUrl + textReaderUrl, + shareUrl }; export default config; \ No newline at end of file diff --git a/package.json b/package.json index 261fc89..89db507 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "spark-md5": "^3.0.2", "tdesign-miniprogram": "^1.0.0", "tslib": "^1.11.1", + "wxbarcode": "^1.0.2", "wxml2canvas": "^1.0.1" }, "devDependencies": { @@ -46,4 +47,4 @@ "lint-staged": "^10.0.8", "prettier": "^2.1.2" } -} \ No newline at end of file +} diff --git a/packageBookService/pages/bookServices/detail/components/learnTask/index.js b/packageBookService/pages/bookServices/detail/components/learnTask/index.js index 8cf3f61..5ea7969 100644 --- a/packageBookService/pages/bookServices/detail/components/learnTask/index.js +++ b/packageBookService/pages/bookServices/detail/components/learnTask/index.js @@ -33,7 +33,22 @@ dialogVisible: false, invitee: "", teacherEvaluated: false, - evaluated: false + evaluated: false, + rowCol: [{ + width: '50%', + }, + { + width: '100%' + }, + { + width: '80%' + }, + { + width: '100%' + }, { + width: '100%' + }, + ], }, onShow() { var that = this; diff --git a/packageBookService/pages/bookServices/detail/components/learnTask/index.json b/packageBookService/pages/bookServices/detail/components/learnTask/index.json index 9159b09..830c657 100644 --- a/packageBookService/pages/bookServices/detail/components/learnTask/index.json +++ b/packageBookService/pages/bookServices/detail/components/learnTask/index.json @@ -9,6 +9,7 @@ "t-button": "tdesign-miniprogram/button/button", "t-radio-group": "tdesign-miniprogram/radio-group/radio-group", "t-radio": "tdesign-miniprogram/radio/radio", - "empty": "/components/empty/index" + "empty": "/components/empty/index", + "t-skeleton": "tdesign-miniprogram/skeleton/skeleton" } } \ 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 index 6524d53..9de41a3 100644 --- a/packageBookService/pages/bookServices/detail/components/learnTask/index.wxml +++ b/packageBookService/pages/bookServices/detail/components/learnTask/index.wxml @@ -59,6 +59,14 @@ </view> </view> </view> + <view wx:else style="width: 100%; height: min-content;margin-top:40rpx"> + <t-skeleton + row-col="{{rowCol}}" + theme="paragraph" + animation="gradient" + loading="{{loading}}" + ></t-skeleton> + </view> </view> <view class="popupBox"> <t-popup visible="{{taskShow}}" bind:visible-change="onVisibleChange" placement="center"> diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index 6934b6b..57eed2f 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.js +++ b/pages/digitalCourses/digitalCoursesDetails/index.js @@ -4,13 +4,15 @@ import FormData from '../../../utils/formdata/index.js'; import Wxml2Canvas from 'wxml2canvas'; import { - worksDataBytool + worksDataBytool, + UpdateworksDataBytool } from "../../../assets/js/toolClass.js"; import moment from 'moment' import Toast from "tdesign-miniprogram/toast"; import { loginInfo } from '../../../assets/js/login'; +import wxbarcode from 'wxbarcode' Page({ /** @@ -104,6 +106,9 @@ imageWidth: '', //鐢诲湪鐢诲竷涓婄殑鍥剧墖鐨勫搴� imageHeight: '', //鐢诲湪鐢诲竷涓婄殑鍥剧墖鐨勯珮搴� website: 'https://jsek.bnuic.com/home/#/digitalCourses', + wxShareUrl: '', + imgUrl: '', + imgUrl1: '' }, formatDate(dateString) { if (!dateString) { @@ -243,6 +248,7 @@ }) }, digitalCoursesDetailsGet(digitalTextId) { + let that = this; let query = { path: '*', queryType: '*', @@ -329,8 +335,34 @@ ) this.setData({ digitalsData: res.datas, - loading: false + loading: false, + wxShareUrl: app.config.shareUrl + '?id=' + res.datas.id + '&path=' + this.data.bookPath + '&type=course' }) + if (this.data.wxShareUrl) { + wxbarcode.qrcode('qrcode', this.data.wxShareUrl, 160, 160); + wxbarcode.qrcode('qrcode1', this.data.wxShareUrl, 160, 160); + setTimeout(() => { + wx.canvasToTempFilePath({ + canvasId: 'qrcode', + success: function (res) { + // res.tempFilePath 鍖呭惈鐢熸垚鐨勫浘鐗囨枃浠惰矾寰� + that.setData({ + imgUrl: res.tempFilePath + }) + } + }); + wx.canvasToTempFilePath({ + canvasId: 'qrcode1', + success: function (res) { + // res.tempFilePath 鍖呭惈鐢熸垚鐨勫浘鐗囨枃浠惰矾寰� + + that.setData({ + imgUrl1: res.tempFilePath + }) + } + }); + }, 1000) + } }) }, //鑾峰彇涓昏浜� @@ -1056,7 +1088,7 @@ app.MG.ugc.getTopicMessageList(data).then((res) => { res.datas.map((item) => { item.content = JSON.parse(item.content) - if (item.content.id == this.data.bookId) { + if (item.content.bookId == this.data.bookId) { this.setData({ isCertificate: item, userName: item.content.userName, @@ -1064,29 +1096,26 @@ }) } }) - }) }, - - onCertificate() { - if (!this.data.isBuy) { - wx.showToast({ - title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", - icon: "none", - duration: 1000, - }); - return false - } - if (!this.data.isLearn) { - wx.showToast({ - title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�", - icon: "none", - duration: 1000, - }); - return false - } + // if (!this.data.isBuy) { + // wx.showToast({ + // title: "璇峰厛璐拱锛屼綋楠屽畬鏁存湇鍔�", + // icon: "none", + // duration: 1000, + // }); + // return false + // } + // if (!this.data.isLearn) { + // wx.showToast({ + // title: "鎮ㄧ殑瀛︿範浠诲姟杩樻湭瀹屾垚锛屾殏涓嶈兘鐢宠璇佷功锛屽姞娌瑰摝锛�", + // icon: "none", + // duration: 1000, + // }); + // return false + // } if (this.data.isCertificate && this.data.isCertificate.state == 'WaitAudit') { wx.showToast({ title: "鎮ㄧ敵璇风殑璇佷功姝e湪瀹℃牳涓�", @@ -1207,37 +1236,81 @@ userName: this.data.userInfo.fullName, userPicture: this.data.pictureMd5, studyTime: this.data.digitalsData.beginDate + '-' + year + '-' + month + '-' + today, - website: this.data.website + website: this.data.website, + wxShareUrl: this.data.wxShareUrl } - data = { - topicIdOrRefCode: 'applyCourseCertificate', - name: this.data.userInfo.fullName, - content: JSON.stringify(bookInfo), - state: 'WaitAudit', - cmsTypeRefCode: 'jsek_courseCertificate', - type: 'applyCourse', - newDataListRequest: worksDataBytool(this.data.worksInfo, this.data.userInfo) + + if (this.data.isCertificate.id) { + let dataRequests = UpdateworksDataBytool( + this.data.worksInfo, + [this.data.isCertificate], + this.data.userInfo + ) + + data = { + id: this.data.isCertificate.id, + topicIdOrRefCode: 'applyCourseCertificate', + name: this.data.userInfo.fullName, + content: JSON.stringify(bookInfo), + state: 'WaitAudit', + cmsTypeRefCode: 'jsek_courseCertificate', + type: 'applyCourse', + newDataRequests: dataRequests.newData, + updateDataRequests: dataRequests.updateData, + delDataRequest: { + ids: [] + } + } + app.MG.ugc + .updateTopicMessage(data) + .then((res) => { + wx.showToast({ + title: "宸叉彁浜ょ敵璇�", + icon: "none", + duration: 1000, + }); + this.setData({ + "userInfo.fullName": "", + dialogBox: false, + scrollJudge: true + }) + this.getCertificateList() + }) + .catch(() => { + btnLoading.value = false + }) + + } else { + data = { + topicIdOrRefCode: 'applyCourseCertificate', + name: this.data.userInfo.fullName, + content: JSON.stringify(bookInfo), + state: 'WaitAudit', + cmsTypeRefCode: 'jsek_courseCertificate', + type: 'applyCourse', + newDataListRequest: worksDataBytool(this.data.worksInfo, this.data.userInfo) + } + app.MG.ugc + .newTopicMessage(data) + .then((res) => { + wx.showToast({ + title: "宸叉彁浜ょ敵璇�", + icon: "none", + duration: 1000, + }); + this.setData({ + "userInfo.fullName": "", + dialogBox: false, + scrollJudge: true + }) + this.getCertificateList() + }) + .catch(() => { + this.setData({ + "userInfo.fullName": "", + }) + }) } - app.MG.ugc - .newTopicMessage(data) - .then((res) => { - wx.showToast({ - title: "宸叉彁浜ょ敵璇�", - icon: "none", - duration: 1000, - }); - this.setData({ - "userInfo.fullName": "", - dialogBox: false, - scrollJudge: true - }) - this.getCertificateList() - }) - .catch(() => { - this.setData({ - "userInfo.fullName": "", - }) - }) } else { wx.showToast({ title: "濮撳悕涓嶈兘涓虹┖", diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxml b/pages/digitalCourses/digitalCoursesDetails/index.wxml index 7154153..017cf75 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxml +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxml @@ -169,156 +169,14 @@ <view class="course-content"> <view class="certificateChart"> <view class="chart" bind:tap="onClick1"> - <image src="{{cbzsImg}}" mode="" /> + <t-image src="{{cbzsImg}}" mode="" class="chartImage"/> </view> <view class="chart" bind:tap="onClick2"> - <image src="{{rzzsImg}}" mode="" /> + <t-image src="{{rzzsImg}}" mode="" class="chartImage"/> </view> </view> </view> - <canvas - canvas-id="myCanvas" - style="height: 845px; width: 595px" - wx:if="{{pubCertificateHide}}" - ></canvas> - <view - id="pubCertificate" - class="my_canvas" - wx:if="{{pubCertificateHide}}" - > - <view class="pubCon"> - <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 my_draw_canvas" - /> - <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> - <canvas - canvas-id="myCanvas1" - style="height: 845px; width: 595px" - wx:if="{{pubCertificateHide}}" - ></canvas> - <view - id="textCertificate" - class="my_canvas1" - wx:if="{{pubCertificateHide}}" - > - <view class="pubCon"> - <image - data-type="image" - data-url="https://jsek.bnuic.com/home/certificate/kczs.jpg" - src="https://jsek.bnuic.com/home/certificate/kczs.jpg" - mode="" - class="bgImg my_draw_canvas1" - /> - <view class="certificateInfo my_draw_canvas1"> - <view class="userIcon my_draw_canvas1"> - <view class="hexagon my_draw_canvas1"> - <image src="{{userPicture}}" class="img my_draw_canvas1" /> - </view> - </view> - <view - class="userName my_draw_canvas1" - data-type="text" - data-text="{{userName}}" - >{{userName}}</view - > - <view - class="bookName my_draw_canvas1" - data-type="text" - data-text="{{digitalsData.name}}" - >{{digitalsData.name}}</view - > - <view - class="author my_draw_canvas1" - data-type="text" - data-text="{{digitalsData.courseLeader || '-'}}" - >{{digitalsData.courseLeader || '-' }}</view - > - <view - class="classHours my_draw_canvas1" - data-type="text" - data-text="{{digitalsData.classHours || '-'}}" - >{{digitalsData.classHours || '-' }}</view - > - <view - class="affiliatedUnit my_draw_canvas1" - data-type="text" - data-text="{{publishingUnit || '-'}}" - >{{publishingUnit || '-'}}</view - > - <view - class="studyTime my_draw_canvas1" - data-type="text" - data-text="{{isCertificate ? isCertificate.content.studyTime || '-' : '-'}}" - >{{ isCertificate ? isCertificate.content.studyTime || '-' : '-' - }}</view - > - <view - class="website my_draw_canvas1" - data-type="text" - data-text="{{website}}" - >{{website}}</view - > - <view class="codeBox my_draw_canvas1"></view> - <view - class="updateDate my_draw_canvas1" - wx-if="{{isCertificate}}" - > - {{ moment(isCertificate.updateDate).format('YYYY骞碝M鏈�') }} - </view> - </view> - </view> - </view> + </t-tab-panel> <t-tab-panel icon="{{ tabValue == '2' ? courseLearningClick : courseLearning}}" @@ -613,6 +471,152 @@ </view> </view> </view> +<canvas canvas-id="myCanvas" class="myCanvas" style="height: 845px; width: 595px" wx:if="{{pubCertificateHide}}"></canvas> +<view + id="pubCertificate" + class="my_canvas" + wx:if="{{pubCertificateHide}}" +> + <view class="pubCon"> + <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 my_draw_canvas" + /> + <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 my_draw_canvas"> + <image data-type="image" data-url="{{imgUrl}}" src="{{imgUrl}}" mode="" class="qrcode my_draw_canvas" wx:if="{{imgUrl}}"/> + <canvas canvas-id="qrcode" class="qrcode my_draw_canvas" wx:else/> + </view> + </view> + </view> + </view> + <canvas + canvas-id="myCanvas1" + class="myCanvas" + style="height: 845px; width: 595px" + wx:if="{{pubCertificateHide}}" + ></canvas> +<view + id="textCertificate" + class="my_canvas1" + wx:if="{{pubCertificateHide}}" +> + <view class="pubCon"> + <image + data-type="image" + data-url="https://jsek.bnuic.com/home/certificate/kczs.jpg" + src="https://jsek.bnuic.com/home/certificate/kczs.jpg" + mode="" + class="bgImg my_draw_canvas1" + /> + <view class="certificateInfo my_draw_canvas1"> + <view class="userIcon my_draw_canvas1"> + <view class="hexagon my_draw_canvas1"> + <image src="{{userPicture}}" data-type="image" data-url="{{userPicture}}" class="img my_draw_canvas1" /> + </view> + </view> + <view + class="userName my_draw_canvas1" + data-type="text" + data-text="{{userName}}" + >{{userName}}</view + > + <view + class="bookName my_draw_canvas1" + data-type="text" + data-text="{{digitalsData.name}}" + >{{digitalsData.name}}</view + > + <view + class="author my_draw_canvas1" + data-type="text" + data-text="{{digitalsData.courseLeader || '-'}}" + >{{digitalsData.courseLeader || '-' }}</view + > + <view + class="classHours my_draw_canvas1" + data-type="text" + data-text="{{digitalsData.classHours || '-'}}" + >{{digitalsData.classHours || '-' }}</view + > + <view + class="affiliatedUnit my_draw_canvas1" + data-type="text" + data-text="{{publishingUnit || '-'}}" + >{{publishingUnit || '-'}}</view + > + <view + class="studyTime my_draw_canvas1" + data-type="text" + data-text="{{isCertificate ? isCertificate.content.studyTime || '-' : '-'}}" + >{{ isCertificate ? isCertificate.content.studyTime || '-' : '-' + }}</view + > + <view + class="website my_draw_canvas1" + data-type="text" + data-text="{{website}}" + >{{website}}</view + > + <view class="codeBox my_draw_canvas1"> + <image data-type="image" data-url="{{imgUrl1}}" src="{{imgUrl1}}" mode="" class="qrcode my_draw_canvas1" wx:if="{{imgUrl1}}"/> + <canvas canvas-id="qrcode1" class="qrcode my_draw_canvas1" wx:else/> + </view> + <view + class="updateDate my_draw_canvas1" + wx-if="{{isCertificate}}" + > + {{ moment(isCertificate.updateDate).format('YYYY骞碝M鏈�') }} + </view> + </view> + </view> +</view> <t-image-viewer usingCustomNavbar diff --git a/pages/digitalCourses/digitalCoursesDetails/index.wxss b/pages/digitalCourses/digitalCoursesDetails/index.wxss index 80e2f36..3fca6a4 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.wxss +++ b/pages/digitalCourses/digitalCoursesDetails/index.wxss @@ -318,6 +318,11 @@ margin-right: 50rpx; } +.chartImage { + width: 230rpx; + height: 325rpx; +} + .placeholder { color: var(--td-text-color-placeholder); line-height: 96rpx; @@ -443,11 +448,16 @@ text-align: center; } +.myCanvas { + position: fixed; + top: 110%; +} #pubCertificate { width: 595px; height: 845px; position: fixed; + top: 110%; background-image: url('https://jsek.bnuic.com/home/certificate/szkc.jpg'); } @@ -516,6 +526,7 @@ width: 595px; height: 845px; position: fixed; + top: 110%; /* background-image: url('https://jsek.bnuic.com/home/certificate/kczs.jpg'); */ } @@ -548,17 +559,18 @@ } #textCertificate .bookName { - padding-top: 34px; + padding-top: 32px; margin-left: 230px; width: 300px; - height: 59px; + height: 60px; font-size: 18px; color: #000; font-family: 'FZXBSJW'; } #textCertificate .author { - height: 26px; + line-height: 14px; + height: 28px; margin-left: 52%; color: #000; font-family: 'SimHei', sans-serif; @@ -603,6 +615,12 @@ color: #000; } +.qrcode { + width: 160rpx; + height: 160rpx; + margin: 0 auto; +} + .rubricBox { diff --git a/pages/personalCenter/certificate/index.js b/pages/personalCenter/certificate/index.js index fc8bae3..d17a777 100644 --- a/pages/personalCenter/certificate/index.js +++ b/pages/personalCenter/certificate/index.js @@ -4,6 +4,7 @@ import { getPublicImage } from "../../../assets/js/middleGround/tool.js"; +import wxbarcode from 'wxbarcode' Page({ /** @@ -41,14 +42,14 @@ images: [], pubCertificateHide: false, contentData: {}, - rzzsImg: '' + rzzsImg: '', + imgUrl: '', }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - console.log(options); this.getDataList(false); }, @@ -126,12 +127,28 @@ .catch(() => {}) }, goBookDetails(e) { + let that = this; let productList = e.currentTarget.dataset.book.productList this.setData({ contentData: productList, pubCertificateHide: true, }) - this.drawImage1() + wxbarcode.qrcode('qrcode', productList.wxShareUrl, 160, 160); + setTimeout(() => { + wx.canvasToTempFilePath({ + canvasId: 'qrcode', + success: function (res) { + // res.tempFilePath 鍖呭惈鐢熸垚鐨勫浘鐗囨枃浠惰矾寰� + that.setData({ + imgUrl: res.tempFilePath + }) + } + }); + setTimeout(() => { + this.drawImage1() + }, 100) + }, 100) + }, drawImage1() { let that = this; @@ -158,7 +175,7 @@ showIndex: true, visible: true, }) - }, 1000) + }, 100) }, }) }, diff --git a/pages/personalCenter/certificate/index.wxml b/pages/personalCenter/certificate/index.wxml index 7dc57db..228509e 100644 --- a/pages/personalCenter/certificate/index.wxml +++ b/pages/personalCenter/certificate/index.wxml @@ -47,7 +47,7 @@ <view class="certificateInfo my_draw_canvas1"> <view class="userIcon my_draw_canvas1"> <view class="hexagon my_draw_canvas1"> - <image src="{{contentData.userPicture}}" class="img my_draw_canvas1" /> + <image data-type="image" data-url="{{contentData.userPicture}}" src="{{contentData.userPicture}}" class="img my_draw_canvas1" /> </view> </view> <view class="userName my_draw_canvas1" data-type="text" data-text="{{contentData.userName}}">{{contentData.userName}}</view> @@ -58,7 +58,10 @@ <view class="{{active == 0 ? 'affiliatedUnit my_draw_canvas1' : 'publishingUnit my_draw_canvas1'}}" data-type="text" data-text="{{contentData.publishingUnit}}">{{contentData.publishingUnit || '-'}}</view> <view class="studyTime my_draw_canvas1" data-type="text" data-text="{{contentData.studyTime}}">{{contentData.studyTime}}</view> <view class="website my_draw_canvas1" data-type="text" data-text="{{contentData.website}}">{{contentData.website}}</view> - <view class="codeBox my_draw_canvas1"></view> + <view class="codeBox my_draw_canvas1"> + <image data-type="image" data-url="{{imgUrl}}" src="{{imgUrl}}" mode="" class="qrcode my_draw_canvas1" wx:if="{{imgUrl}}"/> + <canvas canvas-id="qrcode" class="qrcode my_draw_canvas1" wx:else /> + </view> <view class="updateDate my_draw_canvas1"> {{ contentData.updateDate }} </view> diff --git a/pages/personalCenter/certificate/index.wxss b/pages/personalCenter/certificate/index.wxss index 419e0cb..b0b4831 100644 --- a/pages/personalCenter/certificate/index.wxss +++ b/pages/personalCenter/certificate/index.wxss @@ -278,7 +278,7 @@ } #textCertificate .codeBox { - height: 140rpx; + /* height: 140rpx; */ margin-top: 34rpx; text-align: center; } @@ -288,4 +288,10 @@ text-align: center; font-size: 12px; color: #000; +} + +.qrcode { + width: 160rpx; + height: 160rpx; + margin: 0 auto; } \ No newline at end of file -- Gitblit v1.9.1