|
|
|
@ -37,7 +37,7 @@ |
|
|
|
style="height: 100vh;" |
|
|
|
> |
|
|
|
<view class="ul"> |
|
|
|
<view v-for="(v,k) in tableList" :key="k" class="li" @click="openViewCourseInfo({id:v.id})"> |
|
|
|
<view v-for="(v,k) in tableList" :key="k" class="li" @click="openViewCourseInfo(v)"> |
|
|
|
<view class="top_box"> |
|
|
|
<view class="center_box"> |
|
|
|
<view>班级:{{v.classes_name}}</view> |
|
|
|
@ -92,29 +92,29 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
loading:false,//加载状态 |
|
|
|
loading: false,//加载状态 |
|
|
|
lowerThreshold: 100,//距离底部多远触发 |
|
|
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
|
|
|
|
|
|
|
//筛选条件 |
|
|
|
filteredData:{ |
|
|
|
page:1,//当前页码 |
|
|
|
limit:10,//每页返回数据条数 |
|
|
|
total:10,//数据总条数 |
|
|
|
schedule_date:'',//日期 |
|
|
|
venue_id:'',//场地id |
|
|
|
filteredData: { |
|
|
|
page: 1,//当前页码 |
|
|
|
limit: 10,//每页返回数据条数 |
|
|
|
total: 10,//数据总条数 |
|
|
|
schedule_date: '',//日期 |
|
|
|
venue_id: '',//场地id |
|
|
|
}, |
|
|
|
tableList:[],//表格数据 |
|
|
|
tableList: [],//表格数据 |
|
|
|
|
|
|
|
venuesInfo:{},//场地信息 |
|
|
|
venuesInfo: {},//场地信息 |
|
|
|
|
|
|
|
//今日日期 |
|
|
|
today: '', |
|
|
|
dateList:[]//日期列表 |
|
|
|
dateList: []//日期列表 |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
if(options.venue_id){ |
|
|
|
if (options.venue_id) { |
|
|
|
this.filteredData.venue_id = options.venue_id |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -132,17 +132,16 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
//初始化 |
|
|
|
async init(){ |
|
|
|
async init() { |
|
|
|
await this.getThisDate() |
|
|
|
await this.getHeadDate() |
|
|
|
await this.getList() |
|
|
|
// await this.getDateList(); // 获取日期列表 |
|
|
|
}, |
|
|
|
|
|
|
|
//获取课程头日期 |
|
|
|
async getHeadDate() { |
|
|
|
let res = await memberApi.getDate() |
|
|
|
if (res.code != 1){ |
|
|
|
if (res.code != 1) { |
|
|
|
//提示 |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
@ -152,7 +151,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
this.dateList = [] |
|
|
|
res.data.forEach((v,k)=>{ |
|
|
|
res.data.forEach((v, k) => { |
|
|
|
let today = v.date.split("-")[2]; // "09" |
|
|
|
this.dateList.push({ |
|
|
|
date: v.date, |
|
|
|
@ -163,7 +162,7 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
console.log('xxx',res) |
|
|
|
console.log('xxx', res) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
@ -199,13 +198,13 @@ export default { |
|
|
|
this.filteredData.total = 10//数据总条数 |
|
|
|
}, |
|
|
|
//获取列表 |
|
|
|
async getList(){ |
|
|
|
async getList() { |
|
|
|
this.loading = true |
|
|
|
|
|
|
|
let data = {...this.filteredData} |
|
|
|
|
|
|
|
//判断是否还有数据 |
|
|
|
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total || this.filteredData.limit > this.filteredData.total ){ |
|
|
|
if (this.filteredData.page * this.filteredData.limit > this.filteredData.total || this.filteredData.limit > this.filteredData.total) { |
|
|
|
this.loading = false |
|
|
|
uni.showToast({ |
|
|
|
title: '暂无更多', |
|
|
|
@ -217,7 +216,7 @@ export default { |
|
|
|
let res = await memberApi.courseList(data) |
|
|
|
this.loading = false |
|
|
|
this.isReachedBottom = false; |
|
|
|
if (res.code != 1){ |
|
|
|
if (res.code != 1) { |
|
|
|
uni.showToast({ |
|
|
|
title: res.msg, |
|
|
|
icon: 'none' |
|
|
|
@ -234,23 +233,21 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
//选择日期 |
|
|
|
async selectDate(date){ |
|
|
|
async selectDate(date) { |
|
|
|
this.loadData() |
|
|
|
this.filteredData.schedule_date = date |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//打开课表详情页 |
|
|
|
openViewTimetableInfo(item){ |
|
|
|
// courses_id=课程id |
|
|
|
openViewCourseInfo(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/student/timetable/info?id=${item.courses_id}` |
|
|
|
url: `/pages/student/timetable/info?id=${item.id}` |
|
|
|
}) |
|
|
|
}, |
|
|
|
//体育馆列表 |
|
|
|
more(){ |
|
|
|
more() { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/pages/student/timetable/list' |
|
|
|
}) |
|
|
|
|