Commit 92fd0e4f5141b494ef2abf8e63e233f83a53238e

Authored by xianghenggang

Merge branch 'master' of https://git.healthbaby.com.cn/luoye/littleapp_child

# Conflicts:
#	littleApp_child/app.json

Showing 19 changed files

littleApp_child/app.js View file @ 92fd0e4
... ... @@ -22,6 +22,7 @@
22 22 var userId = wx.getStorageSync('userId')
23 23 this.globalData.token = userToken
24 24 this.globalData.userId = userId
  25 + this.globalData.currentId = userId[0]
25 26 console.log(userToken)
26 27  
27 28 // wx.navigateTo({
... ... @@ -323,7 +324,8 @@
323 324 userId:'',
324 325 openInfo: {},
325 326 artList:[],
326   - days:0
  327 + days:0,
  328 + currentId:''
327 329 },
328 330  
329 331 })
littleApp_child/app.json View file @ 92fd0e4
1 1 {
2 2 "pages": [
3   -
4 3 "pages/home/home",
5 4 "pages/Setting/Setting",
6 5 "pages/PersonalInfo/PersonalInfo",
7 6  
... ... @@ -9,11 +8,10 @@
9 8 "pages/mySaved/mySaved",
10 9 "pages/CheckReport/CheckReport",
11 10 "pages/articleLists/articleLists",
12   -
13   -
14 11 "pages/SearchPage/SearchPage",
15 12 "pages/login/login",
16 13 "pages/inspectionReport/inspectionReport",
  14 +
17 15 "pages/doctor_detail/doctor_detail",
18 16 "pages/doctorList/doctorList",
19 17 "pages/hospital_detail/hospital_detail",
... ... @@ -24,7 +22,9 @@
24 22 "pages/childcare_knowledge_detail/childcare_knowledge_detail",
25 23 "pages/system_notifacations/system_notifacations",
26 24 "pages/vipService/vipService",
27   - "pages/childcare_knowledge/childcare_knowledge"
  25 + "pages/childcare_knowledge/childcare_knowledge",
  26 + "pages/CompleteTouristInfo/CompleteTouristInfo",
  27 + "pages/Register/Register"
28 28  
29 29 ],
30 30 "window": {
littleApp_child/pages/CheckReport/CheckReport.js View file @ 92fd0e4
... ... @@ -153,7 +153,7 @@
153 153 getCheckList() {
154 154 var self = this
155 155 // 列表
156   - networkUtil._get(api.checkList, { patientId: getApp().globalData.userId[0]}, function (res) {
  156 + networkUtil._get(api.checkList, { patientId: getApp().globalData.currentId}, function (res) {
157 157 console.log('获取时间信息', res)
158 158 var showLeft = true
159 159  
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.js View file @ 92fd0e4
  1 +// 完善游客信息
  2 +
  3 +// 网络请求工具类
  4 +var networkUtil = require('../../utils/network_util.js')
  5 +var api = require('../../utils/apiFile.js')
  6 +
  7 +
  8 +// 是否有更多
  9 +var userId = ''
  10 +var token = ''
  11 +
  12 +Page({
  13 + data: {
  14 + },
  15 + /*---------生命周期--------*/
  16 + onLoad: function (e) {
  17 + userId = e.userId
  18 + token = e.token
  19 + },
  20 + formSubmit: function (e) {
  21 + networkUtil.showLoading()
  22 + getApp().globalData.token = token
  23 + var param = { 'username': '李白', 'birth': '2017-02-15'}
  24 + networkUtil._put(api.kTourisInfo + userId, param, function (res) {
  25 + console.log(res)
  26 + getApp().globalData.token = ''
  27 + wx.showModal({
  28 + title: '提示',
  29 + content: '注册成功,立即登录',
  30 + success: function (res) {
  31 + if (res.confirm) {
  32 + wx.navigateBack({
  33 + delta: 5
  34 + })
  35 + }
  36 + }
  37 + })
  38 + }, function (res) {
  39 + networkUtil.showErrorToast(res.errormsg)
  40 + })
  41 + }
  42 +})
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.json View file @ 92fd0e4
  1 +{
  2 + "navigationBarBackgroundColor": "#48C17B",
  3 + "navigationBarTitleText": "我的收藏",
  4 + "navigationBarTextStyle": "white",
  5 + "backgroundColor": "#d8dbd4"
  6 +}
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.wxml View file @ 92fd0e4
  1 +<view class="backgroundView" style="background: white">
  2 + <form catchsubmit="formSubmit">
  3 +
  4 + <view class="record-input-constainer whiteColor">
  5 + <view class="record-input_bg whiteColor" style="border-color:{{inputFocus.nameInput ? '#48C17B' : '#e8eae5'}}">
  6 + <label class="record-input_title">姓名</label>
  7 + <input class="input" id="name" name="name" maxlength="12" placeholder="请输入建档姓名" value="" placeholder-class="input-placeholder" bindinput="blurNameInput"/>
  8 + </view>
  9 + <view>生日</view>
  10 + <view>性别</view>
  11 + </view>
  12 +
  13 + <button class="record-submit-btn" formType="submit">立即注册</button>
  14 + </form>
  15 +</view>
littleApp_child/pages/CompleteTouristInfo/CompleteTouristInfo.wxss View file @ 92fd0e4
  1 +@import "../home/css/login.wxss";
littleApp_child/pages/Register/Register.js View file @ 92fd0e4
  1 +
  2 +// 网络请求工具类
  3 +var networkUtil = require('../../utils/network_util.js')
  4 +var numberUtil = require('../../utils/numberUtil.js')
  5 +var api = require('../../utils/apiFile.js')
  6 +
  7 +var timeCount = 60;
  8 +var timer;
  9 +var phone;
  10 +var name;
  11 +var isFirst = true
  12 +Page({
  13 + data: {
  14 + inputFocus: { codeInput: false },
  15 + time: '0s',
  16 + },
  17 + // 获取验证码
  18 + getVerifyCode: function (e) {
  19 + console.log("name:" + name)
  20 + console.log("phone:" + phone)
  21 + if (timeCount < 60) {
  22 + return
  23 + }
  24 + if (numberUtil.IsTelPhoneNumber(phone) && name.length > 0) {
  25 + var that = this
  26 + networkUtil._post(api.bindDoc, { username: name, phone: phone,'type':2 }, function (res) {
  27 + console.log("getVerifyCode:", res)
  28 +
  29 + }, function (res) {
  30 + timeCount = 60
  31 + clearTimeout(timer);
  32 + that.setData({
  33 + time: '0s'
  34 + })
  35 + networkUtil.showErrorToast(res.errormsg)
  36 + })
  37 + if (timeCount == 60) {
  38 + this.keepTime()
  39 + }
  40 + } else {
  41 + networkUtil.showErrorToast('请输入正确手机号码和姓名')
  42 + return
  43 + }
  44 + },
  45 + // 计时器
  46 + keepTime: function () {
  47 + var that = this
  48 + timeCount--
  49 + that.setData({
  50 + time: timeCount + 's'
  51 + })
  52 + if (timeCount == 0) {
  53 + timeCount = 60
  54 + clearTimeout(timer);
  55 + return
  56 + }
  57 + timer = setTimeout(function () {
  58 + that.keepTime()
  59 + }, 1000)
  60 + },
  61 + blurInput: function (e) {
  62 + phone = e.detail.value
  63 + // console.log(e)
  64 + },
  65 + blurNameInput: function (e) {
  66 + name = e.detail.value
  67 + // console.log(e)
  68 + },
  69 + // 提交表单
  70 + formSubmit: function (e) {
  71 +
  72 + var self = this
  73 + if (e.detail.value.code == "") {
  74 + wx.showModal({
  75 + title: '提示',
  76 + content: '请输入验证码',
  77 + showCancel: false,
  78 + success: function (res) {
  79 + }
  80 + })
  81 + return
  82 + }
  83 + networkUtil.showLoading()
  84 + var param = { code: e.detail.value.code, phone: phone,'type':2 }
  85 + if (getApp().globalData.openInfo.mpid) {
  86 + param.gzopenid = getApp().globalData.openInfo.mpid
  87 + console.log('绑定mpid', param)
  88 + }
  89 + if (getApp().globalData.openInfo.code) {
  90 + param.jscode = getApp().globalData.openInfo.code
  91 + console.log('绑定code', param)
  92 + }
  93 + networkUtil._get(api.verifyCode, param, function (res) {
  94 + console.log(res)
  95 + self.loginSuccess(res.data)
  96 + }, function (res) {
  97 + networkUtil.showErrorToast(res.errormsg)
  98 + })
  99 + },
  100 + loginSuccess(data) {
  101 +
  102 + wx.navigateTo({
  103 + url: '../CompleteTouristInfo/CompleteTouristInfo?userId=' + data.id + '&token=' + data.token,
  104 + })
  105 + }
  106 +})
littleApp_child/pages/Register/Register.json View file @ 92fd0e4
  1 +{
  2 + "navigationBarBackgroundColor": "#48C17B",
  3 + "navigationBarTitleText": "游客注册",
  4 + "navigationBarTextStyle": "white",
  5 + "backgroundColor": "#d8dbd4"
  6 +}
littleApp_child/pages/Register/Register.wxml View file @ 92fd0e4
  1 +<view class="backgroundView" style="background: white">
  2 + <form catchsubmit="formSubmit">
  3 +
  4 + <view class="record-input-constainer whiteColor">
  5 + <view class="record-input_bg whiteColor" style="border-color:{{inputFocus.nameInput ? '#48C17B' : '#e8eae5'}}">
  6 + <label class="record-input_title">姓名</label>
  7 + <input class="input" id="name" name="name" maxlength="12" placeholder="请输入建档姓名" value="" placeholder-class="input-placeholder" bindfocus="getNameFocus" bindblur="loseNameFocus" bindinput="blurNameInput"/>
  8 + </view>
  9 + <view class="record-input_bg" style="margin-top:15px;border-color:{{inputFocus.phoneInput ? '#48C17B' : '#e8eae5'}}">
  10 + <label class="record-input_title">手机号</label>
  11 + <input class="input" id="phone" name="phone" type="number" placeholder="请输入建档手机号" maxlength="11" placeholder-class="input-placeholder" bindfocus="getPhoneFocus" value="" bindblur="losePhoneFocus" bindinput="blurInput" />
  12 + </view>
  13 +
  14 + <view class="code_view">
  15 + <view class="code-input_bg" style="margin-top:15px;border-color:{{inputFocus.codeInput ? '#48C17B' : '#e8eae5'}}">
  16 + <label class="record-input_title" >验证码</label>
  17 + <input class="input" id="code" name="code" maxlength="12" placeholder="请输入验证码" value="" placeholder-class="input-placeholder" bindblur="loseCodeFocus" bindfocus="getCodeFocus" />
  18 + </view>
  19 + <label class="record-time-text" bindtap="getVerifyCode">{{time == '0s' ? '点击获取' : time}}</label>
  20 + </view>
  21 +
  22 + </view>
  23 +
  24 + <button class="record-submit-btn" formType="submit">立即注册</button>
  25 + </form>
  26 +</view>
littleApp_child/pages/Register/Register.wxss View file @ 92fd0e4
  1 +@import "../home/css/login.wxss";
littleApp_child/pages/SearchPage/SearchPage.wxml View file @ 92fd0e4
... ... @@ -7,6 +7,11 @@
7 7 </view>
8 8 <view class="searchBar_bar_cancle" bindtap="back">取消</view>
9 9 </view>
  10 + <!-- 建议标签 -->
  11 + <view class="recommend_labels">
  12 + <view catchtap="clickLabel" data-categary="lable" class="recommend_label">什么东东</view>
  13 + <view class="recommend_label">什么东东啊</view>
  14 + </view>
10 15 <!-- 搜索历史 -->
11 16 <view class="history_list" wx:if="{{getSearch.length > 0 && !searching}}">
12 17 <view class="history_list_content">
littleApp_child/pages/SearchPage/SearchPage.wxss View file @ 92fd0e4
1 1 @import "../childcare_knowledge/childcare_knowledge.wxss";
2 2  
  3 +page {
  4 + height: calc(100% - 38px);
  5 +}
  6 +
3 7 .searchBar_bg {
4 8 background: #48C17B;
5 9 width: 100%;
... ... @@ -49,7 +53,6 @@
49 53 /* 列表 */
50 54 .history_list {
51 55 background: white;
52   - margin-top: 40px;
53 56 min-height: 288px;
54 57 display: flex;
55 58 flex-direction: column;
... ... @@ -109,5 +112,24 @@
109 112 display: -webkit-box;
110 113 -webkit-box-orient: vertical;
111 114 -webkit-line-clamp: 1;
  115 +}
  116 +
  117 +
  118 +/* 标签内容 */
  119 +.recommend_labels {
  120 + margin-top: 38px;
  121 + width: 100%;
  122 + background: white;
  123 +}
  124 +
  125 +.recommend_label {
  126 + font-size: 12px;
  127 + color: #58A478;
  128 + height: 18px;
  129 + display: inline-block;
  130 + margin-left: 8px;
  131 + background: #F2FDF7;
  132 + border-radius: 2px;
  133 + padding: 2px 5px 2px 5px;
112 134 }
littleApp_child/pages/feedback/feedback.wxml View file @ 92fd0e4
... ... @@ -7,15 +7,15 @@
7 7 <view class="type_text">选择反馈类型</view>
8 8 <view style="display: flex;margin-top:10px;">
9 9 <view class="type_choose1" bindtap="chooseOne">
10   - <image class="img" src="../../source/{{chooseOne==1 ? 'save_not.png':'like.png'}}"></image>
  10 + <image mode='aspectFit' class="img" src="../../source/{{chooseOne==1 ? 'checkBox_yes.png':'checkBox_no.png'}}"></image>
11 11 <text class="choose_text1">无法正常使用</text>
12 12 </view>
13 13 <view class="type_choose2" bindtap="chooseTwo">
14   - <image class="img" src="../../source/{{chooseTwo==1 ? 'save_not.png':'like.png'}}"></image>
  14 + <image mode='aspectFit' class="img" src="../../source/{{chooseTwo==1 ? 'checkBox_yes.png':'checkBox_no.png'}}"></image>
15 15 <text class="choose_text2">内容意见</text>
16 16 </view>
17 17 <view class="type_choose2" bindtap="chooseThree">
18   - <image class="img" src="../../source/{{chooseThree==1 ? 'save_not.png':'like.png'}}"></image>
  18 + <image mode='aspectFit' class="img" src="../../source/{{chooseThree==1 ? 'checkBox_yes.png':'checkBox_no.png'}}"></image>
19 19 <text class="choose_text2">其他反馈</text>
20 20 </view>
21 21 </view>
littleApp_child/pages/home/home.js View file @ 92fd0e4
... ... @@ -99,7 +99,7 @@
99 99 })
100 100 },
101 101 getNameFocus:function(){
102   - var self=this
  102 + var self = this
103 103 var inputFocus = { nameInput: true, phoneInput: false, codeInput: false }
104 104 self.setData({
105 105 inputFocus: inputFocus
106 106  
... ... @@ -189,11 +189,11 @@
189 189 this.getUserInfo()
190 190 },
191 191 // 获取用户信息
192   - getUserInfo() {
  192 + getUserInfo(userId) {
193 193 networkUtil.showLoading()
194 194 var self = this
195 195 var param = { 'token': app.globalData.token }
196   - networkUtil._get(api.userInfo + app.globalData.userId[0], {}, function (res) {
  196 + networkUtil._get(api.userInfo + app.globalData.currentId, {}, function (res) {
197 197 console.log('获取用户信息',res)
198 198 app.globalData.days = res.data.data.days
199 199 app.globalData.userInfo = res.data.data
200 200  
... ... @@ -246,10 +246,17 @@
246 246 })
247 247 },
248 248 /*---------------欢迎介绍页面---------------*/
  249 + toRegister(){
  250 + wx.navigateTo({
  251 + url: '../Register/Register',
  252 + })
  253 + },
249 254 // 获取验证码
250 255 getVerifyCode: function (e) {
251 256 console.log("name:" + name)
252 257 console.log("phone:" + phone)
  258 + // name = '小向阳'
  259 + // phone = '18202810912'
253 260 if (timeCount < 60) {
254 261 return
255 262 }
... ... @@ -336,6 +343,7 @@
336 343 wx.setStorageSync('hxPassWord', data.hxPassWord)
337 344 getApp().globalData.token = data.token
338 345 getApp().globalData.userId = data.patientIds
  346 + getApp().globalData.currentId = data.patientIds[0]
339 347 this.homePage()
340 348 }
341 349  
littleApp_child/pages/home/home.wxml View file @ 92fd0e4
... ... @@ -135,6 +135,7 @@
135 135 </view>
136 136  
137 137 <button class="we_button" bindtap="toLogin">身份验证</button>
  138 +
138 139 </view>
139 140  
140 141 <!-- 登录 -->
141 142  
142 143  
143 144  
... ... @@ -145,23 +146,23 @@
145 146 <view class="record-input-constainer whiteColor">
146 147 <view class="record-input_bg whiteColor" style="border-color:{{inputFocus.nameInput ? '#48C17B' : '#e8eae5'}}">
147 148 <label class="record-input_title">姓名</label>
148   - <input class="input" id="name" name="name" maxlength="12" placeholder="请输入建档姓名" value="" placeholder-class="input-placeholder" bindfocus="getNameFocus" bindblur="loseNameFocus" bindinput="blurNameInput"/>
  149 + <input class="input" id="name" name="name" maxlength="12" placeholder="请输入建档姓名" value="小向阳" placeholder-class="input-placeholder" bindfocus="getNameFocus" bindblur="loseNameFocus" bindinput="blurNameInput"/>
149 150 </view>
150 151 <view class="record-input_bg" style="margin-top:15px;border-color:{{inputFocus.phoneInput ? '#48C17B' : '#e8eae5'}}">
151 152 <label class="record-input_title">手机号</label>
152   - <input class="input" id="phone" name="phone" type="number" placeholder="请输入建档手机号" maxlength="11" placeholder-class="input-placeholder" bindfocus="getPhoneFocus" value="" bindblur="losePhoneFocus" bindinput="blurInput" />
  153 + <input class="input" id="phone" name="phone" type="number" placeholder="请输入建档手机号" maxlength="11" placeholder-class="input-placeholder" bindfocus="getPhoneFocus" value="18202810912" bindblur="losePhoneFocus" bindinput="blurInput" />
153 154 </view>
154 155  
155 156 <view class="code_view">
156 157 <view class="code-input_bg" style="margin-top:15px;border-color:{{inputFocus.codeInput ? '#48C17B' : '#e8eae5'}}">
157 158 <label class="record-input_title" >验证码</label>
158   - <input class="input" id="code" name="code" maxlength="12" placeholder="请输入验证码" value="" placeholder-class="input-placeholder" bindblur="loseCodeFocus" bindfocus="getCodeFocus" />
  159 + <input class="input" id="code" name="code" maxlength="12" placeholder="请输入验证码" value="666666" placeholder-class="input-placeholder" bindblur="loseCodeFocus" bindfocus="getCodeFocus" />
159 160 </view>
160 161 <label class="record-time-text" bindtap="getVerifyCode">{{time == '0s' ? '点击获取' : time}}</label>
161 162 </view>
162 163  
163 164 </view>
164   -
  165 + <view class="we_button" bindtap="toRegister">游客注册</view>
165 166 <button class="record-submit-btn" formType="submit">确认</button>
166 167 </form>
167 168 </view>
littleApp_child/pages/home/home.wxss View file @ 92fd0e4
... ... @@ -214,7 +214,7 @@
214 214 }
215 215 /* 文章ne内容背景 */
216 216 .article_content {
217   - height: 133px;
  217 + height: 134px;
218 218 position: relative;
219 219 width: 100%;
220 220 }
... ... @@ -265,7 +265,7 @@
265 265 .article_content_bottomBar_labels {
266 266 position: absolute;
267 267 right: 0px;
268   - height: 100%;
  268 + /* height: 100%; */
269 269 }
270 270  
271 271 .article_content_bottomBar_likes {
littleApp_child/pages/mySaved/mySaved.wxml View file @ 92fd0e4
... ... @@ -8,7 +8,7 @@
8 8  
9 9 <image wx:if="{{isShowCheckbox}}" class="check_image" src="../../source/{{item.checked ? 'checkBox_yes.png' :'checkBox_no.png'}}" mode='aspectFit' bindtap="checkboxChange" data-id="{{item.id}}" data-checked="{{item.checked}}"></image>
10 10 <view class="content_item">
11   - <view style="margin-right:90px;">
  11 + <view style="margin-right:75px;">
12 12 <view class="content_title">{{item.title}}</view>
13 13 <view class="content_content">{{item.introduction}}</view>
14 14 <view class="zarparent_box">
littleApp_child/utils/apiFile.js View file @ 92fd0e4
... ... @@ -37,6 +37,8 @@
37 37 // 7niu
38 38 kApiQiNiuImageToken:'v1/tokens/qiniu',
39 39 // 改用户信息
40   - kApiModifyMyInfo:'v1/users'
  40 + kApiModifyMyInfo:'v1/users',
  41 + // 游客用户信息
  42 + kTourisInfo: 'baby/users/',
41 43 }