@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<view class="ticket-search-result">
|
||||
<view class="header">车票查询结果</view>
|
||||
<view class="ticket-list">
|
||||
<!-- 在这里循环渲染车票列表 -->
|
||||
<view v-for="ticket in ticketList" :key="ticket.id" class="ticket" @click="buyTicket(ticket)">
|
||||
<view class="ticket-header">
|
||||
<text>{{ ticket.departure }} - {{ ticket.destination }}</text>
|
||||
<text>{{ ticket.departureTime }} - {{ ticket.arrivalTime }}</text>
|
||||
</view>
|
||||
<view class="ticket-body">
|
||||
<view class="ticket-info">
|
||||
<text>车次</text>
|
||||
<text>{{ ticket.trainNumber }}</text>
|
||||
</view>
|
||||
<view class="ticket-info">
|
||||
<text>座位类型</text>
|
||||
<text>{{ ticket.seatType }}</text>
|
||||
</view>
|
||||
<view class="ticket-info">
|
||||
<text>剩余票数</text>
|
||||
<text>{{ ticket.remainingTickets }}</text>
|
||||
</view>
|
||||
<view class="ticket-info">
|
||||
<text>价格</text>
|
||||
<text>{{ ticket.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ticketList: [
|
||||
{ id: 1, departure: '北京', destination: '上海', departureTime: '08:00', arrivalTime: '14:00', trainNumber: 'G101', seatType: '二等座', remainingTickets: 20, price: '200元' },
|
||||
{ id: 2, departure: '北京', destination: '广州', departureTime: '09:00', arrivalTime: '18:00', trainNumber: 'G102', seatType: '一等座', remainingTickets: 10, price: '300元' },
|
||||
{ id: 3, departure: '北京', destination: '深圳', departureTime: '10:00', arrivalTime: '20:00', trainNumber: 'G103', seatType: '商务座', remainingTickets: 5, price: '400元' }
|
||||
]
|
||||
};
|
||||
},
|
||||
method:{
|
||||
buyTikect(ticket){
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/Buy-ticket'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.ticket-search-result {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.header {
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.ticket {
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.ticket-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.ticket-header text {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.ticket-body {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.ticket-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.ticket-info text {
|
||||
font-size: 16px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue