Commit 9755ce78 authored by Mac's avatar Mac

1

parent 3e602c91
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<template> <template>
<view class="appointment"> <view class="appointment">
<view class="appointment-box"> <view class="appointment-box">
<zzx-calendar ref='zzx' @selected-change="datechange" @getweekMode = 'getweekMode' @days-change='dayschage'></zzx-calendar> <zzx-calendar ref='zzx' :dotList='dotList' @selected-change="datechange" @getweekMode = 'getweekMode' @days-change='dayschage'></zzx-calendar>
</view> </view>
<view style="position:relative;"> <view style="position:relative;">
...@@ -249,7 +249,9 @@ import tabbars from '@/components/tabbar/index'; ...@@ -249,7 +249,9 @@ import tabbars from '@/components/tabbar/index';
TeacherId:0, TeacherId:0,
}, },
showteacher:0,//0为约课 1位老师进去查看自己的约课情况 showteacher:0,//0为约课 1位老师进去查看自己的约课情况
totalData:[],
fullDate:'',
dotList:[],
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -267,8 +269,9 @@ import tabbars from '@/components/tabbar/index'; ...@@ -267,8 +269,9 @@ import tabbars from '@/components/tabbar/index';
this.showteacher = options.teacher; this.showteacher = options.teacher;
this.list= [{name: '综合排序'}, {name: '课程'}] this.list= [{name: '综合排序'}, {name: '课程'}]
} }
this.msg.SelectStartTime = formatDate(new Date(), 'yyyy-MM-dd'), // this.msg.SelectStartTime = formatDate(new Date(), 'yyyy-MM-dd'),
this.msg.SelectEndTime = formatDate(new Date(), 'yyyy-MM-dd'), // this.msg.SelectEndTime = formatDate(new Date(), 'yyyy-MM-dd'),
this.fullDate=formatDate(new Date(), 'yyyy-MM-dd')
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.pageTitle, title: this.pageTitle,
}); });
...@@ -287,7 +290,7 @@ import tabbars from '@/components/tabbar/index'; ...@@ -287,7 +290,7 @@ import tabbars from '@/components/tabbar/index';
} }
this.getPointCourseClassList() this.getPointCourseClassList()
this.getTeacherList() this.getTeacherList()
this.init()
} }
}, },
created() { created() {
...@@ -297,10 +300,16 @@ import tabbars from '@/components/tabbar/index'; ...@@ -297,10 +300,16 @@ import tabbars from '@/components/tabbar/index';
methods:{ methods:{
datechange(e){ datechange(e){
console.log(e) this.fullDate = e.fullDate
this.msg.SelectStartTime = e.fullDate; // this.msg.SelectStartTime = e.fullDate;
this.msg.SelectEndTime = e.fullDate; // this.msg.SelectEndTime = e.fullDate;
this.init() // this.init()
this.totalData.forEach(x=>{
let time = x.DateYear+'-'+x.DateMonth+'-'+x.DateDay
if(this.fullDate == time){
this.subscribeList = x.PlanList
}
})
}, },
getweekMode(e){ getweekMode(e){
...@@ -396,14 +405,46 @@ import tabbars from '@/components/tabbar/index'; ...@@ -396,14 +405,46 @@ import tabbars from '@/components/tabbar/index';
dayschage(obj){ dayschage(obj){
let start =formatDate(new Date(obj.start), 'yyyy-MM-dd') let start =formatDate(new Date(obj.start), 'yyyy-MM-dd')
let end =formatDate(new Date(obj.end), 'yyyy-MM-dd') let end =formatDate(new Date(obj.end), 'yyyy-MM-dd')
this.msg.SelectStartTime = start
this.msg.SelectEndTime = end
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
}else{
if(this.showteacher==1){
this.msg.TeacherId = this.u.UserTeacher
}
this.init()
}
}, },
init(){ init(){
this.request2({ this.request2({
url: '/api/AppletPoint/GetTeacherCourseList', url: '/api/AppletPoint/GetTeacherCourseList',
data: this.msg data: this.msg
}, },
res => { res => {
this.subscribeList = res.data[0].PlanList // this.subscribeList = res.data[0].PlanList
this.totalData = res.data
this.dotList =[]
this.totalData.forEach(x=>{
let time = x.DateYear+'-'+x.DateMonth+'-'+x.DateDay
if(this.fullDate == time){
this.subscribeList = x.PlanList
}
if(x.haveCourseCount>0){
let obj = {
date:time
}
this.dotList.push(obj)
}
})
console.log(this.dotList)
} }
); );
}, },
......
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
}, },
watch:{ watch:{
dotList: function(newvalue){ dotList: function(newvalue){
console.log(newvalue,'newvalue')
const days = this.days.slice(0); const days = this.days.slice(0);
newvalue.forEach(item => { newvalue.forEach(item => {
const index = days.findIndex(ditem => ditem.fullDate === item.date); const index = days.findIndex(ditem => ditem.fullDate === item.date);
...@@ -296,7 +297,6 @@ ...@@ -296,7 +297,6 @@
} }
}, },
changeMode() { changeMode() {
console.log(2)
const premode = this.weekMode; const premode = this.weekMode;
let isweek = false; let isweek = false;
if (premode) { if (premode) {
...@@ -463,7 +463,7 @@ ...@@ -463,7 +463,7 @@
// border-radius: 10upx; // border-radius: 10upx;
position: absolute; position: absolute;
top: 1px; top: 1px;
right: 6px; right: 2px;
} }
} }
</style> </style>
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