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

2

parent 86f477e1
......@@ -97,8 +97,7 @@
@click="checkCourseType2(item)">
预约
</view>
<view class="yuyueBtn" style="opacity: 0.5;" v-if="item[0].State==4"
@click="checkCourseType2(item)">
<view class="yuyueBtn" style="opacity: 0.5;" v-if="item[0].State==4">
已预约
</view>
</view>
......@@ -173,7 +172,8 @@
onMounted
} from 'vue'
import {
DateFormat
DateFormat,
getToday
} from '../../utils/date.js'
import Navbar from '../../components/navbar.vue'
export default {
......@@ -209,6 +209,7 @@
data.isShowCalendar = false
this.getDateData(val.detail)
data.msg.Date = DateFormat(val.detail)
data.current=0
this.getTeacherList()
console.log(86, data.msg.Date)
},
......@@ -324,6 +325,29 @@
})
},
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 RemainTime = data.basics.NextAppointMinutes - curCourse.Minutes //剩余课时
const ShiftSortArr = [curCourse]
......@@ -371,6 +395,28 @@
}
},
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) => {
return cur.Minutes + pre
}, 0)
......
This diff is collapsed.
......@@ -45,11 +45,12 @@
</view>
<view class="courseInfo">
<view class="title">课程信息</view>
<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 class="statistic">
......@@ -77,6 +78,11 @@
</view>
<view class="statisticName">请假课时</view>
</view>
<view class="statisticItem" @click="jumpPage(`/pages/appointment/mySubscribe`)">
<view class="time">{{yuyueNum}}
</view>
<view class="statisticName">约课记录</view>
</view>
</view>
<view class="courseBox">
<view class="left">
......@@ -176,6 +182,7 @@
pageData: {
AssistList: []
},
yuyueNum:0
});
const methods = {
jumpPage(url) {
......@@ -193,6 +200,22 @@
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;
return {
......@@ -203,6 +226,7 @@
onShow() {
if (this.$isLogin()) {
this.getData();
this.getyuyue()
}
}
};
......@@ -300,16 +324,18 @@
.statistic {
/* height: 70rpx; */
display: flex;
justify-content: space-between;
margin-bottom: 70rpx;
}
.statisticItem {
min-width: 80rpx;
width: 180rpx;
/* height: 70rpx; */
display: flex;
flex-wrap: wrap;
align-content: space-between;
margin-right: 100rpx;
/* margin-right: 100rpx; */
flex-shrink: 1;
}
.statisticItem .time {
......@@ -334,6 +360,7 @@
font-weight: 500;
color: #666666;
white-space: nowrap;
text-align: center;
}
.courseBox {
......
......@@ -74,11 +74,8 @@
<van-toast id="van-toast" />
<view class="btnfixed">
<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>
<view style="font-size: 22rpx;color: #4C50E7;text-align: center;">
约课
</view>
</view>
</view>
</template>
......@@ -591,7 +588,7 @@
}
.btnfixed image {
width: 30px;
width: 50px;
height: auto;
}
</style>
......@@ -72,7 +72,7 @@ export let getdate = (time, tomorrow) => {
let d = year + "-" + month + '-' + day
return d
}
export let DateFormat = (time, separator='-') => {
export let DateFormat = (time=null, separator='-') => {
let date = new Date(time)
let year = date.getFullYear()
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