Commit 3e11f42d332c4c916e2191bd008837b4a5fc63ca

Authored by luoye
1 parent de484b386c

点赞

Showing 8 changed files with 12 additions and 13 deletions

littleApp_child/pages/SearchPage/SearchPage.wxml View file @ 3e11f42
... ... @@ -30,7 +30,7 @@
30 30 <view class="content_content">{{item.introduction}}</view>
31 31 <!-- <view class="content_content">123123,nslkajd;ajsd;jsa;ldjaslkjdlksajdlksjsaklj{{item.content}}</view> -->
32 32 <view class="zar_box">
33   - <image class="zar_img" src="../../source/zar.png"></image>
  33 + <image class="zar_img" src="../../source/{{item.isLike == 1 ? 'zanguo.png' : 'like.png'}}"></image>
34 34 <view class="content_zar">{{item.likeCount ? item.likeCount : 0}}</view>
35 35 </view>
36 36 </view>
littleApp_child/pages/articleLists/articleLists.wxml View file @ 3e11f42
... ... @@ -22,7 +22,7 @@
22 22 <view class="content_title">{{item.title}}</view>
23 23 <view class="content_content">{{item.introduction}}</view>
24 24 <view class="zar_box">
25   - <image class="zar_img" src="../../source/zar.png"></image>
  25 + <image class="zar_img" src="../../source/{{item.isLike == 1 ? 'zanguo.png' : 'like.png'}}"></image>
26 26 <view class="content_zar">{{item.likeCount ? item.likeCount : 0}}</view>
27 27 </view>
28 28 </view>
littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml View file @ 3e11f42
... ... @@ -28,7 +28,7 @@
28 28 <view class="content_title">{{item.title}}</view>
29 29 <view class="content_content">{{item.introduction}}</view>
30 30 <view class="zar_box">
31   - <image class="zar_img" src="../../source/zar.png"></image>
  31 + <image class="zar_img" src="../../source/like.png"></image>
32 32 <view class="content_zar">{{item.likeCount}}</view>
33 33 </view>
34 34  
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js View file @ 3e11f42
... ... @@ -90,14 +90,13 @@
90 90 },
91 91 // 文章点赞
92 92 articleLike() {
93   - console.log(e)
94 93 var self = this
95 94 // 已经点赞
96 95 if (self.data.knowledge.isLike == 1) {
97 96 networkUtil.showErrorToast('您已经点过赞啦')
98 97 return;
99 98 }
100   - networkUtil._post(api.articleLike, { id: articleId }, function (res) {
  99 + networkUtil._post(api.articleLike, { id: self.data.knowledge.id}, function (res) {
101 100 console.log(res)
102 101 var art = self.data.knowledge
103 102 art.likeCount++
... ... @@ -105,12 +104,12 @@
105 104 self.setData({
106 105 knowledge: art
107 106 })
108   - if (categoryIndex) {
109   - // 更新首页数据
110   - event.emit('likeChanged', { categoryIndex: categoryIndex, articleIdIndex: articleIdIndex });
111   - } else {
112   - event.emit('listLikeChanged', { categoryIndex: categoryIndex, articleIdIndex: articleIdIndex });
113   - }
  107 + // if (categoryIndex) {
  108 + // // 更新首页数据
  109 + // event.emit('likeChanged', { categoryIndex: categoryIndex, articleIdIndex: articleIdIndex });
  110 + // } else {
  111 + // event.emit('listLikeChanged', { categoryIndex: categoryIndex, articleIdIndex: articleIdIndex });
  112 + // }
114 113 }, function (res) {
115 114 console.log(res)
116 115 })
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml View file @ 3e11f42
... ... @@ -3,7 +3,7 @@
3 3  
4 4 <view class="zar_box" style="margin-left:8px;">
5 5 <view class="zar_box" bindtap="articleLike">
6   - <image class="zar_img" src="../../source/zar.png"></image>
  6 + <image class="zar_img" src="../../source/{{knowledge.isLike == 1 ? 'zanguo.png' : 'like.png'}}"></image>
7 7 <view class="content_zar">{{knowledge.likeCount ? knowledge.likeCount : 0}}</view>
8 8 </view>
9 9 <view class="content_time">{{knowledge.time}}</view>
littleApp_child/pages/home/home.wxml View file @ 3e11f42
... ... @@ -73,7 +73,7 @@
73 73 </view> -->
74 74 <!-- bindtap="articleLike" data-categaryIndex="{{sectionIndex}}" data-artIndex="{{index}}" -->
75 75 <view class="article_content_bottomBar_likes">
76   - <image class="article_content_bottomBar_likes_icon" src="../../source/{{item.likeCount == 0 ? 'zanguo.png' : 'like.png'}}"></image>
  76 + <image class="article_content_bottomBar_likes_icon" src="../../source/{{item.isLike == 1 ? 'zanguo.png' : 'like.png'}}"></image>
77 77 <label class="article_content_bottomBar_likes_text">{{item.likeCount ? item.likeCount : 0}}</label>
78 78 </view>
79 79 </view>
littleApp_child/source/zanguo.png View file @ 3e11f42

1.38 KB | W: | H:

748 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
littleApp_child/source/zar.png View file @ 3e11f42

711 Bytes