Commit 7dd0edf6 by 陈玉桐

add 所有页面

parent eb6149a6
{
"pages": [
"pages/index/index",
"pages/historyDetail/historyDetail",
"pages/user/user",
"pages/mine/mine",
"pages/idea/idea",
"pages/index/index",
"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/message/message",
"pages/updatePlan/updatePlan",
"pages/plan/plan",
"pages/historyDetail/historyDetail",
"pages/trainHistory/trainHistory",
"pages/trainReport/trainReport",
"pages/starSort/starSort",
"pages/trainSort/trainSort",
"pages/eyesight/eyesight",
"pages/whiteList/whiteList"
"pages/setting/setting",
"pages/whiteList/whiteList",
"pages/childInfo/childInfo",
"pages/targetList/targetList"
],
"window": {
"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({
name: '',//姓名
date: '2010-01-01',// 生日
sex: 1,// 性别
school: '',// 学校
class: '',// 班级
sexList: [{ id: 1, checked: true, name: '男孩' }, { id: 2, name: '女孩' }],
// adapterSource: , //本地匹配源
// bindSource: [], //绑定到页面的数据,根据用户输入动态变化
// hideScroll: true,
isNull: false
},
onLoad: function (options) {
let me = this;
},
childInfoBack: function() {
let me = this;
wx.navigateTo({
url: '/pages/network/network'
})
},
bindDateChange: function(e) {
this.setData({
date: e.detail.value
......@@ -33,92 +22,49 @@ Page({
})
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) {
this.setData({
isNull: false,
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;
if(me.data.name==''){// 没填姓名高亮
me.setData({
......@@ -142,8 +88,6 @@ Page({
name: me.data.name,
birthday: me.data.date,
gender: me.data.sex,//性别
schoolName: me.data.school,//学校
classesName: me.data.class//班级
},
success: function (res) {
// 请求成功后关闭Loading
......@@ -169,5 +113,5 @@ Page({
}
})
}
}
},
})
\ No newline at end of file
<view id="childInfo" bindtap="ccctap">
<!-- 导航 -->
<view id="bindTabWrap">
<view id="bindTab">
<text>绑定设备</text>
<view id="childInfo">
<!-- 步骤进度 -->
<view id="tabWrap">
<view id="tab">
<text class="tabSelected">完善信息</text>
<image src="../../assets/arrow_right.png" />
<text class="bindTabSelected">完善信息</text>
<text>初始视力</text>
<image src="../../assets/arrow_right.png" />
<text>训练设置</text>
</view>
</view>
<!-- 背景 -->
<view id="infoBg">
<image src="../../assets/pic_kv.png"></image>
</view>
<!-- 基本信息 -->
<view id="childInfoListTitle">基本信息</view>
<view id="childInfoList">
<view class="childInfoListItem">
<view class="childInfoListItemTitle {{isNull?'redTitle':''}}"><text>*</text>姓名</view>
<input class="nameInput rightInput" placeholder-style="color:#CDCDCD;" bindinput="nameInput" placeholder="请输入您的孩子的真实姓名" />
<view class="childInfoListItemTitle {{isNull?'redTitle':''}}"><text>* </text>姓名</view>
<input class="nameInput rightInput" maxlength="20" placeholder-style="color:#CDCDCD;" bindinput="nameInput" placeholder="请输入您的孩子的真实姓名" />
</view>
<!-- 生日 -->
<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">
<view class="birthdaypPicker rightInput">
{{date}}
......@@ -25,41 +30,17 @@
</view>
<!-- 性别 -->
<view class="childInfoListItem">
<view class="childInfoListItemTitle"><text>*</text>性别</view>
<view class="childInfoListItemTitle"><text>* </text>性别</view>
<radio-group id="sexRadioBox" class="rightInput" bindchange="sexTap">
<label class="sexRadio" wx:for="{{sexList}}" wx:key="sexList">
<radio color="#fff" value="{{item.id}}" checked="{{item.checked}}"/>{{item.name}}
</label>
</radio-group>
</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 id="childInfoBoxCon">
<view id="childInfoBox">
<button id="childInfoBack" bindtap='childInfoBack'>上一步</button>
<button id="childInfoNext" bindtap='childInfoNext'>下一步</button>
<button id="childInfoNext" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo='childInfoNext'>下一步</button>
</view>
</view>
</view>
......@@ -2,42 +2,49 @@
background: #EFEFF4;
min-height: 100vh;
}
/* 导航 */
#bindTabWrap{
padding: 40rpx 30rpx;
#tabWrap{
padding: 40rpx 25rpx;
}
#bindTab{
#tab{
background: #fff;
display: flex;
align-items: center;
justify-content: center;
border-radius: 52rpx;
height: 104rpx;
padding: 0 55rpx;
padding: 0 30rpx;
}
#bindTab>text{
color: #CDCDCD;
#tab>text{
font-size: 34rpx;
color: #4F5051;
}
#bindTab>image{
#tab>image{
width: 34rpx;
height: 34rpx;
margin: 0 90rpx;
margin: 0 20rpx;
}
#bindTab>.bindTabSelected{
#tab>.tabSelected{
color: #33D1C4;
}
/* 背景 */
#infoBg{
padding-bottom: 20rpx;
}
#infoBg>image{
width: 100%;
height: 430rpx;
}
/* 信息列表 */
#childInfoList{
background: #fff;
padding-left: 25rpx;
}
#childInfoListTitle{
font-size: 28rpx;
color: #4F5051;
padding: 0 0 20rpx 25rpx;
}
.childInfoListItem{
display: flex;
align-items: center;
......@@ -81,7 +88,7 @@ radio .wx-radio-input.wx-radio-input-checked::before{
.childInfoListItem .childInfoListItemTitle{
font-size: 34rpx;
color: #4F5051;
width: 100rpx;
width: 115rpx;
text-align: right;
margin-right: 52rpx;
}
......@@ -126,9 +133,8 @@ radio .wx-radio-input.wx-radio-input-checked::before{
/* 按钮组 */
#childInfoBoxCon{
position: absolute;
bottom: 80rpx;
width: 100%;
padding: 40rpx 0;
}
#childInfoBox{
display: flex;
......@@ -136,17 +142,12 @@ radio .wx-radio-input.wx-radio-input-checked::before{
padding:0 40rpx;
}
#childInfoBox>button{
width: 315rpx;
width: 100%;
height: 94rpx;
line-height: 94rpx;
font-size: 36rpx;
border-radius: 10rpx;
}
#childInfoBack{
background: #F8F8F8;
border: 2rpx solid rgba(5,5,5,0.10);
color: #000000;
}
#childInfoNext{
color: #fff;
background: #33D1C4;
......
......@@ -7,9 +7,9 @@ Page({
luoData: {left: '',right: ''},//裸眼视力
jiaoData: {left: '',right: ''},//矫正视力
glassData: {left: '',right: ''},//眼镜度数
ruoData: {left: '',right: ''},// 弱视
xieData: {left: '',right: ''},// 斜视
sanData: {left: '',right: ''},// 散光
ruoData: {left: '无',right: '无'},// 弱视
xieData: {left: '无',right: '无'},// 斜视
sanData: {left: '无',right: '无'},// 散光
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']
......@@ -46,6 +46,9 @@ Page({
allLeftStatus: 0,// 多个集合左(状态)
allRightStatus: 0,// 多个集合右(状态)
first: true,// 是否第一次点击下一步
isClass: 0, //是否配镜
date: '2012-01-01',// 配镜日期
},
onLoad: function (options) {
let me = this;
......@@ -97,7 +100,7 @@ Page({
// 第一次点击没有视觉缺陷
console.log('第一次没有----下一步')
me.next();
}, 2000)
}, 50)
}
}else{
// 请求前加Loading
......@@ -113,17 +116,54 @@ Page({
// 弹窗后----下一步
console.log('弹窗后----下一步')
me.next();
}, 2000)
}, 50)
}
},
// 下一步请求
next: function(e){
let me = this;
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
// wx.showLoading({
// title: '加载中',
// 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({
url: app.globalData.apiUrl + 'teenages/vision',
method: 'POST',
......@@ -142,7 +182,9 @@ Page({
leftLeerEye: me.data.xieData.left,// 左眼斜视情况
rightLeerEye: me.data.xieData.right,// 右眼斜视情况
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) {
// 请求成功后关闭Loading
......@@ -164,6 +206,37 @@ Page({
showCancel: false,
content: res.data.msg
})
if(me.data.ruoData.left==''){
me.setData({
ruoData:{left: '无',right: me.data.ruoData.right}
})
}
if(me.data.ruoData.right==''){
me.setData({
ruoData:{left: me.data.ruoData.left,right: '无'}
})
}
if(me.data.xieData.left==''){
me.setData({
xieData:{left: '无',right: me.data.xieData.right}
})
}
if(me.data.xieData.right==''){
me.setData({
xieData:{left: me.data.xieData.left,right: '无'}
})
}
if(me.data.sanData.left==''){
me.setData({
sanData:{left: '无',right: me.data.sanData.right}
})
}
if(me.data.sanData.right==''){
me.setData({
sanData:{left: me.data.sanData.left,right: '无'}
})
}
}
}
})
......@@ -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="bindTabWrap">
<view id="bindTab">
<text>绑定设备</text>
<!-- 步骤进度 -->
<view id="tabWrap">
<view id="tab">
<text>完善信息</text>
<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 id="eyesightConWrap">
......@@ -25,24 +27,6 @@
</view>
</picker>
</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="eyesightConLeft">弱视、斜视、散光</view>
<view class="eyesightConRight">
......@@ -50,38 +34,78 @@
<text class="selItem">{{allRight}}</text>
</view>
</view>
</view>
<view id="eyesightLast" hidden="{{!show}}">
<view class="eyesightConItem">
<view class="eyesightConLeft">· 弱视程度</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="ruoChange" value="{{ruoIndex}}" range="{{ruoArray}}">
<view class="eyesightConRight">
<view class="selItem">{{ruoArray[0][ruoIndex[0]]}}</view>
<view class="selItem">{{ruoArray[1][ruoIndex[1]]}}</view>
</view>
</picker>
<view id="eyesightLast" hidden="{{!show}}">
<view class="eyesightConItem">
<view class="eyesightConLeft">· 弱视程度</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="ruoChange" value="{{ruoIndex}}" range="{{ruoArray}}">
<view class="eyesightConRight">
<view class="selItem">{{ruoArray[0][ruoIndex[0]]}}</view>
<view class="selItem">{{ruoArray[1][ruoIndex[1]]}}</view>
</view>
</picker>
</view>
<view class="eyesightConItem">
<view class="eyesightConLeft">· 斜视情况</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="xieChange" value="{{xieIndex}}" range="{{xieArray}}">
<view class="eyesightConRight">
<view class="selItem">{{xieArray[0][xieIndex[0]]}}</view>
<view class="selItem">{{xieArray[1][xieIndex[1]]}}</view>
</view>
</picker>
</view>
<view class="eyesightConItem">
<view class="eyesightConLeft">· 散光度数</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="sanChange" value="{{sanIndex}}" range="{{sanArray}}">
<view class="eyesightConRight">
<view class="selItem">{{sanArray[0][sanIndex[0]]}}</view>
<view class="selItem">{{sanArray[1][sanIndex[1]]}}</view>
</view>
</picker>
</view>
</view>
<view class="eyesightConItem">
<view class="eyesightConLeft">· 斜视情况</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="xieChange" value="{{xieIndex}}" range="{{xieArray}}">
<view class="eyesightConRight">
<view class="selItem">{{xieArray[0][xieIndex[0]]}}</view>
<view class="selItem">{{xieArray[1][xieIndex[1]]}}</view>
</view>
</picker>
<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 class="eyesightConItem">
<view class="eyesightConLeft">· 散光度数</view>
<picker mode="multiSelector" class="selectorPicker" bindchange="sanChange" value="{{sanIndex}}" range="{{sanArray}}">
<view class="eyesightConRight">
<view class="selItem">{{sanArray[0][sanIndex[0]]}}</view>
<view class="selItem">{{sanArray[1][sanIndex[1]]}}</view>
</view>
</picker>
<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 class="{{show?'eyesightBom':'eyesightPos'}}">
<!-- 提示 -->
<view id="childInfoTips">
<view><image src="../../assets/icon_tips_s.png"></image></view>
<view>请您如实填写本页信息,这将帮助我们为您或您的孩子提供更科学有效的眼部健康管理。</view>
</view>
<!-- <view class="{{show?'eyesightBom':'eyesightPos'}}"> -->
<view class="eyesightPos">
<view id="eyesightBox">
<button id="eyesightBack" bindtap='eyesightBack'>上一步</button>
<button id="eyesightNext" bindtap='eyesightNext'>下一步</button>
......
#eyesight{
background:#EFEFF4;
min-height: 100vh;
position: relative;
}
/* 导航 */
#bindTabWrap{
padding: 40rpx 30rpx;
#tabWrap{
padding: 40rpx 25rpx;
}
#bindTab{
#tab{
background: #fff;
display: flex;
align-items: center;
justify-content: center;
border-radius: 52rpx;
height: 104rpx;
padding: 0 55rpx;
padding: 0 30rpx;
}
#bindTab>text{
color: #CDCDCD;
#tab>text{
font-size: 34rpx;
color: #4F5051;
}
#bindTab>image{
#tab>image{
width: 34rpx;
height: 34rpx;
margin: 0 90rpx;
margin: 0 20rpx;
}
#bindTab>.bindTabSelected{
#tab>.tabSelected{
color: #33D1C4;
}
#eyesightCon,#eyesightLast{
#eyesightCon{
color: #4F5051;
font-size: 34rpx;
background: #fff;
padding-left: 25rpx;
}
#eyesightLast{
color: #4F5051;
font-size: 34rpx;
background: #fff;
}
#eyesightCon{
border-bottom: 2rpx solid #E5E5E5;
border-bottom: 1rpx solid #E5E5E5;
}
.eyesightConTitle{
font-size: 32rpx;
padding-bottom: 20rpx;
padding: 20rpx 0;
display: flex;
padding-left: 25rpx;
font-size: 28rpx;
......@@ -52,10 +57,10 @@
.eyesightConItem{
display: flex;
padding-bottom: 52rpx;
border-bottom: 2rpx solid #E5E5E5;
border-bottom: 1rpx solid #E5E5E5;
padding: 32rpx 0 30rpx;
}
.eyesightConItem:last-child{
.eyesightConItemLast{
border: 0;
}
.eyesightConLeft{
......@@ -82,6 +87,13 @@
padding-right:30rpx;
}
.classConRight{
justify-content: flex-end;
}
switch{
transform:scale(0.9);
}
/* 弹窗 */
#eyesightPopup{
position: absolute;
......@@ -121,13 +133,28 @@
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{
padding: 20rpx 0 80rpx;
}
.eyesightPos{
position: absolute;
bottom: 80rpx;
padding: 40rpx 0;
width: 100%;
}
#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';
// 饼状图
let chartPie = null;
function pieInitChart(canvas, width, height) {
chartPie = echarts.init(canvas, null, {
width: width,
height: height
});
canvas.setChart(chartPie);
let itemGap = 15;
function pieInitChart(chart, legendList, ydata) {
var option = {
tooltip: {
show: false
},
color:['#54585f','#7a8088','#979faa'],
color:['#ffa16d','#ffd560','#33edcf','#4dc8f9','#7485f5','#d643f6','#ff6d6d'],
legend: {
left: 'center',
top: 10,
top: 'center',
orient: 'vertical',
// top: 10,
textStyle:{
color: '#555',
fontSize: 10
color: '#4f5051',
fontSize: 11
},
icon: "circle",
itemWidth: 8,
itemHeight: 8,
itemGap: 30,
data: ['动态训练','静态训练','单次训练']
itemGap: itemGap,//图例间隔
data: legendList
},
series: [
{
// silent: true,//不响应和触发鼠标事件
hoverAnimation: false,//是否开启 hover 在拐点标志上的提示动画效果。
type: 'pie',
radius : '80%',
center: ['50%', '60%'],
data:[
{value:35, name:'动态训练'},
{value:45, name:'静态训练'},
{value:20, name:'单次训练'}
],
// radius : '80%',
radius: ['52%', '100%'],
// center: ['50%', '60%'],
// data:[
// {value:48, name:'静态训练'},
// {value:28, name:'动态训练'},
// {value:24, name:'单词训练'}
// ],
data: ydata,
label:{//饼图图形上的文本标签
normal:{
  show: true,
position: 'outside', //标签的位置
position: 'inner', //标签的位置
textStyle : {
fontWeight : 300 ,
fontSize : 12//文字的字体大小
fontSize : 14//文字的字体大小
    },
formatter: '{d}%'
}
......@@ -54,30 +52,106 @@ function pieInitChart(canvas, width, height) {
]
};
chartPie.setOption(option);
return chartPie;
chart.setOption(option);
}
var app = getApp();
Page({
data: {
avatar: "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJgjIlZNw29LLpbQJYlmjib7AuaqROweKxUib78ibPbp0M6mGKvRXNnpT1M4XkwDwFPAypwOFLXko0zQ/132",
teenageName: '小明',
pieChart: {
onInit: pieInitChart
// onInit: pieInitChart
lazyLoad: true
},
historyList: {
id: 0,
date:'5月27日 至 5月20日',
finish: 1,//训练是否完成
minute: 125,// 训练分钟
type: 1,// 视力升高或降低
degrees: '4.5 | 4.4',
dyn: '20%',
static: '60%',
word: '20%'
}
beginDay: '',
endDay: '',
weekNumber: '',
finishedStatus: '',
weekDuration: '',
rightEye: '',
leftEye: '',
weekLeftEye: '',
weekRightEye: '',
rightGlassesDegree: '',
leftGlassesDegree: '',
leftCorrectedEye: '',
rightCorrectedEye: '',
leftWeekEye: '',
rightWeekEye: '',
leftLeerEye: '',
rightLeerEye: '',
appList: [],
},
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": {
"ec-canvas": "../../component/ec-canvas/ec-canvas"
}
......
......@@ -2,13 +2,15 @@
<!-- 头像、用户名时间等 -->
<view id="top">
<view id="topLeft">
<image src="../../assets/head.png" />
<text>用户名</text>
<image src="{{ avatar }}" />
<view>{{teenageName}}</view>
</view>
<view id="topRight">
<view>5月12日~5月18日<text>(周为单位)</text></view>
<view>上周共训练<text>150</text>分钟,目标已完成!</view>
<view>并且右眼提升<text>0.1</text></view>
<view id="topRightTime">第{{weekNumber}}周 <text>{{beginDay}}~{{endDay}}</text></view>
<view id="topRightTitle">上周共训练</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>
<!-- 视力情况 -->
......@@ -18,65 +20,96 @@
<view class="eyesightItemRight"><text>左</text><text>右</text></view>
</view>
<view class="eyesightItem">
<view class="eyesightItemLeft">裸眼视力</view>
<view class="eyesightItemLeft">初测视力</view>
<view class="eyesightItemRight">
<text>4.5</text>
<text>3.5</text>
<text>{{leftEye}}</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 class="eyesightItem">
<view class="eyesightItemLeft">矫正视力</view>
<view class="eyesightItemRight">
<text>4.0↓-0.5</text>
<text>4.0↑+0.5</text>
<text>{{leftCorrectedEye}}</text>
<text>{{rightCorrectedEye}}</text>
</view>
</view>
<view class="eyesightItem">
<view class="eyesightItem" wx:if="{{leftGlassesDegree!=''&&rightGlassesDegree!=''}}">
<view class="eyesightItemLeft">眼镜度数</view>
<view class="eyesightItemRight">
<text>150</text>
<text>100</text>
<text wx:if="{{leftGlassesDegree!=''}}">{{leftGlassesDegree}}</text>
<text wx:if="{{leftGlassesDegree==''}}">-</text>
<text wx:if="{{rightGlassesDegree!=''}}">{{rightGlassesDegree}}</text>
<text wx:if="{{rightGlassesDegree==''}}">-</text>
</view>
</view>
<view class="eyesightItem">
<view class="eyesightItemLeft">斜视、弱视、散光</view>
<view class="eyesightItem" wx:if="{{leftWeekEye!='无'&&rightWeekEye!='无'}}">
<view class="eyesightItemLeft">弱视</view>
<view class="eyesightItemRight">
<text>有</text>
<text>无</text>
<text>{{leftWeekEye}}</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 class="pieChart">
<ec-canvas ec="{{ pieChart }}"></ec-canvas>
<ec-canvas id="reprotPieChart" ec="{{ pieChart }}"></ec-canvas>
</view>
<view id="shareBox">
<!-- <view id="shareBox">
<text id="share">分享</text>
</view>
</view> -->
<!-- 常用应用 -->
<view id="common">
<view id="commonTitle">常用应用</view>
<view id="commonList">
<view class="commonItem">
<image src="../../assets/appIcon.png" />
<text>应用名称111</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 class="commonItem" wx:for="{{appList}}" wx:key>
<image src="{{item.icon}}" />
<text>{{item.title}}</text>
</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{
background: #EFEFF4;
background: #ffffff;
min-height: 100vh;
}
#top{
padding: 30rpx 25rpx;
padding-top: 40rpx;
display: flex;
border-bottom: 2rpx solid #A7A7A8;
}
#topLeft{
display: flex;
flex-direction: column;
align-items: center;
margin-right: 50rpx;
padding: 20rpx 40rpx 0 60rpx;
}
#topLeft>image{
width: 100rpx;
height: 100rpx;
display: block;
height: 120rpx;
width: 120rpx;
border-radius: 50%;
}
#topLeft>text{
font-size: 30rpx;
#topLeft>view{
font-size: 28rpx;
color: #4F5051;
margin-top: 6rpx;
text-align: center;
width: 100%;
}
#topRight{
font-size: 28rpx;
color: #A7A7A8;
display: flex;
flex-direction:column;
justify-content:space-around;
flex-direction: column;
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{
padding: 30rpx;
/* #eyesight{
border-bottom: 2rpx solid #A7A7A8;
}
} */
#eyesightTitle{
display: flex;
font-size: 28rpx;
color: #4F5051;
background: #A7A7A8;
border-radius: 100rpx;
padding: 20rpx 30rpx;
color: #666;
padding: 30rpx 25rpx;
}
.eyesightItem{
display: flex;
font-size: 28rpx;
color: #A7A7A8;
padding: 20rpx 30rpx;
color: #999;
padding: 39rpx 25rpx;
border-top: 1rpx solid #E5ECE5;
}
.eyesightItemLeft{
width: 42%;
......@@ -63,7 +100,24 @@
.pieChart {
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 @@
/* 常用应用 */
#common{
padding: 0 50rpx;
}
#commonList{
display: flex;
padding: 40rpx;
}
#commonTitle{
padding: 10rpx 30rpx;
font-size: 32rpx;
color: #111111;
padding: 30rpx 0;
}
.commonItem{
display: flex;
align-items: center;
flex-direction: column;
font-size: 26rpx;
color: #A7A7A8;
/* padding: 0 20rpx; */
font-size: 24rpx;
color: #4F5051;
width: 20%;
}
.commonItem>image{
width: 60rpx;
height: 60rpx;
width: 106rpx;
height: 106rpx;
margin-bottom: 10rpx;
}
\ No newline at end of file
var app = getApp();
Page({
data: {
idea: '',
......@@ -18,15 +18,41 @@ Page({
})
return
}
wx.redirectTo({
url: '/pages/mine/mine'
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({
url: '/pages/mine/mine'
})
}else{
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
// 输入
inputchange(e) {
this.setData({
idea: e.detail.value,
contentLength: this.data.idea.length
contentLength: e.detail.value.length
})
},
})
\ No newline at end of file
/* 提交 */
#submitBtn{
padding: 75rpx 30rpx 80rpx;
padding: 75rpx 40rpx 80rpx;
}
#submit{
background: #33D1C4;
border-radius: 10rpx;
border-radius: 47rpx;
font-size: 36rpx;
color: #FFFFFF;
height: 94rpx;
......
.grayBlock{
background: #efeff4;
background: #e6ece5;
width: 100%;
height: 20rpx;
}
.swiperBox{
padding: 30rpx 25rpx;
padding: 20rpx 20rpx;
height: 180rpx;
background-color: #e6ece5;
}
.swiperCon{
border-radius:20rpx;
......@@ -14,11 +15,96 @@
width: 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{
display: flex;
position: relative;
padding-left: 50rpx;
padding: 10rpx 0 20rpx 50rpx;
border-bottom: 1rpx solid #dfdfdf;
}
#setBtn{
height: 36rpx;
......@@ -47,65 +133,45 @@
}
#userDetail{
font-size: 28rpx;
color: #A7A7A8;
color: #999;
display: flex;
align-items: center;
}
.userDetailLine{
#userDetail text{
margin-right: 10rpx;
}
#userGender{
display: block;
width: 2rpx;
height: 23rpx;
background: #A7A7A8;
margin: 0 20rpx;
width: 22rpx;
height: 22rpx;
margin-right: 10rpx;
}
/* 训练计划按钮 */
#userBtnBox{
padding: 0 25rpx;
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{
padding: 30rpx 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1rpx solid #dfdfdf;
}
.btnIcon{
#userBtnBox image{
display: block;
width: 64rpx;
height: 64rpx;
margin-right: 6rpx;
}
#userBtnBoxLine{
height: 42rpx;
width: 2rpx;
background: #fff;
margin: 0 60rpx;
width: 345rpx;
height: 90rpx;
}
/* 监控 */
.checkCon{
padding: 50rpx 25rpx 30rpx;
padding: 30rpx 20rpx;
}
.checkDes{
display: flex;
justify-content: space-between;
padding-bottom: 20rpx;
}
#trainTime{
color: #4f5051;
color: #999;
font-size: 28rpx;
}
#powerBox{
......@@ -114,34 +180,58 @@
}
#powerBox>image{
display: block;
width: 36rpx;
height: 36rpx;
margin-right: 6rpx;
width: 48rpx;
height: 48rpx;
margin-left: 10rpx;
}
.PowerOff{
color: #fa6400;
font-size: 32rpx;
/* text-decoration: underline; */
color: #10d9b8;
font-size: 28rpx;
}
.checkImg{
position: relative;
}
.checkImg>image{
margin-top: 20rpx;
/* .checkImg>image{
display: block;
width: 100%;
height: 392rpx;
height: 100rpx;
} */
#checkImgConBox{
position: relative;
}
.wifi{
#checkImgCon{
display: block;
height: 400rpx;
width: 100%;
color: #bababa;
font-size: 26rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
}
#btn_refresh{
width: 48rpx;
height: 48rpx;
position: absolute;
bottom: 30rpx;
right: 30rpx;
}
#checkImgNo{
position: relative;
}
#checkImgNo>image{
position: relative;
height: 100rpx;
width: 100%;
}
#checkImgNoRefreshBox{
position: absolute;
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 @@
.reportTitle{
display: flex;
justify-content: space-between;
padding: 25rpx 0;
padding: 25rpx 0 10rpx;
}
.reportTitleLeft,.trainSortTitleLeft,.resultSortTitleLeft{
font-size: 38rpx;
font-size: 32rpx;
display: flex;
align-items:center;
color: #4f5051;
color: #111;
}
.targetHistory,.trainSortTitleRight,.resultSortTitleRight{
display: flex;
......@@ -199,23 +289,18 @@
margin-right: 10rpx;
}
.targetHistory>image,.trainSortTitleRight>image,.resultSortTitleRight>image{
width: 36rpx;
height: 36rpx;
width: 48rpx;
height: 48rpx;
display: block;
}
/* 训练报告 */
.reportDes{
border-bottom: 2rpx solid #E5E5E5;
padding-bottom: 30rpx;
margin-top: 30rpx;
}
#taskComplete{
display: flex;
align-items: center;
color: #F7B500;
font-size: 32rpx;
margin-bottom: 10rpx;
margin-bottom: 20rpx;
}
#taskComplete>image{
width: 48rpx;
......@@ -225,7 +310,7 @@
#taskNocomplete{
display: flex;
align-items: center;
color: #fa6400;
color: #50e3c2;
margin-bottom: 10rpx;
font-size: 32rpx;
}
......@@ -235,28 +320,24 @@
margin-right: 10rpx;
}
#taskNocompleteDes{
color: #4f5051;
font-size: 28rpx;
margin-left: 60rpx;
color: #111;
font-size: 34rpx;
}
#taskCompleteDes{
color: #4f5051;
font-size: 28rpx;
margin-left: 60rpx;
color: #111;
font-size: 34rpx;
}
#taskCompleteDes>text{
font-size: 36rpx;
margin: 0 6rpx;
}
.reprotChart{
padding-top: 30rpx;
}
.reprotChartTitle{
color: #4f5051;
font-size: 28rpx;
text-align: center;
color: #111;
font-size: 34rpx;
margin-top: 10rpx;
margin-bottom: 20rpx;
}
.reprotChartTitle>text{
font-size: 36rpx;
......@@ -265,28 +346,27 @@
.reprotWeekChart {
width: 100%;
height: 380rpx;
height: 400rpx;
}
.reprotPieChart {
width: 100%;
height: 540rpx;
margin-top: 20rpx;
padding-bottom: 30rpx;
}
.reprotChartSuggest{
border-top: 2rpx solid #E5E5E5;
margin-top: 20rpx;
color: #888;
font-size: 28rpx;
padding-top: 30rpx;
font-size: 24rpx;
padding-top: 10rpx;
}
.reprotChartSuggestTitle{
font-size: 38rpx;
color: #4f5051;
margin-bottom: 30rpx;
font-size: 28rpx;
/* color: #111; */
margin-bottom: 10rpx;
}
.adviseItem{
display: flex;
margin-bottom: 30rpx;
margin-bottom: 20rpx;
}
.adviseItem>image{
width: 24rpx;
......@@ -297,16 +377,16 @@
/* 训练排行 效果排行 */
#trainSort,#resultSort{
color: #4f5051;
font-size: 34rpx;
color: #666;
font-size: 32rpx;
}
.trainSortTitle,.resultSortTitle{
display: flex;
justify-content: space-between;
padding: 25rpx;
padding: 30rpx 20rpx;
}
.trainSortListItemWrap,.resultSortListItemWrap{
padding-left: 25rpx;
padding: 0 20rpx;
}
.trainSortListItemLeft, .resultSortListItemLeft{
display: flex;
......@@ -319,20 +399,20 @@
display: flex;
justify-content: space-between;
align-items: center;
border-top: 2rpx solid #E5E5E5;
padding: 20rpx 25rpx 20rpx 0;
border-top: 1rpx solid #E5E5E5;
padding: 30rpx 20rpx;
}
.trainSortListItemInfo,.resultSortListItemInfo{
display: flex;
align-items: center;
}
.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;
}
} */
.trainSortListItemInfo>image, .resultSortListItemInfo>image{
width: 50rpx;
height: 50rpx;
......@@ -360,20 +440,20 @@
#indexBottom{
height: 115rpx;
width: 100%;
background: #efeff4;
background: #e6ece5;
}
/* 训练成就 */
#achieve{
color: #555;
padding: 0 25rpx;
padding: 0 20rpx;
}
.achieveTitle{
display: flex;
justify-content: space-between;
font-size: 38rpx;
font-size: 32rpx;
align-items:center;
color: #4f5051;
color: #111;
padding: 25rpx 0;
}
.achieveTitle>image{
......@@ -381,17 +461,26 @@
height: 36rpx;
display: block;
}
.achieveTime, .achieveChange{
font-size: 28rpx;
padding-top: 10rpx;
.achieveTime{
font-size: 34rpx;
color: #111;
margin-bottom: 10rpx;
}
.achieveTime>text, .achieveChange>text{
font-size: 36rpx;
margin: 0 10rpx;
}
#suggest{
font-size: 28rpx;
color: #999;
}
.suggestItem{
margin-bottom: 15rpx;
}
.achieveChange{
padding-bottom: 35rpx;
border-bottom: 2rpx solid #e5e5e5;
font-size: 34rpx;
color: #111;
padding-bottom: 20rpx;
}
.leftEyeChart{
position: relative;
......@@ -409,7 +498,7 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 0 0rpx;
padding: 20rpx 0 0rpx;
}
.legend_box{
display: flex;
......@@ -438,8 +527,8 @@
}
.eyeChartName{
text-align: center;
font-size: 34rpx;
color: #4f5051;
font-size: 28rpx;
color: #666;
}
.rightEyeChart{
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": {}
}
\ No newline at end of file
<view id="ruleSet">
<!-- 会员卡 -->
<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="trainTip">
<view id="trainTipTitle">
<view id="trainTipLeft">
<image src="../../assets/icon_mine_notice.png" />
<text>训练提醒</text>
<view id="trainTipRight">
<switch color="#33D1C4" checked="{{trainTip}}" bindchange="trainTip"/>
</view>
</view>
<view id="trainTipRight">
<switch color="#33D1C4" checked="{{trainTip}}" bindchange="trainTip"/>
</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="trainTipBom" hidden="{{!isShow}}">
<view id="trainTipBomItem">
<view class="trainLeft">
<image src="../../assets/icon_mine_message.png" />
<text>短信提醒</text>
</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 id="trainTipBomRight">
<switch color="#33D1C4" checked="{{messageTip}}" bindchange="messageTip"/>
</view>
</view>
<view id="logoutWrap">
<view id="logoutBox">
<button id="logoutBtn" bindtap='logout'>退出登录</button>
<view id="trainTipBomItem">
<view class="trainLeft">
<image src="../../assets/icon_mine_wechat.png" />
<text>微信提醒</text>
</view>
<view id="trainTipBomRight">
<switch color="#33D1C4" checked="{{serveTip}}" bindchange="serveTip"/>
</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({
data: {
teenageName: '小明',
gender: '男',
age: 9,
className: '',
avatar: "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJgjIlZNw29LLpbQJYlmjib7AuaqROweKxUib78ibPbp0M6mGKvRXNnpT1M4XkwDwFPAypwOFLXko0zQ/132",
sn: 'sn123541341'
teenageName: '',
avatar: "",
sn: ''
},
onReady() {
this.setData({
className: '无'
onLoad() {
let me = this
// 请求前加Loading
wx.showLoading({
title: '加载中',
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'users/personalCenter',
method: 'POST',
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
})
}
}
})
// setTimeout(function () {
// // 获取 chartWeek 实例的方式
// console.log(chartWeek)
// }, 2000);
},
// 解绑
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() {
wx.redirectTo({
wx.navigateTo({
url: '/pages/idea/idea'
})
}
},
})
\ No newline at end of file
......@@ -4,26 +4,36 @@
</view>
<view id="userInfo">
<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 class="useSettingBox">
<view class="use">
<image src="../../assets/account_pn.png"></image>
<text>设备ID:{{sn}}</text>
<image src="../../assets/icon_mine_device.png"></image>
<view class="snCode">设备ID<text>{{sn}}</text></view>
</view>
<text bindtap="unbundle">解绑</text>
<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>
<image class="arrowDown" src="../../assets/icon_more.png" />
</view>
<view class="useSettingBox" bindtap="idea">
<view class="use">
<image src="../../assets/account_pn.png"></image>
<image src="../../assets/icon_mine_feedback.png"></image>
<text>意见反馈</text>
</view>
<image class="arrowDown" src="../../assets/arrow_right.png" />
<image class="arrowDown" src="../../assets/icon_more.png" />
</view>
\ No newline at end of file
page{
background-color: #efeff5;
}
/* 头像设置 */
#userBox{
display: flex;
position: relative;
padding: 50rpx 0 30rpx 25rpx;
padding: 20rpx 30rpx;
background-color: #fff;
}
#userHead{
display: block;
height: 120rpx;
width: 120rpx;
margin-right: 30rpx;
margin-right: 20rpx;
border-radius: 50%;
/* overflow: hidden; */
}
......@@ -19,22 +22,8 @@
justify-content: center;
}
#username{
color: #4f5051;
font-size: 38rpx;
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;
color: #666;
font-size: 34rpx;
}
......@@ -42,21 +31,43 @@
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
color: #A7A7A8;
padding: 25rpx;
font-size: 34rpx;
color: #4F5051;
padding: 20rpx 30rpx;
background-color: #fff;
margin-top: 20rpx;
}
.use{
display: flex;
align-items: center;
}
.use>image{
width: 50rpx;
height: 36rpx;
margin-right: 10rpx;
width: 70rpx;
height: 70rpx;
margin-right: 15rpx;
}
.arrowDown{
width: 36rpx;
height: 36rpx;
margin-left: 10rpx;
width: 48rpx;
height: 48rpx;
}
.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();
Page({
data: {
teenageName: '',
avatar: '',
beginTime: '',
endTime: '',
trainingTimes: '',
trainingList: [],
totalDuration: [],
},
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 () {
......
<view id="plan">
<!-- 顶部数据 -->
<view id="planWrap">
<view id="planCon">
<view id="planConTitle">训练计划</view>
<view class="planConDes">本周(x月x日~x月x日)</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 id="planInfoBox">
<view id="planInfo">
<view id="planInfoHead">
<image id="userHead" src="{{ avatar }}" />
<view id="username">{{ teenageName }}</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="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 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>
<!-- 按钮组 -->
......@@ -45,3 +65,12 @@
<button id="updatePlan" bindtap='update'>更新计划</button>
</view>
</view>
<wxs module="we">
var toFixed = function (value) {
return Math.floor(value);
}
module.exports = {
toFixed :toFixed
}
</wxs>
#plan{
background: #EFEFF4;
background-color: #e6ece5;
min-height: 100vh;
}
/* 顶部 */
#planWrap{
padding: 30rpx;
#planInfoBox{
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{
background: #ccc;
padding: 25rpx;
#username{
font-size: 28rpx;
color: #4F5051;
border-radius: 10rpx;
margin-top: 10rpx;
text-align: center;
}
#planInfoTime{
padding-left: 40rpx;
}
#planConTitle{
.planConDes{
font-size: 32rpx;
text-align: center;
color: #10D9B8;
padding-top: 20rpx;
}
.planConDes>text{
font-size: 40rpx;
font-size: 28rpx;
margin-left: 20rpx;
}
.planInfoTimeDes{
font-size: 28rpx;
color: #666;
}
#planConTip{
padding-top: 30rpx;
.planInfoTimeDes text{
font-weight: 300;
color: #111;
font-size: 48rpx;
padding: 0 20rpx;
}
#planInfoTip{
font-size: 24rpx;
color: #666;
padding: 0 20rpx 30rpx;
}
/* 列表 */
#history{
color: #4F5051;
#planList{
background-color: #fff;
}
#historyTitle{
text-align: center;
font-size: 26rpx;
.planListItem{
padding: 0 25rpx;
border-bottom: 1rpx solid #E5ECE5;
}
.historyListItem{
.planListItemTitle{
border-bottom: 1rpx solid #E5ECE5;
font-size: 32rpx;
color: #111111;
display: flex;
justify-content: space-around;
font-size: 24rpx;
padding-top: 15rpx;
}
/* 折线图 */
#eyeChart{
width: 100%;
height: 380rpx;
justify-content: space-between;
align-items: center;
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{
padding: 75rpx 30rpx 80rpx;
padding: 40rpx 50rpx 80rpx;
}
#updatePlan{
background: #33D1C4;
border-radius: 10rpx;
border-radius: 47rpx;
font-size: 36rpx;
color: #FFFFFF;
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();
Page({
data: {
useArray: ['允许使用','完成当日训练后允许使用','不可使用'],
useArray: ['允许使用全部应用','完成训练计划,允许使用应用','不可使用应用'],
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,//强制护眼
// shieldValue: [0],
// shield: '',
starting: 0, //开机提醒状态,1、允许、0、不允许
installApp: 0, //安装应用状态,1、允许安装、0、不允许安装
......@@ -23,9 +21,9 @@ Page({
weakArray: ['关闭','双眼弱视','右眼弱视','左眼弱视'],
weakIndex: 0,//弱视训练
// shieldAllArray: [{name:'关闭护眼功能'},{name:'使用应用20分钟,强制护眼训练5分钟'},{name:'使用应用30分钟,强制护眼训练5分钟'},{name:'使用应用40分钟,强制护眼训练5分钟'}],//picker 数据
// pickerClo: "1",// picker 几列
constraintTipShow: false,
useLimitShow: false,
installAppTipShow: false,
},
onLoad: function () {
// this.demopicker = this.selectComponent("#shieldpicker");
......@@ -36,7 +34,7 @@ Page({
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'apps/info',
url: app.globalData.apiUrl + 'Settings/index',
method: 'POST',
data: {
token: wx.getStorageSync('token')
......@@ -45,11 +43,28 @@ Page({
// 请求成功后关闭Loading
wx.hideLoading();
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({
useIndex: res.data.data.appManagement-1,
shieldIndex: res.data.data.eyeProtection-1,
installApp: res.data.data.installApp,
// starting: res.data.data.starting
useIndex: res.data.data.appLockedStatus-1,
installApp: res.data.data.moreAppStatus,
parallaxIndex: res.data.data.parallaxStatus-1,
weakIndex: res.data.data.redLightStatus-1,
})
}else{
wx.showModal({
......@@ -108,17 +123,17 @@ Page({
title: '加载中',
mask: true
})
// wx.request({
// url: app.globalData.apiUrl + 'apps/appManagement',
// method: 'POST',
// data: {
// token: wx.getStorageSync('token'),
// status: parallaxStatus
// },
// success: function (res) {
wx.request({
url: app.globalData.apiUrl + 'devices/setIntensiveTraining',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
status: parallaxStatus
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
// if(res.data.errno==200){
if(res.data.errno==200){
me.setData({
parallaxIndex: parallaxStatus-1
})
......@@ -126,21 +141,21 @@ Page({
wx.showModal({
title: '重要提示',
showCancel: false,
content: '训练仅适用于双眼视差大于0.2的情况'
content: '视差训练仅适用于双眼视差大于0.2的情况'
})
}
// }else{
// me.setData({
// parallaxIndex: me.data.parallaxIndex
// })
// wx.showModal({
// title: '提示',
// showCancel: false,
// content: res.data.msg
// })
// }
// }
// })
}else{
me.setData({
parallaxIndex: me.data.parallaxIndex
})
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
weakChange: function (e) {// 弱视训练
let me = this,
......@@ -152,17 +167,17 @@ Page({
title: '加载中',
mask: true
})
// wx.request({
// url: app.globalData.apiUrl + 'apps/appManagement',
// method: 'POST',
// data: {
// token: wx.getStorageSync('token'),
// status: weakStatus
// },
// success: function (res) {
wx.request({
url: app.globalData.apiUrl + 'devices/setRedLightTraining',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
status: weakStatus
},
success: function (res) {
// 请求成功后关闭Loading
wx.hideLoading();
// if(res.data.errno==200){
if(res.data.errno==200){
me.setData({
weakIndex: weakStatus-1
})
......@@ -170,21 +185,21 @@ Page({
wx.showModal({
title: '重要提示',
showCancel: false,
content: '如无弱视情况,请勿开启此训练!'
content: '如无弱视情况,请勿开启此训练!\r\n(原理:使用红灯闪烁的方式,激活黄斑区视觉细胞感光能力)'
})
}
// }else{
// me.setData({
// weakIndex: me.data.weakIndex
// })
// wx.showModal({
// title: '提示',
// showCancel: false,
// content: res.data.msg
// })
// }
// }
// })
}else{
me.setData({
weakIndex: me.data.weakIndex
})
wx.showModal({
title: '提示',
showCancel: false,
content: res.data.msg
})
}
}
})
},
shieldChange: function (e) {// 强制护眼
let me = this,
......@@ -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) {// 安装应用
console.log('安装应用', e.detail.value)
let me = this,
......@@ -349,26 +282,35 @@ Page({
},
// 使用限制疑问
useLimit: function () {
wx.showModal({
title: '提示',
showCancel: false,
content: '您可以根据情况设置是否完成训练计划才可以使用其他应用或功能'
this.setData({
useLimitShow: true
})
},
closeUseLimit: function () {
this.setData({
useLimitShow: false
})
},
// 强制护眼疑问
constraint: function () {
wx.showModal({
title: '提示',
showCancel: false,
content: '您可以根据选项设置使用时长的强制护眼训练'
this.setData({
constraintTipShow: true
})
},
closeConstraintTip: function () {
this.setData({
constraintTipShow: false
})
},
// 安装应用疑问
installAppTip: function () {
wx.showModal({
title: '提示',
showCancel: false,
content: '打开该设置可以允许自主下载更多应用'
this.setData({
installAppTipShow: true
})
},
closeInstallAppTip: function () {
this.setData({
installAppTipShow: false
})
},
toWhiteList: function(e) {
......@@ -407,6 +349,5 @@ Page({
// })
// // this.demopicker.hiddePicker();
// },
})
......@@ -3,72 +3,43 @@
<view class="useSetting">
<view class="useSettingTip" bindtap='useLimit'>
<text class="useSettingTitle">使用限制</text>
<image src="../../assets/tips.png" />
<view class="useSettingTipIcon">
<image src="../../assets/tips.png" />
<view class='invite' hidden="{{!useLimitShow}}">
您可以设置是否完成训练计划后,才允许使用「娱乐」「游戏」「视频」等应用
</view>
</view>
</view>
<picker bindchange="useChange" value="{{useIndex}}" range="{{useArray}}">
<view class="useSettingBox">
<view class="use">{{useArray[useIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" />
<image class="arrowDown" src="../../assets/icon_more.png" />
</view>
</picker>
</view>
<view class="useSetting">
<view class="useSettingTip" bindtap='constraint'>
<text class="useSettingTitle">强制护眼</text>
<image src="../../assets/tips.png" />
<view class="useSettingTipIcon">
<image src="../../assets/tips.png" />
<view class='invite' hidden="{{!constraintTipShow}}">
未训练的使用时长达到设定时间后,系统将自动进行护眼训练
</view>
</view>
</view>
<picker bindchange="shieldChange" value="{{shieldIndex}}" range="{{shieldAllArray}}">
<picker bindchange="shieldChange" value="{{shieldIndex}}" range="{{shieldArray}}">
<view class="useSettingBox">
<view class="use">{{shieldArray[shieldIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" />
<image class="arrowDown" src="../../assets/icon_more.png" />
</view>
</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 class="useSetting parallaxBox">
<text class="useSettingTitle">视差训练</text>
<picker bindchange="parallaxChange" value="{{parallaxIndex}}" range="{{parallaxArray}}">
<view class="useSettingBox">
<view class="use">{{parallaxArray[parallaxIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" />
<image class="arrowDown" src="../../assets/icon_more.png" />
</view>
</picker>
</view>
......@@ -77,14 +48,19 @@
<picker bindchange="weakChange" value="{{weakIndex}}" range="{{weakArray}}">
<view class="useSettingBox">
<view class="use">{{weakArray[weakIndex]}}</view>
<image class="arrowDown" src="../../assets/arrow_right.png" />
<image class="arrowDown" src="../../assets/icon_more.png" />
</view>
</picker>
</view>
<view class="useSetting useSettingInstall">
<view class="useSettingTip" bindtap='installAppTip'>
<text class="useSettingTitle">允许自由安装更多应用</text>
<image src="../../assets/tips.png" />
<view class="useSettingTipIcon">
<image src="../../assets/tips.png" />
<view class='inviteSmall' hidden="{{!installAppTipShow}}">
打开该设置可以允许自主下载更多应用
</view>
</view>
</view>
<switch color="#33D1C4" checked="{{installApp==1}}" bindchange="installApp"/>
</view>
......@@ -113,5 +89,7 @@
<view id="settingBtn">
<button id="settingDone" bindtap='settingDone'>保存</button>
</view>
<!-- <navigator hover-class="none" target="miniProgram" open-type="exit"> 退出当前小程序</navigator> -->
</view>
<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>
\ No newline at end of file
......@@ -10,7 +10,11 @@
background: #fff;
margin-bottom: 21rpx;
}
.useSettingTip>image{
.useSettingTipIcon{
display: inline;
position: relative;
}
.useSettingTipIcon>image{
width: 29rpx;
height: 29rpx;
margin-left: 7rpx;
......@@ -33,8 +37,8 @@
color: #A7A7A8;
}
.arrowDown{
width: 36rpx;
height: 36rpx;
width: 48rpx;
height: 48rpx;
margin-left: 10rpx;
}
switch{
......@@ -77,8 +81,8 @@ switch{
border-bottom: 4rpx solid #33D1C4;
}
.whiteListTabItem>image{
width: 60rpx;
height: 60rpx;
width: 64rpx;
height: 54rpx;
margin-bottom: 6rpx;
}
.centerTabItem{
......@@ -100,42 +104,66 @@ switch{
line-height: 94rpx;
}
/* 训练提醒 */
#trainTip{
padding: 30rpx 25rpx;
background: #fff;
}
#trainTipTitle{
display: flex;
justify-content: space-between;
align-items: center;
font-size: 34rpx;
color: #4F5051;
}
switch{
transform:scale(0.9);
.dialogBg{
position: absolute;
z-index: 1;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
#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;
.invite {
/* display: none; */
width: 450rpx;
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;
}
.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();
Page({
data: {
equipmentId: ''
sortList: [],
noThreeSortList: [],
},
onLoad: function (options) {
console.log(options.equipmentId)
this.setData({
equipmentId: options.equipmentId
})
},
noBind: function() {
// 暂不绑定,关闭所有页面,返回扫码页面
wx.reLaunch({
url: '/pages/getCodeIndex/getCodeIndex'
})
},
bindEquipment: function() {
onLoad: function () {
let me = this;
// 请求前加Loading
wx.showLoading({
......@@ -23,26 +12,19 @@ Page({
mask: true
})
wx.request({
url: app.globalData.apiUrl + 'devices/bind',
url: app.globalData.apiUrl + 'ranks/effectedRanking',
method: 'POST',
data: {
token: wx.getStorageSync('token'),
seexSn: me.data.equipmentId
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.navigateTo({
url: '/pages/childInfo/childInfo'
let newArr = res.data.data.filter(item => item.ranking > 3)
me.setData({
sortList: res.data.data,
noThreeSortList: newArr,
})
}else{
wx.showModal({
......@@ -53,5 +35,5 @@ Page({
}
}
})
}
},
})
\ No newline at end of file
{
"navigationBarTitleText": "扫码绑定",
"navigationBarTitleText": "光明之星",
"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