index.vue 55 KB

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