Commit 6b16554e by 陈玉桐

修复已知bug

parent 7a994ee8
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/setting/setting", "pages/historyDetail/historyDetail",
"pages/user/user", "pages/trainReport/trainReport",
"pages/starSort/starSort",
"pages/updatePlan/updatePlan", "pages/updatePlan/updatePlan",
"pages/plan/plan", "pages/trainSort/trainSort",
"pages/eyesight/eyesight", "pages/eyesight/eyesight",
"pages/childInfo/childInfo", "pages/childInfo/childInfo",
"pages/trainReport/trainReport", "pages/setting/setting",
"pages/historyDetail/historyDetail", "pages/user/user",
"pages/plan/plan",
"pages/message/message", "pages/message/message",
"pages/trainSort/trainSort",
"pages/mine/mine", "pages/mine/mine",
"pages/idea/idea", "pages/idea/idea",
"pages/starSort/starSort",
"pages/whiteList/whiteList", "pages/whiteList/whiteList",
"pages/targetList/targetList" "pages/targetList/targetList"
], ],
......
...@@ -7,6 +7,9 @@ function pieInitChart(chart, legendList, ydata) { ...@@ -7,6 +7,9 @@ function pieInitChart(chart, legendList, ydata) {
tooltip: { tooltip: {
show: false show: false
}, },
grid: {
top: 20,
},
color:['#ffa16d','#ffd560','#33edcf','#4dc8f9','#7485f5','#d643f6','#ff6d6d'], color:['#ffa16d','#ffd560','#33edcf','#4dc8f9','#7485f5','#d643f6','#ff6d6d'],
legend: { legend: {
left: 'center', left: 'center',
...@@ -29,7 +32,7 @@ function pieInitChart(chart, legendList, ydata) { ...@@ -29,7 +32,7 @@ function pieInitChart(chart, legendList, ydata) {
hoverAnimation: false,//是否开启 hover 在拐点标志上的提示动画效果。 hoverAnimation: false,//是否开启 hover 在拐点标志上的提示动画效果。
type: 'pie', type: 'pie',
// radius : '80%', // radius : '80%',
radius: ['52%', '100%'], radius: ['52%', '70%'],
// center: ['50%', '60%'], // center: ['50%', '60%'],
// data:[ // data:[
// {value:48, name:'静态训练'}, // {value:48, name:'静态训练'},
...@@ -40,12 +43,27 @@ function pieInitChart(chart, legendList, ydata) { ...@@ -40,12 +43,27 @@ function pieInitChart(chart, legendList, ydata) {
label:{//饼图图形上的文本标签 label:{//饼图图形上的文本标签
normal:{ normal:{
  show: true,   show: true,
position: 'inner', //标签的位置 // position: 'inner', //标签的位置
textStyle : { textStyle : {
fontWeight : 300 , fontWeight : 300 ,
fontSize : 14//文字的字体大小 fontSize : 14//文字的字体大小
    },     },
formatter: '{d}%' // formatter: '{d}%',
formatter(v) {//此方法为核心代码,解决问题
let text = v.percent+'%'
if(text.length <= 8)
{
return text;
}else if(text.length > 8 && text.length <= 16){
return text = `${text.slice(0,8)}\n${text.slice(8)}`
}else if(text.length > 16 && text.length <= 24){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}`
}else if(text.length > 24 && text.length <= 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24)}`
}else if(text.length > 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24,30)}\n${text.slice(30)}`
}
},
} }
    }     }
} }
...@@ -58,8 +76,8 @@ function pieInitChart(chart, legendList, ydata) { ...@@ -58,8 +76,8 @@ function pieInitChart(chart, legendList, ydata) {
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
avatar: "https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJgjIlZNw29LLpbQJYlmjib7AuaqROweKxUib78ibPbp0M6mGKvRXNnpT1M4XkwDwFPAypwOFLXko0zQ/132", avatar: "",
teenageName: '小明', teenageName: '',
pieChart: { pieChart: {
// onInit: pieInitChart // onInit: pieInitChart
lazyLoad: true lazyLoad: true
...@@ -127,7 +145,7 @@ Page({ ...@@ -127,7 +145,7 @@ Page({
let pieList = [] let pieList = []
res.data.data.typeTrainingList.map((item)=>{ res.data.data.typeTrainingList.map((item)=>{
legendList.push(item.title) legendList.push(item.title)
pieList.push({value: item.trainingDuration,name: item.title}) pieList.push({value: item.trainingPercent,name: item.title})
}) })
if(legendList.length>5){ if(legendList.length>5){
itemGap = 5 itemGap = 5
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="eyesightItem"> <view class="eyesightItem" wx:if="{{leftCorrectedEye!='0.0'&&rightCorrectedEye!='0.0'}}">
<view class="eyesightItemLeft">矫正视力</view> <view class="eyesightItemLeft">矫正视力</view>
<view class="eyesightItemRight"> <view class="eyesightItemRight">
<text>{{leftCorrectedEye}}</text> <text>{{leftCorrectedEye}}</text>
...@@ -98,9 +98,15 @@ ...@@ -98,9 +98,15 @@
<view id="commonTitle">常用应用</view> <view id="commonTitle">常用应用</view>
<view id="commonList"> <view id="commonList">
<view class="commonItem" wx:for="{{appList}}" wx:key> <view class="commonItem" wx:for="{{appList}}" wx:key>
<image src="{{item.icon}}" /> <image wx:if="{{item.icon}}" src="{{item.icon}}" />
<view wx:else class="commonItemNo"></view>
<text>{{item.title}}</text> <text>{{item.title}}</text>
</view> </view>
<view wx:if="{{appList.length<5}}" class="commonItemNo">空</view>
<view wx:if="{{appList.length<4}}" class="commonItemNo">空</view>
<view wx:if="{{appList.length<3}}" class="commonItemNo">空</view>
<view wx:if="{{appList.length<2}}" class="commonItemNo">空</view>
<view wx:if="{{appList.length<1}}" class="commonItemNo">空</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
display: flex; display: flex;
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
padding: 39rpx 25rpx; padding: 20rpx 25rpx;
border-top: 1rpx solid #E5ECE5; border-top: 1rpx solid #E5ECE5;
} }
.eyesightItemLeft{ .eyesightItemLeft{
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
} }
#commonList{ #commonList{
display: flex; display: flex;
justify-content: space-between;
} }
#commonTitle{ #commonTitle{
font-size: 32rpx; font-size: 32rpx;
...@@ -149,10 +150,30 @@ ...@@ -149,10 +150,30 @@
flex-direction: column; flex-direction: column;
font-size: 24rpx; font-size: 24rpx;
color: #4F5051; color: #4F5051;
width: 20%; width: 19%;
} }
.commonItem>image{ .commonItem>image{
width: 106rpx; width: 106rpx;
height: 106rpx; height: 106rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
border-radius: 24rpx;
}
.commonItem>text{
width: 100%;
white-space: nowrap;/*设置不换行*/
overflow: hidden; /*设置隐藏*/
text-overflow: ellipsis; /*设置隐藏部分为省略号*/
}
.commonItemNo{
font-size: 24rpx;
color: #cecece;
text-align: center;
width: 106rpx;
height: 106rpx;
line-height: 106rpx;
border-radius: 24rpx;
border: 1rpx solid rgba(206,206,206,0.50);
background-color: rgba(206,206,206,0.10);
margin-bottom: 10rpx;
} }
\ No newline at end of file
...@@ -12,7 +12,7 @@ function weekInitChart(chart, xdata, ydata) { ...@@ -12,7 +12,7 @@ function weekInitChart(chart, xdata, ydata) {
left: 5, left: 5,
right: 5, right: 5,
bottom: 10, bottom: 10,
top: 10, top: 20,
// height: 150, // height: 150,
// show: true, // show: true,
containLabel: true, containLabel: true,
...@@ -23,6 +23,7 @@ function weekInitChart(chart, xdata, ydata) { ...@@ -23,6 +23,7 @@ function weekInitChart(chart, xdata, ydata) {
type: 'category', type: 'category',
// data: ['周日\n5.11', '周一\n5.12', '周二\n5.13', '周三\n5.14', '周四\n5.15', '周五\n5.16', '周六\n5.17'], // data: ['周日\n5.11', '周一\n5.12', '周二\n5.13', '周三\n5.14', '周四\n5.15', '周五\n5.16', '周六\n5.17'],
data: xdata, data: xdata,
scale: true,
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#10d9b8', color: '#10d9b8',
...@@ -146,7 +147,15 @@ function pieInitChart(chart, legendList, ydata) { ...@@ -146,7 +147,15 @@ function pieInitChart(chart, legendList, ydata) {
fontWeight : 300 , fontWeight : 300 ,
fontSize : 14//文字的字体大小 fontSize : 14//文字的字体大小
    },     },
formatter: '{d}%' // formatter: '{d}%',
formatter(v) {//此方法为核心代码,解决问题
let text = v.percent
if(v.percent < 6){
return '';
}else{
return text+'%';
}
},
} }
    }     }
} }
...@@ -413,6 +422,8 @@ Page({ ...@@ -413,6 +422,8 @@ Page({
guideStatus: 1,//是否进行过新手引导 1:已经引导过 0:未引导过 guideStatus: 1,//是否进行过新手引导 1:已经引导过 0:未引导过
guideId: 1,//引导顺序 guideId: 1,//引导顺序
isLoading: false,
}, },
onReady() { onReady() {
}, },
...@@ -656,7 +667,7 @@ Page({ ...@@ -656,7 +667,7 @@ Page({
let pieList = [] let pieList = []
res.data.data.reports.typeTrainingList.map((item)=>{ res.data.data.reports.typeTrainingList.map((item)=>{
legendList.push(item.title) legendList.push(item.title)
pieList.push({value: item.trainingDuration,name: item.title}) pieList.push({value: item.trainingPercent,name: item.title})
}) })
if(legendList.length>5){ if(legendList.length>5){
...@@ -808,13 +819,25 @@ Page({ ...@@ -808,13 +819,25 @@ Page({
//获取当前时间戳 //获取当前时间戳
var timestamp = Date.parse(new Date()); var timestamp = Date.parse(new Date());
timestamp = timestamp / 1000; timestamp = timestamp / 1000;
console.log("当前时间戳为:" + timestamp); // console.log("当前时间戳为:" + timestamp);
// 加载中 // console.log(me.data.trainingStatus)
me.setData({ if(me.data.trainingStatus=='5'){
watchImgText: '加载中', return
trainingStatus: 2,//训练状态 1正在训练 0:未训练 2加载中 3未在线 }
checkImg: '../../assets/indexDefault.png' if(me.data.trainingStatus=='0' || me.data.trainingStatus=='1'){
}) // 加载中
me.setData({
watchImgText: '加载中',
trainingStatus: 5,//训练状态 1正在训练 0:未训练 2加载中 3未在线 5在线时刷新
})
}else{
// 加载中
me.setData({
watchImgText: '加载中',
trainingStatus: 2,//训练状态 1正在训练 0:未训练 2加载中 3未在线
checkImg: '../../assets/indexDefault.png'
})
}
// 请求前加Loading // 请求前加Loading
wx.showLoading({ wx.showLoading({
title: '加载中', title: '加载中',
...@@ -1052,7 +1075,17 @@ Page({ ...@@ -1052,7 +1075,17 @@ Page({
url: '/pages/out/out?url='+e.currentTarget.dataset.url url: '/pages/out/out?url='+e.currentTarget.dataset.url
}) })
}, },
// onPullDownRefresh: function() { onReachBottom() {
// wx.stopPullDownRefresh(); // 上拉触底
// }, let me = this
console.log('上拉触底')
me.setData({
isLoading: true
})
setTimeout(function(){
me.setData({
isLoading: false
})
},1000)
}
}) })
\ No newline at end of file
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<!-- 监控 --> <!-- 监控 -->
<view class="checkCon"> <view class="checkCon">
<view class="checkDes"> <view class="checkDes">
<text id="trainTime" wx:if="{{trainingStatus==2}}">{{watchImgText}}</text> <text id="trainTime" wx:if="{{trainingStatus==2 || trainingStatus==5}}">{{watchImgText}}</text>
<text id="trainTime" wx:elif="{{trainingStatus==3}}">设备未在线</text> <text id="trainTime" wx:elif="{{trainingStatus==3}}">设备未在线</text>
<text id="trainTime" wx:elif="{{trainingStatus==4}}">监控画面加载失败,请您手动刷新</text> <text id="trainTime" wx:elif="{{trainingStatus==4}}">监控画面加载失败,请您手动刷新</text>
<text id="trainTime" wx:else>设备使用中,今日已训练{{trainingTime}}分钟</text> <text id="trainTime" wx:else>设备使用中,今日已训练{{trainingTime}}分钟</text>
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</view> </view>
</view> </view>
<view id="indexBottom"></view> <view id="indexBottom"></view>
<view id="indexBottomText">底下没有了~</view> <view id="indexBottomText" hidden="{{!isLoading}}">底下没有了~</view>
<!-- 更新训练计划弹窗 --> <!-- 更新训练计划弹窗 -->
<view id="mustUpdate" catchtouchmove="preventTouchMove" hidden="{{mustUpdate}}"> <view id="mustUpdate" catchtouchmove="preventTouchMove" hidden="{{mustUpdate}}">
......
...@@ -3,18 +3,33 @@ ...@@ -3,18 +3,33 @@
<view id="sortTop2" class="sortTopItem" wx:if="{{sortList[1]}}"> <view id="sortTop2" class="sortTopItem" wx:if="{{sortList[1]}}">
<image src="{{sortList[1].avatar}}"></image> <image src="{{sortList[1].avatar}}"></image>
<view class="sortPlanName">{{sortList[1].name}}</view> <view class="sortPlanName">{{sortList[1].name}}</view>
<view class="sortTopNum">
<image src="../../assets/up.png"></image>
<text>{{sortList[1].degree}}</text>
<text class="sortListItemEye">{{sortList[1].promoteMode}}</text>
</view>
</view> </view>
<view id="sortTop2" class="sortTopItem" wx:if="{{!sortList[1]}}"> <view id="sortTop2" class="sortTopItem" wx:if="{{!sortList[1]}}">
</view> </view>
<view id="sortTop1" class="sortTopItem" wx:if="{{sortList[0]}}"> <view id="sortTop1" class="sortTopItem" wx:if="{{sortList[0]}}">
<image src="{{sortList[0].avatar}}"></image> <image src="{{sortList[0].avatar}}"></image>
<view class="sortPlanName">{{sortList[0].name}}</view> <view class="sortPlanName">{{sortList[0].name}}</view>
<view class="sortTopNum">
<image src="../../assets/up.png"></image>
<text>{{sortList[0].degree}}</text>
<text class="sortListItemEye">{{sortList[0].promoteMode}}</text>
</view>
</view> </view>
<view id="sortTop1" class="sortTopItem" wx:if="{{!sortList[0]}}"> <view id="sortTop1" class="sortTopItem" wx:if="{{!sortList[0]}}">
</view> </view>
<view id="sortTop3" class="sortTopItem" wx:if="{{sortList[2]}}"> <view id="sortTop3" class="sortTopItem" wx:if="{{sortList[2]}}">
<image src="{{sortList[2].avatar}}"></image> <image src="{{sortList[2].avatar}}"></image>
<view class="sortPlanName">{{sortList[2].name}}</view> <view class="sortPlanName">{{sortList[2].name}}</view>
<view class="sortTopNum">
<image src="../../assets/up.png"></image>
<text>{{sortList[2].degree}}</text>
<text class="sortListItemEye">{{sortList[2].promoteMode}}</text>
</view>
</view> </view>
<view id="sortTop3" class="sortTopItem" wx:if="{{!sortList[2]}}"> <view id="sortTop3" class="sortTopItem" wx:if="{{!sortList[2]}}">
</view> </view>
......
...@@ -11,6 +11,21 @@ ...@@ -11,6 +11,21 @@
height: 306rpx; height: 306rpx;
} }
#sortTop .sortTopNum{
font-size: 24rpx;
color: #4F5051;
display: flex;
align-items: center;
justify-content: center;
}
#sortTop .sortTopNum image{
display: inline-block;
width: 26rpx;
height: 24rpx;
margin: 0;
margin-right: 10rpx;
}
.sortTopItem{ .sortTopItem{
text-align: center; text-align: center;
font-size: 24rpx; font-size: 24rpx;
......
...@@ -2,9 +2,6 @@ var app = getApp(); ...@@ -2,9 +2,6 @@ var app = getApp();
import * as echarts from '../../component/ec-canvas/echarts'; import * as echarts from '../../component/ec-canvas/echarts';
// 柱状图 // 柱状图
let xDataList = []
let yDataList = []
function setOption(chart, xdata, ydata) { function setOption(chart, xdata, ydata) {
var option = { var option = {
color: ['#54585f'], color: ['#54585f'],
...@@ -104,19 +101,10 @@ function setOption(chart, xdata, ydata) { ...@@ -104,19 +101,10 @@ function setOption(chart, xdata, ydata) {
Page({ Page({
data: { data: {
trainList: [ trainList: [],
// { id: 1,ci:'5', time: "5月27日至5月20日", complete: false, xDataList: ['周日\n5.27', '周一\n5.26', '周二\n5.25', '周三\n5.24', '周四\n5.23', '周五\n5.22', '周六\n5.21'] ,yDataList: [3, 30, 3, 45, 37, 2, 20] },
// { id: 2,ci:'4', time: "5月20日至5月13日", complete: true,xDataList: ['周日\n5.20', '周一\n5.19', '周二\n5.18', '周三\n5.17', '周四\n5.16', '周五\n5.15', '周六\n5.14'] ,yDataList: [13, 21, 15, 15, 27, 12, 10] },
// { id: 3,ci:'3', time: "5月13日至5月6日", complete: false,xDataList: ['周日\n5.13', '周一\n5.12', '周二\n5.11', '周三\n5.10', '周四\n5.9', '周五\n5.8', '周六\n5.7'] ,yDataList: [3, 30, 3, 45, 37, 2, 20] },
// { id: 4,ci:'2', time: "5月6日至5月1日", complete: true,xDataList: ['周日\n5.6', '周一\n5.5', '周二\n5.4', '周三\n5.3', '周四\n5.2', '周五\n5.1', '周六\n4.30'] ,yDataList: [30, 3, 35, 45, 17, 22, 0] },
// { id: 5,ci:'1', time: "4月30日至4月23日", complete: false,xDataList: ['周日\n4.30', '周一\n4.29', '周二\n4.28', '周三\n4.27', '周四\n4.26', '周五\n4.25', '周六\n4.24'] ,yDataList: [3, 30, 3, 45, 37, 2, 20] },
],
// interval: 5000,
weekChart: { weekChart: {
// onInit: weekInitChart,
lazyLoad: true lazyLoad: true
}, },
// current: '',
currentPage: 1, currentPage: 1,
isLoading: false, isLoading: false,
}, },
...@@ -163,8 +151,6 @@ Page({ ...@@ -163,8 +151,6 @@ Page({
}) })
}, },
detail(e){ detail(e){
// console.log(e.currentTarget.dataset.id)
wx.navigateTo({ wx.navigateTo({
url: '/pages/historyDetail/historyDetail?historyId='+e.currentTarget.dataset.id url: '/pages/historyDetail/historyDetail?historyId='+e.currentTarget.dataset.id
}) })
......
...@@ -2,6 +2,5 @@ ...@@ -2,6 +2,5 @@
"navigationBarTitleText": "训练报告", "navigationBarTitleText": "训练报告",
"usingComponents": { "usingComponents": {
"ec-canvas": "../../component/ec-canvas/ec-canvas" "ec-canvas": "../../component/ec-canvas/ec-canvas"
}, }
"enablePullDownRefresh": true
} }
\ No newline at end of file
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
<ec-canvas id="mychart-{{index}}" ec="{{ weekChart }}"></ec-canvas> <ec-canvas id="mychart-{{index}}" ec="{{ weekChart }}"></ec-canvas>
</view> </view>
<view class="reportItemChartText"> <view class="reportItemChartText">
<view wx:for="{{item.typeTrainingList}}" wx:key> <view wx:for="{{item.typeTrainingTitleList}}" wx:key>
<text class="dot"></text> <text class="dot"></text>
{{item.title}} {{item.trainingDuration}}% {{item.title}} {{item.trainingPercent}}%
</view> </view>
</view> </view>
</view> </view>
......
...@@ -807,5 +807,6 @@ Page({ ...@@ -807,5 +807,6 @@ Page({
} }
} }
}) })
} },
preventTouchMove() {},
}) })
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
</view> </view>
</view> </view>
<!-- 单词训练设置弹窗 --> <!-- 单词训练设置弹窗 -->
<view id="wordSet" hidden="{{!wordSetShow}}"> <view id="wordSet" hidden="{{!wordSetShow}}" catchtouchmove="preventTouchMove">
<view id="wordTitleBox"> <view id="wordTitleBox">
<image id="close" src="../../assets/close.png" bindtap="close"></image> <image id="close" src="../../assets/close.png" bindtap="close"></image>
单词训练设置 单词训练设置
......
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