You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<template>
|
|
|
|
<view class="checkout-list-bg">
|
|
|
|
<u-list
|
|
|
|
@scrolltolower="loadMore"
|
|
|
|
@refresh="onRefresh"
|
|
|
|
:refreshing="refreshing"
|
|
|
|
:finished="finished"
|
|
|
|
:finished-text="'没有更多了'"
|
|
|
|
>
|
|
|
|
<u-list-item v-for="item in list" :key="item.chooseRoomRecId">
|
|
|
|
<view class="checkout-card" @click="goDetail(item)">
|
|
|
|
<image :src="item.img" class="room-img" mode="aspectFill"></image>
|
|
|
|
<view class="room-info">
|
|
|
|
<view class="room-title">{{ item.roomNamePath }}</view>
|
|
|
|
<view class="room-user">
|
|
|
|
<text>{{ item.graduateName }}</text>
|
|
|
|
<text class="gender">{{ item.gender==1?'男':'女' }}</text>
|
|
|
|
<text class="phone">{{ item.telephone }}</text>
|
|
|
|
</view>
|
|
|
|
<view class="room-date"
|
|
|
|
>{{ item.startDate }}至{{ item.checkOutDate }}</view
|
|
|
|
>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</u-list-item>
|
|
|
|
</u-list>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { listCheckoutAlert } from "../../../pages/api";
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
list: [],
|
|
|
|
page: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
refreshing: false,
|
|
|
|
finished: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async getList() {
|
|
|
|
const res = await listCheckoutAlert({
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
});
|
|
|
|
this.list = res.rows;
|
|
|
|
console.log(res, "res");
|
|
|
|
|
|
|
|
// if (res.code === 200) {
|
|
|
|
// this.list = this.page === 1 ? res.data : [...this.list, ...res.data];
|
|
|
|
// this.finished = res.data.length < this.pageSize;
|
|
|
|
// this.refreshing = false;
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
|
|
|
|
// 下拉刷新
|
|
|
|
onRefresh() {
|
|
|
|
this.page = 1;
|
|
|
|
this.finished = false;
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
// 上拉加载
|
|
|
|
loadMore() {
|
|
|
|
if (this.finished) return;
|
|
|
|
this.page++;
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
goDetail(item) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `/pagesA/checkout/detail/detail?id=${item.chooseRoomRecId}`,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.checkout-list-bg {
|
|
|
|
background: #f7f7f7;
|
|
|
|
min-height: 80vh;
|
|
|
|
padding: 24rpx 0;
|
|
|
|
}
|
|
|
|
.checkout-card {
|
|
|
|
display: flex;
|
|
|
|
background: #fff;
|
|
|
|
border-radius: 20rpx;
|
|
|
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
|
|
|
margin: 24rpx 24rpx 0 24rpx;
|
|
|
|
padding: 20rpx;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.room-img {
|
|
|
|
width: 160rpx;
|
|
|
|
height: 120rpx;
|
|
|
|
border-radius: 12rpx;
|
|
|
|
object-fit: cover;
|
|
|
|
margin-right: 20rpx;
|
|
|
|
}
|
|
|
|
.room-info {
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.room-title {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 32rpx;
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
}
|
|
|
|
.room-user {
|
|
|
|
font-size: 28rpx;
|
|
|
|
color: #222;
|
|
|
|
margin-bottom: 8rpx;
|
|
|
|
}
|
|
|
|
.room-user .gender {
|
|
|
|
margin-left: 16rpx;
|
|
|
|
}
|
|
|
|
.room-user .phone {
|
|
|
|
margin-left: 16rpx;
|
|
|
|
}
|
|
|
|
.room-date {
|
|
|
|
color: #bbb;
|
|
|
|
font-size: 26rpx;
|
|
|
|
}
|
|
|
|
</style>
|