index.vue 53 KB

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