From 88d80c9f40935c6ce7ea51683c6cdc1a80d1997b Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 22 三月 2024 11:17:45 +0800 Subject: [PATCH] Merge refs/remotes/origin/master into refs/heads/master --- packagePersonal/pages/myCollection/index.js | 2 packageBookService/pages/bookServices/detail/index.wxml | 13 pages/retrievalPage/index.json | 9 packageBookService/pages/bookServices/detail/index.wxss | 38 + pages/bookExhibitionList/index.js | 64 +- pages/personalCenter/components/user-center-card/index.wxml | 4 packageDomain/pages/resourceDetails/myVideo/index.wxml | 6 packageBookService/pages/bookServices/list/index.js | 2 pages/bibliographyList/index.json | 9 packageBookService/pages/bookServices/detail/index.js | 444 +++++++++++++++++- packageDomain/pages/resourceDetails/myVideo/index.wxss | 4 pages/personalCenter/index.js | 13 pages/retrievalPage/index.js | 227 ++++++++ pages/cart/index.wxss | 9 pages/cart/index.wxml | 5 packagePersonal/pages/userSetting/index.wxml | 18 packagePersonal/pages/userSetting/index.wxss | 21 packageDomain/pages/resourceDetails/myVideo/index.json | 3 pages/bookExhibitionList/index.wxss | 10 packageDomain/pages/resourceDetails/myVideo/index.js | 1 packageDomain/pages/sampleBookList/applicationForm/index.js | 10 pages/bookExhibitionList/index.wxml | 72 +- pages/retrievalPage/index.wxml | 33 + packageDomain/pages/sampleBookList/applicationForm/index.wxss | 5 pages/retrievalPage/index.wxss | 25 + packagePersonal/pages/userSetting/index.js | 125 ++++ pages/bookExhibitionList/index.json | 3 pages/cart/index.json | 9 pages/cart/index.js | 50 + assets/js/toolClass.js | 1 pages/bibliographyList/index.wxml | 14 pages/bibliographyList/index.wxss | 9 packageDomain/pages/resourceDetails/myAudio/index.wxml | 2 pages/bibliographyList/index.js | 121 ++++ 34 files changed, 1,180 insertions(+), 201 deletions(-) diff --git a/assets/js/toolClass.js b/assets/js/toolClass.js index c173046..ee88bba 100644 --- a/assets/js/toolClass.js +++ b/assets/js/toolClass.js @@ -163,6 +163,7 @@ }) ) } + res.forEach((item) => { const obj = { baseType: item.typeField.baseType, diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 66497f3..500be20 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -16,6 +16,7 @@ name: '', }, bookDetail: {}, + bookItemDetail: {}, link: { jd: '', tamll: '', @@ -53,7 +54,19 @@ }, flag: true, applyResourceLoading: false, - noResources: false + noResources: false, + selectedIds: "",//鍟嗗搧鎴栧瓙鍟嗗搧閿�鍞柟寮� + bookBuy: false, //鍟嗗搧鎴栧瓙鍟嗗搧鏄惁璐拱 + expire: false,//鍟嗗搧鎴栧瓙鍟嗗搧閿�鍞柟寮忔槸鍚﹁繃鏈� + noFile: false, //鍟嗗搧鎴栧瓙鍟嗘湁鏃犵數瀛愪功鏂囦欢 + num: 0, //鏍蜂功鐢宠鍗曟暟閲� + alreadyPaperBookList: [], //宸茬敵璇风焊璐ㄦ牱涔� + alreadyElectronicBookList: [], //宸茬敵璇风數瀛愭牱涔� + paperBookList: [], //鏍蜂功鍗曠焊璐ㄤ功 + electronicBookList: [], //鏍蜂功鍗曠數瀛愪功 + paperBookCount: 0, //绾歌川涔﹀墿浣欐鏁� + ebookCount: 0, //鐢靛瓙涔﹀墿浣欐鏁� + userInfo: {}, }, @@ -81,6 +94,7 @@ name: options.name, }, }); + this.getBookInfo(options.id); this.getResourceClass() // 鑾峰彇璧勬簮鎵�灞炲垎绫� const token = wx.getStorageSync('jsek-token') @@ -89,6 +103,24 @@ this.getApplyInfo(options.id) this.getMockData() } + if (wx.getStorageSync(app.config.userInfoKey)) { + this.setData({ + userInfo: JSON.parse(wx.getStorageSync(app.config.userInfoKey)) + }) + } + if (wx.getStorageSync("paperBookList")) { + this.setData({ + paperBookList: wx.getStorageSync("paperBookList"), + }) + } + if (wx.getStorageSync("electronicBookList")) { + this.setData({ + electronicBookList: wx.getStorageSync("electronicBookList"), + }) + } + this.setData({ + num: this.data.paperBookList.length + this.data.electronicBookList.length + }) }, /** @@ -237,6 +269,7 @@ cmsDatas: res.datas.cmsDatas[0].datas, buyIdList: res.datas.purchasedSaleMethodIdList }); + this.getSubTtem(); // 鑾峰彇鍥句功鍒嗙被 const iconType = JSON.parse(res.datas.bookClassification)[0][0]; const classType = JSON.parse(res.datas.bookClassification)[0][1]; @@ -273,6 +306,76 @@ console.log('鍥句功淇℃伅', this.data.bookDetail); }); + }, + //璇锋眰瀛愬晢鍝佺殑鏂囦欢 + getSubTtem() { + const obj = { + path: '*', + queryType: 'SubProduct', + sort: { + type: 'Desc', + field: 'CreateDate' + }, + paging: { + start: 0, + size: 6 + }, + mainProductId: this.data.bookDetail.id, + fields: { + author: [], + bookshelf_pdf: [], + bookshelf_protectedEpub: [], + bookshelf_freeEpub: [], //epub璇曡鐧惧垎姣� + bookshelf_probationPage: [] //pdf璇曡椤垫暟 + } + } + app.MG.store.getProductList(obj).then((res) => { + if (res.datas && res.datas.length > 0) { + this.setData({ + bookItemDetail: res.datas[0], + selectedIds: res.datas[0].defaultSaleMethod.id, + bookBuy: res.datas[0].purchasedSaleMethodIdList.indexOf(res.datas[0].defaultSaleMethodId) > -1 + }); + console.log(this.data.bookItemDetail, 'bookItemData.value'); + let times = new Date(res.datas[0].defaultSaleMethod.endDate).getTime() + let startTime = new Date(res.datas[0].defaultSaleMethod.beginDate).getTime() + if (times < new Date().getTime() || new Date().getTime() < startTime) { + this.setData({ + expire: true + }); + } else { + this.setData({ + expire: false + }); + } + if (res.datas[0].bookshelf_pdf || res.datas[0].bookshelf_protectedEpub) { + this.setData({ + noFile: true + }); + } + } else { + if (this.data.bookDetail.pdf || this.data.bookDetail.protectedEpub) { + this.setData({ + noFile: true + }); + } + this.setData({ + selectedIds: this.data.bookDetail.defaultSaleMethodId, + bookBuy: this.data.bookDetail.purchasedSaleMethodIdList.indexOf(this.data.bookDetail.defaultSaleMethodId) > -1 + }); + let times = new Date(this.data.bookDetail.defaultSaleMethod.endDate).getTime() + let startTime = new Date(this.data.bookDetail.defaultSaleMethod.beginDate).getTime() + if (times < new Date().getTime() || new Date().getTime() < startTime) { + this.setData({ + expire: true + }); + } else { + this.setData({ + expire: false + }); + } + } + }) }, // 鑾峰彇鍥句功鍒嗙被 async getBookClass(iconType, classType) { @@ -566,7 +669,6 @@ // 鍥句功娣诲姞璐墿杞� async addBookShopcCar() { - const token = wx.getStorageSync('jsek-token') if (!token) { return wx.getUserProfile({ @@ -590,15 +692,14 @@ shoppingCartGetId.push(item.saleMethod.id) }) console.log(shoppingCartGetId, 'shoppingCartGetId'); - console.log(this.data.bookDetail.defaultSaleMethodId, 'this.data.bookDetail.defaultSaleMethodId'); - const determine = shoppingCartGetId.some((item) => item == this.data.bookDetail.defaultSaleMethodId) + console.log(this.data.selectedIds, '閿�鍞柟寮廼d'); + const determine = shoppingCartGetId.some((item) => item == this.data.selectedIds) console.log(determine); - if (!determine) { let query = { requests: [ { - saleMethodId: this.data.bookDetail.defaultSaleMethodId, + saleMethodId: this.data.selectedIds, storeEventId: null, agentCode: '鐢靛瓙涔�' } @@ -632,31 +733,38 @@ async buyBook() { - let bookOrdersId = '' - let query = { - remarks: '鐢靛瓙涔�', - requests: [ - { - saleMethodId: this.data.bookDetail.defaultSaleMethodId, - count: 1 - } - ] - } - // 鍙戣捣璁㈠崟鍒濆鍖栬姹傚苟绛夊緟缁撴灉 - const res = await app.MG.store.initOrder(query) - // 鑾峰彇璁㈠崟鍙峰苟璧嬪�肩粰 orderNumber.value - bookOrdersId = res.orderNumber - console.log(bookOrdersId); - // 妫�鏌ヨ鍗曞彿鏄惁瀛樺湪 - if (bookOrdersId) { - const url = '/pages/cart/paymentPage/index?orderNumber=' + bookOrdersId - wx.navigateTo({ - url - }) + if (!this.data.expire) { + let bookOrdersId = '' + let query = { + remarks: '鐢靛瓙涔�', + requests: [ + { + saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ? this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId, + count: 1 + } + ] + } + // 鍙戣捣璁㈠崟鍒濆鍖栬姹傚苟绛夊緟缁撴灉 + const res = await app.MG.store.initOrder(query) + // 鑾峰彇璁㈠崟鍙峰苟璧嬪�肩粰 orderNumber.value + bookOrdersId = res.orderNumber + console.log(bookOrdersId); + // 妫�鏌ヨ鍗曞彿鏄惁瀛樺湪 + if (bookOrdersId) { + const url = '/pages/cart/paymentPage/index?orderNumber=' + bookOrdersId + wx.navigateTo({ + url + }) + } else { + console.log(222); + } } else { - console.log(222); + wx.showToast({ + title: "鍟嗗搧涓嶅湪鏈夋晥鏈�", + icon: 'none', + duration: 1000, + }) } - }, // 鑾峰彇鏁欏璧勬簮涓嬭浇鏄惁鐢宠閫氳繃 @@ -1226,10 +1334,7 @@ } else if (this.data.tabValue == 'jsek_cloudLearning') { const tree = this.selectComponent('#tree') - tree.onCloudShoppingCart() - - } else if (this.data.tabValue == 'questionBank') { this.buyMock() } else { @@ -1237,4 +1342,279 @@ } }, + //鏍蜂功鐢宠 + //鐢宠鐢靛瓙鏍蜂功 + appplyElectronicBook() { + console.log(this.data.bookDetail) + if (this.data.bookDetail.isApplyBook == 2 || this.data.bookDetail.isApplyBook == 4) { + let role = this.data.userInfo != null ? this.data.userInfo.role : null + if (role) { + if (role == 'Teacher') { + if (this.data.noFile) { + this.getSelectBookCount() + } else { + wx.showToast({ + title: "鏆傛棤鐢靛瓙涔︽枃浠�,璇疯仈绯荤鐞嗗憳!", + icon: 'none', + duration: 1000, + }) + } + } else { + wx.showModal({ + title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', //鎻愮ず鐨勬爣棰� + content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', //鎻愮ず鐨勫唴瀹� + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: "/packageDomain/pages/teacherCertification/index", + }); + } else if (res.cancel) { + } + } + }) + } + } + } + }, + //鐢宠绾歌川鏍蜂功 + appplyPaperBook() { + if (this.data.bookDetail.isApplyBook == 3 || this.data.bookDetail.isApplyBook == 4) { + let role = this.data.userInfo != null ? this.data.userInfo.role : null + if (role) { + if (role == 'Teacher') { + this.getSelectPaperBookCount() + } else { + wx.showModal({ + title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', //鎻愮ず鐨勬爣棰� + content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', //鎻愮ず鐨勫唴瀹� + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: "/packageDomain/pages/teacherCertification/index", + }); + } else if (res.cancel) { + } + } + }) + } + } + } + }, + //鑾峰彇褰撳墠宸茬敵璇锋鏁帮紙绾歌川锛� + getSelectPaperBookCount() { + app.MG.app + .getTicketResult({ + ticketRefCodeOrGuid: 'paperSampleBookapplyNum', + roleId: this.data.userInfo.roleId + }) + .then((res) => { + this.setData({ + paperBookCount: res.totalCount - res.usedCount + }) + this.getAlreadyBookList(this.data.bookDetail, 'pBook') + }) + }, + //鑾峰彇褰撳墠宸茬敵璇锋鏁帮紙鐢靛瓙锛� + getSelectBookCount() { + app.MG.app + .getTicketResult({ + ticketRefCodeOrGuid: 'electronicSampleBookapplyNum', + roleId: this.data.userInfo.roleId + }) + .then((res) => { + this.setData({ + ebookCount: res.totalCount - res.usedCount + }) + this.getAlreadyBookList(this.data.bookDetail, 'eBook') + }) + }, + //鑾峰彇宸茬敵璇风殑鏍蜂功鍒楄〃 + getAlreadyBookList(item, type) { + let topicIdOrRefCode = null + if (type == 'eBook') { + topicIdOrRefCode = 'applyBook' + } else { + topicIdOrRefCode = 'applyEntityBook' + } + const data = { + start: 0, + size: 9999, + topicIdOrRefCode, + appRefCode: app.config.appRefCode, + sort: { + type: 'Desc', + field: 'CreateDate' + } + } + app.MG.ugc.getTopicMessageList(data).then((res) => { + let itemAttr = null + let isHas = false + itemAttr = { + id: item.id, + title: item.name || '--', + icon: item.icon, + checked: false, + defaultSaleMethodId: item.defaultSaleMethodId, + md5: item.datas.Icon, + author: item.author || '--', + price: item.price || '--', + isbn: item.isbn || '--', + publicationDate: item.publicationDate + } + res.datas.map((item) => { + if (item.feedBack) { + item.feedBack = JSON.parse(item.feedBack) + if (item.feedBack.endDate) { + const currentDate = new Date() + let times = new Date(item.feedBack.endDate + ' 23:59:59').getTime() + if (times < currentDate.getTime()) { + item.isExpiry = true + } + } + } + if (item.content) { + item.content = JSON.parse(item.content) + item.content.map((e) => (item.productId = e.id)) + } + }) + let objVal = null + if (type != 'eBook') { + objVal = res.datas.find( + (i) => i.productId == item.id && i.state != 'Reject' && i.state == 'WaitAudit' + ) + } else { + objVal = res.datas.find((i) => i.productId == item.id && i.state != 'Reject') + } + if (objVal && !objVal.isExpiry && type == 'eBook') { + wx.showToast({ + title: "鎮ㄥ凡鐢宠璇ユ牱涔�", + icon: 'none', + duration: 1000, + }) + } else if (objVal && type != 'eBook') { + wx.showToast({ + title: "鎮ㄥ凡鐢宠璇ユ牱涔�", + icon: 'none', + duration: 1000, + }) + } else { + if (type == 'eBook') { + if (this.data.ebookCount > 0) { + const eBookData = this.data.electronicBookList + if (eBookData.length == 2) { + wx.showToast({ + title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�", + icon: 'none', + duration: 1000, + }) + return false + } + if (eBookData.length > 0) { + for (let i = 0; i < eBookData.length; i++) { + if (eBookData[i].id == item.id) { + isHas = true + } + } + if (!isHas) { + wx.showToast({ + title: "娣诲姞鎴愬姛锛屽湪鏍蜂功鐢宠鍗曠瓑鎮ㄥ摝~", + icon: "none", + duration: 1000, + }) + this.setData({ + electronicBookList: [...this.data.electronicBookList, ...[itemAttr]], + num: this.data.electronicBookList.length + this.data.paperBookList.length + }) + wx.setStorageSync("electronicBookList", this.data.electronicBookList); + } else { + wx.showToast({ + title: "璇ヤ功宸插湪娓呭崟鍒楄〃涓�", + icon: "none", + duration: 1000, + }) + } + } else { + wx.showToast({ + title: "娣诲姞鎴愬姛锛屽湪鏍蜂功鐢宠鍗曠瓑鎮ㄥ摝~", + icon: "none", + duration: 1000, + }) + this.setData({ + electronicBookList: [itemAttr], + num: 1 + this.data.paperBookList.length + }) + wx.setStorageSync("electronicBookList", [itemAttr]); + } + } else { + wx.showToast({ + title: "鎮ㄧ殑鐢靛瓙鏍蜂功鐢宠娆℃暟宸茬敤灏斤紝鑻ヨ缁х画锛岃鑱旂郴绠$悊鍛橈紒", + icon: "none", + duration: 1000, + }) + } + } else { + if (this.data.paperBookCount > 0) { + const pBookData = this.data.paperBookList + if (pBookData.length == 2) { + wx.showToast({ + title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�", + icon: 'none', + duration: 1000, + }) + return false + } + if (pBookData.length > 0) { + for (let i = 0; i < pBookData.length; i++) { + if (pBookData[i].id == item.id) { + isHas = true + } + } + if (!isHas) { + wx.showToast({ + title: "娣诲姞鎴愬姛锛屽湪鏍蜂功鐢宠鍗曠瓑鎮ㄥ摝~", + icon: 'none', + duration: 1000, + }) + this.setData({ + paperBookList: [...this.data.paperBookList, ...[itemAttr]], + num: this.data.paperBookList.lenght + this.data.electronicBookList.length + }) + wx.setStorageSync("paperBookList", this.data.paperBookList); + } else { + wx.showToast({ + title: "璇ヤ功宸插湪娓呭崟鍒楄〃涓�", + icon: "none", + duration: 1000, + }) + } + } else { + wx.showToast({ + title: "娣诲姞鎴愬姛锛屽湪鏍蜂功鐢宠鍗曠瓑鎮ㄥ摝~", + icon: 'none', + duration: 1000, + }) + this.setData({ + paperBookList: [itemAttr], + num: 1 + this.data.electronicBookList.length + }) + wx.setStorageSync("paperBookList", [itemAttr]); + } + } else { + wx.showToast({ + title: "鎮ㄧ殑绾歌川鏍蜂功鐢宠娆℃暟宸茬敤灏斤紝鑻ヨ缁х画锛岃鑱旂郴绠$悊鍛橈紒", + icon: 'none', + duration: 1000, + }) + } + } + } + }) + }, + //鍘绘牱涔︾敵璇峰崟 + goApply() { + wx.navigateTo({ + url: "/packageDomain/pages/sampleBookList/applicationForm/index", + }); + }, + }) diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml index 0272a41..8296b05 100644 --- a/packageBookService/pages/bookServices/detail/index.wxml +++ b/packageBookService/pages/bookServices/detail/index.wxml @@ -137,13 +137,13 @@ </view> <!-- 璐拱鎸夐挳 --> <view class="box-bottom"> - <view class="bottom-btn"> + <view class="bottom-btn" bind:tap="appplyElectronicBook"> <view> <t-image src="/static/images/bookService/detail/ebook.png"></t-image> </view> <view class="btn-text">鐢靛瓙鏍蜂功鐢宠</view> </view> - <view class="bottom-btn"> + <view class="bottom-btn" bind:tap="appplyPaperBook"> <view> <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> </view> @@ -156,4 +156,11 @@ <!-- 鎴戣寤鸿寮圭獥 --> <suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest> <!-- 鏁欏璧勬簮涓嬭浇鎻愮ず寮圭獥 --> -<t-dialog class="teachDownloadDialog" visible="{{isShowTeachDownload}}" title="鎻愮ず" content="璇峰墠寰�PC绔笅杞�" confirm-btn="{{ confirmBtn }}" bind:confirm="closeTeachDownload" /> \ No newline at end of file +<t-dialog class="teachDownloadDialog" visible="{{isShowTeachDownload}}" title="鎻愮ず" content="璇峰墠寰�PC绔笅杞�" confirm-btn="{{ confirmBtn }}" bind:confirm="closeTeachDownload" /> + +<view class="applyBox" bindtap="goApply"> + <view class="box"> + <t-image src="/static/images/home/yangshuForm.png" mode="heightFix" class="img" /> + <view class="num" wx:if="{{num > 0}}">{{num}}</view> + </view> +</view> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/index.wxss b/packageBookService/pages/bookServices/detail/index.wxss index 8deaf31..0cf0628 100644 --- a/packageBookService/pages/bookServices/detail/index.wxss +++ b/packageBookService/pages/bookServices/detail/index.wxss @@ -227,7 +227,7 @@ } .box-bottom image { - width: 36rpx; + width: 38rpx; height: 44rpx; } @@ -300,4 +300,40 @@ .noData { height: 100%; +} + +.applyBox { + width: 184rpx; + height: 184rpx; + position: fixed; + bottom: 20%; + right: 0; +} + +.applyBox .box { + width: 184rpx; + height: 184rpx; + color: #fff; + position: relative; +} + +.applyBox .box .t-image { + width: 100%; + height: 100%; +} + +.num { + background-color: #FD3D16; + color: #fff; + border: 2rpx solid #FFFFFF; + font-size: 24rpx; + line-height: 30rpx; + font-weight: 400; + width: 48rpx; + height: 32rpx; + text-align: center; + border-radius: 9px; + position: absolute; + top: 30rpx; + left: 118rpx; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js index 81847df..656c94b 100644 --- a/packageBookService/pages/bookServices/list/index.js +++ b/packageBookService/pages/bookServices/list/index.js @@ -287,7 +287,7 @@ subAccess: this.data.pathList, }; } else { - pathObj = { + pathObj = { path, queryType: '*', }; diff --git a/packageDomain/pages/resourceDetails/myAudio/index.wxml b/packageDomain/pages/resourceDetails/myAudio/index.wxml index ac2c8b6..8291973 100644 --- a/packageDomain/pages/resourceDetails/myAudio/index.wxml +++ b/packageDomain/pages/resourceDetails/myAudio/index.wxml @@ -86,7 +86,7 @@ <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}"> <view slot="header" class="collapse-header"> <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> - <view class="header-name">{{item.name}}</view> + <view class="header-name">{{titleName}}</view> </view> <view> <view class="note-content">{{item.content}}</view> diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index d99b880..95b5e9e 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -345,6 +345,7 @@ // item.deleteHover = false item.createDate = this.convertTimestamp(item.createDate) }) + console.log(res, 'res'); this.setData({ "pageCount.total": res.totalSize, noteList: res.datas, diff --git a/packageDomain/pages/resourceDetails/myVideo/index.json b/packageDomain/pages/resourceDetails/myVideo/index.json index adaa91b..fa11de1 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.json +++ b/packageDomain/pages/resourceDetails/myVideo/index.json @@ -12,7 +12,8 @@ "t-image": "tdesign-miniprogram/image/image", "t-textarea": "tdesign-miniprogram/textarea/textarea", "t-loading": "tdesign-miniprogram/loading/loading", - "t-popup": "tdesign-miniprogram/popup/popup" + "t-popup": "tdesign-miniprogram/popup/popup", + "t-empty": "tdesign-miniprogram/empty/empty" }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/packageDomain/pages/resourceDetails/myVideo/index.wxml b/packageDomain/pages/resourceDetails/myVideo/index.wxml index 8f5847e..3d2e9b9 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.wxml +++ b/packageDomain/pages/resourceDetails/myVideo/index.wxml @@ -31,11 +31,15 @@ <t-tab-panel label="绗旇" value="1" style="{{tabPanelstyle}}"> <view class="wrapper"> + <view wx:if="{{!noteList.length}}" class="noData"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> + + </view> <t-collapse value="{{activeValues}}" bind:change="handleChange"> <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}"> <view slot="header" class="collapse-header"> <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> - <view class="header-name">{{item.name}}</view> + <view class="header-name">{{titleName}}</view> </view> <view> <view class="note-content">{{item.content}}</view> diff --git a/packageDomain/pages/resourceDetails/myVideo/index.wxss b/packageDomain/pages/resourceDetails/myVideo/index.wxss index 511cbd2..7316760 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.wxss +++ b/packageDomain/pages/resourceDetails/myVideo/index.wxss @@ -296,4 +296,8 @@ .t-tabs__track { background-color: #FF6C00 !important; +} + +.noData { + margin-top: 120rpx; } \ No newline at end of file diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.js b/packageDomain/pages/sampleBookList/applicationForm/index.js index 92d0e54..e884a0f 100644 --- a/packageDomain/pages/sampleBookList/applicationForm/index.js +++ b/packageDomain/pages/sampleBookList/applicationForm/index.js @@ -9,6 +9,7 @@ workInfo: null, schoolName: "", courseName: "", + detailedAddress: "" }, contactInfo: { fullName: "", @@ -101,6 +102,7 @@ 'teacherInfo.workInfo': res[0].cmsTypeLinks[0].children, }) } + console.log(this.data.teacherInfo.workInfo, 333) }) }, //鑾峰彇褰撳墠宸茬敵璇锋鏁帮紙鐢靛瓙锛� @@ -177,12 +179,13 @@ }) return } + const mailAddress = JSON.stringify(that.data.contactInfo) that.setData({ - teacherInfo: { - detailedAddress: mailAddress, - } + 'teacherInfo.detailedAddress': mailAddress }) + console.log(that.data.teacherInfo.workInfo, 345) + data = { topicIdOrRefCode: 'applyEntityBook', name: that.data.userInfo.name || '', @@ -214,7 +217,6 @@ }) wx.setStorageSync("paperBookList", that.data.paperBookList); } - wx.showModal({ title: '鎻愮ず锛�', //鎻愮ず鐨勬爣棰� content: '鎮ㄧ殑鏍蜂功鐢宠宸叉彁浜わ紝绠$悊鍛樺鏍镐腑锛佺敵璇风姸鎬佸湪銆愪釜浜轰腑蹇冣�旀牱涔︾敵璇枫�戜腑鏌ヨ銆�', //鎻愮ず鐨勫唴瀹� diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.wxss b/packageDomain/pages/sampleBookList/applicationForm/index.wxss index 877f863..894c094 100644 --- a/packageDomain/pages/sampleBookList/applicationForm/index.wxss +++ b/packageDomain/pages/sampleBookList/applicationForm/index.wxss @@ -6,6 +6,11 @@ width: 100%; } +.page-content { + padding-bottom: env(safe-area-inset-bottom); + +} + .t-tabs__track { display: none; diff --git a/packagePersonal/pages/myCollection/index.js b/packagePersonal/pages/myCollection/index.js index 1a6e3ff..fb1a765 100644 --- a/packagePersonal/pages/myCollection/index.js +++ b/packagePersonal/pages/myCollection/index.js @@ -167,7 +167,7 @@ icon: 'success', duration: 1000, }) - this.getDataList(false) + that.getDataList(false) }); } else if (res.cancel) { console.log('鐢ㄦ埛鐐瑰嚮浜嗗彇娑�') diff --git a/packagePersonal/pages/userSetting/index.js b/packagePersonal/pages/userSetting/index.js index 48c0a70..c732fd8 100644 --- a/packagePersonal/pages/userSetting/index.js +++ b/packagePersonal/pages/userSetting/index.js @@ -1,4 +1,6 @@ const app = getApp() +import tool from "../../../assets/js/toolClass.js"; +import FormData from '../../../utils/formdata/index.js'; Page({ /** @@ -10,6 +12,8 @@ userInfoBox: false, editType: '', userInfoForm: { + icon: '', + nickName: '', phone: '', email: '', captcha: '', @@ -49,6 +53,7 @@ // 鐢ㄦ埛淇℃伅浼樺厛绾э細鏁欏笀璁よ瘉 > 寰俊 > 瀛︾敓锛堟敞鍐屾椂榛樿锛� if (res) { let defaultUser = {}; + let nickNameData = res.infoList.find((item) => item.type == 'nickName') let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') @@ -58,8 +63,8 @@ if (teacherRole && teacherInfos) { defaultUser = { ...teacherInfos, - fullName: teacherInfos.fullName, - icon: teacherInfos.icon, + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name, + icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', userId: res.userId, role: 'Teacher', roleId: teacherRole.role.id, @@ -69,16 +74,16 @@ } else if (WeChatInfo) { defaultUser = { ...WeChatInfo, - fullName: WeChatInfo.name, - icon: WeChatInfo.icon, + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, + icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, userId: res.userId, phoneNumber: phoneInfo?.credential, Email: emailInfo?.credential } } else if (secretData) { defaultUser = { - fullName: secretData.credential, - icon: "", + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, + icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : '', userId: res.userId, phoneNumber: phoneInfo?.credential, Email: emailInfo?.credential @@ -99,7 +104,8 @@ userInfoBox: true, editType: info, "userInfoForm.captcha": "", - "userInfoForm.code": "" + "userInfoForm.code": "", + "userInfoForm.nickName": '' }); } this.getImgCapcha() @@ -110,7 +116,86 @@ countDown: 0, }); }, + editIconInfo(e) { + var that = this; + wx.chooseMedia({ + // count: 1, // 榛樿9 + sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� + sourceType: ['album', 'camera'], // 鍙互鎸囧畾鏉ユ簮鏄浉鍐岃繕鏄浉鏈猴紝榛樿浜岃�呴兘鏈� + success: function (res) { + // 杩斿洖閫夊畾鐓х墖鐨勬湰鍦版枃浠惰矾寰勫垪琛紝tempFilePath涔熷彲浠ヤ綔涓篿mg鏍囩鐨剆rc灞炴�ф樉绀哄浘鐗� + console.log(res.tempFiles[0]) + tool.getFileMd5(res.tempFiles[0]).then((e) => { + console.log(e, 4) + let formData = new FormData(); + formData.append('Md5', e); + formData.append('FileName', e); + formData.append('FileType', res.tempFiles[0].fileType); + formData.appendFile("file", res.tempFiles[0].tempFilePath); + const data = formData.getData(); + let _token = wx.getStorageSync(app.config.tokenKey); + let header = {}; + if (_token == null) { + header["Authorization"] = `Basic ${Base64.encode(website.clientId + ":" + website.clientSecret)}`; + } else { + header["Authorization"] = `Bearer ` + _token; + } + new Promise((resolve, reject) => { + wx.request({ + url: app.config.requestCtx + '/file/api/ApiUpload', + method: 'POST', + header: { + 'content-type': data.contentType, + ...header + }, + data: data.buffer, + success(res) { + console.log(res) + if (res.statusCode == 200) { + resolve(res.data); + if (res.data) { + that.setData({ + 'userInfoForm.icon': app.config.requestCtx + `/file/GetPreViewImage?md5=` + e, + }); + let userTypeInfo = { + requests: [ + { + data: JSON.stringify({ nickName: that.data.userInfo.nickName, icon: that.data.userInfoForm.icon }), + name: '鐢ㄦ埛鏄电О澶村儚', + type: 'nickName' + } + ] + } + app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { + if (res) { + wx.showToast({ + title: "淇敼鎴愬姛", + icon: 'success', + duration: 1000, + }) + this.getUserInfo() + this.setData({ + userInfoBox: false, + }); + } + }) + } + } else { + reject('杩愯鏃堕敊璇�,璇风◢鍚庡啀璇�'); + } + } + }) + }) + }) + } + }); + }, + onNameInput(e) { + this.setData({ + "userInfoForm.nickName": e.detail.value, + }); + }, //杈撳叆鎵嬫満鍙� onPhoneInput(e) { console.log(e) @@ -247,7 +332,31 @@ }, confirmInfo() { - if (this.data.changeType == 'phone') { + if (this.data.editType == 'nickName') { + let userTypeInfo = { + requests: [ + { + data: JSON.stringify({ nickName: this.data.userInfoForm.nickName, icon: this.data.userInfo.icon }), + name: '鐢ㄦ埛鏄电О澶村儚', + type: 'nickName' + } + ] + } + app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { + if (res) { + wx.showToast({ + title: "淇敼鎴愬姛", + icon: 'success', + duration: 1000, + }) + this.getUserInfo() + this.setData({ + userInfoBox: false, + }); + } + }) + + } else if (this.data.editType == 'phone') { let query = { phoneNumber: this.data.userInfoForm.phone, phoneCaptcha: this.data.userInfoForm.code diff --git a/packagePersonal/pages/userSetting/index.wxml b/packagePersonal/pages/userSetting/index.wxml index 51c6a17..aaf6525 100644 --- a/packagePersonal/pages/userSetting/index.wxml +++ b/packagePersonal/pages/userSetting/index.wxml @@ -2,13 +2,15 @@ <view class="itemList"> <view class="label">澶村儚</view> <view class="contentImg"> - <t-avatar image="{{defaultAvatarUrl}}" class="user-center-card__header__avatar" /> + <t-avatar image="{{userInfo.icon}}" class="user-center-card__header__avatar" /> </view> - <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> + <view class="iconEdit" data-info="{{'icon'}}" bindtap="editIconInfo"> + <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> + </view> </view> <view class="itemList"> <view class="label">鐢ㄦ埛鍚�</view> - <view class="content">{{userInfo.fullName || '寰俊鐢ㄦ埛'}}</view> + <view class="content" data-info="{{'nickName'}}" bindtap="editUserInfo">{{userInfo.nickName || '寰俊鐢ㄦ埛'}}</view> <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> </view> <view class="itemList"> @@ -24,6 +26,14 @@ <t-popup visible="{{userInfoBox}}" bind:visible-change="onVisibleChange" placement="bottom"> <view class="block"> <view class="body"> + <view class="from-item" wx:if="{{editType == 'nickName'}}"> + <view class="label"> 鏄电О锛� </view> + <view class="item-content"> + <view class="inputBox1"> + <t-input placeholder="杈撳叆鐢ㄦ埛鍚�" borderless value="{{userInfoForm.nickName}}" bindchange="onNameInput" /> + </view> + </view> + </view> <view class="from-item" wx:if="{{editType == 'phone'}}"> <view class="label"> 鎵嬫満鍙凤細 </view> <view class="item-content"> @@ -40,7 +50,7 @@ </view> </view> </view> - <view class="from-item"> + <view class="from-item" wx:if="{{editType !== 'nickName'}}"> <view class="label"> 鍥惧舰楠岃瘉鐮侊細 </view> <view class="item-content"> <view class="inputBox"> diff --git a/packagePersonal/pages/userSetting/index.wxss b/packagePersonal/pages/userSetting/index.wxss index be5d1e4..e5530ca 100644 --- a/packagePersonal/pages/userSetting/index.wxss +++ b/packagePersonal/pages/userSetting/index.wxss @@ -32,6 +32,10 @@ overflow: hidden; } +.iconEdit { + padding: 40rpx 0; +} + .content { flex: 1; color: #5C5C5C; @@ -59,10 +63,10 @@ } .block .body .from-item .label { - width: 170rpx; + width: 200rpx; height: 72rpx; line-height: 72rpx; - font-size: 28rpx; + font-size: 32rpx; } .block .body .from-item .item-content { @@ -72,14 +76,17 @@ } .inputBox1 { - width: 540rox; height: 72rpx; border: 2rpx solid #D9D9D9; flex: 1; } +.inputBox1 .t-input { + width: 440rpx !important; +} + .block .body .inputBox { - width: 280rpx; + width: 250rpx; height: 72rpx; border: 2rpx solid #D9D9D9; } @@ -90,17 +97,17 @@ .imgCode { height: 72rpx; - width: 200rpx; + width: 190rpx; } .code { - width: 200rpx; + width: 190rpx; height: 72rpx; margin-left: 20rpx; } .btn { - width: 200rpx; + width: 190rpx; height: 72rpx; padding: 0 10rpx !important; background: #ff6c00; diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js index 4c3cd21..0a4cd71 100644 --- a/pages/bibliographyList/index.js +++ b/pages/bibliographyList/index.js @@ -7,6 +7,7 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + isMore: null, higherList: [], vocationalList: [], teacherList: [], @@ -16,7 +17,8 @@ value: '', BarHeight: '', navBarHeight: '', - + start: 1, + tabValue: '' }, /** @@ -35,7 +37,12 @@ barHeight: systInfo.statusBarHeight, }) + let event = + { + detail: { value: "0" } + } + this.onTabsChange(event) @@ -92,12 +99,28 @@ }, onTabsChange(event) { - console.log(`Change tab, tab-panel value is ${event.detail.value}.`); + + const value = event.detail.value + + if (value === '0') { + console.log(value); + this.setData({ + tabValue: value + }) + } else if (value === '1') { + console.log(value); + this.setData({ + tabValue: value + }) + } else if (value === '2') { + console.log(value); + this.setData({ + tabValue: value + }) + } }, - onTabsClick(event) { - console.log(`Click tab, tab-panel value is ${event.detail.value}.`); - }, + //楂樼瓑鏁欒偛 higherGet(keyword) { let searchObj = { @@ -112,7 +135,7 @@ queryType: '*', paging: { start: '0', - size: '999' + size: this.data.start * 9 }, coverSize: { width: 260 @@ -139,7 +162,7 @@ }) console.log(this.data.higherList, '5555'); }) - + wx.stopPullDownRefresh() }, @@ -156,7 +179,7 @@ queryType: '*', paging: { start: '0', - size: '999' + size: this.data.start * 9 }, coverSize: { width: 260 @@ -181,6 +204,7 @@ }) }) + wx.stopPullDownRefresh() }, // 鑱屼笟鏁欒偛 teacherGet(keyword) { @@ -195,7 +219,7 @@ queryType: '*', paging: { start: '0', - size: '999' + size: this.data.start * 9 }, coverSize: { width: 260 @@ -220,7 +244,7 @@ }) }) - + wx.stopPullDownRefresh() }, downloadData(event) { @@ -267,5 +291,82 @@ goBack() { wx.navigateBack(); }, + onReachBottom(e) { + if (this.data.tabValue == 0) { + console.log(0); + if (this.data.higherList.length < this.data.higherTotal) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.higherGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + + } else if (this.data.tabValue == 1) { + + if (this.data.teacherList.length < this.data.teacherTotal) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.teacherGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + console.log(2); + } else if (this.data.tabValue == 2) { + + if (this.data.vocationalList.length < this.data.vocationalTotal && this.data.vocationalList.length > 9) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.vocationalGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + console.log(2); + } + + + + }, + onPullDownRefresh() { + + + this.setData({ + start: 1 + }) + this.vocationalGet() + this.higherGet() + this.teacherGet() + + }, }) \ No newline at end of file diff --git a/pages/bibliographyList/index.json b/pages/bibliographyList/index.json index a9c6aab..66d8036 100644 --- a/pages/bibliographyList/index.json +++ b/pages/bibliographyList/index.json @@ -4,7 +4,12 @@ "t-tabs": "tdesign-miniprogram/tabs/tabs", "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", "t-search": "tdesign-miniprogram/search/search", - "t-icon": "tdesign-miniprogram/icon/icon" + "t-icon": "tdesign-miniprogram/icon/icon", + "t-loading": "tdesign-miniprogram/loading/loading", + "t-image": "tdesign-miniprogram/image/image" }, - "navigationStyle": "custom" + "navigationStyle": "custom", + "enablePullDownRefresh": true, + "onReachBottomDistance": 200, + "backgroundTextStyle": "dark" } \ No newline at end of file diff --git a/pages/bibliographyList/index.wxml b/pages/bibliographyList/index.wxml index 3b9aa81..83c7d6b 100644 --- a/pages/bibliographyList/index.wxml +++ b/pages/bibliographyList/index.wxml @@ -49,7 +49,10 @@ </view> </view> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </t-tab-panel> <t-tab-panel label="鑱屼笟鏁欒偛({{vocationalTotal}})" value="1"> <view class="outsideHigherBox"> @@ -67,7 +70,10 @@ </view> </view> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </t-tab-panel> <t-tab-panel label="鏁欏笀鏁欒偛({{teacherTotal}})" value="2"> @@ -86,6 +92,10 @@ </view> </view> + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </t-tab-panel> </t-tabs> \ No newline at end of file diff --git a/pages/bibliographyList/index.wxss b/pages/bibliographyList/index.wxss index a6426d2..8133f8a 100644 --- a/pages/bibliographyList/index.wxss +++ b/pages/bibliographyList/index.wxss @@ -119,4 +119,13 @@ .t-tabs__track { background-color: #FF6C00 !important; +} + +.bottom-box { + display: flex; + justify-content: center; + color: #999; + height: 80rpx; + font-size: 28rpx; + --td-loading-color: #ff6c00 } \ No newline at end of file diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js index 1febd4e..a3ae6df 100644 --- a/pages/bookExhibitionList/index.js +++ b/pages/bookExhibitionList/index.js @@ -8,6 +8,7 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + keynoteDisabled: true, value: '', keyword: '', nameSort: null, @@ -49,9 +50,7 @@ price: 'jsek_teacherEducation', label: '鏁欏笀鏁欒偛', }, - ], - }, multipleSelect: { value: [], @@ -68,33 +67,7 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - // 鑾峰彇灞忓箷楂樺害 - wx.getSystemInfo({ - success: function (res) { - // this.setData({ - // windowHeight: res.windowHeight - // }) - // 鑾峰彇鑺傜偣鐨勭被鍚� - var query = wx.createSelectorQuery(); - query.select('.assembleContent').boundingClientRect(); - query.exec(function (res) { - - // console.log(res, 'res'); - let node = res[0]; - node.setStyle({ - backgroundColor: '#0256b9', - }) - // // 淇敼鑺傜偣鏍峰紡 - // if (node) { - // node.setStyle({ - // backgroundColor: 'red', - // color: 'white' - // }); - // } - }); - } - }); // console.log(this.data.filteredItems, 88888); const systInfo = wx.getSystemInfoSync(); @@ -114,18 +87,18 @@ if (this.data.filteredItems = []) { console.log(11111); - singleSelectOptions.push({ - label: '绂佺敤閫夐」', - value: 'disabled', - disabled: true, - }); + // singleSelectOptions.push({ + // label: '鏆傛棤鏁版嵁', + // value: 'disabled', + // disabled: true, + // }); + } else { + console.log(7889); } - // singleSelectOptions.push({ - // label: '绂佺敤閫夐」', - // value: 'disabled', - // disabled: true, - // }); + + + // 鏇存柊鏁版嵁 @@ -300,6 +273,18 @@ const newValue = e.detail.value; const selectedOption = this.data.product.options.find(option => option.value === newValue); const newPrice = selectedOption ? selectedOption.price : null; + console.log(newValue, 'newValue'); + console.log(newPrice, 'newPrice'); + if (newPrice) { + this.setData({ + keynoteDisabled: false + }) + + } else { + this.setData({ + keynoteDisabled: true + }) + } this.setData({ 'product.value': newValue, 'product.price': newPrice, // 灏嗛�変腑鐨� price 鍊间繚瀛樺湪鏁版嵁涓� @@ -330,6 +315,7 @@ }); }, handleConfirm(event) { + const { value } = event.detail; // 纭鎿嶄綔鐨勫鐞嗛�昏緫 @@ -369,8 +355,6 @@ this.data.nameSort = 'Desc' // console.log('sssssss'); this.bookExhibitionGet() - - }, onBookExhibitionDetails: function (event) { const item = event.currentTarget.dataset.item; diff --git a/pages/bookExhibitionList/index.json b/pages/bookExhibitionList/index.json index 2a46042..fbf7f99 100644 --- a/pages/bookExhibitionList/index.json +++ b/pages/bookExhibitionList/index.json @@ -6,7 +6,8 @@ "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu", "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item", "t-toast": "tdesign-miniprogram/toast/toast", - "t-icon": "tdesign-miniprogram/icon/icon" + "t-icon": "tdesign-miniprogram/icon/icon", + "t-empty": "tdesign-miniprogram/empty/empty" }, "onReachBottomDistance": 200, "navigationStyle": "custom", diff --git a/pages/bookExhibitionList/index.wxml b/pages/bookExhibitionList/index.wxml index 212b518..a09728c 100644 --- a/pages/bookExhibitionList/index.wxml +++ b/pages/bookExhibitionList/index.wxml @@ -2,41 +2,49 @@ <!-- 寮瑰嚭妗� 绂佹 --> <t-toast id="t-toast" /> - -<view style="width: 100%; height: {{barHeight}}px; "></view> -<view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> - <view> - <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> - </view> - <view class="example-search"> - <t-search model:value="{{value}}" placeholder="璇疯緭鍏ヤ功灞曞悕绉�" bind:submit="onSearchSubmit" /> - </view> -</view> - - -<view class="menuBox"> - <t-dropdown-menu class="classification"> - - <t-dropdown-item options="{{product.options}}" value="{{product.value}}" bindchange="onChange" /> - <t-dropdown-item label="閲嶇偣椤圭洰" options="{{multipleSelect.options}}" value="{{multipleSelect.value}}" bindchange="handleMultipleSelect" multiple bind:confirm="handleConfirm" bind:reset="handleReset" /> - - - - </t-dropdown-menu> - - - - <view class="outsideSortBox"> - <view class="sortBox" bind:tap="onSwapRight"> - <text>鎺掑簭</text> - <view class="iconBox"> - <t-icon class="swapRight" name="swap-right" size="35rpx" color="{{nameSort == 'Asc' ? '#ff6c00' : ''}}" /> - <t-icon class="swapLeft" name="swap-right" size="35rpx" color="{{nameSort == 'Desc' ? '#ff6c00' : ''}}" /> - </view> +<view class="bigTitleBox"> + <view style="width: 100%; height: {{barHeight}}px; "></view> + <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> + <view> + <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> + </view> + <view class="example-search"> + <t-search model:value="{{value}}" placeholder="璇疯緭鍏ヤ功灞曞悕绉�" bind:submit="onSearchSubmit" /> </view> </view> +</view> + + +<view> </view> + +<view class="outsideMenuBox"> + <view class="menuBox"> + <t-dropdown-menu class="classification"> + + <t-dropdown-item options="{{product.options}}" value="{{product.value}}" bindchange="onChange" /> + <t-dropdown-item disabled="{{keynoteDisabled}}" label=" 閲嶇偣椤圭洰" options="{{multipleSelect.options}}" value="{{multipleSelect.value}}" bindchange="handleMultipleSelect" multiple bind:confirm="handleConfirm" bind:reset="handleReset" /> + + + + </t-dropdown-menu> + + + + <view class="outsideSortBox"> + <view class="sortBox" bind:tap="onSwapRight"> + <text>鎺掑簭</text> + <view class="iconBox"> + <t-icon class="swapRight" name="swap-right" size="35rpx" color="{{nameSort == 'Asc' ? '#ff6c00' : ''}}" /> + <t-icon class="swapLeft" name="swap-right" size="35rpx" color="{{nameSort == 'Desc' ? '#ff6c00' : ''}}" /> + </view> + </view> + </view> + + </view> +</view> + <view class="assembleContent"> <view class="titleBox"> @@ -47,7 +55,7 @@ </view> <view class="outside"> - <view wx:if="{{bookExhibitionList.length }}"> + <view wx:if="{{!bookExhibitionList.length }}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> diff --git a/pages/bookExhibitionList/index.wxss b/pages/bookExhibitionList/index.wxss index 3b28263..555a3e2 100644 --- a/pages/bookExhibitionList/index.wxss +++ b/pages/bookExhibitionList/index.wxss @@ -139,8 +139,9 @@ .assembleContent { background-color: #F2F3F8; - + min-height: 90vh; } + .t-dropdown-menu:after, .t-dropdown-menu::after { height: 0px; @@ -202,4 +203,11 @@ .menu--t-dropdown-menu::after { background-color: var(--td-component-border, var(--td-gray-color-4, #fff)) !important; +} + +.noData { + /* display: flex; + justify-content: center; */ + margin: 0 auto; + margin-top: 100rpx; } \ No newline at end of file diff --git a/pages/cart/index.js b/pages/cart/index.js index 7e52034..2abc176 100644 --- a/pages/cart/index.js +++ b/pages/cart/index.js @@ -11,10 +11,14 @@ checkedList: [], selectedCount: 0, totalPrice: 0.00, - type: '' + type: '', + start: 1, + totalSize: '', + isMore: null, }, onLoad(options) { + wx.setNavigationBarTitle({ title: '璐墿杞�' }); @@ -38,16 +42,19 @@ shoppingCartGet() { let query = { start: 0, - size: 999, + size: this.data.start * 4, filterList: [], searchList: [] }; app.MG.store.getShoppingCartProductList(query).then(res => { - console.log(res, 'res'); + + this.setData({ + totalSize: res.totalSize + }) + res.datas.forEach(item => { item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); - console.log(item); - console.log(item.saleMethod.type, 'item.saleMethod.type') + this.setData({ type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' }) @@ -58,6 +65,7 @@ shoppingCartData: res.datas }); }); + wx.stopPullDownRefresh() }, bottomChange(e) { @@ -134,5 +142,35 @@ wx.navigateTo({ url: '/pages/testLogin/index' }); - } + }, + //瑙﹀簳鍑芥暟 + onReachBottom() { + if (this.data.shoppingCartData.length < this.data.totalSize) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.shoppingCartGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + }, + // 涓嬫媺鍑芥暟 + onPullDownRefresh() { + + this.setData({ + start: 1 + }) + console.log(978); + this.shoppingCartGet() + }, + }); diff --git a/pages/cart/index.json b/pages/cart/index.json index e06cfaa..5c4b437 100644 --- a/pages/cart/index.json +++ b/pages/cart/index.json @@ -6,6 +6,11 @@ "t-cell": "tdesign-miniprogram/cell/cell", "t-button": "tdesign-miniprogram/button/button", "t-toast": "tdesign-miniprogram/toast/toast", - "t-empty": "tdesign-miniprogram/empty/empty" - } + "t-empty": "tdesign-miniprogram/empty/empty", + "t-loading": "tdesign-miniprogram/loading/loading", + "t-image": "tdesign-miniprogram/image/image" + }, + "enablePullDownRefresh": true, + "onReachBottomDistance": 200, + "backgroundTextStyle": "dark" } \ No newline at end of file diff --git a/pages/cart/index.wxml b/pages/cart/index.wxml index 7642960..5e42db6 100644 --- a/pages/cart/index.wxml +++ b/pages/cart/index.wxml @@ -46,7 +46,10 @@ </view> <view slot="right" class="btn delete-btn" bind:tap="onDelete" data-item="{{item}}">鍒犻櫎</view> </t-swipe-cell> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </view> <view class="bottomBox"> diff --git a/pages/cart/index.wxss b/pages/cart/index.wxss index 4d47114..b802a96 100644 --- a/pages/cart/index.wxss +++ b/pages/cart/index.wxss @@ -249,4 +249,13 @@ color: #333333; /* margin: 10rpx 0; */ margin-bottom: 20rpx; +} + +.bottom-box { + display: flex; + justify-content: center; + color: #999; + height: 80rpx; + font-size: 28rpx; + --td-loading-color: #ff6c00 } \ No newline at end of file diff --git a/pages/personalCenter/components/user-center-card/index.wxml b/pages/personalCenter/components/user-center-card/index.wxml index 60cff21..04cd0a2 100644 --- a/pages/personalCenter/components/user-center-card/index.wxml +++ b/pages/personalCenter/components/user-center-card/index.wxml @@ -17,7 +17,7 @@ <view class="user-center-card__header"> <t-avatar image="{{userInfo.icon || defaultAvatarUrl}}" class="user-center-card__header__avatar" /> <view> - <view class="user-center-card__header__name">{{userInfo.fullName || '寰俊鐢ㄦ埛'}}</view> + <view class="user-center-card__header__name">{{userInfo.nickName || '寰俊鐢ㄦ埛'}}</view> <view class="userTypeBox"> <text>{{userInfo.userType}}</text> <text class="edit" bindtap="editUserType">淇敼</text> @@ -36,7 +36,7 @@ <view class="user-center-card__header"> <t-avatar t-class="avatar" mode="aspectFill" class="user-center-card__header__avatar" image="{{userInfo.icon || defaultAvatarUrl}}" /> <view> - <view class="user-center-card__header__name">{{userInfo.fullName || '寰俊鐢ㄦ埛'}}</view> + <view class="user-center-card__header__name">{{userInfo.nickName || '寰俊鐢ㄦ埛'}}</view> <view class="userTypeBox"> <text>{{userInfo.userType}}</text> <text bindtap="editUserType">淇敼</text> diff --git a/pages/personalCenter/index.js b/pages/personalCenter/index.js index 7ece773..b7bd420 100644 --- a/pages/personalCenter/index.js +++ b/pages/personalCenter/index.js @@ -175,6 +175,7 @@ type = '-' } let defaultUser = {}; + let nickNameData = res.infoList.find((item) => item.type == 'nickName') let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') @@ -182,8 +183,8 @@ if (teacherRole && teacherInfos) { defaultUser = { ...teacherInfos, - fullName: teacherInfos.fullName, - icon: teacherInfos.icon, + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : teacherInfos.name, + icon: nickNameData ? JSON.parse(nickNameData.data).icon : WeChatInfo ? WeChatInfo.icon : '', userId: res.userId, role: 'Teacher', roleId: teacherRole.role.id, @@ -196,8 +197,8 @@ } else if (WeChatInfo) { defaultUser = { ...WeChatInfo, - fullName: WeChatInfo.name, - icon: WeChatInfo.icon, + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : WeChatInfo.name, + icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : WeChatInfo.icon, userId: res.userId, userType: type } @@ -206,8 +207,8 @@ }); } else if (secretData) { defaultUser = { - fullName: secretData.credential, - icon: "", + nickName: nickNameData ? JSON.parse(nickNameData.data).nickName : secretData.credential, + icon: JSON.parse(nickNameData.data).icon ? JSON.parse(nickNameData.data).icon : "", userId: res.userId, userType: type } diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js index 77f1025..3524d4a 100644 --- a/pages/retrievalPage/index.js +++ b/pages/retrievalPage/index.js @@ -9,6 +9,7 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + isMore: null, tabPanelstyle: 'display:flex;justify-content:center;align-items:center;', navBarHeight: '', barHeight: '', @@ -24,7 +25,12 @@ biblioClassificationData: [],//涔﹀睍 biblioClassificationTotal: 0, bookFairData: [],//涔︾洰 - bookFairTotal: 0 + bookFairTotal: 0, + pageCount: { + page: 1, + total: 0, + }, + tabValue: '' }, /** @@ -35,7 +41,6 @@ const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� this.setData({ - navBarHeight: navBarHeight, barHeight: systInfo.statusBarHeight, searchVal: options.searchVal @@ -44,6 +49,13 @@ this.retrievalPageGet() this.bibliographyGet() + let event = { + detail: { + + value: "0" + } + } + this.onTabsChange(event) }, /** @@ -105,13 +117,47 @@ this.retrievalPageGet() this.bibliographyGet() }, + + + //鏍囩鐨勫垏鎹� onTabsChange(event) { - console.log(`Change tab, tab-panel searchVal is ${event.detail.searchVal}.`); + const value = event.detail.value + if (value === '0') { + this.setData({ + tabValue: value, + isMore: false + }) + } else if (value === '1') { + console.log(value, 'tab'); + this.setData({ + tabValue: value, + isMore: false + }) + } else if (value === '2') { + this.setData({ + tabValue: value, + isMore: false + }) + } else if (value === '3') { + this.setData({ + tabValue: value, + isMore: false + }) + } else if (value === '4') { + this.setData({ + tabValue: value, + isMore: false + }) + } else if (value === '5') { + this.setData({ + tabValue: value, + isMore: false + }) + } + }, - onTabsClick(event) { - console.log(`Click tab, tab-panel searchVal is ${event.detail.searchVal}.`); - }, + retrievalPageGet() { @@ -149,7 +195,7 @@ }, PageQuery: { Start: 0, - Size: 999 + Size: this.data.pageCount.page * 9, }, SortQuery: [ { @@ -194,7 +240,7 @@ }, PageQuery: { Start: 0, - Size: 999 + Size: this.data.pageCount.page * 4 }, SortQuery: [ { @@ -238,7 +284,7 @@ }, PageQuery: { Start: 0, - Size: 999 + Size: this.data.pageCount.page * 9, }, SortQuery: [ { @@ -283,7 +329,7 @@ }, PageQuery: { Start: 0, - Size: 999 + Size: this.data.pageCount.page * 6, }, SortQuery: [ { @@ -327,7 +373,7 @@ PageQuery: { Start: 0, - Size: 999 + Size: this.data.pageCount.page * 10 }, SortQuery: [ { @@ -382,7 +428,8 @@ }) this.setData({ bookData: datas1, - bookTotal: data1.totalCount + bookTotal: data1.totalCount, + }) @@ -434,7 +481,7 @@ datas5.forEach((items) => { items.subtitleName = items.subtitle + items.name }) - console.log(datas5, 'sadasd'); + // console.log(datas5, 'sadasd'); this.setData({ biblioClassificationData: datas5, biblioClassificationTotal: data5.totalCount @@ -444,7 +491,7 @@ }) - + wx.stopPullDownRefresh() }, bibliographyGet() { let bibliographyObj = {} @@ -462,7 +509,7 @@ queryType: '*', paging: { start: 0, - size: 999 + size: this.data.pageCount.page * 9, }, coverSize: { width: 260 @@ -478,13 +525,14 @@ }, SysType: "CmsItem" }).then(res => { - // console.log(res); + this.setData({ bookFairData: res.datas, bookFairTotal: res.total }) }) + wx.stopPullDownRefresh() }, downloadData(event) { console.log(111); @@ -527,8 +575,6 @@ const item = e.currentTarget.dataset.item wx.navigateTo({ url: '/packageBookService/pages/bookServices/detail/index?id=' + item.id + '&name=' + item.name - - }) }, onBookExhibitionDetails(e) { @@ -539,14 +585,151 @@ url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟 }); }, - //瑙﹀簳鍑芥暟 - onReachBottom() { - console.log("涓婃媺鍔犺浇...."); - }, + //涓婃媺鍑芥暟 onPullDownRefresh() { console.log("涓嬫媺鍒锋柊..."); }, + /** + * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� + */ + onReachBottom(e) { + if (this.data.tabValue == 0) { + console.log(0); + if (this.data.bookData.length < this.data.bookTotal) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.retrievalPageGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + + } else if (this.data.tabValue == 1) { + + if (this.data.courseData.length < this.data.courseTotal) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.retrievalPageGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + console.log(2); + } else if (this.data.tabValue == 2) { + + if (this.data.digitalTextbooksData.length < this.data.digitalTextbooksTotal && this.data.digitalTextbooksData.length > 9) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.retrievalPageGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + console.log(2); + } else if (this.data.tabValue == 3) { + if (this.data.seminarData.length < this.data.seminarTotal) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.retrievalPageGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + } + console.log(3); + } else if (this.data.tabValue == 4) { + if (this.data.bookFairData.length < this.data.bookFairTotal) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.bibliographyGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + } + console.log(4); + } else if (this.data.tabValue == 5) { + if (this.data.biblioClassificationData.length < this.data.biblioClassificationTotal) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.retrievalPageGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + }, 100) + + } + } + + }, + + // 涓嬫媺鍑芥暟 + onPullDownRefresh() { + + if (this.data.tabValue == 4) { + this.setData({ + "pageCount.page": 1 + }) + this.bibliographyGet() + } else { + this.setData({ + "pageCount.page": 1 + }) + this.retrievalPageGet() + } + + + + }, }) \ No newline at end of file diff --git a/pages/retrievalPage/index.json b/pages/retrievalPage/index.json index fa9fab5..a348276 100644 --- a/pages/retrievalPage/index.json +++ b/pages/retrievalPage/index.json @@ -5,8 +5,13 @@ "t-search": "tdesign-miniprogram/search/search", "t-tabs": "tdesign-miniprogram/tabs/tabs", "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", - "t-empty": "tdesign-miniprogram/empty/empty" + "t-empty": "tdesign-miniprogram/empty/empty", + "t-toast": "tdesign-miniprogram/toast/toast", + "t-loading": "tdesign-miniprogram/loading/loading", + "t-image": "tdesign-miniprogram/image/image" }, "navigationStyle": "custom", - "enablePullDownRefresh": true + "enablePullDownRefresh": true, + "onReachBottomDistance": 200, + "backgroundTextStyle": "dark" } \ No newline at end of file diff --git a/pages/retrievalPage/index.wxml b/pages/retrievalPage/index.wxml index c36c3f5..97a1e59 100644 --- a/pages/retrievalPage/index.wxml +++ b/pages/retrievalPage/index.wxml @@ -10,7 +10,6 @@ <view class="example-search"> <t-search bind:submit="onSearchSubmit" class="searchBox" model:value="{{searchVal}}" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" /> - <view class="cancellation" bind:tap="onCancellation">鍙栨秷</view> </view> @@ -37,7 +36,10 @@ </view> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </t-tab-panel> <t-tab-panel label="璇剧▼({{courseTotal}})" value="1"> @@ -47,7 +49,7 @@ <view wx:if="{{courseData.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <view wx:if="{{courseData.length>0}}"> + <view> <view wx:for="{{courseData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="listItemBox"> <view class="listItem flex"> <view class="specialSubject-img"> @@ -71,7 +73,10 @@ </view> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </t-tab-panel> <t-tab-panel label="鏁板瓧鏁欐潗({{digitalTextbooksTotal}})" value="2"> @@ -95,7 +100,10 @@ </view> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> @@ -125,7 +133,10 @@ </view> </view> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </t-tab-panel> <t-tab-panel label="涔︾洰({{bookFairTotal}})" value="4"> @@ -154,7 +165,10 @@ - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> @@ -173,7 +187,10 @@ </view> - + <view class="bottom-box"> + <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> </t-tab-panel> </t-tabs> \ No newline at end of file diff --git a/pages/retrievalPage/index.wxss b/pages/retrievalPage/index.wxss index b17fdca..e2cc9b1 100644 --- a/pages/retrievalPage/index.wxss +++ b/pages/retrievalPage/index.wxss @@ -87,6 +87,11 @@ font-weight: 400; font-size: 22rpx; color: #333333; + word-break: break-all; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; } @@ -111,6 +116,7 @@ border-radius: 5px; overflow: hidden; box-shadow: 0px 0px 20rpx 2px #f1f1f1; + min-height: 170rpx; } @@ -128,6 +134,7 @@ .body-info { padding: 20rpx; font-size: 28rpx; + min-height: 110rpx; } .body-info .name { @@ -301,4 +308,22 @@ align-items: center */ margin: 0 auto; margin-top: 250rpx; +} + +.bottom-box { + display: flex; + justify-content: center; + color: #999; + height: 80rpx; + font-size: 28rpx; + --td-loading-color: #ff6c00 +} + +.loading-box { + width: 100%; + height: calc(100vh - 500rpx); + display: flex; + align-items: center; + justify-content: center; + --td-loading-color: #ff6c00; } \ No newline at end of file -- Gitblit v1.9.1