Commit 844a620e authored by 罗超's avatar 罗超

2

parent 86f477e1
...@@ -97,8 +97,7 @@ ...@@ -97,8 +97,7 @@
@click="checkCourseType2(item)"> @click="checkCourseType2(item)">
预约 预约
</view> </view>
<view class="yuyueBtn" style="opacity: 0.5;" v-if="item[0].State==4" <view class="yuyueBtn" style="opacity: 0.5;" v-if="item[0].State==4">
@click="checkCourseType2(item)">
已预约 已预约
</view> </view>
</view> </view>
...@@ -173,7 +172,8 @@ ...@@ -173,7 +172,8 @@
onMounted onMounted
} from 'vue' } from 'vue'
import { import {
DateFormat DateFormat,
getToday
} from '../../utils/date.js' } from '../../utils/date.js'
import Navbar from '../../components/navbar.vue' import Navbar from '../../components/navbar.vue'
export default { export default {
...@@ -209,6 +209,7 @@ ...@@ -209,6 +209,7 @@
data.isShowCalendar = false data.isShowCalendar = false
this.getDateData(val.detail) this.getDateData(val.detail)
data.msg.Date = DateFormat(val.detail) data.msg.Date = DateFormat(val.detail)
data.current=0
this.getTeacherList() this.getTeacherList()
console.log(86, data.msg.Date) console.log(86, data.msg.Date)
}, },
...@@ -324,6 +325,29 @@ ...@@ -324,6 +325,29 @@
}) })
}, },
checkCourse(index) { checkCourse(index) {
if(data.basics.AdvanceDay==1){
const lateTime =new Date( getToday()+' '+data.basics.ScrollETime).getTime()
const nowTime=new Date().getTime()
if(nowTime>lateTime){
uni.showToast({
icon:'none',
title:`${data.basics.ScrollETime}点后不可预约明天课程`
})
return
}
}
if(data.basics.AppointDate){
const lateDate =new Date(data.basics.AppointDate).getTime()
const curSubDate=new Date(data.msg.Date).getTime()
console.log(curSubDate<lateDate)
if(curSubDate<lateDate){
uni.showToast({
icon:'none',
title:`需预约${data.basics.AppointDate}之后的日期`
})
return
}
}
let curCourse = data.courselist[index] let curCourse = data.courselist[index]
let RemainTime = data.basics.NextAppointMinutes - curCourse.Minutes //剩余课时 let RemainTime = data.basics.NextAppointMinutes - curCourse.Minutes //剩余课时
const ShiftSortArr = [curCourse] const ShiftSortArr = [curCourse]
...@@ -371,6 +395,28 @@ ...@@ -371,6 +395,28 @@
} }
}, },
checkCourseType2(item) { checkCourseType2(item) {
if(data.basics.AdvanceDay==1){
const lateTime =new Date( getToday()+' '+data.basics.ScrollETime).getTime()
const nowTime=new Date().getTime()
if(nowTime>lateTime){
uni.showToast({
icon:'none',
title:`${data.basics.ScrollETime}点后不可预约明天课程`
})
return
}
}
if(data.basics.AppointDate){
const lateDate =new Date(data.basics.AppointDate).getTime()
const curSubDate=new Date(data.msg.Date).getTime()
if(curSubDate<lateDate){
uni.showToast({
icon:'none',
title:`需预约${data.basics.AppointDate}之后的日期`
})
return
}
}
let total = item.reduce((pre, cur) => { let total = item.reduce((pre, cur) => {
return cur.Minutes + pre return cur.Minutes + pre
}, 0) }, 0)
......
<style> <style scoped>
.mySubscribe{ .mySubscribe {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
background: #F5F5F5; background-color: #F5F5F5;
} }
.listbox{
.headrow {
overflow: hidden;
border-radius: 0px 0px 50rpx 50rpx;
}
.listbox {
width: 100%; width: 100%;
margin-top: 15px; margin-top: 15px;
padding: 0 15px; padding: 0 15px;
box-sizing: border-box; box-sizing: border-box;
} }
.box-item{
border-radius: 12rpx; .box-item {
border-radius: 24rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 30rpx; padding: 30rpx;
background: #FFF; background-color: #FFF;
font-size: 24rpx; font-size: 24rpx;
box-shadow: 2rpx 4rpx 40rpx 0px rgba(212, 212, 212, 0.6);
position: relative;
} }
.row{
.row {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.onetext{
.onetext {
width: 100%; width: 100%;
text-align: center; text-align: center;
overflow: hidden;display: inline-block;white-space: nowrap; text-overflow:ellipsis overflow: hidden;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis
} }
.popupbox{
.popupbox {
width: 60vw; width: 60vw;
background: #FFF; background: #FFF;
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
} }
.popupBtnBox{
.popupBtnBox {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 30rpx; padding: 30rpx;
...@@ -45,73 +61,212 @@ ...@@ -45,73 +61,212 @@
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
} }
.popupBtn{
.popupBtn {
font-size: 30rpx; font-size: 30rpx;
color: #111; color: #111;
} }
.popupbox-c{
.popupbox-c {
padding: 20rpx; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.popupbox-list{
.popupbox-list {
height: 90rpx; height: 90rpx;
border-bottom: 1px solid rgba(0, 0, 0, 0.05); border-bottom: 1px solid rgba(0, 0, 0, 0.05);
font-size: 26rpx; font-size: 26rpx;
color: #555555; color: #555555;
box-sizing: border-box; box-sizing: border-box;
} }
.popupbox-item{
.popupbox-item {
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid rgba(0, 0, 0, 0.05); border-bottom: 1px solid rgba(0, 0, 0, 0.05);
height: 100rpx; height: 100rpx;
} }
.listItemBox1 {
width: 100%;
display: flex;
align-items: center;
margin-bottom: 10rpx;
}
.listItemBox1 .listItemDate {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
margin-right: 10rpx;
}
.listItemBox1 .listItemWeek {
font-size: 24rpx;
font-family: PingFang SC;
color: #A5A5A5;
}
.listItemBox2 {
display: flex;
flex-wrap: wrap;
align-items: center;
background-color: #E4E5FB;
border-radius: 16rpx;
margin: 20rpx 0;
box-sizing: border-box;
padding: 16rpx 20rpx;
}
.listItemBox2 .classTime {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.listItemBox2 .gap {
margin: 0 20rpx;
text-align: center;
}
.listItemBox2 .classMinutes {
font-size: 18rpx;
font-family: PingFang SC;
color: #9699E6;
}
.CourseTimeListItem {
margin: 5rpx 0;
}
.listItemBox3 {
display: flex;
margin: 10rpx 0;
}
.listItemBox3 .label {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: #A5A5A5;
margin-right: 20rpx;
}
.listItemBox3 .con {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: #111111;
display: flex;
white-space: nowrap;
}
.stateBox {
position: absolute;
right: 44rpx;
bottom: 44rpx;
}
.stateBox .StateName {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.quxiaoBtn{
box-sizing: border-box;
padding: 6rpx 12rpx;
border-radius: 10rpx;
margin-left: 300rpx;
border: 1px solid #9699e6;
color: #4c50e7;
font-size: 20rpx
}
</style> </style>
<template> <template>
<view class="mySubscribe"> <view class="mySubscribe">
<view class="row"> <view class="row headrow">
<van-tabs <van-tabs style="flex:1" :active="data.msg.State" title-inactive-color="#444444"
style="flex:1" title-active-color="#4C50E7" line-height="0" @change="changeTab">
:active="data.msg.State" <van-tab :title="x.Name" :name="x.Id" v-for="(x,y) in stateList" :key='y'></van-tab>
title-inactive-color="#444444"
title-active-color="#00ACF9"
line-height="0"
@change="changeTab"
>
<van-tab :title="x.Name" :name="x.Id" v-for="(x,y) in stateList" :key='y'></van-tab>
</van-tabs> </van-tabs>
<view class="onetext" style="width: 100rpx;background: #FFF;height: 88rpx;display: flex;align-items: center;justify-content: center;" @click="popupshow2=true"> <view class="onetext"
<van-icon name="bars" size="44rpx"/> style="width: 100rpx;background: #FFF;height: 88rpx;display: flex;align-items: center;justify-content: center;"
@click="popupshow2=true">
<van-icon name="bars" color="#4C50E7" size="44rpx" />
</view> </view>
</view> </view>
<view v-if="List.length>0"> <view v-if="List.length>0">
<scroll-view :scroll-y="true" style="height: calc(100vh - 150rpx );width: 100vw;"> <scroll-view :scroll-y="true" style="height: calc(100vh - 150rpx );width: 100vw;">
<view class="listbox" v-for='(x,y) in List' :key = 'y' > <view class="listbox" v-for='(x,y) in List' :key='y'>
<view class="box-item"> <view class="box-item">
<view class="row" style="justify-content: space-between;font-size: 30rpx;line-height: 60rpx;margin-bottom: 20rpx;"> <view class="listItemBox1">
<span>{{x.Date}}</span> <view class="listItemDate">
<span>{{x.StateName}}</span> {{x.Date}}
</view>
<view class="listItemWeek">
{{getWeek(x.Date)}}
</view>
<view class="quxiaoBtn" v-if="x.State == 1" @click="goquxiao(x)">
取消
</view>
</view>
<view class="listItemBox2"
:style="{display:x.CourseTimeList.length==1?'inline-block':'flex','background-color':x.State == 5?'#D4D4D4':'#E4E5FB'}">
<view v-for="(item,index) in x.CourseTimeList" :key="index" class="row CourseTimeListItem">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee.png"
mode="" style="width: 38rpx;height: 38rpx;margin: 0 20rpx ;" v-if="index%2===1">
</image>
<text class="classTime">{{item.StartTime}}</text>
<view class="gap">
<view class="classMinutes">{{item.Minutes}}分钟</view>
<van-icon name="ellipsis" color="#9699E6" size="26rpx" />
</view>
<text class="classTime">{{item.EndTime}}</text>
</view>
</view>
<view class="listItemBox3">
<view class="label">
课程
</view>
<view class="con">
{{x.CourseName}}
</view>
</view>
<view class="listItemBox3">
<view class="label">
学生
</view>
<view class="con">
{{x.StuName}}
</view>
</view> </view>
<view class="row" style="align-items: flex-start;"> <view class="listItemBox3">
<image :src='x.TeacherHead' mode="aspectFill" style="width:76rpx ;height: 76rpx;border-radius: 50%;"></image> <view class="label">
<view style="margin-left: 30rpx;padding-bottom:20rpx ;"> 课次
<div style="font-size: 26rpx;color: #111;font-weight: bold">{{x.CourseName}}</div> </view>
<div style="font-size: 22rpx;color: #666;margin-top: 8rpx;">{{x.TeacherName}}</div> <view class="con">
<div style="font-size: 22rpx;color: #666;margin-top: 8rpx;">学生:{{x.StuName}}</div> {{x.ChapterNo||0}}次课
<div style="font-size: 22rpx;color: #666;margin-top: 8rpx;">{{x.ChapterNo}}次课</div>
</view> </view>
</view> </view>
<view >时间列表</view> <view class="listItemBox3">
<view v-for="(item,index) in x.CourseTimeList" :key="index"> <view class="label">
<view class="row"> 教师
{{item.StartTime}} </view>
<span style="margin: 0 10rpx;">-</span> <view class="con">
{{item.EndTime}} <image :src='x.TeacherHead' mode="aspectFill"
<span style='margin-left: 20rpx;'>{{item.Minutes}}分钟</span> style="width:36rpx ;height: 36rpx;border-radius: 50%; margin-right: 12rpx;"></image>
<text>{{x.TeacherName}}</text>
</view> </view>
</view> </view>
<view style="display: flex;justify-content: flex-end;" v-if="x.State == 1"> <view class="stateBox">
<van-button size="small" @click="goquxiao(x)">取消</van-button> <view class="StateName" :style="{color: x.State == 2?'#4C50E7':x.State == 4?'#EF5361':x.State == 5?'#d4d4d4':'#111111'}">
{{x.StateName}}
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -119,7 +274,7 @@ ...@@ -119,7 +274,7 @@
</scroll-view> </scroll-view>
</view> </view>
<view v-else> <view v-else>
<van-empty description="暂无数据" /> <van-empty description="暂无数据" />
</view> </view>
<van-dialog :show='show' title="提示" message='正在确认中,您确定取消预约?' show-cancel-button @cancel='show = false' <van-dialog :show='show' title="提示" message='正在确认中,您确定取消预约?' show-cancel-button @cancel='show = false'
@confirm='quedquxiao'> @confirm='quedquxiao'>
...@@ -130,61 +285,60 @@ ...@@ -130,61 +285,60 @@
<span>开始时间</span> <span>开始时间</span>
<view class="row" @click="showdatePopup=true"> <view class="row" @click="showdatePopup=true">
<span v-if="msg.StartTime==''" style="color: #999999;">请选择</span> <span v-if="msg.StartTime==''" style="color: #999999;">请选择</span>
<span v-else >{{msg.StartTime}}</span> <span v-else>{{msg.StartTime}}</span>
</view> </view>
</view> </view>
<view class="popupbox-item row"> <view class="popupbox-item row">
<span>结束时间</span> <span>结束时间</span>
<view class="row" @click="showdatePopup2=true"> <view class="row" @click="showdatePopup2=true">
<span v-if="msg.EntTime==''" style="color: #999999;">请选择</span> <span v-if="msg.EntTime==''" style="color: #999999;">请选择</span>
<span v-else >{{msg.EntTime}}</span> <span v-else>{{msg.EntTime}}</span>
</view> </view>
</view> </view>
<view class="popupbox-item row"> <view class="popupbox-item row">
<span>老师</span> <span>老师</span>
<view class="row" @click="popupshow=true"> <view class="row" @click="popupshow=true">
<span v-if="msg.TeacherId==0" style="color: #999999;">请选择</span> <span v-if="msg.TeacherId==0" style="color: #999999;">请选择</span>
<span v-else >{{TeacherName}}</span> <span v-else>{{TeacherName}}</span>
</view> </view>
</view> </view>
<view class="popupBtnBox"> <view class="popupBtnBox">
<!-- <view class="popupBtn"> <van-button type="info" plain size="small" @click="popupshow2=false">取消</van-button>
取消
</view> -->
<van-button type="info" plain size="small" @click="popupshow2=false">取消</van-button>
<van-button type="info" size="small" @click="search">确定</van-button> <van-button type="info" size="small" @click="search">确定</van-button>
<!-- <view class="popupBtn">
确定
</view> -->
</view> </view>
</view> </view>
</van-popup> </van-popup>
<van-popup :show="popupshow" @close="popupshow=false" position='right'> <van-popup :show="popupshow" @close="popupshow=false" position='right'>
<view class="popupbox"> <view class="popupbox">
<view class="popupbox-top"> <view class="popupbox-top">
<van-search :value="value" placeholder="请输入搜索关键词" @change="onSearch" @cancel="onSearch"/> <van-search :value="value" placeholder="请输入搜索关键词" @change="onSearch" @cancel="onSearch" />
</view> </view>
<view class="popupbox-c" v-if='TeacherList.length>0'> <view class="popupbox-c" v-if='TeacherList.length>0'>
<scroll-view :scroll-y="true" style="height: calc(100vh - 110rpx - 150rpx);width: 100%;"> <scroll-view :scroll-y="true" style="height: calc(100vh - 110rpx - 150rpx);width: 100%;">
<view class="popupbox-list row" style="justify-content: space-between;" v-for='(x,y) in TeacherList' :key = 'y' @click="choice(x)"> <view class="popupbox-list row" style="justify-content: space-between;"
<span >{{x.TeacherName}}</span> v-for='(x,y) in TeacherList' :key='y' @click="choice(x)">
<van-icon name="success" color='#0000ff' v-if='msg.TeacherId == x.TId'/> <span>{{x.TeacherName}}</span>
<van-icon name="success" color='#0000ff' v-if='msg.TeacherId == x.TId' />
</view> </view>
<view style="width: 100%;height: 20px;"></view> <view style="width: 100%;height: 20px;"></view>
</scroll-view> </scroll-view>
</view> </view>
<view v-else> <view v-else>
<van-empty description="暂无数据" /> <van-empty description="暂无数据" />
</view> </view>
</view> </view>
</van-popup> </van-popup>
<van-popup :show="showdatePopup" round position="bottom" custom-style="height: 50%" @close="showdatePopup=false"> <van-popup :show="showdatePopup" round position="bottom" custom-style="height: 50%"
<van-datetime-picker type="date" :value="getCurrentDate" @cancel="showdatePopup=false" @confirm="onConfirm()" /> @close="showdatePopup=false">
<van-datetime-picker type="date" :value="getCurrentDate" @cancel="showdatePopup=false"
@confirm="onConfirm()" />
</van-popup> </van-popup>
<van-popup :show="showdatePopup2" round position="bottom" custom-style="height: 50%" @close="showdatePopup2=false"> <van-popup :show="showdatePopup2" round position="bottom" custom-style="height: 50%"
<van-datetime-picker type="date" :value="getCurrentDate2" @cancel="showdatePopup2=false" @confirm="onConfirm2()" /> @close="showdatePopup2=false">
<van-datetime-picker type="date" :value="getCurrentDate2" @cancel="showdatePopup2=false"
@confirm="onConfirm2()" />
</van-popup> </van-popup>
</view> </view>
</template> </template>
...@@ -204,101 +358,121 @@ ...@@ -204,101 +358,121 @@
import Dialog from '../../wxcomponents/vant/dialog/dialog' import Dialog from '../../wxcomponents/vant/dialog/dialog'
export default { export default {
components: { components: {
}, },
props:[], props: [],
setup(props) { setup(props) {
let {proxy} = getCurrentInstance(); let {
proxy
} = getCurrentInstance();
let data = reactive({ let data = reactive({
msg:{ msg: {
pageIndex:1, pageIndex: 1,
pageSize:10, pageSize: 10,
StartTime:'', StartTime: '',
EntTime:'', EntTime: '',
State:0, State: 0,
TeacherId:0, TeacherId: 0,
}, },
TeacherName:"", TeacherName: "",
pageState: "more", pageState: "more",
PageCount: 0, PageCount: 0,
timer: null, //防抖 timer: null, //防抖
List:[], List: [{
stateList:[], Date: "2020-01-01",
show:false, CourseTimeList: [{
AppointId:0, StartTime: '09:00',
popupshow:false, Minutes: 90,
popupshow2:false, EndTime: "12:00"
value:'', }, {
TeacherList:[], StartTime: '09:00',
allTeacherList:[], Minutes: 90,
showdatePopup:false, EndTime: "12:00"
showdatePopup2:false, }],
getCurrentDate:new Date().getTime(), CourseName: "内部斑",
getCurrentDate2:new Date().getTime(), StuName: "张三",
ChapterNo: 1,
TeacherName: "张三",
StateName: '待确认',
State: 1,
}, ],
stateList: [],
show: false,
AppointId: 0,
popupshow: false,
popupshow2: false,
value: '',
TeacherList: [],
allTeacherList: [],
showdatePopup: false,
showdatePopup2: false,
getCurrentDate: new Date().getTime(),
getCurrentDate2: new Date().getTime(),
}) })
let methods = { let methods = {
getList() { getList() {
data.pageState = "loading"; data.pageState = "loading";
proxy.$request("/AppletCenter/GetMyAppointPageList",data.msg).then(res => { proxy.$request("/AppletCenter/GetMyAppointPageList", data.msg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
if (data.timer) data.timer = null; if (data.timer) data.timer = null;
data.PageCount = res.Data.PageCount; data.PageCount = res.Data.PageCount;
if (data.msg.pageIndex === 1) { if (data.msg.pageIndex === 1) {
data.List = res.Data.PageData; data.List = res.Data.PageData;
} else { } else {
data.List = [...data.List,...res.Data.PageData]; data.List = [...data.List, ...res.Data.PageData];
} }
if (data.msg.pageIndex >= res.Data.PageCount) { if (data.msg.pageIndex >= res.Data.PageCount) {
data.pageState = "none"; data.pageState = "none";
} else { } else {
data.pageState = "more"; data.pageState = "more";
} }
} }
}) })
}, },
lower(e) { lower(e) {
if (data.msg.pageIndex < data.PageCount) { if (data.msg.pageIndex < data.PageCount) {
data.pageState = "loading"; data.pageState = "loading";
if (data.timer) clearTimeout(data.timer); if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => { data.timer = setTimeout(() => {
data.msg.pageIndex++; data.msg.pageIndex++;
that.getList(); that.getList();
}, 1000); }, 1000);
} else { } else {
data.pageState = "none"; data.pageState = "none";
} }
}, },
getState(){ getState() {
proxy.$request("/AppletCenter/GetCourseAppointStateEnumList",{}).then(res => { proxy.$request("/AppletCenter/GetCourseAppointStateEnumList", {}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
data.stateList = res.Data data.stateList = res.Data
data.stateList.unshift({ data.stateList.unshift({
Id:0,Name:'全部' Id: 0,
Name: '全部'
}) })
} }
}) })
}, },
getTeacherList(){ getTeacherList() {
proxy.$request("/AppletCenter/GetTeacherList",{}).then(res => { proxy.$request("/AppletCenter/GetTeacherList", {}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
data.TeacherList = res.Data data.TeacherList = res.Data
data.TeacherList.unshift({ data.TeacherList.unshift({
TeacherName:'不限', TeacherName: '不限',
TId:0 TId: 0
}) })
data.allTeacherList = JSON.parse(JSON.stringify(res.Data)) data.allTeacherList = JSON.parse(JSON.stringify(res.Data))
} }
}) })
}, },
choice(x){//老师选择 choice(x) { //老师选择
data.msg.TeacherId = x.TId; data.msg.TeacherId = x.TId;
data.popupshow = false; data.popupshow = false;
data.value = ''; data.value = '';
data.TeacherList = JSON.parse(JSON.stringify(data.allTeacherList)) data.TeacherList = JSON.parse(JSON.stringify(data.allTeacherList))
data.TeacherName=x.TeacherName data.TeacherName = x.TeacherName
}, },
onSearch(val){ onSearch(val) {
if (!val.detail) { if (!val.detail) {
data.TeacherList = JSON.parse(JSON.stringify(data.allTeacherList)) data.TeacherList = JSON.parse(JSON.stringify(data.allTeacherList))
} else { } else {
...@@ -307,20 +481,22 @@ ...@@ -307,20 +481,22 @@
}) })
} }
}, },
changeTab(e){ changeTab(e) {
data.msg.State = e.detail.name; data.msg.State = e.detail.name;
data.msg.pageIndex = 1; data.msg.pageIndex = 1;
that.getList(); that.getList();
}, },
goquxiao(x){ goquxiao(x) {
data.show = true; data.show = true;
data.AppointId = x.Id data.AppointId = x.Id
}, },
quedquxiao(){ quedquxiao() {
uni.showLoading({ uni.showLoading({
title:'取消中...' title: '取消中...'
}) })
proxy.$request("/AppletCenter/CancelAppointment",{AppointId:data.AppointId}).then(res => { proxy.$request("/AppletCenter/CancelAppointment", {
AppointId: data.AppointId
}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
uni.hideLoading() uni.hideLoading()
data.show = false; data.show = false;
...@@ -329,33 +505,62 @@ ...@@ -329,33 +505,62 @@
} }
}) })
}, },
onConfirm(val){ onConfirm(val) {
data.getCurrentDate = val.detail; data.getCurrentDate = val.detail;
let curdate = new Date(val.detail); let curdate = new Date(val.detail);
let year = curdate.getFullYear(); let year = curdate.getFullYear();
let month = curdate.getMonth() < 9 ? "0" + (curdate.getMonth() + 1) : curdate.getMonth() + 1 let month = curdate.getMonth() < 9 ? "0" + (curdate.getMonth() + 1) : curdate.getMonth() + 1
let day = curdate.getDate() < 9 ? "0" + (curdate.getDate() ) : curdate.getDate() let day = curdate.getDate() < 9 ? "0" + (curdate.getDate()) : curdate.getDate()
data.msg.StartTime = year + "-" + month+'-'+day; data.msg.StartTime = year + "-" + month + '-' + day;
data.showdatePopup = false data.showdatePopup = false
}, },
onConfirm2(val){ onConfirm2(val) {
data.getCurrentDate2 = val.detail; data.getCurrentDate2 = val.detail;
let curdate = new Date(val.detail); let curdate = new Date(val.detail);
let year = curdate.getFullYear(); let year = curdate.getFullYear();
let month = curdate.getMonth() < 9 ? "0" + (curdate.getMonth() + 1) : curdate.getMonth() + 1 let month = curdate.getMonth() < 9 ? "0" + (curdate.getMonth() + 1) : curdate.getMonth() + 1
let day = curdate.getDate() < 9 ? "0" + (curdate.getDate() ) : curdate.getDate() let day = curdate.getDate() < 9 ? "0" + (curdate.getDate()) : curdate.getDate()
data.msg.EntTime = year + "-" + month+'-'+day; data.msg.EntTime = year + "-" + month + '-' + day;
data.showdatePopup2 = false data.showdatePopup2 = false
}, },
search(){ search() {
data.msg.pageIndex=1 data.msg.pageIndex = 1
this.getList() this.getList()
data.popupshow2=false data.popupshow2 = false
},
getWeek(d){
const date=new Date(d)
const week = date.getDay()
let weekStr=""
switch (week) {
case 0:
weekStr = '星期天';
break;
case 1:
weekStr = '星期一';
break;
case 2:
weekStr = '星期二';
break;
case 3:
weekStr = '星期三';
break;
case 4:
weekStr = '星期四';
break;
case 5:
weekStr = '星期五';
break;
case 6:
weekStr = '星期六';
break;
}
return weekStr
} }
} }
onMounted(() => { onMounted(() => {
}) })
let that = methods; let that = methods;
return { return {
...@@ -364,19 +569,17 @@ ...@@ -364,19 +569,17 @@
}; };
}, },
onShow() { onShow() {
}, },
onLoad() { onLoad() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "约课记录", title: "约课记录",
}); });
this.getState() this.getState()
this.getTeacherList() this.getTeacherList()
this.getList() this.getList()
}, },
} }
</script> </script>
...@@ -45,11 +45,12 @@ ...@@ -45,11 +45,12 @@
</view> </view>
<view class="courseInfo"> <view class="courseInfo">
<view class="title">课程信息</view>
<view style="display: flex;justify-content: space-between;"> <view style="display: flex;justify-content: space-between;">
<view class="title">课程信息</view>
<view class="title" @click="jumpPage(`/pages/appointment/mySubscribe`)"> <!-- <view class="title" @click="jumpPage(`/pages/appointment/mySubscribe`)">
约课记录 约课记录
</view> </view> -->
</view> </view>
<view class="statistic"> <view class="statistic">
...@@ -77,6 +78,11 @@ ...@@ -77,6 +78,11 @@
</view> </view>
<view class="statisticName">请假课时</view> <view class="statisticName">请假课时</view>
</view> </view>
<view class="statisticItem" @click="jumpPage(`/pages/appointment/mySubscribe`)">
<view class="time">{{yuyueNum}}
</view>
<view class="statisticName">约课记录</view>
</view>
</view> </view>
<view class="courseBox"> <view class="courseBox">
<view class="left"> <view class="left">
...@@ -176,6 +182,7 @@ ...@@ -176,6 +182,7 @@
pageData: { pageData: {
AssistList: [] AssistList: []
}, },
yuyueNum:0
}); });
const methods = { const methods = {
jumpPage(url) { jumpPage(url) {
...@@ -193,6 +200,22 @@ ...@@ -193,6 +200,22 @@
phoneNumber: num, phoneNumber: num,
}); });
}, },
getyuyue() {
const msg={
pageIndex: 1,
pageSize: 1,
StartTime: '',
EntTime: '',
State: 0,
TeacherId: 0,
}
proxy.$request("/AppletCenter/GetMyAppointPageList", msg).then(res => {
if (res.Code == 1) {
data.yuyueNum=res.Data.Count
}
})
},
}; };
let that = methods; let that = methods;
return { return {
...@@ -203,6 +226,7 @@ ...@@ -203,6 +226,7 @@
onShow() { onShow() {
if (this.$isLogin()) { if (this.$isLogin()) {
this.getData(); this.getData();
this.getyuyue()
} }
} }
}; };
...@@ -300,16 +324,18 @@ ...@@ -300,16 +324,18 @@
.statistic { .statistic {
/* height: 70rpx; */ /* height: 70rpx; */
display: flex; display: flex;
justify-content: space-between;
margin-bottom: 70rpx; margin-bottom: 70rpx;
} }
.statisticItem { .statisticItem {
min-width: 80rpx; width: 180rpx;
/* height: 70rpx; */ /* height: 70rpx; */
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
align-content: space-between; align-content: space-between;
margin-right: 100rpx; /* margin-right: 100rpx; */
flex-shrink: 1;
} }
.statisticItem .time { .statisticItem .time {
...@@ -334,6 +360,7 @@ ...@@ -334,6 +360,7 @@
font-weight: 500; font-weight: 500;
color: #666666; color: #666666;
white-space: nowrap; white-space: nowrap;
text-align: center;
} }
.courseBox { .courseBox {
......
...@@ -74,11 +74,8 @@ ...@@ -74,11 +74,8 @@
<van-toast id="van-toast" /> <van-toast id="van-toast" />
<view class="btnfixed"> <view class="btnfixed">
<image @click="goappointment" <image @click="goappointment"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/book.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/yuyuebtn.png"
mode="widthFix"></image> mode="widthFix"></image>
<view style="font-size: 22rpx;color: #4C50E7;text-align: center;">
约课
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -591,7 +588,7 @@ ...@@ -591,7 +588,7 @@
} }
.btnfixed image { .btnfixed image {
width: 30px; width: 50px;
height: auto; height: auto;
} }
</style> </style>
...@@ -72,7 +72,7 @@ export let getdate = (time, tomorrow) => { ...@@ -72,7 +72,7 @@ export let getdate = (time, tomorrow) => {
let d = year + "-" + month + '-' + day let d = year + "-" + month + '-' + day
return d return d
} }
export let DateFormat = (time, separator='-') => { export let DateFormat = (time=null, separator='-') => {
let date = new Date(time) let date = new Date(time)
let year = date.getFullYear() let year = date.getFullYear()
let month = date.getMonth() < 9 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 let month = date.getMonth() < 9 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
......
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