相关修改
This commit is contained in:
parent
6dea318ca8
commit
4022a1ebcd
@ -96,7 +96,7 @@
|
||||
<text class="card-desc">维修方便便捷</text>
|
||||
<view class="card-bg"></view>
|
||||
</view>
|
||||
<image class="card-icon" src="/static/imgs/index/weixiu.png"></image>
|
||||
<image class="card-icon" src="/static/imgs/index/weixiu.png" style="width: 80rpx;height: 80rpx;bottom: 32rpx;"></image>
|
||||
</view>
|
||||
|
||||
<!-- <view class="service-card large card-3" @click="goDetail('neighborList')" hover-class="card-hover">
|
||||
@ -522,13 +522,13 @@
|
||||
|
||||
&.card-2 {
|
||||
.card-bg {
|
||||
background: #ff7e7e;
|
||||
top: -30rpx;
|
||||
background: #5b9cf8;
|
||||
top: -50rpx;
|
||||
right: -30rpx;
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
filter: drop-shadow(0 4rpx 8rpx rgba(255, 126, 126, 0.3));
|
||||
filter: drop-shadow(0 4rpx 8rpx rgba(91, 156, 248, 0.3));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<view class="date">{{ formatTime(order.createdAt,"YYYY-MM-DD") }}</view>
|
||||
</view>
|
||||
<view class="order-description">{{ order.title }}</view>
|
||||
<button @click="handleAction(order)" class="order-action" v-if="order.status == 1 || order.status == 2 || order.status == 99">撤回</button>
|
||||
<button @click.stop="handleAction(order, $event)" class="order-action" v-if="order.status == 1 || order.status == 2 || order.status == 99">撤回</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 空状态提示 -->
|
||||
@ -73,7 +73,7 @@
|
||||
<script>
|
||||
// import Header from '@/components/header_common.vue';
|
||||
import Footer from '@/components/footer_common.vue';
|
||||
import { get, post } from '@/utils/request';
|
||||
import { get, post,put } from '@/utils/request';
|
||||
import { IMAGE_BASE_URL,BASE_URL } from '@/utils/config';
|
||||
import { formatTime, formatRelativeTime } from '@/utils/timeFormat';
|
||||
export default {
|
||||
@ -116,7 +116,7 @@
|
||||
2: '进行中',
|
||||
3: '已完成',
|
||||
99:'驳回',
|
||||
98:'已删除'
|
||||
98:'已撤回'
|
||||
};
|
||||
return statusMap[status] || '未知状态';
|
||||
},
|
||||
@ -153,22 +153,41 @@
|
||||
uni.navigateTo({ url: '/pages/serviceTickets/index' });
|
||||
},
|
||||
// 工单操作处理
|
||||
handleAction(order) {
|
||||
if (order.actionText === '撤回') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要撤回这个工单吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 执行撤回逻辑
|
||||
uni.showToast({
|
||||
title: '工单已撤回',
|
||||
icon: 'success'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
handleAction(order, e) {
|
||||
// 阻止事件冒泡
|
||||
e.stopPropagation();
|
||||
|
||||
if (order.status == 1 || order.status == 2 || order.status == 99) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要撤回这个工单吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// 执行撤回逻辑
|
||||
this.withdrawOrder(order.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async withdrawOrder(orderId) {
|
||||
try {
|
||||
const res = await put(`/api/v1/app_auth/work-order/${orderId}`, {status:98});
|
||||
if (res?.success) {
|
||||
uni.showToast({
|
||||
title: '工单已撤回',
|
||||
icon: 'success'
|
||||
});
|
||||
// 刷新列表
|
||||
this.getWorkOrderList();
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('撤回工单失败:', err);
|
||||
uni.showToast({
|
||||
title: '撤回失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
goDetail(i){
|
||||
uni.setStorageSync("Detail",i)
|
||||
|
||||
@ -3,18 +3,37 @@
|
||||
|
||||
<!-- 图片区域 - 编辑状态下可修改 -->
|
||||
<view class="image-area card">
|
||||
<view class="img-container">
|
||||
<image
|
||||
class="work-order-img"
|
||||
:src="!isEditing ? `${IMAGE_BASE_URL}${detailObj.images[0] || ''}` : workOrderImg"
|
||||
mode="widthFix"
|
||||
:lazy-load="true"
|
||||
></image>
|
||||
<view class="upload-btn" @click="uploadImage" v-if="isEditing">
|
||||
<u-icon name="camera" size="28" color="#fff"></u-icon>
|
||||
<text class="upload-text">更换图片</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="img-container">
|
||||
<!-- 非编辑状态显示服务器图片 -->
|
||||
<image
|
||||
class="work-order-img"
|
||||
:src="`${IMAGE_BASE_URL}${detailObj.images[0]}`"
|
||||
mode="widthFix"
|
||||
lazy-load="true"
|
||||
v-if="!isEditing && detailObj.images && detailObj.images.length > 0"
|
||||
></image>
|
||||
|
||||
<!-- 编辑状态显示本地选择的图片 -->
|
||||
<image
|
||||
class="work-order-img"
|
||||
:src="workOrderImg"
|
||||
mode="widthFix"
|
||||
lazy-load="true"
|
||||
v-if="isEditing && workOrderImg"
|
||||
></image>
|
||||
|
||||
<!-- 没有图片时的占位 -->
|
||||
<view class="empty-placeholder" v-if="(!detailObj.images || detailObj.images.length === 0) && !isEditing">
|
||||
<u-icon name="photo" size="48" color="#c0c4cc"></u-icon>
|
||||
<text class="empty-text">暂无图片</text>
|
||||
</view>
|
||||
|
||||
<!-- 编辑状态的上传按钮 -->
|
||||
<view class="upload-btn" @click="uploadImage" v-if="isEditing">
|
||||
<u-icon name="camera" size="28" color="#fff"></u-icon>
|
||||
<text class="upload-text">{{ workOrderImg ? '更换图片' : '上传图片' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 标题与日期 -->
|
||||
@ -298,7 +317,22 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-placeholder {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #f5f7fa;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.empty-text {
|
||||
margin-top: 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
/* 页面容器 */
|
||||
.work-order-detail {
|
||||
background-color: $bg-color;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user