diff --git a/littleApp_child/pages/home/css/login.wxss b/littleApp_child/pages/home/css/login.wxss index 342a20d..0c7a4c2 100644 --- a/littleApp_child/pages/home/css/login.wxss +++ b/littleApp_child/pages/home/css/login.wxss @@ -1,81 +1,101 @@ - .input-placeholder { - font-size: 13px; - color: #979797; + font-size: 13px; + color: #999; } page { - background-color: white; + background-color: white; } .record-topbar { - width: 100%; - height: 45px; - background: #ffd5dd; - font-size: 12px; - color: #ee7289; - text-align: center; - line-height: 45px; + width: 100%; + height: 45px; + background: #ffd5dd; + font-size: 12px; + color: #ee7289; + text-align: center; + line-height: 45px; } .record-input-constainer { - margin: 40px 25px 0 25px; + margin: 40px 10px 0 10px; } .record-input_bg { - /*background: beige;*/ - display: flex; - align-items: center; - justify-content: flex-start; - height: 45px; - border: solid 1px; - border-radius: 5px; + /*background: beige;*/ + display: flex; + align-items: center; + justify-content: flex-start; + height: 42px; + border: solid 1px; + border-radius: 5px; } .record-input_title { - /*background-color: green;*/ - width: 100px; - height: 20px; - text-align: center; - line-height: 20px; - font: medium; - font-size: 14px; - color: #ee7289; - border-right: solid #e8eae5 1px; + /*background-color: green;*/ + width: 50px; + height: 20px; + text-align: left; + line-height: 20px; + font: medium; + font-size: 14px; + color: #000; + padding-left: 15px; + border-right: solid #e8eae5 1px; } .input { - /*background-color: red;*/ - font-size: 13px; - color: #5e5e5e; - margin-left: 20px; - width: 180px; - margin-top: 3px; + /*background-color: red;*/ + font-size: 13px; + color: #999; + margin-left: 10px; + width: 110px; + margin-top: 3px; } .record-submit-btn { - font: medium; - font-size: 20px; - color: white; - width: 200px; - height: 45px; - line-height: 45px; - border-radius: 22.5px; - background-color: #48C17B; - position: absolute; - bottom: 100px; - left: 50%; - transform: translateX(-50%); - text-align: center; + font: medium; + font-size: 20px; + color: white; + width: 200px; + height: 45px; + line-height: 45px; + border-radius: 22.5px; + background-color: #48c17b; + position: absolute; + bottom: 100px; + left: 50%; + transform: translateX(-50%); + text-align: center; +} + +.code-input_bg { + /*background: beige;*/ + display: flex; + align-items: center; + justify-content: flex-start; + height: 42px; + border: solid 1px; + border-radius: 5px; + width: 60%; } .record-time-text { - margin-right: 20px; - font: lighter; - font-size: 13px; - color: #48C17B; - width: 110px; - text-align: right; - margin-top: 2px; - /*background-color: rgba(1, 1, 1, 1);*/ -} \ No newline at end of file + font: lighter; + margin-left: 10px; + width: 80px; + text-align: center; + font-size: 15px; + color: #666; + height: 30px; + line-height: 30px; + margin-top: 20px; + background: #f5f5f5; + border: 1px solid #d3d3d3; + border-radius: 4px; + /*background-color: rgba(1, 1, 1, 1);*/ +} + +.code_view { + display: flex; +} diff --git a/littleApp_child/pages/home/home.js b/littleApp_child/pages/home/home.js index d016965..f97aa86 100644 --- a/littleApp_child/pages/home/home.js +++ b/littleApp_child/pages/home/home.js @@ -12,150 +12,259 @@ var util = require('../../utils/util.js') var event = require('../../utils/event.js') // 获取应用实例 var app = getApp() + +var timeCount = 60; +var timer; +var phone; +var name; Page({ - /*---------属性变量--------*/ - data: { - isLogin: '', - item_big_height:0, - item_small: 0, - // 首页类型 1登录 2用户首页 3欢迎页 - pageType:0 - }, - /*---------生命周期--------*/ - onLoad: function () { - var isFirst = wx.getStorageSync('isFirst') - if(!isFirst){ - this.setData({ - pageType:3 - }) - console.log('我是空的') - } else { - console.log('我是空的') - } - - - // var that = this - this.networkStatusChange() - // this.networkstatus() - if (app.globalData.token == null || app.globalData.token == '') { - this.loginPage() - } else { - networkUtil.showLoading() - this.getUserInfo() - this.homePage() - // 监听事件 - event.on('likeChanged', this, function (data) { - if (data.categoryIndex == -1) { - var artList = this.data.crisisCategorie - artList[data.articleIdIndex].likeCount++ - this.setData({ - crisisCategorie: artList - }); + /*---------属性变量--------*/ + data: { + isLogin: '', + item_big_height: 0, + item_small: 0, + // 首页类型 1登录 2用户首页 3欢迎页 + pageType: 0, + time: '0s', + }, + /*---------生命周期--------*/ + onLoad: function () { + var isFirst = wx.getStorageSync('isFirst') + if (!isFirst) { + this.setData({ + pageType: 3 + }) + console.log('我是空的') } else { - var artList = this.data.articleList - artList[data.categoryIndex].article[data.articleIdIndex].likeCount++ - this.setData({ - articleList: artList - }); + console.log('我是空的') } - }) - } - - }, - onShow: function () { - // 生命周期函数--监听页面显示 - if (app.globalData.token.length > 0 && this.data.isLogin == true) { - this.getUserInfo() - this.homePage() - } - if (wx.getStorageSync("access_token") != null && !wx.getStorageSync("isHxOpend")){ - - } - }, - onUnload: function () { - // 移除监听 - event.remove('likeChanged', this); - }, - /*---------交互--------*/ - // 下拉刷新回调接口 - onPullDownRefresh: function () { - if (app.globalData.token == null || app.globalData.token == '') { - wx.stopPullDownRefresh() - return - } - // 网络请求,重新请求一遍数据 - this.getUserInfo() - this.homePage() - }, - // 点击头像 - tapAvatar: function () { - var that = this - wx.showActionSheet({ - itemList: ['退出当前用户'], - success: function (res) { - if (res.tapIndex == 0) { - wx.setStorageSync('userToken', '') - getApp().globalData.token = '' - that.loginPage() - WebIM.conn.close(); + + // var that = this + this.networkStatusChange() + // this.networkstatus() + if (app.globalData.token == null || app.globalData.token == '') { + this.loginPage() + } else { + networkUtil.showLoading() + this.getUserInfo() + this.homePage() + // 监听事件 + event.on('likeChanged', this, function (data) { + if (data.categoryIndex == -1) { + var artList = this.data.crisisCategorie + artList[data.articleIdIndex].likeCount++ + this.setData({ + crisisCategorie: artList + }); + } else { + var artList = this.data.articleList + artList[data.categoryIndex].article[data.articleIdIndex].likeCount++ + this.setData({ + articleList: artList + }); + } + }) } - }, - fail: function (res) { - console.log(res.errMsg) - } - }) - }, - /*---------自定义函数--------*/ - homePage() { - this.getAccessToken() - var that = this - that.setData({ - isLogin: false - }) - }, - loginPage() { - var that = this - that.setData({ - isLogin: true - }) - }, - // 监听网络状态 - networkStatusChange() { - var that = this - wx.onNetworkStatusChange(function (res) { - if (res.isConnected == true) { - that.connectWebIM() - } - }) - }, - // 获取用户信息 - getUserInfo() { - - var self = this - var param = { 'token': app.globalData.token } - networkUtil._get(api.getUserInfo, param, function (res) { - - }, function (res) { - networkUtil.showErrorToast(res.errormsg) - }) - }, - getArticleInfo(days) { - var self = this - // 文章列表 - networkUtil._get(api.homeArtList, { page: 0, limit: 100, days: days }, function (res) { - }, function (res) { - wx.stopPullDownRefresh() - }) - }, - // 设置UI数据 - setUserInfo(data) { - - }, - /*---------------欢迎介绍页面---------------*/ - toLogin(){ - this.setData({ - pageType:1 - }) - } + + }, + onShow: function () { + // 生命周期函数--监听页面显示 + if (app.globalData.token.length > 0 && this.data.isLogin == true) { + this.getUserInfo() + this.homePage() + } + + if (wx.getStorageSync("access_token") != null && !wx.getStorageSync("isHxOpend")) { + + } + }, + onUnload: function () { + // 移除监听 + event.remove('likeChanged', this); + }, + /*---------交互--------*/ + // 下拉刷新回调接口 + onPullDownRefresh: function () { + if (app.globalData.token == null || app.globalData.token == '') { + wx.stopPullDownRefresh() + return + } + // 网络请求,重新请求一遍数据 + this.getUserInfo() + this.homePage() + }, + // 点击头像 + tapAvatar: function () { + var that = this + wx.showActionSheet({ + itemList: ['退出当前用户'], + success: function (res) { + if (res.tapIndex == 0) { + wx.setStorageSync('userToken', '') + getApp().globalData.token = '' + that.loginPage() + WebIM.conn.close(); + } + }, + fail: function (res) { + console.log(res.errMsg) + } + }) + }, + /*---------自定义函数--------*/ + homePage() { + this.getAccessToken() + var that = this + that.setData({ + isLogin: false + }) + }, + loginPage() { + var that = this + that.setData({ + isLogin: true + }) + }, + // 监听网络状态 + networkStatusChange() { + var that = this + wx.onNetworkStatusChange(function (res) { + if (res.isConnected == true) { + that.connectWebIM() + } + }) + }, + // 获取用户信息 + getUserInfo() { + + var self = this + var param = { 'token': app.globalData.token } + networkUtil._get(api.getUserInfo, param, function (res) { + + }, function (res) { + networkUtil.showErrorToast(res.errormsg) + }) + }, + getArticleInfo(days) { + var self = this + // 文章列表 + networkUtil._get(api.homeArtList, { page: 0, limit: 100, days: days }, function (res) { + }, function (res) { + wx.stopPullDownRefresh() + }) + }, + // 设置UI数据 + setUserInfo(data) { + + }, + /*---------------欢迎介绍页面---------------*/ + toLogin() { + this.setData({ + pageType: 1 + }) + }, + + // 获取验证码 + getVerifyCode: function (e) { + console.log("name:" + name) + console.log("phone:" + phone) + if (timeCount < 60) { + return + } + + var that = this + networkUtil._post(api.bindDoc, { username: name, phone: phone }, function (res) { + console.log("getVerifyCode:",res) + + }, function (res) { + timeCount = 60 + clearTimeout(timer); + that.setData({ + time: '0s' + }) + networkUtil.showErrorToast('获取验证码失败,请稍后再试') + }) + if (timeCount == 60) { + this.keepTime() + } + // if (numberUtil.IsTelPhoneNumber(phone)) { + + // } else { + // wx.showToast({ + // title: '请输入正确手机号码', + // }) + // return + // } + + + }, + // 计时器 + keepTime: function () { + var that = this + timeCount-- + that.setData({ + time: timeCount + 's' + }) + if (timeCount == 0) { + timeCount = 60 + clearTimeout(timer); + return + } + timer = setTimeout(function () { + that.keepTime() + }, 1000) + }, + blurInput: function (e) { + console.log(e) + phone = e.detail.value + }, + blurNameInput:function(e){ + console.log(e) + name = e.detail.value + }, + // 提交表单 + formSubmit: function (e) { + + // wx.navigateTo({ + // url: '../childcare_knowledge/childcare_knowledge' + // }) + var self = this + if (e.detail.value.code == "") { + wx.showModal({ + title: '提示', + content: '请输入验证码', + showCancel: false, + success: function (res) { + } + }) + return + } + networkUtil.showLoading() + var param = { code: e.detail.value.code, phone: phone } + if (getApp().globalData.openInfo.mpid) { + param.gzopenid = getApp().globalData.openInfo.mpid + console.log('绑定mpid', param) + } + if (getApp().globalData.openInfo.code) { + param.jscode = getApp().globalData.openInfo.code + console.log('绑定code', param) + } + networkUtil._get(api.verifyCode, param, function (res) { + console.log(res) + self.loginSuccess(res.data) + }, function (res) { + networkUtil.showErrorToast(res.errormsg) + }) + }, + loginSuccess(data) { + console.log(data) + wx.setStorageSync('userToken', data.token) + wx.setStorageSync('hxName', data.hxName) + wx.setStorageSync('hxPassWord', data.hxPassWord) + getApp().globalData.token = data.token + // wx.navigateTo({ + // url: '../HasDocumentedVerifySuccess/HasDocumentedVerifySuccess?name=' + name + // }) + } }) diff --git a/littleApp_child/pages/home/home.wxml b/littleApp_child/pages/home/home.wxml index 67481cf..d05e5d8 100644 --- a/littleApp_child/pages/home/home.wxml +++ b/littleApp_child/pages/home/home.wxml @@ -1,4 +1,3 @@ - @@ -6,77 +5,77 @@ - - - - - - - {{username}} - - - - 体检医院 - {{week}}青黄岛 - - - 月龄 - {{nextCheckTime}}1岁半 - - - - 健康状况 - {{intervalDays}}未知 - - - - - - {{hospitalName}} - - - - - 儿保检查记录 - - - - 育儿百科 - - - - 育儿知识 - - - - 消息通知 - - + + + + + + + {{username}} + + + + 体检医院 + {{week}}青黄岛 + + + 月龄 + {{nextCheckTime}}1岁半 + + + + 健康状况 + {{intervalDays}}未知 + + + + + + {{hospitalName}} + + + + + 儿保检查记录 + + + + 育儿百科 + + + + 育儿知识 + + + + 消息通知 + + - - - - - - 日常护理 - - - - - 如何提防新生儿败血症 - - - - + + + + + 日常护理 + + + + + 如何提防新生儿败血症 + + + + - - - - + + + + + + - - @@ -84,61 +83,65 @@ - - - - - 幼儿保健 + + + + + 幼儿保健 + + 妈咪baby之“幼儿保健”,主要针对0-6周岁婴幼儿提供院内保健检查信息、诊断指导意见以及相关医疗服务提醒等业务。 - 妈咪baby之“幼儿保健”,主要针对0-6周岁婴幼儿提供院内保健检查信息、诊断指导意见以及相关医疗服务提醒等业务。 - - - - - 儿保记录 + + + + 儿保记录 + + 查看婴幼儿在院内检查的各项信息,以及对应的诊断、处理、指导意见。 - 查看婴幼儿在院内检查的各项信息,以及对应的诊断、处理、指导意见。 - - - - - 服务提醒 + + + + 服务提醒 + + 可提供高危、复查、预约、精确指导等相关及时提醒服务。 - 可提供高危、复查、预约、精确指导等相关及时提醒服务。 - - - - - 育儿知识 + + + + 育儿知识 + + 根据儿童生长发育情况,每周提供针对性婴幼儿日常护理、营养饮食、疾病护理等相关信息。 - 根据儿童生长发育情况,每周提供针对性婴幼儿日常护理、营养饮食、疾病护理等相关信息。 - - + -
- - - - - - - - - - - - - - - - - - - -
+
+ + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/littleApp_child/utils/apiFile.js b/littleApp_child/utils/apiFile.js index 99016ba..fbfa9c8 100644 --- a/littleApp_child/utils/apiFile.js +++ b/littleApp_child/utils/apiFile.js @@ -1,85 +1,13 @@ module.exports = { getOpenId:'wx/getOpenId', /*------建档------*/ - // 提交建档 - bookArchive:'vqhdfy/bookArchive', + // 校验验证码并且绑定建档 - verifyCode : 'wx/vercode', + verifyCode: 'baby/vercode', // 获取验证码 - bindDoc : 'wx/bind', - // 获取地区 - regions:'v1/regions', - /*------首页------*/ - // 获取用户信息 - getUserInfo : 'v1/users', - // 首页文章列表 - homeArtList : 'wx/pregnancy', - // 获取这个人所属的高危文章列表 - riskGuideList : 'v1/riskGuide', - // 文章列表 - articleList : 'wx/articles/precise', - // 文章详情/articles/:id - article : 'v1/articles', - // 文章点赞 - articleLike : 'v1/articleLike', - // 获取用户医院与医生信息 - getUserHosiptal : 'v1/documents', - // 孕期产检信息 - checkInfoOfPregnancy : 'v1/appointments/pregnancy', - // 孕期健康评级 - healthOfPregnancy : 'wx/health', - // 获取这个人所属的高危 - userRisk : 'wx/getselfrisk', - riskDetails : 'wx/getriskdetail', - /*------医院医生------*/ - // 医生介绍 - doctorInfo : 'wx/doctorDetail', - // 医生列表 - doctorList : 'wx/doctor/list', - // 获取孕期检查报告列表 详情使用:/reports/:id - pregnancyReports : 'v1/reports', - // 获取检验报告列表 详情使用:/reports/:id - inspectionReports: 'wx/getAreaReports', - // 获取检验报告详情使用:/reports/:id - inspectionReportDetail: 'wx/reports', - // reportDetails : 'wx/getriskdetail', - // 医院列表 - hospitalList : 'v1/hospitals/my', - // 医院详情 使用:/hospitals/:id - hospitalDetail : 'v1/hospitals/', - // 查询床位类型信息sickedTypes/:hospitalId - sickbedTypes : 'v1/sickbedTypes/', - // 查询我的床位预约、预约床位、取消预约床位 - sickbedOrders : 'v1/sickbedOrders/', - // 体重管理-获取体重记录 - getUserWeight: 'grWeContr/getGw', - // 体重管理-设置孕妇孕前体重 - setUserBeforeWeight: 'grWeContr/addGwBasic', - // 体重管理-记录孕妇当前体重 - setUserCurrentWeight: 'grWeContr/addGw', - // 体重管理-获取体重标准值 - getWeightReference: 'grWeContr/getGsw', - // 体重管理-获取推荐信息 - getweightSuggest: 'grWeContr/getweightSuggest', - // 体重管理-获取血压 - getBolldPressure: 'pbp/getBolldPressure', - // 体重管理-设置血压 - addBloodPre: 'pbp/addBloodPre', - // 医生环信用户名 - getDoctorHxName: 'wx/getDoctorHxName', - // 添加医生为好友 - doctorAddFriend: 'wx/doctorAddFriend', - // 获取环信登录token - getAccessToken: 'wx/getAccessToken', - // 既往史类型 - getjws:'getjws', - // 新增血糖记录 - addBloodSug: 'pbs/addBloodSug', - // 获取血糖记录 - getBolldSugar: 'pbs/getBolldSugar', + bindDoc : 'baby/bind', + // 用户基本信息 - - - /*---------衡水-----------*/ - hengshui: 'WX_CS.asmx/Get_CSResult_Info' + userInfo: 'baby/user/info', + } \ No newline at end of file