index.vue 39 KB

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