Commit c5e74f79 by 陈玉桐

fix

parent 5e5b7bc2
{
"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",
......
......@@ -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
......
......@@ -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-09-01" bindchange="bindDateChange">
<picker mode="date" value="{{date}}" start="1990-09-01" end="2025-01-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>
......
......@@ -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
}
......
......@@ -66,11 +66,17 @@ page{
display: block;
left: 0;
bottom: 0;
width: 100%;
width: 180rpx;
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment