Commit 7dd0edf6 by 陈玉桐

add 所有页面

parent eb6149a6
{ {
"pages": [ "pages": [
"pages/index/index",
"pages/historyDetail/historyDetail",
"pages/user/user",
"pages/mine/mine", "pages/mine/mine",
"pages/idea/idea", "pages/idea/idea",
"pages/index/index", "pages/message/message",
"pages/childInfo/childInfo",
"pages/getCodeIndex/getCodeIndex",
"pages/login/login",
"pages/setting/setting",
"pages/ruleSet/ruleSet",
"pages/mustUpdate/mustUpdate",
"pages/bindEquipment/bindEquipment",
"pages/targetList/targetList",
"pages/updatePlan/updatePlan", "pages/updatePlan/updatePlan",
"pages/plan/plan", "pages/plan/plan",
"pages/historyDetail/historyDetail", "pages/trainReport/trainReport",
"pages/trainHistory/trainHistory", "pages/starSort/starSort",
"pages/trainSort/trainSort",
"pages/eyesight/eyesight", "pages/eyesight/eyesight",
"pages/whiteList/whiteList" "pages/setting/setting",
"pages/whiteList/whiteList",
"pages/childInfo/childInfo",
"pages/targetList/targetList"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
assets/arrow_down.png

4.19 KB | W: | H:

assets/arrow_down.png

264 Bytes | W: | H:

assets/arrow_down.png
assets/arrow_down.png
assets/arrow_down.png
assets/arrow_down.png
  • 2-up
  • Swipe
  • Onion skin
assets/gameIcon.png

1.5 KB | W: | H:

assets/gameIcon.png

412 Bytes | W: | H:

assets/gameIcon.png
assets/gameIcon.png
assets/gameIcon.png
assets/gameIcon.png
  • 2-up
  • Swipe
  • Onion skin
assets/happyIcon.png

430 Bytes | W: | H:

assets/happyIcon.png

488 Bytes | W: | H:

assets/happyIcon.png
assets/happyIcon.png
assets/happyIcon.png
assets/happyIcon.png
  • 2-up
  • Swipe
  • Onion skin
assets/manage_game.png

1.5 KB | W: | H:

assets/manage_game.png

406 Bytes | W: | H:

assets/manage_game.png
assets/manage_game.png
assets/manage_game.png
assets/manage_game.png
  • 2-up
  • Swipe
  • Onion skin
assets/manage_study.png

1.08 KB | W: | H:

assets/manage_study.png

561 Bytes | W: | H:

assets/manage_study.png
assets/manage_study.png
assets/manage_study.png
assets/manage_study.png
  • 2-up
  • Swipe
  • Onion skin
assets/manage_video.png

430 Bytes | W: | H:

assets/manage_video.png

462 Bytes | W: | H:

assets/manage_video.png
assets/manage_video.png
assets/manage_video.png
assets/manage_video.png
  • 2-up
  • Swipe
  • Onion skin
assets/power.png

1023 Bytes | W: | H:

assets/power.png

864 Bytes | W: | H:

assets/power.png
assets/power.png
assets/power.png
assets/power.png
  • 2-up
  • Swipe
  • Onion skin
assets/studyIcon.png

1.08 KB | W: | H:

assets/studyIcon.png

643 Bytes | W: | H:

assets/studyIcon.png
assets/studyIcon.png
assets/studyIcon.png
assets/studyIcon.png
  • 2-up
  • Swipe
  • Onion skin
assets/task_incomplete.png

619 Bytes | W: | H:

assets/task_incomplete.png

652 Bytes | W: | H:

assets/task_incomplete.png
assets/task_incomplete.png
assets/task_incomplete.png
assets/task_incomplete.png
  • 2-up
  • Swipe
  • Onion skin
<view id="bind">
<!-- 步骤进度 -->
<view id="bindTabWrap">
<view id="bindTab">
<text class="bindTabSelected">绑定设备</text>
<!-- <image src="../../assets/arrow_right.png" />
<text>链接网络</text> -->
<image src="../../assets/arrow_right.png" />
<text>完善信息</text>
</view>
</view>
<view id="bindBox">
<image id="bindBoxBg" src="../../assets/bind_bg.png" />
<view id="equipmentIdCon">
<text>设备编号:</text>
<text id="equipmentId">{{equipmentId}}</text>
</view>
</view>
<view id="bindTip">
<view>温馨提示:</view>
<view>使用家长端绑定SeeX,让您实时查看孩子的训练情况,由您掌控孩子的训练计划,使用的应用等</view>
</view>
<view id="bindBtn">
<button class="noBindBtn" bindtap='noBind'>暂不绑定</button>
<button class="nowBindBtn" bindtap="bindEquipment">绑定设备</button>
</view>
</view>
#bind{
background: #EFEFF4;
min-height: 100vh;
}
#bindTabWrap{
padding: 40rpx 30rpx;
}
#bindTab{
background: #fff;
display: flex;
align-items: center;
justify-content: center;
border-radius: 52rpx;
height: 104rpx;
padding: 0 55rpx;
}
#bindTab>text{
color: #CDCDCD;
font-size: 34rpx;
}
#bindTab>image{
width: 34rpx;
height: 34rpx;
margin: 0 90rpx;
}
#bindTab>.bindTabSelected{
color: #33D1C4;
}
/* 设备号背景 */
#bindBox{
height: 579rpx;
position: relative;
}
#bindBoxBg{
width: 100%;
height: 100%;
}
#equipmentIdCon{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width:570rpx;
height: 170rpx;
line-height: 170rpx;
text-align: center;
font-size: 34rpx;
color: #F8F8F8;
border: 2rpx solid #F8F8F8;
border-radius: 10rpx;
}
/* 提示 */
#bindTip{
font-size: 28rpx;
color: #4F5051;
padding: 30rpx 30rpx 0;
}
#bindBtn{
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 100rpx;
padding: 0 40rpx;
}
#bindBtn .noBindBtn,#bindBtn .nowBindBtn{
width: 315rpx;
height: 94rpx;
line-height: 94rpx;
font-size: 36rpx;
border-radius: 10rpx;
margin: 0;
}
button::after{
border: 0;
}
#bindBtn .noBindBtn{
color: #000000;
color: #555;
background: #F8F8F8;
border: 2rpx solid rgba(5,5,5,0.10);
}
#bindBtn .nowBindBtn{
background: #33D1C4;
color: #fff;
}
\ No newline at end of file
...@@ -4,23 +4,12 @@ Page({ ...@@ -4,23 +4,12 @@ Page({
name: '',//姓名 name: '',//姓名
date: '2010-01-01',// 生日 date: '2010-01-01',// 生日
sex: 1,// 性别 sex: 1,// 性别
school: '',// 学校
class: '',// 班级
sexList: [{ id: 1, checked: true, name: '男孩' }, { id: 2, name: '女孩' }], sexList: [{ id: 1, checked: true, name: '男孩' }, { id: 2, name: '女孩' }],
// adapterSource: , //本地匹配源
// bindSource: [], //绑定到页面的数据,根据用户输入动态变化
// hideScroll: true,
isNull: false isNull: false
}, },
onLoad: function (options) { onLoad: function (options) {
let me = this; let me = this;
}, },
childInfoBack: function() {
let me = this;
wx.navigateTo({
url: '/pages/network/network'
})
},
bindDateChange: function(e) { bindDateChange: function(e) {
this.setData({ this.setData({
date: e.detail.value date: e.detail.value
...@@ -33,92 +22,49 @@ Page({ ...@@ -33,92 +22,49 @@ Page({
}) })
console.log(e.detail.value) console.log(e.detail.value)
}, },
// schoolInput: function (e) {
// let me = this;
// // 检测拼音输入结束后
// if(e.detail.cursor != me.data.cursor){
// me.setData({
// cursor: e.detail.cursor
// });
// //用户实时输入值
// var prefix = e.detail.value
// // console.log(prefix)
// // 假设现在需要检测到用户输入的值,用户 400 毫秒内没有继续输入就将该值打印出来
// me.throttle(me.queryData, null, 400, prefix);
// }
// },
// // 节流
//   throttle: function(fn, context, delay, text) {
//     clearTimeout(fn.timeoutId);
//     fn.timeoutId = setTimeout(function () {
//       fn.call(context, text);
//     }, delay);
//   },
// //匹配的结果
// queryData: function(prefix){
// let me = this;
// console.log(prefix)// 此处打印出来的就是 用户输入的值
// if(prefix==''){
// me.setData({
// // 输入内容为空,关闭下拉列表
// hideScroll: true,
// bindSource: []
// })
// return
// }
// // 如果匹配结果存在,那么将其返回,相反则返回空数组
// // 模拟请求获取newSource
// setTimeout(function(){
// var newSource = ["weixin", "wechat", "wechatandroid", "wechat程序", "wechat众号", "wechat工具"]
// if (newSource.length != 0) {
// me.setData({
// // 匹配结果存在,显示自动联想词下拉列表
// hideScroll: false,
// bindSource: newSource,
// arrayHeight: newSource.length * 71
// })
// } else {
// me.setData({
// // 匹配无结果,不现实下拉列表
// hideScroll: true,
// bindSource: []
// })
// }
// },100)
// },
// 用户点击选择某个联想字符串时,获取该联想词,并清空提醒联想词数组
// itemtap: function (e) {
// this.setData({
// // .id在wxml中被赋值为{{item}},即当前遍历的元素值
// school: e.target.id,
// // 当用户选择某个联想词,隐藏下拉列表
// hideScroll: true,
// bindSource: []
// })
// },
ccctap: function (e) {
if(e.target.id==''||e.target.id=='childInfo'||e.target.id=='childInfoNext'||e.target.id=='bindTab'||e.target.id=='childInfoTips'||e.target.id=='childInfoBox'||e.target.id=='childInfoBack'){
this.setData({
hideScroll: true,
bindSource: []
})
}
},
nameInput: function (e) { nameInput: function (e) {
this.setData({ this.setData({
isNull: false, isNull: false,
name: e.detail.value name: e.detail.value
}) })
}, },
classInput: function (e) {
this.setData({
class: e.detail.value
})
},
// 下一步 // 下一步
childInfoNext: function () { childInfoNext: function (e) {
console.log(11111)
// 授权
if(e.detail.errMsg!='getUserInfo:ok'){
//拒绝授权
console.log(e.detail.errMsg)
return
}
//授权成功后
console.log(e.detail.userInfo)
wx.request({
url: app.globalData.apiUrl + '/users/addSmallProgramUser',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
avatarUrl: e.detail.userInfo.avatarUrl,
city: e.detail.userInfo.city,
country: e.detail.userInfo.country,
gender: e.detail.userInfo.gender,
language: e.detail.userInfo.language,
nickName: e.detail.userInfo.nickName,
province: e.detail.userInfo.province
},
success: function (res) {
if(res.data.errno==200){
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
let me = this; let me = this;
if(me.data.name==''){// 没填姓名高亮 if(me.data.name==''){// 没填姓名高亮
me.setData({ me.setData({
...@@ -142,8 +88,6 @@ Page({ ...@@ -142,8 +88,6 @@ Page({
name: me.data.name, name: me.data.name,
birthday: me.data.date, birthday: me.data.date,
gender: me.data.sex,//性别 gender: me.data.sex,//性别
schoolName: me.data.school,//学校
classesName: me.data.class//班级
}, },
success: function (res) { success: function (res) {
// 请求成功后关闭Loading // 请求成功后关闭Loading
...@@ -169,5 +113,5 @@ Page({ ...@@ -169,5 +113,5 @@ Page({
} }
}) })
} }
} },
}) })
\ No newline at end of file
<view id="childInfo" bindtap="ccctap"> <view id="childInfo">
<!-- 导航 --> <!-- 步骤进度 -->
<view id="bindTabWrap"> <view id="tabWrap">
<view id="bindTab"> <view id="tab">
<text>绑定设备</text> <text class="tabSelected">完善信息</text>
<image src="../../assets/arrow_right.png" /> <image src="../../assets/arrow_right.png" />
<text class="bindTabSelected">完善信息</text> <text>初始视力</text>
<image src="../../assets/arrow_right.png" />
<text>训练设置</text>
</view>
</view> </view>
<!-- 背景 -->
<view id="infoBg">
<image src="../../assets/pic_kv.png"></image>
</view> </view>
<!-- 基本信息 --> <!-- 基本信息 -->
<view id="childInfoListTitle">基本信息</view>
<view id="childInfoList"> <view id="childInfoList">
<view class="childInfoListItem"> <view class="childInfoListItem">
<view class="childInfoListItemTitle {{isNull?'redTitle':''}}"><text>*</text>姓名</view> <view class="childInfoListItemTitle {{isNull?'redTitle':''}}"><text>* </text>姓名</view>
<input class="nameInput rightInput" placeholder-style="color:#CDCDCD;" bindinput="nameInput" placeholder="请输入您的孩子的真实姓名" /> <input class="nameInput rightInput" maxlength="20" placeholder-style="color:#CDCDCD;" bindinput="nameInput" placeholder="请输入您的孩子的真实姓名" />
</view> </view>
<!-- 生日 --> <!-- 生日 -->
<view class="childInfoListItem"> <view class="childInfoListItem">
<view class="childInfoListItemTitle"><text>*</text>生日</view> <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-09-01" bindchange="bindDateChange">
<view class="birthdaypPicker rightInput"> <view class="birthdaypPicker rightInput">
{{date}} {{date}}
...@@ -25,41 +30,17 @@ ...@@ -25,41 +30,17 @@
</view> </view>
<!-- 性别 --> <!-- 性别 -->
<view class="childInfoListItem"> <view class="childInfoListItem">
<view class="childInfoListItemTitle"><text>*</text>性别</view> <view class="childInfoListItemTitle"><text>* </text>性别</view>
<radio-group id="sexRadioBox" class="rightInput" bindchange="sexTap"> <radio-group id="sexRadioBox" class="rightInput" bindchange="sexTap">
<label class="sexRadio" wx:for="{{sexList}}" wx:key="sexList"> <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.checked}}"/>{{item.name}}
</label> </label>
</radio-group> </radio-group>
</view> </view>
<!-- 学校 -->
<view class="childInfoListItem">
<text class="childInfoListItemTitle">学校</text>
<view class="childInfoListSchool rightInput">
<view>
<input class="textinput rightInput" cursor-spacing="200" placeholder-style="color:#CDCDCD;" value="{{school}}" placeholder="例:省市-区县-校名(选填)" />
</view>
<!-- <scroll-view scroll-y="true" class="locationPull rightInput" hidden="{{hideScroll}}" style="{{arrayHeight>280?'height:280rpx':''}}">
<view class="locationPullItem" id="{{item}}" bindtap="itemtap" wx:for="{{bindSource}}" wx:key="bindSource">
{{item}}
</view>
</scroll-view> -->
</view>
</view>
<!-- 班级 -->
<view class="childInfoListItem">
<text class="childInfoListItemTitle">班级</text>
<input class="rightInput" placeholder-style="color:#CDCDCD;" bindinput="classInput" placeholder="例:三年级5班(选填)" />
</view>
</view>
<!-- 提示 -->
<view id="childInfoTips">
请您如实填写本页信息,这将帮助我们为您或您的孩子提供更科学有效的眼部健康管理。
</view> </view>
<view id="childInfoBoxCon"> <view id="childInfoBoxCon">
<view id="childInfoBox"> <view id="childInfoBox">
<button id="childInfoBack" bindtap='childInfoBack'>上一步</button> <button id="childInfoNext" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo='childInfoNext'>下一步</button>
<button id="childInfoNext" bindtap='childInfoNext'>下一步</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -2,42 +2,49 @@ ...@@ -2,42 +2,49 @@
background: #EFEFF4; background: #EFEFF4;
min-height: 100vh; min-height: 100vh;
} }
/* 导航 */ /* 导航 */
#bindTabWrap{ #tabWrap{
padding: 40rpx 30rpx; padding: 40rpx 25rpx;
} }
#bindTab{ #tab{
background: #fff; background: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 52rpx; border-radius: 52rpx;
height: 104rpx; height: 104rpx;
padding: 0 55rpx; padding: 0 30rpx;
} }
#bindTab>text{ #tab>text{
color: #CDCDCD;
font-size: 34rpx; font-size: 34rpx;
color: #4F5051;
} }
#bindTab>image{ #tab>image{
width: 34rpx; width: 34rpx;
height: 34rpx; height: 34rpx;
margin: 0 90rpx; margin: 0 20rpx;
} }
#bindTab>.bindTabSelected{ #tab>.tabSelected{
color: #33D1C4; color: #33D1C4;
} }
/* 背景 */
#infoBg{
padding-bottom: 20rpx;
}
#infoBg>image{
width: 100%;
height: 430rpx;
}
/* 信息列表 */ /* 信息列表 */
#childInfoList{ #childInfoList{
background: #fff; background: #fff;
padding-left: 25rpx; padding-left: 25rpx;
} }
#childInfoListTitle{
font-size: 28rpx;
color: #4F5051;
padding: 0 0 20rpx 25rpx;
}
.childInfoListItem{ .childInfoListItem{
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -81,7 +88,7 @@ radio .wx-radio-input.wx-radio-input-checked::before{ ...@@ -81,7 +88,7 @@ radio .wx-radio-input.wx-radio-input-checked::before{
.childInfoListItem .childInfoListItemTitle{ .childInfoListItem .childInfoListItemTitle{
font-size: 34rpx; font-size: 34rpx;
color: #4F5051; color: #4F5051;
width: 100rpx; width: 115rpx;
text-align: right; text-align: right;
margin-right: 52rpx; margin-right: 52rpx;
} }
...@@ -126,9 +133,8 @@ radio .wx-radio-input.wx-radio-input-checked::before{ ...@@ -126,9 +133,8 @@ radio .wx-radio-input.wx-radio-input-checked::before{
/* 按钮组 */ /* 按钮组 */
#childInfoBoxCon{ #childInfoBoxCon{
position: absolute;
bottom: 80rpx;
width: 100%; width: 100%;
padding: 40rpx 0;
} }
#childInfoBox{ #childInfoBox{
display: flex; display: flex;
...@@ -136,17 +142,12 @@ radio .wx-radio-input.wx-radio-input-checked::before{ ...@@ -136,17 +142,12 @@ radio .wx-radio-input.wx-radio-input-checked::before{
padding:0 40rpx; padding:0 40rpx;
} }
#childInfoBox>button{ #childInfoBox>button{
width: 315rpx; width: 100%;
height: 94rpx; height: 94rpx;
line-height: 94rpx; line-height: 94rpx;
font-size: 36rpx; font-size: 36rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
#childInfoBack{
background: #F8F8F8;
border: 2rpx solid rgba(5,5,5,0.10);
color: #000000;
}
#childInfoNext{ #childInfoNext{
color: #fff; color: #fff;
background: #33D1C4; background: #33D1C4;
......
...@@ -7,9 +7,9 @@ Page({ ...@@ -7,9 +7,9 @@ Page({
luoData: {left: '',right: ''},//裸眼视力 luoData: {left: '',right: ''},//裸眼视力
jiaoData: {left: '',right: ''},//矫正视力 jiaoData: {left: '',right: ''},//矫正视力
glassData: {left: '',right: ''},//眼镜度数 glassData: {left: '',right: ''},//眼镜度数
ruoData: {left: '',right: ''},// 弱视 ruoData: {left: '无',right: '无'},// 弱视
xieData: {left: '',right: ''},// 斜视 xieData: {left: '无',right: '无'},// 斜视
sanData: {left: '',right: ''},// 散光 sanData: {left: '无',right: '无'},// 散光
luoeyeArray: [ luoeyeArray: [
['4.0','4.1','4.2','4.3','4.4','4.5','4.6','4.7','4.8','4.9','-','5.0','5.1','5.2','5.3'], ['4.0','4.1','4.2','4.3','4.4','4.5','4.6','4.7','4.8','4.9','-','5.0','5.1','5.2','5.3'],
['4.0','4.1','4.2','4.3','4.4','4.5','4.6','4.7','4.8','4.9','-','5.0','5.1','5.2','5.3'] ['4.0','4.1','4.2','4.3','4.4','4.5','4.6','4.7','4.8','4.9','-','5.0','5.1','5.2','5.3']
...@@ -46,6 +46,9 @@ Page({ ...@@ -46,6 +46,9 @@ Page({
allLeftStatus: 0,// 多个集合左(状态) allLeftStatus: 0,// 多个集合左(状态)
allRightStatus: 0,// 多个集合右(状态) allRightStatus: 0,// 多个集合右(状态)
first: true,// 是否第一次点击下一步 first: true,// 是否第一次点击下一步
isClass: 0, //是否配镜
date: '2012-01-01',// 配镜日期
}, },
onLoad: function (options) { onLoad: function (options) {
let me = this; let me = this;
...@@ -97,7 +100,7 @@ Page({ ...@@ -97,7 +100,7 @@ Page({
// 第一次点击没有视觉缺陷 // 第一次点击没有视觉缺陷
console.log('第一次没有----下一步') console.log('第一次没有----下一步')
me.next(); me.next();
}, 2000) }, 50)
} }
}else{ }else{
// 请求前加Loading // 请求前加Loading
...@@ -113,17 +116,54 @@ Page({ ...@@ -113,17 +116,54 @@ Page({
// 弹窗后----下一步 // 弹窗后----下一步
console.log('弹窗后----下一步') console.log('弹窗后----下一步')
me.next(); me.next();
}, 2000) }, 50)
} }
}, },
// 下一步请求 // 下一步请求
next: function(e){ next: function(e){
let me = this; let me = this;
// 请求前加Loading // 请求前加Loading
wx.showLoading({ // wx.showLoading({
title: '加载中', // title: '加载中',
mask: true // mask: true
// })
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: ''}
})
}
let nearsightedTime = ''
if(me.data.isClass==0){
nearsightedTime = ''
}else{
nearsightedTime = me.data.date
}
wx.request({ wx.request({
url: app.globalData.apiUrl + 'teenages/vision', url: app.globalData.apiUrl + 'teenages/vision',
method: 'POST', method: 'POST',
...@@ -142,7 +182,9 @@ Page({ ...@@ -142,7 +182,9 @@ Page({
leftLeerEye: me.data.xieData.left,// 左眼斜视情况 leftLeerEye: me.data.xieData.left,// 左眼斜视情况
rightLeerEye: me.data.xieData.right,// 右眼斜视情况 rightLeerEye: me.data.xieData.right,// 右眼斜视情况
leftCylEye: me.data.sanData.left,// 左眼散光度数 leftCylEye: me.data.sanData.left,// 左眼散光度数
rightCylEye: me.data.sanData.right// 右眼散光度数 rightCylEye: me.data.sanData.right,// 右眼散光度数
nearsightedStatus: me.data.isClass,// 佩戴眼镜情况 1:戴眼镜; 0:未戴眼镜
nearsightedTime: nearsightedTime// 配镜时间
}, },
success: function (res) { success: function (res) {
// 请求成功后关闭Loading // 请求成功后关闭Loading
...@@ -164,6 +206,37 @@ Page({ ...@@ -164,6 +206,37 @@ Page({
showCancel: false, showCancel: false,
content: res.data.msg 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: '无'}
})
}
} }
} }
}) })
...@@ -283,4 +356,22 @@ Page({ ...@@ -283,4 +356,22 @@ Page({
}) })
} }
}, },
// 是否配镜开关
classSwitch(e) {
console.log('是否配镜', e.detail.value)
if(e.detail.value){
this.setData({
isClass: 1
})
}else{
this.setData({
isClass: 0
})
}
},
bindDateChange: function(e) {
this.setData({
date: e.detail.value
})
},
}) })
\ No newline at end of file
<view id="eyesight"> <view id="eyesight">
<!-- 导航 --> <!-- 步骤进度 -->
<view id="bindTabWrap"> <view id="tabWrap">
<view id="bindTab"> <view id="tab">
<text>绑定设备</text> <text>完善信息</text>
<image src="../../assets/arrow_right.png" /> <image src="../../assets/arrow_right.png" />
<text class="bindTabSelected">完善信息</text> <text class="tabSelected">初始视力</text>
<image src="../../assets/arrow_right.png" />
<text>训练设置</text>
</view> </view>
</view> </view>
<view id="eyesightConWrap"> <view id="eyesightConWrap">
...@@ -25,24 +27,6 @@ ...@@ -25,24 +27,6 @@
</view> </view>
</picker> </picker>
</view> </view>
<view class="eyesightConItem">
<view class="eyesightConLeft">矫正视力</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="jiaoChange" value="{{jiaoIndex}}" range="{{jiaoArray}}">
<view class="eyesightConRight">
<view class="selItem">{{jiaoArray[0][jiaoIndex[0]]}}</view>
<view class="selItem">{{jiaoArray[1][jiaoIndex[1]]}}</view>
</view>
</picker>
</view>
<view class="eyesightConItem">
<view class="eyesightConLeft">眼镜度数</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="glassChange" value="{{glassIndex}}" range="{{glassArray}}">
<view class="eyesightConRight">
<view class="selItem">{{glassArray[0][glassIndex[0]]}}</view>
<view class="selItem">{{glassArray[1][glassIndex[1]]}}</view>
</view>
</picker>
</view>
<view class="eyesightConItem" bindtap="showList"> <view class="eyesightConItem" bindtap="showList">
<view class="eyesightConLeft">弱视、斜视、散光</view> <view class="eyesightConLeft">弱视、斜视、散光</view>
<view class="eyesightConRight"> <view class="eyesightConRight">
...@@ -50,7 +34,6 @@ ...@@ -50,7 +34,6 @@
<text class="selItem">{{allRight}}</text> <text class="selItem">{{allRight}}</text>
</view> </view>
</view> </view>
</view>
<view id="eyesightLast" hidden="{{!show}}"> <view id="eyesightLast" hidden="{{!show}}">
<view class="eyesightConItem"> <view class="eyesightConItem">
<view class="eyesightConLeft">· 弱视程度</view> <view class="eyesightConLeft">· 弱视程度</view>
...@@ -80,8 +63,49 @@ ...@@ -80,8 +63,49 @@
</picker> </picker>
</view> </view>
</view> </view>
<view class="eyesightConItem {{isClass==1 ? '' : 'eyesightConItemLast'}}">
<view class="eyesightConLeft">是否配镜</view>
<view class="eyesightConRight classConRight">
<switch color="#33D1C4" checked="{{isClass==1}}" bindchange="classSwitch"/>
</view>
</view>
<view hidden="{{isClass==0}}">
<view class="eyesightConItem">
<view class="eyesightConLeft">· 矫正视力</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="jiaoChange" value="{{jiaoIndex}}" range="{{jiaoArray}}">
<view class="eyesightConRight">
<view class="selItem">{{jiaoArray[0][jiaoIndex[0]]}}</view>
<view class="selItem">{{jiaoArray[1][jiaoIndex[1]]}}</view>
</view>
</picker>
</view>
<view class="eyesightConItem">
<view class="eyesightConLeft">· 眼镜度数</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="glassChange" value="{{glassIndex}}" range="{{glassArray}}">
<view class="eyesightConRight">
<view class="selItem">{{glassArray[0][glassIndex[0]]}}</view>
<view class="selItem">{{glassArray[1][glassIndex[1]]}}</view>
</view>
</picker>
</view>
<view class="eyesightConItem eyesightConItemLast">
<view class="eyesightConLeft">· 配镜日期</view>
<picker mode="date" value="{{date}}" start="1990-09-01" end="2025-09-01" class="selectorPicker" bindchange="bindDateChange">
<view class="eyesightConRight">
{{date}}
</view>
</picker>
</view>
</view>
</view>
</view>
<!-- 提示 -->
<view id="childInfoTips">
<view><image src="../../assets/icon_tips_s.png"></image></view>
<view>请您如实填写本页信息,这将帮助我们为您或您的孩子提供更科学有效的眼部健康管理。</view>
</view> </view>
<view class="{{show?'eyesightBom':'eyesightPos'}}"> <!-- <view class="{{show?'eyesightBom':'eyesightPos'}}"> -->
<view class="eyesightPos">
<view id="eyesightBox"> <view id="eyesightBox">
<button id="eyesightBack" bindtap='eyesightBack'>上一步</button> <button id="eyesightBack" bindtap='eyesightBack'>上一步</button>
<button id="eyesightNext" bindtap='eyesightNext'>下一步</button> <button id="eyesightNext" bindtap='eyesightNext'>下一步</button>
......
#eyesight{ #eyesight{
background:#EFEFF4; background:#EFEFF4;
min-height: 100vh; min-height: 100vh;
position: relative;
} }
/* 导航 */ /* 导航 */
#bindTabWrap{ #tabWrap{
padding: 40rpx 30rpx; padding: 40rpx 25rpx;
} }
#bindTab{ #tab{
background: #fff; background: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-radius: 52rpx; border-radius: 52rpx;
height: 104rpx; height: 104rpx;
padding: 0 55rpx; padding: 0 30rpx;
} }
#bindTab>text{ #tab>text{
color: #CDCDCD;
font-size: 34rpx; font-size: 34rpx;
color: #4F5051;
} }
#bindTab>image{ #tab>image{
width: 34rpx; width: 34rpx;
height: 34rpx; height: 34rpx;
margin: 0 90rpx; margin: 0 20rpx;
} }
#bindTab>.bindTabSelected{ #tab>.tabSelected{
color: #33D1C4; color: #33D1C4;
} }
#eyesightCon{
#eyesightCon,#eyesightLast{
color: #4F5051; color: #4F5051;
font-size: 34rpx; font-size: 34rpx;
background: #fff; background: #fff;
padding-left: 25rpx; padding-left: 25rpx;
} }
#eyesightLast{
color: #4F5051;
font-size: 34rpx;
background: #fff;
}
#eyesightCon{ #eyesightCon{
border-bottom: 2rpx solid #E5E5E5; border-bottom: 1rpx solid #E5E5E5;
} }
.eyesightConTitle{ .eyesightConTitle{
font-size: 32rpx; font-size: 32rpx;
padding-bottom: 20rpx; padding: 20rpx 0;
display: flex; display: flex;
padding-left: 25rpx; padding-left: 25rpx;
font-size: 28rpx; font-size: 28rpx;
...@@ -52,10 +57,10 @@ ...@@ -52,10 +57,10 @@
.eyesightConItem{ .eyesightConItem{
display: flex; display: flex;
padding-bottom: 52rpx; padding-bottom: 52rpx;
border-bottom: 2rpx solid #E5E5E5; border-bottom: 1rpx solid #E5E5E5;
padding: 32rpx 0 30rpx; padding: 32rpx 0 30rpx;
} }
.eyesightConItem:last-child{ .eyesightConItemLast{
border: 0; border: 0;
} }
.eyesightConLeft{ .eyesightConLeft{
...@@ -82,6 +87,13 @@ ...@@ -82,6 +87,13 @@
padding-right:30rpx; padding-right:30rpx;
} }
.classConRight{
justify-content: flex-end;
}
switch{
transform:scale(0.9);
}
/* 弹窗 */ /* 弹窗 */
#eyesightPopup{ #eyesightPopup{
position: absolute; position: absolute;
...@@ -121,13 +133,28 @@ ...@@ -121,13 +133,28 @@
line-height: 60rpx; line-height: 60rpx;
} }
/* 提示 */
#childInfoTips{
font-size: 28rpx;
color: #666;
padding-left: 25rpx;
margin-top: 30rpx;
display: flex;
}
#childInfoTips image{
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
margin-top: 4rpx;
}
/* 按钮组 */ /* 按钮组 */
.eyesightBom{ .eyesightBom{
padding: 20rpx 0 80rpx; padding: 20rpx 0 80rpx;
} }
.eyesightPos{ .eyesightPos{
position: absolute; padding: 40rpx 0;
bottom: 80rpx;
width: 100%; width: 100%;
} }
#eyesightBox{ #eyesightBox{
......
var app = getApp();
Page({
data: {
},
onLoad: function () {
},
// 扫码绑定
scanBind: function (e) {
let me = this;
wx.scanCode({ //扫描API
success(res) { //扫描成功
console.log(res.result)
wx.request({
url: app.globalData.apiUrl + 'devices/seexSn',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
url: res.result
},
success: function (res) {
if(res.data.errno==200){
console.log(res.data.data.seexSn)
// 获取设备码后跳转到绑定页面
wx.navigateTo({
url: '/pages/bindEquipment/bindEquipment?equipmentId='+res.data.data.seexSn
})
}else{
// 打印错误信息
console.log(res.data.msg)
wx.showToast({
title: res.data.msg,
// mask: true,
icon: 'none',
duration: 2000
});
}
}
})
}
})
},
// 手动绑定
handBind: function (e) {
// 跳转到输入SN码页面
wx.navigateTo({
url: '/pages/handBind/handBind'
})
}
})
<view id="getCode">
<!-- 背景图片 -->
<view id="scanBtnBgBox">
<image id="scanBtnBg" src="../../assets/bg_linkdevice.png" />
<!-- 提示语 -->
<view id="getCodeTip">
<view>您好!</view>
<view>请绑定已购买设备。</view>
</view>
<!-- 提示图片 -->
<image id="tipIcon" src="../../assets/qrtips.png" />
<!-- 按钮 -->
<view id="getCodeBtnBox">
<button class="getCodeBtn" id="scanBtn" bindtap="scanBind">扫码绑定</button>
<button class="getCodeBtn" id="handBtn" bindtap="handBind">手动绑定</button>
</view>
</view>
</view>
#getCode{
background: #97979C;
min-height: 100vh;
}
#scanBtnBgBox{
position:absolute;
left:30rpx;
top:30rpx;
right:30rpx;
bottom:0;
height:87%;
}
#scanBtnBg{
width: 100%;
height: 100%;
}
#getCodeBtnBox{
position: absolute;
bottom: 60rpx;
width: 100%;
}
#scanBtn{
margin-bottom: 30rpx;
}
.getCodeBtn{
width:91%;
height: 94rpx;
line-height: 94rpx;
font-size: 36rpx;
color: #FFFFFF;
background: #33D1C4;
border-radius: 10rpx;
}
/* 提示语 */
#getCodeTip{
position: absolute;
top: 0;
left: 0;
font-size: 38rpx;
color: #30C0D1;
padding-left: 30rpx;
padding-top: 60rpx;
}
/* 提示图片 */
#tipIcon{
width: 220rpx;
height: 60rpx;
position: absolute;
top: 196rpx;
left: 50%;
transform: translateX(-50%);
}
\ No newline at end of file
<view id="handBind">
<view id="handBindCon">
<view id="handBindInputBox">
<view id="handBindTitle">请输入您的设备SN码</view>
<input id="snInput" bindinput="snChange" placeholder-style="color:#888;" bindinput="snChange" maxlength="20" type="text" placeholder="SN码由13位数字和字母组合而成" />
</view>
</view>
<!-- 提示 -->
<view id="handBindTip">
<view id="handBindTipTitle">
<image src="../../assets/tips.png" />
<text>在哪可以找到我的SN码</text>
</view>
<view class="handBindTipItem">
• 开启眼保仪 > 我的 > 关于我们,最下方写着SN
<view>码的字母数字组合;</view>
</view>
<view class="handBindTipItem">• 眼保仪的外包装盒。</view>
</view>
<!-- 开始绑定按钮 -->
<view id="handBindBtnCon">
<view id="handBindBtnBox">
<button id="bindBtn" bindtap="bind">开始绑定</button>
</view>
</view>
</view>
#handBind{
background: #EFEFF4;
min-height: 100vh;
}
/* 输入框 */
#handBindCon{
padding: 30rpx;
}
#handBindInputBox{
background: #FFFFFF;
padding: 60rpx 30rpx;
border-radius: 10rpx;
}
#handBindTitle{
font-size: 38rpx;
color: #4F5051;
margin-bottom: 30rpx;
}
#snInput{
font-size: 32rpx;
color: #4F5051;
padding: 20rpx 24rpx;
background: #EFEFF4;
border-radius: 4rpx;
}
/* 提示 */
#handBindTip{
padding: 0 60rpx;
margin-top: 40rpx;
}
#handBindTipTitle{
display: flex;
align-items: center;
font-size: 32rpx;
color: #4F5051;
margin-bottom: 20rpx;
}
#handBindTipTitle>image{
width: 29rpx;
height: 29rpx;
margin-right: 7rpx;
}
.handBindTipItem{
font-size: 28rpx;
color: #888888;
margin-bottom: 20rpx;
}
.handBindTipItem>view{
margin-left: 24rpx;
}
/* 按钮 */
#handBindBtnCon{
position: absolute;
width: 100%;
bottom: 80rpx;
}
#handBindBtnBox{
padding: 0 36rpx;
}
#bindBtn{
width: 100%;
height: 94rpx;
line-height: 94rpx;
font-size: 36rpx;
color: #FFFFFF;
background: #33D1C4;
border-radius: 10rpx;
}
\ No newline at end of file
import * as echarts from '../../component/ec-canvas/echarts'; import * as echarts from '../../component/ec-canvas/echarts';
// 饼状图 // 饼状图
let chartPie = null; let itemGap = 15;
function pieInitChart(canvas, width, height) { function pieInitChart(chart, legendList, ydata) {
chartPie = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(chartPie);
var option = { var option = {
tooltip: { tooltip: {
show: false show: false
}, },
color:['#54585f','#7a8088','#979faa'], color:['#ffa16d','#ffd560','#33edcf','#4dc8f9','#7485f5','#d643f6','#ff6d6d'],
legend: { legend: {
left: 'center', left: 'center',
top: 10, top: 'center',
orient: 'vertical',
// top: 10,
textStyle:{ textStyle:{
color: '#555', color: '#4f5051',
fontSize: 10 fontSize: 11
}, },
icon: "circle", icon: "circle",
itemWidth: 8, itemWidth: 8,
itemHeight: 8, itemHeight: 8,
itemGap: 30, itemGap: itemGap,//图例间隔
data: ['动态训练','静态训练','单次训练'] data: legendList
}, },
series: [ series: [
{ {
// silent: true,//不响应和触发鼠标事件 // silent: true,//不响应和触发鼠标事件
hoverAnimation: false,//是否开启 hover 在拐点标志上的提示动画效果。 hoverAnimation: false,//是否开启 hover 在拐点标志上的提示动画效果。
type: 'pie', type: 'pie',
radius : '80%', // radius : '80%',
center: ['50%', '60%'], radius: ['52%', '100%'],
data:[ // center: ['50%', '60%'],
{value:35, name:'动态训练'}, // data:[
{value:45, name:'静态训练'}, // {value:48, name:'静态训练'},
{value:20, name:'单次训练'} // {value:28, name:'动态训练'},
], // {value:24, name:'单词训练'}
// ],
data: ydata,
label:{//饼图图形上的文本标签 label:{//饼图图形上的文本标签
normal:{ normal:{
  show: true,   show: true,
position: 'outside', //标签的位置 position: 'inner', //标签的位置
textStyle : { textStyle : {
fontWeight : 300 , fontWeight : 300 ,
fontSize : 12//文字的字体大小 fontSize : 14//文字的字体大小
    },     },
formatter: '{d}%' formatter: '{d}%'
} }
...@@ -54,30 +52,106 @@ function pieInitChart(canvas, width, height) { ...@@ -54,30 +52,106 @@ function pieInitChart(canvas, width, height) {
] ]
}; };
chartPie.setOption(option); chart.setOption(option);
return chartPie;
} }
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
avatar: "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJgjIlZNw29LLpbQJYlmjib7AuaqROweKxUib78ibPbp0M6mGKvRXNnpT1M4XkwDwFPAypwOFLXko0zQ/132",
teenageName: '小明',
pieChart: { pieChart: {
onInit: pieInitChart // onInit: pieInitChart
lazyLoad: true
}, },
historyList: { beginDay: '',
id: 0, endDay: '',
date:'5月27日 至 5月20日', weekNumber: '',
finish: 1,//训练是否完成 finishedStatus: '',
minute: 125,// 训练分钟 weekDuration: '',
type: 1,// 视力升高或降低 rightEye: '',
degrees: '4.5 | 4.4', leftEye: '',
dyn: '20%', weekLeftEye: '',
static: '60%', weekRightEye: '',
word: '20%' rightGlassesDegree: '',
} leftGlassesDegree: '',
leftCorrectedEye: '',
rightCorrectedEye: '',
leftWeekEye: '',
rightWeekEye: '',
leftLeerEye: '',
rightLeerEye: '',
appList: [],
}, },
onLoad: function (options) { onLoad: function (options) {
// console.log(options.historyId) let me = this;
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'Reports/detail',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
// historyId: options.historyId
historyId: 12
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
me.setData({
name: res.data.data.name,
avatar: res.data.data.avatar,
beginDay: res.data.data.beginDay,
endDay: res.data.data.endDay,
weekNumber: res.data.data.weekNumber,
finishedStatus: res.data.data.finishedStatus,
weekDuration: res.data.data.weekDuration,
rightEye: res.data.data.rightEye,
leftEye: res.data.data.leftEye,
weekLeftEye: res.data.data.weekLeftEye,
weekRightEye: res.data.data.weekRightEye,
rightGlassesDegree: res.data.data.rightGlassesDegree,
leftGlassesDegree: res.data.data.rightGlassesDegree,
leftCorrectedEye: res.data.data.leftCorrectedEye,
rightCorrectedEye: res.data.data.rightCorrectedEye,
leftWeekEye: res.data.data.leftWeekEye,
rightWeekEye: res.data.data.rightWeekEye,
leftLeerEye: res.data.data.leftLeerEye,
rightLeerEye: res.data.data.rightLeerEye,
appList: res.data.data.appList,
})
let legendList = []
let pieList = []
res.data.data.typeTrainingList.map((item)=>{
legendList.push(item.title)
pieList.push({value: item.trainingDuration,name: item.title})
})
if(legendList.length>5){
itemGap = 5
}else{
itemGap = 15
}
me.selectComponent('#reprotPieChart').init((canvas, width, height) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height
});
pieInitChart(chart, legendList, pieList)
me.chart = chart;
return chart;
});
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
} }
}) })
{ {
"navigationBarTitleText": "训练历史", "navigationBarTitleText": "训练报告",
"usingComponents": { "usingComponents": {
"ec-canvas": "../../component/ec-canvas/ec-canvas" "ec-canvas": "../../component/ec-canvas/ec-canvas"
} }
......
...@@ -2,13 +2,15 @@ ...@@ -2,13 +2,15 @@
<!-- 头像、用户名时间等 --> <!-- 头像、用户名时间等 -->
<view id="top"> <view id="top">
<view id="topLeft"> <view id="topLeft">
<image src="../../assets/head.png" /> <image src="{{ avatar }}" />
<text>用户名</text> <view>{{teenageName}}</view>
</view> </view>
<view id="topRight"> <view id="topRight">
<view>5月12日~5月18日<text>(周为单位)</text></view> <view id="topRightTime">第{{weekNumber}}周 <text>{{beginDay}}~{{endDay}}</text></view>
<view>上周共训练<text>150</text>分钟,目标已完成!</view> <view id="topRightTitle">上周共训练</view>
<view>并且右眼提升<text>0.1</text></view> <view id="topRightTrain"><text>{{we.toFixed(weekDuration/60)}}</text> 分钟,目标 <text id="topRightTrainStatus" wx:if="{{finishedStatus==1}}">已完成!</text><text id="topRightTrainStatusNo" wx:else>未完成!</text></view>
<view id="topRightTitle">当前视力</view>
<view id="topRightTrain">右眼 <text id="leftEye">{{rightEye}}</text>左眼 <text>{{leftEye}}</text></view>
</view> </view>
</view> </view>
<!-- 视力情况 --> <!-- 视力情况 -->
...@@ -18,65 +20,96 @@ ...@@ -18,65 +20,96 @@
<view class="eyesightItemRight"><text>左</text><text>右</text></view> <view class="eyesightItemRight"><text>左</text><text>右</text></view>
</view> </view>
<view class="eyesightItem"> <view class="eyesightItem">
<view class="eyesightItemLeft">裸眼视力</view> <view class="eyesightItemLeft">初测视力</view>
<view class="eyesightItemRight"> <view class="eyesightItemRight">
<text>4.5</text> <text>{{leftEye}}</text>
<text>3.5</text> <text>{{rightEye}}</text>
</view>
</view>
<view class="eyesightItem">
<view class="eyesightItemLeft">本次视力</view>
<view class="eyesightItemRight eyesightItemRightNowBox">
<view class="eyesightItemRightNow">
<text>{{weekLeftEye}}</text>
<view wx:if="{{weekLeftEye>leftEye}}">
<image src="../../assets/up.png"></image>
<text>{{weekLeftEye-leftEye}}</text>
</view>
<view wx:elif="{{weekLeftEye<leftEye}}">
<image src="../../assets/down.png"></image>
<text>{{leftEye-weekLeftEye}}</text>
</view>
<view wx:else></view>
</view>
<view class="eyesightItemRightNow">
<text>{{weekRightEye}}</text>
<view wx:if="{{weekRightEye>rightEye}}">
<image src="../../assets/up.png"></image>
<text>{{weekRightEye-rightEye}}</text>
</view>
<view wx:elif="{{weekRightEye<rightEye}}">
<image src="../../assets/down.png"></image>
<text>{{rightEye-weekRightEye}}</text>
</view>
<view wx:else></view>
</view>
</view> </view>
</view> </view>
<view class="eyesightItem"> <view class="eyesightItem">
<view class="eyesightItemLeft">矫正视力</view> <view class="eyesightItemLeft">矫正视力</view>
<view class="eyesightItemRight"> <view class="eyesightItemRight">
<text>4.0↓-0.5</text> <text>{{leftCorrectedEye}}</text>
<text>4.0↑+0.5</text> <text>{{rightCorrectedEye}}</text>
</view> </view>
</view> </view>
<view class="eyesightItem"> <view class="eyesightItem" wx:if="{{leftGlassesDegree!=''&&rightGlassesDegree!=''}}">
<view class="eyesightItemLeft">眼镜度数</view> <view class="eyesightItemLeft">眼镜度数</view>
<view class="eyesightItemRight"> <view class="eyesightItemRight">
<text>150</text> <text wx:if="{{leftGlassesDegree!=''}}">{{leftGlassesDegree}}</text>
<text>100</text> <text wx:if="{{leftGlassesDegree==''}}">-</text>
<text wx:if="{{rightGlassesDegree!=''}}">{{rightGlassesDegree}}</text>
<text wx:if="{{rightGlassesDegree==''}}">-</text>
</view> </view>
</view> </view>
<view class="eyesightItem"> <view class="eyesightItem" wx:if="{{leftWeekEye!='无'&&rightWeekEye!='无'}}">
<view class="eyesightItemLeft">斜视、弱视、散光</view> <view class="eyesightItemLeft">弱视</view>
<view class="eyesightItemRight"> <view class="eyesightItemRight">
<text>有</text> <text>{{leftWeekEye}}</text>
<text>无</text> <text>{{rightWeekEye}}</text>
</view>
</view>
<view class="eyesightItem" wx:if="{{leftLeerEye!='无'&&rightLeerEye!='无'}}">
<view class="eyesightItemLeft">斜视</view>
<view class="eyesightItemRight">
<text>{{leftLeerEye}}</text>
<text>{{rightLeerEye}}</text>
</view> </view>
</view> </view>
</view> </view>
<!-- 训练图 --> <!-- 训练图 -->
<view class="pieChart"> <view class="pieChart">
<ec-canvas ec="{{ pieChart }}"></ec-canvas> <ec-canvas id="reprotPieChart" ec="{{ pieChart }}"></ec-canvas>
</view> </view>
<view id="shareBox"> <!-- <view id="shareBox">
<text id="share">分享</text> <text id="share">分享</text>
</view> </view> -->
<!-- 常用应用 --> <!-- 常用应用 -->
<view id="common"> <view id="common">
<view id="commonTitle">常用应用</view> <view id="commonTitle">常用应用</view>
<view id="commonList"> <view id="commonList">
<view class="commonItem"> <view class="commonItem" wx:for="{{appList}}" wx:key>
<image src="../../assets/appIcon.png" /> <image src="{{item.icon}}" />
<text>应用名称111</text> <text>{{item.title}}</text>
</view>
<view class="commonItem">
<image src="../../assets/appIcon.png" />
<text>应用名称222</text>
</view>
<view class="commonItem">
<image src="../../assets/appIcon.png" />
<text>应用名称333</text>
</view>
<view class="commonItem">
<image src="../../assets/appIcon.png" />
<text>应用名称444</text>
</view>
<view class="commonItem">
<image src="../../assets/appIcon.png" />
<text>应用名称555</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<wxs module="we">
var toFixed = function (value) {
return Math.floor(value);
}
module.exports = {
toFixed :toFixed
}
</wxs>
\ No newline at end of file
#historyDetail{ #historyDetail{
background: #EFEFF4; background: #ffffff;
min-height: 100vh; min-height: 100vh;
} }
#top{ #top{
padding: 30rpx 25rpx; padding-top: 40rpx;
display: flex; display: flex;
border-bottom: 2rpx solid #A7A7A8;
} }
#topLeft{ #topLeft{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin-right: 50rpx; padding: 20rpx 40rpx 0 60rpx;
} }
#topLeft>image{ #topLeft>image{
width: 100rpx; display: block;
height: 100rpx; height: 120rpx;
width: 120rpx;
border-radius: 50%;
} }
#topLeft>text{ #topLeft>view{
font-size: 30rpx; font-size: 28rpx;
color: #4F5051;
margin-top: 6rpx; margin-top: 6rpx;
text-align: center;
width: 100%;
} }
#topRight{ #topRight{
font-size: 28rpx;
color: #A7A7A8;
display: flex; display: flex;
flex-direction:column; flex-direction: column;
justify-content:space-around; justify-content: space-around;
border-left: 1rpx solid #E5ECE5;
padding-left: 40rpx;
padding-top: 10rpx;
}
#topRightTime{
font-size: 32rpx;
color: #33D1C4;
margin-bottom: 35rpx;
}
#topRightTime text{
font-size: 28rpx;
}
#topRightTitle{
font-size: 22rpx;
color: #999;
margin-bottom: -5rpx;
}
#topRightTrain{
font-size: 32rpx;
color: #999;
padding-bottom: 25rpx;
}
#topRightTrain text{
font-size: 64rpx;
color: #111111;
}
#topRightTrain #topRightTrainStatus{
font-size: 32rpx;
color: #F7B500;
}
#topRightTrain #topRightTrainStatusNo{
font-size: 32rpx;
color: #33D1C4;
}
#leftEye{
margin-right: 34rpx;
} }
/*  */ /*  */
#eyesight{ /* #eyesight{
padding: 30rpx;
border-bottom: 2rpx solid #A7A7A8; border-bottom: 2rpx solid #A7A7A8;
} } */
#eyesightTitle{ #eyesightTitle{
display: flex; display: flex;
font-size: 28rpx; font-size: 28rpx;
color: #4F5051; color: #666;
background: #A7A7A8; padding: 30rpx 25rpx;
border-radius: 100rpx;
padding: 20rpx 30rpx;
} }
.eyesightItem{ .eyesightItem{
display: flex; display: flex;
font-size: 28rpx; font-size: 28rpx;
color: #A7A7A8; color: #999;
padding: 20rpx 30rpx; padding: 39rpx 25rpx;
border-top: 1rpx solid #E5ECE5;
} }
.eyesightItemLeft{ .eyesightItemLeft{
width: 42%; width: 42%;
...@@ -63,7 +100,24 @@ ...@@ -63,7 +100,24 @@
.pieChart { .pieChart {
width: 100%; width: 100%;
height: 400rpx; height: 540rpx;
margin-top: 40rpx;
padding-bottom: 40rpx;
}
.eyesightItemRightNowBox{
display: flex;
}
.eyesightItemRightNow{
display: flex;
align-items: center;
width: 35%;
padding-left: 15%;
}
.eyesightItemRightNow image{
width: 26rpx;
height: 24rpx;
margin: 0 4rpx;
} }
/* 分享 */ /* 分享 */
...@@ -78,24 +132,27 @@ ...@@ -78,24 +132,27 @@
/* 常用应用 */ /* 常用应用 */
#common{
padding: 0 50rpx;
}
#commonList{ #commonList{
display: flex; display: flex;
padding: 40rpx;
} }
#commonTitle{ #commonTitle{
padding: 10rpx 30rpx; font-size: 32rpx;
color: #111111;
padding: 30rpx 0;
} }
.commonItem{ .commonItem{
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
font-size: 26rpx; font-size: 24rpx;
color: #A7A7A8; color: #4F5051;
/* padding: 0 20rpx; */
width: 20%; width: 20%;
} }
.commonItem>image{ .commonItem>image{
width: 60rpx; width: 106rpx;
height: 60rpx; height: 106rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
\ No newline at end of file
var app = getApp();
Page({ Page({
data: { data: {
idea: '', idea: '',
...@@ -18,15 +18,41 @@ Page({ ...@@ -18,15 +18,41 @@ Page({
}) })
return return
} }
let me = this
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'users/feedback',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
content: me.data.idea
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
wx.redirectTo({ wx.redirectTo({
url: '/pages/mine/mine' url: '/pages/mine/mine'
}) })
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
}, },
// 输入 // 输入
inputchange(e) { inputchange(e) {
this.setData({ this.setData({
idea: e.detail.value, idea: e.detail.value,
contentLength: this.data.idea.length contentLength: e.detail.value.length
}) })
}, },
}) })
\ No newline at end of file
/* 提交 */ /* 提交 */
#submitBtn{ #submitBtn{
padding: 75rpx 30rpx 80rpx; padding: 75rpx 40rpx 80rpx;
} }
#submit{ #submit{
background: #33D1C4; background: #33D1C4;
border-radius: 10rpx; border-radius: 47rpx;
font-size: 36rpx; font-size: 36rpx;
color: #FFFFFF; color: #FFFFFF;
height: 94rpx; height: 94rpx;
......
.grayBlock{ .grayBlock{
background: #efeff4; background: #e6ece5;
width: 100%; width: 100%;
height: 20rpx; height: 20rpx;
} }
.swiperBox{ .swiperBox{
padding: 30rpx 25rpx; padding: 20rpx 20rpx;
height: 180rpx; height: 180rpx;
background-color: #e6ece5;
} }
.swiperCon{ .swiperCon{
border-radius:20rpx; border-radius:20rpx;
...@@ -14,11 +15,96 @@ ...@@ -14,11 +15,96 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.swiper_box {
position: relative;
}
/*用来包裹所有的小圆点 */
.dots {
width: 100%;
display: flex;
flex-direction: row;
position: absolute;
justify-content: center;
bottom: 35rpx;
}
/*未选中时的小圆点样式 */
.dot {
width: 20rpx;
height: 4rpx;
border-radius: 14rpx;
margin-right: 5rpx;
background-color: rgba(255, 255, 255, 0.5);
}
/*选中以后的小圆点样式 */
.active {
width: 40rpx;
height: 4rpx;
background-color: #fff;
}
#userTab{
display: flex;
background-color: #e6ece5;
padding-top: 30rpx;
position: relative;
}
.userTabItem{
position: relative;
margin-left: 10rpx;
}
.userTabItem image{
width: 200rpx;
height: 60rpx;
display: block;
}
.userTabItem text{
position: absolute;
display: block;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
line-height: 60rpx;
color: #111;
font-size: 28rpx;
}
/* .userTabItem:first-child{
margin-left: -10rpx;
} */
#userCenter{
display: block;
position: absolute;
right: 20rpx;
top: 20rpx;
width: 48rpx;
height: 48rpx;
}
/* 头像设置 */ /* 头像设置 */
#initial{
margin-left: 30rpx;
display: flex;
align-items: center;
}
.initialIcon{
display: inline-block;
width: 22rpx;
height: 22rpx;
font-size: 18rpx;
text-align: center;
line-height: 22rpx;
border-radius: 50%;
background-color: #000;
color: #fff;
}
#userBox{ #userBox{
display: flex; display: flex;
position: relative; position: relative;
padding-left: 50rpx; padding: 10rpx 0 20rpx 50rpx;
border-bottom: 1rpx solid #dfdfdf;
} }
#setBtn{ #setBtn{
height: 36rpx; height: 36rpx;
...@@ -47,65 +133,45 @@ ...@@ -47,65 +133,45 @@
} }
#userDetail{ #userDetail{
font-size: 28rpx; font-size: 28rpx;
color: #A7A7A8; color: #999;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.userDetailLine{ #userDetail text{
margin-right: 10rpx;
}
#userGender{
display: block; display: block;
width: 2rpx; width: 22rpx;
height: 23rpx; height: 22rpx;
background: #A7A7A8; margin-right: 10rpx;
margin: 0 20rpx;
} }
/* 训练计划按钮 */ /* 训练计划按钮 */
#userBtnBox{ #userBtnBox{
padding: 0 25rpx; padding: 30rpx 20rpx;
margin-top: 30rpx;
}
#btnWrap{
display: flex;
justify-content: center;
align-items: center;
font-size: 38rpx;
color: #fff;
padding: 35rpx 0;
background: linear-gradient(to right, #60d4c6, #6be89b);
border-radius:100rpx;
}
#planBtnBox{
display: flex;
align-items: center;
}
#setBtnBox{
display: flex; display: flex;
align-items: center; justify-content: space-between;
border-bottom: 1rpx solid #dfdfdf;
} }
.btnIcon{ #userBtnBox image{
display: block; display: block;
width: 64rpx; width: 345rpx;
height: 64rpx; height: 90rpx;
margin-right: 6rpx;
}
#userBtnBoxLine{
height: 42rpx;
width: 2rpx;
background: #fff;
margin: 0 60rpx;
} }
/* 监控 */ /* 监控 */
.checkCon{ .checkCon{
padding: 50rpx 25rpx 30rpx; padding: 30rpx 20rpx;
} }
.checkDes{ .checkDes{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding-bottom: 20rpx;
} }
#trainTime{ #trainTime{
color: #4f5051; color: #999;
font-size: 28rpx; font-size: 28rpx;
} }
#powerBox{ #powerBox{
...@@ -114,34 +180,58 @@ ...@@ -114,34 +180,58 @@
} }
#powerBox>image{ #powerBox>image{
display: block; display: block;
width: 36rpx; width: 48rpx;
height: 36rpx; height: 48rpx;
margin-right: 6rpx; margin-left: 10rpx;
} }
.PowerOff{ .PowerOff{
color: #fa6400; color: #10d9b8;
font-size: 32rpx; font-size: 28rpx;
/* text-decoration: underline; */
} }
.checkImg{ .checkImg{
position: relative; position: relative;
} }
.checkImg>image{ /* .checkImg>image{
margin-top: 20rpx;
display: block; display: block;
width: 100%; width: 100%;
height: 392rpx; height: 100rpx;
} */
#checkImgConBox{
position: relative;
} }
.wifi{ #checkImgCon{
display: block;
height: 400rpx;
width: 100%; width: 100%;
color: #bababa; }
font-size: 26rpx; #btn_refresh{
height: 60rpx; width: 48rpx;
line-height: 60rpx; height: 48rpx;
text-align: center; position: absolute;
bottom: 30rpx;
right: 30rpx;
}
#checkImgNo{
position: relative;
}
#checkImgNo>image{
position: relative;
height: 100rpx;
width: 100%;
}
#checkImgNoRefreshBox{
position: absolute; position: absolute;
bottom: 0; bottom: 0;
background: rgba(0, 0, 0, 0.5); width: 100%;
text-align: center;
}
#checkImgNoRefresh{
background: #e6ece5;
border-radius: 10rpx;
padding: 4rpx 10rpx;
color: #10d9b8;
font-size: 28rpx;
} }
/* 目标 */ /* 目标 */
...@@ -181,13 +271,13 @@ ...@@ -181,13 +271,13 @@
.reportTitle{ .reportTitle{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 25rpx 0; padding: 25rpx 0 10rpx;
} }
.reportTitleLeft,.trainSortTitleLeft,.resultSortTitleLeft{ .reportTitleLeft,.trainSortTitleLeft,.resultSortTitleLeft{
font-size: 38rpx; font-size: 32rpx;
display: flex; display: flex;
align-items:center; align-items:center;
color: #4f5051; color: #111;
} }
.targetHistory,.trainSortTitleRight,.resultSortTitleRight{ .targetHistory,.trainSortTitleRight,.resultSortTitleRight{
display: flex; display: flex;
...@@ -199,23 +289,18 @@ ...@@ -199,23 +289,18 @@
margin-right: 10rpx; margin-right: 10rpx;
} }
.targetHistory>image,.trainSortTitleRight>image,.resultSortTitleRight>image{ .targetHistory>image,.trainSortTitleRight>image,.resultSortTitleRight>image{
width: 36rpx; width: 48rpx;
height: 36rpx; height: 48rpx;
display: block; display: block;
} }
/* 训练报告 */ /* 训练报告 */
.reportDes{
border-bottom: 2rpx solid #E5E5E5;
padding-bottom: 30rpx;
margin-top: 30rpx;
}
#taskComplete{ #taskComplete{
display: flex; display: flex;
align-items: center; align-items: center;
color: #F7B500; color: #F7B500;
font-size: 32rpx; font-size: 32rpx;
margin-bottom: 10rpx; margin-bottom: 20rpx;
} }
#taskComplete>image{ #taskComplete>image{
width: 48rpx; width: 48rpx;
...@@ -225,7 +310,7 @@ ...@@ -225,7 +310,7 @@
#taskNocomplete{ #taskNocomplete{
display: flex; display: flex;
align-items: center; align-items: center;
color: #fa6400; color: #50e3c2;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-size: 32rpx; font-size: 32rpx;
} }
...@@ -235,28 +320,24 @@ ...@@ -235,28 +320,24 @@
margin-right: 10rpx; margin-right: 10rpx;
} }
#taskNocompleteDes{ #taskNocompleteDes{
color: #4f5051; color: #111;
font-size: 28rpx; font-size: 34rpx;
margin-left: 60rpx;
} }
#taskCompleteDes{ #taskCompleteDes{
color: #4f5051; color: #111;
font-size: 28rpx; font-size: 34rpx;
margin-left: 60rpx;
} }
#taskCompleteDes>text{ #taskCompleteDes>text{
font-size: 36rpx; font-size: 36rpx;
margin: 0 6rpx; margin: 0 6rpx;
} }
.reprotChart{
padding-top: 30rpx;
}
.reprotChartTitle{ .reprotChartTitle{
color: #4f5051; color: #111;
font-size: 28rpx; font-size: 34rpx;
text-align: center; margin-top: 10rpx;
margin-bottom: 20rpx;
} }
.reprotChartTitle>text{ .reprotChartTitle>text{
font-size: 36rpx; font-size: 36rpx;
...@@ -265,28 +346,27 @@ ...@@ -265,28 +346,27 @@
.reprotWeekChart { .reprotWeekChart {
width: 100%; width: 100%;
height: 380rpx; height: 400rpx;
} }
.reprotPieChart { .reprotPieChart {
width: 100%; width: 100%;
height: 540rpx; height: 540rpx;
margin-top: 20rpx; margin-top: 20rpx;
padding-bottom: 30rpx;
} }
.reprotChartSuggest{ .reprotChartSuggest{
border-top: 2rpx solid #E5E5E5;
margin-top: 20rpx;
color: #888; color: #888;
font-size: 28rpx; font-size: 24rpx;
padding-top: 30rpx; padding-top: 10rpx;
} }
.reprotChartSuggestTitle{ .reprotChartSuggestTitle{
font-size: 38rpx; font-size: 28rpx;
color: #4f5051; /* color: #111; */
margin-bottom: 30rpx; margin-bottom: 10rpx;
} }
.adviseItem{ .adviseItem{
display: flex; display: flex;
margin-bottom: 30rpx; margin-bottom: 20rpx;
} }
.adviseItem>image{ .adviseItem>image{
width: 24rpx; width: 24rpx;
...@@ -297,16 +377,16 @@ ...@@ -297,16 +377,16 @@
/* 训练排行 效果排行 */ /* 训练排行 效果排行 */
#trainSort,#resultSort{ #trainSort,#resultSort{
color: #4f5051; color: #666;
font-size: 34rpx; font-size: 32rpx;
} }
.trainSortTitle,.resultSortTitle{ .trainSortTitle,.resultSortTitle{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 25rpx; padding: 30rpx 20rpx;
} }
.trainSortListItemWrap,.resultSortListItemWrap{ .trainSortListItemWrap,.resultSortListItemWrap{
padding-left: 25rpx; padding: 0 20rpx;
} }
.trainSortListItemLeft, .resultSortListItemLeft{ .trainSortListItemLeft, .resultSortListItemLeft{
display: flex; display: flex;
...@@ -319,20 +399,20 @@ ...@@ -319,20 +399,20 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-top: 2rpx solid #E5E5E5; border-top: 1rpx solid #E5E5E5;
padding: 20rpx 25rpx 20rpx 0; padding: 30rpx 20rpx;
} }
.trainSortListItemInfo,.resultSortListItemInfo{ .trainSortListItemInfo,.resultSortListItemInfo{
display: flex; display: flex;
align-items: center; align-items: center;
} }
.trainSortListItemSelf, .resultSortListItemSelf{ .trainSortListItemSelf, .resultSortListItemSelf{
color: #fff; /* background: linear-gradient(to right, #60d4c6, #6be89b); */
background: linear-gradient(to right, #60d4c6, #6be89b); background-color: #dcf9f1;
} }
.trainSortListItemSelf .trainSortListItem,.resultSortListItemSelf .resultSortListItem{ /* .trainSortListItemSelf .trainSortListItem,.resultSortListItemSelf .resultSortListItem{
border: 0; border: 0;
} } */
.trainSortListItemInfo>image, .resultSortListItemInfo>image{ .trainSortListItemInfo>image, .resultSortListItemInfo>image{
width: 50rpx; width: 50rpx;
height: 50rpx; height: 50rpx;
...@@ -360,20 +440,20 @@ ...@@ -360,20 +440,20 @@
#indexBottom{ #indexBottom{
height: 115rpx; height: 115rpx;
width: 100%; width: 100%;
background: #efeff4; background: #e6ece5;
} }
/* 训练成就 */ /* 训练成就 */
#achieve{ #achieve{
color: #555; color: #555;
padding: 0 25rpx; padding: 0 20rpx;
} }
.achieveTitle{ .achieveTitle{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 38rpx; font-size: 32rpx;
align-items:center; align-items:center;
color: #4f5051; color: #111;
padding: 25rpx 0; padding: 25rpx 0;
} }
.achieveTitle>image{ .achieveTitle>image{
...@@ -381,17 +461,26 @@ ...@@ -381,17 +461,26 @@
height: 36rpx; height: 36rpx;
display: block; display: block;
} }
.achieveTime, .achieveChange{ .achieveTime{
font-size: 28rpx; font-size: 34rpx;
padding-top: 10rpx; color: #111;
margin-bottom: 10rpx;
} }
.achieveTime>text, .achieveChange>text{ .achieveTime>text, .achieveChange>text{
font-size: 36rpx; font-size: 36rpx;
margin: 0 10rpx; margin: 0 10rpx;
} }
#suggest{
font-size: 28rpx;
color: #999;
}
.suggestItem{
margin-bottom: 15rpx;
}
.achieveChange{ .achieveChange{
padding-bottom: 35rpx; font-size: 34rpx;
border-bottom: 2rpx solid #e5e5e5; color: #111;
padding-bottom: 20rpx;
} }
.leftEyeChart{ .leftEyeChart{
position: relative; position: relative;
...@@ -409,7 +498,7 @@ ...@@ -409,7 +498,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 30rpx 0 0rpx; padding: 20rpx 0 0rpx;
} }
.legend_box{ .legend_box{
display: flex; display: flex;
...@@ -438,8 +527,8 @@ ...@@ -438,8 +527,8 @@
} }
.eyeChartName{ .eyeChartName{
text-align: center; text-align: center;
font-size: 34rpx; font-size: 28rpx;
color: #4f5051; color: #666;
} }
.rightEyeChart{ .rightEyeChart{
padding-bottom: 10rpx; padding-bottom: 10rpx;
......
var app = getApp();
Page({
data: {
trainTip: false,
messageTip: false,
serveTip: false,
isShow: false
},
onLoad() {
let me = this
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'remindings/index',
method: 'POST',
data: {
token: wx.getStorageSync('token')
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
if(res.data.data.smsRemind==1 || res.data.data.wechatRemind==1){
me.setData({
trainTip: true,
isShow: true,
})
}else{
me.setData({
trainTip: false,
isShow: false,
})
}
if(res.data.data.smsRemind==1){//短信提醒状态 1:开启提醒; 0:关闭提醒。
me.setData({
messageTip: true,
})
}else{
me.setData({
messageTip: false,
})
}
if(res.data.data.wechatRemind==1){//微信提醒状态 1:开启提醒; 0:关闭提醒。
me.setData({
serveTip: true,
})
}else{
me.setData({
serveTip: false,
})
}
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
// 训练提醒(总开关)
trainTip: function(e) {
let me = this
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
let status = ''
if(e.detail.value){
status = 1
}else{
status = 0
}
wx.request({
url: app.globalData.apiUrl + 'remindings/setRemind',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
type: 3,//提醒类型 1:短信提醒; 2:微信提醒; 3:全部提醒(包括短信和微信)
status: status,//提醒状态 1:开启提醒状态; 0:关闭提醒状态。
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
me.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
messageTip: function(e) {
let me = this
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
let status = ''
if(e.detail.value){
status = 1
}else{
status = 0
}
wx.request({
url: app.globalData.apiUrl + 'remindings/setRemind',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
type: 1,//提醒类型 1:短信提醒; 2:微信提醒; 3:全部提醒(包括短信和微信)
status: status,//提醒状态 1:开启提醒状态; 0:关闭提醒状态。
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
me.setData({
messageTip: e.detail.value
})
if(me.data.messageTip || me.data.serveTip){
}else{
me.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
}
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
serveTip: function(e) {
let me = this
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
let status = ''
if(e.detail.value){
status = 1
}else{
status = 0
}
wx.request({
url: app.globalData.apiUrl + 'remindings/setRemind',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
type: 2,//提醒类型 1:短信提醒; 2:微信提醒; 3:全部提醒(包括短信和微信)
status: status,//提醒状态 1:开启提醒状态; 0:关闭提醒状态。
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
me.setData({
serveTip: e.detail.value
})
if(me.data.messageTip || me.data.serveTip){
}else{
me.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
}
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
})
\ No newline at end of file
{ {
"navigationBarTitleText": "绑定设备", "navigationBarTitleText": "通知提醒",
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file
<view id="ruleSet"> <!-- 训练提醒 -->
<!-- 会员卡 --> <view id="trainTip">
<view id="clubCardWrap" hidden="{{true}}">
<view id="clubCard">
<view id="clubCardTop">
<view>
<view id="clubCardTopLeftTitle">我的会员卡</view>
<view id="clubCardScoreLabel">可用积分:<text id="clubCardScore">99999</text></view>
</view>
<image src="../../assets/club_card.png" />
</view>
<view id="clubCardBom">
<image src="../../assets/club_card_QRcode.png" />
<text>点击出示电子会员卡</text>
</view>
</view>
</view>
<!-- 设备编号、网络 -->
<view id="networkInfo">
<view id="networkInfoId">设备编号:{{equipmentId}}</view>
<view id="networkInfoBox">
<text>链接网络:china mobile net 5g</text>
<button id="changeNet" bindtap="changeNet">
<image src="../../assets/wifi.png" />
更改网络
</button>
</view>
</view>
<view id="trainTip">
<view id="trainTipTitle"> <view id="trainTipTitle">
<view id="trainTipLeft">
<image src="../../assets/icon_mine_notice.png" />
<text>训练提醒</text> <text>训练提醒</text>
</view>
<view id="trainTipRight"> <view id="trainTipRight">
<switch color="#33D1C4" checked="{{trainTip}}" bindchange="trainTip"/> <switch color="#33D1C4" checked="{{trainTip}}" bindchange="trainTip"/>
</view> </view>
</view> </view>
</view> </view>
<view id="trainTipBom" hidden="{{!isShow}}"> <view id="trainTipBom" hidden="{{!isShow}}">
<view id="trainTipBomItem"> <view id="trainTipBomItem">
<view class="trainLeft"> <view class="trainLeft">
<image src="../../assets/account_pn.png" /> <image src="../../assets/icon_mine_message.png" />
<text>短信提醒</text> <text>短信提醒</text>
</view> </view>
<view id="trainTipBomRight"> <view id="trainTipBomRight">
...@@ -46,17 +22,11 @@ ...@@ -46,17 +22,11 @@
</view> </view>
<view id="trainTipBomItem"> <view id="trainTipBomItem">
<view class="trainLeft"> <view class="trainLeft">
<image src="../../assets/account_wx.png" /> <image src="../../assets/icon_mine_wechat.png" />
<text>服务号提醒</text> <text>微信提醒</text>
</view> </view>
<view id="trainTipBomRight"> <view id="trainTipBomRight">
<switch color="#33D1C4" checked="{{serveTip}}" bindchange="serveTip"/> <switch color="#33D1C4" checked="{{serveTip}}" bindchange="serveTip"/>
</view> </view>
</view> </view>
</view>
<view id="logoutWrap">
<view id="logoutBox">
<button id="logoutBtn" bindtap='logout'>退出登录</button>
</view>
</view>
</view> </view>
\ No newline at end of file
page{
background-color: #efeff5;
}
/* 训练提醒 */
#trainTip{
padding: 20rpx 30rpx;
background: #fff;
}
#trainTipTitle{
display: flex;
justify-content: space-between;
align-items: center;
font-size: 34rpx;
color: #4F5051;
}
#trainTipLeft{
display: flex;
align-items: center;
}
#trainTipLeft image{
width: 70rpx;
height: 70rpx;
margin-right: 15rpx;
}
switch{
transform:scale(0.9);
}
#trainTipBom{
background: #F8F7F5;
font-size: 34rpx;
color: #4F5051;
}
#trainTipBomItem{
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 30rpx;
border-top: 1rpx solid #e5e5e5;
}
.trainLeft{
display: flex;
align-items: center;
}
.trainLeft>image{
width: 70rpx;
height: 70rpx;
margin-right: 15rpx;
}
var app = getApp();
Page({ Page({
data: { data: {
teenageName: '小明', teenageName: '',
gender: '男', avatar: "",
age: 9, sn: ''
className: '', },
avatar: "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJgjIlZNw29LLpbQJYlmjib7AuaqROweKxUib78ibPbp0M6mGKvRXNnpT1M4XkwDwFPAypwOFLXko0zQ/132", onLoad() {
sn: 'sn123541341' let me = this
}, // 请求前加Loading
onReady() { wx.showLoading({
this.setData({ title: '加载中',
className: '无' mask: true
}) })
// setTimeout(function () { wx.request({
// // 获取 chartWeek 实例的方式 url: app.globalData.apiUrl + 'users/personalCenter',
// console.log(chartWeek) method: 'POST',
// }, 2000); data: {
token: wx.getStorageSync('token')
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
me.setData({
avatar: res.data.data.avatar,
teenageName: res.data.data.name,
sn: res.data.data.seexSn,
})
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
}, },
// 解绑 // 解绑
unbundle() { unbundle() {
console.log('解绑') wx.showModal({
title: '删除提示',
content: '删除后无法恢复,是否删除?',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'devices/unbind',
method: 'POST',
data: {
token: wx.getStorageSync('token')
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
} else if (res.cancel) {
// console.log('用户点击取消')
}
}
})
},
// 用户
user() {
wx.navigateTo({
url: '/pages/user/user'
})
},
// 通知提醒
message() {
wx.navigateTo({
url: '/pages/message/message'
})
}, },
// 意见与反馈 // 意见与反馈
idea() { idea() {
wx.redirectTo({ wx.navigateTo({
url: '/pages/idea/idea' url: '/pages/idea/idea'
}) })
} },
}) })
\ No newline at end of file
...@@ -4,26 +4,36 @@ ...@@ -4,26 +4,36 @@
</view> </view>
<view id="userInfo"> <view id="userInfo">
<view id="username">{{teenageName}}</view> <view id="username">{{teenageName}}</view>
<view id="userDetail">
<text>{{gender}}</text>
<text class="userDetailLine"></text>
<text>{{age}}岁</text>
<text class="userDetailLine"></text>
<text>{{className}}</text>
</view>
</view> </view>
</view> </view>
<view class="useSettingBox"> <view class="useSettingBox">
<view class="use"> <view class="use">
<image src="../../assets/account_pn.png"></image> <image src="../../assets/icon_mine_device.png"></image>
<text>设备ID:{{sn}}</text> <view class="snCode">设备ID<text>{{sn}}</text></view>
</view>
<view id="unbundleBox" bindtap="unbundle">
<image src="../../assets/icon_unlock.png"></image>
<text>解绑</text>
</view>
</view>
<view class="useSettingBox" bindtap="user">
<view class="use">
<image src="../../assets/icon_mine_user.png"></image>
<text>用户管理</text>
</view>
<image class="arrowDown" src="../../assets/icon_more.png" />
</view>
<view class="useSettingBox" bindtap="message">
<view class="use">
<image src="../../assets/icon_mine_notice.png"></image>
<text>通知提醒</text>
</view> </view>
<text bindtap="unbundle">解绑</text> <image class="arrowDown" src="../../assets/icon_more.png" />
</view> </view>
<view class="useSettingBox" bindtap="idea"> <view class="useSettingBox" bindtap="idea">
<view class="use"> <view class="use">
<image src="../../assets/account_pn.png"></image> <image src="../../assets/icon_mine_feedback.png"></image>
<text>意见反馈</text> <text>意见反馈</text>
</view> </view>
<image class="arrowDown" src="../../assets/arrow_right.png" /> <image class="arrowDown" src="../../assets/icon_more.png" />
</view> </view>
\ No newline at end of file
page{
background-color: #efeff5;
}
/* 头像设置 */ /* 头像设置 */
#userBox{ #userBox{
display: flex; display: flex;
position: relative; position: relative;
padding: 50rpx 0 30rpx 25rpx; padding: 20rpx 30rpx;
background-color: #fff;
} }
#userHead{ #userHead{
display: block; display: block;
height: 120rpx; height: 120rpx;
width: 120rpx; width: 120rpx;
margin-right: 30rpx; margin-right: 20rpx;
border-radius: 50%; border-radius: 50%;
/* overflow: hidden; */ /* overflow: hidden; */
} }
...@@ -19,22 +22,8 @@ ...@@ -19,22 +22,8 @@
justify-content: center; justify-content: center;
} }
#username{ #username{
color: #4f5051; color: #666;
font-size: 38rpx; font-size: 34rpx;
margin-bottom: 10rpx;
}
#userDetail{
font-size: 28rpx;
color: #A7A7A8;
display: flex;
align-items: center;
}
.userDetailLine{
display: block;
width: 2rpx;
height: 23rpx;
background: #A7A7A8;
margin: 0 20rpx;
} }
...@@ -42,21 +31,43 @@ ...@@ -42,21 +31,43 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 28rpx; font-size: 34rpx;
color: #A7A7A8; color: #4F5051;
padding: 25rpx; padding: 20rpx 30rpx;
background-color: #fff;
margin-top: 20rpx;
} }
.use{ .use{
display: flex; display: flex;
align-items: center; align-items: center;
} }
.use>image{ .use>image{
width: 50rpx; width: 70rpx;
height: 36rpx; height: 70rpx;
margin-right: 10rpx; margin-right: 15rpx;
} }
.arrowDown{ .arrowDown{
width: 36rpx; width: 48rpx;
height: 36rpx; height: 48rpx;
margin-left: 10rpx; }
.snCode{
display: flex;
align-items: center;
}
.snCode text{
font-size: 28rpx;
color: #999999;
margin-left: 20rpx;
}
#unbundleBox{
display: flex;
align-items: center;
font-size: 34rpx;
color: #33D1C4;
}
#unbundleBox image{
width: 35rpx;
height: 35rpx;
margin-right: 10rpx;
} }
\ No newline at end of file
var app = getApp();
Page({
data: {
status: 2
},
onLoad: function () {
},
// 稍后前往
lastGo: function () {
// 关闭当前页面,跳转到首页
wx.redirectTo({
url: '/pages/index/index'
})
},
// 一键前往
nowGo: function () {
// 关闭当前页面,跳转到 "训练计划"
wx.redirectTo({
url: '/pages/plan/plan'
})
},
})
<view id="mustUpdate">
<view id="mustUpdateBox" wx:if="{{status==1}}">
<!-- 内容 -->
<view id="mustUpdateCon">
<view id="mustUpdateTitle">尊敬的家长您好</view>
<view id="mustUpdateDes">请前往“训练计划”更新训练计划,否则护眼仪将暂时无法正常使用。</view>
</view>
<!-- 按钮组 -->
<view id="mustUpdateBtn">
<text id="lastGoBtn" bindtap="lastGo">稍后前往</text>
<text id="nowGoBtn" bindtap="nowGo">一键前往</text>
</view>
</view>
<view id="mustUpdateBox" wx:else>
<!-- 内容 -->
<view id="mustUpdateCon">
<view id="mustUpdateTitle">尊敬的家长您好</view>
<view id="mustUpdateDes">因您长时间未更新视力信息,眼保仪已被暂时锁定,请您立即前往"训练计划"更新“视力数据”进行解锁!</view>
</view>
<!-- 按钮组 -->
<view id="mustUpdateBtn">
<text id="nowGoBtn" bindtap="nowGo">立即前往</text>
</view>
</view>
</view>
#mustUpdate{
background: rgba(0,0,0,0.5);
min-height: 100vh;
}
#mustUpdateTitle{
font-size: 36rpx;
color: #000000;
padding: 50rpx 0 18rpx;
text-align: center;
}
#mustUpdateDes{
font-size: 30rpx;
color: #888888;
padding: 0 40rpx 30rpx;
text-align: center;
}
#mustUpdateBox{
width: 560rpx;
position: absolute;
left: 50%;
top: 45%;
border-radius: 8rpx;
transform: translate(-50%,-50%);
background: #fff;
}
/* 按钮 */
#mustUpdateBtn{
font-size: 36rpx;
color: #33D1C4;
display: flex;
justify-content: center;
align-items: center;
border-top: 2rpx solid #E5E5E5;
overflow: hidden;
}
#mustUpdateBtn>text{
text-align: center;
width: 49.2%;
padding: 25rpx 0;
}
#lastGoBtn{
border-right: 2rpx solid #E5E5E5;
}
\ No newline at end of file
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
teenageName: '',
avatar: '',
beginTime: '',
endTime: '',
trainingTimes: '',
trainingList: [],
totalDuration: [],
}, },
onLoad: function () { onLoad: function () {
let me = this;
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'Trainings/index',
method: 'POST',
data: {
token: wx.getStorageSync('token')
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
me.setData({
teenageName: res.data.data.teenageName,
avatar: res.data.data.avatar,
beginTime: res.data.data.beginTime,
endTime: res.data.data.endTime,
trainingTimes: res.data.data.trainingTimes,
totalDuration: res.data.data.totalDuration,
trainingList: res.data.data.trainingList,
})
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
}, },
// 更新计划 // 更新计划
update: function () { update: function () {
......
<view id="plan"> <view id="plan">
<!-- 顶部数据 --> <view id="planInfoBox">
<view id="planWrap"> <view id="planInfo">
<view id="planCon"> <view id="planInfoHead">
<view id="planConTitle">训练计划</view> <image id="userHead" src="{{ avatar }}" />
<view class="planConDes">本周(x月x日~x月x日)</view> <view id="username">{{ teenageName }}</view>
<view class="planConDes">每天训练<text>2</text>组,总时长<text>123</text>分钟</view>
<view class="planConDes">其中动态训练<text>2</text>,单词训练<text>123</text>分钟</view>
<view id="planConTip">训练计划随着您的孩子视力情况随机调整,请按时更新孩子视力情况,以便达到最合理的训练安排及最佳的效果哦!</view>
</view>
</view>
<!-- 视力历史 -->
<view id="history">
<view id="historyTitle">视力历史</view>
<view id="historyList">
<view class="historyListItem">
<text>视力情况</text>
<text>左</text>
<text>右</text>
</view>
<view class="historyListItem">
<text>裸眼视力</text>
<text>4.0</text>
<text>4.0</text>
</view>
<view class="historyListItem">
<text>矫正视力</text>
<text>4.5</text>
<text>3.5</text>
</view>
<view class="historyListItem">
<text>眼镜度数</text>
<text>150</text>
<text>200</text>
</view>
<view class="historyListItem">
<text>弱视、散光</text>
<text>有</text>
<text>无</text>
</view> </view>
<view id="planInfoTime">
<view class="planConDes">本周<text>{{beginTime}}~{{endTime}}</text></view>
<view class="planInfoTimeDes">每天训练<text>{{trainingTimes}}</text>组</view>
<view class="planInfoTimeDes">训练总时长<text>{{totalDuration}}</text>分钟</view>
<view class="planInfoTimeDes" wx:for="{{trainingList}}" wx:key>·{{item.type}}<text>{{item.duration}}</text>分钟</view>
</view>
</view>
</view>
<view id="planInfoTip">训练计划随着您的孩子视力情况随机调整,请按时更新孩子视力情况,以便达到最合理的训练安排及最佳的效果!</view>
<view id="planList">
<view class="planListItem">
<view class="planListItemTitle">
<text>第一组</text>
<text>{{trainingList[0].type}}</text>
</view>
<!-- 动态 -->
<view class="planListItemCon" wx:if="{{trainingList[0].type=='动态训练'}}">
<view><image class="planListItemIcon" src="../../assets/pic-dt.png" /></view>
<view class="planListItemText">看视频的同时进行训练,通过丰富的内容画面,模拟真实世界场景,结合设备的远近调节,达到训练10分钟,满足当日长时间望远需要,锻炼睫状肌,缓解疲劳。</view>
</view>
<!-- 静态 -->
<view class="planListItemCon" wx:elif="{{trainingList[0].type=='静态训练'}}">
<view><image class="planListItemIcon" src="../../assets/pic-jt.png" /></view>
<view class="planListItemText">看图片,听音乐进行训练,通过看自然风景,动漫人物, 科幻场景等主题图片来同时锻炼眼外肌和睫状肌的收缩性,改善睫状肌的收缩能力,从而预防和防控近视情况的产生。</view>
</view>
<!-- 单词 -->
<view class="planListItemCon" wx:else>
<view><image class="planListItemIcon" src="../../assets/pic-word.png" /></view>
<view class="planListItemText">学单词的同时进行训练。单词与课本同步,使用艾宾浩斯记忆法,让孩子能够在高效学习单词的同时锻炼睫状肌和外眼肌,保护视力。</view>
</view>
<view class="planListItemTime"><image src="../../assets/icon_traintime.png"></image>训练{{trainingList[0].duration}}分钟</view>
</view>
<view class="planListItem">
<view class="planListItemTitle">
<text>第二组</text>
<text>{{trainingList[1].type}}</text>
</view>
<!-- 动态 -->
<view class="planListItemCon" wx:if="{{trainingList[1].type=='动态训练'}}">
<view><image class="planListItemIcon" src="../../assets/pic-dt.png" /></view>
<view class="planListItemText">看视频的同时进行训练,通过丰富的内容画面,模拟真实世界场景,结合设备的远近调节,达到训练10分钟,满足当日长时间望远需要,锻炼睫状肌,缓解疲劳。</view>
</view>
<!-- 静态 -->
<view class="planListItemCon" wx:elif="{{trainingList[1].type=='静态训练'}}">
<view><image class="planListItemIcon" src="../../assets/pic-jt.png" /></view>
<view class="planListItemText">看图片,听音乐进行训练,通过看自然风景,动漫人物, 科幻场景等主题图片来同时锻炼眼外肌和睫状肌的收缩性,改善睫状肌的收缩能力,从而预防和防控近视情况的产生。</view>
</view>
<!-- 单词 -->
<view class="planListItemCon" wx:else>
<view><image class="planListItemIcon" src="../../assets/pic-word.png" /></view>
<view class="planListItemText">学单词的同时进行训练。单词与课本同步,使用艾宾浩斯记忆法,让孩子能够在高效学习单词的同时锻炼睫状肌和外眼肌,保护视力。</view>
</view>
<view class="planListItemTime"><image src="../../assets/icon_traintime.png"></image>训练{{trainingList[1].duration}}分钟</view>
</view> </view>
</view> </view>
<!-- 按钮组 --> <!-- 按钮组 -->
...@@ -45,3 +65,12 @@ ...@@ -45,3 +65,12 @@
<button id="updatePlan" bindtap='update'>更新计划</button> <button id="updatePlan" bindtap='update'>更新计划</button>
</view> </view>
</view> </view>
<wxs module="we">
var toFixed = function (value) {
return Math.floor(value);
}
module.exports = {
toFixed :toFixed
}
</wxs>
#plan{ #plan{
background: #EFEFF4; background-color: #e6ece5;
min-height: 100vh; min-height: 100vh;
} }
/* 顶部 */
#planWrap{ #planInfoBox{
padding: 30rpx; padding: 20rpx;
}
#planInfo{
background: #fff;
display: flex;
padding: 21rpx 0;
border-radius: 20rpx;
}
#planInfoHead{
padding: 0 40rpx;
border-right: 1rpx solid #E5ECE5;
display: flex;
flex-direction: column;
justify-content: center;
}
#userHead{
display: block;
height: 120rpx;
width: 120rpx;
border-radius: 50%;
} }
#planCon{ #username{
background: #ccc;
padding: 25rpx;
font-size: 28rpx; font-size: 28rpx;
color: #4F5051; color: #4F5051;
border-radius: 10rpx; margin-top: 10rpx;
text-align: center;
}
#planInfoTime{
padding-left: 40rpx;
} }
#planConTitle{ .planConDes{
font-size: 32rpx; font-size: 32rpx;
text-align: center; color: #10D9B8;
padding-top: 20rpx;
} }
.planConDes>text{ .planConDes>text{
font-size: 40rpx; font-size: 28rpx;
margin-left: 20rpx;
}
.planInfoTimeDes{
font-size: 28rpx;
color: #666;
} }
#planConTip{ .planInfoTimeDes text{
padding-top: 30rpx; font-weight: 300;
color: #111;
font-size: 48rpx;
padding: 0 20rpx;
}
#planInfoTip{
font-size: 24rpx; font-size: 24rpx;
color: #666;
padding: 0 20rpx 30rpx;
} }
/* 列表 */ #planList{
#history{ background-color: #fff;
color: #4F5051;
} }
#historyTitle{ .planListItem{
text-align: center; padding: 0 25rpx;
font-size: 26rpx; border-bottom: 1rpx solid #E5ECE5;
} }
.historyListItem{ .planListItemTitle{
border-bottom: 1rpx solid #E5ECE5;
font-size: 32rpx;
color: #111111;
display: flex; display: flex;
justify-content: space-around; justify-content: space-between;
font-size: 24rpx; align-items: center;
padding-top: 15rpx;
}
/* 折线图 */
#eyeChart{
width: 100%;
height: 380rpx;
padding: 30rpx 0; padding: 30rpx 0;
} }
.planListItemCon{
display: flex;
padding: 30rpx 0 20rpx;
}
.planListItemIcon{
display: block;
width: 106rpx;
height: 106rpx;
margin-right: 30rpx;
}
.planListItemText{
font-size: 28rpx;
color: #666;
}
.planListItemTime{
text-align: right;
font-size: 28rpx;
color: #33D1C4;
display: flex;
justify-content: flex-end;
align-items: center;
padding-bottom: 30rpx;
}
.planListItemTime image{
width: 32rpx;
height: 32rpx;
margin-right: 12rpx;
}
/* 按钮 */ /* 按钮 */
#planBtn{ #planBtn{
padding: 75rpx 30rpx 80rpx; padding: 40rpx 50rpx 80rpx;
} }
#updatePlan{ #updatePlan{
background: #33D1C4; background: #33D1C4;
border-radius: 10rpx; border-radius: 47rpx;
font-size: 36rpx; font-size: 36rpx;
color: #FFFFFF; color: #FFFFFF;
height: 94rpx; height: 94rpx;
......
var app = getApp();
Page({
data: {
equipmentId: 'B022I319D384F95',
trainTip: true,
messageTip: true,
serveTip: true,
isShow: true,
},
onLoad: function (options) {
},
// 训练提醒(总开关)
trainTip: function(e) {
this.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
console.log('训练提醒'+this.data.trainTip)
},
messageTip: function(e) {
this.setData({
messageTip: e.detail.value
})
if(this.data.messageTip || this.data.serveTip){
}else{
this.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
}
console.log('短信提醒'+this.data.messageTip)
},
serveTip: function(e) {
this.setData({
serveTip: e.detail.value
})
if(this.data.messageTip || this.data.serveTip){
}else{
this.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
}
console.log('服务号提醒'+this.data.serveTip)
},
// 更改网络
changeNet: function () {
wx.navigateTo({
url: '/pages/network/network'
})
},
// 退出登录
logout: function(e) {
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'users/logout',
method: 'POST',
data: {
token: wx.getStorageSync('token')
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
if(res.data.errno==200){
wx.showToast({
title: '退出登录成功!',
mask: true,
// icon: 'none',
duration: 2000
});
// 关闭所有页面,打开到
wx.reLaunch({
url: '/pages/login/login'
})
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
})
\ No newline at end of file
{
"navigationBarTitleText": "训练设置",
"usingComponents": {}
}
\ No newline at end of file
#ruleSet{
background: #EFEFF4;
min-height: 100vh;
}
#clubCardWrap{
padding: 20rpx 20rpx 0 20rpx;
}
#clubCard{
border-radius: 10rpx;
box-shadow:3px 2px 3px 2px #888;
margin-bottom: 30rpx;
}
#clubCardTop{
padding: 22rpx 24rpx;
position: relative;
background: #333;
color: #d7d7d7;
font-size: 32rpx;
border-top-left-radius: 10rpx;
border-top-right-radius: 10rpx;
}
#clubCardTop>image{
width: 320rpx;
height: 136rpx;
position: absolute;
top: 56rpx;
right: 24rpx;
}
#clubCardTopLeftTitle{
padding-bottom: 30rpx;
}
#clubCardScoreLabel{
font-size: 24rpx;
}
#clubCardScore{
font-size: 32rpx;
}
#clubCardBom{
padding: 20rpx;
color: #333;
font-size: 24rpx;
display: flex;
align-items: center;
background: #d7d7d7;
border-bottom-left-radius: 10rpx;
border-bottom-right-radius: 10rpx;
}
#clubCardBom>image{
height: 60rpx;
width: 60rpx;
margin-right: 24rpx;
}
#networkInfo{
background: #fff;
padding: 20rpx;
}
#networkInfoId{
font-size: 34rpx;
color: #4F5051;
padding: 20rpx 0;
}
#networkInfoBox{
color: #888;
font-size: 28rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
#changeNet{
width: 210rpx;
height: 56rpx;
line-height: 56rpx;
background: #fff;
color: #33D1C4;
border: 2rpx solid #33D1C4;
font-size: 28rpx;
margin:0;
}
#changeNet>image{
width: 24rpx;
height: 24rpx;
}
#trainTip{
padding: 30rpx 25rpx;
background: #fff;
margin-top: 20rpx;
}
#trainTipTitle{
display: flex;
justify-content: space-between;
align-items: center;
font-size: 34rpx;
color: #4F5051;
}
switch{
transform:scale(0.9);
}
#trainTipBom{
background: #fafafc;
padding: 0 25rpx;
font-size: 34rpx;
color: #4F5051;
}
#trainTipBomItem{
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 0;
border-top: 2rpx solid #e5e5e5;
}
.trainLeft{
display: flex;
align-items: center;
}
.trainLeft>image{
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
}
/* 退出登录 */
#logoutWrap{
position: absolute;
bottom: 40rpx;
width: 100%;
}
#logoutBox{
padding: 40rpx 30rpx;
}
#logoutBtn{
background: #33D1C4;
border-radius: 10rpx;
font-size: 36rpx;
color: #FFFFFF;
height: 94rpx;
line-height: 94rpx;
}
\ No newline at end of file
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
useArray: ['允许使用','完成当日训练后允许使用','不可使用'], useArray: ['允许使用全部应用','完成训练计划,允许使用应用','不可使用应用'],
useIndex: 0,//使用限制 useIndex: 0,//使用限制
shieldAllArray: ['关闭护眼功能','使用20分钟,强制训练5分钟','使用30分钟,强制训练5分钟','使用40分钟,强制训练5分钟'], shieldArray: ['关闭','使用20分钟,护眼5分钟','使用30分钟,护眼5分钟','使用40分钟,护眼5分钟'],
shieldArray: ['关闭护眼功能','使用20分钟,训练5分钟','使用30分钟,训练5分钟','使用40分钟,训练5分钟'],
shieldIndex: 0,//强制护眼 shieldIndex: 0,//强制护眼
// shieldValue: [0], // shieldValue: [0],
// shield: '', // shield: '',
starting: 0, //开机提醒状态,1、允许、0、不允许
installApp: 0, //安装应用状态,1、允许安装、0、不允许安装 installApp: 0, //安装应用状态,1、允许安装、0、不允许安装
...@@ -23,9 +21,9 @@ Page({ ...@@ -23,9 +21,9 @@ Page({
weakArray: ['关闭','双眼弱视','右眼弱视','左眼弱视'], weakArray: ['关闭','双眼弱视','右眼弱视','左眼弱视'],
weakIndex: 0,//弱视训练 weakIndex: 0,//弱视训练
// shieldAllArray: [{name:'关闭护眼功能'},{name:'使用应用20分钟,强制护眼训练5分钟'},{name:'使用应用30分钟,强制护眼训练5分钟'},{name:'使用应用40分钟,强制护眼训练5分钟'}],//picker 数据 constraintTipShow: false,
// pickerClo: "1",// picker 几列 useLimitShow: false,
installAppTipShow: false,
}, },
onLoad: function () { onLoad: function () {
// this.demopicker = this.selectComponent("#shieldpicker"); // this.demopicker = this.selectComponent("#shieldpicker");
...@@ -36,7 +34,7 @@ Page({ ...@@ -36,7 +34,7 @@ Page({
mask: true mask: true
}) })
wx.request({ wx.request({
url: app.globalData.apiUrl + 'apps/info', url: app.globalData.apiUrl + 'Settings/index',
method: 'POST', method: 'POST',
data: { data: {
token: wx.getStorageSync('token') token: wx.getStorageSync('token')
...@@ -45,11 +43,28 @@ Page({ ...@@ -45,11 +43,28 @@ Page({
// 请求成功后关闭Loading // 请求成功后关闭Loading
wx.hideLoading(); wx.hideLoading();
if(res.data.errno==200){ if(res.data.errno==200){
if(res.data.data.loopTrainingtime==40){
me.setData({
shieldIndex: 3
})
}else if(res.data.data.loopTrainingtime==30){
me.setData({
shieldIndex: 2
})
}else if(res.data.data.loopTrainingtime==20){
me.setData({
shieldIndex: 1
})
}else{
me.setData({
shieldIndex: 0
})
}
me.setData({ me.setData({
useIndex: res.data.data.appManagement-1, useIndex: res.data.data.appLockedStatus-1,
shieldIndex: res.data.data.eyeProtection-1, installApp: res.data.data.moreAppStatus,
installApp: res.data.data.installApp, parallaxIndex: res.data.data.parallaxStatus-1,
// starting: res.data.data.starting weakIndex: res.data.data.redLightStatus-1,
}) })
}else{ }else{
wx.showModal({ wx.showModal({
...@@ -108,17 +123,17 @@ Page({ ...@@ -108,17 +123,17 @@ Page({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
// wx.request({ wx.request({
// url: app.globalData.apiUrl + 'apps/appManagement', url: app.globalData.apiUrl + 'devices/setIntensiveTraining',
// method: 'POST', method: 'POST',
// data: { data: {
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
// status: parallaxStatus status: parallaxStatus
// }, },
// success: function (res) { success: function (res) {
// 请求成功后关闭Loading // 请求成功后关闭Loading
wx.hideLoading(); wx.hideLoading();
// if(res.data.errno==200){ if(res.data.errno==200){
me.setData({ me.setData({
parallaxIndex: parallaxStatus-1 parallaxIndex: parallaxStatus-1
}) })
...@@ -126,21 +141,21 @@ Page({ ...@@ -126,21 +141,21 @@ Page({
wx.showModal({ wx.showModal({
title: '重要提示', title: '重要提示',
showCancel: false, showCancel: false,
content: '训练仅适用于双眼视差大于0.2的情况' content: '视差训练仅适用于双眼视差大于0.2的情况'
}) })
} }
// }else{ }else{
// me.setData({ me.setData({
// parallaxIndex: me.data.parallaxIndex parallaxIndex: me.data.parallaxIndex
// }) })
// wx.showModal({ wx.showModal({
// title: '提示', title: '提示',
// showCancel: false, showCancel: false,
// content: res.data.msg content: res.data.msg
// }) })
// } }
// } }
// }) })
}, },
weakChange: function (e) {// 弱视训练 weakChange: function (e) {// 弱视训练
let me = this, let me = this,
...@@ -152,17 +167,17 @@ Page({ ...@@ -152,17 +167,17 @@ Page({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
// wx.request({ wx.request({
// url: app.globalData.apiUrl + 'apps/appManagement', url: app.globalData.apiUrl + 'devices/setRedLightTraining',
// method: 'POST', method: 'POST',
// data: { data: {
// token: wx.getStorageSync('token'), token: wx.getStorageSync('token'),
// status: weakStatus status: weakStatus
// }, },
// success: function (res) { success: function (res) {
// 请求成功后关闭Loading // 请求成功后关闭Loading
wx.hideLoading(); wx.hideLoading();
// if(res.data.errno==200){ if(res.data.errno==200){
me.setData({ me.setData({
weakIndex: weakStatus-1 weakIndex: weakStatus-1
}) })
...@@ -170,21 +185,21 @@ Page({ ...@@ -170,21 +185,21 @@ Page({
wx.showModal({ wx.showModal({
title: '重要提示', title: '重要提示',
showCancel: false, showCancel: false,
content: '如无弱视情况,请勿开启此训练!' content: '如无弱视情况,请勿开启此训练!\r\n(原理:使用红灯闪烁的方式,激活黄斑区视觉细胞感光能力)'
}) })
} }
// }else{ }else{
// me.setData({ me.setData({
// weakIndex: me.data.weakIndex weakIndex: me.data.weakIndex
// }) })
// wx.showModal({ wx.showModal({
// title: '提示', title: '提示',
// showCancel: false, showCancel: false,
// content: res.data.msg content: res.data.msg
// }) })
// } }
// } }
// }) })
}, },
shieldChange: function (e) {// 强制护眼 shieldChange: function (e) {// 强制护眼
let me = this, let me = this,
...@@ -223,88 +238,6 @@ Page({ ...@@ -223,88 +238,6 @@ Page({
} }
}) })
}, },
// 训练提醒(总开关)
trainTip: function(e) {
this.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
console.log('训练提醒'+this.data.trainTip)
},
messageTip: function(e) {
this.setData({
messageTip: e.detail.value
})
if(this.data.messageTip || this.data.serveTip){
}else{
this.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
}
console.log('短信提醒'+this.data.messageTip)
},
serveTip: function(e) {
this.setData({
serveTip: e.detail.value
})
if(this.data.messageTip || this.data.serveTip){
}else{
this.setData({
trainTip: e.detail.value,
messageTip: e.detail.value,
serveTip: e.detail.value,
isShow: e.detail.value
})
}
console.log('服务号提醒'+this.data.serveTip)
},
starting: function (e) {// 开机提醒
console.log('开机提醒', e.detail.value)
let me = this,
startingStatus = 0;
if(e.detail.value){
// 安装应用状态,1、允许安装、0、不允许安装
startingStatus = 1
}else{
startingStatus = 0
}
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
// wx.request({
// url: app.globalData.apiUrl + 'apps/installApp',
// method: 'POST',
// data: {
// token: wx.getStorageSync('token'),
// status: startingStatus
// },
// success: function (res) {
// // 请求成功后关闭Loading
wx.hideLoading();
// if(res.data.errno==200){
me.setData({
starting: startingStatus
})
// }else{
// me.setData({
// starting: me.data.starting
// })
// wx.showModal({
// title: '提示',
// showCancel: false,
// content: res.data.msg
// })
// }
// }
// })
},
installApp: function (e) {// 安装应用 installApp: function (e) {// 安装应用
console.log('安装应用', e.detail.value) console.log('安装应用', e.detail.value)
let me = this, let me = this,
...@@ -349,26 +282,35 @@ Page({ ...@@ -349,26 +282,35 @@ Page({
}, },
// 使用限制疑问 // 使用限制疑问
useLimit: function () { useLimit: function () {
wx.showModal({ this.setData({
title: '提示', useLimitShow: true
showCancel: false, })
content: '您可以根据情况设置是否完成训练计划才可以使用其他应用或功能' },
closeUseLimit: function () {
this.setData({
useLimitShow: false
}) })
}, },
// 强制护眼疑问 // 强制护眼疑问
constraint: function () { constraint: function () {
wx.showModal({ this.setData({
title: '提示', constraintTipShow: true
showCancel: false, })
content: '您可以根据选项设置使用时长的强制护眼训练' },
closeConstraintTip: function () {
this.setData({
constraintTipShow: false
}) })
}, },
// 安装应用疑问 // 安装应用疑问
installAppTip: function () { installAppTip: function () {
wx.showModal({ this.setData({
title: '提示', installAppTipShow: true
showCancel: false, })
content: '打开该设置可以允许自主下载更多应用' },
closeInstallAppTip: function () {
this.setData({
installAppTipShow: false
}) })
}, },
toWhiteList: function(e) { toWhiteList: function(e) {
...@@ -408,5 +350,4 @@ Page({ ...@@ -408,5 +350,4 @@ Page({
// // this.demopicker.hiddePicker(); // // this.demopicker.hiddePicker();
// }, // },
}) })
...@@ -3,72 +3,43 @@ ...@@ -3,72 +3,43 @@
<view class="useSetting"> <view class="useSetting">
<view class="useSettingTip" bindtap='useLimit'> <view class="useSettingTip" bindtap='useLimit'>
<text class="useSettingTitle">使用限制</text> <text class="useSettingTitle">使用限制</text>
<view class="useSettingTipIcon">
<image src="../../assets/tips.png" /> <image src="../../assets/tips.png" />
<view class='invite' hidden="{{!useLimitShow}}">
您可以设置是否完成训练计划后,才允许使用「娱乐」「游戏」「视频」等应用
</view>
</view>
</view> </view>
<picker bindchange="useChange" value="{{useIndex}}" range="{{useArray}}"> <picker bindchange="useChange" value="{{useIndex}}" range="{{useArray}}">
<view class="useSettingBox"> <view class="useSettingBox">
<view class="use">{{useArray[useIndex]}}</view> <view class="use">{{useArray[useIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" /> <image class="arrowDown" src="../../assets/icon_more.png" />
</view> </view>
</picker> </picker>
</view> </view>
<view class="useSetting"> <view class="useSetting">
<view class="useSettingTip" bindtap='constraint'> <view class="useSettingTip" bindtap='constraint'>
<text class="useSettingTitle">强制护眼</text> <text class="useSettingTitle">强制护眼</text>
<view class="useSettingTipIcon">
<image src="../../assets/tips.png" /> <image src="../../assets/tips.png" />
<view class='invite' hidden="{{!constraintTipShow}}">
未训练的使用时长达到设定时间后,系统将自动进行护眼训练
</view>
</view> </view>
<picker bindchange="shieldChange" value="{{shieldIndex}}" range="{{shieldAllArray}}"> </view>
<picker bindchange="shieldChange" value="{{shieldIndex}}" range="{{shieldArray}}">
<view class="useSettingBox"> <view class="useSettingBox">
<view class="use">{{shieldArray[shieldIndex]}}</view> <view class="use">{{shieldArray[shieldIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" /> <image class="arrowDown" src="../../assets/icon_more.png" />
</view> </view>
</picker> </picker>
<!-- <view class="useSettingBox" catchtap="shieldTap">
<view class="use">{{shieldArray[shieldValue]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" />
<my-picker id='shieldpicker' column="{{pickerClo}}" list="{{shieldAllArray}}" value="{{shieldValue}}" bind:confirm='confirm'></my-picker>
</view> -->
</view>
<!-- 开机提醒 -->
<view class="useSetting useSettingInstall">
<text class="useSettingTitle">开机提醒</text>
<switch color="#33D1C4" checked="{{starting==1}}" bindchange="starting"/>
</view>
<!-- 训练提醒 -->
<view id="trainTip">
<view id="trainTipTitle">
<text>训练提醒</text>
<view id="trainTipRight">
<switch color="#33D1C4" checked="{{trainTip}}" bindchange="trainTip"/>
</view>
</view>
</view>
<view id="trainTipBom" hidden="{{!isShow}}">
<view id="trainTipBomItem">
<view class="trainLeft">
<image src="../../assets/account_pn.png" />
<text>短信提醒</text>
</view>
<view id="trainTipBomRight">
<switch color="#33D1C4" checked="{{messageTip}}" bindchange="messageTip"/>
</view>
</view>
<view id="trainTipBomItem">
<view class="trainLeft">
<image src="../../assets/account_wx.png" />
<text>服务号提醒</text>
</view>
<view id="trainTipBomRight">
<switch color="#33D1C4" checked="{{serveTip}}" bindchange="serveTip"/>
</view>
</view>
</view> </view>
<view class="useSetting parallaxBox"> <view class="useSetting parallaxBox">
<text class="useSettingTitle">视差训练</text> <text class="useSettingTitle">视差训练</text>
<picker bindchange="parallaxChange" value="{{parallaxIndex}}" range="{{parallaxArray}}"> <picker bindchange="parallaxChange" value="{{parallaxIndex}}" range="{{parallaxArray}}">
<view class="useSettingBox"> <view class="useSettingBox">
<view class="use">{{parallaxArray[parallaxIndex]}}</view> <view class="use">{{parallaxArray[parallaxIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" /> <image class="arrowDown" src="../../assets/icon_more.png" />
</view> </view>
</picker> </picker>
</view> </view>
...@@ -77,14 +48,19 @@ ...@@ -77,14 +48,19 @@
<picker bindchange="weakChange" value="{{weakIndex}}" range="{{weakArray}}"> <picker bindchange="weakChange" value="{{weakIndex}}" range="{{weakArray}}">
<view class="useSettingBox"> <view class="useSettingBox">
<view class="use">{{weakArray[weakIndex]}}</view> <view class="use">{{weakArray[weakIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" /> <image class="arrowDown" src="../../assets/icon_more.png" />
</view> </view>
</picker> </picker>
</view> </view>
<view class="useSetting useSettingInstall"> <view class="useSetting useSettingInstall">
<view class="useSettingTip" bindtap='installAppTip'> <view class="useSettingTip" bindtap='installAppTip'>
<text class="useSettingTitle">允许自由安装更多应用</text> <text class="useSettingTitle">允许自由安装更多应用</text>
<view class="useSettingTipIcon">
<image src="../../assets/tips.png" /> <image src="../../assets/tips.png" />
<view class='inviteSmall' hidden="{{!installAppTipShow}}">
打开该设置可以允许自主下载更多应用
</view>
</view>
</view> </view>
<switch color="#33D1C4" checked="{{installApp==1}}" bindchange="installApp"/> <switch color="#33D1C4" checked="{{installApp==1}}" bindchange="installApp"/>
</view> </view>
...@@ -113,5 +89,7 @@ ...@@ -113,5 +89,7 @@
<view id="settingBtn"> <view id="settingBtn">
<button id="settingDone" bindtap='settingDone'>保存</button> <button id="settingDone" bindtap='settingDone'>保存</button>
</view> </view>
<!-- <navigator hover-class="none" target="miniProgram" open-type="exit"> 退出当前小程序</navigator> --> <view class="dialogBg" hidden="{{!useLimitShow}}" bindtap="closeUseLimit"></view>
<view class="dialogBg" hidden="{{!constraintTipShow}}" bindtap="closeConstraintTip"></view>
<view class="dialogBg" hidden="{{!installAppTipShow}}" bindtap="closeInstallAppTip"></view>
</view> </view>
\ No newline at end of file
...@@ -10,7 +10,11 @@ ...@@ -10,7 +10,11 @@
background: #fff; background: #fff;
margin-bottom: 21rpx; margin-bottom: 21rpx;
} }
.useSettingTip>image{ .useSettingTipIcon{
display: inline;
position: relative;
}
.useSettingTipIcon>image{
width: 29rpx; width: 29rpx;
height: 29rpx; height: 29rpx;
margin-left: 7rpx; margin-left: 7rpx;
...@@ -33,8 +37,8 @@ ...@@ -33,8 +37,8 @@
color: #A7A7A8; color: #A7A7A8;
} }
.arrowDown{ .arrowDown{
width: 36rpx; width: 48rpx;
height: 36rpx; height: 48rpx;
margin-left: 10rpx; margin-left: 10rpx;
} }
switch{ switch{
...@@ -77,8 +81,8 @@ switch{ ...@@ -77,8 +81,8 @@ switch{
border-bottom: 4rpx solid #33D1C4; border-bottom: 4rpx solid #33D1C4;
} }
.whiteListTabItem>image{ .whiteListTabItem>image{
width: 60rpx; width: 64rpx;
height: 60rpx; height: 54rpx;
margin-bottom: 6rpx; margin-bottom: 6rpx;
} }
.centerTabItem{ .centerTabItem{
...@@ -100,42 +104,66 @@ switch{ ...@@ -100,42 +104,66 @@ switch{
line-height: 94rpx; line-height: 94rpx;
} }
/* 训练提醒 */ .dialogBg{
#trainTip{ position: absolute;
padding: 30rpx 25rpx; z-index: 1;
background: #fff; top: 0;
} left: 0;
#trainTipTitle{ bottom: 0;
display: flex; right: 0;
justify-content: space-between;
align-items: center;
font-size: 34rpx;
color: #4F5051;
}
switch{
transform:scale(0.9);
} }
#trainTipBom{ .invite {
background: #fafafc; /* display: none; */
padding: 0 25rpx; width: 450rpx;
font-size: 34rpx; font-size: 25rpx;
color: #4F5051; /* height: 50rpx; */
} line-height: 50rpx;
#trainTipBomItem{ padding-left: 20rpx;
display: flex; position: absolute;
justify-content: space-between; background-color: #FFF0F5;
align-items: center; border: 1px solid #FFB5C5;
padding: 30rpx 0; border-radius: 5px;
border-top: 2rpx solid #e5e5e5; top: 50rpx;
left: -10rpx;
z-index: 2;
}
.invite:after {
content: '';
width: 20rpx;
height: 20rpx;
position: absolute;
top: -11rpx;
left: 20rpx;
transform: rotate(45deg);
background-color: #FFF0F5;
border: 1px #FFB5C5;
border-style: solid none none solid ;
}
.inviteSmall {
/* display: none; */
width: 300rpx;
font-size: 25rpx;
/* height: 50rpx; */
line-height: 50rpx;
padding-left: 20rpx;
position: absolute;
background-color: #FFF0F5;
border: 1px solid #FFB5C5;
border-radius: 5px;
top: 50rpx;
left: -10rpx;
z-index: 2;
}
.inviteSmall:after {
content: '';
width: 20rpx;
height: 20rpx;
position: absolute;
top: -11rpx;
left: 20rpx;
transform: rotate(45deg);
background-color: #FFF0F5;
border: 1px #FFB5C5;
border-style: solid none none solid ;
} }
.trainLeft{
display: flex;
align-items: center;
}
.trainLeft>image{
width: 36rpx;
height: 36rpx;
margin-right: 10rpx;
}
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
equipmentId: '' sortList: [],
noThreeSortList: [],
}, },
onLoad: function (options) { onLoad: function () {
console.log(options.equipmentId)
this.setData({
equipmentId: options.equipmentId
})
},
noBind: function() {
// 暂不绑定,关闭所有页面,返回扫码页面
wx.reLaunch({
url: '/pages/getCodeIndex/getCodeIndex'
})
},
bindEquipment: function() {
let me = this; let me = this;
// 请求前加Loading // 请求前加Loading
wx.showLoading({ wx.showLoading({
...@@ -23,26 +12,19 @@ Page({ ...@@ -23,26 +12,19 @@ Page({
mask: true mask: true
}) })
wx.request({ wx.request({
url: app.globalData.apiUrl + 'devices/bind', url: app.globalData.apiUrl + 'ranks/effectedRanking',
method: 'POST', method: 'POST',
data: { data: {
token: wx.getStorageSync('token'), token: wx.getStorageSync('token')
seexSn: me.data.equipmentId
}, },
success: function (res) { success: function (res) {
// 请求成功后关闭Loading // 请求成功后关闭Loading
wx.hideLoading(); wx.hideLoading();
if(res.data.errno==200){ if(res.data.errno==200){
// 绑定成功 let newArr = res.data.data.filter(item => item.ranking > 3)
wx.showToast({ me.setData({
title: '绑定成功', sortList: res.data.data,
mask: true, noThreeSortList: newArr,
// icon: 'none',
duration: 2000
});
//跳转完善信息
wx.navigateTo({
url: '/pages/childInfo/childInfo'
}) })
}else{ }else{
wx.showModal({ wx.showModal({
...@@ -53,5 +35,5 @@ Page({ ...@@ -53,5 +35,5 @@ Page({
} }
} }
}) })
} },
}) })
\ No newline at end of file
{ {
"navigationBarTitleText": "扫码绑定", "navigationBarTitleText": "光明之星",
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file
<view id="sortBg">
<view id="sortTop">
<view id="sortTop2" class="sortTopItem" wx:if="{{sortList[1]}}">
<image src="{{sortList[1].avatar}}"></image>
<view class="sortPlanName">{{sortList[1].name}}</view>
</view>
<view id="sortTop2" class="sortTopItem" wx:if="{{!sortList[1]}}">
</view>
<view id="sortTop1" class="sortTopItem" wx:if="{{sortList[0]}}">
<image src="{{sortList[0].avatar}}"></image>
<view class="sortPlanName">{{sortList[0].name}}</view>
</view>
<view id="sortTop1" class="sortTopItem" wx:if="{{!sortList[0]}}">
</view>
<view id="sortTop3" class="sortTopItem" wx:if="{{sortList[2]}}">
<image src="{{sortList[2].avatar}}"></image>
<view class="sortPlanName">{{sortList[2].name}}</view>
</view>
<view id="sortTop3" class="sortTopItem" wx:if="{{!sortList[2]}}">
</view>
<image id="sortPlanBg" src="../../assets/kv_star.png"></image>
</view>
<view id="sortList">
<view class="sortListItem" wx:for="{{noThreeSortList}}" wx:key="{{index}}">
<view class="sortListItemInfo">
<text>{{item.ranking}}</text>
<image src="{{item.avatar}}"></image>
<view>{{item.name}}</view>
</view>
<view class="sortListItemTime">
<image src="../../assets/up.png"></image>
<text>{{item.degree}}</text>
<text class="sortListItemEye">{{item.promoteMode}}</text>
</view>
</view>
</view>
<view id="sortListBom"></view>
</view>
#sortBg{
background-color: #e6ece5;
min-height: 100vh;
}
#sortTop{
display: flex;
justify-content: center;
position: relative;
padding-top: 60rpx;
height: 306rpx;
}
.sortTopItem{
text-align: center;
font-size: 24rpx;
color: #666666;
z-index: 1;
}
.sortTopItem image{
height: 120rpx;
width: 120rpx;
border-radius: 50%;
}
.sortPlanName{
font-size: 28rpx;
color: #111111;
}
#sortTop1{
width: 180rpx;
}
#sortTop2{
width: 170rpx;
}
#sortTop3{
width: 170rpx;
padding-top: 30rpx;
}
#sortTop1 image{
margin-top: -30rpx;
}
#sortPlanBg{
display: block;
width: 100%;
height: 366rpx;
position: absolute;
top: 0;
left: 0;
}
/* 4名以后 */
#sortList{
padding: 0 30rpx;
background: #F8F7F5;
}
.sortListItem{
display: flex;
align-items: center;
justify-content: space-between;
font-size: 34rpx;
color: #4F5051;
padding: 30rpx 0;
border-bottom: 1rpx solid #e5e5e5;
}
.sortListItemInfo{
display: flex;
align-items: center;
}
.sortListItemInfo text{
width: 44rpx;
margin-right: 10rpx;
}
.sortListItemInfo image{
height: 50rpx;
width: 50rpx;
border-radius: 50%;
margin-right: 20rpx;
}
/* .sortListItemTime{
text-align: right;
} */
.sortListItemTime image{
display: inline-block;
width: 26rpx;
height: 24rpx;
margin-right: 10rpx;
}
.sortListItemEye{
font-size: 24rpx;
color: #4F5051;
margin-left: 10rpx;
}
#sortListBom{
height: 20rpx;
}
\ No newline at end of file
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