From 618936ac2706afda9ba6540c8a2397c4e18b284a Mon Sep 17 00:00:00 2001
From: luoye <397379429@qq.com>
Date: Tue, 8 Aug 2017 16:11:15 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=94=B9=E5=8A=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
littleApp_child/pages/home/home.js | 20 +++++++++----
littleApp_child/pages/home/home.wxml | 56 +++++++++++++++++++-----------------
littleApp_child/pages/home/home.wxss | 16 ++++++-----
3 files changed, 54 insertions(+), 38 deletions(-)
diff --git a/littleApp_child/pages/home/home.js b/littleApp_child/pages/home/home.js
index 826f836..40146e8 100644
--- a/littleApp_child/pages/home/home.js
+++ b/littleApp_child/pages/home/home.js
@@ -26,9 +26,12 @@ Page({
// 首页类型 1登录 2用户首页 3欢迎页
pageType: 0,
time: '0s',
+ list:[],
+ userInfo:''
},
/*---------生命周期--------*/
onLoad: function () {
+ this.calculatePageSize()
var isFirst = wx.getStorageSync('isFirst')
// 网络监听
this.networkStatusChange()
@@ -37,10 +40,11 @@ Page({
this.welcomePage()
} else {
if (app.globalData.token == null || app.globalData.token == '') {
- this.loginPage()
+ this.toLogin()
+ console.log('登录页面--')
} else {
+ console.log('shouye页面--')
networkUtil.showLoading()
-
this.homePage()
// 监听事件
event.on('likeChanged', this, function (data) {
@@ -118,7 +122,7 @@ Page({
var smallWidth = ((windowWidth - 10) / 2 - 10)
this.setData({
item_big_height: 'height:' + windowWidth / 4 + 'px',
- item_small: 'width:' + smallWidth / 2 + 'px;height:' + smallWidth / 2 + 'px',
+ item_small: 'width:' + windowWidth / 4 * 0.45 + 'px;height:' + windowWidth / 4 * 0.45 + 'px',
})
},
// 监听网络状态
@@ -141,6 +145,10 @@ Page({
var param = { 'token': app.globalData.token }
networkUtil._get(api.userInfo + app.globalData.userId, {}, function (res) {
console.log('获取用户信息',res)
+ self.getArticleInfo(res.data.data.days)
+ self.setData({
+ userData: res.data.data
+ })
}, function (res) {
networkUtil.showErrorToast(res.errormsg)
})
@@ -149,6 +157,10 @@ Page({
var self = this
// 文章列表
networkUtil._get(api.homeArtList, { page: 0, limit: 100, days: days }, function (res) {
+ console.log('获取文章信息', res.data.list)
+ self.setData({
+ list: res.data.list
+ })
}, function (res) {
wx.stopPullDownRefresh()
})
@@ -190,8 +202,6 @@ Page({
// })
// return
// }
-
-
},
// 计时器
keepTime: function () {
diff --git a/littleApp_child/pages/home/home.wxml b/littleApp_child/pages/home/home.wxml
index d05e5d8..f364358 100644
--- a/littleApp_child/pages/home/home.wxml
+++ b/littleApp_child/pages/home/home.wxml
@@ -11,21 +11,21 @@
- {{username}}
+ {{userData.username}}
体检医院
- {{week}}青黄岛
+ {{userData.checkhospital}}
月龄
- {{nextCheckTime}}1岁半
+ {{userData.monthage}}
健康状况
- {{intervalDays}}未知
+ {{userData.hstatus}}
@@ -35,46 +35,50 @@
-
+
儿保检查记录
-
+
育儿百科
-
+
育儿知识
-
+
消息通知
+
- 日常护理
-
-
-
-
- 如何提防新生儿败血症
-
-
-
-
-
-
-
-
-
+ {{sectionItem.title}}
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
+
+
+
+
+
@@ -124,11 +128,11 @@
-
+
-
+
diff --git a/littleApp_child/pages/home/home.wxss b/littleApp_child/pages/home/home.wxss
index 81d6b4c..587d6e1 100644
--- a/littleApp_child/pages/home/home.wxss
+++ b/littleApp_child/pages/home/home.wxss
@@ -137,8 +137,8 @@ color: #D8FCE7;
}
.foundation_item_small_image {
- height: 45%;
- width: 45%;
+ /* height: 45%;
+ width: 45%; */
margin-top: 3px;
}
@@ -151,14 +151,16 @@ color: #D8FCE7;
/*---------文章列表---------*/
.article_list {
- border-radius: 4px;
- background: white;
+
+ /* background: red; */
margin-left: 5px;
margin-right: 5px;
margin-top: 11px;
}
.article_bg {
margin-bottom: 10px;
+ border-radius: 4px;
+ background: white
}
/* 栏目标题前面图 */
.article_title_image {
@@ -179,11 +181,11 @@ color: #D8FCE7;
}
/* 箭头 */
.article_title_indicator {
- width: 5.5px;
- height: 10.2px;
+ width: 12px;
+ height: 14px;
float: right;
margin-right: 10px;
- margin-top: 12px;
+ margin-top: 10px;
}
/* 文章ne内容背景 */
.article_content {
--
1.8.3.1