2025-11-14 11:39:33 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view class="reserve-records">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 顶部导航栏 -->
|
2026-01-15 17:18:24 +08:00
|
|
|
|
<customNavbar title="我的预约" :is-transparent="navbarStyle.isTransparent" :bg-color="navbarStyle.bgColor"
|
|
|
|
|
|
:text-color="navbarStyle.textColor" :opacity="navbarStyle.opacity"
|
|
|
|
|
|
:show-home="true" />
|
2025-11-14 11:39:33 +08:00
|
|
|
|
<!-- 内容部分 -->
|
|
|
|
|
|
<scroll-view
|
|
|
|
|
|
scroll-y
|
|
|
|
|
|
class="scroll-content"
|
|
|
|
|
|
@scrolltolower="loadMore"
|
|
|
|
|
|
@refresherrefresh="refresh"
|
|
|
|
|
|
:refresher-enabled="true"
|
|
|
|
|
|
:refresher-triggered="isRefreshing"
|
|
|
|
|
|
>
|
2026-01-15 17:18:24 +08:00
|
|
|
|
<view v-if="flowList.length > 0" class="record-list">
|
2025-11-14 11:39:33 +08:00
|
|
|
|
<view
|
2026-01-15 17:18:24 +08:00
|
|
|
|
v-for="item in flowList"
|
2025-11-14 11:39:33 +08:00
|
|
|
|
:key="item.id"
|
|
|
|
|
|
class="record-card"
|
|
|
|
|
|
>
|
2025-12-26 17:39:00 +08:00
|
|
|
|
<!-- 资产名称和状态 -->
|
|
|
|
|
|
<view class="card-header">
|
|
|
|
|
|
<text class="asset-name">{{ item.assetName }}</text>
|
2025-11-14 11:39:33 +08:00
|
|
|
|
<text
|
|
|
|
|
|
:class="['record-status', item.status]"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ statusText(item.status) }}
|
|
|
|
|
|
</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 内容部分 -->
|
2025-12-26 17:39:00 +08:00
|
|
|
|
<view class="card-content">
|
|
|
|
|
|
<!-- 预约时间 -->
|
|
|
|
|
|
<view class="info-item">
|
|
|
|
|
|
<text class="info-label">预约时间:</text>
|
|
|
|
|
|
<text class="info-value">{{ formatDate(item.date) }}</text>
|
2025-11-14 11:39:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
<!-- 地址 -->
|
|
|
|
|
|
<view class="info-item">
|
|
|
|
|
|
<text class="info-label">地址:</text>
|
|
|
|
|
|
<text class="info-value">{{ item.assetAddress }}</text>
|
2025-11-14 11:39:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
<!-- 管家 -->
|
|
|
|
|
|
<view class="info-item">
|
|
|
|
|
|
<text class="info-label">管家:</text>
|
2026-01-15 17:18:24 +08:00
|
|
|
|
<text class="info-value">{{ item.managerName || '未知'}}({{ item.managerPhone || '未知'}})</text>
|
2025-11-14 11:39:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2025-12-26 17:39:00 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 操作按钮 -->
|
|
|
|
|
|
<view class="action-buttons">
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="location-btn"
|
|
|
|
|
|
@click="viewLocation(item)"
|
|
|
|
|
|
>
|
|
|
|
|
|
查看位置
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="call-btn"
|
|
|
|
|
|
@click="callManager(item.managerPhone)"
|
|
|
|
|
|
>
|
|
|
|
|
|
拨打电话
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</view>
|
2025-11-14 11:39:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<u-loadmore :status="loadStatus" />
|
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view v-else class="empty">
|
|
|
|
|
|
<u-empty mode="list" text="暂无预约记录" />
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</scroll-view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2026-01-15 17:18:24 +08:00
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize:10,
|
|
|
|
|
|
flowList: [],
|
2025-11-14 11:39:33 +08:00
|
|
|
|
loadStatus: 'loadmore',
|
|
|
|
|
|
isRefreshing: false
|
2026-01-15 17:18:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad(options){
|
|
|
|
|
|
this.fetchReserve()
|
|
|
|
|
|
},
|
|
|
|
|
|
onShow() {
|
|
|
|
|
|
this.$checkToken(this.$getToken())
|
2025-11-14 11:39:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
statusText(status) {
|
|
|
|
|
|
switch (status) {
|
|
|
|
|
|
case 'pending':
|
|
|
|
|
|
return '待确认';
|
|
|
|
|
|
case 'done':
|
|
|
|
|
|
return '已完成';
|
|
|
|
|
|
default:
|
|
|
|
|
|
return '未知';
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2025-12-26 17:39:00 +08:00
|
|
|
|
formatDate(dateStr) {
|
|
|
|
|
|
// 格式化日期,例如:2025-11-10 周五 09:00
|
2026-01-15 17:18:24 +08:00
|
|
|
|
if(!dateStr){return '-'}
|
2025-12-26 17:39:00 +08:00
|
|
|
|
const date = new Date(dateStr);
|
|
|
|
|
|
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
|
|
|
|
|
const year = date.getFullYear();
|
|
|
|
|
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
|
const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
|
const weekday = weekdays[date.getDay()];
|
|
|
|
|
|
const hours = String(date.getHours()).padStart(2, '0');
|
|
|
|
|
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
|
|
|
|
|
|
|
|
|
|
return `${year}-${month}-${day} ${weekday} ${hours}:${minutes}`;
|
|
|
|
|
|
},
|
2026-01-15 17:18:24 +08:00
|
|
|
|
fetchReserve(){
|
|
|
|
|
|
if (this.loadStatus !== 'loadmore') return;
|
|
|
|
|
|
this.loadStatus = 'loading';
|
|
|
|
|
|
let url = '/reservate/queryPage'
|
|
|
|
|
|
this.$u.post(url, {
|
|
|
|
|
|
pageNo: this.pageNo,
|
|
|
|
|
|
pageSize: this.pageSize
|
|
|
|
|
|
},{
|
|
|
|
|
|
WT: this.$getToken()
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
const rows = res.data.result || [];
|
|
|
|
|
|
console.log(rows)
|
|
|
|
|
|
if (this.pageNo === 1) this.flowList = [];
|
|
|
|
|
|
this.flowList = this.flowList.concat(rows);
|
|
|
|
|
|
if (rows.length < this.pageSize) {
|
|
|
|
|
|
this.loadStatus = 'nomore';
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.pageNo++;
|
|
|
|
|
|
this.loadStatus = 'loadmore';
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
console.log("获取预约记录失败:", err)
|
|
|
|
|
|
this.loadStatus = 'loadmore';
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2025-11-14 11:39:33 +08:00
|
|
|
|
viewLocation(item) {
|
|
|
|
|
|
uni.openLocation({
|
|
|
|
|
|
latitude: item.lat,
|
|
|
|
|
|
longitude: item.lng,
|
|
|
|
|
|
name: item.assetName,
|
|
|
|
|
|
address: item.assetAddress
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
callManager(phone) {
|
2026-01-30 09:01:38 +08:00
|
|
|
|
if (!phone) {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '暂无管家联系方式',
|
|
|
|
|
|
icon: 'none'
|
|
|
|
|
|
});
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-11-14 11:39:33 +08:00
|
|
|
|
uni.makePhoneCall({ phoneNumber: phone });
|
|
|
|
|
|
},
|
|
|
|
|
|
loadMore() {
|
2026-01-15 17:18:24 +08:00
|
|
|
|
this.fetchReserve()
|
2025-11-14 11:39:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
refresh() {
|
|
|
|
|
|
this.isRefreshing = true;
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
this.isRefreshing = false;
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.reserve-records {
|
|
|
|
|
|
min-height: 100vh;
|
2026-01-15 17:18:24 +08:00
|
|
|
|
padding-top: 175rpx; /* 给导航栏留空间 */
|
|
|
|
|
|
background: linear-gradient(0deg, #F3F1ED 43%, #F5E9DB 100%);
|
2025-11-14 11:39:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.scroll-content {
|
2026-01-15 17:18:24 +08:00
|
|
|
|
height: calc(100vh - -120rpx - 120rpx);
|
2025-11-14 11:39:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.record-list {
|
2025-12-26 17:39:00 +08:00
|
|
|
|
padding: 30rpx 40rpx;
|
2025-11-14 11:39:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.record-card {
|
|
|
|
|
|
background: #fff;
|
2025-12-26 17:39:00 +08:00
|
|
|
|
border-radius: 12rpx;
|
|
|
|
|
|
padding: 32rpx;
|
|
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
|
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
|
2025-11-14 11:39:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
.card-header {
|
2025-11-14 11:39:33 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
2025-12-26 17:39:00 +08:00
|
|
|
|
margin-bottom: 24rpx;
|
|
|
|
|
|
}
|
2025-11-14 11:39:33 +08:00
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
.asset-name {
|
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
color: #2D2B2C;
|
|
|
|
|
|
}
|
2025-11-14 11:39:33 +08:00
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
.record-status {
|
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
|
padding: 10rpx 15rpx;
|
|
|
|
|
|
border-radius: 4rpx;
|
|
|
|
|
|
&.done {
|
|
|
|
|
|
background: #FCE5E0;
|
|
|
|
|
|
color: #ED7748;
|
2025-11-14 11:39:33 +08:00
|
|
|
|
}
|
2025-12-26 17:39:00 +08:00
|
|
|
|
&.pending {
|
|
|
|
|
|
background: #F2F3F7;
|
|
|
|
|
|
color: #86868C;
|
2025-11-14 11:39:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
.card-content {
|
|
|
|
|
|
margin-bottom: 32rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-item {
|
2025-11-14 11:39:33 +08:00
|
|
|
|
display: flex;
|
2025-12-26 17:39:00 +08:00
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
}
|
2025-11-14 11:39:33 +08:00
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
.info-item:last-child {
|
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
}
|
2025-11-14 11:39:33 +08:00
|
|
|
|
|
2025-12-26 17:39:00 +08:00
|
|
|
|
.info-label {
|
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
|
color: #666;
|
|
|
|
|
|
width: 120rpx;
|
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
line-height: 44rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.info-value {
|
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
line-height: 44rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.action-buttons {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
gap: 20rpx;
|
|
|
|
|
|
margin-top: 32rpx;
|
|
|
|
|
|
padding-top: 32rpx;
|
|
|
|
|
|
border-top: 1rpx solid #f0f0f0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.location-btn {
|
|
|
|
|
|
width: 220rpx;
|
|
|
|
|
|
height: 72rpx;
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
color: #2D2B2C;
|
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
border: 1px solid #222222;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.call-btn {
|
|
|
|
|
|
width: 220rpx;
|
|
|
|
|
|
height: 72rpx;
|
|
|
|
|
|
background: #ff3b30;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
border: none;
|
2025-11-14 11:39:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.empty {
|
|
|
|
|
|
margin-top: 200rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|