index.vue 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855
  1. <template>
  2. <view class="container">
  3. <!-- 吸顶固定层:状态tab + 搜索 + 筛选 -->
  4. <view class="sticky-header">
  5. <!-- 顶部 Tab (待接送/服务中...) -->
  6. <view class="status-tabs">
  7. <view class="tab-item" v-for="(tab, index) in tabs" :key="index"
  8. :class="{ active: currentTab === index }" @click="currentTab = index">
  9. <text>{{ tab }}</text>
  10. <view class="indicator" v-if="currentTab === index"></view>
  11. </view>
  12. </view>
  13. <!-- 搜索栏 -->
  14. <view class="search-bar">
  15. <view class="search-input-box">
  16. <input class="search-input" v-model="searchContent" placeholder="搜索地址/电话/姓名"
  17. placeholder-class="ph-style" />
  18. </view>
  19. </view>
  20. <!-- 筛选栏 (支持自定义下拉) -->
  21. <view class="filter-wrapper">
  22. <view class="filter-bar">
  23. <!-- 订单类型下拉视图 -->
  24. <view class="filter-item" :class="{ 'active': activeDropdown === 1 }" @click="toggleDropdown(1)">
  25. <text :class="{ 'active-text': activeDropdown === 1 || currentTypeFilterIdx > 0 }">
  26. {{ currentTypeFilterIdx > 0 ? typeFilterOptions[currentTypeFilterIdx] : '全部类型' }}
  27. </text>
  28. <view class="triangle" :class="activeDropdown === 1 ? 'up' : 'down'"></view>
  29. </view>
  30. <!-- 服务时间下拉视图 -->
  31. <view class="filter-item" :class="{ 'active': activeDropdown === 2 }" @click="toggleDropdown(2)">
  32. <text :class="{ 'active-text': activeDropdown === 2 || hasTimeFilter }">服务时间</text>
  33. <view class="triangle" :class="activeDropdown === 2 ? 'up' : 'down'"></view>
  34. </view>
  35. </view>
  36. <!-- 下拉内容面板与遮罩 -->
  37. <view class="dropdown-mask" v-if="activeDropdown !== 0" @click="closeDropdown"></view>
  38. <view class="dropdown-panel" v-if="activeDropdown === 1">
  39. <view class="type-option" v-for="(item, index) in typeFilterOptions" :key="index"
  40. :class="{ 'selected': currentTypeFilterIdx === index }" @click="selectType(index)">
  41. <text>{{ item }}</text>
  42. </view>
  43. </view>
  44. <view class="dropdown-panel calendar-panel" v-if="activeDropdown === 2">
  45. <view class="custom-calendar-container">
  46. <!-- 头部 -->
  47. <view class="cal-header">
  48. <text class="cal-nav-btn" @click="prevMonth">‹</text>
  49. <text class="cal-title">{{ currentMonth }}</text>
  50. <text class="cal-nav-btn" @click="nextMonth">›</text>
  51. </view>
  52. <!-- 星期条 -->
  53. <view class="cal-weekdays">
  54. <text v-for="(wk, idx) in weekDays" :key="idx" class="wk-item">{{ wk }}</text>
  55. </view>
  56. <!-- 日期网格 -->
  57. <view class="cal-body">
  58. <view v-for="(day, idx) in calendarDays" :key="idx" class="cal-day-box"
  59. :class="day ? getDateClass(day) : ''" @click="day && selectDateItem(day)">
  60. <view class="cal-day-text" v-if="day">{{ day }}</view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="calendar-actions">
  65. <button class="cal-btn reset" @click="resetTimeFilter">重置</button>
  66. <button class="cal-btn confirm" @click="confirmTimeFilter">确定</button>
  67. </view>
  68. </view>
  69. </view><!-- end filter-wrapper -->
  70. </view><!-- end sticky-header -->
  71. <!-- 订单列表 -->
  72. <view class="order-list">
  73. <view class="order-card" v-for="(item, index) in orderList" :key="index" @click="goToDetail(item)">
  74. <view class="card-header">
  75. <view class="type-badge">
  76. <image class="type-icon" :src="item.typeIcon"></image>
  77. <text class="type-text">{{ item.typeText }}</text>
  78. </view>
  79. <text class="status-badge" :class="getStatusClass(item)">{{ getDisplayStatus(item) }}</text>
  80. </view>
  81. <view class="card-body">
  82. <view class="time-row">
  83. <view class="time-col">
  84. <text class="label">{{ item.timeLabel }}:</text>
  85. <text class="value">{{ item.time }}</text>
  86. </view>
  87. <text class="fulfillmentCommission">¥{{ item.fulfillmentCommission }}</text>
  88. </view>
  89. <!-- 宠物信息 -->
  90. <view class="pet-card">
  91. <image class="pet-avatar" :src="item.petAvatarUrl || item.petAvatar" mode="aspectFill"></image>
  92. <view class="pet-info">
  93. <text class="pet-name">{{ item.petName }}</text>
  94. <text class="pet-breed">品种: {{ item.petBreed }}</text>
  95. </view>
  96. </view>
  97. <!-- 路线信息 (完全复用 Home 样式) -->
  98. <view class="route-info">
  99. <template v-if="item.type === 1">
  100. <view class="route-item" @click.stop="openNavigation(item, 'start')">
  101. <view class="icon-circle start">起</view>
  102. <view class="route-line-vertical"></view>
  103. <view class="address-box">
  104. <text class="addr-title">{{ item.startLocation }}</text>
  105. <text class="addr-desc">{{ item.startAddress }}</text>
  106. </view>
  107. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"
  108. style="flex-shrink: 0; align-self: center;"></image>
  109. </view>
  110. <view class="route-item" @click.stop="openNavigation(item, 'end')">
  111. <view class="icon-circle end">终</view>
  112. <view class="address-box">
  113. <text class="addr-title">{{ item.endLocation }}</text>
  114. <text class="addr-desc">{{ item.endAddress }}</text>
  115. </view>
  116. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"
  117. style="flex-shrink: 0; align-self: center;"></image>
  118. </view>
  119. </template>
  120. <template v-else>
  121. <view class="route-item" @click.stop="openNavigation(item, 'end')">
  122. <view class="icon-circle service">服</view>
  123. <view class="address-box">
  124. <text class="addr-title">{{ item.endLocation }}</text>
  125. <text class="addr-desc">{{ item.endAddress }}</text>
  126. </view>
  127. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"
  128. style="flex-shrink: 0; align-self: center;"></image>
  129. </view>
  130. <view class="service-content" v-if="item.serviceContent">
  131. <text class="content-label">服务内容:</text>
  132. <text>{{ item.serviceContent }}</text>
  133. </view>
  134. </template>
  135. </view>
  136. <!-- 备注 -->
  137. <view class="remark-box" v-if="item.remark">
  138. <text>备注:{{ item.remark }}</text>
  139. </view>
  140. </view><!-- End of card-body -->
  141. <!-- 按钮组 -->
  142. <view class="action-btns" v-if="['接单', '到达', '出发', '开始', '送达', '结束'].includes(item.statusText)">
  143. <view class="action-left">
  144. <button class="btn normal" @click.stop="doCall('customer', item)">拨号</button>
  145. </view>
  146. <view class="action-right">
  147. <button class="btn normal danger" v-if="item.status === 2"
  148. @click.stop="handleCancelOrder(item)">取消</button>
  149. <button class="btn normal" @click.stop="reportAbnormal(item)">异常上报</button>
  150. <button class="btn primary" @click.stop="mainAction(item)">到达打卡</button>
  151. </view>
  152. </view>
  153. </view>
  154. <!-- 已加载完提示文字 -->
  155. <view class="loading-text">已加载完</view>
  156. <view style="height: 160rpx;"></view>
  157. </view>
  158. <view class="call-mask" v-if="activeCallItem" @click="closeCallMenu"></view>
  159. </view>
  160. <!-- 宠物档案弹窗 (复用Home) -->
  161. <view class="pet-modal-mask" v-if="showPetModal" @click="closePetProfile">
  162. <view class="pet-modal-content" @click.stop>
  163. <view class="pet-modal-header">
  164. <text class="pet-modal-title">宠物档案</text>
  165. <view class="pm-header-actions">
  166. <view class="pm-remark-btn" @click="openRemarkInput">备注</view>
  167. <view class="close-icon-btn" @click="closePetProfile">×</view>
  168. </view>
  169. </view>
  170. <scroll-view scroll-y class="pet-modal-scroll">
  171. <!-- Basic Info -->
  172. <view class="pet-base-info">
  173. <image class="pm-avatar" :src="currentPetInfo.petAvatar" mode="aspectFill"></image>
  174. <view class="pm-info-text">
  175. <view class="pm-name-row">
  176. <text class="pm-name">{{ currentPetInfo.petName }}</text>
  177. <view class="pm-gender" v-if="currentPetInfo.petGender === 'M'">
  178. <text class="gender-icon">♂</text>
  179. <text>公</text>
  180. </view>
  181. <view class="pm-gender female" v-else-if="currentPetInfo.petGender === 'F'">
  182. <text class="gender-icon">♀</text>
  183. <text>母</text>
  184. </view>
  185. </view>
  186. <text class="pm-breed">品种:{{ currentPetInfo.petBreed }}</text>
  187. </view>
  188. </view>
  189. <!-- Details Grid -->
  190. <view class="pm-detail-grid">
  191. <view class="pm-grid-item half">
  192. <text class="pm-label">年龄</text>
  193. <text class="pm-val">{{ currentPetInfo.petAge || '未知' }}</text>
  194. </view>
  195. <view class="pm-grid-item half">
  196. <text class="pm-label">体重</text>
  197. <text class="pm-val">{{ currentPetInfo.petWeight || '未知' }}</text>
  198. </view>
  199. <view class="pm-grid-item full">
  200. <text class="pm-label">性格</text>
  201. <text class="pm-val">{{ currentPetInfo.petPersonality || '无' }}</text>
  202. </view>
  203. <view class="pm-grid-item full">
  204. <text class="pm-label">爱好</text>
  205. <text class="pm-val">{{ currentPetInfo.petHobby || '无' }}</text>
  206. </view>
  207. <view class="pm-grid-item full">
  208. <text class="pm-label">备注</text>
  209. <text class="pm-val">{{ currentPetInfo.petRemark || '无特殊过敏史' }}</text>
  210. </view>
  211. </view>
  212. <!-- Tags -->
  213. <view class="pm-tags" v-if="currentPetInfo.petTags && currentPetInfo.petTags.length > 0">
  214. <view class="pm-tag" v-for="(tag, index) in currentPetInfo.petTags" :key="index">{{ tag }}</view>
  215. </view>
  216. <!-- Log Section -->
  217. <view class="pm-section-title">
  218. <view class="orange-bar"></view>
  219. <text>备注日志</text>
  220. </view>
  221. <view class="pm-log-list">
  222. <view class="pm-log-item" v-for="(log, lIndex) in currentPetInfo.petLogs" :key="lIndex">
  223. <text class="pm-log-date">{{ log.date }}</text>
  224. <text class="pm-log-text">{{ log.content }}</text>
  225. <text class="pm-log-recorder">{{ log.recorder === '系统记录' ? '' : '记录人: ' }}{{ log.recorder
  226. }}</text>
  227. </view>
  228. </view>
  229. <view style="height: 30rpx;"></view>
  230. </scroll-view>
  231. </view>
  232. </view>
  233. <!-- 备注输入弹窗 -->
  234. <view class="remark-mask" v-if="showRemarkInput" @click="closeRemarkInput">
  235. <view class="remark-sheet" @click.stop>
  236. <view class="remark-sheet-header">
  237. <text class="remark-sheet-title">添加备注</text>
  238. <view class="close-icon-btn" @click="closeRemarkInput">×</view>
  239. </view>
  240. <textarea class="remark-textarea" v-model="remarkText" placeholder="请输入备注内容..." maxlength="500"
  241. auto-height />
  242. <view class="remark-submit-btn" @click="submitRemark">提交备注</view>
  243. </view>
  244. </view>
  245. <!-- 选择地图导航弹窗 (复用Home) -->
  246. <view class="nav-modal-mask" v-if="showNavModal" @click="closeNavModal">
  247. <view class="nav-action-sheet" @click.stop>
  248. <view class="nav-sheet-title">选择地图进行导航</view>
  249. <view class="nav-sheet-item" @click="chooseMap('高德')">高德地图</view>
  250. <view class="nav-sheet-item" @click="chooseMap('腾讯')">腾讯地图</view>
  251. <view class="nav-sheet-item" @click="chooseMap('百度')">百度地图</view>
  252. <view class="nav-sheet-gap"></view>
  253. <view class="nav-sheet-item cancel" @click="closeNavModal">取消</view>
  254. </view>
  255. </view>
  256. <custom-tabbar currentPath="pages/orders/index"></custom-tabbar>
  257. </template>
  258. <script>
  259. import { getMyOrders, cancelOrderApi } from '@/api/order/subOrder'
  260. import { listAllService } from '@/api/service/list'
  261. import { reportGps } from '@/utils/gps'
  262. import customTabbar from '@/components/custom-tabbar/index.vue'
  263. export default {
  264. components: {
  265. customTabbar
  266. },
  267. data() {
  268. return {
  269. currentTab: 0,
  270. tabs: ['待接送/服务', '配送/服务中', '已完成', '已取消'],
  271. typeFilterOptions: ['全部类型'],
  272. currentTypeFilterIdx: 0,
  273. activeDropdown: 0,
  274. hasTimeFilter: false,
  275. currentMonth: '',
  276. viewDate: new Date(),
  277. weekDays: ['日', '一', '二', '三', '四', '五', '六'],
  278. calendarDays: [],
  279. selectedDateRange: [],
  280. allOrderList: [],
  281. serviceList: [],
  282. searchContent: '',
  283. startServiceTime: '',
  284. endServiceTime: '',
  285. showPetModal: false,
  286. currentPetInfo: {},
  287. showNavModal: false,
  288. navTargetItem: null,
  289. navTargetPointType: '',
  290. activeCallItem: null,
  291. showRemarkInput: false,
  292. remarkText: ''
  293. }
  294. },
  295. created() {
  296. this.initCalendar();
  297. },
  298. async onLoad() {
  299. await this.loadServiceList()
  300. await this.loadOrders()
  301. // 显式请求一次定位授权
  302. reportGps(true).catch(e => console.log('Init GPS check skipped', e));
  303. },
  304. onShow() {
  305. uni.hideTabBar()
  306. // 此处不需要重复调用,因为逻辑可能在onLoad已处理,
  307. // 或者如果需要每次进入都刷新,可以保留,但需确保顺序
  308. this.loadOrders()
  309. },
  310. async onPullDownRefresh() {
  311. try {
  312. await this.loadServiceList()
  313. await this.loadOrders()
  314. } finally {
  315. uni.stopPullDownRefresh()
  316. }
  317. },
  318. watch: {
  319. currentTab() {
  320. this.loadOrders()
  321. },
  322. currentTypeFilterIdx() {
  323. this.loadOrders()
  324. },
  325. searchContent() {
  326. // 搜索内容变化时,自动重新加载订单
  327. this.loadOrders()
  328. }
  329. },
  330. computed: {
  331. orderList() {
  332. return this.allOrderList;
  333. }
  334. },
  335. methods: {
  336. async loadServiceList() {
  337. try {
  338. const res = await listAllService()
  339. this.serviceList = res.data || []
  340. this.typeFilterOptions = ['全部类型', ...this.serviceList.map(s => s.name)]
  341. } catch (err) {
  342. console.error('获取服务类型失败:', err)
  343. }
  344. },
  345. async loadOrders() {
  346. try {
  347. const statusMap = { 0: 2, 1: 3, 2: 4, 3: 5 }
  348. const serviceId = this.currentTypeFilterIdx > 0 ? this.serviceList[this.currentTypeFilterIdx - 1]?.id : undefined
  349. const params = {
  350. status: statusMap[this.currentTab],
  351. content: this.searchContent || undefined,
  352. service: serviceId,
  353. startServiceTime: this.startServiceTime || undefined,
  354. endServiceTime: this.endServiceTime || undefined
  355. }
  356. console.log('订单列表请求参数:', params)
  357. const res = await getMyOrders(params)
  358. console.log('订单列表响应:', res)
  359. const orders = res.rows || []
  360. console.log('订单数量:', orders.length)
  361. this.allOrderList = orders.map(order => this.transformOrder(order, this.currentTab))
  362. } catch (err) {
  363. console.error('获取订单列表失败:', err)
  364. this.allOrderList = []
  365. }
  366. },
  367. transformOrder(order, tabIndex) {
  368. const service = this.serviceList.find(s => s.id === order.service)
  369. const serviceText = service?.name || '未知'
  370. const serviceIcon = service?.iconUrl || ''
  371. const mode = service?.mode || 0
  372. const isRoundTrip = mode === 1
  373. // 根据 Tab 索引强制指定状态文字,忽略后端缺失的 status 字段
  374. let statusText = '接单'
  375. if (tabIndex === 0) {
  376. statusText = '接单' // 待接送/服务
  377. } else if (tabIndex === 1) {
  378. statusText = isRoundTrip ? '出发' : '开始' // 配送/服务中
  379. } else if (tabIndex === 2) {
  380. statusText = '已完成' // 已完成
  381. } else if (tabIndex === 3) {
  382. statusText = '已拒绝' // 已拒绝
  383. }
  384. return {
  385. id: order.id,
  386. status: order.status, // 保存原始 status 用于判断权限
  387. type: isRoundTrip ? 1 : 2,
  388. typeText: serviceText,
  389. typeIcon: serviceIcon,
  390. statusText: statusText,
  391. fulfillmentCommission: (order.price / 100).toFixed(2),
  392. timeLabel: '服务时间',
  393. time: order.serviceTime || '',
  394. petAvatar: order.petAvatar || '/static/dog.png',
  395. petAvatarUrl: order.petAvatarUrl || '',
  396. petName: order.petName || '',
  397. petBreed: order.breed || '',
  398. startLocation: order.fromAddress || '暂无起点',
  399. startAddress: order.fromAddress || '',
  400. fromAddress: order.fromAddress || '',
  401. fromLat: order.fromLat,
  402. fromLng: order.fromLng,
  403. startDistance: '0km',
  404. endLocation: (order.customerName || '') + ' ' + (order.customerPhone || ''),
  405. endAddress: order.toAddress || '',
  406. toAddress: order.toAddress || '',
  407. toLat: order.toLat,
  408. toLng: order.toLng,
  409. customerPhone: order.customerPhone || '',
  410. endDistance: '0km',
  411. serviceContent: order.remark || '',
  412. remark: order.remark || ''
  413. }
  414. },
  415. getDisplayStatus(item) {
  416. if (item.statusText === '已完成') return '已完成';
  417. if (item.statusText === '已拒绝') return '已拒绝';
  418. if (item.statusText === '接单') {
  419. return item.type === 1 ? '待接送' : '待服务';
  420. }
  421. return item.type === 1 ? '配送中' : '服务中';
  422. },
  423. getStatusClass(item) {
  424. let display = this.getDisplayStatus(item);
  425. if (display === '已完成') return 'finish';
  426. if (display === '已拒绝') return 'reject';
  427. if (display === '配送中' || display === '服务中') return 'processing';
  428. return 'highlight';
  429. },
  430. goToDetail(item) {
  431. uni.navigateTo({ url: `/pages/orders/detail/index?id=${item.id}` });
  432. },
  433. showPetProfile(item) {
  434. this.currentPetInfo = {
  435. ...item,
  436. petGender: 'M',
  437. petAge: '2岁',
  438. petWeight: '15kg',
  439. petPersonality: '活泼亲人,精力旺盛',
  440. petHobby: '喜欢追飞盘,爱吃肉干',
  441. petRemark: '肠胃较弱,不能乱喂零食;出门易爆冲,请拉紧牵引绳。',
  442. petTags: ['拉响警报', '不能吃鸡肉', '精力旺盛'],
  443. petLogs: [
  444. { date: '2026-02-09 14:00', content: '今天遛弯拉了两次粑粑,精神状态很好。', recorder: '王阿姨' },
  445. { date: '2026-02-08 10:30', content: '有些挑食,剩了小半碗狗粮。', recorder: '李师傅' },
  446. { date: '2026-02-05 09:00', content: '建档。', recorder: '系统记录' }
  447. ]
  448. };
  449. this.showPetModal = true;
  450. },
  451. closePetProfile() {
  452. this.showPetModal = false;
  453. },
  454. openNavigation(item, pointType) {
  455. this.navTargetItem = item;
  456. this.navTargetPointType = pointType;
  457. this.showNavModal = true;
  458. },
  459. closeNavModal() {
  460. this.showNavModal = false;
  461. },
  462. chooseMap(mapType) {
  463. let item = this.navTargetItem;
  464. let pointType = this.navTargetPointType;
  465. // 起 -> fromAddress ; 终 -> toAddress
  466. let name = pointType === 'start' ? (item.fromAddress || '起点') : (item.toAddress || '终点');
  467. let address = pointType === 'start' ? (item.fromAddress || '起点地址') : (item.toAddress || '终点地址');
  468. let latitude = pointType === 'start' ? Number(item.fromLat) : Number(item.toLat);
  469. let longitude = pointType === 'start' ? Number(item.fromLng) : Number(item.toLng);
  470. this.showNavModal = false;
  471. // 统一定义打开地图的函数
  472. const navigateTo = (lat, lng, addrName, addrDesc) => {
  473. uni.openLocation({
  474. latitude: lat,
  475. longitude: lng,
  476. name: addrName,
  477. address: addrDesc || '无法获取详细地址',
  478. success: function () {
  479. console.log('打开导航成功: ' + mapType);
  480. },
  481. fail: function (err) {
  482. console.error('打开导航失败:', err);
  483. uni.showToast({ title: '打开地图失败', icon: 'none' });
  484. }
  485. });
  486. };
  487. // 如果有目标经纬度,直接打开
  488. if (latitude && longitude && !isNaN(latitude) && !isNaN(longitude)) {
  489. navigateTo(latitude, longitude, name, address);
  490. } else {
  491. // 如果没有经纬度,按照需求:使用自己当前的经纬度,然后搜索 fromAddress 或者 toAddress
  492. uni.showLoading({ title: '获取当前位置...', mask: true });
  493. reportGps(true).then(res => {
  494. uni.hideLoading();
  495. // 使用用户当前经纬度作为锚点打开地图,展示目标地址信息
  496. navigateTo(res.latitude, res.longitude, name, address);
  497. }).catch(err => {
  498. uni.hideLoading();
  499. console.error('获取地理位置失败:', err);
  500. // 具体的授权引导已在 reportGps 内部处理
  501. });
  502. }
  503. },
  504. toggleCallMenu(item) {
  505. if (this.activeCallItem === item) {
  506. this.activeCallItem = null;
  507. } else {
  508. this.activeCallItem = item;
  509. }
  510. },
  511. closeCallMenu() {
  512. this.activeCallItem = null;
  513. },
  514. doCall(type, item) {
  515. let phoneNum = '';
  516. const targetItem = item || this.activeCallItem;
  517. // 1. 获取电话号码
  518. if (type === 'merchant') {
  519. phoneNum = '18900008451';
  520. } else if (type === 'customer') {
  521. phoneNum = targetItem?.customerPhone;
  522. }
  523. // 2. 基础校验
  524. if (!phoneNum) {
  525. uni.showToast({ title: '未找到电话号码', icon: 'none' });
  526. this.activeCallItem = null;
  527. return;
  528. }
  529. // 3. 清洗号码 (去除空格、横杠等非数字字符)
  530. phoneNum = phoneNum.replace(/[^\d]/g, '');
  531. // 二次校验:确保清洗后仍有数字
  532. if (phoneNum.length < 3) {
  533. uni.showToast({ title: '电话号码格式错误', icon: 'none' });
  534. this.activeCallItem = null;
  535. return;
  536. }
  537. console.log('正在发起直接呼叫:', phoneNum);
  538. // 4. 核心逻辑:区分环境处理
  539. // #ifdef APP-PLUS
  540. // App 端:使用 uni.makePhoneCall 直接发起呼叫
  541. uni.makePhoneCall({
  542. phoneNumber: phoneNum,
  543. success: () => {
  544. console.log('成功唤起系统拨号盘');
  545. },
  546. fail: (err) => {
  547. console.error('拨号失败:', err);
  548. // 常见错误:Permission denied (权限被拒) 或 Activity not found
  549. let msg = '拨号失败';
  550. if (err.message && err.message.includes('permission')) {
  551. msg = '请在手机设置中允许"电话"权限';
  552. }
  553. uni.showToast({ title: msg, icon: 'none', duration: 3000 });
  554. // 如果失败,尝试引导用户去设置页 (仅限 Android)
  555. // #ifdef APP-ANDROID
  556. if (err.message && err.message.includes('permission')) {
  557. uni.showModal({
  558. title: '权限提示',
  559. content: '拨打电话需要电话权限,是否前往设置开启?',
  560. success: (res) => {
  561. if (res.confirm) {
  562. plus.runtime.openURL("app-settings:");
  563. }
  564. }
  565. });
  566. }
  567. // #endif
  568. },
  569. complete: () => {
  570. this.activeCallItem = null; // 关闭弹窗
  571. }
  572. });
  573. // #endif
  574. // #ifdef H5
  575. // H5 端:使用 tel: 协议
  576. window.location.href = `tel:${phoneNum}`;
  577. this.activeCallItem = null;
  578. // #endif
  579. // #ifdef MP-WEIXIN
  580. // 小程序端:直接调用 makePhoneCall (微信小程序支持直接弹框确认拨打)
  581. uni.makePhoneCall({
  582. phoneNumber: phoneNum,
  583. fail: () => {
  584. uni.showToast({ title: '拨号失败', icon: 'none' });
  585. },
  586. complete: () => {
  587. this.activeCallItem = null;
  588. }
  589. });
  590. // #endif
  591. },
  592. reportAbnormal(item) {
  593. uni.navigateTo({ url: '/pages/orders/anomaly/index?orderId=' + (item.id || '') });
  594. },
  595. toggleDropdown(idx) {
  596. if (this.activeDropdown === idx) {
  597. this.activeDropdown = 0;
  598. } else {
  599. this.activeDropdown = idx;
  600. }
  601. },
  602. closeDropdown() {
  603. this.activeDropdown = 0;
  604. },
  605. selectType(index) {
  606. this.currentTypeFilterIdx = index;
  607. this.closeDropdown();
  608. },
  609. initCalendar() {
  610. const year = this.viewDate.getFullYear();
  611. const month = this.viewDate.getMonth();
  612. this.currentMonth = `${year}年${month + 1}月`;
  613. // 获取该月第一天是周几 (0-6)
  614. const firstDay = new Date(year, month, 1).getDay();
  615. // 获取该月有多少天
  616. const daysInMonth = new Date(year, month + 1, 0).getDate();
  617. let days = [];
  618. // 填充开头的空白
  619. for (let i = 0; i < firstDay; i++) {
  620. days.push(0);
  621. }
  622. // 填充真实日期
  623. for (let i = 1; i <= daysInMonth; i++) {
  624. days.push(i);
  625. }
  626. this.calendarDays = days;
  627. },
  628. prevMonth() {
  629. this.viewDate.setMonth(this.viewDate.getMonth() - 1);
  630. // 切换月份时强制重新创建 Date 对象以触发 Vue 响应式(如果需要)或者简单调用 init
  631. this.viewDate = new Date(this.viewDate);
  632. this.initCalendar();
  633. },
  634. nextMonth() {
  635. this.viewDate.setMonth(this.viewDate.getMonth() + 1);
  636. this.viewDate = new Date(this.viewDate);
  637. this.initCalendar();
  638. },
  639. selectDateItem(day) {
  640. if (this.selectedDateRange.length === 2) {
  641. this.selectedDateRange = [day];
  642. } else if (this.selectedDateRange.length === 1) {
  643. let start = this.selectedDateRange[0];
  644. if (day > start) {
  645. this.selectedDateRange = [start, day];
  646. } else if (day < start) {
  647. this.selectedDateRange = [day, start];
  648. } else {
  649. this.selectedDateRange = [];
  650. }
  651. } else {
  652. this.selectedDateRange = [day];
  653. }
  654. },
  655. getDateClass(day) {
  656. if (!day || this.selectedDateRange.length === 0) return '';
  657. if (this.selectedDateRange.length === 1) {
  658. return day === this.selectedDateRange[0] ? 'is-start' : '';
  659. }
  660. let start = this.selectedDateRange[0];
  661. let end = this.selectedDateRange[1];
  662. if (day === start) return 'is-start';
  663. if (day === end) return 'is-end';
  664. if (day > start && day < end) return 'is-between';
  665. return '';
  666. },
  667. resetTimeFilter() {
  668. this.hasTimeFilter = false;
  669. this.selectedDateRange = [];
  670. this.startServiceTime = '';
  671. this.endServiceTime = '';
  672. this.closeDropdown();
  673. this.loadOrders();
  674. },
  675. confirmTimeFilter() {
  676. if (this.selectedDateRange.length === 0) {
  677. uni.showToast({ title: '请先选择日期', icon: 'none' });
  678. return;
  679. }
  680. // 构建时间范围参数
  681. const year = this.currentMonth.replace(/[^0-9]/g, '').substring(0, 4);
  682. const month = this.currentMonth.replace(/[^0-9]/g, '').substring(4);
  683. const pad = (n) => String(n).padStart(2, '0');
  684. if (this.selectedDateRange.length === 2) {
  685. this.startServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 00:00:00`;
  686. this.endServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[1])} 23:59:59`;
  687. } else {
  688. this.startServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 00:00:00`;
  689. this.endServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 23:59:59`;
  690. }
  691. this.hasTimeFilter = true;
  692. this.closeDropdown();
  693. this.loadOrders();
  694. },
  695. getMainActionText(item) {
  696. return '查看详情';
  697. },
  698. mainAction(item) {
  699. uni.navigateTo({ url: `/pages/orders/detail/index?id=${item.id}` });
  700. },
  701. openRemarkInput() {
  702. this.remarkText = '';
  703. this.showRemarkInput = true;
  704. },
  705. closeRemarkInput() {
  706. this.showRemarkInput = false;
  707. this.remarkText = '';
  708. },
  709. submitRemark() {
  710. const text = this.remarkText.trim();
  711. if (!text) {
  712. uni.showToast({ title: '备注内容不能为空', icon: 'none' });
  713. return;
  714. }
  715. const now = new Date();
  716. const dateStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
  717. if (!this.currentPetInfo.petLogs) {
  718. this.$set(this.currentPetInfo, 'petLogs', []);
  719. }
  720. this.currentPetInfo.petLogs.unshift({
  721. date: dateStr,
  722. content: text,
  723. recorder: '我'
  724. });
  725. uni.showToast({ title: '备注已添加', icon: 'success' });
  726. this.closeRemarkInput();
  727. },
  728. /**
  729. * 取消订单处理逻辑
  730. * @param {Object} item - 订单项
  731. */
  732. handleCancelOrder(item) {
  733. uni.showModal({
  734. title: '提示',
  735. content: '确认是否取消这个订单?',
  736. success: async (res) => {
  737. if (res.confirm) {
  738. try {
  739. uni.showLoading({ title: '取消中...', mask: true });
  740. await cancelOrderApi({ orderId: item.id });
  741. uni.showToast({ title: '订单已取消', icon: 'success' });
  742. // 延时刷新列表,防止提示框闪现
  743. setTimeout(() => {
  744. this.loadOrders();
  745. }, 1500);
  746. } catch (err) {
  747. console.error('取消订单失败:', err);
  748. uni.showToast({ title: '取消失败', icon: 'none' });
  749. } finally {
  750. uni.hideLoading();
  751. }
  752. }
  753. }
  754. });
  755. }
  756. }
  757. }
  758. </script>
  759. <style>
  760. page {
  761. background-color: #F8F8F8;
  762. }
  763. .custom-nav-bar {
  764. padding: 80rpx 30rpx 20rpx;
  765. background-color: #fff;
  766. display: flex;
  767. align-items: center;
  768. justify-content: center;
  769. }
  770. .nav-title {
  771. font-size: 34rpx;
  772. font-weight: bold;
  773. color: #333;
  774. }
  775. .sticky-header {
  776. position: sticky;
  777. top: 0;
  778. z-index: 999;
  779. background-color: #F8F8F8;
  780. }
  781. .container {
  782. background-color: #F8F8F8;
  783. display: flex;
  784. flex-direction: column;
  785. min-height: 100vh;
  786. }
  787. .status-tabs {
  788. display: flex;
  789. background-color: #fff;
  790. padding: 0 30rpx;
  791. justify-content: space-between;
  792. }
  793. .tab-item {
  794. position: relative;
  795. padding: 20rpx 0;
  796. font-size: 26rpx;
  797. color: #666;
  798. font-weight: 500;
  799. }
  800. .tab-item.active {
  801. color: #FF5722;
  802. font-weight: bold;
  803. }
  804. .indicator {
  805. position: absolute;
  806. bottom: 0;
  807. left: 50%;
  808. transform: translateX(-50%);
  809. width: 40rpx;
  810. height: 6rpx;
  811. background-color: #FF5722;
  812. border-radius: 3rpx;
  813. }
  814. .search-bar {
  815. padding: 10rpx 30rpx;
  816. background-color: #fff;
  817. }
  818. .search-input-box {
  819. display: flex;
  820. align-items: center;
  821. background-color: #F8F8F8;
  822. height: 64rpx;
  823. border-radius: 32rpx;
  824. padding: 0 30rpx;
  825. }
  826. .search-input {
  827. flex: 1;
  828. font-size: 26rpx;
  829. color: #333;
  830. padding-left: 20rpx;
  831. }
  832. .ph-style {
  833. font-size: 26rpx;
  834. color: #999;
  835. }
  836. .filter-wrapper {
  837. position: relative;
  838. z-index: 998;
  839. }
  840. .filter-bar {
  841. display: flex;
  842. background-color: #fff;
  843. padding: 5rpx 30rpx 10rpx 30rpx;
  844. justify-content: space-between;
  845. position: relative;
  846. z-index: 998;
  847. }
  848. .filter-item {
  849. width: 48%;
  850. display: flex;
  851. align-items: center;
  852. justify-content: center;
  853. font-size: 26rpx;
  854. color: #666;
  855. background-color: #F8F8F8;
  856. height: 56rpx;
  857. border-radius: 12rpx;
  858. transition: all 0.2s;
  859. }
  860. .filter-item.active {
  861. background-color: #FFF3E0;
  862. }
  863. .active-text {
  864. color: #FF5722;
  865. font-weight: 500;
  866. }
  867. .triangle {
  868. width: 0;
  869. height: 0;
  870. border-left: 8rpx solid transparent;
  871. border-right: 8rpx solid transparent;
  872. margin-left: 10rpx;
  873. transition: all 0.2s;
  874. }
  875. .triangle.down {
  876. border-top: 10rpx solid #dcdcdc;
  877. }
  878. .filter-item.active .triangle.down,
  879. .active-text+.triangle.down {
  880. border-top-color: #FF5722;
  881. }
  882. .triangle.up {
  883. border-bottom: 10rpx solid #FF5722;
  884. }
  885. .dropdown-mask {
  886. position: absolute;
  887. top: 100%;
  888. left: 0;
  889. right: 0;
  890. height: 100vh;
  891. background-color: rgba(0, 0, 0, 0.4);
  892. z-index: 80;
  893. }
  894. .dropdown-panel {
  895. position: absolute;
  896. top: 100%;
  897. left: 0;
  898. right: 0;
  899. background-color: #fff;
  900. z-index: 90;
  901. border-radius: 0 0 20rpx 20rpx;
  902. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.05);
  903. overflow: hidden;
  904. }
  905. .type-option {
  906. padding: 30rpx 40rpx;
  907. font-size: 28rpx;
  908. color: #333;
  909. border-bottom: 1px solid #f5f5f5;
  910. }
  911. .type-option:last-child {
  912. border-bottom: none;
  913. }
  914. .type-option.selected text {
  915. color: #FF5722;
  916. font-weight: bold;
  917. }
  918. .calendar-panel {
  919. padding-bottom: 30rpx;
  920. }
  921. .custom-calendar-container {
  922. padding: 20rpx 30rpx 0;
  923. }
  924. .cal-header {
  925. display: flex;
  926. justify-content: space-between;
  927. align-items: center;
  928. padding: 20rpx 0;
  929. }
  930. .cal-title {
  931. font-size: 32rpx;
  932. font-weight: bold;
  933. color: #333;
  934. }
  935. .cal-weekdays {
  936. display: flex;
  937. justify-content: space-around;
  938. padding: 20rpx 0;
  939. border-bottom: 1px solid #f5f5f5;
  940. }
  941. .wk-item {
  942. font-size: 24rpx;
  943. color: #999;
  944. width: 14.28%;
  945. text-align: center;
  946. }
  947. .cal-body {
  948. display: flex;
  949. flex-wrap: wrap;
  950. padding-top: 20rpx;
  951. }
  952. .cal-day-box {
  953. width: 14.28%;
  954. height: 80rpx;
  955. display: flex;
  956. align-items: center;
  957. justify-content: center;
  958. margin-bottom: 10rpx;
  959. position: relative;
  960. }
  961. .cal-day-text {
  962. width: 64rpx;
  963. height: 64rpx;
  964. line-height: 64rpx;
  965. text-align: center;
  966. font-size: 28rpx;
  967. color: #333;
  968. border-radius: 8rpx;
  969. position: relative;
  970. z-index: 2;
  971. }
  972. .cal-day-box.is-start .cal-day-text,
  973. .cal-day-box.is-end .cal-day-text {
  974. background-color: #FF5722;
  975. color: #fff;
  976. font-weight: bold;
  977. }
  978. .cal-day-box.is-start::after {
  979. content: '';
  980. position: absolute;
  981. right: 0;
  982. top: 8rpx;
  983. bottom: 8rpx;
  984. width: 50%;
  985. background-color: #FFF3E0;
  986. z-index: 1;
  987. }
  988. .cal-day-box.is-end::after {
  989. content: '';
  990. position: absolute;
  991. left: 0;
  992. top: 8rpx;
  993. bottom: 8rpx;
  994. width: 50%;
  995. background-color: #FFF3E0;
  996. z-index: 1;
  997. }
  998. .cal-day-box.is-start.is-end::after {
  999. display: none;
  1000. }
  1001. .cal-day-box.is-between {
  1002. background-color: #FFF3E0;
  1003. margin-top: 8rpx;
  1004. height: 64rpx;
  1005. margin-bottom: 18rpx;
  1006. }
  1007. .cal-day-box.is-between .cal-day-text {
  1008. color: #FF5722;
  1009. }
  1010. .calendar-actions {
  1011. display: flex;
  1012. justify-content: space-between;
  1013. padding: 0 30rpx;
  1014. margin-top: 20rpx;
  1015. }
  1016. .cal-btn {
  1017. width: 48%;
  1018. height: 70rpx;
  1019. line-height: 70rpx;
  1020. text-align: center;
  1021. border-radius: 10rpx;
  1022. font-size: 28rpx;
  1023. margin: 0;
  1024. }
  1025. .cal-btn.reset {
  1026. background-color: #f5f5f5;
  1027. color: #666;
  1028. }
  1029. .cal-btn.confirm {
  1030. background-color: #FF5722;
  1031. color: #fff;
  1032. }
  1033. .order-list {
  1034. padding: 0 30rpx;
  1035. width: 100%;
  1036. box-sizing: border-box;
  1037. }
  1038. .order-card {
  1039. background-color: #fff;
  1040. border-radius: 24rpx;
  1041. padding: 20rpx 20rpx;
  1042. margin-bottom: 20rpx;
  1043. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.03);
  1044. }
  1045. .order-card:first-child {
  1046. margin-top: 20rpx;
  1047. }
  1048. .card-header {
  1049. display: flex;
  1050. justify-content: space-between;
  1051. align-items: center;
  1052. margin-bottom: 15rpx;
  1053. }
  1054. .type-badge {
  1055. display: flex;
  1056. align-items: center;
  1057. }
  1058. .type-icon {
  1059. width: 44rpx;
  1060. height: 44rpx;
  1061. margin-right: 15rpx;
  1062. background-color: #FFF3E0;
  1063. border-radius: 50%;
  1064. padding: 6rpx;
  1065. box-sizing: border-box;
  1066. }
  1067. .type-text {
  1068. font-size: 30rpx;
  1069. font-weight: bold;
  1070. color: #333;
  1071. }
  1072. .status-badge {
  1073. font-size: 28rpx;
  1074. }
  1075. .status-badge.highlight {
  1076. color: #FF5722;
  1077. }
  1078. .status-badge.processing {
  1079. color: #2196F3;
  1080. }
  1081. .status-badge.finish {
  1082. color: #4CAF50;
  1083. }
  1084. .status-badge.reject {
  1085. color: #9E9E9E;
  1086. }
  1087. .time-row {
  1088. display: flex;
  1089. justify-content: space-between;
  1090. align-items: center;
  1091. margin-bottom: 25rpx;
  1092. }
  1093. .time-row .time-col {
  1094. display: flex;
  1095. align-items: center;
  1096. font-size: 26rpx;
  1097. color: #333;
  1098. }
  1099. .time-row .label {
  1100. color: #666;
  1101. margin-right: 10rpx;
  1102. }
  1103. .fulfillmentCommission {
  1104. font-size: 36rpx;
  1105. font-weight: bold;
  1106. color: #FF5722;
  1107. }
  1108. .pet-card {
  1109. background-color: #FFF8F0;
  1110. border-radius: 16rpx;
  1111. padding: 15rpx 20rpx;
  1112. display: flex;
  1113. align-items: center;
  1114. margin-bottom: 20rpx;
  1115. }
  1116. .pet-avatar {
  1117. width: 80rpx;
  1118. height: 80rpx;
  1119. border-radius: 50%;
  1120. margin-right: 20rpx;
  1121. }
  1122. .pet-info {
  1123. flex: 1;
  1124. display: flex;
  1125. flex-direction: column;
  1126. }
  1127. .pet-name {
  1128. font-size: 28rpx;
  1129. font-weight: bold;
  1130. color: #333;
  1131. margin-bottom: 5rpx;
  1132. }
  1133. .pet-breed {
  1134. font-size: 24rpx;
  1135. color: #999;
  1136. }
  1137. .pet-profile-btn {
  1138. font-size: 24rpx;
  1139. color: #FF9800;
  1140. border: 1px solid #FF9800;
  1141. padding: 6rpx 20rpx;
  1142. border-radius: 50rpx;
  1143. background-color: #fff;
  1144. }
  1145. .route-info {
  1146. margin-bottom: 25rpx;
  1147. }
  1148. .route-item {
  1149. display: flex;
  1150. align-items: flex-start;
  1151. padding-bottom: 12rpx;
  1152. position: relative;
  1153. width: 100%;
  1154. }
  1155. .route-item:not(:last-child) {
  1156. margin-bottom: 5rpx;
  1157. }
  1158. .route-item:last-child {
  1159. padding-bottom: 0;
  1160. margin-bottom: 0;
  1161. }
  1162. .route-line-vertical {
  1163. position: absolute;
  1164. left: 19rpx;
  1165. top: 46rpx;
  1166. bottom: -15rpx;
  1167. border-left: 2rpx dashed #E0E0E0;
  1168. width: 0;
  1169. z-index: 0;
  1170. }
  1171. .icon-circle {
  1172. width: 40rpx;
  1173. height: 40rpx;
  1174. border-radius: 50%;
  1175. color: #fff;
  1176. font-size: 22rpx;
  1177. display: flex;
  1178. align-items: center;
  1179. justify-content: center;
  1180. margin-right: 20rpx;
  1181. flex-shrink: 0;
  1182. font-weight: bold;
  1183. margin-top: 6rpx;
  1184. position: relative;
  1185. z-index: 1;
  1186. }
  1187. .icon-circle.service {
  1188. background-color: #81C784;
  1189. }
  1190. .icon-circle.start {
  1191. background-color: #FFB74D;
  1192. }
  1193. .icon-circle.end {
  1194. background-color: #81C784;
  1195. }
  1196. .address-box {
  1197. flex: 1;
  1198. display: flex;
  1199. flex-direction: column;
  1200. margin-right: 20rpx;
  1201. }
  1202. .addr-title {
  1203. font-size: 28rpx;
  1204. font-weight: bold;
  1205. color: #333;
  1206. margin-bottom: 4rpx;
  1207. }
  1208. .addr-desc {
  1209. font-size: 24rpx;
  1210. color: #999;
  1211. line-height: 1.4;
  1212. }
  1213. .distance-tag {
  1214. display: flex;
  1215. align-items: center;
  1216. justify-content: flex-end;
  1217. flex-shrink: 0;
  1218. min-width: 80rpx;
  1219. }
  1220. .distance-text {
  1221. font-size: 24rpx;
  1222. color: #FF5722;
  1223. margin-right: 15rpx;
  1224. font-weight: 500;
  1225. }
  1226. .nav-icon-circle {
  1227. width: 48rpx;
  1228. height: 48rpx;
  1229. background-color: #FFF3E0;
  1230. border-radius: 50%;
  1231. display: flex;
  1232. align-items: center;
  1233. justify-content: center;
  1234. }
  1235. .nav-arrow {
  1236. width: 24rpx;
  1237. height: 24rpx;
  1238. }
  1239. .service-content {
  1240. margin-top: -10rpx;
  1241. font-size: 24rpx;
  1242. color: #666;
  1243. padding-left: 60rpx;
  1244. }
  1245. .content-label {
  1246. color: #999;
  1247. margin-right: 10rpx;
  1248. }
  1249. .remark-box {
  1250. background-color: #F8F8F8;
  1251. padding: 15rpx 20rpx;
  1252. border-radius: 8rpx;
  1253. font-size: 26rpx;
  1254. color: #666;
  1255. margin-bottom: 30rpx;
  1256. }
  1257. .action-btns {
  1258. display: flex;
  1259. justify-content: space-between;
  1260. margin-top: 15rpx;
  1261. }
  1262. .action-left {
  1263. display: flex;
  1264. }
  1265. .action-right {
  1266. display: flex;
  1267. }
  1268. .btn {
  1269. height: 60rpx;
  1270. line-height: 60rpx;
  1271. border-radius: 30rpx;
  1272. font-size: 26rpx;
  1273. padding: 0 30rpx;
  1274. margin: 0;
  1275. }
  1276. .action-right .btn:not(:last-child) {
  1277. margin-right: 20rpx;
  1278. }
  1279. .btn::after {
  1280. border: none;
  1281. }
  1282. .btn.normal {
  1283. background-color: #F8F8F8;
  1284. color: #666;
  1285. border: none;
  1286. }
  1287. .btn.primary {
  1288. background: linear-gradient(90deg, #FF9800 0%, #FF5722 100%);
  1289. color: #fff;
  1290. box-shadow: 0 4rpx 12rpx rgba(255, 87, 34, 0.2);
  1291. border: none;
  1292. }
  1293. .btn.normal.danger {
  1294. background-color: #FFF2F0;
  1295. color: #F5222D;
  1296. }
  1297. .pet-modal-mask {
  1298. position: fixed;
  1299. top: 0;
  1300. left: 0;
  1301. right: 0;
  1302. bottom: 0;
  1303. background-color: rgba(0, 0, 0, 0.4);
  1304. z-index: 1000;
  1305. display: flex;
  1306. align-items: center;
  1307. justify-content: center;
  1308. }
  1309. .pet-modal-content {
  1310. width: 680rpx;
  1311. height: 85vh;
  1312. background-color: #fff;
  1313. border-radius: 20rpx;
  1314. display: flex;
  1315. flex-direction: column;
  1316. overflow: hidden;
  1317. }
  1318. .pet-modal-header {
  1319. display: flex;
  1320. align-items: center;
  1321. justify-content: space-between;
  1322. padding: 30rpx;
  1323. border-bottom: 1rpx solid #F0F0F0;
  1324. }
  1325. .pet-modal-title {
  1326. font-size: 34rpx;
  1327. font-weight: bold;
  1328. color: #333;
  1329. }
  1330. .pet-modal-scroll {
  1331. flex: 1;
  1332. height: 0;
  1333. padding: 30rpx;
  1334. box-sizing: border-box;
  1335. }
  1336. .pet-base-info {
  1337. display: flex;
  1338. align-items: center;
  1339. margin-bottom: 40rpx;
  1340. }
  1341. .pm-avatar {
  1342. width: 120rpx;
  1343. height: 120rpx;
  1344. border-radius: 50%;
  1345. margin-right: 30rpx;
  1346. border: 2rpx solid #f5f5f5;
  1347. }
  1348. .pm-info-text {
  1349. flex: 1;
  1350. display: flex;
  1351. flex-direction: column;
  1352. }
  1353. .pm-name-row {
  1354. display: flex;
  1355. align-items: center;
  1356. margin-bottom: 15rpx;
  1357. }
  1358. .pm-name {
  1359. font-size: 36rpx;
  1360. font-weight: bold;
  1361. color: #333;
  1362. margin-right: 20rpx;
  1363. }
  1364. .pm-gender {
  1365. display: flex;
  1366. align-items: center;
  1367. background-color: #E3F2FD;
  1368. padding: 4rpx 12rpx;
  1369. border-radius: 20rpx;
  1370. }
  1371. .pm-gender text {
  1372. font-size: 22rpx;
  1373. color: #1E88E5;
  1374. }
  1375. .pm-gender .gender-icon {
  1376. font-weight: bold;
  1377. margin-right: 4rpx;
  1378. }
  1379. .pm-gender.female {
  1380. background-color: #FCE4EC;
  1381. }
  1382. .pm-gender.female text {
  1383. color: #D81B60;
  1384. }
  1385. .pm-breed {
  1386. font-size: 26rpx;
  1387. color: #999;
  1388. }
  1389. .pm-detail-grid {
  1390. display: flex;
  1391. flex-wrap: wrap;
  1392. justify-content: space-between;
  1393. }
  1394. .pm-grid-item {
  1395. background-color: #F8F8F8;
  1396. border-radius: 16rpx;
  1397. padding: 24rpx;
  1398. margin-bottom: 20rpx;
  1399. display: flex;
  1400. flex-direction: column;
  1401. }
  1402. .pm-grid-item.half {
  1403. width: 48%;
  1404. box-sizing: border-box;
  1405. }
  1406. .pm-grid-item.full {
  1407. width: 100%;
  1408. box-sizing: border-box;
  1409. }
  1410. .pm-label {
  1411. font-size: 24rpx;
  1412. color: #999;
  1413. margin-bottom: 10rpx;
  1414. }
  1415. .pm-val {
  1416. font-size: 28rpx;
  1417. color: #333;
  1418. font-weight: 500;
  1419. }
  1420. .pm-tags {
  1421. display: flex;
  1422. flex-wrap: wrap;
  1423. gap: 20rpx;
  1424. margin-bottom: 40rpx;
  1425. }
  1426. .pm-tag {
  1427. background-color: #FFF8EB;
  1428. border: 2rpx solid #FFCC80;
  1429. color: #FF9800;
  1430. font-size: 22rpx;
  1431. padding: 8rpx 24rpx;
  1432. border-radius: 30rpx;
  1433. }
  1434. .pm-section-title {
  1435. display: flex;
  1436. align-items: center;
  1437. margin-bottom: 30rpx;
  1438. padding-top: 30rpx;
  1439. border-top: 2rpx dashed #F0F0F0;
  1440. }
  1441. .pm-section-title .orange-bar {
  1442. width: 8rpx;
  1443. height: 32rpx;
  1444. background-color: #FF9800;
  1445. margin-right: 16rpx;
  1446. border-radius: 4rpx;
  1447. }
  1448. .pm-section-title text {
  1449. font-size: 30rpx;
  1450. font-weight: bold;
  1451. color: #333;
  1452. }
  1453. .pm-log-list {
  1454. display: flex;
  1455. flex-direction: column;
  1456. }
  1457. .pm-log-item {
  1458. display: flex;
  1459. flex-direction: column;
  1460. padding: 24rpx 0;
  1461. border-bottom: 1rpx solid #F0F0F0;
  1462. }
  1463. .pm-log-item:last-child {
  1464. border-bottom: none;
  1465. }
  1466. .pm-log-date {
  1467. font-size: 24rpx;
  1468. color: #999;
  1469. margin-bottom: 16rpx;
  1470. }
  1471. .pm-log-text {
  1472. font-size: 28rpx;
  1473. color: #333;
  1474. line-height: 1.6;
  1475. margin-bottom: 20rpx;
  1476. }
  1477. .pm-log-recorder {
  1478. font-size: 24rpx;
  1479. color: #FF9800;
  1480. align-self: flex-end;
  1481. }
  1482. .pm-bottom-close {
  1483. width: 100%;
  1484. height: 80rpx;
  1485. line-height: 80rpx;
  1486. background-color: #F5F5F5;
  1487. color: #666;
  1488. border-radius: 40rpx;
  1489. font-size: 30rpx;
  1490. font-weight: bold;
  1491. margin: 0;
  1492. }
  1493. .pm-bottom-close::after {
  1494. border: none;
  1495. }
  1496. .close-icon-btn {
  1497. font-size: 48rpx;
  1498. color: #999;
  1499. line-height: 1;
  1500. padding: 0 10rpx;
  1501. }
  1502. .nav-modal-mask {
  1503. position: fixed;
  1504. top: 0;
  1505. left: 0;
  1506. right: 0;
  1507. bottom: 0;
  1508. background-color: rgba(0, 0, 0, 0.5);
  1509. z-index: 1000;
  1510. display: flex;
  1511. flex-direction: column;
  1512. justify-content: flex-end;
  1513. }
  1514. .nav-action-sheet {
  1515. background-color: #fff;
  1516. width: 100%;
  1517. border-top-left-radius: 24rpx;
  1518. border-top-right-radius: 24rpx;
  1519. overflow: hidden;
  1520. padding-bottom: constant(safe-area-inset-bottom);
  1521. padding-bottom: env(safe-area-inset-bottom);
  1522. }
  1523. .nav-sheet-title {
  1524. text-align: center;
  1525. padding: 30rpx 0;
  1526. font-size: 13px;
  1527. color: #999;
  1528. border-bottom: 1rpx solid #efefef;
  1529. }
  1530. .nav-sheet-item {
  1531. text-align: center;
  1532. padding: 30rpx 0;
  1533. font-size: 13px;
  1534. color: #333;
  1535. background-color: #fff;
  1536. border-bottom: 1rpx solid #efefef;
  1537. }
  1538. .nav-sheet-item.cancel {
  1539. border-bottom: none;
  1540. color: #666;
  1541. }
  1542. .nav-sheet-gap {
  1543. height: 16rpx;
  1544. background-color: #F8F8F8;
  1545. }
  1546. .order-list {
  1547. flex: 1;
  1548. overflow-y: auto;
  1549. width: 100%;
  1550. padding: 0 30rpx;
  1551. box-sizing: border-box;
  1552. }
  1553. .loading-text {
  1554. text-align: center;
  1555. font-size: 24rpx;
  1556. color: #999;
  1557. padding: 30rpx 0;
  1558. }
  1559. .pm-header-actions {
  1560. display: flex;
  1561. align-items: center;
  1562. gap: 16rpx;
  1563. }
  1564. .pm-remark-btn {
  1565. font-size: 24rpx;
  1566. color: #fff;
  1567. background-color: #FF9800;
  1568. padding: 6rpx 18rpx;
  1569. border-radius: 20rpx;
  1570. }
  1571. .remark-mask {
  1572. position: fixed;
  1573. top: 0;
  1574. left: 0;
  1575. right: 0;
  1576. bottom: 0;
  1577. background-color: rgba(0, 0, 0, 0.5);
  1578. z-index: 3000;
  1579. display: flex;
  1580. align-items: center;
  1581. justify-content: center;
  1582. }
  1583. .remark-sheet {
  1584. width: 600rpx;
  1585. background-color: #fff;
  1586. border-radius: 24rpx;
  1587. padding: 40rpx;
  1588. box-sizing: border-box;
  1589. display: flex;
  1590. flex-direction: column;
  1591. align-items: center;
  1592. }
  1593. .remark-sheet-header {
  1594. width: 100%;
  1595. text-align: center;
  1596. margin-bottom: 30rpx;
  1597. position: relative;
  1598. }
  1599. .remark-sheet-header .close-icon-btn {
  1600. position: absolute;
  1601. right: 0;
  1602. top: 50%;
  1603. transform: translateY(-50%);
  1604. }
  1605. .remark-sheet-title {
  1606. font-size: 32rpx;
  1607. font-weight: bold;
  1608. color: #333;
  1609. }
  1610. .remark-textarea {
  1611. width: 100%;
  1612. height: 160rpx;
  1613. border: 1rpx solid #eee;
  1614. border-radius: 12rpx;
  1615. padding: 20rpx;
  1616. font-size: 28rpx;
  1617. color: #333;
  1618. box-sizing: border-box;
  1619. margin-bottom: 40rpx;
  1620. }
  1621. .remark-submit-btn {
  1622. width: 100%;
  1623. background-color: #FF5722;
  1624. color: #fff;
  1625. font-size: 32rpx;
  1626. font-weight: bold;
  1627. text-align: center;
  1628. padding: 24rpx 0;
  1629. border-radius: 16rpx;
  1630. }
  1631. .action-left {
  1632. position: relative;
  1633. z-index: 10;
  1634. }
  1635. .action-left .btn.normal {
  1636. font-size: 26rpx;
  1637. }
  1638. .call-popover {
  1639. position: absolute;
  1640. top: calc(100% + 10rpx);
  1641. left: 0;
  1642. background-color: #fff;
  1643. border-radius: 12rpx;
  1644. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
  1645. z-index: 999;
  1646. display: flex;
  1647. flex-direction: column;
  1648. width: 200rpx;
  1649. }
  1650. .call-pop-item {
  1651. font-size: 26rpx;
  1652. color: #333;
  1653. text-align: center;
  1654. padding: 24rpx 0;
  1655. border-bottom: 1rpx solid #eee;
  1656. }
  1657. .call-pop-item:last-child {
  1658. border-bottom: none;
  1659. }
  1660. .call-mask {
  1661. position: fixed;
  1662. top: 0;
  1663. left: 0;
  1664. right: 0;
  1665. bottom: 0;
  1666. z-index: 900;
  1667. background: transparent;
  1668. }
  1669. </style>