diff --git a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js index 264f04e..21edae9 100644 --- a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js +++ b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.js @@ -12,7 +12,14 @@ var isRefresh Page({ data: { - list:[], + list: [ + {zar:12, title: "title1", content: "content1content1content1content1content1content1content1content1content1content1content1ds到场定损", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" } + , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" } + , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" } + , { zar: 12,title: "title1", content: "content1", image: "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg" } + , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg" } + , { zar: 12, title: "title2", content: "content2", image: "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg" } + ], images: [ 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', @@ -20,7 +27,8 @@ Page({ ], titles: ["日常护理", "营养美食", "疾病护理", "亲子互动", "言传qq"], id:0, - category:'' + category:'', + current_index:0, }, onLoad: function (e) { this.data.id = e.id @@ -68,6 +76,9 @@ Page({ titleClick:function(e){ console.log(e) var index = e.currentTarget.dataset.index + this.setData({ + current_index:index + }) }, /*---------自定义函数--------*/ requestData(id){ diff --git a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.json b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.json index da7faa0..fd0bcae 100644 --- a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.json +++ b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.json @@ -1,5 +1,5 @@ { - "navigationBarBackgroundColor": "#f4879b", + "navigationBarBackgroundColor": "#48C17B ", "navigationBarTitleText": "育儿知识", "navigationBarTextStyle": "white", "backgroundColor": "#d8dbd4" diff --git a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml index 1f56881..9309f63 100644 --- a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml +++ b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxml @@ -1,36 +1,37 @@ - - + - - - - - - - - - - - - - - - - {{item.title}} - + + + + + + + + + + + + + + + {{item.title}} + {{item.content}} + {{item.zar}} + - {{item.introduction}} - - - - 加载更多... - + + + 加载更多... + + + \ No newline at end of file diff --git a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxss b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxss index c821e04..4f8ef0a 100644 --- a/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxss +++ b/littleApp_child/pages/childcare_knowledge/childcare_knowledge.wxss @@ -1,7 +1,22 @@ +.main { + background: #fff; + width: 100%; + margin-top: 50px; +} + +.title_top_view { + width: 100%; + display: flex; + background: white; + position: fixed; + height: 50px; + top: 0px; + z-index: 1; +} + .title_scroll { - width: 95%; - margin-left: 40px; - position: relative; + width: 90%; + margin-left: 20px; /*可以滚动 */ white-space: nowrap; display: inline-block; @@ -20,12 +35,20 @@ margin-right: 30px; text-align: left; line-height: 40px; + border: 1px; + border-bottom: 2px; + border-color: #FF5E5E ; +} + +.title_text { + font-size: 13px; + padding-top: 10px; + padding-bottom: 7px; } .search_img { width: 20px; height: 20px; - position: absolute; margin-top: 11px; margin-left: 10px; } @@ -35,86 +58,68 @@ background: white; } -/*首页列表文章 item 的文章图片*/ - -.home__list__img { - width: 80px; - height: 100%; - vertical-align: top; - /*垂直居中*/ - display: flex; - justify-content: center; - align-items: Center; +.swiper { + height: 200px; + width: 100%; } -.home__list-item-content { - margin-left: 15px; +.swiper image { + height: 100%; + width: 100%; } -/*首页列表文章 item 外层布局 右侧*/ - -.home__list-item__right { +.content_item { width: 100%; - height: 32px; - /*background: darkcyan;*/ - position: relative; + height: 75px; + right: 75px; } -/*首页列表文章 item 内的title 布局*/ - -.home__list-item__title { - position: absolute; - top: 0px; - left: 0px; - right: 60px; +.content_title { + font-family: PingFangSC-Regular; font-size: 14px; - color: #5e5e5e; - font: normal; + margin-top: 10px; + color: #222; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; } -/*首页列表文章 item 内的的点赞 布局*/ - -.home__list-item__like { - position: absolute; - top: 0px; - right: 0px; - /*垂直居中 - display: flex; - justify-content:center; - align-items:Center;*/ +.content_content { + height: 36px; + font-family: PingFangSC-Regular; + font-size: 12px; + color: #888; + line-height: 18px; + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } -/*首页列表文章 item 内的点赞手图标*/ - -.home__list-item__title-like-icon { - position: absolute; - width: 10px; - height: 10px; - right: 0px; - left: 0px; - top: 7px; +.content_zar { + font-family: PingFangSC-Regular; + font-size: 10px; + color: #c6c6c6; } -/*首页列表文章 item 内的的点赞 数*/ - -.home__list-item__title-like-count { - /*这个宽度设置后可以变化点赞数整个布局的位置前移后移*/ - width: 30px; - margin-left: 15px; - font-size: 10px; - margin-top: 4px; - color: #c8c6c6; - overflow: hidden; - text-overflow: ellipsis; +.content_image { + width: 50px; + transform: translateY(-65px); + float: right; + margin-right: 15px; + height: 50px; } /*item 分割线*/ .home__list-item__bottom { - position: absolute; - height: 1rpx; + height: 2px; background: #d8dbd4; - top: 0px; + margin-bottom: 5px; + margin-top: 5px; left: 15px; right: 15px; }