From e6a156a6a8bb6f1d3a17e9310269f53c56e10b42 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期一, 08 四月 2024 22:29:26 +0800 Subject: [PATCH] 问题修改 --- pages/personalCenter/feedBackSubmit/index.js | 17 ++++- packagePersonal/pages/myMassage/index.js | 18 +++-- packageDomain/pages/sampleBookList/applicationForm/index.js | 12 ++++ packagePersonal/pages/feedBack/index.js | 23 ++++--- assets/js/config.js | 2 packageDomain/pages/sampleBookList/index.js | 48 +++++++++++++++ packageDomain/pages/sampleBookList/index.json | 3 packageBookService/pages/bookServices/detail/index.js | 17 +++-- packagePersonal/pages/downloads/index.js | 2 packagePersonal/pages/sampleBooks/index.js | 2 packagePersonal/pages/feedBack/index.wxml | 2 11 files changed, 110 insertions(+), 36 deletions(-) diff --git a/assets/js/config.js b/assets/js/config.js index 924f932..71c32a2 100644 --- a/assets/js/config.js +++ b/assets/js/config.js @@ -3,7 +3,7 @@ export const requestCtx = "https://jsek.bnuic.com" // 璇锋眰鍦板潃 export const appId = 3; // export const epubUrl = "http://182.92.203.7:3007/epubReadMobile/"; -export const epubUrl = "http://jsysf.bnuic.com/epubReadMobile/#/"; +export const epubUrl = "https://jsek.bnuic.com/epubReadMobile/#/"; export const pdfUrl = "http://182.92.203.7:3007/pdfRead/" export const requestTimeOut = 300000; // 璇锋眰瓒呮椂鏃堕棿 export const tokenKey = "jsek-token"; diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 1240104..97cf4ee 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -1928,14 +1928,7 @@ }); return false; } - if (this.data.paperBookList.length >= 2) { - wx.showToast({ - title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�", - icon: "none", - duration: 1000, - }); - return false; - } + let isHas = this.data.paperBookList.find( (pitem) => pitem.id == this.data.bookDetail.id ); @@ -1947,6 +1940,14 @@ }); return false; } + if (this.data.paperBookList.length >= 2) { + wx.showToast({ + title: "姣忔鏈�澶氬彧鍙敵璇�2鏈牱涔�", + icon: "none", + duration: 1000, + }); + return false; + } this.addBookFun(this.data.bookDetail, "pBook"); } else { wx.showModal({ diff --git a/packageDomain/pages/sampleBookList/applicationForm/index.js b/packageDomain/pages/sampleBookList/applicationForm/index.js index 6b599f9..b1831f9 100644 --- a/packageDomain/pages/sampleBookList/applicationForm/index.js +++ b/packageDomain/pages/sampleBookList/applicationForm/index.js @@ -46,6 +46,18 @@ 'contactInfo.phone': JSON.parse(this.data.userInfo.data).phone, 'contactInfo.detailedAddress': JSON.parse(this.data.userInfo.data).detailedAddress, }) + } else { + wx.showModal({ + title: '灏婃暚鐨勭敤鎴凤紝鎮ㄥソ锛�', //鎻愮ず鐨勬爣棰� + content: '璇峰厛杩涜鏁欏笀璁よ瘉锛�', //鎻愮ず鐨勫唴瀹� + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: "/packageDomain/pages/teacherCertification/index", + }); + } + } + }) } if (wx.getStorageSync("paperBookList")) { this.setData({ diff --git a/packageDomain/pages/sampleBookList/index.js b/packageDomain/pages/sampleBookList/index.js index 0858a02..eb4db74 100644 --- a/packageDomain/pages/sampleBookList/index.js +++ b/packageDomain/pages/sampleBookList/index.js @@ -420,6 +420,8 @@ author: [], isbn: [], publicationDate: [], + pdf: [], + protectedEpub: [], isApplyBook: [], 'isApplyBook>': ['1'], ...searchObj, @@ -495,6 +497,9 @@ }) } else { that.setData({ + bookList: [], + pageTotalCount: 0, + bottomLoading: false, skeletonLoding: false, loading: false }) @@ -807,14 +812,55 @@ }, //閫夋嫨鐢靛瓙鏍蜂功 - onChangeElectron(e) { + async onChangeElectron(e) { const item = e.currentTarget.dataset.book; + console.log(item) const index = this.data.bookList.findIndex(citem => citem.id == item.id) let role = this.data.userInfo != null ? this.data.userInfo.role : null if (role && role == 'Teacher') { // 鏄暀甯� if (e.detail.checked) { // 鐐瑰嚮閫変腑 + //鍟嗗搧鏈夋棤鐢靛瓙涔� + const obj = { + path: '*', + queryType: 'SubProduct', + sort: { + type: 'Desc', + field: 'CreateDate' + }, + paging: { + start: 0, + size: 1 + }, + mainProductId: item.id, + fields: { + bookshelf_pdf: [], + bookshelf_protectedEpub: [], + } + } + const res = await app.MG.store.getProductList(obj) + if (res.datas.length > 0) { + if (!res.datas[0].bookshelf_pdf && !res.datas[0].bookshelf_protectedEpub) { + wx.showToast({ + title: "鏆傛棤鐢靛瓙涔︽枃浠�,璇疯仈绯荤鐞嗗憳!", + icon: 'none', + duration: 1000, + }) + return false; + } + } else { + if (!item.pdf && !item.protectedEpub) { + wx.showToast({ + title: "鏆傛棤鐢靛瓙涔︽枃浠�,璇疯仈绯荤鐞嗗憳!", + icon: 'none', + duration: 1000, + }) + return false; + } + } + + //鐢宠娆℃暟 if (this.data.ebookCount == 0) { wx.showToast({ title: "鎮ㄧ殑鐢靛瓙鏍蜂功鐢宠娆℃暟宸茬敤灏斤紝鑻ヨ缁х画锛岃鑱旂郴绠$悊鍛橈紒", diff --git a/packageDomain/pages/sampleBookList/index.json b/packageDomain/pages/sampleBookList/index.json index cf12577..f62f659 100644 --- a/packageDomain/pages/sampleBookList/index.json +++ b/packageDomain/pages/sampleBookList/index.json @@ -11,6 +11,7 @@ "t-search": "tdesign-miniprogram/search/search", "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", "t-loading": "tdesign-miniprogram/loading/loading", - "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh" + "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh", + "t-empty": "tdesign-miniprogram/empty/empty" } } \ No newline at end of file diff --git a/packagePersonal/pages/downloads/index.js b/packagePersonal/pages/downloads/index.js index 76aa687..f87e7d1 100644 --- a/packagePersonal/pages/downloads/index.js +++ b/packagePersonal/pages/downloads/index.js @@ -67,6 +67,8 @@ }) } else { this.setData({ + list: [], + pageTotalCount: 0, skeletonLoding: false, }) } diff --git a/packagePersonal/pages/feedBack/index.js b/packagePersonal/pages/feedBack/index.js index e1511ec..618acf0 100644 --- a/packagePersonal/pages/feedBack/index.js +++ b/packagePersonal/pages/feedBack/index.js @@ -9,8 +9,7 @@ data: { active: 0, activeName: "bookOpinion", - tabList: [ - { + tabList: [{ label: '鍥句功寤鸿', key: 0, value: 'bookOpinion' @@ -80,15 +79,15 @@ getDataList(isReachBottom) { app.MG.ugc.getTopicMessageList({ - appRefCode: app.config.appRefCode, - topicIdOrRefCode: this.data.topicIdOrRefCode, - start: this.data.page * this.data.limit - this.data.limit, - size: this.data.limit, - sort: { - type: "Desc", - field: "CreateDate" - } - }) + appRefCode: app.config.appRefCode, + topicIdOrRefCode: this.data.topicIdOrRefCode, + start: this.data.page * this.data.limit - this.data.limit, + size: this.data.limit, + sort: { + type: "Desc", + field: "CreateDate" + } + }) .then(res => { try { if (res.datas.length > 0) { @@ -112,6 +111,8 @@ }) } else { this.setData({ + list: [], + pageTotalCount: 0, skeletonLoding: false, }) } diff --git a/packagePersonal/pages/feedBack/index.wxml b/packagePersonal/pages/feedBack/index.wxml index 0c8222d..4eba6c7 100644 --- a/packagePersonal/pages/feedBack/index.wxml +++ b/packagePersonal/pages/feedBack/index.wxml @@ -17,7 +17,7 @@ <view wx:if="{{activeName == 'bookOpinion'}}" class="listBox"> <view class="content-item" wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> <view class="icon"> - <t-image src="{{item.content.icon}}" mode="aspectFill" class="img" /> + <t-image src="{{item.content.icon ? item.content.icon : '/static/images/default-book-img.png'}}" mode="aspectFill" class="img" /> </view> <view class="item-con"> <view class="titleBox"> diff --git a/packagePersonal/pages/myMassage/index.js b/packagePersonal/pages/myMassage/index.js index 34762a5..998b88d 100644 --- a/packagePersonal/pages/myMassage/index.js +++ b/packagePersonal/pages/myMassage/index.js @@ -29,14 +29,14 @@ getDataList(isReachBottom) { app.MG.app.getAppMessageList({ - appRefCode: app.config.appRefCode, - start: this.data.page * this.data.limit - this.data.limit, - size: this.data.limit, - sort: { - type: "Desc", - field: "CreateDate" - } - }) + appRefCode: app.config.appRefCode, + start: this.data.page * this.data.limit - this.data.limit, + size: this.data.limit, + sort: { + type: "Desc", + field: "CreateDate" + } + }) .then(res => { try { if (res.datas.length > 0) { @@ -59,6 +59,8 @@ }) } else { this.setData({ + list: [], + pageTotalCount: 0, skeletonLoding: false, }) } diff --git a/packagePersonal/pages/sampleBooks/index.js b/packagePersonal/pages/sampleBooks/index.js index bc1a1e4..ede0a53 100644 --- a/packagePersonal/pages/sampleBooks/index.js +++ b/packagePersonal/pages/sampleBooks/index.js @@ -143,6 +143,8 @@ }) } else { this.setData({ + list: [], + pageTotalCount: 0, skeletonLoding: false, loading: false }) diff --git a/pages/personalCenter/feedBackSubmit/index.js b/pages/personalCenter/feedBackSubmit/index.js index a6f3185..462762c 100644 --- a/pages/personalCenter/feedBackSubmit/index.js +++ b/pages/personalCenter/feedBackSubmit/index.js @@ -68,11 +68,18 @@ const { phoneError } = this.data; - const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value); - if (phoneError === isPhoneNumber) { + if (e.detail.value) { + const isPhoneNumber = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(e.detail.value); + if (phoneError === isPhoneNumber) { + this.setData({ + phoneError: !isPhoneNumber, + mannder: e.detail.value, + }); + } + } else { this.setData({ - phoneError: !isPhoneNumber, - mannder: e.detail.value, + phoneError: false, + mannder: '' }); } }, @@ -97,7 +104,7 @@ if (this.data.mannder.replace(/^\s*|\s*$/g, "") == '') { this.data.lock = true; wx.showToast({ - title: "鍙嶉鍐呭涓嶈兘涓虹┖", + title: "鑱旂郴鏂瑰紡涓嶈兘涓虹┖", icon: 'none', duration: 1000 }) -- Gitblit v1.9.1