Commit 73fe9ff1ecc5e34d38f01f1281f990319ead6e89

Authored by luoye
1 parent 52bf224294

bug

Showing 8 changed files with 81 additions and 44 deletions

littleApp_child/pages/CheckReport/CheckReport.js View file @ 73fe9ff
... ... @@ -38,7 +38,6 @@
38 38 isShowMore: function (e) {
39 39 var self = this
40 40 var index = e.currentTarget.dataset.index
41   - console.log(index)
42 41 if (index == 1) {
43 42 self.setData({
44 43 isShowOne: !self.data.isShowOne,
... ... @@ -46,7 +45,7 @@
46 45 isShowThree: false,
47 46 })
48 47 } if (index == 2) {
49   - if (!self.data.wzInfo.handl_suggest){
  48 + if (!self.data.wzInfo.handlSuggest){
50 49 return
51 50 }
52 51 self.setData({
... ... @@ -55,7 +54,7 @@
55 54 isShowThree: false,
56 55 })
57 56 } if (index == 3) {
58   - if (!self.data.wzInfo.guide_suggest) {
  57 + if (!self.data.wzInfo.guideSuggest) {
59 58 return
60 59 }
61 60 self.setData({
62 61  
... ... @@ -156,8 +155,10 @@
156 155 // 具体检查信息
157 156 networkUtil._get(api.wzXinxi, params, function (res) {
158 157 console.log('获取详细信息', res)
  158 + if (res.data.diagnose && res.data.diagnose.length > 0) {
  159 + res.data.diagnose = res.data.diagnose.split(",")
  160 + }
159 161 self.setData({
160   - list: res.data.list,
161 162 wzInfo: res.data
162 163 })
163 164 }, function (res) {
littleApp_child/pages/CheckReport/CheckReport.wxml View file @ 73fe9ff
... ... @@ -85,10 +85,12 @@
85 85 <label class="check_diagnosis_name">检查诊断</label>
86 86 <image class="icon_more" src="{{isShowOne==false ? '../../source/more_bottom.png': '../../source/more_top.png'}}"></image>
87 87 </view>
88   - <label wx:if="{{!isShowOne}}" class="check_diagnosis_content_1_line">{{wzInfo.diagnose[0]}}</label>
89   - <view wx:if="{{isShowOne}}" style="display:flex;width:100%">
90   - <label class="check_diagnosis_content_lines">{{wzInfo.diagnose}}</label>
91   - <label class="high_risk_bg">高危</label>
  88 + <label wx:if="{{wzInfo.highRisk == 1}}" class="high_risk_bg">高危</label>
  89 + <view class="check_diagnosis_bg">
  90 + <label wx:if="{{!isShowOne}}" class="check_diagnosis_content_1_line">{{wzInfo.diagnose[0]}}</label>
  91 + <view wx:if="{{isShowOne}}" style="display:flex;width:100%">
  92 + <label class="check_diagnosis_content_lines">{{wzInfo.diagnose}}</label>
  93 + </view>
92 94 </view>
93 95 </view>
94 96 <view class="check_diagnosis" style="{{isShowTwo==false ? 'background: #ffffff;border: 1px solid #E6E6E6;': 'background: #f9fffa;border: 1px solid #CEE2D5;'}}">
95 97  
... ... @@ -96,9 +98,9 @@
96 98 <label class="check_diagnosis_name">处理意见</label>
97 99 <image class="icon_more" src="{{isShowTwo==false ? '../../source/more_bottom.png': '../../source/more_top.png'}}"></image>
98 100 </view>
99   - <label wx:if="{{!isShowTwo}}" class="check_diagnosis_content_1_line">{{wzInfo.handl_suggest ? wzInfo.handl_suggest : '暂无处理意见'}}</label>
  101 + <label wx:if="{{!isShowTwo}}" class="check_diagnosis_content_1_line">{{wzInfo.handlSuggest ? wzInfo.handlSuggest : '暂无处理意见'}}</label>
100 102 <view wx:if="{{isShowTwo}}" style="display:flex;width:100%">
101   - <label class="check_diagnosis_content_lines">{{wzInfo.handl_suggest}}</label>
  103 + <label class="check_diagnosis_content_lines">{{wzInfo.handlSuggest}}</label>
102 104 </view>
103 105 </view>
104 106 <view class="check_diagnosis" style="{{isShowThree==false ? 'background: #ffffff;border: 1px solid #E6E6E6;': 'background: #f9fffa;border: 1px solid #CEE2D5;'}}">
105 107  
... ... @@ -106,10 +108,9 @@
106 108 <label class="check_diagnosis_name">指导意见</label>
107 109 <image class="icon_more" src="{{isShowThree==false ? '../../source/more_bottom.png': '../../source/more_top.png'}}"></image>
108 110 </view>
109   - <label wx:if="{{!isShowThree}}" class="check_diagnosis_content_1_line">{{wzInfo.guide_suggest}}</label>
  111 + <label wx:if="{{!isShowThree}}" class="check_diagnosis_content_1_line">{{wzInfo.guideSuggest ? wzInfo.guideSuggest : '暂无指导意见'}}</label>
110 112 <view wx:if="{{isShowThree}}" style="display:flex;width:100%">
111   - <label class="check_diagnosis_content_lines">{{wzInfo.guide_suggest}}</label>
112   -
  113 + <label class="check_diagnosis_content_lines">{{wzInfo.guideSuggest}}</label>
113 114 </view>
114 115 </view>
115 116  
littleApp_child/pages/CheckReport/CheckReport.wxss View file @ 73fe9ff
... ... @@ -282,6 +282,12 @@
282 282 margin-top: 13px;
283 283 }
284 284  
  285 +.check_diagnosis_bg {
  286 + /* background: rebeccapurple; */
  287 + margin-right: 55px;
  288 + min-height: 25px;
  289 +}
  290 +
285 291 .check_diagnosis_content_1_line {
286 292 font-family: PingFangSC-Regular;
287 293 font-size: 13px;
... ... @@ -294,7 +300,6 @@
294 300 text-overflow: ellipsis;
295 301 display: -webkit-box;
296 302 -webkit-line-clamp: 1;
297   -
298 303 -webkit-box-orient: vertical;
299 304 }
300 305  
301 306  
... ... @@ -305,7 +310,9 @@
305 310 margin-left: 10px;
306 311 padding-right: 10px;
307 312 width: calc(100% - 20px);
  313 +
308 314 }
  315 +
309 316 .high_risk_bg {
310 317 background: #e36767;
311 318 border-radius: 4px;
... ... @@ -316,5 +323,6 @@
316 323 margin-right: 10px;
317 324 width: 40px;
318 325 height: 20px;
  326 + float: right;
319 327 }
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js View file @ 73fe9ff
... ... @@ -88,7 +88,32 @@
88 88  
89 89 })
90 90 },
91   -
92   -
  91 + // 文章点赞
  92 + articleLike() {
  93 + console.log(e)
  94 + var self = this
  95 + // 已经点赞
  96 + if (self.data.knowledge.isLike == 1) {
  97 + networkUtil.showErrorToast('您已经点过赞啦')
  98 + return;
  99 + }
  100 + networkUtil._post(api.articleLike, { id: articleId }, function (res) {
  101 + console.log(res)
  102 + var art = self.data.knowledge
  103 + art.likeCount++
  104 + art.isLike = 1
  105 + self.setData({
  106 + knowledge: art
  107 + })
  108 + if (categoryIndex) {
  109 + // 更新首页数据
  110 + event.emit('likeChanged', { categoryIndex: categoryIndex, articleIdIndex: articleIdIndex });
  111 + } else {
  112 + event.emit('listLikeChanged', { categoryIndex: categoryIndex, articleIdIndex: articleIdIndex });
  113 + }
  114 + }, function (res) {
  115 + console.log(res)
  116 + })
  117 + }
93 118 })
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml View file @ 73fe9ff
... ... @@ -2,7 +2,7 @@
2 2 <view class="title_text">{{knowledge.title}}</view>
3 3  
4 4 <view class="zar_box" style="margin-left:8px;">
5   - <view class="zar_box">
  5 + <view class="zar_box" bindtap="articleLike">
6 6 <image class="zar_img" src="../../source/zar.png"></image>
7 7 <view class="content_zar">{{knowledge.likeCount ? knowledge.likeCount : 0}}</view>
8 8 </view>
littleApp_child/pages/home/home.js View file @ 73fe9ff
... ... @@ -42,7 +42,7 @@
42 42 if (app.globalData.token == null || app.globalData.token == '') {
43 43 this.toLogin()
44 44 } else {
45   - networkUtil.showLoading()
  45 +
46 46 this.homePage()
47 47 // 监听事件
48 48 event.on('likeChanged', this, function (data) {
49 49  
50 50  
51 51  
52 52  
... ... @@ -139,36 +139,37 @@
139 139 },
140 140 // 获取用户信息
141 141 getUserInfo() {
142   - console.log(app.globalData.userId)
143   - var self = this
144   - var param = { 'token': app.globalData.token }
145   - networkUtil._get(api.userInfo + app.globalData.userId[0], {}, function (res) {
146   - console.log('获取用户信息',res)
147   - app.globalData.days = res.data.data.days
148   - app.globalData.userInfo = res.data.data
149   - self.getArticleInfo(res.data.data.days)
150   - self.setData({
151   - userData: res.data.data
152   - })
153   - }, function (res) {
154   - networkUtil.showErrorToast(res.errormsg)
  142 + networkUtil.showLoading()
  143 + var self = this
  144 + var param = { 'token': app.globalData.token }
  145 + networkUtil._get(api.userInfo + app.globalData.userId[0], {}, function (res) {
  146 + console.log('获取用户信息',res)
  147 + app.globalData.days = res.data.data.days
  148 + app.globalData.userInfo = res.data.data
  149 + self.getArticleInfo(res.data.data.days)
  150 + self.setData({
  151 + userData: res.data.data
155 152 })
  153 + }, function (res) {
  154 + networkUtil.showErrorToast(res.errormsg)
  155 + })
156 156 },
157 157 getArticleInfo(days) {
158   - var self = this
159   - // 文章列表
160   - networkUtil._get(api.homeArtList, { page: 0, limit: 100, days: days }, function (res) {
161   - console.log('获取文章信息', res.data.list)
162   - app.globalData.artList = res.data.list
163   - self.setData({
164   - list: res.data.list
165   - })
166   - }, function (res) {
167   - wx.stopPullDownRefresh()
  158 + var self = this
  159 + // 文章列表
  160 + networkUtil._get(api.homeArtList, { page: 0, limit: 100, days: days }, function (res) {
  161 + console.log('获取文章信息', res.data.list)
  162 + app.globalData.artList = res.data.list
  163 + self.setData({
  164 + list: res.data.list
168 165 })
  166 + }, function (res) {
  167 + wx.stopPullDownRefresh()
  168 + })
169 169 },
170 170 // 文章点赞
171   - articleLike() {
  171 + articleLike(e) {
  172 + console.log(e)
172 173 var self = this
173 174 // 已经点赞
174 175 if (self.data.articleDetail.isLike == 1) {
littleApp_child/pages/home/home.wxml View file @ 73fe9ff
... ... @@ -71,8 +71,9 @@
71 71 <view class="article_content_bottomBar util_bottom_line">
72 72 <!-- <view class="article_content_bottomBar_labels">
73 73 </view> -->
74   - <view class="article_content_bottomBar_likes" bindtap="articleLike" data-categaryIndex="{{sectionIndex}}" data-artIndex="{{index}}">
75   - <image class="article_content_bottomBar_likes_icon" src="../../source/like.png"></image>
  74 + <!-- bindtap="articleLike" data-categaryIndex="{{sectionIndex}}" data-artIndex="{{index}}" -->
  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 77 <label class="article_content_bottomBar_likes_text">{{item.likeCount ? item.likeCount : 0}}</label>
77 78 </view>
78 79 </view>
littleApp_child/source/zanguo.png View file @ 73fe9ff

1.38 KB