Commit a8c2053c by kyle

学习进度图标

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