index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678
  1. <template>
  2. <view class="order-detail-page">
  3. <nav-bar title="订单详情"></nav-bar>
  4. <!-- 骨架屏 -->
  5. <view class="skeleton-page" v-if="loading">
  6. <view class="skeleton-header skeleton-box"></view>
  7. <view class="skeleton-progress skeleton-box"></view>
  8. <view class="skeleton-row-cards">
  9. <view class="skeleton-card skeleton-box"></view>
  10. <view class="skeleton-card skeleton-box"></view>
  11. </view>
  12. <view class="skeleton-content skeleton-box"></view>
  13. </view>
  14. <!-- 真实内容 -->
  15. <view class="real-content fade-in" v-else>
  16. <!-- 订单号与状态 -->
  17. <view class="order-header">
  18. <view class="order-id-row">
  19. <text class="order-id">{{ order.code || order.id }}</text>
  20. <text :class="['status-badge', `badge-${order.statusKey}`]">{{ order.statusText }}</text>
  21. <text class="service-badge">{{ currentServiceName }}</text>
  22. </view>
  23. </view>
  24. <!-- 状态进度条 -->
  25. <view class="progress-card">
  26. <view class="progress-steps">
  27. <view v-for="(step, i) in progressSteps" :key="i"
  28. :class="['step-item', { done: step.done, active: step.active }]">
  29. <view class="step-circle">
  30. <uni-icons v-if="step.done" type="checkmarkempty" size="12" color="#fff"></uni-icons>
  31. <text v-else class="step-num">{{ i + 1 }}</text>
  32. </view>
  33. <view class="step-line" v-if="i < progressSteps.length - 1" :class="{ done: step.done }"></view>
  34. <text class="step-label">{{ step.label }}</text>
  35. <text class="step-time">{{ step.time }}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- 宠物档案 + 用户信息 -->
  40. <view class="info-row-cards">
  41. <view class="info-card pet-card">
  42. <text class="card-label">宠物档案</text>
  43. <view class="pet-header">
  44. <view class="pet-avatar">
  45. <image v-if="order.petAvatarUrl" :src="order.petAvatarUrl" mode="aspectFill"
  46. class="avatar-img"></image>
  47. <text v-else>{{ (order.petName || '宠')[0] }}</text>
  48. </view>
  49. <view class="pet-basic">
  50. <text class="pet-name">
  51. {{ order.petName || '-' }}
  52. <text class="gender-male" v-if="order.petGender === 'male'">♂</text>
  53. <text class="gender-female" v-else-if="order.petGender === 'female'">♀</text>
  54. </text>
  55. <view class="pet-tags">
  56. <text class="mini-tag" v-if="order.petAge">{{ order.petAge }}</text>
  57. <text class="mini-tag" v-if="order.petWeight">{{ order.petWeight }}</text>
  58. <text class="breed-badge" v-if="order.petBreed">{{ order.petBreed }}</text>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="pet-attrs">
  63. <view class="attr-item">
  64. <text class="attr-label">品种</text>
  65. <text class="attr-val">{{ order.petBreed || '-' }}</text>
  66. </view>
  67. <view class="attr-item">
  68. <text class="attr-label">疫苗状态</text>
  69. <text class="attr-val highlight">{{ order.petVaccine || '-' }}</text>
  70. </view>
  71. <view class="attr-item full">
  72. <text class="attr-label">性格特点</text>
  73. <text class="attr-val">{{ order.petCharacter || '-' }}</text>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="info-card user-card">
  78. <text class="card-label">用户信息</text>
  79. <view class="user-header">
  80. <view class="user-avatar">
  81. <image v-if="order.userAvatarUrl" :src="order.userAvatarUrl" mode="aspectFill"
  82. class="avatar-img"></image>
  83. <uni-icons v-else type="person" size="26" color="#aaa"></uni-icons>
  84. </view>
  85. <view class="user-basic">
  86. <text class="user-name-text">{{ order.userName }}</text>
  87. <text class="user-phone">{{ order.userPhone }}</text>
  88. </view>
  89. </view>
  90. <view class="service-address-box">
  91. <text class="addr-label">服务地址</text>
  92. <text class="addr-text">{{ order.address }}</text>
  93. </view>
  94. </view>
  95. </view>
  96. <!-- 标签页 -->
  97. <view class="detail-tabs-wrap">
  98. <view class="tab-nav">
  99. <view v-for="tab in tabList" :key="tab.name"
  100. :class="['tab-nav-item', { active: activeTab === tab.name }]" @click="activeTab = tab.name">
  101. <text>{{ tab.title }}</text>
  102. </view>
  103. </view>
  104. <!-- 任务详情扩展板块 -->
  105. <view class="tab-content" v-if="activeTab === 'base'">
  106. <view class="base-info-grid">
  107. <view class="bi-item" v-for="item in baseInfoList" :key="item.label">
  108. <text class="bi-label">{{ item.label }}</text>
  109. <text :class="['bi-val', item.highlight ? 'highlight' : '']">{{ item.value }}</text>
  110. </view>
  111. </view>
  112. <!-- 接送任务详情 -->
  113. <block v-if="order.type === 'transport'">
  114. <text class="sub-title">接送任务详情</text>
  115. <view class="task-card transport-card">
  116. <view class="task-header">
  117. <text class="type-tag" :class="getTransportClass(order.subOrderType)">
  118. {{ getTransportLabel(order.subOrderType) }}
  119. </text>
  120. <text class="task-time">{{ order.serviceTime }}</text>
  121. </view>
  122. <view class="task-body">
  123. <view class="task-row">
  124. <text class="task-label">起点</text>
  125. <text class="task-value">{{ order.fromAddress || '-' }}</text>
  126. </view>
  127. <view class="task-row">
  128. <text class="task-label">终点</text>
  129. <text class="task-value">{{ order.toAddress || '-' }}</text>
  130. </view>
  131. <view class="task-row contact-row">
  132. <text class="task-value">{{ order.userName }} — {{ order.userPhone }}</text>
  133. </view>
  134. </view>
  135. </view>
  136. </block>
  137. <!-- 上门服务执行要求 -->
  138. <block v-if="['feeding', 'washing'].includes(order.type)">
  139. <text class="sub-title">服务执行要求</text>
  140. <view class="task-card req-card">
  141. <view class="req-item">
  142. <text class="req-label">服务地址</text>
  143. <text class="req-value">{{ order.address }}</text>
  144. </view>
  145. </view>
  146. </block>
  147. </view>
  148. <!-- 指派履约者 -->
  149. <view class="tab-content" v-if="activeTab === 'assignee'">
  150. <view class="empty-state" v-if="order.statusKey === 'wait_dispatch'">
  151. <uni-icons type="clock" size="40" color="#ccc"></uni-icons>
  152. <text class="empty-text">等待派单中...</text>
  153. </view>
  154. <view class="assignee-card" v-else>
  155. <view class="assignee-header">
  156. <view class="assignee-avatar">
  157. <image v-if="order.assigneeAvatarUrl" :src="order.assigneeAvatarUrl" mode="aspectFill"
  158. class="avatar-img"></image>
  159. <uni-icons v-else type="person" size="30" color="#aaa"></uni-icons>
  160. </view>
  161. <view class="assignee-info">
  162. <text class="assignee-name">{{ order.assigneeName }}</text>
  163. <text class="assignee-phone">联系电话:{{ order.assigneePhone }}</text>
  164. <text class="assignee-zone">归属区域:{{ order.assigneeZone }}</text>
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. <!-- 服务进度 -->
  170. <view class="tab-content" v-if="activeTab === 'progress'">
  171. <view class="empty-state"
  172. v-if="['wait_dispatch', 'wait_accept'].includes(order.statusKey) || serviceTimeline.length === 0">
  173. <uni-icons type="info" size="40" color="#ccc"></uni-icons>
  174. <text class="empty-text">服务尚未开始或暂无进度</text>
  175. </view>
  176. <view class="timeline" v-else>
  177. <view class="tl-item" v-for="(tl, i) in serviceTimeline" :key="i">
  178. <view class="tl-dot"></view>
  179. <view class="tl-body">
  180. <text class="tl-time">{{ tl.time }}</text>
  181. <text class="tl-title">{{ tl.title }}</text>
  182. <text class="tl-desc">{{ tl.desc }}</text>
  183. <view class="tl-media" v-if="tl.media && tl.media.length">
  184. <view v-for="(item, idx) in tl.media" :key="idx" class="media-item">
  185. <image v-if="item.type === 'image'" mode="aspectFill" :src="item.url"
  186. class="p-img" @click="previewImage(item.url, tl.media)"></image>
  187. <view v-else-if="item.type === 'video'" class="p-video-box"
  188. @click="openVideoPreview(item.url)">
  189. <image src="/static/video-placeholder.png" mode="aspectFill" class="p-img"
  190. style="background:#000;"></image>
  191. <view class="play-icon-overlay">
  192. <uni-icons type="videocam-filled" size="30" color="#fff"></uni-icons>
  193. </view>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. </view>
  199. </view>
  200. </view>
  201. <!-- 订单日志 -->
  202. <view class="tab-content" v-if="activeTab === 'log'">
  203. <view class="empty-state" v-if="orderLogs.length === 0">
  204. <uni-icons type="info" size="40" color="#ccc"></uni-icons>
  205. <text class="empty-text">暂无订单日志</text>
  206. </view>
  207. <view class="timeline" v-else>
  208. <view class="tl-item" v-for="(log, i) in orderLogs" :key="i">
  209. <view class="tl-dot log-dot"></view>
  210. <view class="tl-body">
  211. <text class="tl-time">{{ log.time }}</text>
  212. <text class="tl-title">{{ log.title }}</text>
  213. <text class="tl-desc">{{ log.desc }}</text>
  214. </view>
  215. </view>
  216. </view>
  217. </view>
  218. <!-- 投诉记录 -->
  219. <view class="tab-content" v-if="activeTab === 'complaint'">
  220. <view class="empty-state" v-if="complaintList.length === 0">
  221. <uni-icons type="info" size="40" color="#ccc"></uni-icons>
  222. <text class="empty-text">暂无投诉记录</text>
  223. </view>
  224. <view class="timeline" v-else>
  225. <view class="tl-item" v-for="(complaint, i) in complaintList" :key="i">
  226. <view class="tl-dot" style="background: #f56c6c;"></view>
  227. <view class="tl-body">
  228. <text class="tl-time">{{ complaint.createTime }}</text>
  229. <text class="tl-title">投诉原因:{{ complaint.reason }}</text>
  230. <view v-if="complaint.photoUrls" class="tl-media">
  231. <view v-for="(url, idx) in (complaint.photoUrls || '').split(',')" :key="idx"
  232. class="media-item">
  233. <image mode="aspectFill" :src="url" class="p-img"
  234. @click="previewImage(url, (complaint.photoUrls || '').split(','))"></image>
  235. </view>
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. </view>
  241. <!-- 服务变更记录 -->
  242. <view class="tab-content" v-if="activeTab === 'serviceChange'">
  243. <view class="empty-state" v-if="serviceChangeList.length === 0">
  244. <uni-icons type="info" size="40" color="#ccc"></uni-icons>
  245. <text class="empty-text">暂无服务变更记录</text>
  246. </view>
  247. <view class="timeline" v-else>
  248. <view class="tl-item" v-for="(change, i) in serviceChangeList" :key="i">
  249. <view class="tl-dot" style="background: #409eff;"></view>
  250. <view class="tl-body">
  251. <text class="tl-time">{{ change.createTime }}</text>
  252. <text class="tl-title">服务变更 - {{ change.service }}</text>
  253. <text class="tl-desc">申诉理由:{{ change.reason }}</text>
  254. <text class="tl-desc" v-if="change.auditStatus === 1"
  255. style="color:#67c23a;">审核状态:已通过</text>
  256. <text class="tl-desc" v-else-if="change.auditStatus === 2"
  257. style="color:#f56c6c;">审核状态:已驳回</text>
  258. <text class="tl-desc" v-else style="color:#e6a23c;">审核状态:待审核</text>
  259. <view v-if="change.photoUrls" class="tl-media">
  260. <view v-for="(url, idx) in (change.photoUrls || '').split(',')" :key="idx"
  261. class="media-item">
  262. <image mode="aspectFill" :src="url" class="p-img"
  263. @click="previewImage(url, (change.photoUrls || '').split(','))"></image>
  264. </view>
  265. </view>
  266. </view>
  267. </view>
  268. </view>
  269. </view>
  270. </view>
  271. </view>
  272. <!-- 视频全屏预览 -->
  273. <view class="video-preview-mask" v-if="videoPreview.visible" @click.stop="closeVideoPreview">
  274. <video :src="videoPreview.url" autoplay controls class="preview-video" @click.stop></video>
  275. <view class="close-video-btn" @click.stop="closeVideoPreview">
  276. <uni-icons type="closeempty" size="24" color="#fff"></uni-icons>
  277. </view>
  278. </view>
  279. <!-- 底部操作按钮 -->
  280. <view class="cancel-bar safe-bottom"
  281. v-if="!loading && (['wait_dispatch', 'wait_accept'].includes(order.statusKey) || ['serving', 'done'].includes(order.statusKey) && order.fulfiller)">
  282. <button v-if="['wait_dispatch', 'wait_accept'].includes(order.statusKey)" class="cancel-order-btn"
  283. @click="onCancelOrder">取消订单</button>
  284. <button v-if="['serving', 'done'].includes(order.statusKey) && order.fulfiller" class="complaint-btn"
  285. @click="onComplaint">投诉订单</button>
  286. </view>
  287. <!-- 自定义取消订单弹窗 -->
  288. <view class="custom-modal" v-if="showCancelModal">
  289. <view class="modal-mask" @click="closeCancelModal"></view>
  290. <view class="modal-content">
  291. <view class="modal-title">提示</view>
  292. <view class="modal-body">
  293. <view style="margin-bottom: 20rpx; font-size: 28rpx; color: #666;">确定要取消订单 [{{ order.id }}] 吗?
  294. </view>
  295. <textarea class="cancel-input" v-model="cancelReason" placeholder="必填,请输入取消原因"
  296. placeholder-class="ph-color" :show-confirm-bar="false"></textarea>
  297. </view>
  298. <view class="modal-footer">
  299. <view class="modal-btn btn-cancel" @click="closeCancelModal">取消</view>
  300. <view class="modal-btn btn-confirm" @click="confirmCancelOrder">确定</view>
  301. </view>
  302. </view>
  303. </view>
  304. </view>
  305. </template>
  306. <script setup>
  307. import { ref, reactive, computed, watch } from 'vue'
  308. import { onLoad } from '@dcloudio/uni-app'
  309. import navBar from '@/components/nav-bar/index.vue'
  310. import { getSubOrderInfo, cancelSubOrder } from '@/api/order/subOrder'
  311. import { getPet } from '@/api/archieves/pet'
  312. import { getCustomer } from '@/api/archieves/customer'
  313. import { getFulfiller } from '@/api/fulfiller/fulfiller'
  314. import { listSubOrderLog } from '@/api/order/subOrderLog'
  315. import { listComplaintByOrder } from '@/api/fulfiller/complaint'
  316. import { listSubOrderAppealByOrderId } from '@/api/order/subOrderAppeal'
  317. const activeTab = ref('base')
  318. const activeService = ref('transport')
  319. const orderId = ref('')
  320. const loading = ref(true)
  321. const tabList = [
  322. { title: '基础信息', name: 'base' },
  323. { title: '履约者', name: 'assignee' },
  324. { title: '服务进度', name: 'progress' },
  325. { title: '订单日志', name: 'log' },
  326. { title: '服务变更', name: 'serviceChange' },
  327. { title: '投诉记录', name: 'complaint' }
  328. ]
  329. const currentServiceName = computed(() => {
  330. const map = { transport: '宠物接送', feed: '上门喂遛', wash: '上门洗护' }
  331. return map[activeService.value]
  332. })
  333. const order = reactive({
  334. id: '',
  335. code: '',
  336. statusKey: 'pending_service',
  337. statusText: '待服务',
  338. status: 2,
  339. petName: '',
  340. petBreed: '',
  341. petAge: '',
  342. petWeight: '',
  343. petGender: '',
  344. petVaccine: '',
  345. petCharacter: '',
  346. petHealth: '',
  347. userName: '',
  348. userPhone: '',
  349. address: '',
  350. shopName: '',
  351. createTime: '',
  352. bookTime: '',
  353. packageName: '',
  354. remark: '',
  355. assigneeName: '',
  356. cancelTime: '',
  357. orderCommission: 0,
  358. pickAddress: '',
  359. pickTime: '',
  360. sendAddress: '',
  361. sendTime: '',
  362. fromAddress: '',
  363. toAddress: '',
  364. type: 'transport', // 对应后端 transport/feeding/washing
  365. subOrderType: 0, // 接送子类型
  366. service: '',
  367. pet: '',
  368. customer: '',
  369. fulfiller: '',
  370. fulfillerName: '',
  371. assigneePhone: '-',
  372. assigneeZone: '-',
  373. petAvatarUrl: '',
  374. userAvatarUrl: '',
  375. assigneeAvatarUrl: ''
  376. })
  377. const orderLogsData = ref([])
  378. const fulfillerLogsData = ref([])
  379. const complaintList = ref([])
  380. const serviceChangeList = ref([])
  381. const loadOrderDetail = async (id) => {
  382. if (!id) return
  383. loading.value = true
  384. try {
  385. const res = await getSubOrderInfo(id)
  386. console.log('订单详情返回:', res)
  387. if (res) {
  388. // 手动逐个赋值,避免 Object.assign 导致的全量字段触发及潜在的递归更新
  389. order.id = res.id
  390. order.code = res.code || res.id
  391. order.status = res.status
  392. order.statusKey = getStatusKey(res.status)
  393. order.statusText = getStatusName(res.status)
  394. order.bookTime = res.serviceTime || '-'
  395. order.shopName = res.storeName || '-'
  396. order.userName = res.customerName || '-'
  397. order.userPhone = res.contactPhoneNumber || '-'
  398. order.assigneeName = res.fulfillerName || '-'
  399. order.remark = res.remark || '-'
  400. order.fromAddress = res.fromAddress || '-'
  401. order.toAddress = res.toAddress || '-'
  402. order.address = res.address || res.toAddress || '-'
  403. order.type = res.type || 'transport'
  404. order.subOrderType = res.subOrderType
  405. order.pet = res.usrPet
  406. order.customer = res.usrCustomer
  407. order.fulfiller = res.fulfiller
  408. order.packageName = res.groupPurchasePackageName || res.packageName || '-'
  409. order.createTime = res.createTime || '-'
  410. order.orderCommission = res.orderCommission || 0
  411. // 并行加载关联信息,提升效率并减少串行触发的重演
  412. const tasks = []
  413. if (res.usrPet) tasks.push(loadPetInfo(res.usrPet))
  414. if (res.usrCustomer) tasks.push(loadCustomerInfo(res.usrCustomer))
  415. if (res.fulfiller) tasks.push(loadFulfillerInfo(res.fulfiller))
  416. await Promise.all([
  417. ...tasks,
  418. loadOrderLogs(id),
  419. loadComplaints(id),
  420. loadServiceChanges(id)
  421. ])
  422. }
  423. } catch (error) {
  424. console.error('加载订单详情失败:', error)
  425. uni.showToast({ title: typeof error === 'string' ? error : '请求失败', icon: 'none' })
  426. } finally {
  427. loading.value = false
  428. }
  429. }
  430. const loadPetInfo = async (petId) => {
  431. try {
  432. const res = await getPet(petId)
  433. if (res) {
  434. const data = res.data || res
  435. console.log('宠物详情 res:', data)
  436. order.petName = data.name || '-'
  437. order.petBreed = data.breed || '-'
  438. order.petAge = data.age ? `${data.age}岁` : '-'
  439. order.petWeight = data.weight ? `${data.weight}kg` : '-'
  440. order.petGender = Number(data.gender) === 1 ? 'male' : (Number(data.gender) > 0 ? 'female' : '')
  441. order.petVaccine = data.vaccineStatus || '-'
  442. order.petCharacter = data.cutePersonality || data.personality || '-'
  443. order.petHealth = data.healthStatus || '-'
  444. order.petAvatarUrl = data.avatarUrl || ''
  445. }
  446. } catch (error) {
  447. console.error('加载宠物信息失败:', error)
  448. uni.showToast({ title: typeof error === 'string' ? error : '加载宠物信息失败', icon: 'none' })
  449. }
  450. }
  451. const loadCustomerInfo = async (customerId) => {
  452. try {
  453. const res = await getCustomer(customerId)
  454. if (res) {
  455. const data = res.data || res
  456. console.log('客户详情 res:', data)
  457. order.userName = data.name || '-'
  458. order.userPhone = data.phone || '-'
  459. order.address = data.address || '-'
  460. order.userAvatarUrl = data.avatarUrl || ''
  461. }
  462. } catch (error) {
  463. console.error('加载客户信息失败:', error)
  464. uni.showToast({ title: typeof error === 'string' ? error : '加载客户信息失败', icon: 'none' })
  465. }
  466. }
  467. const loadFulfillerInfo = async (fulfillerId) => {
  468. try {
  469. const res = await getFulfiller(fulfillerId)
  470. if (res) {
  471. const data = res.data || res
  472. console.log('履约者详情 res:', data)
  473. order.assigneeName = data.name || order.assigneeName
  474. order.assigneePhone = data.phone || '-'
  475. order.assigneeZone = data.stationName || '-'
  476. order.assigneeAvatarUrl = data.avatarUrl || data.avatar || ''
  477. }
  478. } catch (error) {
  479. console.error('加载履约者信息失败:', error)
  480. uni.showToast({ title: typeof error === 'string' ? error : '加载履约者信息失败', icon: 'none' })
  481. }
  482. }
  483. const loadOrderLogs = async (id) => {
  484. try {
  485. const res = await listSubOrderLog({ orderId: id })
  486. const list = res || []
  487. orderLogsData.value = list.filter(i => Number(i?.logType) === 0)
  488. fulfillerLogsData.value = list.filter(i => Number(i?.logType) === 1)
  489. } catch (error) {
  490. console.error('加载订单日志失败:', error)
  491. uni.showToast({ title: typeof error === 'string' ? error : '加载订单日志失败', icon: 'none' })
  492. orderLogsData.value = []
  493. fulfillerLogsData.value = []
  494. }
  495. }
  496. const loadComplaints = async (id) => {
  497. try {
  498. const res = await listComplaintByOrder(id)
  499. complaintList.value = res || []
  500. } catch (error) {
  501. console.error('加载投诉记录失败:', error)
  502. uni.showToast({ title: typeof error === 'string' ? error : '加载投诉记录失败', icon: 'none' })
  503. complaintList.value = []
  504. }
  505. }
  506. const loadServiceChanges = async (id) => {
  507. try {
  508. const res = await listSubOrderAppealByOrderId(id)
  509. serviceChangeList.value = res || []
  510. } catch (error) {
  511. console.error('加载服务变更记录失败:', error)
  512. uni.showToast({ title: typeof error === 'string' ? error : '加载服务变更记录失败', icon: 'none' })
  513. serviceChangeList.value = []
  514. }
  515. }
  516. const getStatusKey = (status) => {
  517. const map = { 0: 'wait_dispatch', 1: 'wait_accept', 2: 'pending_service', 3: 'serving', 4: 'done', 5: 'cancel', 6: 'rejected', 7: 'closed' }
  518. return map[status] || 'serving'
  519. }
  520. const getStatusName = (status) => {
  521. const map = { 0: '待派单', 1: '待接单', 2: '待服务', 3: '服务中', 4: '已完成', 5: '已取消', 6: '已拒绝', 7: '已关闭' }
  522. return map[status] || '-'
  523. }
  524. const getTransportLabel = (t) => {
  525. if (t === 0 || t === '0') return '接'
  526. if (t === 1 || t === '1') return '送'
  527. if (t === 2 || t === '2') return '单程接'
  528. if (t === 3 || t === '3') return '单程送'
  529. return '接送'
  530. }
  531. const getTransportClass = (t) => {
  532. if (t === 0 || t === '0' || t === 2 || t === '2') return 'tag-blue'
  533. return 'tag-orange'
  534. }
  535. const getTypeName = (type) => {
  536. const map = { transport: '宠物接送', feeding: '上门喂遛', washing: '上门洗护' }
  537. return map[type] || '-'
  538. }
  539. onLoad((options) => {
  540. // 防御性校验:id 必须是有效值(非空、非字符串 "undefined")
  541. if (options.id && options.id !== 'undefined') {
  542. orderId.value = options.id
  543. console.log('订单详情页:接收到的订单ID =', options.id)
  544. loadOrderDetail(options.id)
  545. } else {
  546. console.error('订单详情页:缺少有效的订单ID,options =', options)
  547. uni.showToast({ title: '订单ID无效', icon: 'none' })
  548. loading.value = false
  549. }
  550. if (options.service) activeService.value = options.service
  551. })
  552. const progressSteps = computed(() => {
  553. const status = Number(order.status)
  554. const getSystemLogTime = (step) => {
  555. const log = (orderLogsData.value || []).find(l => parseInt(l.step) === step)
  556. return log ? (log.createTime || log.time) : ''
  557. }
  558. const getFulfillerLogTime = (step) => {
  559. const log = (fulfillerLogsData.value || []).find(l => parseInt(l.step) === step)
  560. return log ? (log.createTime || log.time) : ''
  561. }
  562. // 已取消 — 特殊两步流程
  563. if (status === 5) {
  564. const cancelTime = getSystemLogTime(5) || order.cancelTime || ''
  565. return [
  566. { label: '商户下单', time: (getSystemLogTime(0) || order.createTime || '').substring(5, 16), done: true, active: false },
  567. { label: '已取消', time: cancelTime.substring(5, 16), done: true, active: true }
  568. ]
  569. }
  570. // 已拒绝 — 特殊两步流程
  571. if (status === 6) {
  572. return [
  573. { label: '商户下单', time: (getSystemLogTime(0) || order.createTime || '').substring(5, 16), done: true, active: false },
  574. { label: '已拒绝', time: '', done: true, active: true }
  575. ]
  576. }
  577. // 已关闭 — 特殊两步流程
  578. if (status === 7) {
  579. return [
  580. { label: '商户下单', time: (getSystemLogTime(0) || order.createTime || '').substring(5, 16), done: true, active: false },
  581. { label: '已关闭', time: '', done: true, active: true }
  582. ]
  583. }
  584. // 六步流程(全四字):商户下单 → 运营派单 → 履约接单 → 等待服务 → 服务进行 → 订单完成
  585. const steps = [
  586. { label: '商户下单', time: getSystemLogTime(0) || order.createTime || '' },
  587. { label: '运营派单', time: getSystemLogTime(1) || '' },
  588. { label: '履约接单', time: getSystemLogTime(2) || getFulfillerLogTime(0) || '' },
  589. { label: '等待服务', time: getSystemLogTime(3) || '' },
  590. { label: '服务进行', time: getFulfillerLogTime(99) || '' },
  591. { label: '订单完成', time: getSystemLogTime(4) || '' }
  592. ]
  593. let active = 1 // 默认停在「运营派单」
  594. switch (status) {
  595. case 0: // 待派单
  596. active = 1
  597. break
  598. case 1: // 待接单
  599. active = 2
  600. steps[2].label = '等待接单'
  601. break
  602. case 2: // 待服务
  603. active = 3
  604. steps[2].label = '已确认接'
  605. steps[3].label = '等待服务'
  606. break
  607. case 3: // 服务中(到达打卡)
  608. active = 4
  609. steps[2].label = '已确认接'
  610. steps[3].label = '已到达点'
  611. steps[4].label = '服务进行'
  612. break
  613. case 4: // 已完成
  614. active = 6
  615. steps[2].label = '已确认接'
  616. steps[3].label = '已到达点'
  617. steps[4].label = '服务进行'
  618. break
  619. }
  620. return steps.map((s, i) => ({
  621. label: s.label,
  622. time: s.time ? s.time.substring(5, 16) : '',
  623. done: i < active,
  624. active: i === active
  625. }))
  626. })
  627. const baseInfoList = computed(() => {
  628. const list = [
  629. { label: '系统单号', value: order.code || order.id },
  630. { label: '服务类型', value: currentServiceName.value },
  631. { label: '订单金额', value: `¥${(order.orderCommission / 100).toFixed(2)}`, highlight: true },
  632. { label: '归属门店', value: order.shopName },
  633. { label: '宠主信息', value: `${order.userName} / ${order.userPhone}` },
  634. { label: '预约时间', value: order.bookTime },
  635. { label: '团购套餐', value: order.packageName },
  636. { label: '创建时间', value: order.createTime },
  637. { label: '订单备注', value: order.remark }
  638. ]
  639. if (order.statusKey === 'cancel') list.push({ label: '取消时间', value: order.cancelTime || '2024-02-02 11:30', highlight: true })
  640. return list
  641. })
  642. // 视频判定辅助函数
  643. const isVideo = (url) => {
  644. if (!url) return false;
  645. const videoExts = ['.mp4', '.mov', '.avi', '.wmv', '.webm', '.ogg'];
  646. return videoExts.some(ext => String(url).toLowerCase().endsWith(ext));
  647. }
  648. const videoPreview = reactive({
  649. visible: false,
  650. url: ''
  651. })
  652. const openVideoPreview = (url) => {
  653. videoPreview.url = url;
  654. videoPreview.visible = true;
  655. }
  656. const closeVideoPreview = () => {
  657. videoPreview.visible = false;
  658. videoPreview.url = '';
  659. }
  660. const previewImage = (url, mediaList) => {
  661. let imgUrls = []
  662. if (Array.isArray(mediaList)) {
  663. if (mediaList.length > 0 && typeof mediaList[0] === 'string') {
  664. // 直接的URL数组(服务变更记录)
  665. imgUrls = mediaList
  666. } else {
  667. // 包含type属性的对象数组
  668. imgUrls = mediaList.filter(m => m.type === 'image').map(m => m.url)
  669. }
  670. } else if (typeof mediaList === 'string') {
  671. // 单个URL
  672. imgUrls = [mediaList]
  673. }
  674. uni.previewImage({
  675. current: url,
  676. urls: imgUrls
  677. });
  678. }
  679. const serviceTimeline = computed(() => {
  680. const list = fulfillerLogsData.value || []
  681. return list.map((i) => {
  682. const rawUrls = i?.photoUrls || [];
  683. const urlList = Array.isArray(rawUrls) ? rawUrls : (typeof rawUrls === 'string' ? rawUrls.split(',').filter(Boolean) : []);
  684. const media = urlList.map(url => {
  685. const type = isVideo(url) ? 'video' : 'image';
  686. return { type, url }
  687. });
  688. return {
  689. title: i?.title || '-',
  690. time: i?.createTime || i?.time || '',
  691. desc: i?.content || '',
  692. media: media
  693. }
  694. })
  695. })
  696. const orderLogs = computed(() => {
  697. return (orderLogsData.value || []).map(log => ({
  698. time: log.createTime || log.time || '',
  699. title: log.title,
  700. desc: log.content
  701. }))
  702. })
  703. const showCancelModal = ref(false)
  704. const cancelReason = ref('')
  705. const onCancelOrder = () => {
  706. cancelReason.value = ''
  707. showCancelModal.value = true
  708. }
  709. const closeCancelModal = () => {
  710. showCancelModal.value = false
  711. }
  712. const confirmCancelOrder = async () => {
  713. const reason = cancelReason.value.trim()
  714. if (!reason) {
  715. uni.showToast({ title: '取消原因不能为空', icon: 'none' })
  716. return
  717. }
  718. try {
  719. uni.showLoading({ title: '处理中' })
  720. await cancelSubOrder({ orderId: order.id, reason })
  721. uni.hideLoading()
  722. uni.showToast({ title: '订单已取消', icon: 'success' })
  723. showCancelModal.value = false
  724. // 重新初始化页面数据
  725. loadOrderDetail(order.id)
  726. } catch (error) {
  727. uni.hideLoading()
  728. console.error('取消订单失败:', error)
  729. uni.showToast({ title: typeof error === 'string' ? error : '取消失败', icon: 'none' })
  730. }
  731. }
  732. const onComplaint = () => {
  733. uni.navigateTo({
  734. url: `/pages/my/complaint/submit/index?orderId=${order.id}&fulfillerId=${order.fulfiller}&orderCode=${order.code}`
  735. })
  736. }
  737. </script>
  738. <style lang="scss" scoped>
  739. .order-detail-page {
  740. background: #f2f3f7;
  741. min-height: 100vh;
  742. padding-bottom: 160rpx;
  743. }
  744. .order-header {
  745. padding: 24rpx 32rpx 16rpx;
  746. }
  747. .order-id-row {
  748. display: flex;
  749. align-items: center;
  750. gap: 16rpx;
  751. flex-wrap: wrap;
  752. }
  753. .order-id {
  754. font-size: 26rpx;
  755. color: #666;
  756. font-family: monospace;
  757. }
  758. .status-badge {
  759. font-size: 22rpx;
  760. padding: 4rpx 16rpx;
  761. border-radius: 20rpx;
  762. font-weight: 600;
  763. }
  764. .badge-wait_dispatch {
  765. background: #fff0f0;
  766. color: #f44336;
  767. }
  768. .badge-wait_accept {
  769. background: #fff8e1;
  770. color: #ff9800;
  771. }
  772. .badge-pending_service {
  773. background: #e3f2fd;
  774. color: #49a3ff;
  775. }
  776. .badge-serving {
  777. background: #e3f2fd;
  778. color: #2196f3;
  779. }
  780. .badge-done {
  781. background: #e8f5e9;
  782. color: #4caf50;
  783. }
  784. .badge-cancel {
  785. background: #f5f5f5;
  786. color: #9e9e9e;
  787. }
  788. .service-badge {
  789. font-size: 22rpx;
  790. padding: 4rpx 16rpx;
  791. border-radius: 20rpx;
  792. background: #fff3e0;
  793. color: #ff9500;
  794. }
  795. .progress-card {
  796. background: #fff;
  797. margin: 0 24rpx 24rpx;
  798. border-radius: 28rpx;
  799. padding: 32rpx 16rpx 24rpx;
  800. }
  801. .progress-steps {
  802. display: flex;
  803. align-items: flex-start;
  804. }
  805. .step-item {
  806. display: flex;
  807. flex-direction: column;
  808. align-items: center;
  809. flex: 1;
  810. position: relative;
  811. z-index: 1;
  812. }
  813. .step-circle {
  814. width: 44rpx;
  815. height: 44rpx;
  816. border-radius: 50%;
  817. background: #e0e0e0;
  818. display: flex;
  819. align-items: center;
  820. justify-content: center;
  821. margin-bottom: 8rpx;
  822. position: relative;
  823. z-index: 2;
  824. }
  825. .step-num {
  826. font-size: 20rpx;
  827. color: #fff;
  828. }
  829. .step-item.done .step-circle,
  830. .step-item.active .step-circle {
  831. background: #ff9500;
  832. }
  833. .step-line {
  834. position: absolute;
  835. top: 22rpx;
  836. left: 50%;
  837. width: 100%;
  838. height: 4rpx;
  839. background: #e0e0e0;
  840. z-index: 0;
  841. }
  842. .step-line.done {
  843. background: #ff9500;
  844. }
  845. .step-label {
  846. font-size: 20rpx;
  847. color: #999;
  848. text-align: center;
  849. }
  850. .step-item.done .step-label,
  851. .step-item.active .step-label {
  852. color: #ff9500;
  853. font-weight: 600;
  854. }
  855. .step-time {
  856. font-size: 18rpx;
  857. color: #bbb;
  858. margin-top: 4rpx;
  859. }
  860. .info-row-cards {
  861. display: flex;
  862. gap: 20rpx;
  863. margin: 0 24rpx 24rpx;
  864. }
  865. .info-card {
  866. flex: 1;
  867. background: #fff;
  868. border-radius: 28rpx;
  869. padding: 24rpx;
  870. min-width: 0;
  871. }
  872. .card-label {
  873. display: block;
  874. font-size: 24rpx;
  875. font-weight: 700;
  876. color: #333;
  877. margin-bottom: 20rpx;
  878. border-left: 6rpx solid #ff9500;
  879. padding-left: 12rpx;
  880. }
  881. .pet-header {
  882. display: flex;
  883. align-items: center;
  884. gap: 16rpx;
  885. margin-bottom: 20rpx;
  886. }
  887. .pet-avatar,
  888. .user-avatar,
  889. .assignee-avatar {
  890. width: 80rpx;
  891. height: 80rpx;
  892. border-radius: 50%;
  893. background: #f0f2f5;
  894. display: flex;
  895. align-items: center;
  896. justify-content: center;
  897. overflow: hidden;
  898. flex-shrink: 0;
  899. .avatar-img {
  900. width: 100%;
  901. height: 100%;
  902. }
  903. }
  904. .pet-basic {
  905. flex: 1;
  906. min-width: 0;
  907. }
  908. .pet-name {
  909. display: block;
  910. font-size: 28rpx;
  911. font-weight: bold;
  912. color: #222;
  913. }
  914. .gender-male {
  915. color: #409eff;
  916. margin-left: 4rpx;
  917. }
  918. .gender-female {
  919. color: #f56c6c;
  920. margin-left: 4rpx;
  921. }
  922. .pet-tags {
  923. display: flex;
  924. flex-wrap: wrap;
  925. gap: 12rpx;
  926. margin-top: 10rpx;
  927. align-items: center;
  928. }
  929. .mini-tag {
  930. font-size: 20rpx;
  931. background: #f5f5f5;
  932. border-radius: 8rpx;
  933. padding: 4rpx 12rpx;
  934. color: #666;
  935. white-space: nowrap;
  936. }
  937. .breed-badge {
  938. font-size: 20rpx;
  939. background: #ffe0b2;
  940. color: #e65100;
  941. border-radius: 8rpx;
  942. padding: 4rpx 12rpx;
  943. white-space: nowrap;
  944. }
  945. .pet-attrs {
  946. display: flex;
  947. flex-wrap: wrap;
  948. gap: 12rpx 0;
  949. }
  950. .attr-item {
  951. width: 50%;
  952. }
  953. .attr-item.full {
  954. width: 100%;
  955. }
  956. .attr-label {
  957. display: block;
  958. font-size: 20rpx;
  959. color: #aaa;
  960. }
  961. .attr-val {
  962. display: block;
  963. font-size: 22rpx;
  964. color: #333;
  965. }
  966. .attr-val.highlight {
  967. color: #4caf50;
  968. }
  969. .user-header {
  970. display: flex;
  971. align-items: center;
  972. gap: 16rpx;
  973. margin-bottom: 20rpx;
  974. }
  975. .user-name-text {
  976. display: block;
  977. font-size: 28rpx;
  978. font-weight: bold;
  979. color: #222;
  980. }
  981. .user-phone {
  982. display: block;
  983. font-size: 24rpx;
  984. color: #666;
  985. }
  986. .service-address-box {
  987. background: #fff8f0;
  988. border-radius: 16rpx;
  989. padding: 16rpx;
  990. }
  991. .addr-label {
  992. display: block;
  993. font-size: 20rpx;
  994. color: #ff9500;
  995. margin-bottom: 6rpx;
  996. }
  997. .addr-text {
  998. display: block;
  999. font-size: 22rpx;
  1000. color: #333;
  1001. line-height: 1.5;
  1002. }
  1003. .detail-tabs-wrap {
  1004. margin: 0 24rpx;
  1005. background: #fff;
  1006. border-radius: 28rpx;
  1007. overflow: hidden;
  1008. }
  1009. .tab-nav {
  1010. display: flex;
  1011. border-bottom: 2rpx solid #EEEEEE;
  1012. }
  1013. .tab-nav-item {
  1014. flex: 1;
  1015. text-align: center;
  1016. padding: 24rpx 0;
  1017. font-size: 24rpx;
  1018. color: #666;
  1019. position: relative;
  1020. }
  1021. .tab-nav-item.active {
  1022. color: #ff9500;
  1023. font-weight: bold;
  1024. }
  1025. .tab-nav-item.active::after {
  1026. content: '';
  1027. position: absolute;
  1028. bottom: 0;
  1029. left: 50%;
  1030. transform: translateX(-50%);
  1031. width: 48rpx;
  1032. height: 6rpx;
  1033. background: #ff9500;
  1034. border-radius: 6rpx;
  1035. }
  1036. .tab-content {
  1037. padding: 28rpx;
  1038. min-height: 280rpx;
  1039. }
  1040. .base-info-grid {
  1041. display: flex;
  1042. flex-wrap: wrap;
  1043. gap: 20rpx;
  1044. margin-bottom: 32rpx;
  1045. }
  1046. .bi-item {
  1047. width: calc(50% - 10rpx);
  1048. background: #f8f8f8;
  1049. border-radius: 16rpx;
  1050. padding: 16rpx 20rpx;
  1051. box-sizing: border-box;
  1052. display: flex;
  1053. flex-direction: column;
  1054. justify-content: center;
  1055. }
  1056. .bi-label {
  1057. display: block;
  1058. font-size: 20rpx;
  1059. color: #aaa;
  1060. margin-bottom: 8rpx;
  1061. }
  1062. .bi-val {
  1063. display: block;
  1064. font-size: 24rpx;
  1065. color: #333;
  1066. font-weight: 500;
  1067. word-break: break-all;
  1068. line-height: 1.4;
  1069. }
  1070. .bi-val.highlight {
  1071. color: #f44336;
  1072. }
  1073. .sub-title {
  1074. display: block;
  1075. font-size: 28rpx;
  1076. font-weight: bold;
  1077. color: #333;
  1078. margin: 12rpx 0 24rpx;
  1079. }
  1080. /* 任务卡片样式 */
  1081. .task-card {
  1082. padding: 24rpx;
  1083. background: #fff;
  1084. border: 2rpx solid #EEEEEE;
  1085. border-radius: 12rpx;
  1086. margin-bottom: 20rpx;
  1087. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.02);
  1088. }
  1089. .task-header {
  1090. display: flex;
  1091. align-items: center;
  1092. gap: 16rpx;
  1093. margin-bottom: 20rpx;
  1094. }
  1095. .type-tag {
  1096. font-size: 22rpx;
  1097. padding: 4rpx 12rpx;
  1098. border-radius: 6rpx;
  1099. border: 1rpx solid;
  1100. }
  1101. .tag-blue {
  1102. color: #007aff;
  1103. background: #eef6ff;
  1104. border-color: #007aff;
  1105. }
  1106. .tag-orange {
  1107. color: #ff9500;
  1108. background: #fff8f0;
  1109. border-color: #ff9500;
  1110. }
  1111. .task-time {
  1112. font-size: 26rpx;
  1113. font-weight: bold;
  1114. color: #f56c6c;
  1115. }
  1116. .task-body {
  1117. display: flex;
  1118. flex-direction: column;
  1119. gap: 12rpx;
  1120. }
  1121. .task-row {
  1122. display: flex;
  1123. align-items: flex-start;
  1124. gap: 20rpx;
  1125. }
  1126. .task-label {
  1127. width: 60rpx;
  1128. font-size: 24rpx;
  1129. color: #999;
  1130. flex-shrink: 0;
  1131. }
  1132. .task-value {
  1133. font-size: 26rpx;
  1134. color: #333;
  1135. line-height: 1.4;
  1136. }
  1137. .contact-row {
  1138. margin-top: 8rpx;
  1139. padding-top: 8rpx;
  1140. }
  1141. .contact-row .task-value {
  1142. color: #999;
  1143. }
  1144. /* 执行要求卡片 */
  1145. .req-card {
  1146. background: #f9f9f9;
  1147. border: none;
  1148. }
  1149. .req-item {
  1150. display: flex;
  1151. align-items: center;
  1152. }
  1153. .req-label {
  1154. width: 140rpx;
  1155. font-size: 24rpx;
  1156. color: #333;
  1157. }
  1158. .req-value {
  1159. flex: 1;
  1160. font-size: 26rpx;
  1161. color: #333;
  1162. }
  1163. .assignee-card {
  1164. background: #f9f9f9;
  1165. border-radius: 24rpx;
  1166. padding: 28rpx;
  1167. }
  1168. .assignee-header {
  1169. display: flex;
  1170. gap: 24rpx;
  1171. }
  1172. .assignee-avatar {
  1173. width: 100rpx;
  1174. height: 100rpx;
  1175. border-radius: 50%;
  1176. background: #e0e0e0;
  1177. display: flex;
  1178. align-items: center;
  1179. justify-content: center;
  1180. }
  1181. .assignee-name {
  1182. display: block;
  1183. font-size: 30rpx;
  1184. font-weight: bold;
  1185. color: #222;
  1186. margin-bottom: 8rpx;
  1187. }
  1188. .assignee-phone,
  1189. .assignee-zone {
  1190. display: block;
  1191. font-size: 24rpx;
  1192. color: #666;
  1193. margin-bottom: 4rpx;
  1194. }
  1195. .timeline {
  1196. position: relative;
  1197. padding-left: 40rpx;
  1198. }
  1199. .tl-item {
  1200. position: relative;
  1201. margin-bottom: 40rpx;
  1202. padding-left: 32rpx;
  1203. }
  1204. .tl-dot {
  1205. position: absolute;
  1206. left: -12rpx;
  1207. top: 8rpx;
  1208. width: 24rpx;
  1209. height: 24rpx;
  1210. border-radius: 50%;
  1211. background: #ff9500;
  1212. border: 4rpx solid #fff;
  1213. box-shadow: 0 0 0 4rpx #ff9500;
  1214. }
  1215. .tl-item::before {
  1216. content: '';
  1217. position: absolute;
  1218. left: -2rpx;
  1219. top: 32rpx;
  1220. bottom: -40rpx;
  1221. width: 4rpx;
  1222. background: #f0f0f0;
  1223. }
  1224. .tl-item:last-child::before {
  1225. display: none;
  1226. }
  1227. .tl-time {
  1228. display: block;
  1229. font-size: 22rpx;
  1230. color: #aaa;
  1231. margin-bottom: 6rpx;
  1232. }
  1233. .tl-title {
  1234. display: block;
  1235. font-size: 28rpx;
  1236. font-weight: 600;
  1237. color: #222;
  1238. margin-bottom: 6rpx;
  1239. }
  1240. .tl-desc {
  1241. display: block;
  1242. font-size: 24rpx;
  1243. color: #666;
  1244. }
  1245. .log-dot {
  1246. background: #e0e0e0;
  1247. box-shadow: 0 0 0 4rpx #e0e0e0;
  1248. }
  1249. .empty-state {
  1250. display: flex;
  1251. flex-direction: column;
  1252. align-items: center;
  1253. justify-content: center;
  1254. padding: 80rpx 0;
  1255. gap: 24rpx;
  1256. }
  1257. .empty-text {
  1258. font-size: 26rpx;
  1259. color: #bbb;
  1260. }
  1261. .cancel-bar {
  1262. position: fixed;
  1263. bottom: 0;
  1264. left: 0;
  1265. right: 0;
  1266. padding: 24rpx 32rpx;
  1267. background: rgba(255, 255, 255, 0.95);
  1268. box-shadow: 0 -8rpx 28rpx rgba(0, 0, 0, 0.08);
  1269. z-index: 100;
  1270. }
  1271. .cancel-order-btn {
  1272. width: 100%;
  1273. height: 96rpx;
  1274. font-size: 32rpx;
  1275. font-weight: 600;
  1276. border: 2rpx solid #f44336;
  1277. color: #f44336;
  1278. background: transparent;
  1279. border-radius: 48rpx;
  1280. line-height: 92rpx;
  1281. &::after {
  1282. border: none;
  1283. }
  1284. }
  1285. .complaint-btn {
  1286. width: 100%;
  1287. height: 96rpx;
  1288. font-size: 32rpx;
  1289. font-weight: 600;
  1290. border: 2rpx solid #ff9800;
  1291. color: #ff9800;
  1292. background: transparent;
  1293. border-radius: 48rpx;
  1294. line-height: 92rpx;
  1295. &::after {
  1296. border: none;
  1297. }
  1298. }
  1299. /* 骨架屏动画与样式 */
  1300. .skeleton-page {
  1301. padding: 24rpx;
  1302. }
  1303. .skeleton-box {
  1304. background: #e0e0e0;
  1305. border-radius: 16rpx;
  1306. margin-bottom: 24rpx;
  1307. animation: skeleton-shimmer 1.5s infinite linear;
  1308. background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  1309. background-size: 400% 100%;
  1310. }
  1311. @keyframes skeleton-shimmer {
  1312. 0% {
  1313. background-position: 100% 0;
  1314. }
  1315. 100% {
  1316. background-position: -100% 0;
  1317. }
  1318. }
  1319. .skeleton-header {
  1320. height: 80rpx;
  1321. border-radius: 20rpx;
  1322. }
  1323. .skeleton-progress {
  1324. height: 120rpx;
  1325. border-radius: 28rpx;
  1326. }
  1327. .skeleton-row-cards {
  1328. display: flex;
  1329. gap: 20rpx;
  1330. margin-bottom: 24rpx;
  1331. }
  1332. .skeleton-card {
  1333. flex: 1;
  1334. height: 280rpx;
  1335. border-radius: 28rpx;
  1336. margin-bottom: 0;
  1337. }
  1338. .skeleton-content {
  1339. height: 500rpx;
  1340. border-radius: 28rpx;
  1341. }
  1342. /* 渐显进入动画 */
  1343. .fade-in {
  1344. animation: fadeIn 0.4s ease-out forwards;
  1345. }
  1346. @keyframes fadeIn {
  1347. from {
  1348. opacity: 0;
  1349. transform: translateY(10rpx);
  1350. }
  1351. to {
  1352. opacity: 1;
  1353. transform: translateY(0);
  1354. }
  1355. }
  1356. /* 日志媒体相关样式 */
  1357. .tl-media {
  1358. display: flex;
  1359. flex-wrap: wrap;
  1360. gap: 16rpx;
  1361. margin-top: 16rpx;
  1362. }
  1363. .media-item {
  1364. width: 160rpx;
  1365. height: 160rpx;
  1366. border-radius: 12rpx;
  1367. overflow: hidden;
  1368. background: #f0f0f0;
  1369. position: relative;
  1370. }
  1371. .p-img,
  1372. .p-video-box {
  1373. width: 100%;
  1374. height: 100%;
  1375. }
  1376. .play-icon-overlay {
  1377. position: absolute;
  1378. top: 50%;
  1379. left: 50%;
  1380. transform: translate(-50%, -50%);
  1381. width: 60rpx;
  1382. height: 60rpx;
  1383. background: rgba(0, 0, 0, 0.4);
  1384. border-radius: 50%;
  1385. display: flex;
  1386. align-items: center;
  1387. justify-content: center;
  1388. pointer-events: none;
  1389. }
  1390. /* 视频预览弹窗 */
  1391. .video-preview-mask {
  1392. position: fixed;
  1393. top: 0;
  1394. left: 0;
  1395. right: 0;
  1396. bottom: 0;
  1397. background: #000;
  1398. z-index: 999;
  1399. display: flex;
  1400. align-items: center;
  1401. justify-content: center;
  1402. }
  1403. .preview-video {
  1404. width: 100%;
  1405. height: 60vh;
  1406. }
  1407. .close-video-btn {
  1408. position: absolute;
  1409. top: 100rpx;
  1410. right: 40rpx;
  1411. width: 64rpx;
  1412. height: 64rpx;
  1413. border-radius: 50%;
  1414. background: rgba(255, 255, 255, 0.2);
  1415. display: flex;
  1416. justify-content: center;
  1417. z-index: 1000;
  1418. }
  1419. /* 自定义弹窗样式 */
  1420. .custom-modal {
  1421. position: fixed;
  1422. top: 0;
  1423. left: 0;
  1424. width: 100%;
  1425. height: 100%;
  1426. z-index: 999;
  1427. display: flex;
  1428. align-items: center;
  1429. justify-content: center;
  1430. }
  1431. .modal-mask {
  1432. position: absolute;
  1433. top: 0;
  1434. left: 0;
  1435. width: 100%;
  1436. height: 100%;
  1437. background-color: rgba(0, 0, 0, 0.5);
  1438. }
  1439. .modal-content {
  1440. position: relative;
  1441. width: 80%;
  1442. background-color: #fff;
  1443. border-radius: 16rpx;
  1444. overflow: hidden;
  1445. z-index: 1000;
  1446. }
  1447. .modal-title {
  1448. padding: 30rpx 0 20rpx;
  1449. text-align: center;
  1450. font-size: 32rpx;
  1451. font-weight: bold;
  1452. color: #333;
  1453. }
  1454. .modal-body {
  1455. padding: 10rpx 40rpx 30rpx;
  1456. }
  1457. .cancel-input {
  1458. width: 100%;
  1459. height: 160rpx;
  1460. background-color: #f8f8f8;
  1461. border-radius: 8rpx;
  1462. padding: 20rpx;
  1463. font-size: 28rpx;
  1464. box-sizing: border-box;
  1465. color: #333;
  1466. }
  1467. .ph-color {
  1468. color: #999;
  1469. }
  1470. .modal-footer {
  1471. display: flex;
  1472. border-top: 2rpx solid #EEEEEE;
  1473. }
  1474. .modal-btn {
  1475. flex: 1;
  1476. height: 90rpx;
  1477. line-height: 90rpx;
  1478. text-align: center;
  1479. font-size: 30rpx;
  1480. font-weight: 500;
  1481. }
  1482. .btn-cancel {
  1483. color: #666;
  1484. border-right: 2rpx solid #EEEEEE;
  1485. }
  1486. .btn-confirm {
  1487. color: #2196f3;
  1488. }
  1489. </style>