From 3f026c2e65fb9ed2e0017ed116b649808a9a5086 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Thu, 9 Apr 2020 20:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mall/search-list/index.js | 18 ++++++++++++------ pages/mall/search-list/index.wxml | 12 ++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/pages/mall/search-list/index.js b/pages/mall/search-list/index.js index e752958..228ec97 100644 --- a/pages/mall/search-list/index.js +++ b/pages/mall/search-list/index.js @@ -13,6 +13,7 @@ Page({ data: { height: app.globalData.fragmentHeight, CustomBar: app.globalData.CustomBar, + loading: false, finished: false, requesting: false, rearchStringList: [], @@ -103,8 +104,11 @@ Page({ if (this.data.requesting || this.data.finished) { return } + if (this.data.form.pageNum == 1 && this.data.taskList.length == 0) { + this.setData({ loading: true }) + } this.data.requesting = true - wx.showLoading({ title: '搜索中', mask: true }) + // wx.showLoading({ title: '搜索中', mask: true }) // /product/list产品列表 request.get('/bxe-mall/product/list', this.data.form).then(result => { //成功回调 @@ -124,7 +128,8 @@ Page({ [nowList]: respList, total: result.data.total, ['form.pageNum']: (num + 1), - finished + finished, + loading: false }) } else { var strList = this.data.rearchStringList @@ -133,15 +138,16 @@ Page({ } this.setData({ rearchStringList: strList, - focus: false + focus: false, + loading: false }) } - wx.hideLoading() + // wx.hideLoading() }).catch(err => { //异常回调 - wx.hideLoading() + // wx.hideLoading() + this.setData({ loading: false }) this.data.requesting = false - console.log() var strList = this.data.rearchStringList if(strList.indexOf(this.data.form.name) < 0){ strList.splice(0, 0, this.data.form.name) diff --git a/pages/mall/search-list/index.wxml b/pages/mall/search-list/index.wxml index 62350af..3f12165 100644 --- a/pages/mall/search-list/index.wxml +++ b/pages/mall/search-list/index.wxml @@ -11,7 +11,7 @@ - 搜索 + 搜索 @@ -19,7 +19,7 @@ - 搜索历史 + 搜索历史 @@ -28,7 +28,11 @@ - + + + 加载中... + + 暂无数据 @@ -36,7 +40,7 @@ - +