index.vue 40 KB

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