detail.vue 20 KB

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