DispatchOrderDialog.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. <template>
  2. <el-dialog
  3. :visible.sync="dialogVisible"
  4. width="1100px"
  5. custom-class="dispatch-order-dialog"
  6. :close-on-click-modal="false"
  7. :show-close="false"
  8. append-to-body
  9. destroy-on-close
  10. @opened="onDialogOpened"
  11. @closed="onDialogClosed"
  12. >
  13. <div class="dispatch-order-panel">
  14. <div class="panel-header">
  15. <span class="panel-title">订单分配</span>
  16. <span v-if="currentOrder" class="panel-subtitle">
  17. 订单号:{{ currentOrder.orderNo }}
  18. <template v-if="currentOrder.cAddress"> · {{ currentOrder.cAddress }}</template>
  19. </span>
  20. <i class="el-icon-close panel-close" @click="handleClose" />
  21. </div>
  22. <div class="filter-bar">
  23. <el-select v-model="filterForm.region" placeholder="地区" clearable class="filter-item">
  24. <el-option
  25. v-for="item in regionOptions"
  26. :key="item.value"
  27. :label="item.cityName"
  28. :value="item.cityCode"
  29. />
  30. </el-select>
  31. <el-select placeholder="服务类目" v-model="filterForm.category" clearable class="filter-item">
  32. <el-option v-for="item in serveTypes" :label="item.name" :value="item.id"></el-option>
  33. </el-select>
  34. <!-- <el-select v-model="filterForm.category" placeholder="服务类目" clearable class="filter-item">
  35. <el-option label="按摩" value="按摩" />
  36. <el-option label="陪玩" value="陪玩" />
  37. </el-select> -->
  38. <el-input
  39. v-model="filterForm.keyword"
  40. placeholder="搜索技师名称或姓名"
  41. prefix-icon="el-icon-search"
  42. clearable
  43. class="filter-search"
  44. @keyup.enter.native="handleSearch"
  45. />
  46. <div class="filter-actions">
  47. <el-button type="primary" @click="handleSearch">搜索</el-button>
  48. <el-button @click="handleClear">清空</el-button>
  49. </div>
  50. </div>
  51. <div class="panel-body">
  52. <div class="technician-list">
  53. <div
  54. v-for="item in technicians"
  55. :key="item.id"
  56. class="technician-card"
  57. :class="{ 'is-active': selectedId === item.id }"
  58. @click="selectTechnician(item)"
  59. >
  60. <span class="technician-radio" :class="{ 'is-checked': selectedId === item.merchantId }">
  61. <span class="technician-radio__inner" />
  62. </span>
  63. <img :src="item.merchantAvatar" class="technician-avatar" alt="" />
  64. <div class="technician-info">
  65. <div class="technician-name-row">
  66. <span class="technician-name">{{ item.merchantNickName }}</span>
  67. <span class="status-tag" :class="`status-tag--${item.status}`">{{ statusLabel(item.postStateName) }}</span>
  68. <span v-if="item.distance != null" class="technician-distance">距用户 {{ formatDistance(item.distanceShow) }}</span>
  69. </div>
  70. <div class="technician-address">{{ item.merchantAddress }}</div>
  71. </div>
  72. </div>
  73. <div v-if="!technicians.length" class="empty-tip">暂无符合条件的技师</div>
  74. </div>
  75. <div class="map-wrap">
  76. <div :id="mapId" class="map-container" />
  77. </div>
  78. </div>
  79. <div class="panel-footer">
  80. <el-button @click="handleClose">取消</el-button>
  81. <el-button type="primary" @click="handleConfirm">确认派单</el-button>
  82. </div>
  83. </div>
  84. </el-dialog>
  85. </template>
  86. <script>
  87. import AMapLoader from '@amap/amap-jsapi-loader'
  88. import { calcDistance, formatDistance } from '@/utils/geo'
  89. import userDestIcon from '@/assets/images/map/user.png'
  90. import { getDispatchMerchantList,getCityList,serviceCategory,dispatchOrder} from '@/api/order/serviceOrder'
  91. const AMAP_KEY = '41bc0f647d4432045d472f554bf03d75'
  92. const AMAP_SECURITY = '80ba66cc0bba5b07de6a275d7aa02a39'
  93. const STATUS_MAP = {
  94. online: '在线',
  95. onway: '在路途中',
  96. rest: '休息中'
  97. }
  98. const DEFAULT_FILTER = {
  99. region: 'city',
  100. category: '',
  101. keyword: ''
  102. }
  103. let mapInstanceSeed = 0
  104. /** 示例技师数据 */
  105. const MOCK_TECHNICIANS = [
  106. { id: 1, nickname: 'NaNny', name: '娜娜', category: '按摩', region: 'city', status: 'rest', lng: 116.397428, lat: 39.90923, address: '北京市东城区王府井大街88号附近', avatar: require('@/assets/images/map/user.png') },
  107. { id: 2, nickname: '小艾', name: '艾琳', category: '按摩', region: 'city', status: 'onway', lng: 116.451328, lat: 39.908765, address: '北京市朝阳区建国门外大街1号附近', avatar: require('@/assets/images/map/user.png') },
  108. { id: 3, nickname: '阿杰', name: '杰哥', category: '陪玩', region: 'city', status: 'online', lng: 116.280892, lat: 39.921234, address: '北京市海淀区中关村大街27号附近', avatar: require('@/assets/images/map/user.png') },
  109. { id: 4, nickname: '小雨', name: '雨晴', category: '陪玩', region: 'city', status: 'online', lng: 116.385621, lat: 39.954812, address: '北京市西城区西单北大街120号附近', avatar: require('@/assets/images/map/user.png') },
  110. { id: 5, nickname: '大明', name: '明明', category: '按摩', region: 'city', status: 'rest', lng: 116.420981, lat: 39.893456, address: '北京市丰台区南三环西路16号附近', avatar: require('@/assets/images/map/user.png') },
  111. { id: 6, nickname: '小美', name: '美美', category: '按摩', region: 'city', status: 'online', lng: 116.362481, lat: 39.915612, address: '北京市东城区东直门内大街8号附近', avatar: require('@/assets/images/map/user.png') },
  112. { id: 7, nickname: '阿强', name: '强子', category: '陪玩', region: 'city', status: 'onway', lng: 116.432156, lat: 39.928341, address: '北京市朝阳区三里屯路19号附近', avatar: require('@/assets/images/map/user.png') },
  113. { id: 8, nickname: '莉莉', name: '丽丽', category: '按摩', region: 'city', status: 'rest', lng: 116.318765, lat: 39.876543, address: '北京市丰台区方庄路15号附近', avatar: require('@/assets/images/map/user.png') },
  114. { id: 9, nickname: '小军', name: '军哥', category: '陪玩', region: 'city', status: 'online', lng: 116.468912, lat: 39.941234, address: '北京市朝阳区望京街10号附近', avatar: require('@/assets/images/map/user.png') },
  115. { id: 10, nickname: '小芳', name: '芳芳', category: '按摩', region: 'city', status: 'onway', lng: 116.351234, lat: 39.902345, address: '北京市西城区金融大街35号附近', avatar: require('@/assets/images/map/user.png') }
  116. ]
  117. export default {
  118. name: 'DispatchOrderDialog',
  119. data() {
  120. return {
  121. dialogVisible: false,
  122. mapId: `dispatch-order-map-${++mapInstanceSeed}`,
  123. currentOrder: null,
  124. orderDest: null,
  125. filterForm: { ...DEFAULT_FILTER },
  126. searchParams: { ...DEFAULT_FILTER },
  127. regionOptions: [{ label: '城市运营中心', value: 'city' }],
  128. technicians:[],// MOCK_TECHNICIANS,
  129. selectedId: null,
  130. orderStatus: 'pending',
  131. AMap: null,
  132. map: null,
  133. markerInstances: [],
  134. destMarker: null,
  135. serveTypes: []
  136. }
  137. },
  138. computed: {
  139. sortedTechnicians() {
  140. const { region, category, keyword } = this.searchParams
  141. const kw = keyword.trim().toLowerCase()
  142. let list = this.technicians.filter((item) => {
  143. if (region && item.region !== region) return false
  144. if (category && item.category !== category) return false
  145. if (kw && !item.nickname.toLowerCase().includes(kw) && !item.name.toLowerCase().includes(kw)) {
  146. return false
  147. }
  148. return true
  149. })
  150. if (this.orderDest) {
  151. const { lng, lat } = this.orderDest
  152. list = list
  153. .map((item) => ({
  154. ...item,
  155. distance: calcDistance(lng, lat, item.lng, item.lat)
  156. }))
  157. .sort((a, b) => a.distance - b.distance)
  158. }
  159. return list
  160. },
  161. mapMarkers() {
  162. return this.sortedTechnicians.map((item) => ({
  163. ...item,
  164. active: item.id === this.selectedId
  165. }))
  166. }
  167. },
  168. watch: {
  169. mapMarkers: {
  170. deep: true,
  171. handler() {
  172. this.renderMarkers()
  173. }
  174. }
  175. },
  176. beforeDestroy() {
  177. this.destroyMap()
  178. },
  179. methods: {
  180. formatDistance,
  181. /**
  182. * 打开派单弹窗
  183. * @param {Object} order - 订单信息,需含 arrivalLongitude / arrivalLatitude(用户目的地经纬度)
  184. */
  185. open(order) {
  186. this.serviceCategoryFun()
  187. this.getCityListFun()
  188. console.log(order,'order9999')
  189. console.log(order.region,'order9999')
  190. if (!order) return
  191. const lng = Number(order.merchantLongitude)
  192. const lat = Number(order.merchantLatitude)
  193. if (!Number.isFinite(lng) || !Number.isFinite(lat)) {
  194. this.$message.warning('该订单缺少用户目的地经纬度,无法分配')
  195. return
  196. }
  197. this.currentOrder = order
  198. this.orderDest = { lng, lat }
  199. this.orderStatus = order.dispatchStatus || 'pending'
  200. this.filterForm = {
  201. orderId: order.id,
  202. region: order.region,
  203. category: order.categoryId,
  204. keyword: ''
  205. }
  206. console.log(this.filterForm,'this.filterForm')
  207. this.getDispatchMerchantListFun()
  208. this.searchParams = { ...this.filterForm }
  209. this.selectedId = null
  210. this.dialogVisible = true
  211. },
  212. getDispatchMerchantListFun() {
  213. getDispatchMerchantList(this.filterForm.orderId,{
  214. region: this.filterForm.region,
  215. category: this.filterForm.category,
  216. keyword: this.filterForm.keyword
  217. }).then(res => {
  218. this.technicians = res.data || []
  219. })
  220. },
  221. //获取服务类型
  222. serviceCategoryFun() {
  223. serviceCategory().then(res => {
  224. if (res.code === 200) {
  225. this.serveTypes = res.data
  226. }
  227. })
  228. },
  229. getCityListFun() {
  230. getCityList().then(res => {
  231. this.regionOptions = res.data || []
  232. })
  233. },
  234. onDialogOpened() {
  235. this.$nextTick(() => {
  236. this.initMap()
  237. })
  238. },
  239. onDialogClosed() {
  240. this.destroyMap()
  241. this.currentOrder = null
  242. this.orderDest = null
  243. this.selectedId = null
  244. this.filterForm = { ...DEFAULT_FILTER }
  245. this.searchParams = { ...DEFAULT_FILTER }
  246. },
  247. handleSearch() {
  248. this.getDispatchMerchantListFun()
  249. return
  250. this.searchParams = { ...this.filterForm }
  251. if (this.selectedId && !this.sortedTechnicians.some((item) => item.id === this.selectedId)) {
  252. this.selectedId = null
  253. }
  254. this.$nextTick(() => {
  255. this.fitMarkerView()
  256. })
  257. },
  258. handleClear() {
  259. this.filterForm = { region: '', category: '', keyword: '' }
  260. this.searchParams = { region: '', category: '', keyword: '' }
  261. this.selectedId = null
  262. this.$nextTick(() => {
  263. this.fitMarkerView()
  264. })
  265. },
  266. statusLabel(status) {
  267. return STATUS_MAP[status] || status
  268. },
  269. initMap() {
  270. if (this.map) return
  271. window._AMapSecurityConfig = { securityJsCode: AMAP_SECURITY }
  272. const center = this.orderDest
  273. ? [this.orderDest.lng, this.orderDest.lat]
  274. : [116.397428, 39.90923]
  275. AMapLoader.load({
  276. key: AMAP_KEY,
  277. version: '2.0'
  278. }).then((AMap) => {
  279. this.AMap = AMap
  280. this.map = new AMap.Map(this.mapId, {
  281. resizeEnable: true,
  282. zoom: 13,
  283. center,
  284. viewMode: '2D'
  285. })
  286. this.renderDestinationMarker()
  287. this.renderMarkers()
  288. this.fitMarkerView()
  289. this.$nextTick(() => {
  290. if (this.map) this.map.resize()
  291. })
  292. }).catch((err) => {
  293. console.error('地图加载失败', err)
  294. this.$message.error('地图加载失败,请检查网络或 Key 配置')
  295. })
  296. },
  297. createDestinationMarkerContent() {
  298. const wrap = document.createElement('div')
  299. wrap.className = 'dispatch-map-dest'
  300. wrap.innerHTML = `
  301. <div class="dispatch-map-dest__label">用户目的地</div>
  302. <img class="dispatch-map-dest__icon" src="${userDestIcon}" alt="用户目的地" />
  303. `
  304. return wrap
  305. },
  306. renderDestinationMarker() {
  307. if (!this.map || !this.AMap || !this.orderDest) return
  308. if (this.destMarker) {
  309. this.map.remove(this.destMarker)
  310. this.destMarker = null
  311. }
  312. this.destMarker = new this.AMap.Marker({
  313. position: [this.orderDest.lng, this.orderDest.lat],
  314. content: this.createDestinationMarkerContent(),
  315. offset: new this.AMap.Pixel(0, 0),
  316. anchor: 'bottom-center',
  317. zIndex: 300
  318. })
  319. this.map.add(this.destMarker)
  320. },
  321. createMarkerContent(item) {
  322. const wrap = document.createElement('div')
  323. wrap.className = item.active
  324. ? 'dispatch-map-marker dispatch-map-marker--active'
  325. : 'dispatch-map-marker'
  326. wrap.innerHTML = `
  327. <div class="dispatch-map-marker__label">${item.nickname}</div>
  328. <div class="dispatch-map-marker__avatar-wrap">
  329. <img class="dispatch-map-marker__avatar" src="${item.avatar}" alt="${item.nickname}" />
  330. </div>
  331. <div class="dispatch-map-marker__pointer"></div>
  332. `
  333. return wrap
  334. },
  335. renderMarkers() {
  336. if (!this.map || !this.AMap) return
  337. this.clearMarkers()
  338. this.mapMarkers.forEach((item) => {
  339. const marker = new this.AMap.Marker({
  340. position: [item.lng, item.lat],
  341. content: this.createMarkerContent(item),
  342. offset: new this.AMap.Pixel(0, 0),
  343. anchor: 'bottom-center',
  344. zIndex: item.active ? 200 : 100
  345. })
  346. marker.on('click', () => {
  347. this.selectTechnician(item)
  348. })
  349. this.map.add(marker)
  350. this.markerInstances.push(marker)
  351. })
  352. },
  353. clearMarkers() {
  354. if (this.markerInstances.length && this.map) {
  355. this.map.remove(this.markerInstances)
  356. }
  357. this.markerInstances = []
  358. },
  359. fitMarkerView() {
  360. if (!this.map) return
  361. const allMarkers = [...this.markerInstances]
  362. if (this.destMarker) allMarkers.push(this.destMarker)
  363. if (!allMarkers.length) return
  364. this.map.setFitView(allMarkers, false, [60, 60, 60, 60])
  365. },
  366. selectTechnician(item) {
  367. if (this.selectedId === item.merchantId) {
  368. this.selectedId = null
  369. return
  370. }
  371. this.selectedId = item.merchantId
  372. if (this.map) {
  373. this.map.setZoomAndCenter(15, [item.merchantLongitude, item.merchantLatitude])
  374. }
  375. },
  376. handleClose() {
  377. this.dialogVisible = false
  378. },
  379. handleConfirm() {
  380. if (!this.selectedId) {
  381. this.$message.warning('请先选择技师')
  382. return
  383. }
  384. if (this.orderStatus !== 'pending') {
  385. this.$message.warning('订单状态已变更,无法派单')
  386. return
  387. }
  388. //const tech = this.technicians.find((t) => t.id === this.selectedId)
  389. dispatchOrder(this.filterForm.orderId, {
  390. merchantId: this.selectedId
  391. }).then(res => {
  392. console.log(res)
  393. if (res.code === 200) {
  394. this.$message.success(res.msg)
  395. this.$emit('success',this.filterForm.orderId)
  396. this.dialogVisible = false
  397. }
  398. }).catch(err => {
  399. this.$message.error(`订单 ${this.currentOrder.orderNo} 已成功派单给 ${tech.nickname}`)
  400. })
  401. // this.$emit('success', {
  402. // order: this.currentOrder,
  403. // technician: tech
  404. // })
  405. },
  406. destroyMap() {
  407. this.clearMarkers()
  408. if (this.destMarker && this.map) {
  409. this.map.remove(this.destMarker)
  410. this.destMarker = null
  411. }
  412. if (this.map) {
  413. this.map.destroy()
  414. this.map = null
  415. }
  416. this.AMap = null
  417. }
  418. }
  419. }
  420. </script>
  421. <style lang="scss" scoped>
  422. .dispatch-order-panel {
  423. display: flex;
  424. flex-direction: column;
  425. height: 560px;
  426. overflow: hidden;
  427. }
  428. .panel-header {
  429. display: flex;
  430. align-items: center;
  431. padding: 16px 20px;
  432. border-bottom: 1px solid #ebeef5;
  433. gap: 12px;
  434. .panel-title {
  435. font-size: 16px;
  436. font-weight: 600;
  437. color: #303133;
  438. flex-shrink: 0;
  439. }
  440. .panel-subtitle {
  441. flex: 1;
  442. font-size: 12px;
  443. color: #909399;
  444. overflow: hidden;
  445. text-overflow: ellipsis;
  446. white-space: nowrap;
  447. }
  448. .panel-close {
  449. font-size: 18px;
  450. color: #909399;
  451. cursor: pointer;
  452. flex-shrink: 0;
  453. &:hover {
  454. color: #606266;
  455. }
  456. }
  457. }
  458. .filter-bar {
  459. display: flex;
  460. align-items: center;
  461. gap: 12px;
  462. padding: 16px 20px;
  463. border-bottom: 1px solid #ebeef5;
  464. .filter-item {
  465. width: 160px;
  466. flex-shrink: 0;
  467. }
  468. .filter-search {
  469. flex: 1;
  470. min-width: 120px;
  471. }
  472. .filter-actions {
  473. display: flex;
  474. flex-shrink: 0;
  475. gap: 8px;
  476. }
  477. }
  478. .panel-body {
  479. display: flex;
  480. flex: 1;
  481. min-height: 0;
  482. overflow: hidden;
  483. }
  484. .technician-list {
  485. width: 360px;
  486. flex-shrink: 0;
  487. align-self: stretch;
  488. min-height: 0;
  489. overflow-x: hidden;
  490. overflow-y: auto;
  491. -webkit-overflow-scrolling: touch;
  492. border-right: 1px solid #ebeef5;
  493. background: #fafafa;
  494. }
  495. .technician-card {
  496. display: flex;
  497. align-items: flex-start;
  498. padding: 14px 16px;
  499. cursor: pointer;
  500. border-bottom: 1px solid #f0f0f0;
  501. transition: background 0.2s;
  502. &:hover,
  503. &.is-active {
  504. background: #ecf5ff;
  505. }
  506. .technician-radio {
  507. display: inline-flex;
  508. align-items: center;
  509. justify-content: center;
  510. width: 14px;
  511. height: 14px;
  512. margin-right: 8px;
  513. margin-top: 14px;
  514. flex-shrink: 0;
  515. border: 1px solid #dcdfe6;
  516. border-radius: 50%;
  517. background: #fff;
  518. &__inner {
  519. width: 4px;
  520. height: 4px;
  521. border-radius: 50%;
  522. background: #fff;
  523. transform: scale(0);
  524. transition: transform 0.15s ease-in;
  525. }
  526. &.is-checked {
  527. border-color: #409eff;
  528. background: #409eff;
  529. .technician-radio__inner {
  530. transform: scale(1);
  531. }
  532. }
  533. }
  534. .technician-avatar {
  535. width: 44px;
  536. height: 44px;
  537. border-radius: 50%;
  538. object-fit: cover;
  539. flex-shrink: 0;
  540. margin-right: 10px;
  541. background: #eee;
  542. }
  543. .technician-info {
  544. flex: 1;
  545. min-width: 0;
  546. }
  547. .technician-name-row {
  548. display: flex;
  549. align-items: center;
  550. flex-wrap: wrap;
  551. gap: 6px;
  552. margin-bottom: 6px;
  553. }
  554. .technician-name {
  555. font-size: 14px;
  556. font-weight: 500;
  557. color: #303133;
  558. }
  559. .technician-distance {
  560. margin-left: auto;
  561. font-size: 12px;
  562. color: #409eff;
  563. white-space: nowrap;
  564. }
  565. .status-tag {
  566. display: inline-block;
  567. padding: 0 6px;
  568. font-size: 12px;
  569. line-height: 20px;
  570. border-radius: 2px;
  571. &--online {
  572. color: #67c23a;
  573. background: #f0f9eb;
  574. }
  575. &--onway {
  576. color: #e6a23c;
  577. background: #fdf6ec;
  578. }
  579. &--rest {
  580. color: #909399;
  581. background: #f4f4f5;
  582. }
  583. }
  584. .technician-address {
  585. font-size: 12px;
  586. color: #909399;
  587. line-height: 1.5;
  588. word-break: break-all;
  589. }
  590. }
  591. .empty-tip {
  592. padding: 40px 16px;
  593. text-align: center;
  594. color: #909399;
  595. font-size: 14px;
  596. }
  597. .map-wrap {
  598. flex: 1;
  599. min-width: 0;
  600. min-height: 0;
  601. background: #eef1f5;
  602. }
  603. .map-container {
  604. width: 100%;
  605. height: 100%;
  606. }
  607. .panel-footer {
  608. display: flex;
  609. justify-content: flex-end;
  610. gap: 12px;
  611. padding: 14px 20px;
  612. border-top: 1px solid #ebeef5;
  613. }
  614. </style>
  615. <style lang="scss">
  616. .dispatch-order-dialog {
  617. .el-dialog__header {
  618. display: none;
  619. }
  620. .el-dialog__body {
  621. padding: 0;
  622. }
  623. }
  624. .dispatch-map-dest {
  625. display: flex;
  626. flex-direction: column;
  627. align-items: center;
  628. &__label {
  629. margin-bottom: 4px;
  630. padding: 2px 8px;
  631. background: #f56c6c;
  632. color: #fff;
  633. font-size: 12px;
  634. border-radius: 3px;
  635. white-space: nowrap;
  636. }
  637. &__icon {
  638. display: block;
  639. height: 40px;
  640. width: auto;
  641. filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  642. }
  643. }
  644. .dispatch-map-marker {
  645. display: flex;
  646. flex-direction: column;
  647. align-items: center;
  648. cursor: pointer;
  649. &__label {
  650. margin-bottom: 4px;
  651. padding: 2px 8px;
  652. background: rgba(0, 0, 0, 0.65);
  653. color: #fff;
  654. font-size: 12px;
  655. border-radius: 3px;
  656. white-space: nowrap;
  657. }
  658. &__avatar-wrap {
  659. width: 40px;
  660. height: 40px;
  661. border-radius: 50%;
  662. border: 2px solid #fff;
  663. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  664. overflow: hidden;
  665. background: #eee;
  666. }
  667. &__avatar {
  668. display: block;
  669. width: 100%;
  670. height: 100%;
  671. object-fit: cover;
  672. }
  673. &__pointer {
  674. width: 0;
  675. height: 0;
  676. margin-top: -1px;
  677. border-left: 6px solid transparent;
  678. border-right: 6px solid transparent;
  679. border-top: 8px solid #fff;
  680. filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.15));
  681. }
  682. &--active {
  683. .dispatch-map-marker__label {
  684. background: #409eff;
  685. }
  686. .dispatch-map-marker__avatar-wrap {
  687. width: 48px;
  688. height: 48px;
  689. border-color: #409eff;
  690. border-width: 3px;
  691. box-shadow: 0 2px 12px rgba(64, 158, 255, 0.5);
  692. }
  693. .dispatch-map-marker__pointer {
  694. border-top-color: #409eff;
  695. }
  696. }
  697. }
  698. </style>