Commit a8c2053c by kyle

学习进度图标

parent 3003ad85
......@@ -4,30 +4,28 @@
type="column"
:opts="opts"
:chartData="chartData"
@getIndex="tap"
/>
</view>
</template>
<script>
import { ref } from "vue";
export default {
// props:{chartData},
props:['chartData'],
data() {
return {
chartData: {
categories: ["1","2","3","4","5","6"],
series: [
{
name: "学习时间",
data: [35,36,31,33,13,34]
}
]
},
//您可以通过修改 config-ucharts.js 文件中下标为 ['column'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
}
opts: { }
};
},
setup(props,content) {
const chartData = ref(props.chartData);
const tap = function(e){
content.emit('tap',e)
}
return {chartData,tap}
},
mounted() {
this.opts = {
color:['#5F83FF'],
......@@ -61,9 +59,7 @@ export default {
}
};
},
methods: {
}
methods: {}
};
</script>
......
......@@ -34,8 +34,12 @@
name:'announcement_detail',
components:{
},
<<<<<<< Updated upstream
onLoad(options){
this.id = options.id;
=======
onLoad(option){
>>>>>>> Stashed changes
this.getAnnouncementDetail();
},
methods:{
......
......@@ -44,10 +44,14 @@
</view>
<!-- 相关课程列表 -->
<view class="relationCourseListsContent" v-show="tabType===2">
<<<<<<< Updated upstream
<view class="totalCourseCount">
<text v-if="requiredCount">{{requiredCount}}节必修</text>
<text v-if="nonRequiredCount"> + {{nonRequiredCount}}节必修</text>
</view>
=======
<view class="totalCourseCount">{{requiredCount}}节必修 + {{nonRequiredCount}}节选修</view>
>>>>>>> Stashed changes
<view class="courseItemContent" v-for="(item,index) in relatedCoursesLists" :key="item.fileId">
<view class="courseInfoContent">
<h4>{{index + 1}}.{{item.fileTitle}}<text class="courseType">{{item.fileType=='1' ? '必修' : '选修'}}</text></h4>
......@@ -106,6 +110,7 @@
shareCode:'',
shareReadId:'',
dataSource:'1',
<<<<<<< Updated upstream
requiredCount:0,
nonRequiredCount:0,
videoPlaybackInfo:{},
......@@ -115,6 +120,10 @@
viewTime:0,
timer:null,
loginType:''
=======
nonRequiredCount:0,
requiredCount:0
>>>>>>> Stashed changes
};
},
methods:{
......@@ -197,8 +206,12 @@
console.log('相关课程详情',res);
if(res['success']){
this.relatedCoursesLists = res['data']['data']['relatedCourseList'];
<<<<<<< Updated upstream
this.nonRequiredCount = res['data']['data']['nonRequiredCount'];
this.requiredCount = res['data']['data']['requiredCount'];
=======
console.log(this.relatedCoursesLists)
>>>>>>> Stashed changes
}
})
},
......
......@@ -84,8 +84,8 @@
<view class="studyDetailBox">
<h4>学习明细</h4>
<view class="lineChartBox">
<view v-if="studyInfos">
<charts></charts>
<view v-if="studyInfos && chartData">
<charts :chartData="chartData" @tap="tap"></charts>
<view class="chartTips">
<view class="imgBox">
<image src="../../static/point.png" mode="widthFix"></image>
......@@ -98,7 +98,14 @@
</view>
</view>
<view class="calendarBox">
<uni-calendar
:insert="true"
:lunar="true"
:start-date="'2019-3-2'"
:end-date="'2019-5-20'"
:selected="calendarSelected"
@change="calendarChange"
/>
</view>
</view>
</view>
......@@ -120,7 +127,8 @@
package:false
},
chartData:{},
studyInfos:[]
studyInfos:[],
calendarSelected:[]
};
},
methods:{
......@@ -140,18 +148,19 @@
for(let n=first;n<=end;n++){
categories.push(n);
}
for(let j=0;j<=this.studyInfos.length;j++){
for(let i=0;i<=categories.length;i++){
if(this.studyInfos[i] && (parseInt(this.studyInfos[i].month.split('-')[1])==categories[i])){
data.push(this.studyInfos[i].studyTime)
}else{
data.push('0')
data = categories.map(item=>item*0);
for(let j=0;j<this.studyInfos.length;j++){
for(let i=0;i<categories.length;i++){
if(this.studyInfos[j].month.split('-')[1]==categories[i]){
data[i] = this.studyInfos[j].studyTime;
break;
}else{
data[i] = data[i] ? data[i] : '0';
}
}
}
}
this.chartData.categories = categories;
// this.chartData.series[0].data = data;
console.log(data)
this.chartData.series = [{name:'月',data:data}];
}
})
},
......@@ -168,10 +177,18 @@
userStudyTime(){
api.userStudyTime({userId:this.userId,month:this.month}).then(res=>{
if(res['success']){
this.userStudyTimeList = res['data'];
this.userStudyTimeList = res['data']['studyInfos'];
console.log(this.userStudyTimeList)
}
})
},
calendarChange(){
},
tap(e){
// console.log(e.currentIndex.index)
}
},
mounted() {
this.userStudyCount()
......@@ -338,13 +355,12 @@
background-color: #fff;
margin-top: 20rpx;
.calendarBox{
margin: 0 20rpx;
margin: 20rpx;
box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.1);
border-radius: 10rpx;
}
.lineChartBox{
width: 100%;
height: 600rpx;
.chartTips{
text-align: center;
font-size: 20rpx;
......
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