detail.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <view class="detail-container">
  3. <!-- 顶部动态状态区 -->
  4. <view class="detail-header">
  5. <view class="status-row">
  6. <text class="status-title">{{ displayStatusText }}</text>
  7. <text class="status-price">¥{{ orderDetail.price }}</text>
  8. </view>
  9. <!-- 进度条区域 -->
  10. <view class="progress-bar">
  11. <view class="step-item" v-for="(step, index) in steps" :key="index"
  12. :class="{ 'active': index === currentStep }">
  13. <view class="step-circle-wrapper">
  14. <!-- Connecting Line before circle, except first item -->
  15. <view class="step-line" v-if="index !== 0" :class="{ 'active-line': index <= currentStep }">
  16. </view>
  17. <view class="step-circle">{{ index + 1 }}</view>
  18. </view>
  19. <text class="step-text">{{ step }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 内容区域 -->
  24. <scroll-view scroll-y class="detail-content">
  25. <!-- 宠物信息 -->
  26. <view class="white-card pet-bar">
  27. <image class="pb-avatar" :src="orderDetail.petAvatar" mode="aspectFill"></image>
  28. <view class="pb-info">
  29. <view class="pb-name-row">
  30. <text class="pb-name">{{ orderDetail.petName }}</text>
  31. <text class="pb-breed">品种: {{ orderDetail.petBreed }}</text>
  32. </view>
  33. <view class="pb-tags">
  34. <text class="pb-tag">{{ orderDetail.serviceTag }}</text>
  35. </view>
  36. </view>
  37. <view class="pb-actions">
  38. <view class="pb-btn profile-btn" @click="showPetProfile">宠物档案</view>
  39. <view class="pb-btn phone-btn" @click="callPhone">
  40. <image class="phone-icon" src="/static/icons/phone_orange.svg"></image>
  41. </view>
  42. </view>
  43. </view>
  44. <!-- 路线及服务信息 -->
  45. <view class="white-card service-info-card">
  46. <view class="si-row time-row">
  47. <image class="si-icon outline" src="/static/icons/clock.svg"></image>
  48. <view class="si-content">
  49. <text class="si-label">服务时间</text>
  50. <text class="si-val">{{ orderDetail.time }}</text>
  51. </view>
  52. <view class="si-action record-btn">
  53. <text>异常记录</text>
  54. <image class="record-arrow" src="/static/icons/right_arrow_orange.svg"></image>
  55. </view>
  56. </view>
  57. <!-- 接送类型的地址展现 -->
  58. <template v-if="orderDetail.type === 1">
  59. <view class="si-row addr-row start-addr">
  60. <view class="icon-circle start">起</view>
  61. <view class="route-line-vertical"></view>
  62. <view class="si-content">
  63. <text class="si-addr-title">{{ orderDetail.startLocation }}</text>
  64. <text class="si-addr-desc">{{ orderDetail.startAddress }}</text>
  65. </view>
  66. <view class="nav-btn-circle" @click="openNavigation('start')">
  67. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"></image>
  68. </view>
  69. </view>
  70. <view class="si-row addr-row end-addr">
  71. <view class="icon-circle end">终</view>
  72. <view class="si-content">
  73. <text class="si-addr-title">{{ orderDetail.endLocation }}</text>
  74. <text class="si-addr-desc">{{ orderDetail.endAddress }}</text>
  75. </view>
  76. <view class="nav-btn-circle" @click="openNavigation('end')">
  77. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"></image>
  78. </view>
  79. </view>
  80. </template>
  81. <!-- 喂遛/洗护类型的地址展现 -->
  82. <template v-else>
  83. <view class="si-row addr-row end-addr">
  84. <view class="icon-circle service">服</view>
  85. <view class="si-content">
  86. <text class="si-addr-title">{{ orderDetail.endLocation }}</text>
  87. <text class="si-addr-desc">{{ orderDetail.endAddress }}</text>
  88. </view>
  89. <view class="nav-btn-circle" @click="openNavigation('end')">
  90. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"></image>
  91. </view>
  92. </view>
  93. <view class="si-row">
  94. <image class="si-icon outline" src="/static/icons/heart.svg"></image>
  95. <view class="si-content">
  96. <text class="si-label">服务内容</text>
  97. <text class="si-val">{{ orderDetail.serviceContent }}</text>
  98. </view>
  99. </view>
  100. </template>
  101. <view class="si-row">
  102. <image class="si-icon outline custom-icon-file" src="/static/icons/file.svg"></image>
  103. <view class="si-content">
  104. <text class="si-label">备注</text>
  105. <text class="si-val">{{ orderDetail.remark || '无' }}</text>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 打卡任务 -->
  110. <view class="white-card task-card" v-if="currentStep < steps.length">
  111. <text class="tc-title">当前任务:{{ currentTaskTitle }}</text>
  112. <text class="tc-desc">{{ currentTaskDesc }}</text>
  113. <!-- 单个巨大点击区触发弹窗 -->
  114. <view class="full-media-add" @click="openUploadModal">
  115. <image class="upload-icon-large" src="/static/icons/camera_grey.svg"></image>
  116. <text class="upload-text-large">上传图或视频</text>
  117. </view>
  118. </view>
  119. <!-- 订单属性 -->
  120. <view class="white-card base-info-card">
  121. <view class="bi-row">
  122. <image class="si-icon outline" src="/static/icons/order_no.svg"></image>
  123. <view class="bi-content">
  124. <text class="bi-label">订单编号</text>
  125. <view class="bi-val-row">
  126. <text class="bi-val">{{ orderDetail.orderNo }}</text>
  127. <text class="bi-copy" @click="copyOrderNo">复制</text>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="bi-row">
  132. <image class="si-icon outline" src="/static/icons/clock.svg"></image>
  133. <view class="bi-content">
  134. <text class="bi-label">下单时间</text>
  135. <text class="bi-val">{{ orderDetail.createTime }}</text>
  136. </view>
  137. </view>
  138. </view>
  139. <!-- 订单进度 -->
  140. <view class="white-card timeline-card">
  141. <view class="tl-title-row">
  142. <view class="orange-bar"></view>
  143. <text class="tl-title">订单进度</text>
  144. </view>
  145. <view class="tl-list">
  146. <view class="tl-item" v-for="(log, idx) in orderDetail.progressLogs" :key="idx">
  147. <view class="tl-marker active">
  148. <view class="tl-dot-inner"></view>
  149. </view>
  150. <view class="tl-content-row">
  151. <view class="tl-header">
  152. <text class="tl-status">{{ log.status }}</text>
  153. <text class="tl-time">{{ log.time }}</text>
  154. </view>
  155. <!-- 图片展示 -->
  156. <view class="tl-medias" v-if="log.medias && log.medias.length > 0">
  157. <image class="tl-img" v-for="(img, midx) in log.medias" :key="midx" :src="img"
  158. mode="aspectFill">
  159. </image>
  160. </view>
  161. <!-- 备注展示 -->
  162. <view class="tl-remark" v-if="log.remark">
  163. <text>{{ log.remark }}</text>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. <view style="height: 140rpx;"></view>
  170. </scroll-view>
  171. <!-- 底部操作栏 -->
  172. <view class="bottom-action-bar">
  173. <view class="action-left">
  174. <button class="action-btn outline grey-outline" @click="goToAnomaly">异常上报</button>
  175. <button class="action-btn outline orange-outline" @click="openSumModal">宠护小结</button>
  176. </view>
  177. <view class="action-right">
  178. <button class="action-btn primary" @click="openUploadModal" v-if="currentStep < steps.length">{{
  179. currentTaskTitle }}</button>
  180. <button class="action-btn primary grey-bg" v-else>已完成</button>
  181. </view>
  182. </view>
  183. <!-- 宠物档案弹窗 -->
  184. <view class="pet-modal-mask" v-if="showPetModal" @click="closePetProfile">
  185. <view class="pet-modal-content" @click.stop>
  186. <!-- 头部 -->
  187. <view class="pet-modal-header">
  188. <text class="pet-modal-title">宠物档案</text>
  189. <view style="flex:1"></view>
  190. <view class="pm-remark-btn" @click="openPetRemarkInput">备注</view>
  191. <view class="close-icon-btn" @click="closePetProfile">×</view>
  192. </view>
  193. <scroll-view scroll-y class="pet-modal-scroll">
  194. <!-- 宠物基础信息 -->
  195. <view class="pet-base-info">
  196. <image class="pm-avatar" :src="currentPetInfo.petAvatar" mode="aspectFill"></image>
  197. <view class="pm-info-text">
  198. <view class="pm-name-row">
  199. <text class="pm-name">{{ currentPetInfo.petName }}</text>
  200. <view class="pm-gender" v-if="currentPetInfo.petGender === 'M'">
  201. <text class="gender-icon">♂</text>
  202. <text>公</text>
  203. </view>
  204. <view class="pm-gender female" v-else-if="currentPetInfo.petGender === 'F'">
  205. <text class="gender-icon">♀</text>
  206. <text>母</text>
  207. </view>
  208. </view>
  209. <text class="pm-breed">品种:{{ currentPetInfo.petBreed }}</text>
  210. </view>
  211. </view>
  212. <!-- 属性网格 -->
  213. <view class="pm-detail-grid">
  214. <view class="pm-grid-item half">
  215. <text class="pm-label">年龄</text>
  216. <text class="pm-val">{{ currentPetInfo.petAge || '未知' }}</text>
  217. </view>
  218. <view class="pm-grid-item half">
  219. <text class="pm-label">体重</text>
  220. <text class="pm-val">{{ currentPetInfo.petWeight || '未知' }}</text>
  221. </view>
  222. <view class="pm-grid-item full">
  223. <text class="pm-label">性格</text>
  224. <text class="pm-val">{{ currentPetInfo.petPersonality || '无' }}</text>
  225. </view>
  226. <view class="pm-grid-item full">
  227. <text class="pm-label">爱好</text>
  228. <text class="pm-val">{{ currentPetInfo.petHobby || '无' }}</text>
  229. </view>
  230. <view class="pm-grid-item full">
  231. <text class="pm-label">备注</text>
  232. <text class="pm-val">{{ currentPetInfo.petRemark || '无特殊过敏史' }}</text>
  233. </view>
  234. </view>
  235. <!-- 标签 -->
  236. <view class="pm-tags-row" v-if="currentPetInfo.petTags && currentPetInfo.petTags.length > 0">
  237. <view class="pm-tag-chip" v-for="(tag, ti) in currentPetInfo.petTags" :key="ti">
  238. <text class="pm-tag-chip-text">{{ tag }}</text>
  239. </view>
  240. </view>
  241. <!-- 备注日志 -->
  242. <view class="pm-log-section">
  243. <view class="pm-log-header">
  244. <view
  245. style="width:6rpx; height:28rpx; background:#FF9800; border-radius:3rpx; margin-right:12rpx;">
  246. </view>
  247. <text class="pm-log-section-title">备注日志</text>
  248. </view>
  249. <view class="pm-log-item" v-for="(log, lIndex) in currentPetInfo.petLogs" :key="lIndex">
  250. <text class="pm-log-date">{{ log.date }}</text>
  251. <text class="pm-log-text">{{ log.content }}</text>
  252. <text class="pm-log-recorder" v-if="log.recorder !== '系统记录'">记录人:{{ log.recorder }}</text>
  253. <text class="pm-log-recorder system" v-else>系统记录</text>
  254. </view>
  255. </view>
  256. <view style="height: 30rpx;"></view>
  257. </scroll-view>
  258. </view>
  259. </view>
  260. <!-- 宠物备注输入弹窗 -->
  261. <view class="upload-modal-mask" v-if="showPetRemarkInput" @click="closePetRemarkInput">
  262. <view class="upload-modal-content" @click.stop>
  263. <view class="um-header">
  264. <text class="um-title">添加备注</text>
  265. </view>
  266. <view class="um-body">
  267. <textarea class="um-textarea" v-model="petRemarkText" auto-height placeholder="请输入宠物备注内容..."
  268. placeholder-style="color:#ccc; font-size:26rpx;"></textarea>
  269. </view>
  270. <view class="um-footer">
  271. <button class="um-submit-btn active" @click="submitPetRemark">确认提交</button>
  272. </view>
  273. </view>
  274. </view>
  275. <!-- 选择地图导航弹窗 (复用) -->
  276. <view class="nav-modal-mask" v-if="showNavModal" @click="closeNavModal">
  277. <view class="nav-action-sheet" @click.stop>
  278. <view class="nav-sheet-title">选择地图进行导航</view>
  279. <view class="nav-sheet-item" @click="chooseMap('高德')">高德地图</view>
  280. <view class="nav-sheet-item" @click="chooseMap('腾讯')">腾讯地图</view>
  281. <view class="nav-sheet-item" @click="chooseMap('百度')">百度地图</view>
  282. <view class="nav-sheet-gap"></view>
  283. <view class="nav-sheet-item cancel" @click="closeNavModal">取消</view>
  284. </view>
  285. </view>
  286. <!-- 上传图视频弹窗 (新增) -->
  287. <view class="upload-modal-mask" v-if="showUploadModal" @click="closeUploadModal">
  288. <view class="upload-modal-content" @click.stop>
  289. <view class="um-header">
  290. <text class="um-title">上传图或视频 ({{ modalMediaList.length }}/5)</text>
  291. </view>
  292. <view class="um-body">
  293. <view class="um-grid">
  294. <view class="um-item" v-for="(img, idx) in modalMediaList" :key="idx">
  295. <image class="um-preview" :src="img.url || img.localPath || img" mode="aspectFill"></image>
  296. <view class="um-del" @click="removeModalMedia(idx)">×</view>
  297. </view>
  298. <view class="um-add" @click="chooseModalMedia" v-if="modalMediaList.length < 5">
  299. <image class="um-add-icon" src="/static/icons/camera_grey.svg"></image>
  300. <text class="um-add-text">拍摄/上传</text>
  301. </view>
  302. </view>
  303. <textarea class="um-textarea" v-model="modalRemark" placeholder="在此输入备注信息..."
  304. placeholder-style="color:#ccc; font-size:26rpx;"></textarea>
  305. </view>
  306. <view class="um-footer">
  307. <view class="um-submit-btn" :class="{ 'active': modalMediaList.length > 0 }"
  308. @click="handleConfirmUpload">
  309. 确认提交</view>
  310. </view>
  311. </view>
  312. </view>
  313. <!-- 宠护小结弹窗 -->
  314. <view class="sum-modal-mask" v-if="showSumModal" @click="closeSumModal">
  315. <view class="sum-modal-card" @click.stop>
  316. <scroll-view scroll-y class="sum-modal-scroll">
  317. <view class="sum-modal-inner">
  318. <text class="sum-modal-title">宠物护理工作小结</text>
  319. <view class="sum-meta-row">
  320. <text class="sum-meta-label">日期:</text>
  321. <text class="sum-meta-val">{{ sumDate }}</text>
  322. </view>
  323. <view class="sum-meta-row">
  324. <text class="sum-meta-label">客户住址:</text>
  325. <text class="sum-meta-val">{{ orderDetail.endAddress }}</text>
  326. </view>
  327. <view class="sum-meta-row">
  328. <text class="sum-meta-label">宠主姓名:</text>
  329. <text class="sum-meta-val">{{ orderDetail.ownerName || '张**' }}</text>
  330. </view>
  331. <view class="sum-section-title">宠物信息</view>
  332. <view class="sum-pet-card">
  333. <image class="sum-pet-avatar" :src="orderDetail.petAvatar" mode="aspectFill"></image>
  334. <view class="sum-pet-info">
  335. <view class="sum-pet-name-row">
  336. <text class="sum-pet-name">{{ orderDetail.petName }}</text>
  337. <text class="sum-pet-breed">品种: {{ orderDetail.petBreed }}</text>
  338. </view>
  339. <text class="sum-pet-remark">{{ orderDetail.petNotes || '喜欢坐车,有点晗车,请注意通风。' }}</text>
  340. </view>
  341. </view>
  342. <view class="sum-section-title">服务内容记录</view>
  343. <textarea class="sum-textarea" v-model="sumContent" auto-height placeholder="请填写服务内容..."
  344. placeholder-style="color:#ccc"></textarea>
  345. <view class="sum-sign-row">
  346. <text class="sum-sign-label">护宠师签名:</text>
  347. <text class="sum-sign-val">{{ sumSigner }}</text>
  348. </view>
  349. <view style="height: 20rpx;"></view>
  350. </view>
  351. </scroll-view>
  352. <view class="sum-footer">
  353. <button class="sum-submit-btn" @click="submitSumModal">提交小结</button>
  354. </view>
  355. </view>
  356. </view>
  357. </view>
  358. </template>
  359. <script>
  360. import logic from './detail-logic.js';
  361. export default {
  362. ...logic
  363. }
  364. </script>
  365. <style>
  366. @import './detail-style.css';
  367. </style>