|
|
@ -10,7 +10,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tabs"> |
|
|
|
<view class="tab" v-for="(item,index) in tabArr" :key="index" :class="{active: currentTab==item.id}" |
|
|
|
<view class="tab" v-for="(item,index) in tabArr" :key="index" :class="{active: params.status==item.id}" |
|
|
|
@click="changeTab(item)">{{ item.text }}</view> |
|
|
|
</view> |
|
|
|
<view class="screen_row"> |
|
|
@ -34,34 +34,43 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="list"> |
|
|
|
<view class="card"> |
|
|
|
<appointItem-operate @click.native="$goPage('/pages/recordEntry/operate/detail/detail')"/> |
|
|
|
<view class="list" v-if="list.length"> |
|
|
|
<view class="card" v-for="(item,index) in list" :key="index"> |
|
|
|
<appointItem-operate @click.native="$goPage('/pages/recordEntry/operate/detail/detail')" :item="item"/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <nodata v-if="!list.length"></nodata> --> |
|
|
|
<view style="padding-bottom: 20rpx;" v-if="list.length"> |
|
|
|
<u-loadmore :status="status" /> |
|
|
|
</view> |
|
|
|
<nodata v-if="!list.length&&status=='nomore'"></nodata> |
|
|
|
|
|
|
|
<UserTab name ='实操训练'></UserTab> |
|
|
|
|
|
|
|
<u-datetime-picker |
|
|
|
:show="showDatePicker" |
|
|
|
mode="date" |
|
|
|
:visibleItemCount="4" |
|
|
|
:minDate="1587524800000" |
|
|
|
:closeOnClickOverlay="false" |
|
|
|
@confirm="confirmDatePicker" |
|
|
|
@cancel="showDatePicker=false" |
|
|
|
></u-datetime-picker> |
|
|
|
|
|
|
|
<!-- <u-picker :show="showC" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker> --> |
|
|
|
<u-picker :show="showCar" :columns="carArr" keyName="lab" @confirm="confirmCar" @cancel="showCar=false"></u-picker> |
|
|
|
<u-picker :show="showSubject" :columns="subjectArr" keyName="lab" @confirm="confirmSubject" @cancel="showSubject=false"></u-picker> |
|
|
|
<u-picker :show="showSubject" :columns="subjectTxt" keyName="lab" @confirm="confirmSubject" @cancel="showSubject=false"></u-picker> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { bookingMasterPage } from '@/config/api.js' |
|
|
|
import { bookingMasterPage, } from '@/config/api.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tabArr: [{ |
|
|
|
text: '待上课', |
|
|
|
id: 1 |
|
|
|
id: 0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: '已完成', |
|
|
@ -69,15 +78,24 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
text: '已取消', |
|
|
|
id: 3 |
|
|
|
id: 9 |
|
|
|
}, |
|
|
|
], |
|
|
|
],//状态:0:未签到,1:已签到,2:已签退,3:已过期,9:已取消,示例值(2) |
|
|
|
currentTab: 1, |
|
|
|
screen: { |
|
|
|
subject: '训练科目', |
|
|
|
car: '预约车辆', |
|
|
|
timer: '预约时间' |
|
|
|
}, |
|
|
|
status: 'loading', |
|
|
|
subjectTxt: [ |
|
|
|
[ |
|
|
|
{lab: '不限', id: 0}, |
|
|
|
{lab: '科目二', id: 2}, |
|
|
|
{lab: '科目三', id: 3}, |
|
|
|
] |
|
|
|
], |
|
|
|
// :0:不限;2:科目二;3:科目三 |
|
|
|
showDatePicker: false, |
|
|
|
showCar: false, |
|
|
|
showSubject: false, |
|
|
@ -87,48 +105,84 @@ |
|
|
|
{lab: 'C2',id: 2}, |
|
|
|
] |
|
|
|
], |
|
|
|
subjectArr: [ |
|
|
|
carArr: [ |
|
|
|
[ |
|
|
|
{lab: '浙00006',id: 1}, |
|
|
|
{lab: '浙A66666学',id: 1}, |
|
|
|
{lab: '浙00007',id: 2}, |
|
|
|
] |
|
|
|
], |
|
|
|
params: { |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 20 |
|
|
|
} |
|
|
|
pageSize: 20, |
|
|
|
status: 0, |
|
|
|
carNumber: '', |
|
|
|
bookingTime: [] |
|
|
|
}, |
|
|
|
list: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
console.log('我的页面') |
|
|
|
this.bookingMasterPageFn() |
|
|
|
this.params.coachId = this.vuex_coachId |
|
|
|
// this.bookingMasterPageFn() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
uni.hideTabBar(); |
|
|
|
this.initList() |
|
|
|
}, |
|
|
|
onPullDownRefresh() { |
|
|
|
this.initList() |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
|
if(this.list<this.total) { |
|
|
|
this.initList() |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async initList() { |
|
|
|
this.status = 'loading' |
|
|
|
this.list = [] |
|
|
|
this.params.pageNo = 1 |
|
|
|
this.bookingMasterPageFn() |
|
|
|
}, |
|
|
|
async bookingMasterPageFn() { |
|
|
|
console.log(this.params) |
|
|
|
const {data: res } = await bookingMasterPage(this.params) |
|
|
|
// uni.$u.http.get('/api/admin-api/business/booking/master/page', this.params ).then(res => { |
|
|
|
// console.log(res) |
|
|
|
// }).catch(err => { |
|
|
|
|
|
|
|
// }) |
|
|
|
this.params.pageNo ++ |
|
|
|
this.list.push(...res.list) |
|
|
|
this.total = res.total |
|
|
|
if(this.list.length>=this.total) this.status = 'nomore' |
|
|
|
console.log(res) |
|
|
|
}, |
|
|
|
changeTab(item) { |
|
|
|
this.currentTab = item.id |
|
|
|
this.params.status = item.id |
|
|
|
this.initList() |
|
|
|
}, |
|
|
|
confirmDatePicker(val) { |
|
|
|
this.showDatePicker = false |
|
|
|
console.log(val) |
|
|
|
console.log(uni.$u.date(val.value, 'yyyy-mm-dd')) |
|
|
|
this.screen.timer = uni.$u.date(val.value, 'yyyy-mm-dd') |
|
|
|
console.log(this.screen.timer) |
|
|
|
this.params.beginTime = this.screen.timer+ ' 00:00:00' |
|
|
|
this.params.endTime = this.screen.timer+ ' 23:59:59' |
|
|
|
// this.params.bookingTime = [startTimer, endTimer] |
|
|
|
this.initList() |
|
|
|
}, |
|
|
|
confirmCar(val) { |
|
|
|
let item = val.value[0] |
|
|
|
this.screen.car = item.lab |
|
|
|
this.params.carNumber = item.lab |
|
|
|
this.showCar = false |
|
|
|
this.initList() |
|
|
|
}, |
|
|
|
confirmSubject(val) { |
|
|
|
let item = val.value[0] |
|
|
|
this.screen.subject = item.lab |
|
|
|
this.params.subject = item.id |
|
|
|
this.initList() |
|
|
|
this.showSubject = false |
|
|
|
} |
|
|
|
} |
|
|
|