diff --git a/littleApp_child/app.json b/littleApp_child/app.json index 231eb26..c1eb6b1 100644 --- a/littleApp_child/app.json +++ b/littleApp_child/app.json @@ -20,7 +20,7 @@ "pages/hospitalList/hospitalList", "pages/childcare_knowledge_detail/childcare_knowledge_detail", "pages/system_notifacations/system_notifacations", - + "pages/risk_guide/risk_guide", "pages/childcare_knowledge/childcare_knowledge", "pages/CompleteTouristInfo/CompleteTouristInfo", "pages/vipService/vipService", diff --git a/littleApp_child/pages/CheckReport/CheckReport.js b/littleApp_child/pages/CheckReport/CheckReport.js index 8d1f291..1f5ec8f 100644 --- a/littleApp_child/pages/CheckReport/CheckReport.js +++ b/littleApp_child/pages/CheckReport/CheckReport.js @@ -167,7 +167,7 @@ Page({ dateIndex: index, yearText: this.setDateYearText(text), monthText: this.setDateMonthText(text), - currentPID:patientId + currentPID: patientId }) networkUtil.showLoading() this.getCheckDetails(patientId) diff --git a/littleApp_child/pages/Setting/Setting.wxml b/littleApp_child/pages/Setting/Setting.wxml index 3df0093..14500b7 100644 --- a/littleApp_child/pages/Setting/Setting.wxml +++ b/littleApp_child/pages/Setting/Setting.wxml @@ -2,7 +2,7 @@ - + {{userData.username}} {{userData.phone}} diff --git a/littleApp_child/pages/home/home.wxml b/littleApp_child/pages/home/home.wxml index a4b6536..dfb3805 100644 --- a/littleApp_child/pages/home/home.wxml +++ b/littleApp_child/pages/home/home.wxml @@ -60,14 +60,14 @@ 育儿知识 + + + 精准指导 + 消息通知 - diff --git a/littleApp_child/pages/risk_guide/risk_guide.js b/littleApp_child/pages/risk_guide/risk_guide.js new file mode 100644 index 0000000..f8db6b2 --- /dev/null +++ b/littleApp_child/pages/risk_guide/risk_guide.js @@ -0,0 +1,191 @@ +//articleLists.js 文章列表 +// 网络请求工具类 +var networkUtil = require('../../utils/network_util.js') +var api = require('../../utils/apiFile.js') +// 事件监听 +var event = require('../../utils/event.js') +var page +// 是否有更多 +var hasMore +var isRefresh +// 获取应用实例 +var app = getApp() + +var pageLimit=15 +var animation1 = wx.createAnimation({ + duration:1000 +}) +Page({ + data: { + list: [], + images: {}, + titles: [],//"日常护理", "营养美食", "疾病护理", "亲子互动", "言传身教" + category:'', + current_index:0, + animationData:{}, + swiperHeight:0 + }, + onLoad: function (e) { + // 数据初始化 + var self = this + page = 1 + hasMore = true + isRefresh = false + this.setData({ + titles: app.globalData.artList, + category: app.globalData.artList[self.data.current_index].id, + images: app.globalData.artList[self.data.current_index].iconimage, + swiperHeight: wx.getSystemInfoSync().windowWidth * 0.42 + }) + this.requestData() + + + }, + onUnload: function() { + + }, + /*---------事件处理函数--------*/ + bindViewTap: function() { + wx.navigateTo({ + url: '../home/home' + }) + }, + // 加载更多 + loadMore:function(){ + + console.log("hasMore:", hasMore) + if(!hasMore || isRefresh == true){ + return + } + page ++ + networkUtil.showLoading() + this.requestData() + + }, + // 下拉刷新回调接口 + refesh: function() { + page = 1; + hasMore = true + var self=this + this.setData({ + list: [], + + }) + animation1 = wx.createAnimation({ + duration: 1000 + }) + animation1.rotate(720).step() + + this.setData({ + animationData: animation1.export() + }) + + + + networkUtil.showLoading() + // 网络请求,重新请求一遍数据 + this.requestData(); + }, + myScroll: function (e) { + console.log("e:", e) + // if(e.detail.scrollTop >= e.detail.scrollHeight-wx.getSystemInfoSync().windowHeight - 3){ + // this.loadMore() + // } + this.loadMore() + }, + titleClick:function(e){ + // console.log(e) + var self=this + var current_index = e.currentTarget.dataset.index + var categoryid = e.currentTarget.dataset.categoryid + this.setData({ + category: categoryid, + current_index: current_index, + images: app.globalData.artList[current_index].iconimage + }) + page = 1; + hasMore = true + this.requestData() + }, + toSearch(){ + wx.navigateTo({ + url: '../SearchPage/SearchPage', + }) + }, + toDetail:function(e){ + var self = this + var id = e.currentTarget.dataset.id + wx.navigateTo({ + url: '../childcare_knowledge_detail/childcare_knowledge_detail?id=' + id + ' & category=' + self.data.category, + }) + }, + + /*---------自定义函数--------*/ + requestData(){ + var self = this + isRefresh = true + networkUtil.showLoading() + var param = { page: page, limit: pageLimit, type: 2, categoryId: self.data.category} + // console.log(param) + networkUtil._get(api.articleList,param,function(res){ + console.log(res) + isRefresh = false + var arr = [] + if(page > 1) {// 加载更多模式 + arr = self.data.list + } + if (res.data.data.length < pageLimit){ + hasMore = false + }else{ + hasMore = true + } + arr = arr.concat(res.data.data) + self.setData({ + list:arr, + hasMore: hasMore + }) + // var that = this; + setTimeout(function () { + animation1.rotate(0).step({ duration: 0, transformOrigin: "50%,50%", timingFunction: 'linear' }) + self.setData({ + animationData: animation1.export() + }) + }, 300) + + },function(res){ + isRefresh = false + setTimeout(function () { + animation1.rotate(0).step({ duration: 0, transformOrigin: "50%,50%", timingFunction: 'linear' }) + self.setData({ + animationData: animation1.export() + }) + }, 300) + }) + + + }, + // 文章点赞 + articleLike: function (e){ + console.log(e) + var self = this + var id = e.currentTarget.dataset.id + var index = e.currentTarget.dataset.index + // 已经点赞 + if (self.data.list[index].isLike == 1) { + networkUtil.showErrorToast('您已经点过赞啦') + return; + } + networkUtil._post(api.articleLike, { id: id }, function (res) { + console.log(res) + + self.data.list[index].likeCount++ + self.data.list[index].isLike = 1 + self.setData({ + list: self.data.list + }) + + }, function (res) { + console.log(res) + }) + } +}) diff --git a/littleApp_child/pages/risk_guide/risk_guide.json b/littleApp_child/pages/risk_guide/risk_guide.json new file mode 100644 index 0000000..21ba5c5 --- /dev/null +++ b/littleApp_child/pages/risk_guide/risk_guide.json @@ -0,0 +1,6 @@ +{ + "navigationBarBackgroundColor": "#48C17B", + "navigationBarTitleText": "精准指导", + "navigationBarTextStyle": "white", + "backgroundColor": "#d8dbd4" +} \ No newline at end of file diff --git a/littleApp_child/pages/risk_guide/risk_guide.wxml b/littleApp_child/pages/risk_guide/risk_guide.wxml new file mode 100644 index 0000000..c566e70 --- /dev/null +++ b/littleApp_child/pages/risk_guide/risk_guide.wxml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + {{item.title}} + {{item.introduction}} + + + + + {{item.likeCount}} + + + + 新生儿 + 健康宝宝 + 健康宝宝 + + + + + + + + + 加载更多... + + + + + + + + \ No newline at end of file diff --git a/littleApp_child/pages/risk_guide/risk_guide.wxss b/littleApp_child/pages/risk_guide/risk_guide.wxss new file mode 100644 index 0000000..761ee1f --- /dev/null +++ b/littleApp_child/pages/risk_guide/risk_guide.wxss @@ -0,0 +1,186 @@ +.main { + background: #fff; + width: 100%; + margin-top: 40px; +} + +.title_top_view { + width: 100%; + display: flex; + background: white; + position: fixed; + height: 40px; + padding-left: 10px; + top: 0px; + z-index: 1; +} + +.title_scroll { + width: 90%; + margin-left: 10px; + /*可以滚动 */ + white-space: nowrap; + display: inline-block; +} + +/*隐藏Scrollview滚动条 */ + +::-webkit-scrollbar { + width: 0; + height: 0; + color: transparent; +} + +.scroll_title_label { + height: 40px; + margin-right: 30px; + text-align: left; + line-height: 40px; + border: 1px; + font-size: 13px; + color: #494949; + border-bottom: 2px; + border-color: #ff5e5e; +} + +.title_text { + font-size: 13px; + padding-top: 10px; + padding-bottom: 7px; +} + +.search_img { + width: 22px; + height: 22px; + margin-top: 9px; +} + +.home__list-item { + position: relative; + background: white; +} + +.swiper { + width: 100%; +} + +.swiper image { + max-height: 100%; + max-width: 100%; +} + +.content_item { + width: 100%; + height: 120px; + right: 75px; +} + +.content_title { + font-family: PingFangSC-Regular; + font-size: 14px; + padding-top: 10px; + color: #222; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; +} + +.content_content { + height: 36px; + font-family: PingFangSC-Regular; + font-size: 12px; + color: #888; + line-height: 18px; + margin-top: 10px; + display: -webkit-box; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; +} + +.content_image { + width: 70px; + transform: translateY(-100px); + float: right; + margin-right: 15px; + height: 70px; +} + +.zarparent_box { + display: flex; + margin-top: 15px; +} + +.zar_box { + display: flex; + margin-left: -5px; + width: 50px; +} + +.zar_img { + width: 25px; + height: 25px; +} + +.save_img { + width: 25px; + height: 25px; +} +.content_zar { + font-family: PingFangSC-Regular; + font-size: 10px; + margin-left: 3px; + margin-top: 5px; + color: #AFAFAF; +} +.tags_view{ + display:flex; + float: right; + position: absolute; + right: 20px; +} +.tags1 { + background: #f2fdf7; + border-radius: 2px; + font-size: 12px; + margin-left: 10px; + color: #58a478; + margin-top: 5px; + padding: 3px; +} + +.tags_week { + background: #EEF7FF; + border-radius: 2px; + font-size: 12px; + margin-left: 10px; + color: #4E90EB; + margin-top: 5px; + padding: 3px; +} + +/*item 分割线*/ + +.home__list-item__bottom { + height: 1px; + background: #e2e2e2; + margin-top: 5px; + left: 15px; + right: 15px; +} + +.list_scroll { + height: 100vh; + /* background: rebeccapurple */ +} + +.icon_refresh { +position: fixed; + width: 50px; + height: 50px; + right: 20px; + bottom: 30px; +} diff --git a/littleApp_child/source/risk_guide.png b/littleApp_child/source/risk_guide.png new file mode 100644 index 0000000000000000000000000000000000000000..f3bb58dd7d6354e5615835fec76e637915432011 GIT binary patch literal 4149 zcmaJ^cR1VY-_}EqptiPJS`k`10~Lwdv1iTLB4SG-qIT_r8bxbXhp4L7OzEIzLs47p zy-QK0Mh9N{J3YVmkN3Ra>-s+9bKUp-ng2ZT#)ev~%;%Zu=;&B=v{5EUJNozs{CTwc zq(fzowsT|+G})BkLiWdyaCEB91ScF&#~b5{Gr?h;1AW?XSLx{JMcvKNWVC@k5=-y~ zV~#Q40B_S0ydvmxO+5(c?yLy1ykY<~Agbfs+_i&9IMX0Q zGi;D27U2w1RsvoPKpqKrSZ3LGvi36zGyWFb%(1STT|Lm*{kkx(e`?+s!yhzZV@;77t9HO@uo*cB0}PQqcx1d_c;8Q!DIKjV+XAI&`JXt=9X_ay1) zPUY*MRLufLSM5B#Y@1IXxcINxDe#I^unG!7av0+us$4`xYl(8G6lkb<=&_vC6(gJo zV}5F!=PnT~O7Te5R%h`L6I&3hGLISMVvgMK0IHnV)_y4L7|Y8q^5VAq7p20f*Sn>) zld-k_pT{S*=d`Cv=W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$kA#jbXlQw scXTS0P3dieXPC{kk5%=jQw~|6bj#|)N#g)i?(sujN5c?Rs^%E^KO&likN^Mx literal 0 HcmV?d00001 diff --git a/littleApp_child/utils/AnalysisBluetooth.js b/littleApp_child/utils/AnalysisBluetooth.js index 260245c..4e55e91 100644 --- a/littleApp_child/utils/AnalysisBluetooth.js +++ b/littleApp_child/utils/AnalysisBluetooth.js @@ -25,7 +25,7 @@ var packetArr = [] // save_point = 0 // return true // } -// return false +// return false   // } // packetStr = packetStr + dataStr // return false diff --git a/littleApp_child/utils/network_util.js b/littleApp_child/utils/network_util.js index 5367ec7..1912a7e 100644 --- a/littleApp_child/utils/network_util.js +++ b/littleApp_child/utils/network_util.js @@ -4,7 +4,7 @@ // 0测试环境 1正式环境 2演示环境 3衡水 var Builing_Release_AppStore = 0 // 获取服务器地址 -function kServerBaseUrl() { +function kServerBaseUrl() { switch (Builing_Release_AppStore) { case 0: return 'https://dev-app-member-api.healthbaby.com.cn/'; @@ -16,7 +16,7 @@ function kServerBaseUrl() { return 'https://weixin-bj.healthbaby.com.cn/'; } } - + /* * port: 接口名称 类型字符串 * params: 参数 类型json