From 78068d49c20a8b90db902d955f558af507eb8b96 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期四, 11 四月 2024 16:06:12 +0800 Subject: [PATCH] 各页面添加骨架屏 --- packageBookService/pages/bookServices/list/index.js | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js index a870a7d..f57e643 100644 --- a/packageBookService/pages/bookServices/list/index.js +++ b/packageBookService/pages/bookServices/list/index.js @@ -1,7 +1,4 @@ const app = getApp(); -import { - loginInfo -} from "../../../../assets/js/login"; Page({ /** * 椤甸潰鐨勫垵濮嬫暟鎹� @@ -80,6 +77,7 @@ disabledNewForms: false, triggered: false, backTop: "", + isshowLoading: true }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 @@ -166,6 +164,7 @@ triggered: true, }); this.setData({ + isshowLoading: false, "pageCount.page": 1, }); this.getBookList(this.data.path); @@ -181,6 +180,7 @@ this.setData({ isMore: true, "pageCount.page": this.data.pageCount.page + 1, + isshowLoading: false }); this.getBookList(this.data.path); } @@ -353,10 +353,15 @@ return false; } this.setData({ - loading: true, noData: false, isRequesting: true, + disabledSecondList: false }); + if (this.data.isshowLoading) { + this.setData({ + loading: true + }) + } let sort; let pathObj = {}; if (this.data.pathList.length) { @@ -436,6 +441,11 @@ }, }; app.MG.store.getProductList(query).then((res) => { + if (!res.datas.length && !this.data.pathList.length) { + this.setData({ + disabledSecondList: true + }) + } this.setData({ bookList: res.datas, isMore: null, @@ -443,6 +453,7 @@ "pageCount.total": res.total, loading: false, isRequesting: false, + isshowLoading: true }); if (!res.datas.length) { this.setData({ @@ -464,8 +475,6 @@ const path = e.detail.value.length ? `${this.data.assortCheck.code}\\${e.detail.value}` : this.data.assortCheck.code; - console.log(this.data.path); - this.setData({ backTop: "#assort-title", pathList: [], @@ -473,8 +482,8 @@ secondCode: "", path: path, "stairList.value": e.detail.value, + disabledSecondList: false }); - if (e.detail.value == "") { this.setData({ disabledSecondList: true, @@ -483,7 +492,6 @@ this.getSecondList(path); } this.getBookList(path); - console.log(this.data.disabledSecondList); }, // 浜岀骇鍒嗙被鍒囨崲 onChangeSecond(e) { @@ -607,13 +615,11 @@ this.getBookList(this.data.path); }, openDropdown() { - console.log("灞曞紑鍝�"); this.setData({ showDropdown: true, }); }, closeDropdown() { - console.log("鍏抽棴"); this.setData({ showDropdown: false, }); -- Gitblit v1.9.1