|
|
|
@ -4,11 +4,13 @@ |
|
|
|
<scroll-view scroll-y="true" :lower-threshold="lowerThreshold" |
|
|
|
@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="title">{{v.name}}</view> |
|
|
|
<view class="con">{{v.address}}</view> |
|
|
|
<view class="con" v-if="v.distance === null ">无法获取定位</view> |
|
|
|
<view class="con" v-else-if="v.distance">距您{{v.distance}}km</view> |
|
|
|
<view class="title">{{v.campus.campus_name}} </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-else-if="v.distance">距您{{v.distance}}km</view>--> |
|
|
|
<view class="current-venue" v-if="venue_id == v.id"> |
|
|
|
当前场馆 |
|
|
|
</view> |
|
|
|
@ -20,6 +22,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import apiRoute from '@/api/apiRoute.js'; |
|
|
|
import memberApi from '@/api/member.js'; |
|
|
|
import AQTabber from "@/components/AQ/AQTabber.vue" |
|
|
|
|
|
|
|
@ -34,12 +37,15 @@ |
|
|
|
lowerThreshold: 100,//距离底部多远触发 |
|
|
|
isReachedBottom: false,//防止重复加载|true=不可加载|false=可加载 |
|
|
|
|
|
|
|
memberInfo:{id:''},//客户资源信息 |
|
|
|
|
|
|
|
//筛选条件 |
|
|
|
filteredData:{ |
|
|
|
// page:1,//当前页码 |
|
|
|
// limit:10,//每页返回数据条数 |
|
|
|
// total:10,//数据总条数 |
|
|
|
schedule_date:'',//日期 |
|
|
|
course_date:'',//日期 |
|
|
|
resources_id:'',//客户资源ID |
|
|
|
}, |
|
|
|
|
|
|
|
tableList:[],//表格数据 |
|
|
|
@ -50,9 +56,9 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.filteredData.schedule_date = options.schedule_date//日期 |
|
|
|
this.filteredData.course_date = options.course_date//上课日期 |
|
|
|
//场馆id |
|
|
|
this.venue_id = options.venue_id || '' |
|
|
|
this.venue_id = options.venue_id || ''//场地ID |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.init()//初始化 |
|
|
|
@ -60,10 +66,26 @@ |
|
|
|
methods: { |
|
|
|
//初始化 |
|
|
|
async init() { |
|
|
|
await this.getUserLocation(); |
|
|
|
// await this.getUserLocation(); |
|
|
|
|
|
|
|
await this.getMemberInfo(); |
|
|
|
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() { |
|
|
|
@ -142,16 +164,16 @@ |
|
|
|
let data = {...this.filteredData} |
|
|
|
|
|
|
|
//判断是否还有数据 |
|
|
|
if(this.filteredData.page * this.filteredData.limit > this.total){ |
|
|
|
this.loading = false |
|
|
|
uni.showToast({ |
|
|
|
title: '暂无更多', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
let res = await memberApi.venuesList(data) |
|
|
|
// if(this.filteredData.page * this.filteredData.limit > this.total){ |
|
|
|
// this.loading = false |
|
|
|
// uni.showToast({ |
|
|
|
// title: '暂无更多', |
|
|
|
// icon: 'none' |
|
|
|
// }) |
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
let res = await apiRoute.xy_personCourseScheduleGetVenueListAll(data) |
|
|
|
this.loading = false |
|
|
|
this.isReachedBottom = false; |
|
|
|
if (res.code != 1){ |
|
|
|
@ -165,9 +187,9 @@ |
|
|
|
this.tableList = res.data |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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) |
|
|
|
}else{ |
|
|
|
v.distance = null |
|
|
|
@ -175,11 +197,6 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
console.log('列表',this.tableList) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//跳转页面-课程列表 |
|
|
|
@ -201,6 +218,12 @@ |
|
|
|
overflow: auto; |
|
|
|
background: #292929; |
|
|
|
} |
|
|
|
.data_hint{ |
|
|
|
margin-top: 100rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
text-align: center; |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
.main_section{ |
|
|
|
width: 92%; |
|
|
|
border-radius: 15rpx; |
|
|
|
|