|
|
@@ -31,16 +31,37 @@
|
|
|
<view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
|
|
|
</view>
|
|
|
<view style="width: 100%;display: flex;justify-content:center;margin-top: 40rpx;">
|
|
|
- <view v-for="(item, index) in date_num" :key="index" class="date_num">{{ item }}</view>
|
|
|
+ <view v-for="(item, index) in date_num" :key="index" class="date_num">
|
|
|
+ <view v-if="item.color == 0" class="date_num_color0" v-show="item.date>0">
|
|
|
+ {{ item.date }}
|
|
|
+ <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
+ <view v-if="item.dot" class="date_dot"></view>
|
|
|
+ </view>
|
|
|
+ <view v-if="item.color == 1" class="date_num_color1">
|
|
|
+ {{ item.date }}
|
|
|
+ <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
+ <view v-if="item.dot" class="date_dot"></view>
|
|
|
+ </view>
|
|
|
+ <view v-if="item.color == 2" class="date_num_color2">
|
|
|
+ {{ item.date }}
|
|
|
+ <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
+ <view v-if="item.dot" class="date_dot"></view>
|
|
|
+ </view>
|
|
|
+ <view v-if="item.color == 3" class="date_num_color3">
|
|
|
+ {{ item.date }}
|
|
|
+ <view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
|
|
|
+ <view v-if="item.dot" class="date_dot"></view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view style="width: 100%;margin-top: 20rpx;" v-if="false">
|
|
|
+ <view style="width: 100%;margin-top: 20rpx;" v-if="workList.length>0" >
|
|
|
<u-row gutter="16">
|
|
|
<u-col span="2" text-align="center">
|
|
|
- <view><image src="/static/left.png" class="arr-icon"></image></view>
|
|
|
+ <view><image src="/static/left.png" class="arr-icon" @click="preveItem"></image></view>
|
|
|
</u-col>
|
|
|
- <u-col span="8" text-align="center"><view class="course_title">二级建造师市政公用工程</view></u-col>
|
|
|
+ <u-col span="8" text-align="center"><view class="course_title" @click="jumpCourseDetail()">{{ courseItem.courseName }}</view></u-col>
|
|
|
<u-col span="2" text-align="center">
|
|
|
- <view><image src="/static/right.png" class="arr-icon"></image></view>
|
|
|
+ <view><image src="/static/right.png" class="arr-icon" @click="nextItem"></image></view>
|
|
|
</u-col>
|
|
|
</u-row>
|
|
|
</view>
|
|
|
@@ -120,6 +141,11 @@ export default {
|
|
|
name: 'home',
|
|
|
data() {
|
|
|
return {
|
|
|
+ courseItem:{},
|
|
|
+ courseIndex:0,
|
|
|
+ vertical:"vertical",
|
|
|
+ workList: [],
|
|
|
+ workTextList: [],
|
|
|
show: false,
|
|
|
tab_list: [
|
|
|
{
|
|
|
@@ -167,17 +193,97 @@ export default {
|
|
|
this.windowHeight = uni.getSystemInfoSync().windowHeight;
|
|
|
this.initList();
|
|
|
this.advertisingList();
|
|
|
- // d是当前星期一的日期对象
|
|
|
- var d=this.getMonDate();
|
|
|
- var arr=[];
|
|
|
- for(var i=0; i<7; i++)
|
|
|
- {
|
|
|
- this.date_num.push(d.getDate())
|
|
|
- d.setDate(d.getDate()+1);
|
|
|
- }
|
|
|
- console.log(arr)
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
+ init(){
|
|
|
+ if(!this.$method.isLogin()){
|
|
|
+ //未登录
|
|
|
+ this.date_num = []
|
|
|
+ this.workList = []
|
|
|
+ this.initDay()
|
|
|
+ }else{
|
|
|
+ this.date_num = []
|
|
|
+ this.workList = []
|
|
|
+ this.userPlanSeven()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ initDay(){
|
|
|
+ // d是当前星期一的日期对象
|
|
|
+ var d=this.getMonDate();
|
|
|
+ var arr=[];
|
|
|
+ let date = new Date();
|
|
|
+ let num = date.getDate();
|
|
|
+ for(var i=0; i<7; i++)
|
|
|
+ {
|
|
|
+ let item = {date:d.getDate()}
|
|
|
+ item.color = 0
|
|
|
+ if(d.getDate()==num){
|
|
|
+ item.color = 3;
|
|
|
+ }
|
|
|
+ this.date_num.push(item)
|
|
|
+ d.setDate(d.getDate()+1);
|
|
|
+ }
|
|
|
+ console.log(this.date_num,66)
|
|
|
+ },
|
|
|
+ preveItem(){
|
|
|
+ if(self.courseIndex>0){
|
|
|
+ self.courseIndex = self.courseIndex-1
|
|
|
+ self.courseItem = self.workList[self.courseIndex]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ nextItem(){
|
|
|
+ if(self.courseIndex<self.workList.length-1){
|
|
|
+ self.courseIndex = self.courseIndex+1
|
|
|
+ self.courseItem = self.workList[self.courseIndex]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ jumpCourseDetail(){
|
|
|
+ this.$navTo.togo('/pages2/course/detail', {
|
|
|
+ id: this.courseItem.courseId
|
|
|
+ });
|
|
|
+ },
|
|
|
+ noticeBar(index){
|
|
|
+ let item = this.workList[index]
|
|
|
+ this.$navTo.togo('/pages2/course/detail', {
|
|
|
+ id: item.courseId
|
|
|
+ });
|
|
|
+ },
|
|
|
+ userPlanSeven() {
|
|
|
+ let self = this;
|
|
|
+ this.$api.userPlanSeven().then(result => {
|
|
|
+ if(result.data.data.coursePlanVo!=null){
|
|
|
+ self.workList = result.data.data.coursePlanVo;
|
|
|
+ if(self.workList!=null&&self.workList.length>0){
|
|
|
+ self.courseItem = self.workList[self.courseIndex]
|
|
|
+ }
|
|
|
+ let date = new Date();
|
|
|
+ let num = date.getDate();
|
|
|
+ let list = result.data.data.calendarStudyVo[0].dayStudyList;
|
|
|
+ for(let i = 0; i < list.length; i++) {
|
|
|
+ let item = list[i]
|
|
|
+ item.color = 0
|
|
|
+ if (item.date == num) {
|
|
|
+ item.color = 3;
|
|
|
+ }
|
|
|
+ if (item.perform == 1) {
|
|
|
+ item.color = 1;
|
|
|
+ }
|
|
|
+ if (item.perform == 2) {
|
|
|
+ item.color = 2;
|
|
|
+ }
|
|
|
+ item.note = item.studyCourseKnob
|
|
|
+ if(item.note>0){
|
|
|
+ item.dot = true
|
|
|
+ }
|
|
|
+ self.date_num.push(item)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ self.initDay()
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
getMonDate()
|
|
|
{
|
|
|
var d=new Date(),
|
|
|
@@ -384,11 +490,61 @@ export default {
|
|
|
.u-row {
|
|
|
margin: 40rpx 0;
|
|
|
}
|
|
|
+.date_dot {
|
|
|
+ width: 6rpx;
|
|
|
+ height: 6rpx;
|
|
|
+ background: #ffcc00;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin: 0 auto;
|
|
|
+}
|
|
|
+.date_note {
|
|
|
+ border-radius: 50%;
|
|
|
+ width: 29rpx;
|
|
|
+ height: 29rpx;
|
|
|
+ border: 1px solid #ffcc00;
|
|
|
+ font-size: 18rpx;
|
|
|
+ color: #ffcc00;
|
|
|
+ text-align: center;
|
|
|
+ display: inline-block;
|
|
|
+ position: absolute;
|
|
|
+ top: -19rpx;
|
|
|
+ right: 9rpx;
|
|
|
+}
|
|
|
+.circle_num {
|
|
|
+ border-radius: 50%;
|
|
|
+ width: 29rpx;
|
|
|
+ height: 29rpx;
|
|
|
+ border: 1px solid #ffcc00;
|
|
|
+ font-size: 18rpx;
|
|
|
+ color: #ffcc00;
|
|
|
+ text-align: center;
|
|
|
+ display: inline-block;
|
|
|
+ margin: 5rpx;
|
|
|
+}
|
|
|
.date_num {
|
|
|
width: 14%;
|
|
|
text-align: center;
|
|
|
+ position: relative;
|
|
|
+ display: inline-block;
|
|
|
+ margin-top: 20rpx;
|
|
|
+}
|
|
|
+.date_num_color0 {
|
|
|
+ color: #32467b;
|
|
|
+}
|
|
|
+.date_num_color1 {
|
|
|
color: #34c759;
|
|
|
}
|
|
|
+.date_num_color2 {
|
|
|
+ color: #ff3b30;
|
|
|
+}
|
|
|
+.date_num_color3 {
|
|
|
+ color: #ffffff;
|
|
|
+ background-color: #ffcc00;
|
|
|
+ border-radius: 50%;
|
|
|
+ width: 40rpx;
|
|
|
+ height: 40rpx;
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
.card_date {
|
|
|
width: 14%;
|
|
|
text-align: center;
|