From 61c2eff15b782a8628b7c66b391217c1bd554294 Mon Sep 17 00:00:00 2001 From: gray Date: Thu, 16 Aug 2018 08:52:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=9C=8D=E5=8A=A1=E6=94=B6?= =?UTF-8?q?=E8=B4=B9=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- littleApp_child/pages/Guide/guide.js | 22 ++++++++++++++++++---- littleApp_child/pages/home/home.js | 7 ++++++- littleApp_child/utils/network_util.js | 4 ++-- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/littleApp_child/pages/Guide/guide.js b/littleApp_child/pages/Guide/guide.js index 64f12e0..fad5976 100644 --- a/littleApp_child/pages/Guide/guide.js +++ b/littleApp_child/pages/Guide/guide.js @@ -44,8 +44,16 @@ Page({ hasMore = true if (current_index == 0) { + hasMore = false, + this.setData({ + list: [], + }) this.requestData() } else { + hasMore = false, + this.setData({ + list: [], + }) this.requestGuideData() } }, @@ -101,9 +109,12 @@ Page({ this.requestData(); }, myScroll: function(e) { - if (e.detail.scrollTop >= e.detail.scrollHeight - wx.getSystemInfoSync().windowHeight - 3) { + console.log("e:", e) + // console.log("aaaaaaaaaaaaaaaaaaaaaaaaa " + e.detail.scrollTop + " ==== " + e.detail.scrollHeight + " === " + wx.getSystemInfoSync().windowHeight) + // if (e.detail.scrollTop >= (e.detail.scrollHeight - wx.getSystemInfoSync().windowHeight - 3)) { + console.log("bbbbbbbb") this.loadMore() - } + // } }, /*---------自定义函数--------*/ requestGuideData(id) { @@ -119,7 +130,7 @@ Page({ console.log(res) isRefresh = false var arr = [] - + arr = arr.concat(res.data.data) var temp = self.data.category self.setData({ @@ -142,10 +153,12 @@ Page({ categoryId: self.data.id, days: getApp().globalData.days } + console.log(" categoryId ========= " + " ==== " + self.data.id) if (!param.categoryId) { param.categoryId = 4316 } networkUtil._get(api.articleList, param, function(res) { + console.log(param) console.log(res) isRefresh = false var arr = [] @@ -158,6 +171,7 @@ Page({ arr = arr.concat(res.data.data) var temp = self.data.category self.setData({ + list: arr, hasMore: hasMore, category: temp @@ -178,7 +192,7 @@ Page({ console.log(res) isRefresh = false var arr = [] - if (page > 0) { // 加载更多模式 + if (page > 1) { // 加载更多模式 arr = self.data.list } if (res.data.list.length < 15) { diff --git a/littleApp_child/pages/home/home.js b/littleApp_child/pages/home/home.js index 61d5218..2c6bf5e 100644 --- a/littleApp_child/pages/home/home.js +++ b/littleApp_child/pages/home/home.js @@ -362,7 +362,7 @@ Page({ if (item.id == 7) { if (item.status == 1) { self.setData({ - riskGuide: true, + // riskGuide: true, }) } } @@ -409,6 +409,11 @@ Page({ }else{ self.data.riskBase=false; } + if (res.data.data.status == 1){ + self.data.riskGuide=true; + }else{ + self.data.riskGuide = false; + } self.getArticleInfo(res.data.data.days) self.setUserInfo(res.data.data) babyCache[self.data.babyIndex] = res.data.data diff --git a/littleApp_child/utils/network_util.js b/littleApp_child/utils/network_util.js index f741896..1073d1a 100644 --- a/littleApp_child/utils/network_util.js +++ b/littleApp_child/utils/network_util.js @@ -2,7 +2,7 @@ // 测试用户‘花雪莲’,手机号15928512992,验证码666666 // 0测试环境 1正式环境 2演示环境 3衡水 -var Builing_Release_AppStore = 0 +var Builing_Release_AppStore = 1 // 获取服务器地址 function kServerBaseUrl() { switch (Builing_Release_AppStore) { @@ -24,7 +24,7 @@ function kServerBaseUrl() { * fail: 失败回调 类型function */ function _get(port, params, success, fail) { - console.log('---------------request_get-----------url:' + kServerBaseUrl() + port) + console.log('---------------request_get-----------url:== ' + getApp().globalData.token+' === ' + kServerBaseUrl() + port) wx.request({ url: kServerBaseUrl() + port, data: params, -- 1.8.3.1