工作端小程序
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.

131 lines
2.8 KiB

<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>
1 month ago
import { listCheckoutAlert } from "../../../pages/api";
export default {
data() {
return {
list: [],
page: 1,
pageSize: 10,
refreshing: false,
finished: false,
};
},
onLoad() {
this.getList();
},
methods: {
1 month ago
async getList() {
const res = await listCheckoutAlert({
pageNum: 1,
pageSize: 10,
});
this.list = res.rows;
1 month ago
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();
},
1 month ago
goDetail(item) {
uni.navigateTo({
url: `/pagesA/checkout/detail/detail?id=${item.chooseRoomRecId}`,
1 month ago
});
},
},
};
</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>