From aef06b129be7a3a12ac097db8e372b0cb33c6c42 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 02 四月 2024 09:15:19 +0800 Subject: [PATCH] 我的建议,笔记bug修改 --- packageBookService/pages/bookServices/detail/components/note/note.js | 41 +++++++++++++++++++++++++++-------------- 1 files changed, 27 insertions(+), 14 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/note/note.js b/packageBookService/pages/bookServices/detail/components/note/note.js index b059f83..3d9d9e0 100644 --- a/packageBookService/pages/bookServices/detail/components/note/note.js +++ b/packageBookService/pages/bookServices/detail/components/note/note.js @@ -32,6 +32,7 @@ noteList: [], activeValues: 0, loading: false, + noList: false, }, /** * 缁勪欢鐨勬柟娉曞垪琛� @@ -62,7 +63,6 @@ }) }, openDialog() { - console.log(this.properties.bookInfo.name); this.setData({ submitTitle: this.properties.bookInfo.name, showNoteDialog: true @@ -92,12 +92,14 @@ }, // 寮圭獥纭畾鎸夐挳 confirmSuggest() { - if (!this.data.submitTitle) { + const submitTitle = this.data.submitTitle.trim() + const textvalue = this.data.textvalue.trim() + if (!submitTitle.length) { return wx.showToast({ icon: 'error', title: '璇峰~鍐欑瑪璁版爣棰�', }) - } else if (!this.data.textvalue) { + } else if (!textvalue.length) { return wx.showToast({ icon: 'error', title: '璇峰~鍐欑瑪璁板唴瀹�', @@ -136,10 +138,10 @@ }, // 鑾峰彇绗旇鍒楄〃 async getNoteList() { - // this.setData({ - // loading: true - // }) - console.log(this.properties.bookInfo.id, 'this.properties.bookInfo.id'); + this.setData({ + loading: true, + noList: false + }) let topicId await app.MG.ugc .getProductUserSubmitTopic({ @@ -169,6 +171,13 @@ topicIdOrRefCode: topicId + '' } await app.MG.ugc.getTopicMessageList(query).then((res) => { + if (!res.datas.length) { + return this.setData({ + noList: true, + loading: false, + noteList: res.datas, + }) + } // notePage.value.total = res.totalSize res.datas.forEach((item) => { item.compliceHover = false @@ -180,7 +189,6 @@ noteList: res.datas, loading: false }) - console.log('绗旇鍒楄〃', res.datas); }) }, // 鏂板缓绗旇鎺ュ彛 @@ -233,13 +241,15 @@ messageIds.push(id) wx.showModal({ title: '鎻愮ず', - content: '纭鍒犻櫎璇ョ瑪璁板悧锛�',//editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 - editable: false,//鏄惁鏄剧ず杈撳叆妗� - placeholderText: '璇疯緭鍏ュ唴瀹瑰惂',//杈撳叆妗嗙殑榛樿鍐呭 + content: '纭鍒犻櫎璇ョ瑪璁板悧锛�', //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + editable: false, //鏄惁鏄剧ず杈撳叆妗� + placeholderText: '璇疯緭鍏ュ唴瀹瑰惂', //杈撳叆妗嗙殑榛樿鍐呭 success: (res) => { if (res.confirm) { app.MG.ugc - .delTopicMessage({ messageIds }) + .delTopicMessage({ + messageIds + }) .then((res) => { wx.showToast({ title: '鍒犻櫎鎴愬姛', @@ -270,7 +280,10 @@ submitTitle: note.name, noteId: note.id }) - this.openDialog() + console.log(note.name, this.data.submitTitle); + this.setData({ + showNoteDialog: true + }) }, // 缂栬緫绗旇鎺ュ彛 updateNote() { @@ -316,4 +329,4 @@ }) } } -}) +}) \ No newline at end of file -- Gitblit v1.9.1