|
@@ -1,91 +1,106 @@
|
|
|
<template>
|
|
|
<view style="padding: 30rpx;">
|
|
|
- <view v-if="havePlan">
|
|
|
- <view class="card" v-if="havePlan">
|
|
|
- <view class="date_t1">
|
|
|
- <u-icon name="arrow-left" size="28" v-if="havePreviousMonth" @click="swipeMonth(-1)"></u-icon>
|
|
|
- <text style="padding: 0 15rpx;">{{ calendarStudyVo.year }}年 {{ calendarStudyVo.month }}月</text>
|
|
|
- <u-icon name="arrow-right" size="28" v-if="haveNextMonth" @click="swipeMonth(1)"></u-icon>
|
|
|
- </view>
|
|
|
- <view style="width: 100%;display: flex;justify-content:center;margin-top: 20rpx;">
|
|
|
- <view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
|
|
|
- </view>
|
|
|
- <view style="width: 100%;margin-top: 20rpx;">
|
|
|
- <view v-for="(item, index) in showDayList" :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 v-if="havePlan">
|
|
|
+ <view class="card" v-if="havePlan">
|
|
|
+ <view class="date_t1">
|
|
|
+ <u-icon name="arrow-left" size="28" v-if="havePreviousMonth" @click="swipeMonth(-1)"></u-icon>
|
|
|
+ <text style="padding: 0 15rpx;">{{ calendarStudyVo.year }}年 {{ calendarStudyVo.month }}月</text>
|
|
|
+ <u-icon name="arrow-right" size="28" v-if="haveNextMonth" @click="swipeMonth(1)"></u-icon>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view style="width: 100%;display: flex;justify-content: center;" v-if="isOpen == false">
|
|
|
- <view @click="oepn_calendar" style="height: 20rpx;width: 40rpx;padding:20rpx 0;"><view class="date_line"></view></view>
|
|
|
- </view>
|
|
|
- <view style="width: 100%;display: flex;justify-content: center;" v-else>
|
|
|
- <image class="date_line_close" @click="close_calendar" src="/static/close_card.png"></image>
|
|
|
- </view>
|
|
|
- <view v-for="(item, index) in workList">
|
|
|
- <view style="margin-left: 30rpx;margin-top: 10rpx;display: flex;align-items: center;" @click="jumpDetail(item)">
|
|
|
- <text class="date_t2">{{ item.courseName }}</text>
|
|
|
- <view class="circle_num" style="margin-left: 20rpx;">{{ item.chapterNum }}</view>
|
|
|
+ <view style="width: 100%;display: flex;justify-content:center;margin-top: 20rpx;">
|
|
|
+ <view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 列表-->
|
|
|
- <view>
|
|
|
- <uni-swipe-action>
|
|
|
- <uni-swipe-action-item :autoClose="false" @change="swipeChange($event, item)" :show="item.show" v-for="(item, index) in list" :key="index">
|
|
|
- <view class="list_item" :class="index % 2 == 0 ? 'list_item_bac1' : 'list_item_bac2'" @click.stop="openEdit(item)">
|
|
|
- <u-row>
|
|
|
- <u-col span="11">
|
|
|
- <text class="item_t1">{{ item.coursePlanVo[0].categoryName }}:{{ $method.timestampToTime(item.endTime) }}截止</text>
|
|
|
- </u-col>
|
|
|
- <u-col span="1"><image src="/static/more.png" class="img_more" @click.stop="openShow(item)"></image></u-col>
|
|
|
- </u-row>
|
|
|
- <view style="margin-top: 30rpx;">
|
|
|
- <image :src="$method.splitImgHost(item.coursePlanVo[0].coverUrl)" class="r_image"></image>
|
|
|
- <view class="r_t2">{{ item.coursePlanVo[0].courseName }}</view>
|
|
|
+ <view style="width: 100%;margin-top: 20rpx;">
|
|
|
+ <view v-for="(item, index) in showDayList" :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 style="display: flex;margin-top: 30rpx;">
|
|
|
- <text class="item_t2">学习频率:</text>
|
|
|
- <view style="display: flex;justify-content:center;">
|
|
|
- <view v-for="(item1, index) in item.studyCount" :key="index" class="item_date">{{ replay(item1) }}</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 style="display: flex;margin-top: 20rpx;"><text class="item_t2">学习进度:{{item.studyNum}}/{{item.pitchNum}}</text></view>
|
|
|
</view>
|
|
|
- <template v-slot:right>
|
|
|
- <view class="operate">
|
|
|
- <image src="/static/operate_1.png" class="operate_img operate_img1" @click="delWorker(item)"></image>
|
|
|
- <image src="/static/operate_2.png" class="operate_img operate_img2"></image>
|
|
|
- <image @click="edit(item)" src="/static/operate_3.png" class="operate_img operate_img3"></image>
|
|
|
+ </view>
|
|
|
+ <view style="width: 100%;display: flex;justify-content: center;" v-if="isOpen == false">
|
|
|
+ <view @click="oepn_calendar" style="height: 20rpx;width: 40rpx;padding:20rpx 0;"><view class="date_line"></view></view>
|
|
|
+ </view>
|
|
|
+ <view style="width: 100%;display: flex;justify-content: center;" v-else>
|
|
|
+ <image class="date_line_close" @click="close_calendar" src="/static/close_card.png"></image>
|
|
|
+ </view>
|
|
|
+ <view v-for="(item, index) in workList">
|
|
|
+ <view style="margin-left: 30rpx;margin-top: 10rpx;display: flex;align-items: center;" @click="jumpDetail(item)">
|
|
|
+ <text class="date_t2">{{ item.goodsName }}</text>
|
|
|
+ <view class="circle_num" style="margin-left: 20rpx;">{{ item.chapterNum }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 列表-->
|
|
|
+ <view>
|
|
|
+ <uni-swipe-action>
|
|
|
+ <uni-swipe-action-item :autoClose="false" @change="swipeChange($event, item)" :show="item.show" v-for="(item, index) in list" :key="index">
|
|
|
+ <view class="list_item" :class="index % 2 == 0 ? 'list_item_bac1' : 'list_item_bac2'" @click.stop="openEdit(item)">
|
|
|
+ <u-row>
|
|
|
+ <u-col span="11">
|
|
|
+ <text class="item_t1">
|
|
|
+ {{ item.goodsVos[0].educationName + '-' + item.goodsVos[0].projectName + '-' + item.goodsVos[0].businessName }}:{{
|
|
|
+ $method.timestampToTime(item.endTime)
|
|
|
+ }}截止
|
|
|
+ </text>
|
|
|
+ </u-col>
|
|
|
+ <u-col span="1"><image src="/static/more.png" class="img_more" @click.stop="openShow(item)"></image></u-col>
|
|
|
+ </u-row>
|
|
|
+ <scroll-view style="white-space: nowrap" class="scroll-view_H" scroll-x="true">
|
|
|
+ <view style="margin-top: 30rpx;display: inline-block;width:296rpx;margin-right: 30rpx;" v-for="(items, indexs) in 3" :key="indexs">
|
|
|
+ <image :src="$method.splitImgHost(item.goodsVos[0].coverUrl)" class="r_image"></image>
|
|
|
+ <view class="r_t2">{{ item.goodsVos[0].goodsName }}</view>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+
|
|
|
+ <view style="display: flex;margin-top: 30rpx;">
|
|
|
+ <text class="item_t2">学习频率:</text>
|
|
|
+ <view style="display: flex;justify-content:center;">
|
|
|
+ <view v-for="(item1, index) in item.studyCount" :key="index" class="item_date">{{ replay(item1) }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="display: flex;margin-top: 20rpx;">
|
|
|
+ <text class="item_t2">学习进度:{{ item.studyNum }}/{{ item.pitchNum }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </template>
|
|
|
- </uni-swipe-action-item>
|
|
|
- </uni-swipe-action>
|
|
|
+ <template v-slot:right>
|
|
|
+ <view class="operate">
|
|
|
+ <image src="/static/operate_1.png" class="operate_img operate_img1" @click="delWorker(item)"></image>
|
|
|
+ <!-- <image src="/static/operate_2.png" class="operate_img operate_img2"></image> -->
|
|
|
+ <image @click="edit(item)" src="/static/operate_3.png" class="operate_img operate_img3"></image>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </uni-swipe-action-item>
|
|
|
+ </uni-swipe-action>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="newPlan" @click="newPlan()">新建计划</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="newPlan" @click="newPlan()">新建计划</view>
|
|
|
- </view>
|
|
|
<view v-else class="tipBox">
|
|
|
- <view class="tip">您暂无相关计划哦~</view>
|
|
|
- <view class="tipBtn" @click="newPlan()">马上制定~</view>
|
|
|
+ <view class="dis_ffs" v-if="goodsList.length">
|
|
|
+ <view class="tip">您暂无相关计划哦~</view>
|
|
|
+ <view class="tipBtn" @click="newPlan()">马上制定</view>
|
|
|
+ </view>
|
|
|
+ <view class="dis_ffs" v-else>
|
|
|
+ <view class="tip">您暂无课程可以制定计划哦~</view>
|
|
|
+ <view class="tipBtn" @click="newPlan()">马上选课</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -166,30 +181,39 @@ export default {
|
|
|
dayStudyList: [],
|
|
|
listItem: {},
|
|
|
currentMonth: 0,
|
|
|
- havePlan: false
|
|
|
+ havePlan: false,
|
|
|
+ goodsList: [] //用户拥有的商品
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
this.date_use = this.date_num;
|
|
|
+ this.getUserGoodsList();
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.workList = []
|
|
|
- this.showDayList = []
|
|
|
- this.calendarStudyVo = {}
|
|
|
- this.isOpen = false
|
|
|
- // this.getList();
|
|
|
+ this.workList = [];
|
|
|
+ this.showDayList = [];
|
|
|
+ this.calendarStudyVo = {};
|
|
|
+ this.isOpen = false;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ getUserGoodsList() {
|
|
|
+ this.$api.courseGoodsList().then(res => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.goodsList = res.data.rows;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
//删除计划
|
|
|
delWorker(option) {
|
|
|
var data = {
|
|
|
planId: option.planId,
|
|
|
- status: 0
|
|
|
+ status: -1
|
|
|
};
|
|
|
- let self = this
|
|
|
- this.$api.planupdateGenerate(data).then(res => {
|
|
|
- self.getList()
|
|
|
- })
|
|
|
+ let self = this;
|
|
|
+ this.$api.editsystemplan(data).then(res => {
|
|
|
+ self.getList();
|
|
|
+ });
|
|
|
},
|
|
|
swipeMonth(index) {
|
|
|
this.isOpen = false;
|
|
@@ -199,7 +223,7 @@ export default {
|
|
|
this.currentMonth = this.currentMonth + index;
|
|
|
let item = this.listItem.calendarStudyVo[this.monthIndex];
|
|
|
this.calendarStudyVo = item;
|
|
|
- this.workList = this.calendarStudyVo.coursePlanVo;
|
|
|
+ this.workList = this.calendarStudyVo.goodsVos;
|
|
|
if (this.monthIndex > 0) {
|
|
|
this.havePreviousMonth = true;
|
|
|
}
|
|
@@ -213,14 +237,15 @@ export default {
|
|
|
let currentMonth = date.getMonth() + 1;
|
|
|
this.haveNextMonth = false;
|
|
|
this.havePreviousMonth = false;
|
|
|
- this.workList = this.listItem.coursePlanVo;
|
|
|
+ this.workList = this.listItem.goodsVos;
|
|
|
+ return;
|
|
|
if (this.listItem !== undefined) {
|
|
|
for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
|
|
|
let item = this.listItem.calendarStudyVo[i];
|
|
|
if (item.month == currentMonth) {
|
|
|
this.monthIndex = i;
|
|
|
this.calendarStudyVo = item;
|
|
|
-
|
|
|
+
|
|
|
if (i > 0) {
|
|
|
this.havePreviousMonth = true;
|
|
|
}
|
|
@@ -303,27 +328,26 @@ export default {
|
|
|
},
|
|
|
getList() {
|
|
|
let self = this;
|
|
|
- this.$api.planUserPlan().then(result => {
|
|
|
- result.data.data.forEach((item, index) => {
|
|
|
+ this.$api.getsystemplanlist({status:1}).then(result => {
|
|
|
+ result.data.rows.forEach((item, index) => {
|
|
|
item.show = 'none';
|
|
|
});
|
|
|
- self.list = result.data.data;
|
|
|
- if(result.data.data.length>0){
|
|
|
- self.listItem = self.list[0]
|
|
|
- self.dealMonth()
|
|
|
- if(self.list.length>0){
|
|
|
- self.listItem = self.list[0]
|
|
|
- self.dealMonth()
|
|
|
- self.havePlan = true
|
|
|
+ self.list = result.data.rows;
|
|
|
+ if (result.data.rows.length > 0) {
|
|
|
+ self.listItem = self.list[0];
|
|
|
+ self.dealMonth();
|
|
|
+ if (self.list.length > 0) {
|
|
|
+ self.listItem = self.list[0];
|
|
|
+ self.dealMonth();
|
|
|
+ self.havePlan = true;
|
|
|
}
|
|
|
- }else{
|
|
|
- self.havePlan = false
|
|
|
+ } else {
|
|
|
+ self.havePlan = false;
|
|
|
}
|
|
|
- self.updateHomePlan()
|
|
|
-
|
|
|
+ self.updateHomePlan();
|
|
|
});
|
|
|
},
|
|
|
- updateHomePlan(){
|
|
|
+ updateHomePlan() {
|
|
|
const pages = getCurrentPages(); //获取页面栈
|
|
|
const beforePage = pages[pages.length - 2]; //前一个页面
|
|
|
beforePage.$vm.updateHomePlan();
|
|
@@ -362,27 +386,33 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scope>
|
|
|
- .tipBtn{
|
|
|
- width: 160rpx;
|
|
|
- height: 56rpx;
|
|
|
- background: #007AFF;
|
|
|
- border-radius: 16rpx;
|
|
|
- color: #FFFFFF;
|
|
|
- text-align: center;
|
|
|
- line-height: 56rpx;
|
|
|
- margin-top: 30rpx;
|
|
|
- }
|
|
|
- .tipBox{
|
|
|
- display:flex;
|
|
|
- align-items:center;/*垂直居中*/
|
|
|
- justify-content: center;/*水平居中*/
|
|
|
- flex-direction: column;
|
|
|
- margin-top: 40%;
|
|
|
- }
|
|
|
- .tip{
|
|
|
- color: #999999;
|
|
|
- font-size: 32rpx;
|
|
|
- }
|
|
|
+.dis_ffs {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+.tipBtn {
|
|
|
+ width: 160rpx;
|
|
|
+ height: 56rpx;
|
|
|
+ background: #007aff;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 56rpx;
|
|
|
+ margin-top: 30rpx;
|
|
|
+}
|
|
|
+.tipBox {
|
|
|
+ display: flex;
|
|
|
+ align-items: center; /*垂直居中*/
|
|
|
+ justify-content: center; /*水平居中*/
|
|
|
+ flex-direction: column;
|
|
|
+ margin-top: 40%;
|
|
|
+}
|
|
|
+.tip {
|
|
|
+ color: #999999;
|
|
|
+ font-size: 32rpx;
|
|
|
+}
|
|
|
.newPlan {
|
|
|
width: 200rpx;
|
|
|
height: 64rpx;
|
|
@@ -443,10 +473,12 @@ export default {
|
|
|
font-family: PingFang SC;
|
|
|
font-weight: 400;
|
|
|
color: #0c141f;
|
|
|
+ white-space: pre-wrap;
|
|
|
}
|
|
|
.r_image {
|
|
|
width: 278rpx;
|
|
|
height: 134rpx;
|
|
|
+ border-radius: 16rpx;
|
|
|
}
|
|
|
.img_more {
|
|
|
width: 26rpx;
|
|
@@ -466,7 +498,7 @@ export default {
|
|
|
}
|
|
|
.list_item {
|
|
|
width: 100%;
|
|
|
- height: 418rpx;
|
|
|
+ min-height: 418rpx;
|
|
|
box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.05);
|
|
|
border-radius: 24rpx;
|
|
|
margin-top: 20rpx;
|