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)
......
This diff is collapsed.
...@@ -45,11 +45,12 @@ ...@@ -45,11 +45,12 @@
</view> </view>
<view class="courseInfo"> <view class="courseInfo">
<view style="display: flex;justify-content: space-between;">
<view class="title">课程信息</view> <view class="title">课程信息</view>
<view class="title" @click="jumpPage(`/pages/appointment/mySubscribe`)"> <view style="display: flex;justify-content: space-between;">
<!-- <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