Commit 9de91d0dc12adbaa78ab757fc9ed16ce04a72a8a
1 parent
8f0ecaa5a1
Exists in
master
and in
2 other branches
no message
Showing 4 changed files with 102 additions and 102 deletions
littleApp_child/pages/childcare_knowledge/childcare_knowledge.js
View file @
9de91d0
... | ... | @@ -13,12 +13,12 @@ |
13 | 13 | Page({ |
14 | 14 | data: { |
15 | 15 | list: [ |
16 | - {zar:12, title: "title1", content: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" } | |
17 | - , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" } | |
18 | - , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" } | |
19 | - , { zar: 12,title: "title1", content: "content1", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" } | |
20 | - , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" } | |
21 | - , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" } | |
16 | + { likeCount: 12, title: "title1", introduction: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" } | |
17 | + , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" } | |
18 | + , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" } | |
19 | + , { likeCount: 12, title: "title1", introduction: "content1", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" } | |
20 | + , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" } | |
21 | + , { likeCount: 12, title: "title2", introduction: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" } | |
22 | 22 | ], |
23 | 23 | images: [ |
24 | 24 | // 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', |
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | hasMore = true |
39 | 39 | isRefresh = false |
40 | 40 | |
41 | - // this.requestData() | |
41 | + this.requestData() | |
42 | 42 | |
43 | 43 | |
44 | 44 | }, |
littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml
View file @
9de91d0
... | ... | @@ -23,14 +23,14 @@ |
23 | 23 | <view class="content_item"> |
24 | 24 | <view style="margin-left:15px;margin-right:75px;"> |
25 | 25 | <view class="content_title">{{item.title}}</view> |
26 | - <view class="content_content">{{item.content}}</view> | |
26 | + <view class="content_content">{{item.introduction}}</view> | |
27 | 27 | <view class="zar_box"> |
28 | 28 | <image class="zar_img" src="../../source/zar.png"></image> |
29 | - <view class="content_zar">{{item.zar}}</view> | |
29 | + <view class="content_zar">{{item.likeCount}}</view> | |
30 | 30 | </view> |
31 | 31 | |
32 | 32 | </view> |
33 | - <image class="content_image" src="{{item.image}}"></image> | |
33 | + <image class="content_image" src="{{item.image.medium}}"></image> | |
34 | 34 | </view> |
35 | 35 | <view class="home__list-item__bottom"></view> |
36 | 36 | </navigator> |
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js
View file @
9de91d0
... | ... | @@ -11,97 +11,97 @@ |
11 | 11 | |
12 | 12 | |
13 | 13 | Page({ |
14 | - data: { | |
15 | - | |
16 | - knowledge: {time:"2017-8-7", zar: 12, title: "title1", content: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }, | |
17 | - images: [ | |
18 | - 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', | |
19 | - 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', | |
20 | - 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' | |
21 | - ], | |
22 | - titles: ["日常护理", "营养美食", "疾病护理", "亲子互动", "言传qq"], | |
23 | - id:0, | |
24 | - category:'', | |
25 | - current_index:0, | |
26 | - }, | |
27 | - onLoad: function (e) { | |
28 | - this.data.id = e.id | |
29 | - this.data.category = e.category | |
30 | - // 数据初始化 | |
31 | - page = 1 | |
32 | - hasMore = true | |
33 | - isRefresh = false | |
14 | + data: { | |
34 | 15 | |
35 | - // this.requestData() | |
36 | - | |
37 | - | |
38 | - }, | |
39 | - onUnload: function() { | |
40 | - | |
41 | - }, | |
42 | - /*---------事件处理函数--------*/ | |
43 | - bindViewTap: function() { | |
44 | - wx.navigateTo({ | |
45 | - url: '../home/home' | |
46 | - }) | |
47 | - }, | |
48 | - // 加载更多 | |
49 | - loadMore:function(e){ | |
50 | - if(!hasMore || isRefresh == true){ | |
51 | - return | |
52 | - } | |
53 | - page ++ | |
54 | - | |
55 | - this.requestData() | |
56 | - | |
57 | - }, | |
58 | - // 下拉刷新回调接口 | |
59 | - onPullDownRefresh: function() { | |
60 | - page = 1; | |
61 | - hasMore = true | |
62 | - // 网络请求,重新请求一遍数据 | |
63 | - this.requestData(); | |
64 | - }, | |
65 | - myScroll:function(e){ | |
66 | - if(e.detail.scrollTop >= e.detail.scrollHeight-wx.getSystemInfoSync().windowHeight - 3){ | |
67 | - this.loadMore() | |
68 | - } | |
69 | - }, | |
70 | - titleClick:function(e){ | |
71 | - console.log(e) | |
72 | - var index = e.currentTarget.dataset.index | |
73 | - this.setData({ | |
74 | - current_index:index | |
75 | - }) | |
76 | - }, | |
77 | - /*---------自定义函数--------*/ | |
78 | - requestData(id){ | |
79 | - var self = this | |
80 | - isRefresh = true | |
81 | - networkUtil.showLoading() | |
82 | - var param = {page:page,limit:15,type:getApp().globalData.userInfo.status,categoryId:self.data.id} | |
83 | - networkUtil._get(api.articleList,param,function(res){ | |
84 | - | |
85 | - isRefresh = false | |
86 | - var arr = [] | |
87 | - if(page > 0) {// 加载更多模式 | |
88 | - arr = self.data.list | |
89 | - } | |
90 | - if(res.data.data.length < 15){ | |
91 | - hasMore = false | |
92 | - } | |
93 | - arr = arr.concat(res.data.data) | |
94 | - var temp = self.data.category | |
95 | - self.setData({ | |
96 | - list:arr, | |
97 | - hasMore : hasMore, | |
98 | - category : temp | |
99 | - }) | |
100 | - },function(res){ | |
101 | - isRefresh = false | |
102 | - }) | |
103 | - }, | |
104 | - | |
105 | - | |
16 | + knowledge: { time: "2017-8-7", likeCount: 12, title: "title1", content: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" }, | |
17 | + images: [ | |
18 | + 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', | |
19 | + 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', | |
20 | + 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' | |
21 | + ], | |
22 | + titles: ["日常护理", "营养美食", "疾病护理", "亲子互动", "言传qq"], | |
23 | + id: 0, | |
24 | + category: '', | |
25 | + current_index: 0, | |
26 | + }, | |
27 | + onLoad: function (e) { | |
28 | + this.data.id = e.id | |
29 | + this.data.category = e.category | |
30 | + // 数据初始化 | |
31 | + page = 1 | |
32 | + hasMore = true | |
33 | + isRefresh = false | |
34 | + | |
35 | + // this.requestData() | |
36 | + | |
37 | + | |
38 | + }, | |
39 | + onUnload: function () { | |
40 | + | |
41 | + }, | |
42 | + /*---------事件处理函数--------*/ | |
43 | + bindViewTap: function () { | |
44 | + wx.navigateTo({ | |
45 | + url: '../home/home' | |
46 | + }) | |
47 | + }, | |
48 | + // 加载更多 | |
49 | + loadMore: function (e) { | |
50 | + if (!hasMore || isRefresh == true) { | |
51 | + return | |
52 | + } | |
53 | + page++ | |
54 | + | |
55 | + this.requestData() | |
56 | + | |
57 | + }, | |
58 | + // 下拉刷新回调接口 | |
59 | + onPullDownRefresh: function () { | |
60 | + page = 1; | |
61 | + hasMore = true | |
62 | + // 网络请求,重新请求一遍数据 | |
63 | + this.requestData(); | |
64 | + }, | |
65 | + myScroll: function (e) { | |
66 | + if (e.detail.scrollTop >= e.detail.scrollHeight - wx.getSystemInfoSync().windowHeight - 3) { | |
67 | + this.loadMore() | |
68 | + } | |
69 | + }, | |
70 | + titleClick: function (e) { | |
71 | + console.log(e) | |
72 | + var index = e.currentTarget.dataset.index | |
73 | + this.setData({ | |
74 | + current_index: index | |
75 | + }) | |
76 | + }, | |
77 | + /*---------自定义函数--------*/ | |
78 | + requestData(id) { | |
79 | + var self = this | |
80 | + isRefresh = true | |
81 | + networkUtil.showLoading() | |
82 | + var param = { page: page, limit: 15, type: getApp().globalData.userInfo.status, categoryId: self.data.id } | |
83 | + networkUtil._get(api.articleList, param, function (res) { | |
84 | + | |
85 | + isRefresh = false | |
86 | + var arr = [] | |
87 | + if (page > 0) {// 加载更多模式 | |
88 | + arr = self.data.list | |
89 | + } | |
90 | + if (res.data.data.length < 15) { | |
91 | + hasMore = false | |
92 | + } | |
93 | + arr = arr.concat(res.data.data) | |
94 | + var temp = self.data.category | |
95 | + self.setData({ | |
96 | + list: arr, | |
97 | + hasMore: hasMore, | |
98 | + category: temp | |
99 | + }) | |
100 | + }, function (res) { | |
101 | + isRefresh = false | |
102 | + }) | |
103 | + }, | |
104 | + | |
105 | + | |
106 | 106 | }) |
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml
View file @
9de91d0
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <view class="zar_box" style="margin-left:8px;"> |
5 | 5 | <view class="zar_box"> |
6 | 6 | <image class="zar_img" src="../../source/zar.png"></image> |
7 | - <view class="content_zar">{{knowledge.zar}}</view> | |
7 | + <view class="content_zar">{{knowledge.likeCount}}</view> | |
8 | 8 | </view> |
9 | 9 | <view class="content_time">{{knowledge.time}}</view> |
10 | 10 | </view> |