From dc934dfd63fecff84d0bf996418e041b9bd4ea59 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 30 四月 2024 18:16:13 +0800 Subject: [PATCH] bug修改 --- packageBookService/pages/bookServices/list/index.wxml | 1 packagePersonal/pages/aboutUs/index.js | 1 packageBookService/pages/bookServices/detail/buyResource/index.js | 1 packageBookService/pages/bookServices/list/index.wxss | 4 packageDomain/pages/resourceDetails/document/index.wxml | 39 packageDomain/pages/sampleBookList/index.wxml | 4 packagePersonal/pages/myCollection/index.js | 5 packageBookService/pages/bookServices/detail/index.wxml | 7 pages/retrievalPage/index.json | 2 pages/bookExhibitionList/index.js | 460 +++++------- packageBookService/pages/components/webView/index.js | 3 packageDomain/pages/resourceDetails/myVideo/index.wxml | 125 ++ packageBookService/pages/bookServices/detail/components/tree/index.js | 173 ++-- packageBookService/pages/bookServices/detail/buyResource/index.wxss | 2 packageDomain/pages/sampleBookList/index.js | 1 pages/bibliographyList/index.json | 3 packageBookService/pages/bookServices/detail/index.js | 33 pages/retrievalPage/index.js | 14 pages/cart/index.wxss | 4 pages/cart/index.wxml | 88 + pages/bookExhibitionList/index.wxss | 3 packageDomain/pages/resourceDetails/myVideo/index.js | 45 pages/bookExhibitionList/index.wxml | 105 + pages/retrievalPage/index.wxml | 341 ++++++-- pages/retrievalPage/index.wxss | 4 packageBookService/pages/components/webView/index.wxml | 19 packageBookService/pages/bookServices/detail/components/tree/index.wxss | 15 packageDomain/pages/resourceDetails/document/index.js | 53 - packageBookService/pages/bookServices/detail/components/tree/index.wxml | 16 packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js | 26 pages/cart/index.js | 27 pages/bibliographyList/index.wxml | 339 ++++++-- pages/bibliographyList/index.wxss | 30 packageBookService/pages/components/webView/index.wxss | 4 pages/bibliographyList/index.js | 167 --- 35 files changed, 1,174 insertions(+), 990 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/buyResource/index.js b/packageBookService/pages/bookServices/detail/buyResource/index.js index 8986936..d1dc629 100644 --- a/packageBookService/pages/bookServices/detail/buyResource/index.js +++ b/packageBookService/pages/bookServices/detail/buyResource/index.js @@ -234,6 +234,7 @@ itemFields: { SysType: 'CmsFolder', // 璧勬簮绫诲瀷锛岃瘯璇绘枃浠讹紝鏄惁鍏佽涓嬭浇绛夊弬鏁� + learnSelectType: [], selectType: [], freeFile: [], file: [], diff --git a/packageBookService/pages/bookServices/detail/buyResource/index.wxss b/packageBookService/pages/bookServices/detail/buyResource/index.wxss index 2520290..af71eac 100644 --- a/packageBookService/pages/bookServices/detail/buyResource/index.wxss +++ b/packageBookService/pages/bookServices/detail/buyResource/index.wxss @@ -44,7 +44,7 @@ position: fixed; bottom: env(safe-area-inset-bottom); width: 100%; - /* height: 100rpx; */ + height: min-content; display: flex; justify-content: center锛� } diff --git a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js index 195d0a2..9d5ee0d 100644 --- a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js +++ b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js @@ -15,7 +15,9 @@ }, successOrderNumber: { type: Number, - + }, + isGoBuyResource: { + type: Boolean } }, @@ -39,25 +41,17 @@ } // 瑙﹀彂浜嬩欢鐨勯�夐」 this.triggerEvent('getFreeResource', myEventDetail, myEventOption) }, - // allAddShoppiingCar() { - // var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 - // var myEventOption = { - // bubbles: true, - // composed: true - // } // 瑙﹀彂浜嬩欢鐨勯�夐」 - // this.triggerEvent('allAddShoppiingCar', myEventDetail, myEventOption) - // }, + // 璺宠浆璧勬簮璐拱椤� goBuyResource() { - console.log(this.properties.successOrderNumber); -if(this.properties.successOrderNumber !== 0){ - - - -} + if (!this.properties.isGoBuyResource) { + return wx.showToast({ + icon: 'error', + title: '鏆傛棤鍙喘涔拌祫婧�', + }) + } wx.navigateTo({ url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`, }) - }, changeReceive(type) { diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js index b15157c..f8e88e0 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.js +++ b/packageBookService/pages/bookServices/detail/components/tree/index.js @@ -11,7 +11,7 @@ }, learnList: { type: Array, - value: [] + value: [], }, bookInfo: { type: Object, @@ -49,8 +49,8 @@ type: Boolean, }, deadline: { - type: String - } + type: String, + }, }, data: { sonPurchaseSaleMethodId: "", @@ -135,25 +135,15 @@ // 璺宠浆闊宠棰戞挱鏀惧櫒 goPlayer(e) { // 妫�鏌ョ櫥褰曠姸鎬� - - - - const token = wx.getStorageSync(app.config.tokenKey); if (token) { - - - - - const item = e.currentTarget.dataset.item; const parent = e.currentTarget.dataset.parent; - const parentProductLinkPath = parent ? parent.productLinkPath : wx.getStorageSync('teachResourcesPath') - const parentName = parent ? parent.name : '鏁欏璧勬簮' + const parentProductLinkPath = parent ? + parent.productLinkPath : + wx.getStorageSync("teachResourcesPath"); + const parentName = parent ? parent.name : "鏁欏璧勬簮"; let url; - - - if (this.properties.isShowCheck && this.resourceIsBuy(item)) { return false; } @@ -177,36 +167,35 @@ "璇峰厛璐拱璇ヨ祫婧�" : "璇峰厛鐐瑰嚮棰嗗彇鏌ョ湅鎸夐挳", }); } - if (item.saleMethod.length == 0 && item.sysType == 'CmsItem' && this.properties.tab == "jsek_cloudLearning") { + if ( + item.saleMethod.length == 0 && + item.sysType == "CmsItem" && + this.properties.tab == "jsek_cloudLearning" + ) { return wx.showToast({ - icon: 'error', - title: '鏆傛湭寮�濮嬮攢鍞紝璇疯仈绯荤鐞嗗憳', - }) + icon: "error", + title: "鏆傛湭寮�濮嬮攢鍞紝璇疯仈绯荤鐞嗗憳", + }); } if (this.properties.tab == "jsek_teachingResources" && item.fileMap) { - if (item.file && item.fileMap[item.file].protectType !== "Public") { + let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile] + debugger + if (file && file.protectType !== "Public") { return wx.showToast({ - icon: 'error', - title: '璧勬簮涓嶅彲鐢紝璇疯仈绯荤鐞嗗憳', - }) - } else if (item.freeFile && item.fileMap[item.freeFile].protectType !== "Public") { - return wx.showToast({ - icon: 'error', - title: '璧勬簮涓嶅彲鐢紝璇疯仈绯荤鐞嗗憳', - }) + icon: "error", + title: "璧勬簮涓嶅彲鐢紝璇疯仈绯荤鐞嗗憳", + }); } + } else { + return wx.showToast({ + icon: 'error', + title: '鏆傛棤璧勬簮', + }) } wx.navigateTo({ url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`, }); - - - // || item.selectType == "pdf" - - - if (item.selectType == "pdf") { - console.log(item, '79825'); const fileLink = item.file ? item.file : item.freeFile console.log(fileLink); wx.navigateTo({ @@ -216,19 +205,18 @@ item.name + "&fileType=" + item.selectType + "&bookBuy=true" - }); } if (item.selectType == "document") { // freeFile - if (item.selectType == "document") { - item.selectType = "pptx" - + item.selectType = "pptx"; } - console.log(item); const fileLink = item.file ? - app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.freeFile + app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : + app.config.requestCtx + + "/file/api/ApiDownload?md5=" + + item.freeFile; console.log(fileLink, "fileLink"); //鎻愮ず鍔犺浇涓� util.showLoading(); @@ -259,31 +247,12 @@ util.hideLoadingWithErrorTips(); }, }); - - - - } - - - - if (item.selectType == "webpage") { this.setData({ webpageSrc: item.jsek_link, }); - console.log(this.data.webpageSrc, "webpageSrc"); } - - - - - - - - - - } }, @@ -350,7 +319,6 @@ for (let node of tree) { findAndUpdate(node); // 瀵规瘡涓《灞傝妭鐐规墽琛屾煡鎵惧拰鏇存柊鎿嶄綔 } - // console.log(tree, 'tree345'); return tree; // 杩斿洖淇敼鍚庣殑瀹屾暣鏁扮粍 }, @@ -427,15 +395,20 @@ // 杩欎釜鏃跺�檆hecked鐨勫�兼槸fals let checkResourceTitleList = []; const item = e.currentTarget.dataset.item; - const parent = this.findParentById(this.properties.learnList, item.id) - let childrenList - let flagNum - if (parent) childrenList = parent.children.filter(citem => citem.id !== item.id) - if (childrenList) flagNum = childrenList.findIndex(item => item.checked == false) + const parent = this.findParentById(this.properties.learnList, item.id); + let childrenList; + let flagNum; + if (parent) + childrenList = parent.children.filter((citem) => citem.id !== item.id); + if (childrenList) + flagNum = childrenList.findIndex((item) => item.checked == false); let list = this.flattenTree([item]); let ids = []; list.forEach((item) => { - if (item.sysType == 'CmsFolder' || (item.sysType == 'CmsItem' && item.saleMethod.length)) + if ( + item.sysType == "CmsFolder" || + (item.sysType == "CmsItem" && item.saleMethod.length) + ) ids.push(item.id); }); var myEventDetail = { @@ -448,7 +421,7 @@ }; // 瑙﹀彂浜嬩欢鐨勯�夐」 this.triggerEvent("changeListChecked", myEventDetail, myEventOption); if (flagNum == -1) { - let checkedState + let checkedState; var myEventDetail = { ids: [parent.id], flag, @@ -479,14 +452,17 @@ // 瀛愰」鍕鹃�� checkResource(e) { const citem = e.currentTarget.dataset.item; - const parent = e.currentTarget.dataset.parent - let outermost - if (parent) outermost = this.findParentById(this.properties.learnList, parent.id) - const childrenList = parent.children.filter(item => item.id !== citem.id && item.saleMethod.length) - const flag = childrenList.findIndex(item => item.checked == false) + const parent = e.currentTarget.dataset.parent; + let outermost; + if (parent) + outermost = this.findParentById(this.properties.learnList, parent.id); + const childrenList = parent.children.filter( + (item) => item.id !== citem.id && item.saleMethod.length + ); + const flag = childrenList.findIndex((item) => item.checked == false); // 鏀瑰彉璇ラ」checked var myEventDetail = { - id: citem.id + id: citem.id, }; var myEventOption = { bubbles: true, @@ -495,8 +471,8 @@ this.triggerEvent("changeResourceChecked", myEventDetail, myEventOption); // 閫氳繃鍒ゆ柇,鑱旈�氱埗绾hecked if (flag == -1) { - let checkedState - citem.checked == false ? checkedState = true : checkedState = false + let checkedState; + citem.checked == false ? (checkedState = true) : (checkedState = false); var myEventDetail = { ids: [parent.id], flag: checkedState, @@ -521,9 +497,14 @@ } // 鑱旈�氭渶澶栧眰绾hecked, 濡傛灉鎵�鏈夊瓙椤瑰嬀閫�, 涓斿綋鍓嶆渶澶栧眰鏈嬀閫�, 鍒欏姞涓婃渶澶栧眰鐨勫嬀閫� if (!citem.checked && outermost) { - let allchildren = this.flattenTree([outermost]) - allchildren = allchildren.filter(item => item.sysType == 'CmsItem' && item.id !== citem.id && item.saleMethod.length) - const satate = allchildren.findIndex(item => item.checked == false) + let allchildren = this.flattenTree([outermost]); + allchildren = allchildren.filter( + (item) => + item.sysType == "CmsItem" && + item.id !== citem.id && + item.saleMethod.length + ); + const satate = allchildren.findIndex((item) => item.checked == false); if (satate == -1) { var myEventDetail = { ids: [outermost.id], @@ -557,7 +538,7 @@ async onCloudShoppingCart(e) { let shoppingCartGetId = []; - const item = e.currentTarget.dataset.item + const item = e.currentTarget.dataset.item; console.log(item.isShopCar); const saleMethodId = e.currentTarget.dataset.item.saleMethod[0].Id; console.log(saleMethodId); @@ -567,16 +548,13 @@ filterList: [], searchList: [], }; - const res = await app.MG.store.getShoppingCartProductList(query); res.datas.forEach((item) => { shoppingCartGetId.push(item.saleMethod.id); }); if (shoppingCartGetId.includes(saleMethodId)) { - console.log(111); // this.data.updateShoppingCartHidden(); // this.data.updateCloudLearning(); - wx.showToast({ icon: "error", title: "宸叉坊鍔�", @@ -599,8 +577,8 @@ icon: "success", title: "娣诲姞鎴愬姛", }); - item.isShopCar = false - this.triggerEvent("updateCloudLearning") + item.isShopCar = false; + this.triggerEvent("updateCloudLearning"); } } }, @@ -611,23 +589,22 @@ findParentById(arr, id) { for (let i = 0; i < arr.length; i++) { const item = arr[i]; - // 妫�鏌ュ綋鍓嶉」鏄惁鍖归厤锛堝嵆瀹冩槸涓嶆槸鎴戜滑瑕佹壘鐨勯」锛� + // 妫�鏌ュ綋鍓嶉」鏄惁鍖归厤锛堝嵆瀹冩槸涓嶆槸鎴戜滑瑕佹壘鐨勯」锛� if (item.id === id) { - // 濡傛灉褰撳墠椤瑰氨鏄垜浠鎵剧殑椤癸紝鍒欏畠娌℃湁鐖剁骇锛岃繑鍥� null + // 濡傛灉褰撳墠椤瑰氨鏄垜浠鎵剧殑椤癸紝鍒欏畠娌℃湁鐖剁骇锛岃繑鍥� null return null; } - // 閫掑綊鏌ユ壘褰撳墠椤圭殑瀛愰」 + // 閫掑綊鏌ユ壘褰撳墠椤圭殑瀛愰」 const child = this.findChildById(item.children, id); if (child) { - // 濡傛灉鍦ㄥ瓙椤逛腑鎵惧埌鍖归厤鐨勯」锛岃繑鍥炲綋鍓嶉」浣滀负鐖剁骇 + // 濡傛灉鍦ㄥ瓙椤逛腑鎵惧埌鍖归厤鐨勯」锛岃繑鍥炲綋鍓嶉」浣滀负鐖剁骇 return item; } } - // 濡傛灉娌℃湁鎵惧埌鍖归厤鐨勭埗椤癸紝杩斿洖 null + // 濡傛灉娌℃湁鎵惧埌鍖归厤鐨勭埗椤癸紝杩斿洖 null return null; }, - - // 杈呭姪鍑芥暟锛岀敤浜庨�掑綊鏌ユ壘瀛愰」 + // 杈呭姪鍑芥暟锛岀敤浜庨�掑綊鏌ユ壘瀛愰」 findChildById(children, id) { if (!children) { return null; @@ -635,17 +612,17 @@ for (let i = 0; i < children.length; i++) { const child = children[i]; if (child.id === id) { - // 濡傛灉鎵惧埌鍖归厤鐨勯」锛岃繑鍥炲畠 + // 濡傛灉鎵惧埌鍖归厤鐨勯」锛岃繑鍥炲畠 return child; } - // 閫掑綊妫�鏌ュ瓙椤圭殑瀛愰」 + // 閫掑綊妫�鏌ュ瓙椤圭殑瀛愰」 const subChild = this.findChildById(child.children, id); if (subChild) { return subChild; } } - // 濡傛灉娌℃湁鎵惧埌鍖归厤鐨勯」锛岃繑鍥� null + // 濡傛灉娌℃湁鎵惧埌鍖归厤鐨勯」锛岃繑鍥� null return null; - } + }, }, }); \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.wxml b/packageBookService/pages/bookServices/detail/components/tree/index.wxml index 3d57863..36fe711 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.wxml +++ b/packageBookService/pages/bookServices/detail/components/tree/index.wxml @@ -255,23 +255,13 @@ <!-- 鍚嶇О --> <text class="name" - style="{{ tab == 'jsek_teachingResources' ? 'width: 420rpx;' : 'width: 400rpx;'}}" + style="{{ tab == 'jsek_teachingResources' ? citem.resourceClass ? 'width: 420rpx' : 'width: 560rpx;' : 'width: 400rpx;'}}" >{{citem.name || '-'}}</text > </view> <!-- 鏁欏璧勬簮绫诲瀷 --> - <view class="teachClass"> {{citem.resourceClass}} </view> - <view - class="teach-btn" - wx:if="{{tab == 'jsek_teachingResources'}}" - > - <!-- 涓嬭浇鎸夐挳 --> - <!-- <image - src="/static/images/bookService/detail/download-icon.png" - class="download-image" - data-value="{{citem}}" - catchtap="downloadTeach" - ></image> --> + <view class="teachClass" wx:if="{{citem.resourceClass}}"> + {{citem.resourceClass}} </view> <view wx:if="{{tab == 'jsek_cloudLearning'}}"> <!-- 浜戝涔犺瘯鐪嬪浘鏍� --> diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.wxss b/packageBookService/pages/bookServices/detail/components/tree/index.wxss index 7d62423..ed796d5 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.wxss +++ b/packageBookService/pages/bookServices/detail/components/tree/index.wxss @@ -1,17 +1,16 @@ .tree { --td-collapse-content-padding: 0rpx 12rpx 32rpx 12rpx; - --td-collapse-header-text-color: #ff6C00; + --td-collapse-header-text-color: #ff6c00; --td-collapse-icon-color: #ff6c00; --td-collapse-header-height: min-content; } - .header-title { width: 100%; display: flex; justify-content: space-between; align-items: center; - --td-checkbox-vertical-padding: 0 + --td-checkbox-vertical-padding: 0; } .title-box { @@ -25,14 +24,12 @@ display: flex; } - - .title-name { height: min-content; } .t-class { - background-color: #F7F7F7; + background-color: #f7f7f7; } .t-class-content { @@ -48,7 +45,7 @@ margin: 0 26rpx; padding: 0 20rpx; height: 88rpx; - background-color: #FFF6F0; + background-color: #fff6f0; margin-top: 24rpx; display: flex; align-items: center; @@ -57,7 +54,7 @@ .contentBox .checkBox { --td-checkbox-vertical-padding: 0; - --td-checkbox-bg-color: #FFF6F0; + --td-checkbox-bg-color: #fff6f0; } .box-image { @@ -109,4 +106,4 @@ /* .t-collapse-panel__content { padding: var(--td-collapse-content-padding, 0rpx) !important; -} */ \ No newline at end of file +} */ diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 3ee1ff3..e5b7821 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -37,6 +37,8 @@ openTeachids: [], openLearnids: [], openTestids: [], + isGoBuyResource: true, + learnPath: '', applyResourceState: false, // 鐢宠鏁欏璧勬簮鎸夐挳闃叉姈 resourceClassList: [], // 璧勬簮鎵�灞炲垎绫� applyState: "", // 鏁欏璧勬簮鐢宠鐘舵�� @@ -746,7 +748,7 @@ return num }, - // 缁櫬风洰褰曟坊鍔犲瓙椤规暟閲� + // 缁欑洰褰曟坊鍔犲瓙椤规暟閲� changeResourceChildren(list) { const changeList = (list) => { for (let index = 0; index < list.length; index++) { @@ -900,6 +902,22 @@ } } }); + if (type.refCode == "jsek_cloudLearning") { + this.setData({ + learnPath: type.productLinkPath + }) + const dataList = res.datas.cmsDatas[0].datas + if (dataList.length) { + const tag = dataList.findIndex(item => this.isShowNeedBuy(item)) + this.setData({ + isGoBuyResource: tag > -1 ? true : false + }) + } else { + this.setData({ + isGoBuyResource: false + }) + } + } const num = query.cmsPath.length + 6 this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\') list = this.ensureTreeConsistency(list) @@ -1686,19 +1704,19 @@ }; // 纭璁㈠崟 const confirmOrderRes = await app.MG.store.confirmOrder(parameter); - console.log(confirmOrderRes.orderNumber, 'confirmOrderRes.orderNumber'); - if (confirmOrderRes.orderNumber) { child.changeReceive(false); wx.showToast({ title: "棰嗗彇鎴愬姛", }); this.getBookInfo(this.data.bookId); + this.getResourceDataList({ + refCode: 'jsek_cloudLearning', + productLinkPath: this.data.learnPath + }) this.setData({ successOrderNumber: confirmOrderRes.orderNumber }) - - } } catch (error) { console.log(error); @@ -2026,7 +2044,6 @@ this.data.bookDetail.id, }); - debugger }, //鏍蜂功鐢宠 @@ -2093,7 +2110,7 @@ const smBook = list.find(item => item.content[0].id == this.data.bookDetail.id) console.log('宸茬敵璇�', smBook); if (smBook && smBook.state == 'Normal') { - const flag = new Date(JSON.parse(smBook.feedBack).endDate + '23:59:59').getTime() > new Date().getTime() + const flag = new Date(smBook.feedBack.endDate + '23:59:59').getTime() > new Date().getTime() if (flag) { this.setData({ applicationState: 'Normal' @@ -2203,7 +2220,7 @@ }); return false; } else if (isApply.state == 'Normal') { - const flag = new Date(JSON.parse(isApply.feedBack).endDate + '23:59:59').getTime() > new Date().getTime() + const flag = new Date(isApply.feedBack.endDate + '23:59:59').getTime() > new Date().getTime() if (flag) { wx.showToast({ title: "璇ヤ功宸茬敵璇凤紒", diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml index 4b32c1f..8507c3c 100644 --- a/packageBookService/pages/bookServices/detail/index.wxml +++ b/packageBookService/pages/bookServices/detail/index.wxml @@ -272,6 +272,7 @@ bookId="{{bookDetail.id}}" isshowDrawBtn="{{isshowDrawBtn}}" successOrderNumber="{{successOrderNumber}}" + isGoBuyResource="{{isGoBuyResource}}" ></learn-resource> <tree @@ -381,7 +382,7 @@ <view class="{{!bookBuy && bookDetail.isSell ? 'bottom-btn tryRead' : 'bottom-btn try'}}" bind:tap="goRead" - wx:if="{{ applicationState == 'overdue' ? true :!bookBuy}}" + wx:if="{{!bookBuy}}" > <view> <t-image src="/static/images/bookService/detail/shidu.png"></t-image> @@ -392,7 +393,7 @@ <view class="shopCar shopCarColor" bind:tap="addBookShopcCar" - wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}" + wx:if="{{!bookBuy && bookDetail.price !== '0.00' && bookDetail.isSell == '1'}}" >鍔犲叆璐墿杞�</view > <view @@ -407,7 +408,7 @@ wx:if="{{!bookBuy && bookDetail.price == '0.00' && bookDetail.isSell == '1'}}" >鍏嶈垂棰嗗彇</view > - <view class="buy read" bind:tap="goRead" wx:if="{{ applicationState == 'Normal' ? true : bookBuy}}">绔嬪嵆鏌ョ湅</view> + <view class="buy read" bind:tap="goRead" wx:if="{{bookBuy}}">绔嬪嵆鏌ョ湅</view> </view> </view> diff --git a/packageBookService/pages/bookServices/list/index.wxml b/packageBookService/pages/bookServices/list/index.wxml index 4254797..ba61f26 100644 --- a/packageBookService/pages/bookServices/list/index.wxml +++ b/packageBookService/pages/bookServices/list/index.wxml @@ -94,7 +94,6 @@ bindrefresherrefresh="onPullDownRefresh" bindrefresherpulling="{{refresh.onPulling}}" class="list-container" - bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom" > <view slot="refresher" class="refresh-container"> diff --git a/packageBookService/pages/bookServices/list/index.wxss b/packageBookService/pages/bookServices/list/index.wxss index d2a9887..57de768 100644 --- a/packageBookService/pages/bookServices/list/index.wxss +++ b/packageBookService/pages/bookServices/list/index.wxss @@ -258,4 +258,8 @@ .t-radio { font-size: var(--td-radio-font-size, 28rpx) !important; +} + +.t-icon-base { + font-size: 44rpx; } \ No newline at end of file diff --git a/packageBookService/pages/components/webView/index.js b/packageBookService/pages/components/webView/index.js index fba1875..0db1d1a 100644 --- a/packageBookService/pages/components/webView/index.js +++ b/packageBookService/pages/components/webView/index.js @@ -32,7 +32,6 @@ src: '' }) if (options) { - console.log(options) wx.setNavigationBarTitle({ title: options.fileName, skeletonLoding: true @@ -96,12 +95,10 @@ const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + data.md5 + '&index=' + (i + 1) + '&dpi=300' list.push(src) } - console.log(list) that.setData({ pdfList: list, skeletonLoding: false, }) - } }) } diff --git a/packageBookService/pages/components/webView/index.wxml b/packageBookService/pages/components/webView/index.wxml index dbc0a99..61effb3 100644 --- a/packageBookService/pages/components/webView/index.wxml +++ b/packageBookService/pages/components/webView/index.wxml @@ -4,9 +4,22 @@ <t-loading theme="circular" size="40rpx" class="wrapper" /> </view> <view wx:if="{{epubObj.fileType == 'pdf' && !skeletonLoding}}" class="pdfBox"> - <view wx:for="{{pdfList}}" wx:key="index" wx:for-item="item" wx:for-index="index" class="pdfItem"> + <view + wx:for="{{pdfList}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + class="pdfItem" + > <image src="{{item}}" alt="" mode="widthFix"></image> </view> </view> - <web-view bind:message="drawBack" binderror="onError" bindload="onLoadWeb" src="{{src}}" id="webView" wx:if="{{epubObj.fileType !== 'pdf' && !skeletonLoding}}"></web-view> -</view> \ No newline at end of file + <web-view + bind:message="drawBack" + binderror="onError" + bindload="onLoadWeb" + src="{{src}}" + id="webView" + wx:if="{{epubObj.fileType !== 'pdf' && !skeletonLoding}}" + ></web-view> +</view> diff --git a/packageBookService/pages/components/webView/index.wxss b/packageBookService/pages/components/webView/index.wxss index 19586d0..86fb704 100644 --- a/packageBookService/pages/components/webView/index.wxss +++ b/packageBookService/pages/components/webView/index.wxss @@ -15,6 +15,10 @@ text-align: center; } +.pdfItem image { + height: 1000rpx !important; +} + .body-loading { padding: 200rpx 0; text-align: center; diff --git a/packageDomain/pages/resourceDetails/document/index.js b/packageDomain/pages/resourceDetails/document/index.js index 2449ab4..2276497 100644 --- a/packageDomain/pages/resourceDetails/document/index.js +++ b/packageDomain/pages/resourceDetails/document/index.js @@ -38,23 +38,13 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - wx.setNavigationBarTitle({ title: '璧勬簮璇︽儏' }); - - - - - - - - console.log(options); const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� - this.setData({ navBarHeight: navBarHeight, barHeight: systInfo.statusBarHeight, @@ -94,12 +84,11 @@ this.setData({ pauseTime: Date.now() }) - if (wx.getStorageSync(app.config.tokenKey) && epubObj.bookBuy) { + if (wx.getStorageSync(app.config.tokenKey) && epubObj && epubObj.bookBuy) { let duration = this.data.pauseTime - this.data.startTime this.count(duration) } }, - /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 @@ -108,7 +97,7 @@ this.setData({ pauseTime: Date.now() }) - if (wx.getStorageSync(app.config.tokenKey) && epubObj.bookBuy) { + if (wx.getStorageSync(app.config.tokenKey) && epubObj && epubObj.bookBuy) { let duration = this.data.pauseTime - this.data.startTime this.count(duration) } @@ -184,11 +173,6 @@ app.MG.store.getProductDetail(query).then((res) => { console.log(res); res.datas.cmsDatas[0].datas.forEach((item) => { - - - - - //鍒氬垰杩涙潵鐨勬椂鍊� if (this.data.productLinkPath == item.productLinkPath) { this.handleTeachData(item) this.setData({ @@ -196,8 +180,6 @@ selectType: item.selectType }) } - - }) }) }, @@ -205,16 +187,13 @@ onDownloadButton() { const item = this.data.zipData; if (this.data.applyState !== 'Normal') { - return wx.showToast({ - icon: 'none', - title: '璇峰厛鐢宠涓嬭浇', - }) - } else { - const flag = new Date(this.data.deadline) > new Date() - if (!flag) return wx.showToast({ - icon: 'none', - title: '璇峰厛鐢宠涓嬭浇', - }) + if (!this.data.deadline == '姘镐箙') { + const flag = new Date(this.data.deadline) > new Date() + return wx.showToast({ + icon: 'none', + title: '璇峰厛鐢宠涓嬭浇', + }) + } } if (!item || !item.file) { wx.showToast({ @@ -227,7 +206,6 @@ wx.showLoading({ title: '姝e湪涓嬭浇...', }); - wx.downloadFile({ url: downloadUrl, success(res) { @@ -285,9 +263,7 @@ console.log(item, 'item11111'); if (item.selectType == 'picture') { this.setData({ - showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile, - }) console.log(this.data.showData, 'showData'); } @@ -303,7 +279,6 @@ webpageSrc: item.jsek_link }) } - //鏂囨。绛� if (item.selectType == 'pdf' || item.selectType == 'document') { app.MG.file.getPdfInfo({ @@ -317,14 +292,8 @@ } } }) - - - - } }, - - handleTap: function () { const naturalResources = this.data.naturalResources; @@ -332,8 +301,6 @@ // console.log(item); }); }, - - onClick() { this.setData({ @@ -349,7 +316,6 @@ const { index } = e.detail; - console.log('change', index); }, @@ -378,7 +344,6 @@ preview(event) { console.log(event.currentTarget.dataset.src) let currentUrl = event.currentTarget.dataset.src - wx.previewImage({ current: currentUrl, // 褰撳墠鏄剧ず鍥剧墖鐨刪ttp閾炬帴 // urls: this.data.showData // 闇�瑕侀瑙堢殑鍥剧墖http閾炬帴鍒楄〃 diff --git a/packageDomain/pages/resourceDetails/document/index.wxml b/packageDomain/pages/resourceDetails/document/index.wxml index 53c2075..a583aa9 100644 --- a/packageDomain/pages/resourceDetails/document/index.wxml +++ b/packageDomain/pages/resourceDetails/document/index.wxml @@ -13,7 +13,12 @@ </view> <!-- bind:tap="onClick" --> <view class="pictureBox" wx:if="{{selectType == 'picture'}}"> - <image src="{{showData}}" mode="aspectFit" data-src="{{showData}}" bindtap="preview" /> + <image + src="{{showData}}" + mode="aspectFit" + data-src="{{showData}}" + bindtap="preview" + /> </view> <view wx:if="{{selectType == 'zip'}}"> @@ -21,32 +26,38 @@ <image src="/static/images/document/zip200px.png" mode="aspectFill" /> </view> - <view class="button-example"> <t-button size="large" bind:tap="onDownloadButton"> - <view class="text"> - 涓嬭浇 - </view> + <view class="text"> 涓嬭浇 </view> </t-button> </view> </view> - <view wx:if="{{selectType == 'pdf' || selectType == 'document'}}"> - <view wx:for="{{naturalResources}}" wx:key="index" wx:for-item="item" wx:for-index="index"> - <image src="{{item}}" alt="" style="min-height: 550px;"></image> + <view + wx:for="{{naturalResources}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + > + <image src="{{item}}" alt="" style="min-height: 550px"></image> <view class="divider">绗� {{index + 1}} 椤�</view> </view> </view> - - - <web-view wx:if="{{selectType == 'webpage'}}" src="{{webpageSrc}}"></web-view> <!-- <button bind:tap="handleTap">鐐逛綅</button> --> - - <!-- <t-button theme="primary" size="large" variant="outline" block>鍩虹鍥剧墖棰勮</t-button> --> <t-toast id="t-toast" /> -<t-image-viewer usingCustomNavbar deleteBtn="{{deleteBtn}}" closeBtn="{{closeBtn}}" showIndex="{{showIndex}}" visible="{{visible}}" images="{{images}}" bind:change="onChange" bind:delete="onDelete" bind:close="onClose"></t-image-viewer> \ No newline at end of file +<t-image-viewer + usingCustomNavbar + deleteBtn="{{deleteBtn}}" + closeBtn="{{closeBtn}}" + showIndex="{{showIndex}}" + visible="{{visible}}" + images="{{images}}" + bind:change="onChange" + bind:delete="onDelete" + bind:close="onClose" +></t-image-viewer> diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js index 63118dd..5033850 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.js +++ b/packageDomain/pages/resourceDetails/myVideo/index.js @@ -58,7 +58,6 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - wx.setNavigationBarTitle({ title: '璧勬簮璇︽儏-瑙嗛' }); @@ -186,7 +185,6 @@ showDialog(e) { this.setData({ - dialogKey: true, textvalue: '', submitTitle: this.data.titleName @@ -239,9 +237,10 @@ this.data.threeLeveData.forEach((items, index) => { // 淇敼姝ゅ娣诲姞index鍙傛暟 if (this.data.productLinkPath == items.productLinkPath) { if (this.data.formPath === "jsek_cloudLearning") { - console.log(items); + let file + items.protectedFile ? file = items.protectedFile : file = items.freeFile this.setData({ - showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + items.protectedFile + '&token=' + wx.getStorageSync(app.config.tokenKey), + showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey), titleName: items.name }) } else { @@ -250,7 +249,6 @@ titleName: items.name }) } - console.log(index, 'index'); let selectedIndex = index; // 瀛樺偍閫変腑椤圭殑绱㈠紩 this.setData({ selectedId: selectedIndex // 璁剧疆閫変腑椤圭殑绱㈠紩 @@ -259,49 +257,33 @@ }); } }) - this.data.threeLeveData.forEach((item) => { - console.log(item.name); - }) this.setData({ loading: false, hidden: false }) + console.log('鍦板潃', this.data.showData); }) }, onVideo(e) { - if (this.data.showData != '') { - this.setData({ - showData: '' - }) - } - - this.setData({ - selectedId: e.currentTarget.dataset.index, - }) const item = e.currentTarget.dataset.item this.setData({ + selectedId: e.currentTarget.dataset.index, + showData: '', titleName: item.name }) - if (item.selectType == "video" || item.learnSelectType === "video") { - - // if (!item.file) { - // console.log(1111); - // } - if (this.data.formPath === "jsek_cloudLearning") { - + let file + item.protectedFile ? file = item.protectedFile : file = item.freeFile this.setData({ - showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + item.protectedFile + '&token=' + wx.getStorageSync(app.config.tokenKey) + showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey) }) + console.log(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, }) } - - console.log(this.data.showData, 'item.file'); - } }, @@ -310,15 +292,11 @@ productId: this.data.bookId, appRefCode: app.config.appRefCode }).then((res) => { - console.log(res); - this.setData({ topicId: res.id }) }) }, - - newTopicMessageGet() { let query = { @@ -336,7 +314,6 @@ // 鏍囬鏀瑰彉 changeTitle(e) { - console.log(e.currentTarget.dataset.value); this.setData({ flag: e.currentTarget.dataset.value }) @@ -427,7 +404,6 @@ noteList: res.datas, loading: false }) - console.log('绗旇鍒楄〃', res.datas); }) }, // 缂栬緫鎸夐挳 @@ -440,7 +416,6 @@ noteId: note.id, dialogKey: true, }) - // this.showDialog() }, // 鍒犻櫎绗旇 diff --git a/packageDomain/pages/resourceDetails/myVideo/index.wxml b/packageDomain/pages/resourceDetails/myVideo/index.wxml index 12c366f..6216b31 100644 --- a/packageDomain/pages/resourceDetails/myVideo/index.wxml +++ b/packageDomain/pages/resourceDetails/myVideo/index.wxml @@ -14,47 +14,68 @@ <!-- autoplay='false' 鏄惁鑷姩鎾斁 --> <!-- <video binderror="videoErrorCallback" src="{{showData}}" play-btn-position='center' object-fit='fill' controls enable-play-gesture enable-auto-rotation></video> --> <video src="{{showData}}"></video> - </view> <view wx:if="{{!videoChange}}" class="videoSubsidiaryBox"> - <view class="videoNoData">鏆傛棤鏁版嵁</view> - </view> <!-- 鏍囬 --> <view class="titleBox">{{titleName}}</view> <view class="contentBox"> - <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel" split="{{false}}"> + <t-tabs + defaultValue="{{0}}" + bind:change="onTabsChange" + bind:click="onTabsClick" + t-class="custom-tabs" + t-class-content="custom-panel" + split="{{false}}" + > <!-- 璧勬簮鍒楄〃 --> - <t-tab-panel label="璧勬簮鍒楄〃" value="0" style="{{tabPanelstyle}}" style="width: 750rpx;"> + <t-tab-panel + label="璧勬簮鍒楄〃" + value="0" + style="{{tabPanelstyle}}" + style="width: 750rpx" + > <view class="wrapper"> - - <view class="outsideDetailsName"> <view class="titleBox">{{parentName}}</view> - <view class="detailsName" wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}"> - <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}">{{item.name}}</view> + <view + class="detailsName" + wx:for="{{threeLeveData}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + bind:tap="onVideo" + data-item="{{item}}" + data-index="{{index}}" + > + <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}" + >{{item.name}}</view + > </view> </view> - </view> </t-tab-panel> <!-- 绗旇灞曠ず --> <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}}"> + <t-collapse-panel + value="{{item.id}}" + expandIcon + wx:for="{{noteList}}" + wx:key="id" + > <view slot="header" class="collapse-header"> - <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> + <t-image + class="note-icon" + src="/static/images/bookService/detail/note-icon.png" + ></t-image> <view class="header-name">{{item.name}}</view> </view> <view> @@ -62,9 +83,19 @@ <view class="note-bottom"> <view class="note-time">{{item.createDate}}</view> <view class="bottom-btn"> - <t-image src="/static/images/bookService/detail/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}"></t-image> + <t-image + src="/static/images/bookService/detail/compliceHover.png" + class="complice" + bind:tap="editNote" + data-note="{{item}}" + ></t-image> <view></view> - <t-image src="/static/images/bookService/detail/deleteHover.png" class="delete" bind:tap="deleteNote" data-id="{{item.id}}"></t-image> + <t-image + src="/static/images/bookService/detail/deleteHover.png" + class="delete" + bind:tap="deleteNote" + data-id="{{item.id}}" + ></t-image> </view> </view> </view> @@ -77,35 +108,73 @@ <!-- 璁扮瑪璁� --> <view class="takeNotes" data-key="showCloseBtn" bind:tap="showDialog"> <view class="takeNotesLining"> - <image src="/static/images/resourceDetails/jibiji锛廼con@2x.png" mode="" /> 璁扮瑪璁� + <image + src="/static/images/resourceDetails/jibiji锛廼con@2x.png" + mode="" + /> + 璁扮瑪璁� </view> </view> <view class="buttonBox"></view> </view> - <!-- 璁扮瑪璁板脊绐� --> - <t-popup visible="{{dialogKey}}" bind:visible-change="onVisibleChange" placement="center"> + <t-popup + visible="{{dialogKey}}" + bind:visible-change="onVisibleChange" + placement="center" + > <view class="popup"> <view slot="title"> <view class="title-text" wx:if="{{!flag}}"> <text class="note-title">{{submitTitle}}</text> - <t-image src="/static/images/bookService/detail/edit.png" class="edit-icon" bind:tap="changeTitle" data-value="{{true}}"></t-image> + <t-image + src="/static/images/bookService/detail/edit.png" + class="edit-icon" + bind:tap="changeTitle" + data-value="{{true}}" + ></t-image> </view> <view wx:else> - <t-input value="{{submitTitle}}" style="{{inputStyle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" maxlength="{{50}}" bind:change="inputChange"></t-input> + <t-input + value="{{submitTitle}}" + style="{{inputStyle}}" + data-value="{{false}}" + bind:enter="changeTitle" + bind:blur="changeTitle" + maxlength="{{50}}" + bind:change="inputChange" + ></t-input> </view> </view> - <view slot='content'> + <view slot="content"> <view class="textarea-example"> <text class="textarea-example__label">鍐呭:</text> - <t-textarea value="{{textvalue}}" t-class="external-class" placeholder="璇疯緭鍏ユ枃瀛�" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{inputStyle}}" bind:change="textareaChange" /> + <t-textarea + value="{{textvalue}}" + t-class="external-class" + placeholder="璇疯緭鍏ユ枃瀛�" + bordered + maxlength="500" + disableDefaultPadding="{{true}}" + indicator + style="{{inputStyle}}" + bind:change="textareaChange" + /> </view> <view class="submit-btn"> - <t-button theme="primary" size="large" block bind:tap="confirmSuggest">鎻愪氦</t-button> + <t-button theme="primary" size="large" block bind:tap="confirmSuggest" + >鎻愪氦</t-button + > </view> </view> </view> - <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> + <t-icon + t-class="close-btn" + name="close-circle" + size="32" + color="#fff" + bind:tap="closeDialog" + /> </t-popup> -</view> \ No newline at end of file +</view> diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js index 2eafd72..afec91a 100644 --- a/packageDomain/pages/sampleBookList/index.js +++ b/packageDomain/pages/sampleBookList/index.js @@ -563,6 +563,7 @@ }, onResetSecond() { this.setData({ + pathList: [], 'secondList.value': [], }); this.getBookList(false); diff --git a/packageDomain/pages/sampleBookList/index.wxml b/packageDomain/pages/sampleBookList/index.wxml index 9331917..371d69b 100644 --- a/packageDomain/pages/sampleBookList/index.wxml +++ b/packageDomain/pages/sampleBookList/index.wxml @@ -25,7 +25,6 @@ </view> <view class="list-header"> <view class="header-scroll"> - <!-- <scroll-view scroll-x scroll-with-animation='true' class="srcolbox"> --> <view class="srcolbox"> <t-dropdown-menu> <t-dropdown-item @@ -58,7 +57,6 @@ /> </t-dropdown-menu> </view> - <!-- </scroll-view> --> </view> <!-- <view class=" header-sort" bind:tap="sortClick"> <view class="sort-name">鎺掑簭</view> @@ -79,7 +77,7 @@ scroll-y refresher-enabled="{{true}}" lower-threshold="{{200}}" - refresher-threshold="{{80}}" + refresher-threshold="{{180}}" refresher-default-style="none" refresher-triggered="{{triggered}}" bindrefresherpulling="{{refresh.onPulling}}" diff --git a/packagePersonal/pages/aboutUs/index.js b/packagePersonal/pages/aboutUs/index.js index b0dd42c..9b0f351 100644 --- a/packagePersonal/pages/aboutUs/index.js +++ b/packagePersonal/pages/aboutUs/index.js @@ -128,6 +128,7 @@ }).then(res => { // console.log(res.datas[0].content); let modifiedContent = `<div class="richTextBox">${res.datas[0].content}</div>`; + // modifiedContent = modifiedContent.replace(/\<table/gi, '<table class="aboutUs-rich-table"').replace(/\<td/gi, '<table class="aboutUs-rich-td"').replace(/\<p/gi, '<p class="aboutUs-rich-p"') console.log(modifiedContent); this.setData({ aboutText: modifiedContent, diff --git a/packagePersonal/pages/myCollection/index.js b/packagePersonal/pages/myCollection/index.js index 57f3507..3c4adf6 100644 --- a/packagePersonal/pages/myCollection/index.js +++ b/packagePersonal/pages/myCollection/index.js @@ -35,10 +35,11 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - console.log(options); + // this.getDataList(false); + }, + onShow() { this.getDataList(false); }, - /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js index f7bba40..b2588bb 100644 --- a/pages/bibliographyList/index.js +++ b/pages/bibliographyList/index.js @@ -39,14 +39,9 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - - - - this.higherGet() this.vocationalGet() this.teacherGet() - const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� @@ -112,9 +107,7 @@ }, onTabsChange(event) { - const value = event.detail.value - if (value === '0') { console.log(value); this.setData({ @@ -135,8 +128,6 @@ }) } }, - - //楂樼瓑鏁欒偛 higherGet(keyword) { // console.log(keyword, 'keyword'); @@ -144,9 +135,7 @@ 'Name*': keyword, '||author*': keyword, '||isbn*': keyword - } - app.MG.resource.getItem({ path: 'jsek_biblioClassification\\jsek_bCHigherEducation', queryType: '*', @@ -172,20 +161,16 @@ res.datas.forEach(item => { item.determine = true }) - // console.log(res, 789111); this.setData({ higherList: res.datas, higherTotal: res.total }) - // console.log(this.data.higherList, '5555'); this.setData({ loading: false, //寮�鍚鏋跺睆鍔犺浇 hidden: false, //鏄惁灞曠ず鍐呭 }) }) wx.stopPullDownRefresh() - - }, //鏁欏笀鏁欒偛 @@ -194,7 +179,6 @@ 'Name*': keyword, '||author*': keyword, '||isbn*': keyword - } app.MG.resource.getItem({ path: 'jsek_biblioClassification\\jsek_bCVocationalEducation', @@ -225,7 +209,6 @@ vocationalList: res.datas, vocationalTotal: res.total }) - }) wx.stopPullDownRefresh() }, @@ -235,7 +218,6 @@ 'Name*': keyword, '||author*': keyword, '||isbn*': keyword - } app.MG.resource.getItem({ path: 'jsek_biblioClassification\\jsek_bCTeacherEducation', @@ -310,11 +292,8 @@ // }, 2000); // }, downloadData(event) { - const item = event.currentTarget.dataset.item - console.log(item); if (item.fileType == "pdf") { - wx.navigateTo({ url: "/packageBookService/pages/components/webView/index?md5=" + item.freeFile + @@ -337,11 +316,7 @@ theme: 'warning', direction: 'column', }); - console.log(456); } - - - }, onSearchSubmit: function (e) { const keyword = e.detail.value; @@ -351,14 +326,11 @@ this.vocationalGet(keyword) this.teacherGet(keyword) }, - - 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, @@ -374,11 +346,8 @@ isMore: false }) }, 100) - } - } else if (this.data.tabValue == 2) { - if (this.data.teacherList.length < this.data.teacherTotal) { this.setData({ isMore: true, @@ -394,11 +363,8 @@ isMore: false }) }, 100) - } - } else if (this.data.tabValue == 1) { - console.log(this.data.vocationalList.length); console.log(this.data.vocationalTotal); if (this.data.vocationalList.length < this.data.vocationalTotal) { @@ -416,13 +382,8 @@ isMore: false }) }, 100) - } - console.log(2); } - - - }, onPullDownRefresh() { @@ -438,96 +399,45 @@ mailbox(e) { const key = e.currentTarget.dataset.key; const item = e.currentTarget.dataset.item; - - - this.setData({ - // [key]: true, - // dialogKey: key, - hiddenmodalput: true, - input: '', Md5: item.datas.freeFile.FileList[0].Md5 - - }); - - - - }, - - onEmailInput(e) { - const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(e.detail.value); - this.setData({ - emailError: !isEmailValid, - "input": e.detail.value, - }); - }, - //寮圭獥纭 - onConfirm() { - if (!this.data.emailError && this.data.input) { - const { - dialogKey - } = this.data; - this.setData({ - [dialogKey]: false - }); - - - console.log(this.data.input); - console.log(this.data.Md5); - if (this.data.input) { - let query = { - eMail: this.data.input, - md5s: [this.data.Md5] + }) + wx.showModal({ + title: '璇疯緭鍏ラ偖绠�', + content: '', + confirmColor: '#ff6c00', + cancelColor: '#949494', + placeholderText: '璇疯緭鍏ラ偖绠卞彿', + editable: true, + complete: (res) => { + if (res.cancel) { + console.log('鍙栨秷'); } - app.MG.file.sendFileWithEmail(query).then(res => { - console.log(res); - }) + if (res.confirm) { + this.setData({ + input: res.content + }) + this.confirmM() + } } - } else { - // 鏍¢獙涓嶉�氳繃锛岀粰鍑洪敊璇彁绀� - wx.showToast({ - title: '閭鏍煎紡涓嶆纭�', - icon: 'none', - }); - } - - }, - // 寮圭獥鍙栨秷 - closeDialog() { - const { - dialogKey - } = this.data; - this.setData({ - [dialogKey]: false - }); - console.log(111); - }, - //鍙栨秷寮规 - cancelM: function (e) { - this.setData({ - hiddenmodalput: false, }) }, //鎻愪氦 - confirmM: function (e) { - console.log("濮撳悕锛�" + this.data.name + " 鐢佃瘽锛�" + this.data.phoneNum); - if (!this.data.emailError && this.data.name) { - - - - - if (this.data.name) { - let query = { - eMail: this.data.name, - md5s: [this.data.Md5] - } - app.MG.file.sendFileWithEmail(query).then(res => { - console.log(res); - this.setData({ - hiddenmodalput: false, - }) - }) + confirmM(e) { + const isEmailValid = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(this.data.input); + if (isEmailValid && this.data.input) { + let query = { + eMail: this.data.input, + md5s: [this.data.Md5] } + app.MG.file.sendFileWithEmail(query).then(res => { + if (res) { + wx.showToast({ + icon: 'success', + title: '閭欢宸插彂閫�', + }) + } + }) } else { // 鏍¢獙涓嶉�氳繃锛岀粰鍑洪敊璇彁绀� wx.showToast({ @@ -535,20 +445,5 @@ icon: 'none', }); } - }, - - iName: function (e) { - this.setData({ - name: e.detail.value - }) - // console.log(this.data.name); - }, - iPhoneNum: function (e) { - this.setData({ - phoneNum: e.detail.value - }) - }, - - }) \ No newline at end of file diff --git a/pages/bibliographyList/index.json b/pages/bibliographyList/index.json index cd98246..23c79f4 100644 --- a/pages/bibliographyList/index.json +++ b/pages/bibliographyList/index.json @@ -1,5 +1,4 @@ { - "component": true, "usingComponents": { "t-tabs": "tdesign-miniprogram/tabs/tabs", "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", @@ -14,7 +13,5 @@ "t-toast": "tdesign-miniprogram/toast/toast" }, "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 996fbdd..4b6846e 100644 --- a/pages/bibliographyList/index.wxml +++ b/pages/bibliographyList/index.wxml @@ -1,141 +1,270 @@ <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> - -<view hidden="{{hidden}}"> - - - <view class="bibliographyList"> - <view class="titlesBox"> - <!--pages/bibliographyList/index.wxml--> - <view wx:if="{{downloadLoadin}}" class="loadinBox"> - <t-loading class="colors" theme="circular" size="70rpx" class="wrapper" /> +<view wx:if="{{!loading}}"> + <view wx:if="{{downloadLoadin}}" class="loadinBox"> + <t-loading class="colors" theme="circular" size="70rpx" class="wrapper" /> + </view> + <view class="titleBox"> + <view + style="width: 100%; height: {{barHeight}}px; background-color: #fff;" + ></view> + <view + class="nacigationBar" + style="width: 100%; height: {{navBarHeight}}px;" + > + <view> + <t-icon + name="chevron-left" + size="30" + data-name="{{item}}" + bind:click="goBack" + /> </view> - <view class="bibliographyListBox"></view> - <view class="titleBox"> - <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"> - </t-search> - <!-- <t-icon slot="left-icon" prefix="wr" name="search" size="40rpx" color="#bbb" /> --> - </view> - </view> + <view class="example-search"> + <t-search + model:value="{{value}}" + placeholder="璇疯緭鍏ヤ功鐩悕绉�" + bind:submit="onSearchSubmit" + > + </t-search> </view> </view> - <t-tabs class="contentBox" defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> + </view> + <view class="page-content"> + <t-tabs + class="contentBox" + defaultValue="{{0}}" + bind:change="onTabsChange" + bind:click="onTabsClick" + t-class="custom-tabs" + t-class-content="custom-panel" + > <t-tab-panel label="楂樼瓑鏁欒偛({{higherTotal}})" value="0"> - - - <view wx:if="{{higherList.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <view wx:else class="outsideHigherBox"> - - <view class="higherBox" wx:for="{{higherList}}" wx:key="index" wx:for-item="item" wx:for-index="index"> - <view class="outsideHigherImageBox"> - <view class="higherImageBox"> - <image wx:if="{{item.icon}}" data-item="{{item}}" bind:tap="downloadData" src="{{item.icon}}" mode="aspectFill" /> - <image wx:if="{{!item.icon}}" src="/static/images/default-book-img.png" mode="aspectFill" data-item="{{item}}" bind:tap="downloadData" /> - <view class="downloadIcon" data-item="{{item}}" data-key="showWithInput" bind:tap="mailbox"> - <image wx:if="{{determine}}" class="download" src="/static/images/bibliographyList/email-click.png" mode="aspectFit" /> - <image wx:else="" class="downloadshiftin" src="/static/images/bibliographyList/email.png" mode="aspectFit" /> + <scroll-view + scroll-y="{{true}}" + wx:else + class="scroll-box" + refresher-enabled="{{true}}" + lower-threshold="{{200}}" + refresher-threshold="{{80}}" + refresher-default-style="none" + refresher-triggered="{{triggered}}" + bindscrolltolower="onReachBottom" + > + <view class="outsideHigherBox"> + <view + class="higherBox" + wx:for="{{higherList}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + > + <view class="outsideHigherImageBox"> + <view class="higherImageBox"> + <image + wx:if="{{item.icon}}" + data-item="{{item}}" + bind:tap="downloadData" + src="{{item.icon}}" + mode="aspectFill" + /> + <image + wx:if="{{!item.icon}}" + src="/static/images/default-book-img.png" + mode="aspectFill" + data-item="{{item}}" + bind:tap="downloadData" + /> + <view + class="downloadIcon" + data-item="{{item}}" + data-key="showWithInput" + bind:tap="mailbox" + > + <image + wx:if="{{determine}}" + class="download" + src="/static/images/bibliographyList/email-click.png" + mode="aspectFit" + /> + <image + wx:else="" + class="downloadshiftin" + src="/static/images/bibliographyList/email.png" + mode="aspectFit" + /> + </view> </view> </view> + <view class="higherTextBox">{{item.name}}</view> </view> - <view class="higherTextBox">{{item.name}}</view> </view> - </view> - <view wx:if="{{higherList.length > 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> - <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> - </view> - - - - - + <view wx:if="{{higherList.length > 0}}" class="bottom-box"> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> + </scroll-view> </t-tab-panel> <t-tab-panel label="鑱屼笟鏁欒偛({{vocationalTotal}})" value="1"> <view wx:if="{{vocationalList.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - - - - <view wx:else class="outsideHigherBox"> - <view class="higherBox" wx:for="{{vocationalList}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}"> - <view class="outsideHigherImageBox"> - <view class="higherImageBox"> - <image wx:if="{{item.icon}}" data-item="{{item}}" bind:tap="downloadData" src="{{item.icon}}" mode="aspectFill" /> - <image wx:if="{{!item.icon}}" src="/static/images/default-book-img.png" mode="aspectFill" data-item="{{item}}" bind:tap="downloadData" /> - <view class="downloadIcon" data-item="{{item}}" data-key="showWithInput" bind:tap="mailbox"> - <image wx:if="{{determine}}" class="download" src="/static/images/bibliographyList/email-click.png" mode="aspectFit" /> - <image wx:else="" class="downloadshiftin" src="/static/images/bibliographyList/email.png" mode="aspectFit" /> + <scroll-view + scroll-y="{{true}}" + wx:else + class="scroll-box" + refresher-enabled="{{true}}" + lower-threshold="{{200}}" + refresher-threshold="{{80}}" + refresher-default-style="none" + refresher-triggered="{{triggered}}" + bindscrolltolower="onReachBottom" + > + <view class="outsideHigherBox"> + <view + class="higherBox" + wx:for="{{vocationalList}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + data-item="{{item}}" + > + <view class="outsideHigherImageBox"> + <view class="higherImageBox"> + <image + wx:if="{{item.icon}}" + data-item="{{item}}" + bind:tap="downloadData" + src="{{item.icon}}" + mode="aspectFill" + /> + <image + wx:if="{{!item.icon}}" + src="/static/images/default-book-img.png" + mode="aspectFill" + data-item="{{item}}" + bind:tap="downloadData" + /> + <view + class="downloadIcon" + data-item="{{item}}" + data-key="showWithInput" + bind:tap="mailbox" + > + <image + wx:if="{{determine}}" + class="download" + src="/static/images/bibliographyList/email-click.png" + mode="aspectFit" + /> + <image + wx:else="" + class="downloadshiftin" + src="/static/images/bibliographyList/email.png" + mode="aspectFit" + /> + </view> </view> </view> + <view class="higherTextBox">{{item.name}}</view> </view> - <view class="higherTextBox">{{item.name}}</view> </view> - - </view> - - <view wx:if="{{vocationalList.length > 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> - <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> - </view> + <view wx:if="{{vocationalList.length > 0}}" class="bottom-box"> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> + </scroll-view> </t-tab-panel> <t-tab-panel label="鏁欏笀鏁欒偛({{teacherTotal}})" value="2"> - <view wx:if="{{teacherList.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <view wx:else class="outsideHigherBox"> - <view class="higherBox" wx:for="{{teacherList}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}"> - <view class="outsideHigherImageBox"> - <view class="higherImageBox"> - <image wx:if="{{item.icon}}" data-item="{{item}}" bind:tap="downloadData" src="{{item.icon}}" mode="aspectFill" /> - <image wx:if="{{!item.icon}}" src="/static/images/default-book-img.png" mode="aspectFill" data-item="{{item}}" bind:tap="downloadData" /> - <view class="downloadIcon" data-item="{{item}}" data-key="showWithInput" bind:tap="mailbox"> - <image wx:if="{{determine}}" class="download" src="/static/images/bibliographyList/email-click.png" mode="aspectFit" /> - <image wx:else="" class="downloadshiftin" src="/static/images/bibliographyList/email.png" mode="aspectFit" /> + <scroll-view + scroll-y="{{true}}" + wx:else + class="scroll-box" + refresher-enabled="{{true}}" + lower-threshold="{{200}}" + refresher-threshold="{{80}}" + refresher-default-style="none" + refresher-triggered="{{triggered}}" + bindscrolltolower="onReachBottom" + > + <view class="outsideHigherBox"> + <view + class="higherBox" + wx:for="{{teacherList}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + data-item="{{item}}" + > + <view class="outsideHigherImageBox"> + <view class="higherImageBox"> + <image + wx:if="{{item.icon}}" + data-item="{{item}}" + bind:tap="downloadData" + src="{{item.icon}}" + mode="aspectFill" + /> + <image + wx:if="{{!item.icon}}" + src="/static/images/default-book-img.png" + mode="aspectFill" + data-item="{{item}}" + bind:tap="downloadData" + /> + <view + class="downloadIcon" + data-item="{{item}}" + data-key="showWithInput" + bind:tap="mailbox" + > + <image + wx:if="{{determine}}" + class="download" + src="/static/images/bibliographyList/email-click.png" + mode="aspectFit" + /> + <image + wx:else="" + class="downloadshiftin" + src="/static/images/bibliographyList/email.png" + mode="aspectFit" + /> + </view> </view> </view> + <view class="higherTextBox">{{item.name}}</view> </view> - <view class="higherTextBox">{{item.name}}</view> </view> - - </view> - - <view wx:if="{{teacherList.length > 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> - <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> - </view> + <view wx:if="{{teacherList.length > 0}}" class="bottom-box"> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> + <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> + </view> + </scroll-view> </t-tab-panel> </t-tabs> </view> - <view class="dialogBox"> - <t-dialog visible="{{showWithInput}}" title="璇疯緭鍏ラ偖绠�" confirm-btn="纭畾" cancel-btn="鍙栨秷" bind:confirm="onConfirm" bind:cancel="closeDialog"> - - <t-input model:value="{{input}}" borderless class="dialog-input" clearable slot="content" placeholder="璇疯緭鍏ラ偖绠卞彿" placeholder-class="placeholder" bindchange="onEmailInput" /> - - </t-dialog> - </view> - </view> - - -<modal hidden="{{!hiddenmodalput}}" title="璇疯緭鍏ラ偖绠�" confirm-text="纭畾" cancel-text="鍙栨秷" bindcancel="cancelM" bindconfirm="confirmM" style="height: 300rpx !important;"> - <view style="height: 50rpx;"></view> - <input bindinput='iName' type='text' placeholder="璇疯緭鍏ラ偖绠卞彿" auto-focus /> - <view style="height: 50rpx;"></view> -</modal> - - - - -<t-toast id="t-toast" /> \ No newline at end of file +<t-toast id="t-toast" /> diff --git a/pages/bibliographyList/index.wxss b/pages/bibliographyList/index.wxss index 4a44bad..2a96954 100644 --- a/pages/bibliographyList/index.wxss +++ b/pages/bibliographyList/index.wxss @@ -1,11 +1,3 @@ -/* pages/bibliographyList/index.wxss */ -/* .custom-tabs { - margin-bottom: 32rpx; -} - -.custom-panel { - height: 120px; -} */ @import "./index.skeleton.wxss"; .nacigationBar { @@ -52,7 +44,7 @@ } .higherTextBox { - height: 50rpx; + height: 55rpx; font-weight: bold; font-size: 25rpx; color: #333333; @@ -65,8 +57,6 @@ text-overflow: ellipsis; } - -.outsideHigherImageBox {} .downloadIcon { width: 34rpx; @@ -85,13 +75,9 @@ } - - - .example-search { background-color: #fff; } - .search_icones { position: absolute; @@ -166,10 +152,6 @@ width: 100%; z-index: 999; height: 200rpx; -} - -.contentBox { - margin-top: 180rpx; } .noDataBox { @@ -252,4 +234,14 @@ .scrollViewBox { height: calc(100vh - 326rpx); /* width: calc(100vw - 60rpx); */ +} + +.page-content { + height: calc(100vh - 176rpx); + background-color: #fff; +} + +.scroll-box { + height: calc(100vh - 264rpx - env(safe-area-inset-bottom)); + padding-bottom: env(safe-area-inset-bottom); } \ No newline at end of file diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js index 1b4cf32..91877cb 100644 --- a/pages/bookExhibitionList/index.js +++ b/pages/bookExhibitionList/index.js @@ -1,53 +1,52 @@ // pages/bookExhibitionList/index.js -import Toast from 'tdesign-miniprogram/toast/index'; -import watch from './watch/watch' -const app = getApp() +import Toast from "tdesign-miniprogram/toast/index"; +import watch from "./watch/watch"; +const app = getApp(); Page({ - /** * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { name: "娴嬭瘯watch", - newPrice: '', + newPrice: "", loading: true, hidden: true, - totalSize: '', + totalSize: "", start: 0, isMore: null, keynoteDisabled: true, - value: '', - keyword: '', + value: "", + keyword: "", nameSort: null, total: null, page: { start: 0, - size: 16 + size: 16, }, keynoteValue: null, filteredItems: [], newValue: null, bookExhibitionList: [], sorter: { - value: 'default', + value: "default", }, product: { - value: '*', + value: "*", options: [{ - value: '*', - label: '鎬诲垎绫�', + value: "*", + label: "鎬诲垎绫�", }, { - value: 'jsek_bFHigherEducation', - label: '楂樼瓑鏁欒偛', + value: "jsek_bFHigherEducation", + label: "楂樼瓑鏁欒偛", }, { - value: 'jsek_bFVocationalEducation', - label: '鑱屼笟鏁欒偛', + value: "jsek_bFVocationalEducation", + label: "鑱屼笟鏁欒偛", }, { - value: 'jsek_bFTeacherEducation', - label: '鏁欏笀鏁欒偛', + value: "jsek_bFTeacherEducation", + label: "鏁欏笀鏁欒偛", }, ], }, @@ -55,323 +54,255 @@ value: [], options: [], }, - navBarHeight: '', - barHeight: '', - windowHeight: '', + navBarHeight: "", + barHeight: "", + windowHeight: "", sorter: { - value: 'timeAsc', + value: "timeAsc", options: [{ - value: 'nameAsc', - label: '鍚嶇О姝e簭', + value: "nameAsc", + label: "鍚嶇О姝e簭", }, { - value: 'nameDesc', - label: '鍚嶇О鍊掑簭', + value: "nameDesc", + label: "鍚嶇О鍊掑簭", }, { - value: 'timeAsc', - label: '鍑虹増鏃堕棿姝e簭', + value: "timeAsc", + label: "鍑虹増鏃堕棿姝e簭", }, { - value: 'timeDesc', - label: '鍑虹増鏃堕棿鍊掑簭', + value: "timeDesc", + label: "鍑虹増鏃堕棿鍊掑簭", }, ], }, - newValue: '' + newValue: "", + disbaleProject: true, + disabledSort: false }, - - /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - // this.setData({ // 'product.value': '*', // }); const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 - const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� + const navBarHeight = + (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� this.setData({ navBarHeight: navBarHeight, barHeight: systInfo.statusBarHeight, - }) - - - // watch.setWatcher(this); - // let that = this; - // setTimeout(function () { - // that.data.name = "娴嬭瘯watch鍙樺寲浜�" - // }, 500) - console.log(11111); - }, - watch: { - name: function (newVal, oldVal) { - //杩欓噷鐨則his鍜宱nLoad閲岀殑this鎸囧悜涓�鏍� - console.log(newVal, oldVal); - }, - newPrice: function (newVal, oldVal) { - console.log(newVal, oldVal); - } + }); }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ - onReady() { - - }, + onReady() {}, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ onShow() { - this.bookExhibitionGet() - this.keyProjectsGet(this.data.newPrice) + this.bookExhibitionGet(); + this.keyProjectsGet(this.data.newPrice); }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 */ - onHide() { - - }, + onHide() {}, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 */ - onUnload() { - - - - }, + onUnload() {}, /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ - onPullDownRefresh() { - - }, - // onPullDownRefresh() { - // this.data.page.size = 16 //鏇存敼鏄剧ず鐨勫�� - // this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁 - // }, - + onPullDownRefresh() {}, onScrollToLower() { - if (this.data.bookExhibitionList.length < this.data.totalSize) { this.setData({ isMore: true, - start: this.data.start + 1 - }) - this.bookExhibitionGet() + start: this.data.start + 1, + }); + this.bookExhibitionGet(); } else { this.setData({ isMore: true, - }) + }); setTimeout(() => { this.setData({ - isMore: false - }) - - }, 300) + isMore: false, + }); + }, 300); } }, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ onReachBottom() { - if (this.data.page.size >= this.data.total) { Toast({ context: this, - selector: '#t-toast', - message: '娌℃湁鏇村浜�', - direction: 'column', + selector: "#t-toast", + message: "娌℃湁鏇村浜�", + direction: "column", duration: 1000, preventScrollThrough: true, - icon: 'poweroff', + icon: "poweroff", }); } else { // const currentPage = this.data.page.start + 1; // 鑾峰彇褰撳墠椤垫暟骞跺姞1 const newSize = this.data.page.size + 10; // 鍘熸潵鐨勫熀纭�涓婂姞10 this.setData({ // 'page.start': currentPage, - 'page.size': newSize + "page.size": newSize, }); // this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁 } }, - - /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() { - - }, + onShareAppMessage() {}, // 鍥剧墖鏁版嵁鐨勬帴鍙� bookExhibitionGet(newValue) { - wx.showLoading({ - title: '鍔犺浇涓�...', + this.setData({ + disabledSort: false }) let searchObj = { - 'Name*': this.data.keyword, - '||subtitle*': this.data.keyword - } - - let sort = {}; - - const sortOptions = { - '*': { - CreateDate: 'Asc' - }, - 'nameAsc': { - Name: 'Asc' - }, - 'nameDesc': { - Name: 'Desc' - }, - 'timeAsc': { - CreateDate: 'Asc' - }, - 'timeDesc': { - CreateDate: 'Desc' - } + "Name*": this.data.keyword, + "||subtitle*": this.data.keyword, }; + let sort = {}; + const sortOptions = { + "*": { + CreateDate: "Asc", + }, + nameAsc: { + Name: "Asc", + }, + nameDesc: { + Name: "Desc", + }, + timeAsc: { + CreateDate: "Asc", + }, + timeDesc: { + CreateDate: "Desc", + }, + }; sort = sortOptions[this.data.product.value] || {}; - - - - app.MG.store.getProductList({ - storeInfo: 'jsek_bookFair', - path: this.data.newValue, - queryType: '*', - fields: { - jsek_link: [], - subtitle: [], - 'bookClassification*': this.data.keynoteValue || [], - ...searchObj - }, - paging: { - start: '0', - size: this.data.start * 10 - }, - sort: sort, - // coverSize: { - // width: 100 - // }, - }).then(res => { - res.datas.forEach((item) => { - if (item.subtitle == undefined) { - item.subtitle = '' + app.MG.store + .getProductList({ + storeInfo: "jsek_bookFair", + path: this.data.newValue, + queryType: "*", + fields: { + jsek_link: [], + subtitle: [], + "bookClassification*": this.data.keynoteValue || [], + ...searchObj, + }, + paging: { + start: "0", + size: this.data.start * 10, + }, + sort: sort, + // coverSize: { + // width: 100 + // }, + }) + .then((res) => { + res.datas.forEach((item) => { + if (item.subtitle == undefined) { + item.subtitle = ""; + } + item.subtitleName = item.subtitle + item.name; + }); + this.data.total = res.total; + if (res.datas.length == 0) { + this.setData({ + disabledSort: true + }) + if (!this.data.keynoteValue.length) { + this.setData({ + disbaleProject: true + }); + } } - item.subtitleName = item.subtitle + item.name - }) - - this.data.total = res.total - - // list.push(res.datas) - - - - if (res.datas.length == 0) { + const list = [...res.datas]; this.setData({ - // keynoteDisabled: true - }) - } - - const list = [...res.datas] - - this.setData({ - bookExhibitionList: list, - totalSize: res.total - }) - - - - //鍙栨秷 - wx.hideLoading() - - - this.setData({ - loading: false, - hidden: false, - }) - }) - + bookExhibitionList: list, + totalSize: res.total, + }); + this.setData({ + loading: false, + hidden: false, + }); + }); }, //閲嶇偣椤圭洰鎺ュ彛 keyProjectsGet(newPrice) { this.setData({ - filteredItems: [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁� + filteredItems: [], // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁� }); - //楠ㄦ灦灞� this.setData({ loading: true, hidden: true, - }) - + }); // 鍙傛暟 let parms = { - refCodes: ['bookClassification'] - } + refCodes: ["bookClassification"], + }; //璇锋眰鏁版嵁 - app.MG.store.getProductTypeField(parms).then(res => { - + app.MG.store.getProductTypeField(parms).then((res) => { // 鏍煎紡鍖栨暟鎹� - const checkData = JSON.parse(res[0].config) - console.log(checkData); - + const checkData = JSON.parse(res[0].config); // 寰幆鐒跺悗鍒ゆ柇鐩稿尮閰嶇殑鏁版嵁璧嬪�肩粰filteredItems - checkData.option.forEach(item => { + checkData.option.forEach((item) => { if (newPrice == item.value) { - - - this.setData({ - filteredItems: item.child || [] // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁� + filteredItems: item.child || [], // 濡傛灉瀛樺湪瀛愰」鍒欒祴鍊硷紝鍚﹀垯璧嬪�间负绌烘暟缁� }); } - }) - - let singleSelectOptions = [] - + }); + let singleSelectOptions = []; // 鍗曞垪閫夋嫨鍣ㄩ�夐」 // 鍗曞垪閫夋嫨鍣ㄩ�夐」 - this.data.filteredItems.forEach(item => { + this.data.filteredItems.forEach((item) => { singleSelectOptions.push({ label: item.name, value: item.value, }); }); - - - if (singleSelectOptions.length === 0) { singleSelectOptions.push({ - label: '鏆傛棤鏁版嵁', - + label: "鏆傛棤鏁版嵁", }); - + this.setData({ + disbaleProject: true + }) } - // 鏇存柊鏁版嵁 this.setData({ - 'multipleSelect.options': singleSelectOptions, + "multipleSelect.options": singleSelectOptions, }); - - // 鍙栨秷楠ㄦ灦灞� this.setData({ loading: false, hidden: false, - }) - }) + }); + }); // if (newPrice) { // this.setData({ // keynoteDisabled: false @@ -384,62 +315,46 @@ // } }, - - - // 鎬诲垎绫� // 鎬诲垎绫� onChange(e) { - - - const newValue = e.detail.value; - this.setData({ - 'product.value': newValue, - newValue: newValue + "product.value": newValue, + newValue: newValue, + disbaleProject: false, + loading: true }); - - let newPrice = '' - if (newValue == 'jsek_bFHigherEducation') { - newPrice = 'jsek_higherEducation' - // this.setData({ - // newPrice: 'jsek_higherEducation' - // }) - } else if (newValue == 'jsek_bFVocationalEducation') { - // this.setData({ - // newPrice: 'jsek_vocationalEducation' - // }) - newPrice = 'jsek_vocationalEducation' - } else if (newValue == 'jsek_bFTeacherEducation') { - // this.setData({ - // newPrice: 'jsek_teacherEducation' - // }) - newPrice = 'jsek_teacherEducation' + let newPrice = ""; + if (newValue == "jsek_bFHigherEducation") { + newPrice = "jsek_higherEducation"; + } else if (newValue == "jsek_bFVocationalEducation") { + newPrice = "jsek_vocationalEducation"; + } else if (newValue == "jsek_bFTeacherEducation") { + newPrice = "jsek_teacherEducation"; } else { - newPrice = '' + // 閫夋嫨鎬诲垎绫� + this.setData({ + disbaleProject: true + }) + newPrice = ""; } - - this.keyProjectsGet(newPrice) + this.keyProjectsGet(newPrice); this.bookExhibitionGet(newValue); if (this.data.keynoteValue) { //濡傛灉鏈夋暟鎹氨娓呯┖骞跺埛鏂伴〉闈� - this.data.keynoteValue = [] - this.bookExhibitionGet(newValue) + this.data.keynoteValue = []; + this.bookExhibitionGet(newValue); } - this.onLoad() - }, // 閲嶇偣椤圭洰 handleMultipleSelect(e) { - console.log(e); this.setData({ - 'multipleSelect.value': e.detail.value, + "multipleSelect.value": e.detail.value, }); }, handleConfirm(event) { - console.log(event); const { value } = event.detail; @@ -447,67 +362,66 @@ // this.data.keynoteValue = value this.setData({ keynoteValue: value, - - }) - this.bookExhibitionGet() + loading: true + }); + this.bookExhibitionGet(); }, - handleReset(e) { // 閲嶇疆鎿嶄綔鐨勫鐞嗛�昏緫 - this.data.keynoteValue = [] - this.bookExhibitionGet() + this.data.keynoteValue = []; + this.bookExhibitionGet(); }, onSwapRight() { if (!this.data.nameSort) { this.setData({ - nameSort: 'Desc', + nameSort: "Desc", }); - } else if (this.data.nameSort == 'Desc') { + } else if (this.data.nameSort == "Desc") { this.setData({ - nameSort: 'Asc', + nameSort: "Asc", }); - } else if (this.data.nameSort == 'Asc') { + } else if (this.data.nameSort == "Asc") { this.setData({ - nameSort: '', + nameSort: "", }); } - this.bookExhibitionGet() - + this.bookExhibitionGet(); }, onSwapLeft() { - this.data.nameSort = 'Desc' - this.bookExhibitionGet() + this.data.nameSort = "Desc"; + this.bookExhibitionGet(); }, onBookExhibitionDetails: function (event) { - const item = event.currentTarget.dataset.item; - wx.navigateTo({ - url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name + '&subtitleName=' + item.subtitleName // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟 + url: "/pages/bookExhibitionDetails/index?id=" + + item.id + + "&bookName=" + + item.name + + "&subtitleName=" + + item.subtitleName, // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟 }); }, // 鎼滅储妗� onSearchSubmit(e) { this.setData({ - keyword: e.detail.value - }) + keyword: e.detail.value, + }); - this.bookExhibitionGet() + this.bookExhibitionGet(); }, goBack() { wx.navigateBack(); }, onSort(e) { this.setData({ - 'product.value': e.detail.value, + "product.value": e.detail.value, }); - this.bookExhibitionGet() + this.bookExhibitionGet(); }, - onOpend() { - - } -}) \ No newline at end of file + onOpend() {}, +}); \ No newline at end of file diff --git a/pages/bookExhibitionList/index.wxml b/pages/bookExhibitionList/index.wxml index 901dcaa..e8b2167 100644 --- a/pages/bookExhibitionList/index.wxml +++ b/pages/bookExhibitionList/index.wxml @@ -2,44 +2,63 @@ <!-- 寮瑰嚭妗� 绂佹 --> - <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> -<view hidden="{{hidden}}"> - +<view wx:if="{{!loading}}"> <t-toast id="t-toast" /> - - <view class="outsideBigTitleBox"> <view class="bigTitleBox"> <view style="width: 100%; height: {{barHeight}}px; "></view> - <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> + <view + class="nacigationBar" + style="width: 70%; height: {{navBarHeight}}px;" + > <view> - <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> + <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" /> + <t-search + model:value="{{value}}" + placeholder="璇疯緭鍏ヤ功灞曞悕绉�" + bind:submit="onSearchSubmit" + /> </view> </view> </view> - <view class="outsideMenuBox"> <view class="menuBox"> - <t-dropdown-menu> - - - - - <t-dropdown-item options="{{product.options}}" default-value="{{product.value}}" bindchange="onChange" /> - + <t-dropdown-item + options="{{product.options}}" + default-value="{{product.value}}" + bindchange="onChange" + /> <!-- disabled="{{keynoteDisabled}}" --> - <t-dropdown-item label=" 閲嶇偣椤圭洰" options="{{multipleSelect.options}}" bindchange="handleMultipleSelect" multiple bind:confirm="handleConfirm" bind:reset="handleReset" value="{{multipleSelect.value}}"> + <t-dropdown-item + label=" 閲嶇偣椤圭洰" + disabled="{{disbaleProject}}" + options="{{multipleSelect.options}}" + bindchange="handleMultipleSelect" + multiple + bind:confirm="handleConfirm" + bind:reset="handleReset" + value="{{multipleSelect.value}}" + > </t-dropdown-item> - <t-dropdown-item options="{{sorter.options}}" default-value="{{sorter.value}}" bindchange="onSort" /> + <t-dropdown-item + disabled="{{disabledSort}}" + options="{{sorter.options}}" + default-value="{{sorter.value}}" + bindchange="onSort" + /> </t-dropdown-menu> </view> </view> @@ -48,39 +67,55 @@ <view class="titleBox"> <view class="frameBox"></view> <view class="titleTextBox"> - <image src="/static/images/bookExhibitionList/zhuantitaolun.png" mode="aspectFit" /> + <image + src="/static/images/bookExhibitionList/zhuantitaolun.png" + mode="aspectFit" + /> </view> </view> - <scroll-view scroll-y="{{true}}" class="scrollViewBox" bindscrolltolower="onScrollToLower"> + <scroll-view + scroll-y="{{true}}" + class="scrollViewBox" + bindscrolltolower="onScrollToLower" + > <view class="outside"> - - - - - - - <view wx:if="{{!bookExhibitionList.length }}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <view class="contentBox" wx:for="{{bookExhibitionList}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="onBookExhibitionDetails"> + <view + class="contentBox" + wx:for="{{bookExhibitionList}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + data-item="{{item}}" + bind:tap="onBookExhibitionDetails" + > <view class="imageBox"> <view></view> <image wx:if="{{item.icon}}" src="{{item.icon}}" mode="aspectFit" /> - <image wx:else src="/static/images/bookExhibitionList/banner.png" mode="aspectFit" /> + <image + wx:else + src="/static/images/bookExhibitionList/banner.png" + mode="aspectFit" + /> </view> - <view class="textBox" title="{{item.subtitleName}}"> <text>{{item.subtitleName}}</text></view> + <view class="textBox" title="{{item.subtitleName}}"> + <text>{{item.subtitleName}}</text></view + > </view> </view> <view class="bottom-box" wx:if="{{bookExhibitionList.length }}"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> <!-- <Select prop-array='{{selectArray}}'></Select> --> </scroll-view> - </view> - - -</view> \ No newline at end of file +</view> diff --git a/pages/bookExhibitionList/index.wxss b/pages/bookExhibitionList/index.wxss index 801fa1e..a4e8aab 100644 --- a/pages/bookExhibitionList/index.wxss +++ b/pages/bookExhibitionList/index.wxss @@ -21,7 +21,8 @@ display: flex; flex-wrap: wrap; justify-content: space-between; - margin: 15px; + /* margin: 15px; */ + margin: 0 15px 15px 15px; } .contentBox { diff --git a/pages/cart/index.js b/pages/cart/index.js index 8dfc613..61b7040 100644 --- a/pages/cart/index.js +++ b/pages/cart/index.js @@ -35,7 +35,6 @@ title: '璐墿杞�' }); this.shoppingCartGet(); - this.setData({ swipeOpened: true }) @@ -57,7 +56,26 @@ }) }, - + // 閲戦鏄剧ず.00鏍煎紡 + numFormat(value) { + if (!value) return "0.00"; + value = Number(value).toFixed(2); + var intPart = Math.trunc(value); // 鑾峰彇鏁存暟閮ㄥ垎 + var intPartFormat = intPart + .toString() + .replace(/(\d)(?=(?:\d{3})+$)/g, "$1,"); // 灏嗘暣鏁伴儴鍒嗛�笁涓�鏂� + var floatPart = ".00"; // 棰勫畾涔夊皬鏁伴儴鍒� + var value2Array = value.split("."); + // =2琛ㄧず鏁版嵁鏈夊皬鏁颁綅 + if (value2Array.length === 2) { + floatPart = value2Array[1].toString(); // 鎷垮埌灏忔暟閮ㄥ垎 + if (floatPart.length === 1) { + return `${intPartFormat}.${floatPart}0`; + } + return `${intPartFormat}.${floatPart}`; + } + return intPartFormat + floatPart; + }, onDelete(e) { const item = e.currentTarget.dataset.item; app.MG.store.delShoppingCart({ @@ -84,12 +102,11 @@ searchList: [] }; app.MG.store.getShoppingCartProductList(query).then(res => { - + console.log(res); this.setData({ totalSize: res.totalSize }) res.datas.forEach(item => { - this.setData({ bookId: res.id, bookName: res.name, @@ -101,8 +118,8 @@ // }) const type = item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product'; item.type = type; // 灏唗ype璁剧疆涓篿tem瀵硅薄鐨勫睘鎬э紝鑰屼笉鏄娇鐢╯etData - item.name = item.linkCmsItems[0].name ? item.productMonWithLinkDto.product.name + ':' + item.linkCmsItems[0].name : item.productMonWithLinkDto.product.name + item.saleMethod.price = this.numFormat(item.saleMethod.price) }); this.setData({ diff --git a/pages/cart/index.wxml b/pages/cart/index.wxml index ff79a21..ff41996 100644 --- a/pages/cart/index.wxml +++ b/pages/cart/index.wxml @@ -4,26 +4,34 @@ <!-- loading hidden --> <view hidden="{{hidden}}"> - <scroll-view scroll-y="{{true}}" class="outsideContentBox" bindscrolltolower="onScrollToLower"> - + <scroll-view + scroll-y="{{true}}" + class="outsideContentBox" + bindscrolltolower="onScrollToLower" + > <view> - <!-- <checkbox-group bindchange="HandelItemChange"> --> <view wx:if="{{shoppingCartData.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> </view> <!-- <button bind:tap="onLogin"> 鍘荤櫥褰�</button> --> - <t-swipe-cell wx:for="{{shoppingCartData}}" wx:key="index" wx:for-item="item" wx:for-index="index" opened="{{swipeOpened}}"> + <t-swipe-cell + wx:for="{{shoppingCartData}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + opened="{{swipeOpened}}" + > <view class="itemWarp"> <t-cell bordered="{{false}}"> <view slot="title" class="titleBox"> - <view wx:if="{{item.type == 'product'}}" style="width: 386rpx;"> + <view wx:if="{{item.type == 'product'}}" style="width: 386rpx"> <view class="boosName"> <text class="eBook">鐢靛瓙涔�</text> <text> {{item.name}}</text> </view> </view> - <view wx:if="{{item.type == 'item'}}" style="width: 386rpx;"> + <view wx:if="{{item.type == 'item'}}" style="width: 386rpx"> <view class="boosName"> <text class="cloudLearning">浜戝涔�</text> <text> {{item.name}}</text> @@ -32,50 +40,88 @@ </view> <view slot="description" class="descriptionBox"> <view> - <view class="textBox" wx:if="{{item.type == 'product'}}">鍥句功鏈嶅姟-鐢靛瓙涔�</view> - <view class="textBox" wx:if="{{item.type == 'item'}}">鍥句功鏈嶅姟-浜戝涔�</view> + <view class="textBox" wx:if="{{item.type == 'product'}}" + >鍥句功鏈嶅姟-鐢靛瓙涔�</view + > + <view class="textBox" wx:if="{{item.type == 'item'}}" + >鍥句功鏈嶅姟-浜戝涔�</view + > </view> - <view wx:if="{{item.saleMethod.price != 0}}"> - 锟{price}} + <view wx:if="{{item.saleMethod.price != 0}}" class="price-box"> + 锟{item.saleMethod.price }} </view> <view wx:else class="descriptionBox"> 绔嬪嵆棰嗗彇</view> </view> <view slot="left-icon" class="left-icon"> <view class="contentCheckbox"> - <t-checkbox icon="rectangle" value=" {{item.id}}" data-item="{{item}}" checked="{{item.checked}}" bindchange="HandelItemChange" /> + <t-checkbox + icon="rectangle" + value=" {{item.id}}" + data-item="{{item}}" + checked="{{item.checked}}" + bindchange="HandelItemChange" + /> </view> <view class="left-image" data-item="{{item}}" bind:tap="onBook"> - <image wx:if="{{item.imgUrl}}" src="{{item.imgUrl}}" class="imageStyle" mode="aspectFit" /> - <image wx:else src="/static/images/default-book-img.png" class="imageStyle" mode="aspectFit" /> + <image + wx:if="{{item.imgUrl}}" + src="{{item.imgUrl}}" + class="imageStyle" + mode="aspectFit" + /> + <image + wx:else + src="/static/images/default-book-img.png" + class="imageStyle" + mode="aspectFit" + /> </view> </view> </t-cell> </view> - <view slot="right" class="btn delete-btn" bind:tap="onDelete" data-item="{{item}}">鍒犻櫎</view> + <view + slot="right" + class="btn delete-btn" + bind:tap="onDelete" + data-item="{{item}}" + >鍒犻櫎</view + > </t-swipe-cell> <view wx:if="{{shoppingCartData.length > 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> </view> - - <t-toast id="t-toast" /> </scroll-view> <view class="bottomBox"> <view class="checkGroupBox"> <checkbox-group bindchange="bottomChange"> - <checkbox disabled="{{onDisabled}}" value="鍏ㄩ��" checked="{{checkAll}}">鍏ㄩ��</checkbox> + <checkbox disabled="{{onDisabled}}" value="鍏ㄩ��" checked="{{checkAll}}" + >鍏ㄩ��</checkbox + > </checkbox-group> </view> <view class="settlementBox"> - <view class="totalPrice">鎬讳环:<text class="totalPriceText">锟{totalPrice}}</text></view> + <view class="totalPrice" + >鎬讳环:<text class="totalPriceText">锟{totalPrice}}</text></view + > <view class="buttonBox"> - <t-button class="tButtonBox" size="small" shape="round" bind:tap="goPaymentPage"> + <t-button + class="tButtonBox" + size="small" + shape="round" + bind:tap="goPaymentPage" + > <view>鍘荤粨绠�({{selectedCount}})</view> </t-button> </view> </view> </view> -</view> \ No newline at end of file +</view> diff --git a/pages/cart/index.wxss b/pages/cart/index.wxss index ca38e42..62ca2d2 100644 --- a/pages/cart/index.wxss +++ b/pages/cart/index.wxss @@ -293,4 +293,8 @@ .t-checkbox__content { height: 0rpx !important; +} + +.price-box { + color: #0F1214; } \ No newline at end of file diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js index 2a8f69c..0eaae66 100644 --- a/pages/retrievalPage/index.js +++ b/pages/retrievalPage/index.js @@ -39,7 +39,7 @@ page: 1, total: 0, }, - tabValue: '' + tabValue: '0' }, /** @@ -62,7 +62,7 @@ value: "0" } } - this.onTabsChange(event) + // this.onTabsChange(event) }, /** @@ -130,7 +130,6 @@ onTabsChange(event) { const value = event.detail.value console.log(value); - if (value === '0') { this.setData({ tabValue: value, @@ -163,15 +162,9 @@ isMore: false }) } - }, - - - retrievalPageGet() { - - let fields = { liveTime: [], lecturer: [], @@ -916,8 +909,5 @@ }, 100) } } - }, - onTabsClick(event) { - console.log(`Click tab, tab-panel value is ${event.detail.value}.`); }, }) \ No newline at end of file diff --git a/pages/retrievalPage/index.json b/pages/retrievalPage/index.json index 69736ad..1be75e8 100644 --- a/pages/retrievalPage/index.json +++ b/pages/retrievalPage/index.json @@ -12,7 +12,7 @@ "t-dialog": "tdesign-miniprogram/dialog/dialog", "t-input": "tdesign-miniprogram/input/input" }, - "navigationStyle": "custom", + "navigationBarTitleText": "妫�绱㈢粨鏋�", "enablePullDownRefresh": true, "onReachBottomDistance": 200, "backgroundTextStyle": "dark", diff --git a/pages/retrievalPage/index.wxml b/pages/retrievalPage/index.wxml index f64404d..91098b4 100644 --- a/pages/retrievalPage/index.wxml +++ b/pages/retrievalPage/index.wxml @@ -1,75 +1,100 @@ <import src="index.skeleton.wxml" /> <template is="skeleton" wx:if="{{loading}}" /> - <view class="outsideRetrievalPageBox" hidden="{{hidden}}"> - <view class="retrievalPageBox"> - <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="navbar-title">妫�绱㈢粨鏋�</view> - </view> - - <view class="example-search"> - <t-search bind:submit="onSearchSubmit" class="searchBox" model:value="{{searchVal}}" placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" /> + <t-search + bind:submit="onSearchSubmit" + class="searchBox" + model:value="{{searchVal}}" + placeholder="璇疯緭鍏ュ叧閿瘝/涔﹀悕/ISBN/浣滆��" + /> <view class="cancellation" bind:tap="onCancellation">鍙栨秷</view> </view> - </view> <!--pages/retrievalPage/index.wxml--> - <view class="tabsBox"> <!-- sticky="true" --> - <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> - - - + <t-tabs + value="{{tabValue}}" + bind:change="onTabsChange" + t-class="custom-tabs" + t-class-content="custom-panel" + > <t-tab-panel label="鍥句功({{bookTotal}})" value="0"> - - - - <view wx:if="{{bookData.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - - <scroll-view scroll-y="{{true}}" class="scrollViewBox" bindscrolltolower="onScrollToLower"> + <scroll-view + scroll-y="{{true}}" + class="scrollViewBox" + bindscrolltolower="onScrollToLower" + > <view class="bookDataBox"> - <view class="bookDataForBox" wx:for="{{bookData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="onBook"> + <view + class="bookDataForBox" + wx:for="{{bookData}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + data-item="{{item}}" + bind:tap="onBook" + > <view class="imageBox"> - <image wx:if="{{item.icon}}" src="{{item.icon}}" mode="aspectFit" /> - <image wx:if="{{!item.icon}}" src="/static/images/default-book-img.png" mode="" /> + <image + wx:if="{{item.icon}}" + src="{{item.icon}}" + mode="aspectFit" + /> + <image + wx:if="{{!item.icon}}" + src="/static/images/default-book-img.png" + mode="" + /> </view> - <view class="bookDataNmae"> - {{item.name}} - </view> + <view class="bookDataNmae"> {{item.name}} </view> <view class="bookDataAuthor">{{item.author}}</view> </view> </view> <view wx:if="{{bookData.length != 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> </scroll-view> - - </t-tab-panel> <t-tab-panel label="璇剧▼({{courseTotal}})" value="1"> <view wx:if="{{courseData.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - - <scroll-view scroll-y="{{true}}" class="scrollViewBox" bindscrolltolower="onScrollToLower"> + <scroll-view + scroll-y="{{true}}" + class="scrollViewBox" + bindscrolltolower="onScrollToLower" + > <view class="listBox1"> <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" data-item="{{item}}" bind:tap="underConstruction"> + <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" + data-item="{{item}}" + bind:tap="underConstruction" + > <view class="specialSubject-img-box"> <image src="{{item.icon}}" mode="aspectFill" /> </view> @@ -80,9 +105,17 @@ <text>{{item.classHours}}璇炬椂</text> </view> <view class="priceBox flex jc-sb"> - <text class="price" wx:if="{{item.price == 0}}">鍏嶈垂</text> - <text class="price" wx:if="{{item.price !== 0}}">锟{item.price}}</text> - <image src="/static/images/home/home-cart.png" mode="aspectFill" class="addCartImg" /> + <text class="price" wx:if="{{item.price == 0}}" + >鍏嶈垂</text + > + <text class="price" wx:if="{{item.price !== 0}}" + >锟{item.price}}</text + > + <image + src="/static/images/home/home-cart.png" + mode="aspectFill" + class="addCartImg" + /> </view> </view> </view> @@ -90,60 +123,102 @@ </view> </view> <view wx:if="{{courseData.length != 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> </scroll-view> - </t-tab-panel> <t-tab-panel label="鏁板瓧鏁欐潗({{digitalTextbooksTotal}})" value="2"> - - <view wx:if="{{digitalTextbooksData.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <scroll-view scroll-y="{{true}}" class="scrollViewBox" bindscrolltolower="onScrollToLower"> + <scroll-view + scroll-y="{{true}}" + class="scrollViewBox" + bindscrolltolower="onScrollToLower" + > <view class="bookDataBox"> - <view class="bookDataForBox" wx:for="{{digitalTextbooksData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="underConstruction"> + <view + class="bookDataForBox" + wx:for="{{digitalTextbooksData}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + data-item="{{item}}" + bind:tap="underConstruction" + > <view class="imageBox"> <image src="{{item.icon}}" mode="" /> </view> - <view class="bookDataNmae"> - {{item.name}} - </view> + <view class="bookDataNmae"> {{item.name}} </view> <view class="bookDataAuthor">{{item.author}}</view> </view> </view> - <view wx:if="{{digitalTextbooksData.length != 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> </scroll-view> - - </t-tab-panel> <t-tab-panel label="涓撻({{seminarTotal}})" value="3"> <view wx:if="{{seminarData.length <= 0}}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <scroll-view scroll-y="{{true}}" class="scrollViewBox" bindscrolltolower="onScrollToLower"> + <scroll-view + scroll-y="{{true}}" + class="scrollViewBox" + bindscrolltolower="onScrollToLower" + > <view class="listBox"> - <view wx:for="{{seminarData}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="listItemBox" data-item="{{item}}" bind:tap="underConstruction"> - <view class="listItem" bindtap="goSubjectDetail" data-book="{{item}}"> + <view + wx:for="{{seminarData}}" + wx:for-item="item" + wx:for-index="index" + wx:key="index" + class="listItemBox" + data-item="{{item}}" + bind:tap="underConstruction" + > + <view + class="listItem" + bindtap="goSubjectDetail" + data-book="{{item}}" + > <view class="specialSubject-img"> <image src="{{item.icon}}" mode="aspectFill" class="img" /> </view> <view class="body-info"> <view class="name">{{item.name}}</view> - <view class="time" wx:if="{{item.liveTime}}">鐩存挱鏃堕棿锛歿{item.liveTime}}</view> - <view class="time" wx:if="{{item.startTime}}">寮�鎾椂闂达細{{ item.startTime }}</view> - <view class="time" wx:if="{{!item.liveTime && !item.startTime}}">寮�鎾椂闂达細<text class="grey">寰呭畾</text></view> + <view class="time" wx:if="{{item.liveTime}}" + >鐩存挱鏃堕棿锛歿{item.liveTime}}</view + > + <view class="time" wx:if="{{item.startTime}}" + >寮�鎾椂闂达細{{ item.startTime }}</view + > + <view + class="time" + wx:if="{{!item.liveTime && !item.startTime}}" + >寮�鎾椂闂达細<text class="grey">寰呭畾</text></view + > <view class="flex jc-sb"> - <text class="author">{{item.lecturer}} {{item.position}}</text> + <text class="author" + >{{item.lecturer}} {{item.position}}</text + > <text class="price" wx:if="{{item.price == 0}}">鍏嶈垂</text> - <text class="price" wx:if="{{item.price !== 0}}">锟{item.price}}</text> + <text class="price" wx:if="{{item.price !== 0}}" + >锟{item.price}}</text + > </view> </view> </view> @@ -151,30 +226,59 @@ </view> <view wx:if="{{seminarData.length != 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> - - </scroll-view> </t-tab-panel> <t-tab-panel label="涔︾洰({{bookFairTotal}})" value="4"> - - - <view wx:if="{{bookFairData.length <= 0 }}" class="noDataBox"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <scroll-view scroll-y="{{true}}" class="scrollViewBox" bindscrolltolower="onScrollToLower"> + <scroll-view + scroll-y="{{true}}" + class="scrollViewBox" + bindscrolltolower="onScrollToLower" + > <view class="outsideHigherBox"> - <view class="higherBox" wx:for="{{bookFairData}}" wx:key="index" wx:for-item="item" wx:for-index="index"> + <view + class="higherBox" + wx:for="{{bookFairData}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + > <view class="outsideHigherImageBox"> <view class="higherImageBox" data-item="{{item}}"> - <image bind:tap="downloadData" src="{{item.icon}}" mode="aspectFill" /> - <view class="downloadIcon" data-item="{{item}}" data-key="showWithInput" bind:tap="mailbox"> - <image wx:if="{{determine}}" class="download" src="/static/images/bibliographyList/email-click.png" mode="aspectFit" /> - <image wx:else="" class="downloadshiftin" src="/static/images/bibliographyList/email.png" mode="aspectFit" /> + <image + bind:tap="downloadData" + src="{{item.icon}}" + mode="aspectFill" + /> + <view + class="downloadIcon" + data-item="{{item}}" + data-key="showWithInput" + bind:tap="mailbox" + > + <image + wx:if="{{determine}}" + class="download" + src="/static/images/bibliographyList/email-click.png" + mode="aspectFit" + /> + <image + wx:else="" + class="downloadshiftin" + src="/static/images/bibliographyList/email.png" + mode="aspectFit" + /> </view> </view> </view> @@ -182,48 +286,93 @@ </view> </view> - - <view wx:if="{{bookFairData.length != 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> - - </scroll-view> - - </t-tab-panel> <t-tab-panel label="涔﹀睍({{biblioClassificationTotal}})" value="5"> - <view wx:if="{{biblioClassificationData.length <= 0}}" class="noDataBox"> + <view + wx:if="{{biblioClassificationData.length <= 0}}" + class="noDataBox" + > <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <scroll-view scroll-y="{{true}}" class="scrollViewBox" bindscrolltolower="onScrollToLower"> + <scroll-view + scroll-y="{{true}}" + class="scrollViewBox" + bindscrolltolower="onScrollToLower" + > <view class="outside"> - <view class="contentBox" wx:for="{{biblioClassificationData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bindtap="onBookExhibitionDetails" data-item="{{item}}"> - <image class="bookFairImage" wx:if="{{item.icon}}" src="{{item.icon}}" mode="" /> - <image class="bookFairImage" wx:else="" src="/static/images/bookExhibitionList/banner.png" mode="" /> - <view class="textBox" title="{{item.name}}"> <text>{{item.subtitleName}}</text></view> + <view + class="contentBox" + wx:for="{{biblioClassificationData}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + bindtap="onBookExhibitionDetails" + data-item="{{item}}" + > + <image + class="bookFairImage" + wx:if="{{item.icon}}" + src="{{item.icon}}" + mode="" + /> + <image + class="bookFairImage" + wx:else="" + src="/static/images/bookExhibitionList/banner.png" + mode="" + /> + <view class="textBox" title="{{item.name}}"> + <text>{{item.subtitleName}}</text></view + > </view> - </view> - <view wx:if="{{biblioClassificationData.length != 0}}" class="bottom-box"> - <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> + <view + wx:if="{{biblioClassificationData.length != 0}}" + class="bottom-box" + > + <t-loading + theme="circular" + size="40rpx" + class="wrapper" + wx:if="{{isMore == true}}" + /> <text wx:if="{{isMore == false}}">娌℃湁鏇村浜�</text> </view> - - </scroll-view> </t-tab-panel> </t-tabs> </view> <view class="dialogBox"> - <t-dialog visible="{{showWithInput}}" title="璇疯緭鍏ラ偖绠�" confirm-btn="纭畾" cancel-btn="鍙栨秷" bind:confirm="onConfirm" bind:cancel="closeDialog"> - - <t-input model:value="{{input}}" borderless class="dialog-input" clearable slot="content" placeholder="璇疯緭鍏ラ偖绠卞彿" placeholder-class="placeholder" bindchange="onEmailInput" /> - + <t-dialog + visible="{{showWithInput}}" + title="璇疯緭鍏ラ偖绠�" + confirm-btn="纭畾" + cancel-btn="鍙栨秷" + bind:confirm="onConfirm" + bind:cancel="closeDialog" + > + <t-input + model:value="{{input}}" + borderless + class="dialog-input" + clearable + slot="content" + placeholder="璇疯緭鍏ラ偖绠卞彿" + placeholder-class="placeholder" + bindchange="onEmailInput" + /> </t-dialog> </view> -</view> \ No newline at end of file +</view> diff --git a/pages/retrievalPage/index.wxss b/pages/retrievalPage/index.wxss index 0fc6624..e8439b9 100644 --- a/pages/retrievalPage/index.wxss +++ b/pages/retrievalPage/index.wxss @@ -387,8 +387,8 @@ /* min-width: 210rpx; */ background-repeat: no-repeat; background-image: url(https://jsek.bnuic.com/home/image/click-icon.png); - background-position: 83% center; - background-size: 40%; + background-position: 90% 50%; + background-size: 70rpx !important; /* 灏嗚儗鏅浘鐗囦綅缃缃负闈犲彸 */ } -- Gitblit v1.9.1