Browse Source

feat(student): 优化学生端课程安排功能

- 新增获取全部场地列表的接口和相关功能- 修复和优化课程列表的展示逻辑
- 调整页面样式和布局,提升用户体验
master
liutong 10 months ago
parent
commit
5cbe12405f
  1. 8
      api/apiRoute.js
  2. 14
      pages/student/timetable/index.vue
  3. 73
      pages/student/timetable/list.vue

8
api/apiRoute.js

@ -531,7 +531,13 @@ export default {
}) })
}, },
//学生端-学生课程安排-获取学生排课的全部场地列表
xy_personCourseScheduleGetVenueListAll(data = {}) {
let url = '/xy/personCourseSchedule/getVenueListAll'
return http.get(url, data).then(res => {
return res;
})
},

14
pages/student/timetable/index.vue

@ -24,10 +24,10 @@
<view class="section_2"> <view class="section_2">
<view class="item_box"> <view class="item_box">
<text v-if="venuesInfo.id || ''">{{venuesInfo.name}}</text> <text v-if="(venuesInfo.id || '')">{{venuesInfo.venue_name}}</text>
</view> </view>
<view class="item_box" style="text-align: right;color: #F59A23;" @click="more"> <view class="item_box" style="text-align: right;color: #F59A23;" @click="more">
更多 更多场馆
</view> </view>
</view> </view>
@ -130,7 +130,7 @@ export default {
}, },
tableList: [],// tableList: [],//
venuesInfo: {},// venuesInfo: {id:''},//
// //
today: '', today: '',
@ -416,10 +416,10 @@ export default {
}, },
// //
more() { more() {
let schedule_date = this.filteredData.course_date let course_date = this.filteredData.course_date
let venue_id = this.venuesInfo.id//id let venue_id = this.venuesInfo.id || ''//id
uni.navigateTo({ uni.navigateTo({
url: `/pages/student/timetable/list?schedule_date=${schedule_date}&venue_id=${venue_id}` url: `/pages/student/timetable/list?course_date=${course_date}&venue_id=${venue_id}`
}) })
} }
} }
@ -512,8 +512,8 @@ export default {
padding: 0 20rpx ; padding: 0 20rpx ;
color: #fff; color: #fff;
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
gap: 20rpx;
.item_box { .item_box {
width: 45%; width: 45%;
.fui-filter__item { .fui-filter__item {

73
pages/student/timetable/list.vue

@ -4,11 +4,13 @@
<scroll-view scroll-y="true" :lower-threshold="lowerThreshold" <scroll-view scroll-y="true" :lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData" style="height: 100vh;"> @scrolltolower="loadMoreData" style="height: 100vh;">
<view class="data_hint" v-if="!this.tableList.length">暂无更多数据</view>
<view class="main_section" v-for="(v,k) in tableList" :key="k" @click="opebViewTimetable(v)"> <view class="main_section" v-for="(v,k) in tableList" :key="k" @click="opebViewTimetable(v)">
<view class="title">{{v.name}}</view> <view class="title">{{v.campus.campus_name}} </view>
<view class="con">{{v.address}}</view> <view class="con">{{v.campus.campus_address}} {{v.venue_name}}</view>
<view class="con" v-if="v.distance === null ">无法获取定位</view> <!-- <view class="con" v-if="v.distance === null ">无法获取定位</view>-->
<view class="con" v-else-if="v.distance">距您{{v.distance}}km</view> <!-- <view class="con" v-else-if="v.distance">距您{{v.distance}}km</view>-->
<view class="current-venue" v-if="venue_id == v.id"> <view class="current-venue" v-if="venue_id == v.id">
当前场馆 当前场馆
</view> </view>
@ -20,6 +22,7 @@
</template> </template>
<script> <script>
import apiRoute from '@/api/apiRoute.js';
import memberApi from '@/api/member.js'; import memberApi from '@/api/member.js';
import AQTabber from "@/components/AQ/AQTabber.vue" import AQTabber from "@/components/AQ/AQTabber.vue"
@ -34,12 +37,15 @@
lowerThreshold: 100,// lowerThreshold: 100,//
isReachedBottom: false,//|true=|false= isReachedBottom: false,//|true=|false=
memberInfo:{id:''},//
// //
filteredData:{ filteredData:{
// page:1,// // page:1,//
// limit:10,// // limit:10,//
// total:10,// // total:10,//
schedule_date:'',// course_date:'',//
resources_id:'',//ID
}, },
tableList:[],// tableList:[],//
@ -50,9 +56,9 @@
} }
}, },
onLoad(options) { onLoad(options) {
this.filteredData.schedule_date = options.schedule_date// this.filteredData.course_date = options.course_date//
//id //id
this.venue_id = options.venue_id || '' this.venue_id = options.venue_id || ''//ID
}, },
onShow() { onShow() {
this.init()// this.init()//
@ -60,10 +66,26 @@
methods: { methods: {
// //
async init() { async init() {
await this.getUserLocation(); // await this.getUserLocation();
await this.getMemberInfo();
await this.getList(); await this.getList();
}, },
//
async getMemberInfo() {
let res = await apiRoute.xy_memberInfo({})
if(res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.memberInfo = res.data
this.filteredData.resources_id = res.data.id
},
// //
async getUserLocation() { async getUserLocation() {
@ -142,16 +164,16 @@
let data = {...this.filteredData} let data = {...this.filteredData}
// //
if(this.filteredData.page * this.filteredData.limit > this.total){ // if(this.filteredData.page * this.filteredData.limit > this.total){
this.loading = false // this.loading = false
uni.showToast({ // uni.showToast({
title: '暂无更多', // title: '',
icon: 'none' // icon: 'none'
}) // })
return // return
} // }
let res = await memberApi.venuesList(data) let res = await apiRoute.xy_personCourseScheduleGetVenueListAll(data)
this.loading = false this.loading = false
this.isReachedBottom = false; this.isReachedBottom = false;
if (res.code != 1){ if (res.code != 1){
@ -165,9 +187,9 @@
this.tableList = res.data this.tableList = res.data
this.tableList.forEach((v,k)=>{ this.tableList.forEach((v,k)=>{
if(this.longitude && this.latitude && v.longitude && v.latitude){ if(this.longitude && this.latitude && (v.longitude || '') && (v.latitude || '')){
//
v.distance = this.getDistance(this.latitude, this.longitude, v.latitude, v.longitude) v.distance = this.getDistance(this.latitude, this.longitude, v.latitude, v.longitude)
}else{ }else{
v.distance = null v.distance = null
@ -175,11 +197,6 @@
}) })
console.log('列表',this.tableList) console.log('列表',this.tableList)
}, },
//- //-
@ -201,6 +218,12 @@
overflow: auto; overflow: auto;
background: #292929; background: #292929;
} }
.data_hint{
margin-top: 100rpx;
font-size: 30rpx;
text-align: center;
color: #fff;
}
.main_section{ .main_section{
width: 92%; width: 92%;
border-radius: 15rpx; border-radius: 15rpx;

Loading…
Cancel
Save