diff --git a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js
index f3eb7a2..1210319 100644
--- a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js
+++ b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js
@@ -13,12 +13,12 @@ var isRefresh
Page({
data: {
list: [
- {zar:12, title: "title1", content: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }
- , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" }
- , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" }
- , { zar: 12,title: "title1", content: "content1", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }
- , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" }
- , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" }
+ { likeCount: 12, title: "title1", introduction: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }
+ , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" }
+ , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" }
+ , { likeCount: 12, title: "title1", introduction: "content1", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }
+ , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" }
+ , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" }
],
images: [
// 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
@@ -38,7 +38,7 @@ Page({
hasMore = true
isRefresh = false
- // this.requestData()
+ this.requestData()
},
diff --git a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml
index f647f71..f7cb94e 100644
--- a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml
+++ b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml
@@ -23,14 +23,14 @@
{{item.title}}
- {{item.content}}
+ {{item.introduction}}
- {{item.zar}}
+ {{item.likeCount}}
-
+
diff --git a/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js b/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js
index 044c7eb..c419c62 100644
--- a/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js
+++ b/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js
@@ -11,96 +11,96 @@ var isRefresh
Page({
- data: {
-
- knowledge: {time:"2017-8-7", zar: 12, title: "title1", content: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" },
- images: [
- 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
- 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
- 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
- ],
- titles: ["日常护理", "营养美食", "疾病护理", "亲子互动", "言传qq"],
- id:0,
- category:'',
- current_index:0,
- },
- onLoad: function (e) {
- this.data.id = e.id
- this.data.category = e.category
- // 数据初始化
- page = 1
- hasMore = true
- isRefresh = false
+ data: {
+
+ knowledge: { time: "2017-8-7", likeCount: 12, title: "title1", content: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" },
+ images: [
+ 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg',
+ 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg',
+ 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'
+ ],
+ titles: ["日常护理", "营养美食", "疾病护理", "亲子互动", "言传qq"],
+ id: 0,
+ category: '',
+ current_index: 0,
+ },
+ onLoad: function (e) {
+ this.data.id = e.id
+ this.data.category = e.category
+ // 数据初始化
+ page = 1
+ hasMore = true
+ isRefresh = false
+
+ // this.requestData()
+
+
+ },
+ onUnload: function () {
+
+ },
+ /*---------事件处理函数--------*/
+ bindViewTap: function () {
+ wx.navigateTo({
+ url: '../home/home'
+ })
+ },
+ // 加载更多
+ loadMore: function (e) {
+ if (!hasMore || isRefresh == true) {
+ return
+ }
+ page++
+
+ this.requestData()
+
+ },
+ // 下拉刷新回调接口
+ onPullDownRefresh: function () {
+ page = 1;
+ hasMore = true
+ // 网络请求,重新请求一遍数据
+ this.requestData();
+ },
+ myScroll: function (e) {
+ if (e.detail.scrollTop >= e.detail.scrollHeight - wx.getSystemInfoSync().windowHeight - 3) {
+ this.loadMore()
+ }
+ },
+ titleClick: function (e) {
+ console.log(e)
+ var index = e.currentTarget.dataset.index
+ this.setData({
+ current_index: index
+ })
+ },
+ /*---------自定义函数--------*/
+ requestData(id) {
+ var self = this
+ isRefresh = true
+ networkUtil.showLoading()
+ var param = { page: page, limit: 15, type: getApp().globalData.userInfo.status, categoryId: self.data.id }
+ networkUtil._get(api.articleList, param, function (res) {
+
+ isRefresh = false
+ var arr = []
+ if (page > 0) {// 加载更多模式
+ arr = self.data.list
+ }
+ if (res.data.data.length < 15) {
+ hasMore = false
+ }
+ arr = arr.concat(res.data.data)
+ var temp = self.data.category
+ self.setData({
+ list: arr,
+ hasMore: hasMore,
+ category: temp
+ })
+ }, function (res) {
+ isRefresh = false
+ })
+ },
+
- // this.requestData()
-
-
- },
- onUnload: function() {
-
- },
- /*---------事件处理函数--------*/
- bindViewTap: function() {
- wx.navigateTo({
- url: '../home/home'
- })
- },
- // 加载更多
- loadMore:function(e){
- if(!hasMore || isRefresh == true){
- return
- }
- page ++
-
- this.requestData()
-
- },
- // 下拉刷新回调接口
- onPullDownRefresh: function() {
- page = 1;
- hasMore = true
- // 网络请求,重新请求一遍数据
- this.requestData();
- },
- myScroll:function(e){
- if(e.detail.scrollTop >= e.detail.scrollHeight-wx.getSystemInfoSync().windowHeight - 3){
- this.loadMore()
- }
- },
- titleClick:function(e){
- console.log(e)
- var index = e.currentTarget.dataset.index
- this.setData({
- current_index:index
- })
- },
- /*---------自定义函数--------*/
- requestData(id){
- var self = this
- isRefresh = true
- networkUtil.showLoading()
- var param = {page:page,limit:15,type:getApp().globalData.userInfo.status,categoryId:self.data.id}
- networkUtil._get(api.articleList,param,function(res){
-
- isRefresh = false
- var arr = []
- if(page > 0) {// 加载更多模式
- arr = self.data.list
- }
- if(res.data.data.length < 15){
- hasMore = false
- }
- arr = arr.concat(res.data.data)
- var temp = self.data.category
- self.setData({
- list:arr,
- hasMore : hasMore,
- category : temp
- })
- },function(res){
- isRefresh = false
- })
- },
-
-
})
diff --git a/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml b/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml
index d2d73d5..d5a18ef 100644
--- a/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml
+++ b/littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml
@@ -4,7 +4,7 @@
- {{knowledge.zar}}
+ {{knowledge.likeCount}}
{{knowledge.time}}