Commit 9229c6e7 authored by 罗超's avatar 罗超

2

parent 9a558d23
......@@ -138,16 +138,7 @@
}
},
{
"path": "list"
},
{
"path": "mySubscribe"
},
{
"path": "timeSlot"
},
{
"path": "record"
"path": "mySubscribe"//约课记录
}
]
}
......
......@@ -2,6 +2,7 @@
<view class="">
<Navbar>
<view class="navbar">
<van-icon name="arrow-left" size="36rpx" @click="back"/>
<i class="iconfont icon-calendar" style="font-size: 60rpx;" @click="isShowCalendar=true"></i>
<view class="dateStr">
{{dateStr}}
......@@ -35,33 +36,36 @@
</swiper-item>
</swiper>
</view>
<van-calendar :show="isShowCalendar" @close="isShowCalendar=false" @confirm="onConfirmCalendar" />
<view class="top">
<van-calendar :show="isShowCalendar" @close="isShowCalendar=false" :minDate="minDateStr" :maxDate="maxDateStr"
@confirm="onConfirmCalendar" />
<view class="top" v-if="courselist.length>0">
<view class="topinfo">
<text>当前预约课程</text>
<text @click="goappointment">更多预约</text>
<text>下次预约课程</text>
<text @click="goRecord">更多预约</text>
</view>
<view class="topinfoCourse">
A1地3.1.2《+しのかぞく》
</view>
<view class="CourseTime">
(4课时.180分钟)
<text v-if="basics.IsNextAppoint">{{basics.CourseName||'暂无'}}</text>
<text v-else>课程已约完</text>
</view>
<view class="borderB">
<view class="CourseTime" v-if="basics.IsNextAppoint">
({{basics.NextClassHours||0}}课时.{{basics.NextAppointMinutes||0}}分钟)
</view>
<view class="borderB"></view>
</view>
<view class="list" v-if="courselist.length>0">
<view class="list" v-if="courselist.length>0&&basics.IsNextAppoint">
<view v-for="(item,index) in courselist" :key="index">
<view class="type2box" v-if="Array.isArray(item)">
<view v-for="(_item,_index) in item" :key="_index" class="type2">
<view class="left">
<text class="leftItem" style="color: #111111;">{{item.StartTime}}</text>
<text class="leftItem" style="color: #111111;">{{_item.StartTime}}</text>
<i class="iconfont icon-moreandroid leftItem"></i>
<text class="leftItem">{{_item.EndTime}}</text>
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coffee.png"
mode="" style="width: 38rpx;height: 38rpx;position: absolute;left:50%;transform: translateX(-50%);bottom: -8rpx;z-index:1" v-if="_index!==item.length-1"></image>
mode=""
style="width: 38rpx;height: 38rpx;position: absolute;left:50%;transform: translateX(-50%);bottom: -8rpx;z-index:1"
v-if="_index!==item.length-1"></image>
</view>
<view class="right">
<view class="classroom" style="width: 100%;">
......@@ -77,9 +81,8 @@
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/book.png"
mode="" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;"></image>
A1的3.1.1《かぞく》
{{_item.Description||''}}
</view>
</view>
</view>
......@@ -88,11 +91,16 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/people.png"
mode="" style="width: 30rpx;height: 30rpx;"></image>
<view class="yuyueNum">
已报6
已报{{item[0].PeopleNum||0}}
</view>
<view class="yuyueBtn">
<view class="yuyueBtn" v-if="item[0].State===0||item[0].State==3"
@click="checkCourseType2(item)">
预约
</view>
<view class="yuyueBtn" style="opacity: 0.5;" v-if="item[0].State==4"
@click="checkCourseType2(item)">
已预约
</view>
</view>
</view>
......@@ -116,24 +124,43 @@
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/people.png"
mode="" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;"></image>
已报6
已报{{item.PeopleNum||0}}
</view>
</view>
<view class="yuyueBtn">
<view class="yuyueBtn" v-if="item.State===0||item.State==3" @click="checkCourse(index)">
预约
</view>
<view class="yuyueBtn" style="opacity: 0.5;" v-if="item.State==4">
已预约
</view>
</view>
</view>
<view class="" v-if="courselist.length!==0">
<image
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/noCourse.png"
mode="" style="width: 166rpx;height: 166rpx;"></image>
<view class="">
</view>
<view class="noCourse" v-if="courselist.length==0&&basics.IsNextAppoint">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/noCourse.png" mode=""
style="width: 166rpx;height: 166rpx;"></image>
<view class="noCourseText">
暂无可约课程
</view>
</view>
<van-overlay :show="showlay" :lockScroll="false">
<view class="laybox">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/yuyuesuccess.png" mode="widthFix" style="width: 100%;height: 162rpx;border-radius: 24rpx 24rpx 0 0;"></image>
<view class="layboxTitle">
预约成功
</view>
<view class="layboxBtn1" @click="goRecord(),showlay=false">
查看课表
</view>
<view class="layboxBtn2" @click="showlay=false">
继续预约
</view>
<view class="layboxBtn3" @click="goIndex">
返回首页
</view>
</view>
</van-overlay>
</view>
</template>
......@@ -145,6 +172,9 @@
getCurrentInstance,
onMounted
} from 'vue'
import {
DateFormat
} from '../../utils/date.js'
import Navbar from '../../components/navbar.vue'
export default {
components: {
......@@ -157,17 +187,14 @@
} = getCurrentInstance()
const data = reactive({
isShowCalendar: false,
showlay:false,
date: "2月1号",
dateStr: "",
year: "",
minDateStr: new Date().getTime(),
maxDateStr: new Date().getTime(),
current: 0,
teacherList: [{
name: '张三'
}, {
name: '李四'
}, {
name: '王五'
}],
teacherList: [],
msg: {
Date: props.day,
School_Id: '-1',
......@@ -181,6 +208,9 @@
onConfirmCalendar(val) {
data.isShowCalendar = false
this.getDateData(val.detail)
data.msg.Date = DateFormat(val.detail)
this.getTeacherList()
console.log(86, data.msg.Date)
},
getDateData(d) {
let date = new Date()
......@@ -221,30 +251,9 @@
changeSwiper(val) {
data.current = val.detail.current
data.courselist = data.teacherList[val.detail.current].CourseTimeList
data.courselist.push({
name:1,
SortIdentify:1
})
data.courselist.push({
name:2,
SortIdentify:1
})
data.courselist.push({
name:3,
SortIdentify:1
})
data.courselist.push({
name:4,
SortIdentify:2
})
data.courselist.push({
name:5,
SortIdentify:2
})
data.schoolName = data.teacherList[val.detail.current].SchoolName
data.roomName = data.teacherList[val.detail.current].RoomName
methods.courseGroup()
console.log('课程', data.courselist)
},
getTeacherList() {
uni.showLoading({
......@@ -258,6 +267,8 @@
data.schoolName = data.teacherList[0].SchoolName
data.roomName = data.teacherList[0].RoomName
methods.courseGroup()
} else {
data.courselist = []
}
uni.hideLoading()
}
......@@ -286,20 +297,129 @@
proxy.$request("/AppletCenter/GetScrollAppointmentBaseInfo", {}).then(res => {
if (res.Code == 1) {
data.basics = res.Data;
// that.judge()
const date = new Date()
const y = date.getFullYear()
const m = date.getMonth() + 1
const d = date.getDate()
const maxStr = y + '-' + m + '-' + (d + res.Data.AppointDay - 1)
data.maxDateStr = new Date(maxStr).getTime()
if (res.Data.AdvanceDay) {
const minStr = y + '-' + m + '-' + (d + res.Data.AdvanceDay)
data.minDateStr = new Date(minStr).getTime()
this.getDateData(minStr)
data.msg.Date = minStr
}
this.getTeacherList()
}
})
},
goappointment() {
// let day = currentDate.value + '-' + activeDay.value;
goRecord() {
uni.navigateTo({
url: '/pages/appointment/list',
url: '/pages/appointment/mySubscribe',
});
},
goIndex(){
uni.switchTab({
url:'/pages/index/index'
})
},
checkCourse(index) {
let curCourse = data.courselist[index]
let RemainTime = data.basics.NextAppointMinutes - curCourse.Minutes //剩余课时
const ShiftSortArr = [curCourse]
if (RemainTime > 0) {
if (index + 1 == data.courselist.length) {
uni.showToast({
icon: 'none',
title: "课时不足,请预约其他时间段"
})
return
} else {
this.mapNextCourse(index, ShiftSortArr, RemainTime)
}
} else if (RemainTime == 0) {
this.subscribe()
} else {
uni.showToast({
icon: 'none',
title: "课时不匹配,请预约其他时间段"
})
}
},
mapNextCourse(index, ShiftSortArr = [], RemainTime) {
let nexIndex = index + 1
let nexCourse = data.courselist[nexIndex]
if (!Array.isArray(nexCourse)) {
let RemainTime2 = RemainTime - nexCourse.Minutes //剩余课时
ShiftSortArr.push(nexCourse)
if (RemainTime2 === 0) {
this.subscribe(ShiftSortArr)
} else if (RemainTime2 > 0) {
this.mapNextCourse(nexIndex, ShiftSortArr, RemainTime2)
} else {
uni.showToast({
icon: 'none',
title: "课时不匹配,请预约其他时间段"
})
}
} else {
uni.showToast({
icon: 'none',
title: "课时不匹配,请预约其他时间段"
})
}
},
checkCourseType2(item) {
let total = item.reduce((pre, cur) => {
return cur.Minutes + pre
}, 0)
if (data.basics.NextAppointMinutes == total) {
this.subscribe(item)
} else {
uni.showToast({
icon: 'none',
title: "课时不匹配,请预约其他时间段"
})
}
},
subscribe(ShiftSortArr) { //立即预约
const techerInfo = data.teacherList[data.current]
const obj = {
Date: data.msg.Date,
AccountId: techerInfo.AccountId,
TeacherId: techerInfo.TeacherId,
ShiftSort: ShiftSortArr.map(e => e.Sort).toString(),
CourseId: data.basics.CourseId,
ChapterNo: data.basics.NextAppointChapterNo,
}
uni.requestSubscribeMessage({
tmplIds: data.basics.TempleteList,
success(res) {
proxy.$request("/AppletCenter/SetScrollAppointment", obj).then(res => {
if (res.Code == 1) {
methods.getBaseInfo()
data.showlay=true
}
})
},
fail() {
uni.showToast({
icon: 'none',
title: "订阅失败,请重新预约"
})
}
})
},
back(){
uni.navigateBack({
delta: 1
});
}
}
onMounted(() => {
methods.getDateData()
methods.getTeacherList()
// methods.getTeacherList()
methods.getBaseInfo()
})
return {
......@@ -419,13 +539,15 @@
font-weight: 800;
color: #FFFFFF;
margin-bottom: 4rpx;
white-space: nowrap;
overflow-x: auto;
}
.top .borderB {
position: absolute;
bottom: 0rpx;
left: -18rpx;
z-index: 2;
/* z-index: 2; */
width: 95vw;
height: 25rpx;
border-radius: 12rpx;
......@@ -532,7 +654,8 @@
background-color: #4C50E7;
border-radius: 25rpx;
}
.type2box{
.type2box {
width: 678rpx;
margin: 0 auto;
border-radius: 16rpx;
......@@ -541,6 +664,7 @@
box-sizing: border-box;
position: relative;
}
.type2 {
width: 100%;
height: 196rpx;
......@@ -597,21 +721,26 @@
font-family: PingFang SC;
font-weight: 500;
color: #888888;
white-space: nowrap;
overflow-x: auto;
}
.type2box .yuyueBox{
.type2box .yuyueBox {
position: absolute;
right: 35rpx;
top: 50%;
transform: translateY(-50%);
text-align: center;
}
.type2box .yuyueNum{
.type2box .yuyueNum {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #888888;
margin-bottom: 20rpx;
}
.type2box .yuyueBtn {
font-size: 20rpx;
......@@ -627,4 +756,74 @@
background-color: #4C50E7;
border-radius: 25rpx;
}
.noCourse {
margin-top: 25vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.noCourseText {
width: 100%;
text-align: center;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
margin-top: 10rpx;
}
.laybox{
width: 462rpx;
height: 607rpx;
background-color: #FFFFFF;
border-radius: 24rpx;
position: fixed;
top: 50%;
left: 50%;
z-index: 9;
transform: translate(-50%,-50%);
}
.laybox .layboxTitle{
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
text-align: center;
margin-top: 20rpx;
}
.laybox .layboxBtn1{
width: 292rpx;
height: 80rpx;
background-color: #4C50E7;
border-radius: 40rpx;
margin: 30rpx auto;
text-align: center;
line-height: 80rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.laybox .layboxBtn2{
width: 292rpx;
height: 80rpx;
background-color: #E4E5FB;
border-radius: 40rpx;
margin: 30rpx auto;
text-align: center;
line-height: 80rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #4C50E7;
}
.laybox .layboxBtn3{
text-align: center;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #BBBCCE;
margin-top: 30rpx;
}
</style>
<style scoped>
.Appointmentlist{
width: 100%;
height: 100vh;
}
.row{
display: flex;
align-items: center;
}
.basics-block{
width: 50%;
box-sizing: border-box;
padding-left: 10rpx;
text-align: left;
font-size: 26rpx;
}
.box-top{
display: flex;
box-shadow: 0 4rpx 24rpx rgba(100,101,102,.12);
height: 100rpx;
background: #FFF;
}
.box-top-item{
width: 50%;
justify-content: center;
font-size: 13px;
}
.ellipsis{
max-width: 80%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.center{
width: 100%;
margin-top: 15px;
padding: 0 15px;
box-sizing: border-box;
}
.center-box{
border-radius: 6px;
padding: 15px;
box-shadow: 0px 3px 6px 0px rgba(139, 115, 64, 0.16);
}
.center-top{
border-bottom: 1px solid #E2E2E2;
align-items: flex-start;
}
.basics{
width: 100%;
height: 200rpx;
background: #F5F6F7;
padding: 10px 15px;
box-sizing: border-box;
}
.basics-box{
box-sizing: border-box;
border-radius: 6px;
background: #FFF;
padding: 10px;
font-size: 13px;
color: #111;
height: 100%;
display: flex;
flex-wrap: wrap;
align-content: space-around;
}
</style>
<template>
<div class="Appointmentlist">
<view class="basics">
<view class="basics-box">
<view class="row basics-block" >
提前几天预约:{{basics.AdvanceDay||0}}
</view>
<view class="row basics-block">
可预约时间:{{basics.ScrollETime||'无'}}
</view>
<view class="row basics-block">
可预约的天数:{{basics.AppointDay||0}}
</view>
<view class="row basics-block">
是否可以继续预约:{{basics.IsNextAppoint?'是':'否'}}
</view>
</view>
</view>
<view class="box-top">
<view class="box-top-item row" @click="getscreen(1)">
<view class="ellipsis">
{{msg.Date}}
</view>
<van-icon name="arrow-down" size='12' style='margin-left: 5px;'/>
</view>
<picker mode="selector" range-key="SName" style="width: 50%;"
:range="schoolList" @change="getCutomTypeCheck">
<view class="box-top-item row" style="width: 100%;height: 100rpx;" >
<view class="ellipsis">
{{SchoolName}}
</view>
<van-icon name="arrow-down" size='12' style='margin-left: 5px;'/>
</view>
</picker>
</view>
<view v-if="dataList && dataList.length>0">
<scroll-view :scroll-y="true" style="height: calc(100vh - 100rpx - 200rpx);width: calc(100vw);">
<view class="center" v-for='(x,y) in dataList' :key = 'y' @click="gotimelist(x)">
<view class="center-box">
<view class="center-top row">
<image :src='x.TeacherHead' mode="aspectFill" style="width:38px ;height: 38px;border-radius: 50%;"></image>
<view style="margin-left: 15px;padding-bottom:10px ;">
<div style="font-size: 13px;color: #111;font-weight: bold">{{x.TeacherName}}</div>
<div style="font-size: 11px;color: #666;margin-top: 4px;">{{x.SchoolName}}</div>
<div style="font-size: 11px;color: #666;margin-top: 4px;">{{x.RoomName}}</div>
</view>
</view>
<view style="padding: 10px 0;font-size: 12px;color: #111;">
<view style="font-weight: bold;">个人简介</view>
<view style="margin-top: 5px;">暂时没的其他的</view>
</view>
</view>
</view>
<view style="width: 100%;height: 20px;"></view>
</scroll-view>
</view>
<view v-else>
<van-empty description="暂无约课老师" />
</view>
<van-calendar :show="dateshow" color="#2961fe" @confirm="onConfirm" :default-date='defaultDate' @close='dateshow=false'/>
</div>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
provide,
} from "vue";
export default {
components: {
},
props:['day'],
setup(props) {
let {
proxy
} = getCurrentInstance();
let data = reactive({
dateshow:false,
msg:{
Date:props.day,
School_Id:'-1',
},
SchoolName:'不限校区',
schoolList:[],
dataList:[],//数据list
basics:{},//基础信息
defaultDate:new Date(props.day).getTime()
})
let methods = {
getscreen(type){
data.dateshow = true
},
onConfirm(e){
let date = new Date(e.detail)
let year = date.getFullYear()
let month = date.getMonth()+1;
month = month<10?'0'+month:month
let day = date.getDate();
day = day<10?'0'+day:day
data.msg.Date = year+'-'+month+'-'+day;
this.dateshow = false;
that.judge()
},
getschoolList(){
proxy.$request("/user/GetDropSchoolList", {}).then(res => {
if (res.Code == 1) {
data.schoolList = res.Data;
let obj = {
SId:'-1',
SName:'不限校区'
}
data.schoolList.unshift(obj)
}
})
},
getCutomTypeCheck(e){
let i = e.detail.value;
data.msg.School_Id= data.schoolList[i].SId
data.SchoolName = data.schoolList[i].SName;
that.judge()
},
getList(){
uni.showLoading({
title:'加载中...'
})
proxy.$request("/AppletCenter/GetScrollAppointmentTeacherList", data.msg).then(res => {
if (res.Code == 1) {
data.dataList =res.Data;
uni.hideLoading()
}
})
},
getBaseInfo(){
proxy.$request("/AppletCenter/GetScrollAppointmentBaseInfo",{}).then(res => {
if (res.Code == 1) {
data.basics = res.Data;
that.judge()
}
})
},
judge(){//判断
if(data.basics.IsNextAppoint==true){//是否可以预约
let differ = that.differday(data.msg.Date)
if(differ >=data.basics.AdvanceDay && data.basics.AppointDay >=differ){//提前几天预约 和可预约的天数
//TODO 还有一个时间判断 不知道咋个处理 ScrollETime
that.getList()
}else{
}
}
},
differday(startDate){//获取2个时间相隔多少天
var sdate = new Date(startDate.replace(/-/g, "/"));   
var now = new Date();   
var days = sdate.getTime() - now.getTime() ;   
var day = parseInt(days / (1000 * 60 * 60 * 24))+1;   
return day;
},
gotimelist(item){//跳转到时段页面
let obj={
item:item,
basics:data.basics,
Date:data.msg.Date
}
console.log(obj)
// JSON.parse(decodeURIComponent(option.formData))
uni.navigateTo({//编码
url:'/pages/appointment/timeSlot?data='+encodeURIComponent(JSON.stringify(obj))
})
}
}
onMounted(() => {
})
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onShow() {
},
onLoad() {
uni.setNavigationBarTitle({
title: "约课老师",
});
this.getschoolList()//获取学校下拉
this.getBaseInfo()//获取学员基础信息
},
}
</script>
......@@ -11,10 +11,11 @@
box-sizing: border-box;
}
.box-item{
border-radius: 6px;
padding: 15px;
border-radius: 12rpx;
box-sizing: border-box;
padding: 30rpx;
background: #FFF;
font-size: 14px;
font-size: 24rpx;
}
.row{
display: flex;
......@@ -30,24 +31,39 @@
background: #FFF;
height: 100vh;
box-sizing: border-box;
position: relative;
}
.popupBtnBox{
width: 100%;
box-sizing: border-box;
padding: 30rpx;
position: absolute;
left: 0;
bottom: 0;
display: flex;
justify-content: space-around;
align-items: center;
}
.popupBtn{
font-size: 30rpx;
color: #111;
}
.popupbox-c{
padding: 20rpx;
box-sizing: border-box;
}
.popupbox-list{
height: 45px;
height: 90rpx;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
font-size: 13px;
font-size: 26rpx;
color: #555555;
box-sizing: border-box;
}
.popupbox-item{
justify-content: space-between;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
height: 50px;
height: 100rpx;
}
</style>
<template>
......@@ -63,35 +79,35 @@
>
<van-tab :title="x.Name" :name="x.Id" v-for="(x,y) in stateList" :key='y'></van-tab>
</van-tabs>
<view class="onetext" style="width: 140rpx;background: #FFF;height: 44px;line-height: 44px;text-align: center;" @click="popupshow2=true">
老师
<view class="onetext" style="width: 100rpx;background: #FFF;height: 88rpx;display: flex;align-items: center;justify-content: center;" @click="popupshow2=true">
<van-icon name="bars" size="44rpx"/>
</view>
</view>
<view v-if="List.length>0">
<scroll-view :scroll-y="true" style="height: calc(100vh - 150rpx );width: calc(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="box-item">
<view class="row" style="justify-content: space-between;line-height: 30px;">
<view class="row" style="justify-content: space-between;font-size: 30rpx;line-height: 60rpx;margin-bottom: 20rpx;">
<span>{{x.Date}}</span>
<span>{{x.StateName}}</span>
</view>
<view class="row" style="align-items: flex-start;">
<image :src='x.TeacherHead' mode="aspectFill" style="width:38px ;height: 38px;border-radius: 50%;"></image>
<view style="margin-left: 15px;padding-bottom:10px ;">
<div style="font-size: 13px;color: #111;font-weight: bold">{{x.CourseName}}</div>
<div style="font-size: 11px;color: #666;margin-top: 4px;">{{x.TeacherName}}</div>
<div style="font-size: 11px;color: #666;margin-top: 4px;">学生:{{x.StuName}}</div>
<div style="font-size: 11px;color: #666;margin-top: 4px;">{{x.ChapterNo}}次课</div>
<image :src='x.TeacherHead' mode="aspectFill" style="width:76rpx ;height: 76rpx;border-radius: 50%;"></image>
<view style="margin-left: 30rpx;padding-bottom:20rpx ;">
<div style="font-size: 26rpx;color: #111;font-weight: bold">{{x.CourseName}}</div>
<div style="font-size: 22rpx;color: #666;margin-top: 8rpx;">{{x.TeacherName}}</div>
<div style="font-size: 22rpx;color: #666;margin-top: 8rpx;">学生:{{x.StuName}}</div>
<div style="font-size: 22rpx;color: #666;margin-top: 8rpx;">{{x.ChapterNo}}次课</div>
</view>
</view>
<view >时间列表</view>
<view v-for="(item,index) in x.CourseTimeList">
<view v-for="(item,index) in x.CourseTimeList" :key="index">
<view class="row">
{{item.StartTime}}
<span style="margin: 0 5px;">-</span>
<span style="margin: 0 10rpx;">-</span>
{{item.EndTime}}
<span style='margin-left: 10px;'>{{item.Minutes}}分钟</span>
<span style='margin-left: 20rpx;'>{{item.Minutes}}分钟</span>
</view>
</view>
<view style="display: flex;justify-content: flex-end;" v-if="x.State == 1">
......@@ -99,7 +115,7 @@
</view>
</view>
</view>
<view style="width: 100%;height: 20px;"></view>
<view style="width: 100%;height: 40rpx;"></view>
</scroll-view>
</view>
<view v-else>
......@@ -128,9 +144,19 @@
<view class="popupbox-item row">
<span>老师</span>
<view class="row" @click="popupshow=true">
<span v-if="msg.EntTime==''" style="color: #999999;">请选择</span>
<span v-else >{{msg.EntTime}}</span>
<span v-if="msg.TeacherId==0" style="color: #999999;">请选择</span>
<span v-else >{{TeacherName}}</span>
</view>
</view>
<view class="popupBtnBox">
<!-- <view class="popupBtn">
取消
</view> -->
<van-button type="info" plain size="small" @click="popupshow2=false">取消</van-button>
<van-button type="info" size="small" @click="search">确定</van-button>
<!-- <view class="popupBtn">
确定
</view> -->
</view>
</view>
</van-popup>
......@@ -192,6 +218,7 @@
State:0,
TeacherId:0,
},
TeacherName:"",
pageState: "more",
PageCount: 0,
timer: null, //防抖
......@@ -256,6 +283,10 @@
proxy.$request("/AppletCenter/GetTeacherList",{}).then(res => {
if (res.Code == 1) {
data.TeacherList = res.Data
data.TeacherList.push({
TeacherName:'不限',
TeacherId:0
})
data.allTeacherList = JSON.parse(JSON.stringify(res.Data))
}
})
......@@ -265,6 +296,7 @@
data.popupshow = false;
data.value = '';
data.TeacherList = JSON.parse(JSON.stringify(data.allTeacherList))
data.TeacherName=x.TeacherName
},
onSearch(val){
if (!val.detail) {
......@@ -314,6 +346,11 @@
let day = curdate.getDate() < 9 ? "0" + (curdate.getDate() ) : curdate.getDate()
data.msg.EntTime = year + "-" + month+'-'+day;
data.showdatePopup2 = false
},
search(){
data.msg.pageIndex=1
this.getList()
data.popupshow2=false
}
}
......@@ -331,7 +368,7 @@
},
onLoad() {
uni.setNavigationBarTitle({
title: "我的预约",
title: "约课记录",
});
this.getState()
......
<template>
<view class="">
<view class="box-top">
<view class="box-top-item flex" @click="showCalendar">
<view class="ellipsis">
<text v-if="date.length==2">{{date[0]}}-{{date[1]}}</text>
<text v-else>选择日期</text>
</view>
<van-icon name="arrow-down" size='12' style='margin-left: 5px;'/>
</view>
<picker mode="selector" range-key="Name" style="width: 50%;"
:range="stateList" @change="getState">
<view class="box-top-item flex" style="width: 100%;height: 100rpx;" >
<view class="ellipsis">
{{stateName}}
</view>
<van-icon name="arrow-down" size='12' style='margin-left: 5px;'/>
</view>
</picker>
</view>
<van-calendar
:show="isShowcalendar"
type="range"
@close="isShowcalendar=false"
@confirm="onConfirmCalendar"
/>
</view>
</template>
<script>
import { toRefs, reactive,getCurrentInstance} from 'vue'
import {DateFormat} from '../../utils/date.js'
export default{
setup(){
const data=reactive({
msg:{
State:1,
},
isShowcalendar:false,
date:[],
stateName:"不限",
stateList:[
{
Name:"待确认",
Id:1,
},
{
Name:"待上课",
Id:2
},{
Name:"已上课",
Id:3
},{
Name:"缺席",
Id:4
}
]
})
const methods={
showCalendar(){
data.isShowcalendar=true
},
getState(e){
let i = e.detail.value;
data.stateName=data.stateList[i].Name;
let id=data.stateList[i].Id
},
onConfirmCalendar(e){
data.isShowcalendar=false
let dateS = DateFormat(e.detail[0],'/')
let dateE = DateFormat(e.detail[1],'/')
data.date=[dateS,dateE]
console.log(68,data.date)
}
}
return{
...toRefs(data),
...methods
}
},
onLoad() {
uni.setNavigationBarTitle({
title:"约课记录"
})
}
}
</script>
<style scoped>
.flex{
display: flex;
align-items: center;
}
.box-top{
display: flex;
box-shadow: 0 4rpx 24rpx rgba(100,101,102,.12);
height: 100rpx;
background: #FFF;
}
.box-top-item{
width: 50%;
justify-content: center;
font-size: 13px;
}
.ellipsis{
font-size: 24rpx;
max-width: 80%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
<style scoped>
.timeSlot{
width: 100%;
height: 100vh;
}
.listbox{
width: 100%;
margin-top: 15px;
padding: 0 15px;
box-sizing: border-box;
}
.box-item{
border-radius: 6px;
padding: 15px;
box-shadow: 0px 3px 6px 0px rgba(139, 115, 64, 0.16);
font-size: 14px;
}
.row{
display: flex;
align-items: center;
}
.box-top{
width: 100%;
height: 26px;
font-size: 12px;
}
.btnbox{
width: 100%;
height: 150rpx;
background: #FFF;
box-sizing: border-box;
box-shadow: 3px 3px 6px 0px rgba(139, 115, 64, 0.16);
padding: 0 15px;
position: fixed;
left: 0;
bottom: 0;
}
.btn{
width: 110px;
height: 40px;
border-radius: 6px;
background-color: #0000ff;
font-size: 14px;
color: #FFF;
display: flex;
align-items: center;
justify-content: center;
}
</style>
<template>
<view class="timeSlot">
<view v-if="list.CourseTimeList.length>0">
<scroll-view :scroll-y="true" style="height: calc(100vh - 150rpx );width: calc(100vw);">
<view class="listbox" v-for='(x,y) in list.CourseTimeList' :key = 'y' >
<view class="box-item">
<view class="row box-top" style="justify-content: space-between;">
<view>
<van-checkbox :value="x.checked" @change="onChange(y)"></van-checkbox>
</view>
<view>
<span v-if='x.State==0'>可预约</span>
<span v-if='x.State==2'>不可预约</span>
<span v-if='x.State==3'>他人预约</span>
<span v-if='x.State==4'>我的预约</span>
</view>
</view>
<view class="row" style="line-height: 35px;justify-content: flex-end;">
{{x.StartTime}}
<span style="margin: 0 10px;">-</span>
{{x.EndTime}}
</view>
</view>
</view>
<view style="width: 100%;height: 20px;"></view>
</scroll-view>
</view>
<view v-else>
<van-empty description="暂无数据" />
</view>
<view class="btnbox row" style="justify-content: space-between;" >
<view>2</view>
<view class="btn" @click="subscribe">
立即预约
</view>
</view>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
provide,
} from "vue";
export default {
components: {
},
props:['data'],
setup(props) {
console.log(JSON.parse(decodeURIComponent(props.data)))
let {
proxy
} = getCurrentInstance();
let data = reactive({
basics:JSON.parse(decodeURIComponent(props.data)).basics,
list:JSON.parse(decodeURIComponent(props.data)).item,
Date:JSON.parse(decodeURIComponent(props.data)).Date
})
let methods = {
datahandle(){//进来的时候数据处理
console.log(data.list)
if(data.list.CourseTimeList && data.list.CourseTimeList.length>0){
data.list.CourseTimeList.forEach(x=>{
x.checked = false
})
}
},
onChange(index){
data.list.CourseTimeList[index].checked = !data.list.CourseTimeList[index].checked;
},
subscribe(){//立即预约
let ShiftSort = [];
let list = JSON.parse(JSON.stringify(data.list.CourseTimeList))
list.forEach(x=>{
if(x.checked == true){
ShiftSort.push(x.Sort)
}
})
ShiftSort= ShiftSort.join(',')
let obj ={
Date:data.Date,
AccountId:data.list.AccountId,
TeacherId:data.list.TeacherId,
ShiftSort:ShiftSort,
CourseId:data.basics.CourseId,
ChapterNo:data.basics.NextAppointChapterNo,
}
proxy.$request("/AppletCenter/SetScrollAppointment",obj).then(res => {
if (res.Code == 1) {
uni.showToast({
title:'保存成功',
icon:'none'
});
uni.redirectTo({
url:'/pages/appointment/mySubscribe'
})
}
})
}
}
onMounted(() => {
})
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onShow() {
},
onLoad() {
uni.setNavigationBarTitle({
title: "时段选择",
});
this.datahandle()
},
}
</script>
......@@ -43,11 +43,15 @@
</view>
</view>
</view>
<view class="" @click="jumpPage(`/pages/appointment/record`)">
约课记录
</view>
<view class="courseInfo">
<view style="display: flex;justify-content: space-between;">
<view class="title">课程信息</view>
<view class="title" @click="jumpPage(`/pages/appointment/mySubscribe`)">
约课记录
</view>
</view>
<view class="statistic">
<view class="statisticItem">
<view class="time">{{ pageData.CourseInfo.TotalHours||0 }}
......
......@@ -63,7 +63,7 @@
</swiper>
<view class="Timetable-box">
<view class="flex flex_center_center loading" v-if="loading">
<view class="flex flex_center_center" v-if="loading">
<van-loading size="48rpx" type="spinner">加载中...</van-loading>
</view>
<van-empty description="暂无课程" v-if="dataList.length === 0" />
......@@ -74,8 +74,11 @@
<van-toast id="van-toast" />
<view class="btnfixed">
<image @click="goappointment"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/jiaheb2b/checkDuplicate_btn.png"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/book.png"
mode="widthFix"></image>
<view style="font-size: 22rpx;color: #4C50E7;text-align: center;">
约课
</view>
</view>
</view>
</template>
......@@ -234,7 +237,7 @@
let methods = {
// 获取当天数据
async getData() {
// if(data.msg.ClassId<=0) return
if(data.msg.ClassId<=0) return
data.loading = true
let res = await getStundentPlanStatistical(data.msg);
data.loading = false
......@@ -244,7 +247,7 @@
},
//获取当月数据
async getAllData() {
// if(data.msg.ClassId<=0) return
if(data.msg.ClassId<=0) return
loadingS()
try {
let res = await getStundentPlanStatistical(data.msg);
......@@ -582,21 +585,13 @@
.btnfixed {
position: fixed;
right: 0px;
bottom: 92px;
right: 20rpx;
bottom: 92rpx;
z-index: 9999;
}
.btnfixed image {
width: 80px;
width: 30px;
height: auto;
}
.loading {
/* position: fixed;
top: 200rpx;
left: 50%;
z-index: 999;
transform: translateX(-50%); */
}
</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