Commit 921d144cfc54e39dceeb891a974c842b89719075
Exists in
master
and in
2 other branches
Merge branch 'master' of https://git.healthbaby.com.cn/luoye/littleapp_child
Showing 11 changed files
- littleApp_child/pages/CheckReport/CheckReport.js
- littleApp_child/pages/CheckReport/CheckReport.wxml
- littleApp_child/pages/CheckReport/CheckReport.wxss
- littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js
- littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml
- littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxss
- littleApp_child/pages/home/home.wxml
- littleApp_child/pages/home/home.wxss
- littleApp_child/pages/hospitalList/hospitalList.js
- littleApp_child/utils/numberUtil.js
- littleApp_child/utils/util_UI.wxss
littleApp_child/pages/CheckReport/CheckReport.js
View file @
921d144
| 1 | 1 | |
| 2 | 2 | // 网络请求工具类 |
| 3 | 3 | var networkUtil = require('../../utils/network_util.js') |
| 4 | +var numUtil = require('../../utils/numberUtil.js') | |
| 4 | 5 | var api = require('../../utils/apiFile.js') |
| 5 | 6 | var util = require('../../utils/util.js') |
| 6 | 7 | var event = require('../../utils/event.js') |
| ... | ... | @@ -201,6 +202,17 @@ |
| 201 | 202 | subscribe = true |
| 202 | 203 | subscribeDetail.checkhospital = res.data.data.checkhospital |
| 203 | 204 | subscribeDetail.nextcheck = res.data.data.nextcheck |
| 205 | + // 距离下次检查日期间隔 | |
| 206 | + subscribeDetail.nextInterval = '-' | |
| 207 | + var next = new Date(res.data.data.nextcheck) | |
| 208 | + var nextInterval = numUtil.calculateTimeInterval(new Date().getTime(), next.getTime()) | |
| 209 | + if (nextInterval == 0){ | |
| 210 | + subscribeDetail.nextInterval = '今天' | |
| 211 | + } else if (nextInterval < 0){ | |
| 212 | + subscribeDetail.nextInterval = '已逾期' | |
| 213 | + } else { | |
| 214 | + subscribeDetail.nextInterval = '剩' + nextInterval + '天' | |
| 215 | + } | |
| 204 | 216 | } |
| 205 | 217 | self.setData({ |
| 206 | 218 | todayInfo: res.data.data, |
littleApp_child/pages/CheckReport/CheckReport.wxml
View file @
921d144
| ... | ... | @@ -76,7 +76,6 @@ |
| 76 | 76 | <view class="check_result_doctoe_line"> |
| 77 | 77 | <view class="check_result_doctoe_line1"> |
| 78 | 78 | <label class="docotr_name">{{todayInfo.doctorname ? todayInfo.doctorname : '-'}}</label> |
| 79 | - <label class="docotr_type">/儿童门诊</label> | |
| 80 | 79 | </view> |
| 81 | 80 | </view> |
| 82 | 81 | <view class="check_diagnosis" style="{{isShowOne==false ? 'background: #ffffff;border: 1px solid #E6E6E6;': 'background: #f9fffa;border: 1px solid #CEE2D5;'}}"> |
| ... | ... | @@ -129,10 +128,10 @@ |
| 129 | 128 | <label>预约时间:</label> |
| 130 | 129 | <label class="mask_subscribe_content_text">{{subscribeDetails.nextcheck}}</label> |
| 131 | 130 | </view> |
| 132 | - <!-- <view class="mask_subscribe_office"> | |
| 133 | - <label>检查医生:</label> | |
| 134 | - <label class="mask_subscribe_content_text">{{todayInfo.doctorname ? todayInfo.doctorname : '-'}}</label> | |
| 135 | - </view> --> | |
| 131 | + <view class="mask_subscribe_office"> | |
| 132 | + <label>距预约时间:</label> | |
| 133 | + <label class="mask_subscribe_content_text">{{subscribeDetails.nextInterval}}</label> | |
| 134 | + </view> | |
| 136 | 135 | <view class="mask_subscribe_hospital"> |
| 137 | 136 | <label>医院名称:</label> |
| 138 | 137 | <label class="mask_subscribe_content_text">{{subscribeDetails.checkhospital}}</label> |
littleApp_child/pages/CheckReport/CheckReport.wxss
View file @
921d144
| ... | ... | @@ -233,13 +233,6 @@ |
| 233 | 233 | color: #333; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | -.docotr_type { | |
| 237 | - font-family: PingFangSC-Regular; | |
| 238 | - font-size: 14px; | |
| 239 | - color: #888; | |
| 240 | - margin-left: 3px; | |
| 241 | -} | |
| 242 | - | |
| 243 | 236 | .check_result_time { |
| 244 | 237 | font-family: PingFangSC-Regular; |
| 245 | 238 | font-size: 14px; |
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.js
View file @
921d144
| ... | ... | @@ -80,6 +80,8 @@ |
| 80 | 80 | networkUtil._get(api.articles + '/' + id, {}, function (res) { |
| 81 | 81 | console.log('数据-----',res) |
| 82 | 82 | res.data.content = util.convertHtmlToText(res.data.content) |
| 83 | + var date = new Date(res.data.created * 1000) | |
| 84 | + res.data.time = date.getFullYear() + '年' + (date.getMonth() + 1) + '月' + date.getDate() + '日 ' + date.getHours() + ':' + date.getMinutes() | |
| 83 | 85 | self.setData({ |
| 84 | 86 | knowledge: res.data, |
| 85 | 87 | swiperHeight: wx.getSystemInfoSync().windowWidth * 0.55 |
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxml
View file @
921d144
| 1 | 1 | <view class="main"> |
| 2 | 2 | <view class="title_text">{{knowledge.title}}</view> |
| 3 | - | |
| 4 | - <view class="zar_box" style="margin-left:8px;" wx:if="{{knowledge}}"> | |
| 5 | - <view class="zar_box" bindtap="articleLike"> | |
| 6 | - <image class="zar_img" src="../../source/{{knowledge.isLike == 1 ? 'zanguo.png' : 'like.png'}}"></image> | |
| 7 | - <view class="content_zar">{{knowledge.likeCount ? knowledge.likeCount : 0}}</view> | |
| 8 | - </view> | |
| 9 | - <view class="content_time">{{knowledge.time}}</view> | |
| 3 | + <view class="art_labels"> | |
| 4 | + <view class="article_label">啦啦</view> | |
| 5 | + <view class="article_label">啦啦</view> | |
| 6 | + <view class="article_label">啦啦</view> | |
| 7 | + </view> | |
| 8 | + <view class="zar_box" style="margin-left:8px;" wx:if="{{knowledge}}"> | |
| 9 | + <view class="zar_box" bindtap="articleLike"> | |
| 10 | + <image class="zar_img" src="../../source/{{knowledge.isLike == 1 ? 'zanguo.png' : 'like.png'}}"></image> | |
| 11 | + <view class="content_zar">{{knowledge.likeCount ? knowledge.likeCount : 0}}</view> | |
| 10 | 12 | </view> |
| 13 | + <view class="content_time">{{knowledge.time}}</view> | |
| 14 | + </view> | |
| 11 | 15 | |
| 12 | 16 | <swiper style="height:{{swiperHeight}}px" hidden="{{knowledge.image ? false : true}}" class="swiper" indicator-dots="true" indicator-active-color="#ffffff"> |
| 13 | 17 | <block wx:for="{{[knowledge.image]}}"> |
littleApp_child/pages/childcare_knowledge_detail/childcare_knowledge_detail.wxss
View file @
921d144
| ... | ... | @@ -17,6 +17,11 @@ |
| 17 | 17 | margin-right: 10px; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | +.art_labels { | |
| 21 | + display: flex; | |
| 22 | + margin-left: 10px; | |
| 23 | +} | |
| 24 | + | |
| 20 | 25 | .home__list-item { |
| 21 | 26 | position: relative; |
| 22 | 27 | background: white; |
| 23 | 28 | |
| ... | ... | @@ -42,13 +47,9 @@ |
| 42 | 47 | .content_time { |
| 43 | 48 | font-family: PingFangSC-Regular; |
| 44 | 49 | font-size: 10px; |
| 45 | - margin-top: 3px; | |
| 50 | + margin-top: 5px; | |
| 46 | 51 | color: #c8c6c6; |
| 47 | - display: -webkit-box; | |
| 48 | - -webkit-box-orient: vertical; | |
| 49 | - -webkit-line-clamp: 2; | |
| 50 | - margin-left: 20px; | |
| 51 | - overflow: hidden; | |
| 52 | + margin-left: 14px; | |
| 52 | 53 | } |
| 53 | 54 | |
| 54 | 55 | .content_content { |
littleApp_child/pages/home/home.wxml
View file @
921d144
| ... | ... | @@ -11,7 +11,11 @@ |
| 11 | 11 | <!--头像--> |
| 12 | 12 | <image class="avatar" bindtap="tapAvatar" src="{{userData.avatar.medium ? userData.avatar.medium : ''}}" background-size="cover"></image> |
| 13 | 13 | <!--用户名--> |
| 14 | - <text class="userName">{{userData.username}}</text> | |
| 14 | + <view class="top_name"> | |
| 15 | + <view class="userName userName_selected">{{userData.username}}</view> | |
| 16 | + <view class="top_name_line"></view> | |
| 17 | + <view class="userName">{{userData.username}}</view> | |
| 18 | + </view> | |
| 15 | 19 | <!--下方黑色横条--> |
| 16 | 20 | <view class="infoBar"> |
| 17 | 21 | <view class="infoView"> |
| 18 | 22 | |
| ... | ... | @@ -69,13 +73,15 @@ |
| 69 | 73 | <label class="article_content_text">{{item.introduction}}</label> |
| 70 | 74 | <image class="article_content_image" mode="aspectFill" src="{{item.image.medium}}"></image> |
| 71 | 75 | <view class="article_content_bottomBar util_bottom_line"> |
| 72 | - <!-- <view class="article_content_bottomBar_labels"> | |
| 73 | - </view> --> | |
| 74 | 76 | <!-- bindtap="articleLike" data-categaryIndex="{{sectionIndex}}" data-artIndex="{{index}}" --> |
| 75 | 77 | <view class="article_content_bottomBar_likes" catchtap="articleLike" data-isLike="{{item.isLike}}" data-artId="{{item.id}}" data-categaryIndex="{{sectionIndex}}" data-artIndex="{{index}}"> |
| 76 | 78 | <image class="article_content_bottomBar_likes_icon" src="../../source/{{item.isLike == 1 ? 'zanguo.png' : 'like.png'}}"></image> |
| 77 | 79 | <label class="article_content_bottomBar_likes_text">{{item.likeCount ? item.likeCount : 0}}</label> |
| 78 | 80 | </view> |
| 81 | + <view class="article_content_bottomBar_labels"> | |
| 82 | + <view catchtap="" data-isLike="{{item.isLike}}" style="float: right" class="article_label">什么东东</view> | |
| 83 | + <view class="article_label" style="float: right">什么东东啊</view> | |
| 84 | + </view> | |
| 79 | 85 | </view> |
| 80 | 86 | </navigator> |
| 81 | 87 | </block> |
littleApp_child/pages/home/home.wxss
View file @
921d144
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | /*顶部模块*/ |
| 6 | 6 | .TopBar { |
| 7 | 7 | width:100%; |
| 8 | - height:202px; | |
| 8 | + height:212px; | |
| 9 | 9 | background: #48C17B; |
| 10 | 10 | position: relative; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | |
| ... | ... | @@ -37,15 +37,37 @@ |
| 37 | 37 | box-shadow: 0 2px 4px 0 rgba(186,70,70,0.50); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -.userName { | |
| 41 | - font-size: 14px; | |
| 42 | - font-weight: bold; | |
| 43 | - display: block; | |
| 40 | +.top_name { | |
| 41 | + color: white; | |
| 42 | + font-size: 15px; | |
| 43 | + display: flex; | |
| 44 | 44 | top: 100px; |
| 45 | + width: 100%; | |
| 45 | 46 | position: absolute; |
| 46 | 47 | /*居中*/ |
| 47 | - left: 50%; | |
| 48 | - transform: translateX(-50%); | |
| 48 | + justify-content: center; | |
| 49 | + align-items: center; | |
| 50 | +} | |
| 51 | + | |
| 52 | +.top_name_line { | |
| 53 | + background: white; | |
| 54 | + height: 1px; | |
| 55 | + width: 28px; | |
| 56 | +} | |
| 57 | + | |
| 58 | +.userName { | |
| 59 | + padding: 2.5px 5px 2.5px 5px; | |
| 60 | +} | |
| 61 | + | |
| 62 | +.userName_selected { | |
| 63 | + background: white; | |
| 64 | + border-radius: 4px; | |
| 65 | + color: #48C17B; | |
| 66 | +} | |
| 67 | + | |
| 68 | +.userName_normal { | |
| 69 | + background: #48C17B; | |
| 70 | + border-radius: 4px; | |
| 49 | 71 | color: white; |
| 50 | 72 | } |
| 51 | 73 | |
| ... | ... | @@ -192,7 +214,7 @@ |
| 192 | 214 | } |
| 193 | 215 | /* 文章ne内容背景 */ |
| 194 | 216 | .article_content { |
| 195 | - height: 115px; | |
| 217 | + height: 135px; | |
| 196 | 218 | } |
| 197 | 219 | /* 内容标题 */ |
| 198 | 220 | .article_content_title { |
| 199 | 221 | |
| 200 | 222 | |
| 201 | 223 | |
| 202 | 224 | |
| ... | ... | @@ -229,22 +251,24 @@ |
| 229 | 251 | margin-right: 11px; |
| 230 | 252 | width: 74px; |
| 231 | 253 | height: 74px; |
| 232 | - transform: translateY(-74px); | |
| 254 | + transform: translateY(-74px); | |
| 233 | 255 | } |
| 234 | 256 | /* 点赞 */ |
| 235 | 257 | .article_content_bottomBar { |
| 236 | - height: 28px; | |
| 258 | + height: 38px; | |
| 259 | + width: 100%; | |
| 260 | + margin-top: 10px; | |
| 237 | 261 | } |
| 238 | 262 | |
| 239 | 263 | .article_content_bottomBar_labels { |
| 240 | - float: left; | |
| 264 | + float: right; | |
| 241 | 265 | height: 100%; |
| 242 | - width: 50px; | |
| 266 | + transform: translateX(85px); | |
| 243 | 267 | } |
| 244 | 268 | |
| 245 | 269 | .article_content_bottomBar_likes { |
| 246 | - float: left; | |
| 247 | - width: 50px; | |
| 270 | + float: left; | |
| 271 | + width: 100px; | |
| 248 | 272 | margin-left: 10px; |
| 249 | 273 | } |
| 250 | 274 |
littleApp_child/pages/hospitalList/hospitalList.js
View file @
921d144
| ... | ... | @@ -20,76 +20,6 @@ |
| 20 | 20 | onLoad: function () { |
| 21 | 21 | networkUtil.showLoading() |
| 22 | 22 | this.getUserLocation() |
| 23 | - }, | |
| 24 | - | |
| 25 | - /*---------交互---------*/ | |
| 26 | - //事件处理函数 | |
| 27 | - bindViewTap: function() { | |
| 28 | - wx.navigateTo({ | |
| 29 | - url: '../home/home' | |
| 30 | - }) | |
| 31 | - }, | |
| 32 | - // 加载更多 | |
| 33 | - loadMore:function(e){ | |
| 34 | - if(!hasMore){ | |
| 35 | - return | |
| 36 | - } | |
| 37 | - page ++ | |
| 38 | - networkUtil.showLoading() | |
| 39 | - this.requestData() | |
| 40 | - }, | |
| 41 | - // 下拉刷新回调接口 | |
| 42 | - onPullDownRefresh: function() { | |
| 43 | - page = 0; | |
| 44 | - hasMore = true | |
| 45 | - // 网络请求,重新请求一遍数据 | |
| 46 | - this.requestData(); | |
| 47 | - }, | |
| 48 | - /*---------自定义函数--------*/ | |
| 49 | - // 获取地理位置 | |
| 50 | - getUserLocation(){ | |
| 51 | - var self = this | |
| 52 | - wx.getLocation({ | |
| 53 | - type: 'wgs84', // 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 | |
| 54 | - success: function(res){ | |
| 55 | - // success | |
| 56 | - console.log(res) | |
| 57 | - latitude = res.latitude | |
| 58 | - longitude = res.longitude | |
| 59 | - self.requestData() | |
| 60 | - }, | |
| 61 | - fail: function(res) { | |
| 62 | - // fail | |
| 63 | - console.log(res) | |
| 64 | - self.requestData() | |
| 65 | - }, | |
| 66 | - complete: function() { | |
| 67 | - // complete | |
| 68 | - } | |
| 69 | - }) | |
| 70 | - }, | |
| 71 | - // 获取信息 | |
| 72 | - requestData(){ | |
| 73 | - var self = this | |
| 74 | - var param = {page:page,limit:15,lat:latitude,lng:longitude} | |
| 75 | - | |
| 76 | - networkUtil._get(api.hospitalList,param,function(res){ | |
| 77 | - console.log(res) | |
| 78 | - var arr = [] | |
| 79 | - if(page > 0) {// 加载更多模式 | |
| 80 | - arr = self.data.list | |
| 81 | - } | |
| 82 | - if(res.data.list.length < 15){ | |
| 83 | - hasMore = false | |
| 84 | - } | |
| 85 | - arr = arr.concat(res.data.list) | |
| 86 | - self.setData({ | |
| 87 | - list:arr, | |
| 88 | - hasMore : hasMore | |
| 89 | - }) | |
| 90 | - },function(res){ | |
| 91 | - console.log(res) | |
| 92 | - }) | |
| 93 | - }, | |
| 23 | + } | |
| 94 | 24 | }) |
littleApp_child/utils/numberUtil.js
View file @
921d144
| ... | ... | @@ -423,14 +423,21 @@ |
| 423 | 423 | |
| 424 | 424 | |
| 425 | 425 | module.exports = { |
| 426 | + // 判断是不是手机号 | |
| 426 | 427 | IsTelPhoneNumber : IsTelPhoneNumber, |
| 428 | + // 计算孕周 | |
| 427 | 429 | calculateGestationalWeeks : calculateGestationalWeeks, |
| 430 | + // 计算时间间隔 | |
| 428 | 431 | calculateTimeInterval : calculateTimeInterval, |
| 432 | + // 高危等级 | |
| 429 | 433 | getRiskColorWithLevel : getRiskColorWithLevel, |
| 434 | + // 计算孕周余天 | |
| 430 | 435 | calculateGestationalWeekDay : calculateGestationalWeekDay, |
| 431 | 436 | home_getRiskInfo : home_getRiskInfo, |
| 437 | + | |
| 432 | 438 | healthRating_getRiskInfo : healthRating_getRiskInfo, |
| 433 | 439 | DateAdd : DateAdd, |
| 440 | + // 保留一位小数 | |
| 434 | 441 | toDecimal: toDecimal, |
| 435 | 442 | getMonthAllDayWithDate: getMonthAllDayWithDate, |
| 436 | 443 | getLatestWeek: getLatestWeek, |
littleApp_child/utils/util_UI.wxss
View file @
921d144
| ... | ... | @@ -134,7 +134,7 @@ |
| 134 | 134 | border-radius: 100px; |
| 135 | 135 | width: 160px; |
| 136 | 136 | height: 32px; |
| 137 | - margin-top: 80px; | |
| 137 | + margin-top: 60px; | |
| 138 | 138 | text-align: center; |
| 139 | 139 | margin-left: calc(50% - 80px); |
| 140 | 140 | line-height: 32px; |
| ... | ... | @@ -170,4 +170,13 @@ |
| 170 | 170 | margin-left: calc(50% - 80px); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | + /* 标签 */ | |
| 174 | +.article_label { | |
| 175 | + margin-right: 17px; | |
| 176 | + font-size: 12px; | |
| 177 | + color: #58A478; | |
| 178 | + padding: 5px; | |
| 179 | + background: #F2FDF7; | |
| 180 | + border-radius: 2px; | |
| 181 | +} |