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
c5e74f79
Commit
c5e74f79
authored
Oct 15, 2019
by
陈玉桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5e5b7bc2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
17 deletions
+75
-17
app.json
app.json
+1
-1
childInfo.js
pages/childInfo/childInfo.js
+59
-10
childInfo.wxml
pages/childInfo/childInfo.wxml
+3
-3
index.js
pages/index/index.js
+5
-2
index.wxss
pages/index/index.wxss
+7
-1
No files found.
app.json
View file @
c5e74f79
{
"pages"
:
[
"pages/index/index"
,
"pages/childInfo/childInfo"
,
"pages/historyDetail/historyDetail"
,
"pages/trainReport/trainReport"
,
"pages/starSort/starSort"
,
"pages/updatePlan/updatePlan"
,
"pages/trainSort/trainSort"
,
"pages/eyesight/eyesight"
,
"pages/childInfo/childInfo"
,
"pages/setting/setting"
,
"pages/user/user"
,
"pages/plan/plan"
,
...
...
pages/childInfo/childInfo.js
View file @
c5e74f79
...
...
@@ -3,17 +3,57 @@ Page({
data
:
{
name
:
''
,
//姓名
date
:
'2010-01-01'
,
// 生日
sex
:
1
,
// 性别
sexList
:
[{
id
:
1
,
checked
:
true
,
name
:
'男孩'
},
{
id
:
2
,
name
:
'女孩'
}],
isNull
:
false
sex
:
''
,
// 性别
sexList
:
[{
id
:
1
,
name
:
'男孩'
},
{
id
:
2
,
name
:
'女孩'
}],
isNull
:
false
,
},
onLoad
:
function
(
options
)
{
let
me
=
this
;
// 请求前加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
){
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
)
{
this
.
setData
({
date
:
e
.
detail
.
value
})
if
(
Number
(
new
Date
(
e
.
detail
.
value
))
>
Number
(
new
Date
())){
wx
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
'生日不可大于今天的日期'
})
this
.
setData
({
date
:
'2010-01-01'
})
}
else
{
this
.
setData
({
date
:
e
.
detail
.
value
})
}
},
// 改变性别
sexTap
:
function
(
e
)
{
...
...
@@ -30,7 +70,9 @@ Page({
},
// 下一步
childInfoNext
:
function
(
e
)
{
console
.
log
(
11111
)
console
.
log
(
this
.
data
.
name
)
console
.
log
(
this
.
data
.
date
)
console
.
log
(
this
.
data
.
sex
)
// 授权
if
(
e
.
detail
.
errMsg
!=
'getUserInfo:ok'
){
//拒绝授权
...
...
@@ -70,9 +112,16 @@ Page({
me
.
setData
({
isNull
:
true
})
wx
.
showToast
({
title
:
'姓名不能为空!'
,
icon
:
'none'
wx
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
'姓名不能为空'
})
}
else
if
(
me
.
data
.
sex
==
''
){
//性别未选择
wx
.
showModal
({
title
:
'提示'
,
showCancel
:
false
,
content
:
'请选择性别'
})
}
else
{
// 请求前加Loading
...
...
pages/childInfo/childInfo.wxml
View file @
c5e74f79
...
...
@@ -17,12 +17,12 @@
<view id="childInfoList">
<view class="childInfoListItem">
<view class="childInfoListItemTitle {{isNull?'redTitle':''}}"><text>* </text>姓名</view>
<input
class="nameInput rightInput" maxlength="20
" placeholder-style="color:#CDCDCD;" bindinput="nameInput" placeholder="请输入您的孩子的真实姓名" />
<input
value="{{name}}" class="nameInput rightInput" maxlength="18
" placeholder-style="color:#CDCDCD;" bindinput="nameInput" placeholder="请输入您的孩子的真实姓名" />
</view>
<!-- 生日 -->
<view class="childInfoListItem">
<view class="childInfoListItemTitle"><text>* </text>生日</view>
<picker mode="date" value="{{date}}" start="1990-09-01" end="2025-0
9
-01" bindchange="bindDateChange">
<picker mode="date" value="{{date}}" start="1990-09-01" end="2025-0
1
-01" bindchange="bindDateChange">
<view class="birthdaypPicker rightInput">
{{date}}
</view>
...
...
@@ -33,7 +33,7 @@
<view class="childInfoListItemTitle"><text>* </text>性别</view>
<radio-group id="sexRadioBox" class="rightInput" bindchange="sexTap">
<label class="sexRadio" wx:for="{{sexList}}" wx:key="sexList">
<radio color="#fff" value="{{item.id}}" checked="{{item.
checked}}"
/>{{item.name}}
<radio color="#fff" value="{{item.id}}" checked="{{item.
id==sex}}"
/>{{item.name}}
</label>
</radio-group>
</view>
...
...
pages/index/index.js
View file @
c5e74f79
...
...
@@ -473,10 +473,13 @@ Page({
return
}
// 没有视力信息跳转
初始视力
// 没有视力信息跳转
初始视力 都跳转完善信息
if
(
res
.
data
.
errno
==
4001
){
// wx.redirectTo({
// url: '/pages/eyesight/eyesight'
// })
wx
.
redirectTo
({
url
:
'/pages/
eyesight/eyesight
'
url
:
'/pages/
childInfo/childInfo
'
})
return
}
...
...
pages/index/index.wxss
View file @
c5e74f79
...
...
@@ -66,11 +66,17 @@ page{
display: block;
left: 0;
bottom: 0;
width: 1
00%
;
width: 1
80rpx
;
text-align: center;
line-height: 60rpx;
color: #111;
font-size: 28rpx;
overflow: hidden;
height: 100%;
white-space: nowrap;/*设置不换行*/
overflow: hidden; /*设置隐藏*/
text-overflow: ellipsis; /*设置隐藏部分为省略号*/
padding: 0 10rpx;
}
/* .userTabItem:first-child{
margin-left: -10rpx;
...
...
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