index.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833
  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. <!-- Feb 2026 starts on Sunday (index 0), so no empty padding needed for first row -->
  59. <view v-for="(day, idx) in calendarDays" :key="idx" class="cal-day-box"
  60. :class="getDateClass(day)" @click="selectDateItem(day)">
  61. <view class="cal-day-text">{{ day }}</view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="calendar-actions">
  66. <button class="cal-btn reset" @click="resetTimeFilter">重置</button>
  67. <button class="cal-btn confirm" @click="confirmTimeFilter">确定</button>
  68. </view>
  69. </view>
  70. </view><!-- end filter-wrapper -->
  71. </view><!-- end sticky-header -->
  72. <!-- 订单列表 -->
  73. <view class="order-list">
  74. <view class="order-card" v-for="(item, index) in orderList" :key="index" @click="goToDetail(item)">
  75. <view class="card-header">
  76. <view class="type-badge">
  77. <image class="type-icon" :src="item.typeIcon"></image>
  78. <text class="type-text">{{ item.typeText }}</text>
  79. </view>
  80. <text class="status-badge" :class="getStatusClass(item)">{{ getDisplayStatus(item) }}</text>
  81. </view>
  82. <view class="card-body">
  83. <view class="time-row">
  84. <view class="time-col">
  85. <text class="label">{{ item.timeLabel }}:</text>
  86. <text class="value">{{ item.time }}</text>
  87. </view>
  88. <text class="fulfillmentCommission">¥{{ item.fulfillmentCommission }}</text>
  89. </view>
  90. <!-- 宠物信息 -->
  91. <view class="pet-card">
  92. <image class="pet-avatar" :src="item.petAvatarUrl || item.petAvatar" mode="aspectFill"></image>
  93. <view class="pet-info">
  94. <text class="pet-name">{{ item.petName }}</text>
  95. <text class="pet-breed">品种: {{ item.petBreed }}</text>
  96. </view>
  97. </view>
  98. <!-- 路线信息 (完全复用 Home 样式) -->
  99. <view class="route-info">
  100. <template v-if="item.type === 1">
  101. <view class="route-item" @click.stop="openNavigation(item, 'start')">
  102. <view class="icon-circle start">起</view>
  103. <view class="route-line-vertical"></view>
  104. <view class="address-box">
  105. <text class="addr-title">{{ item.startLocation }}</text>
  106. <text class="addr-desc">{{ item.startAddress }}</text>
  107. </view>
  108. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"
  109. style="flex-shrink: 0; align-self: center;"></image>
  110. </view>
  111. <view class="route-item" @click.stop="openNavigation(item, 'end')">
  112. <view class="icon-circle end">终</view>
  113. <view class="address-box">
  114. <text class="addr-title">{{ item.endLocation }}</text>
  115. <text class="addr-desc">{{ item.endAddress }}</text>
  116. </view>
  117. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"
  118. style="flex-shrink: 0; align-self: center;"></image>
  119. </view>
  120. </template>
  121. <template v-else>
  122. <view class="route-item" @click.stop="openNavigation(item, 'end')">
  123. <view class="icon-circle service">服</view>
  124. <view class="address-box">
  125. <text class="addr-title">{{ item.endLocation }}</text>
  126. <text class="addr-desc">{{ item.endAddress }}</text>
  127. </view>
  128. <image class="nav-arrow" src="/static/icons/nav_arrow.svg"
  129. style="flex-shrink: 0; align-self: center;"></image>
  130. </view>
  131. <view class="service-content" v-if="item.serviceContent">
  132. <text class="content-label">服务内容:</text>
  133. <text>{{ item.serviceContent }}</text>
  134. </view>
  135. </template>
  136. </view>
  137. <!-- 备注 -->
  138. <view class="remark-box" v-if="item.remark">
  139. <text>备注:{{ item.remark }}</text>
  140. </view>
  141. </view><!-- End of card-body -->
  142. <!-- 按钮组 -->
  143. <view class="action-btns" v-if="['接单', '到达', '出发', '开始', '送达', '结束'].includes(item.statusText)">
  144. <view class="action-left">
  145. <button class="btn normal" @click.stop="doCall('customer', item)">拨号</button>
  146. </view>
  147. <view class="action-right">
  148. <button class="btn normal danger" v-if="item.status === 2"
  149. @click.stop="handleCancelOrder(item)">取消</button>
  150. <button class="btn normal" @click.stop="reportAbnormal(item)">异常上报</button>
  151. <button class="btn primary" @click.stop="mainAction(item)">打卡</button>
  152. </view>
  153. </view>
  154. </view>
  155. <!-- 已加载完提示文字 -->
  156. <view class="loading-text">已加载完</view>
  157. <view style="height: 160rpx;"></view>
  158. </view>
  159. <view class="call-mask" v-if="activeCallItem" @click="closeCallMenu"></view>
  160. </view>
  161. <!-- 宠物档案弹窗 (复用Home) -->
  162. <view class="pet-modal-mask" v-if="showPetModal" @click="closePetProfile">
  163. <view class="pet-modal-content" @click.stop>
  164. <view class="pet-modal-header">
  165. <text class="pet-modal-title">宠物档案</text>
  166. <view class="pm-header-actions">
  167. <view class="pm-remark-btn" @click="openRemarkInput">备注</view>
  168. <view class="close-icon-btn" @click="closePetProfile">×</view>
  169. </view>
  170. </view>
  171. <scroll-view scroll-y class="pet-modal-scroll">
  172. <!-- Basic Info -->
  173. <view class="pet-base-info">
  174. <image class="pm-avatar" :src="currentPetInfo.petAvatar" mode="aspectFill"></image>
  175. <view class="pm-info-text">
  176. <view class="pm-name-row">
  177. <text class="pm-name">{{ currentPetInfo.petName }}</text>
  178. <view class="pm-gender" v-if="currentPetInfo.petGender === 'M'">
  179. <text class="gender-icon">♂</text>
  180. <text>公</text>
  181. </view>
  182. <view class="pm-gender female" v-else-if="currentPetInfo.petGender === 'F'">
  183. <text class="gender-icon">♀</text>
  184. <text>母</text>
  185. </view>
  186. </view>
  187. <text class="pm-breed">品种:{{ currentPetInfo.petBreed }}</text>
  188. </view>
  189. </view>
  190. <!-- Details Grid -->
  191. <view class="pm-detail-grid">
  192. <view class="pm-grid-item half">
  193. <text class="pm-label">年龄</text>
  194. <text class="pm-val">{{ currentPetInfo.petAge || '未知' }}</text>
  195. </view>
  196. <view class="pm-grid-item half">
  197. <text class="pm-label">体重</text>
  198. <text class="pm-val">{{ currentPetInfo.petWeight || '未知' }}</text>
  199. </view>
  200. <view class="pm-grid-item full">
  201. <text class="pm-label">性格</text>
  202. <text class="pm-val">{{ currentPetInfo.petPersonality || '无' }}</text>
  203. </view>
  204. <view class="pm-grid-item full">
  205. <text class="pm-label">爱好</text>
  206. <text class="pm-val">{{ currentPetInfo.petHobby || '无' }}</text>
  207. </view>
  208. <view class="pm-grid-item full">
  209. <text class="pm-label">备注</text>
  210. <text class="pm-val">{{ currentPetInfo.petRemark || '无特殊过敏史' }}</text>
  211. </view>
  212. </view>
  213. <!-- Tags -->
  214. <view class="pm-tags" v-if="currentPetInfo.petTags && currentPetInfo.petTags.length > 0">
  215. <view class="pm-tag" v-for="(tag, index) in currentPetInfo.petTags" :key="index">{{ tag }}</view>
  216. </view>
  217. <!-- Log Section -->
  218. <view class="pm-section-title">
  219. <view class="orange-bar"></view>
  220. <text>备注日志</text>
  221. </view>
  222. <view class="pm-log-list">
  223. <view class="pm-log-item" v-for="(log, lIndex) in currentPetInfo.petLogs" :key="lIndex">
  224. <text class="pm-log-date">{{ log.date }}</text>
  225. <text class="pm-log-text">{{ log.content }}</text>
  226. <text class="pm-log-recorder">{{ log.recorder === '系统记录' ? '' : '记录人: ' }}{{ log.recorder
  227. }}</text>
  228. </view>
  229. </view>
  230. <view style="height: 30rpx;"></view>
  231. </scroll-view>
  232. </view>
  233. </view>
  234. <!-- 备注输入弹窗 -->
  235. <view class="remark-mask" v-if="showRemarkInput" @click="closeRemarkInput">
  236. <view class="remark-sheet" @click.stop>
  237. <view class="remark-sheet-header">
  238. <text class="remark-sheet-title">添加备注</text>
  239. <view class="close-icon-btn" @click="closeRemarkInput">×</view>
  240. </view>
  241. <textarea class="remark-textarea" v-model="remarkText" placeholder="请输入备注内容..." maxlength="500"
  242. auto-height />
  243. <view class="remark-submit-btn" @click="submitRemark">提交备注</view>
  244. </view>
  245. </view>
  246. <!-- 选择地图导航弹窗 (复用Home) -->
  247. <view class="nav-modal-mask" v-if="showNavModal" @click="closeNavModal">
  248. <view class="nav-action-sheet" @click.stop>
  249. <view class="nav-sheet-title">选择地图进行导航</view>
  250. <view class="nav-sheet-item" @click="chooseMap('高德')">高德地图</view>
  251. <view class="nav-sheet-item" @click="chooseMap('腾讯')">腾讯地图</view>
  252. <view class="nav-sheet-item" @click="chooseMap('百度')">百度地图</view>
  253. <view class="nav-sheet-gap"></view>
  254. <view class="nav-sheet-item cancel" @click="closeNavModal">取消</view>
  255. </view>
  256. </view>
  257. <custom-tabbar currentPath="pages/orders/index"></custom-tabbar>
  258. </template>
  259. <script>
  260. import { getMyOrders, cancelOrderApi } from '@/api/order/subOrder'
  261. import { listAllService } from '@/api/service/list'
  262. import { reportGps } from '@/utils/gps'
  263. import customTabbar from '@/components/custom-tabbar/index.vue'
  264. export default {
  265. components: {
  266. customTabbar
  267. },
  268. data() {
  269. return {
  270. currentTab: 0,
  271. tabs: ['待接送/服务', '配送/服务中', '已完成', '已取消'],
  272. typeFilterOptions: ['全部类型'],
  273. currentTypeFilterIdx: 0,
  274. activeDropdown: 0,
  275. hasTimeFilter: false,
  276. currentMonth: '2026年2月',
  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. let days = [];
  611. for (let i = 1; i <= 28; i++) {
  612. days.push(i);
  613. }
  614. this.calendarDays = days;
  615. this.selectedDateRange = [2, 4];
  616. },
  617. prevMonth() { uni.showToast({ title: '上个月', icon: 'none' }); },
  618. nextMonth() { uni.showToast({ title: '下个月', icon: 'none' }); },
  619. selectDateItem(day) {
  620. if (this.selectedDateRange.length === 2) {
  621. this.selectedDateRange = [day];
  622. } else if (this.selectedDateRange.length === 1) {
  623. let start = this.selectedDateRange[0];
  624. if (day > start) {
  625. this.selectedDateRange = [start, day];
  626. } else if (day < start) {
  627. this.selectedDateRange = [day, start];
  628. } else {
  629. this.selectedDateRange = [];
  630. }
  631. } else {
  632. this.selectedDateRange = [day];
  633. }
  634. },
  635. getDateClass(day) {
  636. if (this.selectedDateRange.length === 0) return '';
  637. if (this.selectedDateRange.length === 1) {
  638. return day === this.selectedDateRange[0] ? 'is-start' : '';
  639. }
  640. let start = this.selectedDateRange[0];
  641. let end = this.selectedDateRange[1];
  642. if (day === start) return 'is-start';
  643. if (day === end) return 'is-end';
  644. if (day > start && day < end) return 'is-between';
  645. return '';
  646. },
  647. resetTimeFilter() {
  648. this.hasTimeFilter = false;
  649. this.selectedDateRange = [];
  650. this.startServiceTime = '';
  651. this.endServiceTime = '';
  652. this.closeDropdown();
  653. this.loadOrders();
  654. },
  655. confirmTimeFilter() {
  656. if (this.selectedDateRange.length === 0) {
  657. uni.showToast({ title: '请先选择日期', icon: 'none' });
  658. return;
  659. }
  660. // 构建时间范围参数
  661. const year = this.currentMonth.replace(/[^0-9]/g, '').substring(0, 4);
  662. const month = this.currentMonth.replace(/[^0-9]/g, '').substring(4);
  663. const pad = (n) => String(n).padStart(2, '0');
  664. if (this.selectedDateRange.length === 2) {
  665. this.startServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 00:00:00`;
  666. this.endServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[1])} 23:59:59`;
  667. } else {
  668. this.startServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 00:00:00`;
  669. this.endServiceTime = `${year}-${pad(month)}-${pad(this.selectedDateRange[0])} 23:59:59`;
  670. }
  671. this.hasTimeFilter = true;
  672. this.closeDropdown();
  673. this.loadOrders();
  674. },
  675. getMainActionText(item) {
  676. return '查看详情';
  677. },
  678. mainAction(item) {
  679. uni.navigateTo({ url: `/pages/orders/detail/index?id=${item.id}` });
  680. },
  681. openRemarkInput() {
  682. this.remarkText = '';
  683. this.showRemarkInput = true;
  684. },
  685. closeRemarkInput() {
  686. this.showRemarkInput = false;
  687. this.remarkText = '';
  688. },
  689. submitRemark() {
  690. const text = this.remarkText.trim();
  691. if (!text) {
  692. uni.showToast({ title: '备注内容不能为空', icon: 'none' });
  693. return;
  694. }
  695. const now = new Date();
  696. 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')}`;
  697. if (!this.currentPetInfo.petLogs) {
  698. this.$set(this.currentPetInfo, 'petLogs', []);
  699. }
  700. this.currentPetInfo.petLogs.unshift({
  701. date: dateStr,
  702. content: text,
  703. recorder: '我'
  704. });
  705. uni.showToast({ title: '备注已添加', icon: 'success' });
  706. this.closeRemarkInput();
  707. },
  708. /**
  709. * 取消订单处理逻辑
  710. * @param {Object} item - 订单项
  711. */
  712. handleCancelOrder(item) {
  713. uni.showModal({
  714. title: '提示',
  715. content: '确认是否取消这个订单?',
  716. success: async (res) => {
  717. if (res.confirm) {
  718. try {
  719. uni.showLoading({ title: '取消中...', mask: true });
  720. await cancelOrderApi({ orderId: item.id });
  721. uni.showToast({ title: '订单已取消', icon: 'success' });
  722. // 延时刷新列表,防止提示框闪现
  723. setTimeout(() => {
  724. this.loadOrders();
  725. }, 1500);
  726. } catch (err) {
  727. console.error('取消订单失败:', err);
  728. uni.showToast({ title: '取消失败', icon: 'none' });
  729. } finally {
  730. uni.hideLoading();
  731. }
  732. }
  733. }
  734. });
  735. }
  736. }
  737. }
  738. </script>
  739. <style>
  740. page {
  741. background-color: #F8F8F8;
  742. }
  743. .custom-nav-bar {
  744. padding: 80rpx 30rpx 20rpx;
  745. background-color: #fff;
  746. display: flex;
  747. align-items: center;
  748. justify-content: center;
  749. }
  750. .nav-title {
  751. font-size: 34rpx;
  752. font-weight: bold;
  753. color: #333;
  754. }
  755. .sticky-header {
  756. position: sticky;
  757. top: 0;
  758. z-index: 999;
  759. background-color: #F8F8F8;
  760. }
  761. .container {
  762. background-color: #F8F8F8;
  763. display: flex;
  764. flex-direction: column;
  765. min-height: 100vh;
  766. }
  767. .status-tabs {
  768. display: flex;
  769. background-color: #fff;
  770. padding: 0 30rpx;
  771. justify-content: space-between;
  772. }
  773. .tab-item {
  774. position: relative;
  775. padding: 20rpx 0;
  776. font-size: 26rpx;
  777. color: #666;
  778. font-weight: 500;
  779. }
  780. .tab-item.active {
  781. color: #FF5722;
  782. font-weight: bold;
  783. }
  784. .indicator {
  785. position: absolute;
  786. bottom: 0;
  787. left: 50%;
  788. transform: translateX(-50%);
  789. width: 40rpx;
  790. height: 6rpx;
  791. background-color: #FF5722;
  792. border-radius: 3rpx;
  793. }
  794. .search-bar {
  795. padding: 10rpx 30rpx;
  796. background-color: #fff;
  797. }
  798. .search-input-box {
  799. display: flex;
  800. align-items: center;
  801. background-color: #F8F8F8;
  802. height: 64rpx;
  803. border-radius: 32rpx;
  804. padding: 0 30rpx;
  805. }
  806. .search-input {
  807. flex: 1;
  808. font-size: 26rpx;
  809. color: #333;
  810. padding-left: 20rpx;
  811. }
  812. .ph-style {
  813. font-size: 26rpx;
  814. color: #999;
  815. }
  816. .filter-wrapper {
  817. position: relative;
  818. z-index: 998;
  819. }
  820. .filter-bar {
  821. display: flex;
  822. background-color: #fff;
  823. padding: 5rpx 30rpx 10rpx 30rpx;
  824. justify-content: space-between;
  825. position: relative;
  826. z-index: 998;
  827. }
  828. .filter-item {
  829. width: 48%;
  830. display: flex;
  831. align-items: center;
  832. justify-content: center;
  833. font-size: 26rpx;
  834. color: #666;
  835. background-color: #F8F8F8;
  836. height: 56rpx;
  837. border-radius: 12rpx;
  838. transition: all 0.2s;
  839. }
  840. .filter-item.active {
  841. background-color: #FFF3E0;
  842. }
  843. .active-text {
  844. color: #FF5722;
  845. font-weight: 500;
  846. }
  847. .triangle {
  848. width: 0;
  849. height: 0;
  850. border-left: 8rpx solid transparent;
  851. border-right: 8rpx solid transparent;
  852. margin-left: 10rpx;
  853. transition: all 0.2s;
  854. }
  855. .triangle.down {
  856. border-top: 10rpx solid #dcdcdc;
  857. }
  858. .filter-item.active .triangle.down,
  859. .active-text+.triangle.down {
  860. border-top-color: #FF5722;
  861. }
  862. .triangle.up {
  863. border-bottom: 10rpx solid #FF5722;
  864. }
  865. .dropdown-mask {
  866. position: absolute;
  867. top: 100%;
  868. left: 0;
  869. right: 0;
  870. height: 100vh;
  871. background-color: rgba(0, 0, 0, 0.4);
  872. z-index: 80;
  873. }
  874. .dropdown-panel {
  875. position: absolute;
  876. top: 100%;
  877. left: 0;
  878. right: 0;
  879. background-color: #fff;
  880. z-index: 90;
  881. border-radius: 0 0 20rpx 20rpx;
  882. box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.05);
  883. overflow: hidden;
  884. }
  885. .type-option {
  886. padding: 30rpx 40rpx;
  887. font-size: 28rpx;
  888. color: #333;
  889. border-bottom: 1px solid #f5f5f5;
  890. }
  891. .type-option:last-child {
  892. border-bottom: none;
  893. }
  894. .type-option.selected text {
  895. color: #FF5722;
  896. font-weight: bold;
  897. }
  898. .calendar-panel {
  899. padding-bottom: 30rpx;
  900. }
  901. .custom-calendar-container {
  902. padding: 20rpx 30rpx 0;
  903. }
  904. .cal-header {
  905. display: flex;
  906. justify-content: space-between;
  907. align-items: center;
  908. padding: 20rpx 0;
  909. }
  910. .cal-title {
  911. font-size: 32rpx;
  912. font-weight: bold;
  913. color: #333;
  914. }
  915. .cal-weekdays {
  916. display: flex;
  917. justify-content: space-around;
  918. padding: 20rpx 0;
  919. border-bottom: 1px solid #f5f5f5;
  920. }
  921. .wk-item {
  922. font-size: 24rpx;
  923. color: #999;
  924. width: 14.28%;
  925. text-align: center;
  926. }
  927. .cal-body {
  928. display: flex;
  929. flex-wrap: wrap;
  930. padding-top: 20rpx;
  931. }
  932. .cal-day-box {
  933. width: 14.28%;
  934. height: 80rpx;
  935. display: flex;
  936. align-items: center;
  937. justify-content: center;
  938. margin-bottom: 10rpx;
  939. position: relative;
  940. }
  941. .cal-day-text {
  942. width: 64rpx;
  943. height: 64rpx;
  944. line-height: 64rpx;
  945. text-align: center;
  946. font-size: 28rpx;
  947. color: #333;
  948. border-radius: 8rpx;
  949. position: relative;
  950. z-index: 2;
  951. }
  952. .cal-day-box.is-start .cal-day-text,
  953. .cal-day-box.is-end .cal-day-text {
  954. background-color: #FF5722;
  955. color: #fff;
  956. font-weight: bold;
  957. }
  958. .cal-day-box.is-start::after {
  959. content: '';
  960. position: absolute;
  961. right: 0;
  962. top: 8rpx;
  963. bottom: 8rpx;
  964. width: 50%;
  965. background-color: #FFF3E0;
  966. z-index: 1;
  967. }
  968. .cal-day-box.is-end::after {
  969. content: '';
  970. position: absolute;
  971. left: 0;
  972. top: 8rpx;
  973. bottom: 8rpx;
  974. width: 50%;
  975. background-color: #FFF3E0;
  976. z-index: 1;
  977. }
  978. .cal-day-box.is-start.is-end::after {
  979. display: none;
  980. }
  981. .cal-day-box.is-between {
  982. background-color: #FFF3E0;
  983. margin-top: 8rpx;
  984. height: 64rpx;
  985. margin-bottom: 18rpx;
  986. }
  987. .cal-day-box.is-between .cal-day-text {
  988. color: #FF5722;
  989. }
  990. .calendar-actions {
  991. display: flex;
  992. justify-content: space-between;
  993. padding: 0 30rpx;
  994. margin-top: 20rpx;
  995. }
  996. .cal-btn {
  997. width: 48%;
  998. height: 70rpx;
  999. line-height: 70rpx;
  1000. text-align: center;
  1001. border-radius: 10rpx;
  1002. font-size: 28rpx;
  1003. margin: 0;
  1004. }
  1005. .cal-btn.reset {
  1006. background-color: #f5f5f5;
  1007. color: #666;
  1008. }
  1009. .cal-btn.confirm {
  1010. background-color: #FF5722;
  1011. color: #fff;
  1012. }
  1013. .order-list {
  1014. padding: 0 30rpx;
  1015. width: 100%;
  1016. box-sizing: border-box;
  1017. }
  1018. .order-card {
  1019. background-color: #fff;
  1020. border-radius: 24rpx;
  1021. padding: 20rpx 20rpx;
  1022. margin-bottom: 20rpx;
  1023. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.03);
  1024. }
  1025. .order-card:first-child {
  1026. margin-top: 20rpx;
  1027. }
  1028. .card-header {
  1029. display: flex;
  1030. justify-content: space-between;
  1031. align-items: center;
  1032. margin-bottom: 15rpx;
  1033. }
  1034. .type-badge {
  1035. display: flex;
  1036. align-items: center;
  1037. }
  1038. .type-icon {
  1039. width: 44rpx;
  1040. height: 44rpx;
  1041. margin-right: 15rpx;
  1042. background-color: #FFF3E0;
  1043. border-radius: 50%;
  1044. padding: 6rpx;
  1045. box-sizing: border-box;
  1046. }
  1047. .type-text {
  1048. font-size: 30rpx;
  1049. font-weight: bold;
  1050. color: #333;
  1051. }
  1052. .status-badge {
  1053. font-size: 28rpx;
  1054. }
  1055. .status-badge.highlight {
  1056. color: #FF5722;
  1057. }
  1058. .status-badge.processing {
  1059. color: #2196F3;
  1060. }
  1061. .status-badge.finish {
  1062. color: #4CAF50;
  1063. }
  1064. .status-badge.reject {
  1065. color: #9E9E9E;
  1066. }
  1067. .time-row {
  1068. display: flex;
  1069. justify-content: space-between;
  1070. align-items: center;
  1071. margin-bottom: 25rpx;
  1072. }
  1073. .time-row .time-col {
  1074. display: flex;
  1075. align-items: center;
  1076. font-size: 26rpx;
  1077. color: #333;
  1078. }
  1079. .time-row .label {
  1080. color: #666;
  1081. margin-right: 10rpx;
  1082. }
  1083. .fulfillmentCommission {
  1084. font-size: 36rpx;
  1085. font-weight: bold;
  1086. color: #FF5722;
  1087. }
  1088. .pet-card {
  1089. background-color: #FFF8F0;
  1090. border-radius: 16rpx;
  1091. padding: 15rpx 20rpx;
  1092. display: flex;
  1093. align-items: center;
  1094. margin-bottom: 20rpx;
  1095. }
  1096. .pet-avatar {
  1097. width: 80rpx;
  1098. height: 80rpx;
  1099. border-radius: 50%;
  1100. margin-right: 20rpx;
  1101. }
  1102. .pet-info {
  1103. flex: 1;
  1104. display: flex;
  1105. flex-direction: column;
  1106. }
  1107. .pet-name {
  1108. font-size: 28rpx;
  1109. font-weight: bold;
  1110. color: #333;
  1111. margin-bottom: 5rpx;
  1112. }
  1113. .pet-breed {
  1114. font-size: 24rpx;
  1115. color: #999;
  1116. }
  1117. .pet-profile-btn {
  1118. font-size: 24rpx;
  1119. color: #FF9800;
  1120. border: 1px solid #FF9800;
  1121. padding: 6rpx 20rpx;
  1122. border-radius: 50rpx;
  1123. background-color: #fff;
  1124. }
  1125. .route-info {
  1126. margin-bottom: 25rpx;
  1127. }
  1128. .route-item {
  1129. display: flex;
  1130. align-items: flex-start;
  1131. padding-bottom: 12rpx;
  1132. position: relative;
  1133. width: 100%;
  1134. }
  1135. .route-item:not(:last-child) {
  1136. margin-bottom: 5rpx;
  1137. }
  1138. .route-item:last-child {
  1139. padding-bottom: 0;
  1140. margin-bottom: 0;
  1141. }
  1142. .route-line-vertical {
  1143. position: absolute;
  1144. left: 19rpx;
  1145. top: 46rpx;
  1146. bottom: -15rpx;
  1147. border-left: 2rpx dashed #E0E0E0;
  1148. width: 0;
  1149. z-index: 0;
  1150. }
  1151. .icon-circle {
  1152. width: 40rpx;
  1153. height: 40rpx;
  1154. border-radius: 50%;
  1155. color: #fff;
  1156. font-size: 22rpx;
  1157. display: flex;
  1158. align-items: center;
  1159. justify-content: center;
  1160. margin-right: 20rpx;
  1161. flex-shrink: 0;
  1162. font-weight: bold;
  1163. margin-top: 6rpx;
  1164. position: relative;
  1165. z-index: 1;
  1166. }
  1167. .icon-circle.service {
  1168. background-color: #81C784;
  1169. }
  1170. .icon-circle.start {
  1171. background-color: #FFB74D;
  1172. }
  1173. .icon-circle.end {
  1174. background-color: #81C784;
  1175. }
  1176. .address-box {
  1177. flex: 1;
  1178. display: flex;
  1179. flex-direction: column;
  1180. margin-right: 20rpx;
  1181. }
  1182. .addr-title {
  1183. font-size: 28rpx;
  1184. font-weight: bold;
  1185. color: #333;
  1186. margin-bottom: 4rpx;
  1187. }
  1188. .addr-desc {
  1189. font-size: 24rpx;
  1190. color: #999;
  1191. line-height: 1.4;
  1192. }
  1193. .distance-tag {
  1194. display: flex;
  1195. align-items: center;
  1196. justify-content: flex-end;
  1197. flex-shrink: 0;
  1198. min-width: 80rpx;
  1199. }
  1200. .distance-text {
  1201. font-size: 24rpx;
  1202. color: #FF5722;
  1203. margin-right: 15rpx;
  1204. font-weight: 500;
  1205. }
  1206. .nav-icon-circle {
  1207. width: 48rpx;
  1208. height: 48rpx;
  1209. background-color: #FFF3E0;
  1210. border-radius: 50%;
  1211. display: flex;
  1212. align-items: center;
  1213. justify-content: center;
  1214. }
  1215. .nav-arrow {
  1216. width: 24rpx;
  1217. height: 24rpx;
  1218. }
  1219. .service-content {
  1220. margin-top: -10rpx;
  1221. font-size: 24rpx;
  1222. color: #666;
  1223. padding-left: 60rpx;
  1224. }
  1225. .content-label {
  1226. color: #999;
  1227. margin-right: 10rpx;
  1228. }
  1229. .remark-box {
  1230. background-color: #F8F8F8;
  1231. padding: 15rpx 20rpx;
  1232. border-radius: 8rpx;
  1233. font-size: 26rpx;
  1234. color: #666;
  1235. margin-bottom: 30rpx;
  1236. }
  1237. .action-btns {
  1238. display: flex;
  1239. justify-content: space-between;
  1240. margin-top: 15rpx;
  1241. }
  1242. .action-left {
  1243. display: flex;
  1244. }
  1245. .action-right {
  1246. display: flex;
  1247. }
  1248. .btn {
  1249. height: 60rpx;
  1250. line-height: 60rpx;
  1251. border-radius: 30rpx;
  1252. font-size: 26rpx;
  1253. padding: 0 30rpx;
  1254. margin: 0;
  1255. }
  1256. .action-right .btn:not(:last-child) {
  1257. margin-right: 20rpx;
  1258. }
  1259. .btn::after {
  1260. border: none;
  1261. }
  1262. .btn.normal {
  1263. background-color: #F8F8F8;
  1264. color: #666;
  1265. border: none;
  1266. }
  1267. .btn.primary {
  1268. background: linear-gradient(90deg, #FF9800 0%, #FF5722 100%);
  1269. color: #fff;
  1270. box-shadow: 0 4rpx 12rpx rgba(255, 87, 34, 0.2);
  1271. border: none;
  1272. }
  1273. .btn.normal.danger {
  1274. background-color: #FFF2F0;
  1275. color: #F5222D;
  1276. }
  1277. .pet-modal-mask {
  1278. position: fixed;
  1279. top: 0;
  1280. left: 0;
  1281. right: 0;
  1282. bottom: 0;
  1283. background-color: rgba(0, 0, 0, 0.4);
  1284. z-index: 1000;
  1285. display: flex;
  1286. align-items: center;
  1287. justify-content: center;
  1288. }
  1289. .pet-modal-content {
  1290. width: 680rpx;
  1291. height: 85vh;
  1292. background-color: #fff;
  1293. border-radius: 20rpx;
  1294. display: flex;
  1295. flex-direction: column;
  1296. overflow: hidden;
  1297. }
  1298. .pet-modal-header {
  1299. display: flex;
  1300. align-items: center;
  1301. justify-content: space-between;
  1302. padding: 30rpx;
  1303. border-bottom: 1rpx solid #F0F0F0;
  1304. }
  1305. .pet-modal-title {
  1306. font-size: 34rpx;
  1307. font-weight: bold;
  1308. color: #333;
  1309. }
  1310. .pet-modal-scroll {
  1311. flex: 1;
  1312. height: 0;
  1313. padding: 30rpx;
  1314. box-sizing: border-box;
  1315. }
  1316. .pet-base-info {
  1317. display: flex;
  1318. align-items: center;
  1319. margin-bottom: 40rpx;
  1320. }
  1321. .pm-avatar {
  1322. width: 120rpx;
  1323. height: 120rpx;
  1324. border-radius: 50%;
  1325. margin-right: 30rpx;
  1326. border: 2rpx solid #f5f5f5;
  1327. }
  1328. .pm-info-text {
  1329. flex: 1;
  1330. display: flex;
  1331. flex-direction: column;
  1332. }
  1333. .pm-name-row {
  1334. display: flex;
  1335. align-items: center;
  1336. margin-bottom: 15rpx;
  1337. }
  1338. .pm-name {
  1339. font-size: 36rpx;
  1340. font-weight: bold;
  1341. color: #333;
  1342. margin-right: 20rpx;
  1343. }
  1344. .pm-gender {
  1345. display: flex;
  1346. align-items: center;
  1347. background-color: #E3F2FD;
  1348. padding: 4rpx 12rpx;
  1349. border-radius: 20rpx;
  1350. }
  1351. .pm-gender text {
  1352. font-size: 22rpx;
  1353. color: #1E88E5;
  1354. }
  1355. .pm-gender .gender-icon {
  1356. font-weight: bold;
  1357. margin-right: 4rpx;
  1358. }
  1359. .pm-gender.female {
  1360. background-color: #FCE4EC;
  1361. }
  1362. .pm-gender.female text {
  1363. color: #D81B60;
  1364. }
  1365. .pm-breed {
  1366. font-size: 26rpx;
  1367. color: #999;
  1368. }
  1369. .pm-detail-grid {
  1370. display: flex;
  1371. flex-wrap: wrap;
  1372. justify-content: space-between;
  1373. }
  1374. .pm-grid-item {
  1375. background-color: #F8F8F8;
  1376. border-radius: 16rpx;
  1377. padding: 24rpx;
  1378. margin-bottom: 20rpx;
  1379. display: flex;
  1380. flex-direction: column;
  1381. }
  1382. .pm-grid-item.half {
  1383. width: 48%;
  1384. box-sizing: border-box;
  1385. }
  1386. .pm-grid-item.full {
  1387. width: 100%;
  1388. box-sizing: border-box;
  1389. }
  1390. .pm-label {
  1391. font-size: 24rpx;
  1392. color: #999;
  1393. margin-bottom: 10rpx;
  1394. }
  1395. .pm-val {
  1396. font-size: 28rpx;
  1397. color: #333;
  1398. font-weight: 500;
  1399. }
  1400. .pm-tags {
  1401. display: flex;
  1402. flex-wrap: wrap;
  1403. gap: 20rpx;
  1404. margin-bottom: 40rpx;
  1405. }
  1406. .pm-tag {
  1407. background-color: #FFF8EB;
  1408. border: 2rpx solid #FFCC80;
  1409. color: #FF9800;
  1410. font-size: 22rpx;
  1411. padding: 8rpx 24rpx;
  1412. border-radius: 30rpx;
  1413. }
  1414. .pm-section-title {
  1415. display: flex;
  1416. align-items: center;
  1417. margin-bottom: 30rpx;
  1418. padding-top: 30rpx;
  1419. border-top: 2rpx dashed #F0F0F0;
  1420. }
  1421. .pm-section-title .orange-bar {
  1422. width: 8rpx;
  1423. height: 32rpx;
  1424. background-color: #FF9800;
  1425. margin-right: 16rpx;
  1426. border-radius: 4rpx;
  1427. }
  1428. .pm-section-title text {
  1429. font-size: 30rpx;
  1430. font-weight: bold;
  1431. color: #333;
  1432. }
  1433. .pm-log-list {
  1434. display: flex;
  1435. flex-direction: column;
  1436. }
  1437. .pm-log-item {
  1438. display: flex;
  1439. flex-direction: column;
  1440. padding: 24rpx 0;
  1441. border-bottom: 1rpx solid #F0F0F0;
  1442. }
  1443. .pm-log-item:last-child {
  1444. border-bottom: none;
  1445. }
  1446. .pm-log-date {
  1447. font-size: 24rpx;
  1448. color: #999;
  1449. margin-bottom: 16rpx;
  1450. }
  1451. .pm-log-text {
  1452. font-size: 28rpx;
  1453. color: #333;
  1454. line-height: 1.6;
  1455. margin-bottom: 20rpx;
  1456. }
  1457. .pm-log-recorder {
  1458. font-size: 24rpx;
  1459. color: #FF9800;
  1460. align-self: flex-end;
  1461. }
  1462. .pm-bottom-close {
  1463. width: 100%;
  1464. height: 80rpx;
  1465. line-height: 80rpx;
  1466. background-color: #F5F5F5;
  1467. color: #666;
  1468. border-radius: 40rpx;
  1469. font-size: 30rpx;
  1470. font-weight: bold;
  1471. margin: 0;
  1472. }
  1473. .pm-bottom-close::after {
  1474. border: none;
  1475. }
  1476. .close-icon-btn {
  1477. font-size: 48rpx;
  1478. color: #999;
  1479. line-height: 1;
  1480. padding: 0 10rpx;
  1481. }
  1482. .nav-modal-mask {
  1483. position: fixed;
  1484. top: 0;
  1485. left: 0;
  1486. right: 0;
  1487. bottom: 0;
  1488. background-color: rgba(0, 0, 0, 0.5);
  1489. z-index: 1000;
  1490. display: flex;
  1491. flex-direction: column;
  1492. justify-content: flex-end;
  1493. }
  1494. .nav-action-sheet {
  1495. background-color: #fff;
  1496. width: 100%;
  1497. border-top-left-radius: 24rpx;
  1498. border-top-right-radius: 24rpx;
  1499. overflow: hidden;
  1500. padding-bottom: constant(safe-area-inset-bottom);
  1501. padding-bottom: env(safe-area-inset-bottom);
  1502. }
  1503. .nav-sheet-title {
  1504. text-align: center;
  1505. padding: 30rpx 0;
  1506. font-size: 13px;
  1507. color: #999;
  1508. border-bottom: 1rpx solid #efefef;
  1509. }
  1510. .nav-sheet-item {
  1511. text-align: center;
  1512. padding: 30rpx 0;
  1513. font-size: 13px;
  1514. color: #333;
  1515. background-color: #fff;
  1516. border-bottom: 1rpx solid #efefef;
  1517. }
  1518. .nav-sheet-item.cancel {
  1519. border-bottom: none;
  1520. color: #666;
  1521. }
  1522. .nav-sheet-gap {
  1523. height: 16rpx;
  1524. background-color: #F8F8F8;
  1525. }
  1526. .order-list {
  1527. flex: 1;
  1528. overflow-y: auto;
  1529. width: 100%;
  1530. padding: 0 30rpx;
  1531. box-sizing: border-box;
  1532. }
  1533. .loading-text {
  1534. text-align: center;
  1535. font-size: 24rpx;
  1536. color: #999;
  1537. padding: 30rpx 0;
  1538. }
  1539. .pm-header-actions {
  1540. display: flex;
  1541. align-items: center;
  1542. gap: 16rpx;
  1543. }
  1544. .pm-remark-btn {
  1545. font-size: 24rpx;
  1546. color: #fff;
  1547. background-color: #FF9800;
  1548. padding: 6rpx 18rpx;
  1549. border-radius: 20rpx;
  1550. }
  1551. .remark-mask {
  1552. position: fixed;
  1553. top: 0;
  1554. left: 0;
  1555. right: 0;
  1556. bottom: 0;
  1557. background-color: rgba(0, 0, 0, 0.5);
  1558. z-index: 3000;
  1559. display: flex;
  1560. align-items: center;
  1561. justify-content: center;
  1562. }
  1563. .remark-sheet {
  1564. width: 600rpx;
  1565. background-color: #fff;
  1566. border-radius: 24rpx;
  1567. padding: 40rpx;
  1568. box-sizing: border-box;
  1569. display: flex;
  1570. flex-direction: column;
  1571. align-items: center;
  1572. }
  1573. .remark-sheet-header {
  1574. width: 100%;
  1575. text-align: center;
  1576. margin-bottom: 30rpx;
  1577. position: relative;
  1578. }
  1579. .remark-sheet-header .close-icon-btn {
  1580. position: absolute;
  1581. right: 0;
  1582. top: 50%;
  1583. transform: translateY(-50%);
  1584. }
  1585. .remark-sheet-title {
  1586. font-size: 32rpx;
  1587. font-weight: bold;
  1588. color: #333;
  1589. }
  1590. .remark-textarea {
  1591. width: 100%;
  1592. height: 160rpx;
  1593. border: 1rpx solid #eee;
  1594. border-radius: 12rpx;
  1595. padding: 20rpx;
  1596. font-size: 28rpx;
  1597. color: #333;
  1598. box-sizing: border-box;
  1599. margin-bottom: 40rpx;
  1600. }
  1601. .remark-submit-btn {
  1602. width: 100%;
  1603. background-color: #FF5722;
  1604. color: #fff;
  1605. font-size: 32rpx;
  1606. font-weight: bold;
  1607. text-align: center;
  1608. padding: 24rpx 0;
  1609. border-radius: 16rpx;
  1610. }
  1611. .action-left {
  1612. position: relative;
  1613. z-index: 10;
  1614. }
  1615. .action-left .btn.normal {
  1616. font-size: 26rpx;
  1617. }
  1618. .call-popover {
  1619. position: absolute;
  1620. top: calc(100% + 10rpx);
  1621. left: 0;
  1622. background-color: #fff;
  1623. border-radius: 12rpx;
  1624. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
  1625. z-index: 999;
  1626. display: flex;
  1627. flex-direction: column;
  1628. width: 200rpx;
  1629. }
  1630. .call-pop-item {
  1631. font-size: 26rpx;
  1632. color: #333;
  1633. text-align: center;
  1634. padding: 24rpx 0;
  1635. border-bottom: 1rpx solid #eee;
  1636. }
  1637. .call-pop-item:last-child {
  1638. border-bottom: none;
  1639. }
  1640. .call-mask {
  1641. position: fixed;
  1642. top: 0;
  1643. left: 0;
  1644. right: 0;
  1645. bottom: 0;
  1646. z-index: 900;
  1647. background: transparent;
  1648. }
  1649. </style>