Commit 730e1a07 authored by IvyXia123's avatar IvyXia123

ui

parent 9c2f7c50
<template>
<div>
<van-actionsheet
v-model="actionsheetShow"
:actions="actions"
@select="onSelect"
/>
v-model="actionsheetShow"
:actions="actions"
@select="onSelect"
/>
<div class="unit-block">
<div class="course_title" @click="actionsheetShow=true">{{secActions.name}} <i class="iconfont icon-below-s"></i></div>
<!--竖屏 主题栏-->
......@@ -27,12 +27,12 @@
<span style="color: #cccccc">敬请期待</span>
</div>
</swiper-slide>
<swiper-slide v-for="a in 3-unitList.length > 0 ? 3-unitList.length : 0" :key="a*10">
<div class="unit-li">
<div>
<swiper-slide v-for="a in 3-unitList.length > 0 ? 3-unitList.length : 0" :key="a*10">
<div class="unit-li">
<div>
</div>
</div>
</div>
</swiper-slide>
</swiper-slide>
</swiper>
<!--横屏主题栏-->
<!-- <div class="btn-conntent banner-left" v-if="shopType==0&&unitList.length>0">
......@@ -105,23 +105,23 @@
<!--横屏 课程-->
<div class="lesson-block-hp" v-if="lessonList.length>0">
<swiper :options="swiperOptionLesson" class="lesson-sw" ref="mySwiperLesson">
<swiper-slide v-for="(item,x) in hpLessonList" :key="x" style="width: 50vh">
<div class="lesson-content-hp" @click="showDia(item)">
<div class="clock-hp" v-if="item.push_time === '0000-00-00'">
等待开课
</div>
<div class="lesson-day-hp">{{item.dayText}}</div>
<div class="lesson-img-hp"><img :src="item.cover"></div>
<div class="lesson-name-hp">
{{item.sub_title}}
<swiper-slide v-for="(item,x) in hpLessonList" :key="x" style="width: 50vh">
<div class="lesson-content-hp" @click="showDia(item)">
<div class="clock-hp" v-if="item.push_time === '0000-00-00'">
等待开课
</div>
<div class="lesson-day-hp">{{item.dayText}}</div>
<div class="lesson-img-hp"><img :src="item.cover"></div>
<div class="lesson-name-hp">
{{item.sub_title}}
</div>
<div class="star-block">
<img class="star-img" :src="star_act" v-for="s in item.star_num">
<img class="star-img" :src="star_def" v-for="s in 3-item.star_num">
</div>
<i class="map money" v-if="item.push_time !== '0000-00-00' && ((hpLessonList[x+1] && hpLessonList[x+1].push_time === '0000-00-00' || (shopType == 0 && findUnit(parent_category_id) && findUnit(parent_category_id).status === 2 || shopType ==1 ) && x===hpLessonList.length-1 ))"></i>
</div>
<div class="star-block">
<img class="star-img" :src="star_act" v-for="s in item.star_num">
<img class="star-img" :src="star_def" v-for="s in 3-item.star_num">
</div>
<i class="map money" v-if="item.push_time !== '0000-00-00' && ((hpLessonList[x+1] && hpLessonList[x+1].push_time === '0000-00-00' || (shopType == 0 && findUnit(parent_category_id) && findUnit(parent_category_id).status === 2 || shopType ==1 ) && x===hpLessonList.length-1 ))"></i>
</div>
</swiper-slide>
</swiper-slide>
</swiper>
</div>
<div class="unStart" v-if="!secActions.is_start_course&&!teacher_alias">
......@@ -306,7 +306,7 @@
}
},
swiperLesson() {
return this.$refs.mySwiperLesson.swiper
return this.$refs.mySwiperLesson.swiper
},
splitContent(){
let arr = [];
......@@ -334,11 +334,11 @@
this.userCourse = this.$common.deepCopy(res)
localStorage.setItem('userCourse',JSON.stringify(res));
this.setCourse()
})
})
}else{
if(localStorage.getItem("userCourse")){
this.userCourse = JSON.parse(localStorage.getItem("userCourse"));
this.setCourse()
this.userCourse = JSON.parse(localStorage.getItem("userCourse"));
this.setCourse()
}else{
getCourseInfoApi().then(res =>{
localStorage.setItem('userCourse','');
......@@ -365,7 +365,7 @@
this.actionsheetShow = false
this.shopType = item.course_type
if(item.id=='x'){
this.$router.replace({
this.$router.replace({
name: "secMap",
query: {
}
......@@ -383,7 +383,7 @@
})
if(item.is_start_course){
if (this.secActions.course_type == 0){
this.getUnitList()
this.getUnitList()
}else{
this.getLessonList();
}
......@@ -622,17 +622,17 @@
if(res.list[i].push_time !== '0000-00-00'){
x++
}
if(res.list[i].name.indexOf('Day1')>-1 && list.length > 0){
this.lessonList.push(list);
list = [];
list.push(res.list[i]);
}else{
list.push(res.list[i]);
if(i==res.list.length-1){
this.lessonList.push(list);
}
}
res.list[i].dayText = 'DAY '+list.length;
if(res.list[i].name.indexOf('Day1')>-1 && list.length > 0){
this.lessonList.push(list);
list = [];
list.push(res.list[i]);
}else{
list.push(res.list[i]);
if(i==res.list.length-1){
this.lessonList.push(list);
}
}
res.list[i].dayText = 'DAY '+list.length;
this.hpLessonList.push(res.list[i])
}
if(!data){
......@@ -643,21 +643,21 @@
}else if(this.$route.query.category_id){
}
if(this.$route.query.category_id){
let dom = document.getElementsByClassName('cid'+this.$route.query.category_id);
if(dom.length>0 && dom[0].style.display !== 'none'){
this.scroll_to(dom[0].offsetTop);
let data = null ;
let index = 0;
this.lessonList.forEach(i=>{
i.forEach((x,i)=>{
if(x.id == this.$route.query.category_id){
data = x;
index = i+1
}
})
});
this.showDia(data,index)
}
let dom = document.getElementsByClassName('cid'+this.$route.query.category_id);
if(dom.length>0 && dom[0].style.display !== 'none'){
this.scroll_to(dom[0].offsetTop);
let data = null ;
let index = 0;
this.lessonList.forEach(i=>{
i.forEach((x,i)=>{
if(x.id == this.$route.query.category_id){
data = x;
index = i+1
}
})
});
this.showDia(data,index)
}
}else if(this.$route.query.back_id){
setTimeout(() => {
let dom = document.getElementsByClassName('cid'+this.$route.query.back_id);
......@@ -706,16 +706,16 @@
if(this.userCourse.periods_list){
// 有其他课
// debugger
this.userCourse.periods_list.forEach(el =>{
this.userCourse.periods_list.forEach(el =>{
el.name = el.course_title
this.actions.push(el)
if(this.$route.query.item){
this.secActions = this.$route.query.item
}else{
if(this.userCourse.start_periods_id!=null&&this.userCourse.start_periods_id==0){
this.secActions = this.userCourse.periods_list[0]
this.secActions = this.userCourse.periods_list[0]
}else if(this.userCourse.start_periods_id!=null&&el.id==this.userCourse.start_periods_id){
this.secActions = el
this.secActions = el
}
}
})
......@@ -821,12 +821,12 @@
}
}
.shake{
-webkit-animation-name: swing;
-webkit-animation-duration: 0.8s;
-webkit-transform-origin:50% 50%;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
-webkit-animation-name: swing;
-webkit-animation-duration: 0.8s;
-webkit-transform-origin:50% 50%;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
.adSmall{width: 96*@toVw;height: 115*@toVw;position: fixed;top: 314*@toVw;left: 267*@toVw;background: red;}
// 主题列表
.noLesson{
......
......@@ -14,16 +14,14 @@
</div>
</div>
<div class="preservation" @click="preservationClick">保存</div>
<div class="bottom-top">
<van-popup v-model="dateShow" position="bottom">
<van-datetime-picker :min-hour="minHour" :max-hour="maxHour" @confirm="dateConfirm" @cancel="dateConfirmNo" v-model="currentTime" type="time"/>
</van-popup>
</div>
<van-popup v-model="dateShow" position="bottom">
<van-datetime-picker @confirm="dateConfirm" @cancel="dateConfirmNo" v-model="currentTime" type="time"/>
</van-popup>
</div>
</template>
<script>
import { postNotifySettingApi, getNotifyApi } from "../../service/api";
import { postNotifySettingApi } from "../../service/api";
import { DatetimePicker, Popup, Toast } from 'vant';
import tishiTimer from '../../assets/evaluate/tishi_timer.png'
import youjiantou from '../../assets/evaluate/youjiantou.png'
......@@ -32,9 +30,7 @@
name: "promptTime",
data() {
return {
currentTime: '07:00',
minHour: 7,
maxHour: 22,
currentTime: '',
dateVal: '',
dateShow: false,
selectedValue: '',
......@@ -46,18 +42,10 @@
[DatetimePicker.name]: DatetimePicker,
[Popup.name]: Popup,
},
watch: {
dateShow(val) {
if(!val) {
this.contentFn()
}
}
},
methods: {
dateShowClick() {
this.dateShow = true;
this.$nextTick(() => {
document.querySelectorAll('.van-picker__confirm')[0].innerText = '完成'
document.querySelectorAll('.van-picker-column')[1].style.display = 'none';
let oLi = document.querySelectorAll('.van-picker-column')[0].querySelectorAll('li');
for (var i = 0; i < oLi.length; i++) {
......@@ -81,61 +69,36 @@
}
},
preservationClick() {
let pushAtData = { time: this.currentTime, periods_id: this.$route.query.periods_id }
postNotifySettingApi(pushAtData).then(res => {
Toast("时间设定完成");
this.$router.go(-1);
})
if(this.currentTime) {
let pushAtData = { time: this.currentTime }
postNotifySettingApi(pushAtData).then(res => {
Toast("时间设定完成");
this.$router.go(-1);
})
}else {
Toast("请先设定时间");
this.$refs.timeSetting.style.borderBottom = '1px solid red'
}
}
},
mounted() {
getNotifyApi(this.$route.query.periods_id).then(res => {
if(res.time)
this.currentTime = res.time.split(':')[0] + ':' + res.time.split(':')[1]
})
}
}
</script>
<style lang="less">
@import "../../util/public";
.bottom-top {
.van-picker {
border-radius: 30 * @toVw 30 * @toVw 0 0;
}
.van-picker__toolbar::after {
content: '';
border: none;
}
.van-picker__confirm {
color: #333333;
font-size: 15 * @toVw;
margin: 0;
padding-right: 30 * @toVw;
}
.van-picker__frame, .van-picker__loading .van-loading {
height: 54px!important;
}
.van-picker__cancel {
color: #333333;
font-size: 15 * @toVw;
margin: 0;
padding-left: 30 * @toVw;
}
.van-picker {
border-radius: 30 * @toVw 30 * @toVw 0 0;
}
.van-picker-column__item {
color: #666666;
font-size: 17 * @toVw;
}
.van-picker-column__item {
color: #666666;
font-size: 20 * @toVw;
}
.van-picker-column__item--selected {
color: #40A9FF;
font-size: 21 * @toVw;
}
.van-picker-column__item--selected {
color: #40A9FF;
font-size: 26 * @toVw;
}
.prompt-time {
......
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