部分接口对接

This commit is contained in:
2025-07-27 15:52:39 +08:00
parent b82bf6ef8c
commit 97ad8a00dc
7 changed files with 276 additions and 88 deletions

View File

@@ -4,7 +4,7 @@
<view class="add-repair-scroll-content">
<!-- 地址选择 -->
<view class="add-repair-section">
<view class="add-repair-address-btn">
<view class="add-repair-address-btn" @click="goSelectLocation">
<view class="add-repair-address-text">请选择房屋所在地址</view>
<image class="add-repair-address-img" src="/static/ic_add_repair_01.png" />
</view>
@@ -92,8 +92,12 @@ export default {
MediaSelector.preview(path, MediaType.IMAGE);
},
goRepaired(){
uni.navigateTo({ url: '/pages/mine/myRepair/repaired' });
}
uni.navigateTo({ url: '/pages/sys/user/myRepair/repaired' });
},
goSelectLocation(){
uni.navigateTo({ url: '/pages/sys/user/myRepair/selectLocation' });
}
}
}
</script>

View File

@@ -15,17 +15,19 @@
<view v-else class="repair-list-box">
<view v-for="(item, idx) in records" :key="idx" class="repair-card" @click="showDetail(item)">
<view class="repair-row">
<view class="repair-no">工单号{{ item.no }}</view>
<view class="repair-status" :class="item.statusClass">{{ item.statusText }}</view>
<view class="repair-no">工单号{{ item.orderNo }}</view>
<view class="repair-status" :class="getStatusColor(item.status)">
{{ getStatusLabel(item.status) }}</view>
</view>
<image class="repair-line-image" src="/static/ic_my_repair_03.png"/>
<view class="repair-info">建立时间{{ item.time }}</view>
<view class="repair-info">报事内容{{ item.content }}</view>
<view class="repair-info">报事位置{{ item.addr }}</view>
<image class="repair-line-image" src="/static/ic_my_repair_03.png" />
<view class="repair-info">建立时间{{ item.createTime }}</view>
<view class="repair-info">报事内容{{ item.typeName }}</view>
<view class="repair-info">报事位置{{ item.location }}</view>
<view v-if="item.statusText === '已结束'" class="repair-eval-btn eval-btn-right">服务评价</view>
</view>
<!-- 悬浮新增按钮 -->
<image src="/static/ic_my_repair_02.png" :class="['repair-add-btn-fixed', { 'hide': isAddBtnHidden }]" @click="addRepair" />
<image src="/static/ic_my_repair_02.png" :class="['repair-add-btn-fixed', { 'hide': isAddBtnHidden }]"
@click="addRepair" />
</view>
</scroll-view>
<!-- 详情弹窗 -->
@@ -37,18 +39,23 @@
<view class="repair-detail-progress-box">
<view class="repair-detail-progress">
<view v-for="(step, idx) in progressSteps" :key="idx" class="repair-detail-step">
<view :class="['repair-detail-dot', detailStep >= idx ? 'active' : '', (detailStep === idx && detailStatus !== '已结束') ? 'current' : '']"></view>
<view v-if="idx < progressSteps.length - 1" :class="['repair-detail-line', detailStep > idx ? 'active' : '']"></view>
<view
:class="['repair-detail-dot', detailStep >= idx ? 'active' : '', (detailStep === idx && detailStatus !== '已结束') ? 'current' : '']">
</view>
<view v-if="idx < progressSteps.length - 1"
:class="['repair-detail-line', detailStep > idx ? 'active' : '']"></view>
</view>
</view>
<view class="repair-detail-progress-labels">
<view v-for="(step, idx) in progressSteps" :key="idx" class="repair-detail-label">{{ step }}</view>
<view v-for="(step, idx) in progressSteps" :key="idx" class="repair-detail-label">{{ step }}
</view>
</view>
</view>
<view class="repair-detail-info">建立时间{{ detailItem.time }}</view>
<view class="repair-detail-info">报事内容{{ detailItem.content }}</view>
<view class="repair-detail-info">报事位置{{ detailItem.addr }}</view>
<button v-if="detailItem.statusText === '已结束'" class="repair-detail-btn" @click="goTEvaluate">评价服务</button>
<view class="repair-detail-info">建立时间{{ detailItem.createTime }}</view>
<view class="repair-detail-info">报事内容{{ detailItem.typeName }}</view>
<view class="repair-detail-info">报事位置{{ detailItem.location }}</view>
<button v-if="detailItem.statusText === '已结束'" class="repair-detail-btn"
@click="goTEvaluate">评价服务</button>
</view>
</view>
</view>
@@ -59,56 +66,19 @@
data() {
return {
// 空数组可切换空状态
records: [{
no: '20250628147856687',
time: '2025-07-02 15:24:36',
content: '室内无气,未欠费',
addr: '68栋1单元8-9',
statusText: '待处理',
statusClass: 'pending'
},
{
no: '20250628147856687',
time: '2025-07-02 15:24:36',
content: '室内无气,未欠费',
addr: '68栋1单元8-9',
statusText: '已结束',
statusClass: 'done'
},
{
no: '20250628147856687',
time: '2025-07-02 15:24:36',
content: '室内无气,未欠费',
addr: '68栋1单元8-9',
statusText: '处理中',
statusClass: 'doing'
},
{
no: '20250628147856687',
time: '2025-07-02 15:24:36',
content: '室内无气,未欠费',
addr: '68栋1单元8-9',
statusText: '已结束',
statusClass: 'done'
},
{
no: '20250628147856687',
time: '2025-07-02 15:24:36',
content: '室内无气,未欠费',
addr: '68栋1单元8-9',
statusText: '已结束',
statusClass: 'done'
}
],
records: [],
showDetailDialog: false,
detailItem: {},
detailStep: 0,
detailStatus: '',
progressSteps: ['创建报事', '待处理', '处理中', '已结束'],
progressSteps: ['创建工单', '处理中', '已结束'],
lastScrollTop: 0,
isAddBtnHidden: false
}
},
onLoad() {
this.getOrders()
},
methods: {
goBack() {
uni.navigateBack();
@@ -118,19 +88,51 @@
url: '/pages/sys/user/myRepair/addRepair'
});
},
async getOrders() {
let res = await this.$u.api.getOrderList();
if (res.code == '200') {
this.records = res.rows
}
},
getStatusColor(status) {
const statusMap = {
0: 'orange',
1: 'doing',
2: 'doing',
3: 'doing',
4: 'done'
};
return statusMap[status] || '';
},
showDetail(item) {
this.detailItem = item;
// 进度映射
if(item.statusText === '待处理') { this.detailStep = 1; this.detailStatus = '待处理'; }
else if(item.statusText === '处理中') { this.detailStep = 2; this.detailStatus = '处理中'; }
else if(item.statusText === '已结束') { this.detailStep = 3; this.detailStatus = '已结束'; }
else { this.detailStep = 0; this.detailStatus = '创建报事'; }
if (item.status === 0) {
this.detailStep = 0;
this.detailStatus = '创建报';
} else if (item.status === 4) {
this.detailStep = 3;
this.detailStatus = '已结束';
} else {
this.detailStep = 2;
this.detailStatus = '处理中';
}
this.showDetailDialog = true;
},
closeDetail() {
this.showDetailDialog = false;
},
goTEvaluate(){
getStatusLabel(status) {
const statusMap = {
0: '创建工单',
1: '处理中',
2: '处理中',
3: '处理中',
4: '已完成'
};
return statusMap[status] || '';
},
goTEvaluate() {
uni.navigateTo({
url: '/pages/sys/user/myRepair/repairEvaluate'
});
@@ -171,7 +173,8 @@
justify-content: center;
position: relative;
background: #fff;
flex-shrink: 0; /* 防止被压缩 */
flex-shrink: 0;
/* 防止被压缩 */
}
.repair-back {
@@ -267,23 +270,24 @@
font-size: 24rpx;
font-weight: 500;
}
.repair-line-image{
margin: left 29rpx ;
.repair-line-image {
margin: left 29rpx;
margin-right: 39rpx;
height: 2rpx;
margin-bottom: 29rpx;
}
.repair-status.pending {
color: #FF9800;
.repair-status.orange {
color: #F3AB44;
}
.repair-status.doing {
color: #05C58C;
color: #00C9AA;
}
.repair-status.done {
color: #BDBDBD;
color: #8A8A8A;
}
.repair-info {
@@ -330,21 +334,26 @@
.repair-detail-mask {
position: fixed;
left: 0; top: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.45);
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.45);
z-index: 999;
display: flex;
align-items: flex-end;
justify-content: center;
}
.repair-detail-dialog {
width: 100vw;
background: #fff;
border-radius: 18rpx 18rpx 0 0;
box-shadow: 0 -2rpx 24rpx rgba(0,0,0,0.10);
box-shadow: 0 -2rpx 24rpx rgba(0, 0, 0, 0.10);
padding: 52rpx 56rpx 69rpx 56rpx;
margin-bottom: 0;
}
.repair-detail-title {
font-size: 36rpx;
color: #000;
@@ -352,6 +361,7 @@
position: relative;
margin-bottom: 48rpx;
}
.repair-detail-close {
width: 32rpx;
height: 32rpx;
@@ -359,6 +369,7 @@
right: 0;
top: 0;
}
.repair-detail-progress-box {
height: 107rpx;
margin-bottom: 41rpx;
@@ -369,20 +380,23 @@
justify-content: center;
align-items: stretch;
}
.repair-detail-progress {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 5rpx;
margin-left: 70rpx;
margin-left: 100rpx;
width: 100%;
}
.repair-detail-step {
display: flex;
align-items: center;
flex: 1;
position: relative;
}
.repair-detail-dot {
width: 22rpx;
height: 22rpx;
@@ -392,14 +406,17 @@
position: relative;
z-index: 2;
}
.repair-detail-dot.active {
background: #2186FF;
border-color: #2186FF;
}
.repair-detail-dot.current {
background: #EF8D00;
border-color: #EF8D00;
}
.repair-detail-line {
flex: 1;
height: 4rpx;
@@ -407,15 +424,18 @@
margin: 0 2rpx;
z-index: 1;
}
.repair-detail-line.active {
background: #2186FF;
}
.repair-detail-progress-labels {
display: flex;
justify-content: space-between;
margin-left: 0;
width: 100%;
}
.repair-detail-label {
font-size: 22rpx;
color: #888;
@@ -424,13 +444,15 @@
position: relative;
top: 8rpx;
}
.repair-detail-info {
font-size: 26rpx;
color: #222;
margin-bottom: 30rpx;
}
.repair-detail-btn {
width:445rpx;
width: 445rpx;
height: 73rpx;
background: linear-gradient(90deg, #005DE9 0%, #4B9BFF 100%);
color: #fff;
@@ -445,7 +467,7 @@
/* 让服务评价按钮靠右 */
.eval-btn-right {
margin-left: auto;
display: block;
width: fit-content;
margin-left: auto;
display: block;
width: fit-content;
}

View File

@@ -0,0 +1,148 @@
<view class="container">
<!-- 搜索栏 -->
<view class="search-bar">
<picker mode="region" bindchange="onRegionChange">
<view class="region">{{ region }}</view>
</picker>
<input class="search-input" placeholder="请输入您的地址" />
</view>
<!-- 地图展示 -->
<map class="map-view" longitude="{{longitude}}" latitude="{{latitude}}" scale="16" show-location></map>
<!-- 地址列表 -->
<view class="address-list">
<block wx:for="{{addressList}}" wx:key="id">
<view class="address-item" bindtap="onSelect" data-id="{{item.id}}">
<view class="addr-info">
<view class="addr-title">{{ item.name }}</view>
<view class="addr-desc">{{ item.detail }}</view>
</view>
<radio checked="{{item.id === selectedId}}" />
</view>
</block>
</view>
</view>
<script>
export default {
data() {
return {
region: '重庆',
latitude: 29.534,
longitude: 106.565,
selectedId: null,
addressList: [{
id: 1,
name: '综合服务中心-1栋',
detail: '重庆市南川区隆化大道9号'
},
{
id: 2,
name: '综合服务中心-2栋',
detail: '重庆市南川区隆化大道12号'
},
{
id: 3,
name: '综合服务中心-3栋',
detail: '重庆市南川区隆化大道4号'
},
{
id: 4,
name: '综合服务中心-4栋',
detail: '重庆市南川区隆化大道5号'
},
{
id: 5,
name: '综合服务中心-5栋',
detail: '重庆市南川区隆化大道145号'
}
]
}
},
methods: {
toggleTag(tag) {
if (this.selectedTags.includes(tag)) {
this.selectedTags = this.selectedTags.filter(t => t !== tag)
} else {
this.selectedTags.push(tag)
}
}
}
}
</script>
<style scoped>
.container {
display: flex;
flex-direction: column;
}
.top-bar {
display: flex;
align-items: center;
padding: 20rpx;
background: #fff;
font-size: 36rpx;
font-weight: bold;
}
.back-icon {
width: 36rpx;
height: 36rpx;
margin-right: 20rpx;
}
.search-bar {
display: flex;
align-items: center;
padding: 20rpx;
background: #f5f5f5;
}
.region {
margin-right: 20rpx;
color: #333;
}
.search-input {
flex: 1;
background: #fff;
border-radius: 10rpx;
padding: 10rpx;
}
.map-view {
width: 100%;
height: 400rpx;
}
.address-list {
padding: 20rpx;
background: #fff;
}
.address-item {
display: flex;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 1px solid #eee;
}
.addr-info {
display: flex;
flex-direction: column;
}
.addr-title {
font-weight: bold;
font-size: 32rpx;
}
.addr-desc {
font-size: 26rpx;
color: #888;
margin-top: 6rpx;
}
</style>

View File

@@ -125,15 +125,15 @@
3: '已完成'
};
return statusMap[status] || '';
},
getStatusColor(status){
const statusMap = {
0: '待确认',
1: 'orange',
2: '已取消',
3: '已完成'
};
return statusMap[status] || '';
},
getStatusColor(status){
const statusMap = {
0: '待确认',
1: 'orange',
2: '已取消',
3: '已完成'
};
return statusMap[status] || '';
}
}
}

View File

@@ -228,12 +228,17 @@
width: 100%;
height: 372rpx;
margin-bottom: -180rpx; /* 减少负边距避免过度覆盖 */
padding-top: 115rpx;
display: flex;
justify-content: space-between;
position: relative;
z-index: 1;
background: linear-gradient(180deg, #0A60ED 0%, #FFFFFF 100%);
}
.card-wrapper{
z-index: 100;
}
.detail-back {
margin-left: 37rpx;
width: 15rpx;