lanan-repair/pages/myReservation/myReservation.vue

110 lines
2.7 KiB
Vue
Raw Normal View History

2024-09-22 15:07:01 +08:00
<template>
<view class="container">
<VNavigationBar titleColor="rgba(0,0,0,0.9)" backgroundColor="transparent" title="我的预约">
</VNavigationBar>
<view class="body">
<scroll-view style="height: 100%;" scroll-y="true">
<view class="orderList">
<reservationOrderVue v-for="(item, index) in orderList" :key="index" :orderInfo="item">
</reservationOrderVue>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import VNavigationBar from '@/components/VNavigationBar.vue'
import tabBarVue from '@/components/tabBar/tabBar.vue'
import reservationOrderVue from '../../components/reservationOrder/reservationOrder.vue'
2024-09-24 14:08:50 +08:00
import request from "@/utils/request";
2024-09-22 15:07:01 +08:00
export default {
components: {
tabBarVue,
VNavigationBar,
reservationOrderVue
},
data() {
return {
2024-09-24 14:08:50 +08:00
// orderList: [{
// title: '顺捷汽车维修搭电救援补胎中心',
// status: '1',
// address: '济南市历下区福瑞达历下护理院东南门旁',
// phone: '15726506879',
// busiTypeStr: '汽车维修'
// },
// {
// title: '顺捷汽车维修搭电救援补胎中心',
// status: '1',
// address: '济南市历下区福瑞达历下护理院东南门旁',
// phone: '15726506879',
// busiTypeStr: '汽车维修'
// }
// ]
orderList:[]
2024-09-22 15:07:01 +08:00
}
},
2024-09-24 14:08:50 +08:00
onShow() {
this.getBookingPage()
},
2024-09-22 15:07:01 +08:00
methods: {
2024-09-24 14:08:50 +08:00
async getBookingPage(){
const res = await request({
url: "/userClient/repair/booking/page",
method: "get",
params:{
pageNo: 1,
pageSize: 10
}
})
const data = res.data.records
const ids = data.map(item => item.id)
const response = await request({
url: "/userClient/repair/booking/map?ids=" + ids,
method: "get",
})
const list = response.data
this.orderList = list.map(item => {
return {
...item,
title: item.company.corpName,
address: item.company.address,
phone: item.company.mobilePhone,
busiTypeStr: item.servicePackage.name,
status: item.bookingStatus
}
})
}
2024-09-22 15:07:01 +08:00
}
}
</script>
<style scoped lang="less">
.container {
height: 100%;
background: #F3F5F7;
background: linear-gradient(180deg, #C1DEFF 0%, rgba(#F3F5F7, 0) 100%);
background-size: 100% 600rpx;
background-repeat: no-repeat;
display: flex;
flex-direction: column;
color: #333333;
.body {
flex: 1;
height: 0;
padding: 16rpx 0 30rpx;
overflow: auto;
}
.orderList {
width: 686rpx;
margin: 0 auto;
display: flex;
flex-direction: column;
row-gap: 20rpx;
}
}
2024-09-24 14:08:50 +08:00
</style>