<!-- 工单详情 -->
|
<template>
|
<div class="workDetailContainer">
|
<!-- 自定义导航栏 -->
|
<u-navbar title="工单详情" :is-back="true" back-text="" :back-icon-size="40" @left-click="onBackClick">
|
<template #right>
|
<div class="share-btn" @click="onShareClick">分享</div>
|
</template>
|
</u-navbar>
|
|
<!-- 分享弹出层 -->
|
<div v-if="showShareModal" class="share-modal-overlay" @click="onShareModalClose">
|
<div class="share-modal-content" @click.stop>
|
<div class="share-modal-header">
|
<div class="share-modal-title">分享到</div>
|
<div class="share-modal-close" @click="onShareModalClose">×</div>
|
</div>
|
<div class="share-modal-body">
|
<div class="share-item" @click="shareToWechat">
|
<div class="share-icon wechat"></div>
|
<div class="share-name">微信好友</div>
|
</div>
|
<div class="share-item" @click="shareToMoments">
|
<div class="share-icon moments"></div>
|
<div class="share-name">朋友圈</div>
|
</div>
|
<div class="share-item" @click="copyLink">
|
<div class="share-icon link"></div>
|
<div class="share-name">复制链接</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="detailTop">
|
<div class="image-container">
|
<u-swiper
|
class="detailImage"
|
:list="getImageList"
|
mode="round"
|
indicator
|
indicatorMode="dot"
|
indicatorActiveColor="#4C85FF"
|
indicatorInactiveColor="#fff"
|
indicatorPosition="center"
|
height="410rpx"
|
@click="previewImage"
|
></u-swiper>
|
<!-- <div class="detailTitle">-->
|
<!-- <div class="titleText">-->
|
<!-- <div class="itemName">{{workDetailData.event_name}}</div>-->
|
<!-- <div class="itemTime">{{formatDate(workDetailData.create_time)}}</div>-->
|
<!-- </div>-->
|
<!-- </div>-->
|
</div>
|
</div>
|
|
<!-- 工单内容 -->
|
<div class="worderContainer">
|
<div class="workOrderContent">
|
<div class="workOrderTitle">工单内容</div>
|
<div class="workOrderContainer">
|
<div class="orderRow">
|
<div class="rowTitle">工单编号</div>
|
<div>{{ workDetailData.event_num }}</div>
|
</div>
|
<div class="orderRow">
|
<div class="rowTitle">工单处置人</div>
|
<div>{{ workDetailData.event_num?.slice(0, 2) === 'AI' ? 'AI 小飞' : workDetailData.creator }}</div>
|
</div>
|
<div class="orderRow">
|
<div class="rowTitle">处置部门</div>
|
<div>{{ workDetailData.dept_name }}</div>
|
</div>
|
<div class="orderRow">
|
<div class="rowTitle">拍摄时间</div>
|
<div>{{ workDetailData.create_time }}</div>
|
</div>
|
<div class="orderRow">
|
<div class="rowTitle">分发人员</div>
|
<div>{{ workDetailData.remark }}</div>
|
</div>
|
<div class="orderRow">
|
<div class="rowTitle">分发部门</div>
|
<div>{{ workDetailData.remark }}</div>
|
</div>
|
|
<div class="orderRow">
|
<div class="rowTitle">分发时间</div>
|
<div>{{ workDetailData.create_time }}</div>
|
</div>
|
<div class="orderRow">
|
<div class="rowTitle">工单位置</div>
|
<div class="rowAddress" @click="jumpMap(workDetailData)">{{ workDetailData.address }}</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<!-- 操作按钮 -->
|
<div class="actionButton">
|
<div class="btngroups">
|
<up-button type="primary" color="#AEAEAE" text="退回"></up-button>
|
<up-button type="primary" color="#1D6FE9" text="确认"></up-button>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
// import { getShowImg, getSmallImg } from '@/utils/util'
|
import { ref, computed } from 'vue'
|
import { getList, flowEvent } from '/src/api/work/index.js'
|
import dayjs from 'dayjs'
|
|
const formatDate = dateString => {
|
return dayjs(dateString).format('MM/DD HH:mm')
|
}
|
const eventNum = ref('')
|
// 工单内容
|
const workDetailData = ref({
|
"id": 8474,
|
"wayline_job_id": "51835088-cd94-42f8-b2ec-a9069ced4e7b",
|
"event_name": "测试",
|
"device_sn": "7CTDM5E00B3H61",
|
"status": 3,
|
"photo_url": "https://wrj.shuixiongit.com/minio/cloud-bucket/upload/20260113/f090f03fdc52499473ab9cbfcdc0876d.jpeg",
|
"file_path": "upload/20260113/f090f03fdc52499473ab9cbfcdc0876d.jpeg",
|
"longitude": "115.85649472222222",
|
"latitude": "28.624301527777778",
|
"create_time": "2026-01-13 16:51:57",
|
"media_type": "PHOTO_TYPE",
|
"event_num": "BHJC20260113002",
|
"ai_types": "道路裂缝",
|
"ai_type_key_list": [
|
"DLLFSB"
|
],
|
"work_order_type_dict_key": "ZHZLL",
|
"work_order_type": "交通运输与交管",
|
"create_user": "曾超杰",
|
"update_user": "管理员",
|
"dept_name": "中图智飞(江西省)",
|
"create_user_id": "2009140684346388482",
|
"user_id": "1991745495648227330",
|
"handle_user_id": "1123598821738675201",
|
"address": "江西省南昌市西湖区朝农街道抚生南路1806号南昌台湾健康产业城",
|
"update_photo_url": "https://wrj.shuixiongit.com/minio/cloud-bucket/upload/20260113/f090f03fdc52499473ab9cbfcdc0876d.jpeg",
|
"content": "测试",
|
"work_type": "3",
|
"job_name": "定向拍照2",
|
"is_review": 0,
|
"job_create_time": "2026-01-13 16:51:57"
|
},)
|
onLoad(async options => {
|
eventNum.value = options.eventNum
|
// await getDataList(eventNum.value)
|
})
|
const getDataList = async val => {
|
const params = {
|
current: 1,
|
size: 9999,
|
source: 1,
|
event_name: val,
|
}
|
const res = await getList(params)
|
const response = res.data.data.records
|
workDetailData.value = response[0]
|
|
console.log('详情', response)
|
}
|
// 图片预览
|
|
const previewImage = index => {
|
if (getImageList.value.length === 0) return
|
const currentIndex = typeof index === 'number' ? index : 0
|
uni.previewImage({
|
urls: getImageList.value,
|
current: currentIndex,
|
})
|
}
|
const getImageList = computed(() => {
|
const imageArr = []
|
const detail = workDetailData.value
|
if (detail.photo_url) {
|
const smallUrl = detail.photo_url
|
imageArr.push(smallUrl)
|
}
|
if (detail.update_photo_url) {
|
const smallUrl = detail.update_photo_url
|
imageArr.push(smallUrl)
|
}
|
return imageArr
|
})
|
// 跳转地图
|
const jumpMap = item => {
|
uni.navigateTo({
|
url: `/subPackages/workDetail/mapWork/index?eventNum=${item.event_num}`,
|
})
|
}
|
|
// 分享模态框状态
|
const showShareModal = ref(false)
|
|
// 分享按钮点击事件 - 显示分享模态框
|
const onShareClick = () => {
|
showShareModal.value = true
|
}
|
|
// 关闭分享模态框
|
const onShareModalClose = () => {
|
showShareModal.value = false
|
}
|
|
// 微信好友分享
|
const shareToWechat = () => {
|
shareToPlatform('weixin', 'WXSceneSession')
|
}
|
|
// 朋友圈分享
|
const shareToMoments = () => {
|
shareToPlatform('weixin', 'WXSceneTimeline')
|
}
|
|
// 复制链接
|
const copyLink = async () => {
|
const shareUrl = 'https://example.com/workDetail?eventNum=' + workDetailData.value.event_num
|
try {
|
await uni.setClipboardData({
|
data: shareUrl,
|
})
|
uni.showToast({
|
title: '链接已复制',
|
icon: 'success',
|
})
|
} catch (error) {
|
console.error('复制失败:', error)
|
uni.showToast({
|
title: '复制失败,请重试',
|
icon: 'none',
|
})
|
}
|
onShareModalClose()
|
}
|
|
// 通用分享平台函数
|
const shareToPlatform = (provider, scene = '') => {
|
// 检查当前平台是否支持分享功能
|
const platform = uni.getSystemInfoSync().platform
|
|
// H5平台不支持uni.share API
|
if (platform === 'web') {
|
uni.showToast({
|
title: 'H5平台暂不支持分享功能',
|
icon: 'none',
|
})
|
onShareModalClose()
|
return
|
}
|
|
// 检查uni.share是否存在
|
if (typeof uni.share !== 'function') {
|
uni.showToast({
|
title: '当前环境不支持分享功能',
|
icon: 'none',
|
})
|
onShareModalClose()
|
return
|
}
|
|
try {
|
const shareConfig = {
|
provider,
|
type: 0,
|
title: workDetailData.value.event_name || '工单详情',
|
summary: '查看工单详情',
|
href: 'https://example.com/workDetail?eventNum=' + workDetailData.value.event_num,
|
imageUrl: workDetailData.value.photo_url,
|
success: () => {
|
uni.showToast({ title: '分享成功', icon: 'success' })
|
onShareModalClose()
|
},
|
fail: err => {
|
console.log('分享失败', err)
|
uni.showToast({
|
title: '分享失败,请重试',
|
icon: 'none',
|
})
|
onShareModalClose()
|
},
|
}
|
|
// 添加场景参数(如果有)
|
if (scene) {
|
shareConfig.scene = scene
|
}
|
|
uni.share(shareConfig)
|
} catch (error) {
|
console.error('分享出错:', error)
|
uni.showToast({
|
title: '分享功能异常',
|
icon: 'none',
|
})
|
onShareModalClose()
|
}
|
}
|
|
// 返回按钮点击事件
|
const onBackClick = () => {
|
uni.navigateBack()
|
}
|
|
// 监听导航栏右侧按钮点击事件(兼容原来的配置)
|
const onNavigationBarButtonTap = e => {
|
if (e.index === 0) {
|
onShareClick()
|
}
|
}
|
</script>
|
<style lang="scss" scoped>
|
.workDetailContainer {
|
// 添加导航栏高度的padding-top,避免内容被遮挡
|
padding-top: 44px;
|
// 分享按钮样式
|
.share-btn {
|
color: #1D6FE9;
|
font-size: 14px;
|
padding: 0 10px;
|
line-height: 44px;
|
}
|
.detailTop {
|
.image-container {
|
position: relative;
|
width: 100%;
|
height: 410rpx;
|
|
.detailImage {
|
width: 100%;
|
height: 100%;
|
display: block;
|
object-fit: cover;
|
}
|
// 轮播图容器
|
:deep(.u-swiper) {
|
// 指示器容器 - 修改为居中对齐
|
.u-swiper__indicator {
|
position: absolute;
|
left: 50%;
|
transform: translateX(-50%);
|
bottom: 20rpx;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
z-index: 10;
|
}
|
.u-swiper-indicator__wrapper__dot--active {
|
width: 5px !important;
|
}
|
}
|
.detailTitle {
|
position: absolute;
|
left: 0;
|
top: 0;
|
width: 100%;
|
height: 60rpx;
|
line-height: 60rpx;
|
background: rgba(7, 7, 7, 0.4);
|
}
|
|
.titleText {
|
display: flex;
|
width: 100%;
|
justify-content: space-between;
|
align-items: center;
|
color: #fff;
|
|
.itemName,
|
.itemTime {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #ffffff;
|
}
|
.itemName {
|
padding-left: 20rpx;
|
}
|
.itemTime {
|
padding-right: 20rpx;
|
}
|
}
|
}
|
}
|
|
.worderContainer {
|
padding: 0 24rpx;
|
padding-bottom: 4rpx;
|
background: #f6f6f6;
|
margin-top: 20rpx;
|
}
|
.workOrderContent {
|
margin-top: 30epx;
|
background-color: #fff;
|
border-radius: 12rpx;
|
padding: 20rpx;
|
margin-bottom: 34rpx;
|
.workOrderTitle {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: bold;
|
font-size: 32rpx;
|
color: #222324;
|
}
|
.workOrderContainer {
|
.orderRow {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
min-height: 96rpx;
|
border-bottom: 1px solid #f5f5f5;
|
color: #7b7b7b;
|
.rowTitle {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #222324;
|
white-space: nowrap;
|
}
|
.rowAddress {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #1d6fe9;
|
//white-space: nowrap;
|
///* 禁止换行 */
|
//overflow: hidden;
|
//text-overflow: ellipsis;
|
// max-width: 74%;
|
padding-top: 1px;
|
padding-left: 5px;
|
padding-right: 2px;
|
}
|
}
|
}
|
}
|
|
.actionButton {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
width: 100%;
|
height: 61px;
|
|
border-radius: 6px 6px 6px 6px;
|
|
.btngroups {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
:deep(.u-button) {
|
width: 276rpx !important;
|
height: 100rpx !important;
|
&:last-child {
|
margin-left: 30rpx;
|
}
|
}
|
}
|
}
|
}
|
|
/* 分享弹出层样式 */
|
.share-modal-overlay {
|
position: fixed;
|
top: 0;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
background-color: rgba(0, 0, 0, 0.6);
|
display: flex;
|
justify-content: flex-end;
|
align-items: flex-end;
|
z-index: 9999;
|
}
|
|
.share-modal-content {
|
background-color: #fff;
|
border-radius: 20rpx 20rpx 0 0;
|
padding: 30rpx;
|
width: 100%;
|
max-height: 80vh;
|
overflow-y: auto;
|
}
|
|
.share-modal-header {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-bottom: 30rpx;
|
}
|
|
.share-modal-title {
|
font-size: 36rpx;
|
font-weight: bold;
|
color: #222324;
|
text-align: center;
|
flex: 1;
|
}
|
|
.share-modal-close {
|
font-size: 60rpx;
|
color: #999;
|
line-height: 40rpx;
|
}
|
|
.share-modal-body {
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-around;
|
padding-bottom: 30rpx;
|
}
|
|
.share-modal-footer {
|
display: flex;
|
justify-content: space-around;
|
padding-top: 30rpx;
|
border-top: 1px solid #f0f0f0;
|
}
|
|
.share-item {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
margin: 20rpx;
|
width: 120rpx;
|
}
|
|
.share-icon {
|
width: 90rpx;
|
height: 90rpx;
|
border-radius: 50%;
|
margin-bottom: 15rpx;
|
background-size: contain;
|
background-repeat: no-repeat;
|
background-position: center;
|
}
|
|
.share-icon.wechat {
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%2307C160" d="M18.66 6.86l-1.41-1.42a1 1 0 00-1.42 0l-12 12a1 1 0 000 1.42l1.42 1.42a1 1 0 001.42 0l12-12a1 1 0 000-1.42z"/><path fill="%2307C160" d="M8.5 14.5c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm0-6a2 2 0 100 4 2 2 0 000-4zm7 6c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm0-6a2 2 0 100 4 2 2 0 000-4z"/></svg>');
|
}
|
|
.share-icon.moments {
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%2307C160" d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H6V4h12v16z"/><path fill="%2307C160" d="M12 6c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"/><path fill="%2307C160" d="M10 13.5h4v3h-4z"/></svg>');
|
}
|
|
|
.share-icon.link {
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23666" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>');
|
}
|
|
.share-icon.poster {
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23FFA500" d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z"/><path fill="%23FFA500" d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/></svg>');
|
}
|
|
.share-name {
|
font-size: 24rpx;
|
color: #666;
|
margin-top: 10rpx;
|
}
|
</style>
|