Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wx-program
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈玉桐
wx-program
Commits
c771d7af
Commit
c771d7af
authored
Oct 25, 2019
by
陈玉桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
89878266
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
228 additions
and
145 deletions
+228
-145
app.json
app.json
+4
-4
childInfo.js
pages/childInfo/childInfo.js
+102
-62
childInfo.wxml
pages/childInfo/childInfo.wxml
+2
-2
eyesight.js
pages/eyesight/eyesight.js
+111
-73
eyesight.wxml
pages/eyesight/eyesight.wxml
+3
-3
user.wxml
pages/user/user.wxml
+6
-1
No files found.
app.json
View file @
c771d7af
{
"pages"
:
[
"pages/index/index"
,
"pages/trainReport/trainReport"
,
"pages/historyDetail/historyDetail"
,
"pages/updatePlan/updatePlan"
,
"pages/user/user"
,
"pages/eyesight/eyesight"
,
"pages/childInfo/childInfo"
,
"pages/setting/setting"
,
"pages/trainReport/trainReport"
,
"pages/historyDetail/historyDetail"
,
"pages/updatePlan/updatePlan"
,
"pages/plan/plan"
,
"pages/message/message"
,
"pages/trainSort/trainSort"
,
"pages/starSort/starSort"
,
"pages/user/user"
,
"pages/mine/mine"
,
"pages/idea/idea"
,
"pages/whiteList/whiteList"
,
...
...
pages/childInfo/childInfo.js
View file @
c771d7af
...
...
@@ -14,37 +14,61 @@ Page({
me
.
setData
({
ednDate
:
myDate
.
getFullYear
()
+
'-'
+
(
myDate
.
getMonth
()
+
1
)
+
'-'
+
myDate
.
getDate
()
})
// 请求前加Loading
wx
.
showLoading
({
title
:
'加载中'
,
mask
:
true
wx
.
getStorage
({
key
:
'name'
,
success
(
res
){
me
.
setData
({
name
:
res
.
data
})
}
})
wx
.
request
({
url
:
app
.
globalData
.
apiUrl
+
'Teenages/profile'
,
method
:
'POST'
,
data
:
{
token
:
wx
.
getStorageSync
(
'token'
),
},
success
:
function
(
res
)
{
// 请求成功后关闭Loading
wx
.
hideLoading
();
if
(
res
.
data
.
errno
==
200
){
if
(
res
.
data
.
data
){
me
.
setData
({
date
:
res
.
data
.
data
.
birthday
,
name
:
res
.
data
.
data
.
name
,
sex
:
res
.
data
.
data
.
gender
})
}
}
else
{
wx
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
res
.
data
.
msg
})
}
wx
.
getStorage
({
key
:
'birthday'
,
success
(
res
){
me
.
setData
({
date
:
res
.
data
})
}
})
wx
.
getStorage
({
key
:
'gender'
,
success
(
res
){
me
.
setData
({
sex
:
res
.
data
})
}
})
// // 请求前加Loading
// wx.showLoading({
// title: '加载中',
// mask: true
// })
// wx.request({
// url: app.globalData.apiUrl + 'Teenages/profile',
// method: 'POST',
// data: {
// token: wx.getStorageSync('token'),
// },
// success: function (res) {
// // 请求成功后关闭Loading
// wx.hideLoading();
// if(res.data.errno==200){
// if(res.data.data){
// me.setData({
// date: res.data.data.birthday,
// name: res.data.data.name,
// sex: res.data.data.gender
// })
// }
// }else{
// wx.showModal({
// title: '提示',
// showCancel: false,
// content: res.data.msg
// })
// }
// }
// })
},
bindDateChange
:
function
(
e
)
{
if
(
Number
(
new
Date
(
e
.
detail
.
value
))
>
Number
(
new
Date
())){
...
...
@@ -77,9 +101,6 @@ Page({
},
// 下一步
childInfoNext
:
function
(
e
)
{
console
.
log
(
this
.
data
.
name
)
console
.
log
(
this
.
data
.
date
)
console
.
log
(
this
.
data
.
sex
)
// 授权
if
(
e
.
detail
.
errMsg
!=
'getUserInfo:ok'
){
//拒绝授权
...
...
@@ -136,38 +157,56 @@ Page({
title
:
'加载中'
,
mask
:
true
})
wx
.
request
({
url
:
app
.
globalData
.
apiUrl
+
'teenages/info'
,
method
:
'POST'
,
data
:
{
token
:
wx
.
getStorageSync
(
'token'
),
name
:
me
.
data
.
name
,
birthday
:
me
.
data
.
date
,
gender
:
me
.
data
.
sex
,
//性别
},
success
:
function
(
res
)
{
// 请求成功后关闭Loading
wx
.
hideLoading
();
if
(
res
.
data
.
errno
==
200
){
// 绑定成功
wx
.
showToast
({
title
:
'填写成功'
,
mask
:
true
,
// icon: 'none',
duration
:
2000
});
wx
.
navigateTo
({
url
:
'/pages/eyesight/eyesight'
})
}
else
{
wx
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
res
.
data
.
msg
})
}
}
wx
.
setStorage
({
key
:
"name"
,
data
:
me
.
data
.
name
})
wx
.
setStorage
({
key
:
"birthday"
,
data
:
me
.
data
.
date
})
wx
.
setStorage
({
key
:
"gender"
,
data
:
me
.
data
.
sex
})
// 跳转第二步视力
wx
.
navigateTo
({
url
:
'/pages/eyesight/eyesight'
})
// wx.request({
// url: app.globalData.apiUrl + 'teenages/info',
// method: 'POST',
// data: {
// token: wx.getStorageSync('token'),
// name: me.data.name,
// birthday: me.data.date,
// gender: me.data.sex,//性别
// },
// success: function (res) {
// // 请求成功后关闭Loading
// wx.hideLoading();
// if(res.data.errno==200){
// // 绑定成功
// wx.showToast({
// title: '填写成功',
// mask: true,
// // icon: 'none',
// duration: 2000
// });
// wx.navigateTo({
// url: '/pages/eyesight/eyesight'
// })
// }else{
// wx.showModal({
// title: '提示',
// showCancel: false,
// content: res.data.msg
// })
// }
// }
// })
}
},
})
\ No newline at end of file
pages/childInfo/childInfo.wxml
View file @
c771d7af
...
...
@@ -5,8 +5,8 @@
<text class="tabSelected">完善信息</text>
<image src="../../assets/arrow_right.png" />
<text>初始视力</text>
<image src="../../assets/arrow_right.png" />
<text>训练设置</text>
<
!-- <
image src="../../assets/arrow_right.png" />
<text>训练设置</text>
-->
</view>
</view>
<!-- 背景 -->
...
...
pages/eyesight/eyesight.js
View file @
c771d7af
...
...
@@ -50,7 +50,11 @@ Page({
isClass
:
0
,
//是否配镜
date
:
'2012-01-01'
,
// 配镜日期
currentDate
:
''
currentDate
:
''
,
name
:
''
,
birthday
:
''
,
gender
:
''
,
},
onLoad
:
function
(
options
)
{
let
me
=
this
;
...
...
@@ -188,80 +192,114 @@ Page({
}
else
{
nearsightedTime
=
me
.
data
.
date
}
wx
.
request
({
url
:
app
.
globalData
.
apiUrl
+
'teenages/vision'
,
method
:
'POST'
,
data
:
{
token
:
wx
.
getStorageSync
(
'token'
),
leftEye
:
me
.
data
.
luoData
.
left
,
// 左眼裸眼视力
rightEye
:
me
.
data
.
luoData
.
right
,
// 右眼裸眼视力
leftCorrectedEye
:
me
.
data
.
jiaoData
.
left
,
// 左眼矫正视力
rightCorrectedEye
:
me
.
data
.
jiaoData
.
right
,
// 右眼矫正视力
leftGlassesDegree
:
me
.
data
.
glassData
.
left
,
// 左眼眼镜度数
rightGlassesDegree
:
me
.
data
.
glassData
.
right
,
// 右眼眼镜度数
leftOtherEyeStatus
:
me
.
data
.
allLeftStatus
,
// 左眼弱视、斜视、散光情况,1:有、0:无
rightOtherEyeStatus
:
me
.
data
.
allRightStatus
,
// 右眼弱视、斜视、散光情况,1:有、0:无
leftWeekEye
:
me
.
data
.
ruoData
.
left
,
// 左眼弱视程度
rightWeekEye
:
me
.
data
.
ruoData
.
right
,
// 右眼弱视程度
leftLeerEye
:
me
.
data
.
xieData
.
left
,
// 左眼斜视情况
rightLeerEye
:
me
.
data
.
xieData
.
right
,
// 右眼斜视情况
leftCylEye
:
me
.
data
.
sanData
.
left
,
// 左眼散光度数
rightCylEye
:
me
.
data
.
sanData
.
right
,
// 右眼散光度数
nearsightedStatus
:
me
.
data
.
isClass
,
// 佩戴眼镜情况 1:戴眼镜; 0:未戴眼镜
nearsightedTime
:
nearsightedTime
// 配镜时间
},
success
:
function
(
res
)
{
// 请求成功后关闭Loading
wx
.
hideLoading
();
if
(
res
.
data
.
errno
==
200
){
// 填写成功
wx
.
showToast
({
title
:
'填写成功'
,
mask
:
true
,
// icon: 'none',
duration
:
2000
});
wx
.
navigateTo
({
url
:
'/pages/setting/setting'
});
}
else
{
wx
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
res
.
data
.
msg
// 获取缓存的孩子信息
wx
.
getStorage
({
key
:
'name'
,
success
(
res
){
me
.
setData
({
name
:
res
.
data
})
}
})
wx
.
getStorage
({
key
:
'birthday'
,
success
(
res
){
me
.
setData
({
birthday
:
res
.
data
})
}
})
wx
.
getStorage
({
key
:
'gender'
,
success
(
res
){
me
.
setData
({
gender
:
res
.
data
})
wx
.
request
({
url
:
app
.
globalData
.
apiUrl
+
'teenages/addTeenage'
,
method
:
'POST'
,
data
:
{
token
:
wx
.
getStorageSync
(
'token'
),
name
:
me
.
data
.
name
,
birthday
:
me
.
data
.
birthday
,
gender
:
me
.
data
.
gender
,
//性别
leftEye
:
me
.
data
.
luoData
.
left
,
// 左眼裸眼视力
rightEye
:
me
.
data
.
luoData
.
right
,
// 右眼裸眼视力
leftCorrectedEye
:
me
.
data
.
jiaoData
.
left
,
// 左眼矫正视力
rightCorrectedEye
:
me
.
data
.
jiaoData
.
right
,
// 右眼矫正视力
leftGlassesDegree
:
me
.
data
.
glassData
.
left
,
// 左眼眼镜度数
rightGlassesDegree
:
me
.
data
.
glassData
.
right
,
// 右眼眼镜度数
leftOtherEyeStatus
:
me
.
data
.
allLeftStatus
,
// 左眼弱视、斜视、散光情况,1:有、0:无
rightOtherEyeStatus
:
me
.
data
.
allRightStatus
,
// 右眼弱视、斜视、散光情况,1:有、0:无
leftWeekEye
:
me
.
data
.
ruoData
.
left
,
// 左眼弱视程度
rightWeekEye
:
me
.
data
.
ruoData
.
right
,
// 右眼弱视程度
leftLeerEye
:
me
.
data
.
xieData
.
left
,
// 左眼斜视情况
rightLeerEye
:
me
.
data
.
xieData
.
right
,
// 右眼斜视情况
leftCylEye
:
me
.
data
.
sanData
.
left
,
// 左眼散光度数
rightCylEye
:
me
.
data
.
sanData
.
right
,
// 右眼散光度数
nearsightedStatus
:
me
.
data
.
isClass
,
// 佩戴眼镜情况 1:戴眼镜; 0:未戴眼镜
nearsightedTime
:
nearsightedTime
// 配镜时间
},
success
:
function
(
res
)
{
// 请求成功后关闭Loading
wx
.
hideLoading
();
if
(
res
.
data
.
errno
==
200
){
// 填写成功
wx
.
showToast
({
title
:
'填写成功'
,
mask
:
true
,
// icon: 'none',
duration
:
2000
});
wx
.
removeStorage
({
key
:
'name'
})
wx
.
removeStorage
({
key
:
'birthday'
})
wx
.
removeStorage
({
key
:
'gender'
})
// 跳转首页
wx
.
reLaunch
({
url
:
'/pages/index/index'
})
}
else
{
wx
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
res
.
data
.
msg
})
if
(
me
.
data
.
ruoData
.
left
==
''
){
me
.
setData
({
ruoData
:{
left
:
'无'
,
right
:
me
.
data
.
ruoData
.
right
}
})
}
if
(
me
.
data
.
ruoData
.
right
==
''
){
me
.
setData
({
ruoData
:{
left
:
me
.
data
.
ruoData
.
left
,
right
:
'无'
}
})
}
if
(
me
.
data
.
xieData
.
left
==
''
){
me
.
setData
({
xieData
:{
left
:
'无'
,
right
:
me
.
data
.
xieData
.
right
}
})
}
if
(
me
.
data
.
xieData
.
right
==
''
){
me
.
setData
({
xieData
:{
left
:
me
.
data
.
xieData
.
left
,
right
:
'无'
}
})
}
if
(
me
.
data
.
sanData
.
left
==
''
){
me
.
setData
({
sanData
:{
left
:
'无'
,
right
:
me
.
data
.
sanData
.
right
}
})
}
if
(
me
.
data
.
sanData
.
right
==
''
){
me
.
setData
({
sanData
:{
left
:
me
.
data
.
sanData
.
left
,
right
:
'无'
}
})
}
}
}
})
if
(
me
.
data
.
ruoData
.
left
==
''
){
me
.
setData
({
ruoData
:{
left
:
'无'
,
right
:
me
.
data
.
ruoData
.
right
}
})
}
if
(
me
.
data
.
ruoData
.
right
==
''
){
me
.
setData
({
ruoData
:{
left
:
me
.
data
.
ruoData
.
left
,
right
:
'无'
}
})
}
if
(
me
.
data
.
xieData
.
left
==
''
){
me
.
setData
({
xieData
:{
left
:
'无'
,
right
:
me
.
data
.
xieData
.
right
}
})
}
if
(
me
.
data
.
xieData
.
right
==
''
){
me
.
setData
({
xieData
:{
left
:
me
.
data
.
xieData
.
left
,
right
:
'无'
}
})
}
if
(
me
.
data
.
sanData
.
left
==
''
){
me
.
setData
({
sanData
:{
left
:
'无'
,
right
:
me
.
data
.
sanData
.
right
}
})
}
if
(
me
.
data
.
sanData
.
right
==
''
){
me
.
setData
({
sanData
:{
left
:
me
.
data
.
sanData
.
left
,
right
:
'无'
}
})
}
}
}
})
},
...
...
pages/eyesight/eyesight.wxml
View file @
c771d7af
...
...
@@ -5,8 +5,8 @@
<text>完善信息</text>
<image src="../../assets/arrow_right.png" />
<text class="tabSelected">初始视力</text>
<image src="../../assets/arrow_right.png" />
<text>训练设置</text>
<
!-- <
image src="../../assets/arrow_right.png" />
<text>训练设置</text>
-->
</view>
</view>
<view id="eyesightConWrap">
...
...
@@ -108,7 +108,7 @@
<view class="eyesightPos">
<view id="eyesightBox">
<!-- <button id="eyesightBack" bindtap='eyesightBack'>上一步</button> -->
<button id="eyesightNext" bindtap='eyesightNext'>
下一步
</button>
<button id="eyesightNext" bindtap='eyesightNext'>
保存
</button>
</view>
</view>
<view id="eyesightPopup" hidden="{{flag}}">
...
...
pages/user/user.wxml
View file @
c771d7af
...
...
@@ -8,9 +8,14 @@
</view>
<view class="userItemTopDes">
<view><text>{{item.gender}}生 </text><text>{{item.age}}岁</text></view>
<view>视力情况:右眼 {{item.rightEye}} | 左眼 {{item.leftEye}}</view>
<view>裸眼视力:右眼 {{item.rightEye}} | 左眼 {{item.leftEye}}</view>
<!-- <view wx:if="{{(item.leftCorrectedEye!=''&&item.leftCorrectedEye!='0.0')||(item.rightCorrectedEye!=''&&item.rightCorrectedEye!='0.0')}}">矫正视力:右眼 {{item.leftCorrectedEye}} | 左眼 {{item.rightCorrectedEye}}</view>
<view wx:if="{{(item.leftWeekEye!=''&&item.leftWeekEye!='无')||(item.rightWeekEye!=''&&item.rightWeekEye!='无')}}">弱视程度:右眼 {{item.leftWeekEye}} | 左眼 {{item.rightWeekEye}}</view>
<view>斜视情况:右眼 {{item.leftLeerEye}} | 左眼 {{item.rightLeerEye}}</view>
<view>散光度数:右眼 {{item.leftCylEye}} | 左眼 {{item.rightCylEye}}</view> -->
<view>配镜情况:<text wx:if="{{item.nearsightedStatus==1}}">已配镜</text><text wx:else>未配镜</text></view>
<view wx:if="{{item.nearsightedStatus==1}}">配镜日期:{{item.nearsightedTime}}</view>
<!-- <view>眼镜度数:右眼 {{item.leftGlassesDegree}} | 左眼 {{item.rightGlassesDegree}}</view> -->
</view>
</view>
<view class="userItemBom">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment