Commit 6b16554e by 陈玉桐

修复已知bug

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