index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. <template>
  2. <view>
  3. <car-common ref="common" ></car-common>
  4. <u-popup v-model="show1" mode="center" border-radius="20">
  5. <view class="sitePopup">
  6. <view class="sitePopup-head">
  7. <h4>{{title}}</h4>
  8. <p v-if="stationList.length">开往:{{stationList[stationList.length-1].name}} </p>
  9. <p v-if="stationList.length">上车站点:{{downItem.name}}</p>
  10. </view>
  11. <view class="sitePopup-main">
  12. <view class="remind-item-bg remind-item-bg1 ":class="popid==0?'active':''" @click="selectBtn(0)" >
  13. <view class="remind-item remind-item1">
  14. <u-icon name="icon_tixing-01" custom-prefix="custom-icon" size="72" color="#fff"></u-icon>
  15. <span>无提醒</span>
  16. </view>
  17. </view>
  18. <view class="remind-item-bg remind-item-bg2 " :class="popid==1?'active':''" @click="selectBtn(1)">
  19. <view class="remind-item remind-item2">
  20. <u-icon name="icon_tixing-02" custom-prefix="custom-icon" size="72" color="#fff"></u-icon>
  21. <span>距离1站</span>
  22. </view>
  23. </view>
  24. <view class="remind-item-bg remind-item-bg3" :class="popid==2?'active':''" @click="selectBtn(2)">
  25. <view class="remind-item remind-item3">
  26. <u-icon name="icon_tixing-03" custom-prefix="custom-icon" size="72" color="#fff"></u-icon>
  27. <span>距离2站</span>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="sitePopup-foot">
  32. <view class="sitePopup-btn" @click="show1 = false">取消</view>
  33. <view class="sitePopup-btn" @click="radioGroupChange">确定</view>
  34. </view>
  35. </view>
  36. </u-popup>
  37. <u-popup v-model="caritemBl2" v-if="stationList.length" mode="center" closeable="true" border-radius="20">
  38. <view class="sitePopup">
  39. <view class="sitePopup-head">
  40. <h1>{{stationList[0].name}} → {{stationList[stationList.length-1].name}}</h1>
  41. <p>首班:{{routeInfo.startTime}} 末班:{{routeInfo.endTime}}</p>
  42. </view>
  43. <view class="sitePopup-main" v-if="false">
  44. <view class="sitePopup-driver">
  45. <view class="driver-info">
  46. <view class="driver-head">
  47. <u-avatar :src="caritem.driverInfo.faceImage" size="100"></u-avatar>
  48. </view>
  49. <view class="driver-text">
  50. <h2>{{caritem.licensePlateNumber}}</h2>
  51. <p>{{showname(caritem.driverInfo.name)}} {{caritem.driverInfo.phone}}</p>
  52. </view>
  53. </view>
  54. <u-icon name="dianhua" v-if="caritem.driverInfo.phone" @click="makePhoneCall(caritem.driverInfo.phone)" custom-prefix="custom-icon" size="80" color="#1778fb"></u-icon>
  55. </view>
  56. </view>
  57. </view>
  58. </u-popup>
  59. <u-navbar :title="title" :is-back="false" >
  60. <view class="slot-wrap"></view>
  61. <view class="navbar-right" @click="mapopenBtn" >
  62. <u-icon name="plus-circle" v-if="!mapopen" color="#999" size="28"></u-icon>
  63. <span v-if="!mapopen">放大地图</span>
  64. <u-icon name="minus-circle" v-if="mapopen" color="#999" size="28"></u-icon>
  65. <span v-if="mapopen">缩小地图</span>
  66. </view>
  67. </u-navbar>
  68. <carmap ref="amap" @onload="mapdown" @clickMap="carShow2" @clickHandler="clickHandler" ></carmap>
  69. <view class="map-info">
  70. <view class="map-text" v-if="stationList.length">
  71. <h4>{{stationList[0].name}} → {{stationList[stationList.length-1].name}}</h4>
  72. <p>首班:{{routeInfo.startTime}} 末班:{{routeInfo.endTime}}</p>
  73. </view>
  74. <view class="map-btn" @click="reverse">
  75. <u-icon name="swap" custom-prefix="custom-icon" color="#2979ff"></u-icon>
  76. <span>换向</span>
  77. </view>
  78. </view>
  79. <view class="map-route">
  80. <view class="map-route-head" v-if="false" >
  81. <view >上车提醒</view>
  82. <view >
  83. <u-radio-group v-model="downItem.isRemind" @change="radioGroupChange" >
  84. <u-radio
  85. v-for="(dio, index) in radiolist" :key="index"
  86. :name="dio.isRemind"
  87. >
  88. {{dio.name}}
  89. </u-radio>
  90. </u-radio-group>
  91. </view>
  92. </view>
  93. <view class="map-route-head" >
  94. <view>{{dis}}</view>
  95. &lt;&lt;&lt; 下方列表可以左右滑动 &gt;&gt;&gt;
  96. </view>
  97. <view class="map-route-main" id="map-route-main">
  98. <template v-for="item,i in stationList">
  99. <view class="scroll-view-item"
  100. :class="{'map-route-origin map-geton ':i==0,'map-route-item':i!=0,'map-geton':downid==item.id,'map-down':downid==item.id,'map-now':item.currentStationStatus=='2'}"
  101. >
  102. <view class="map-route-car" v-if="showCar(item)">
  103. <img src="static/img/car.png" alt="" @click="carShow(item)">
  104. </view>
  105. <view class="map-route-circle" @click="downBtn(item)" :style="i==0&&downid!=item.id?'border: 3px solid #1e8abd;':''">
  106. <img src="static/img/plate4.png?v=1" style=" width: 12px; margin-top: 3px;" v-if="downid==item.id" alt="">
  107. </view>
  108. <view class="map-route-line" @click="downBtn(item)"></view>
  109. <view class="map-route-name" @click="downBtn(item)">
  110. {{item.name}}
  111. </view>
  112. </view>
  113. </template>
  114. </view>
  115. <view class="map-route-main" v-if="false" >
  116. <!-- <view class="map-route-origin">
  117. <view class="map-route-circle"></view>
  118. <view class="map-route-name">
  119. 1锣场
  120. </view>
  121. </view> -->
  122. <view class="map-route-origin map-geton">
  123. <view class="map-route-car">
  124. <img src="static/img/car.png" alt="">
  125. </view>
  126. <view class="map-route-circle">上</view>
  127. <view class="map-route-name">
  128. 1锣场
  129. </view>
  130. </view>
  131. <view class="map-route-item map-after">
  132. <view class="map-route-circle"></view>
  133. <view class="map-route-line"></view>
  134. <view class="map-route-name">
  135. 2东方大道
  136. </view>
  137. </view>
  138. <view class="map-route-item map-now">
  139. <view class="map-route-car">
  140. <img src="static/img/car.png" alt="">
  141. </view>
  142. <view class="map-route-circle"></view>
  143. <view class="map-route-line"></view>
  144. <view class="map-route-name">
  145. 3小天鹅
  146. </view>
  147. </view>
  148. <view class="map-route-item map-color">
  149. <view class="map-route-circle"></view>
  150. <view class="map-route-line"></view>
  151. <view class="map-route-name">
  152. 4宿架转盘转盘
  153. </view>
  154. </view>
  155. <view class="map-route-item">
  156. <view class="map-route-car">
  157. <img src="static/img/car.png" alt="">
  158. </view>
  159. <view class="map-route-circle"></view>
  160. <view class="map-route-line"></view>
  161. <view class="map-route-name">
  162. 5荆棉
  163. </view>
  164. </view>
  165. <view class="map-route-item map-geton">
  166. <view class="map-route-car">
  167. <img src="static/img/car.png" alt="">
  168. </view>
  169. <view class="map-route-circle">下</view>
  170. <view class="map-route-line"></view>
  171. <view class="map-route-name">
  172. 6跃进村
  173. </view>
  174. </view>
  175. <view class="map-route-item">
  176. <view class="map-route-circle"></view>
  177. <view class="map-route-line"></view>
  178. <view class="map-route-name">
  179. 7变电站
  180. </view>
  181. </view>
  182. <view class="map-route-item">
  183. <view class="map-route-circle"></view>
  184. <view class="map-route-line"></view>
  185. <view class="map-route-name">
  186. 8跃进村
  187. </view>
  188. </view>
  189. <view class="map-route-item">
  190. <view class="map-route-circle"></view>
  191. <view class="map-route-line"></view>
  192. <view class="map-route-name">
  193. 9变电站
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. <view class="map-route-foot">
  199. <view class="remind-btn" v-if="false" @click="show1 = true,popid=downItem.isRemind" v-show="!downItem.remindId">
  200. <u-icon name="md-alarm" custom-prefix="custom-icon" color="#666" size="44"></u-icon>
  201. <span>设置提醒</span>
  202. </view>
  203. <view class="remind-btn" @click="show1 = true,popid=downItem.isRemind" v-show="downItem.remindId" style=" background-color: blue; color: #fff; ">
  204. <u-icon name="md-alarm" custom-prefix="custom-icon" color="#fff" size="44"></u-icon>
  205. <span>提前{{downItem.isRemind}}站</span>
  206. </view>
  207. <view class="reset-btn" v-if="false">
  208. <u-icon name="shuaxin" custom-prefix="custom-icon" color="#666" size="44"></u-icon>
  209. </view>
  210. </view>
  211. </view>
  212. </template>
  213. <script>
  214. import api from './index.js'
  215. export default api
  216. </script>
  217. <style scoped lang="scss">
  218. .map-route-foot{
  219. position: fixed;
  220. bottom:10px;
  221. right: 0px;
  222. display: flex;
  223. justify-content: flex-end;
  224. z-index: 999;
  225. .remind-btn{
  226. background-color: #fff;
  227. height: 40px;
  228. width: 120px;
  229. border-radius: 20px;
  230. line-height: 40px;
  231. border: 1px solid #eee;
  232. margin-right: 10px;
  233. display: flex;
  234. justify-content: center;
  235. align-items: center;
  236. }
  237. span{
  238. margin-left: 5px;
  239. }
  240. .reset-btn{
  241. background-color: #fff;
  242. height: 40px;
  243. width: 40px;
  244. border-radius: 50%;
  245. text-align: center;
  246. line-height: 40px;
  247. border: 1px solid #eee;
  248. margin-right: 10px;
  249. }
  250. }
  251. .sitePopup{
  252. width: 300px;
  253. padding: 15px;
  254. border: 10px;
  255. }
  256. .sitePopup-head{
  257. h4{
  258. font-size: 18px;
  259. }
  260. }
  261. .sitePopup-driver{
  262. display: flex;
  263. width: 100%;
  264. padding-top: 15px;
  265. border-top: 1px solid #f7f7f7;
  266. justify-content: space-between;
  267. .driver-info{
  268. display: flex;
  269. .driver-text{
  270. margin-left: 10px;
  271. }
  272. }
  273. }
  274. .sitePopup-main{
  275. display: flex;
  276. justify-content: space-between;
  277. margin-top: 20px;
  278. .remind-item{
  279. height: 80px;
  280. width: 80px;
  281. display: flex;
  282. flex-direction: column;
  283. justify-content: center;
  284. align-items: center;
  285. border-radius: 10px;
  286. border: 2px solid #fff;
  287. span{
  288. color:#fff;
  289. }
  290. }
  291. .remind-item1{
  292. background-color: #ff6666;
  293. }
  294. .remind-item2{
  295. background-color: #389e0d;
  296. }
  297. .remind-item3{
  298. background-color: #4291ff;
  299. }
  300. .remind-item-bg{
  301. border: 2px solid #fff;
  302. }
  303. .remind-item-bg1.active{
  304. border: 2px solid #ff6666;
  305. border-radius:10px;
  306. }
  307. .remind-item-bg2.active{
  308. border: 2px solid #389e0d;
  309. border-radius:10px;
  310. }
  311. .remind-item-bg3.active{
  312. border: 2px solid #4291ff;
  313. border-radius:10px;
  314. }
  315. }
  316. .sitePopup-foot{
  317. display: flex;
  318. justify-content: space-between;
  319. margin-top: 20px;
  320. .sitePopup-btn{
  321. background-color: #ddd;
  322. flex: 1;
  323. margin: 5px;
  324. height: 40px;
  325. line-height: 40px;
  326. text-align: center;
  327. border-radius: 20px;
  328. }
  329. }
  330. .map-route {
  331. border-top: 10px solid #f7f7f7;
  332. background-color: #fff;
  333. padding-bottom: 60px;
  334. .map-route-head {
  335. font-size: 16px;
  336. color: #007AFF;
  337. text-align: center;
  338. line-height: 20px;
  339. border-bottom: 1px solid #eee;
  340. }
  341. .map-route-main {
  342. padding: 10px;
  343. position: relative;
  344. overflow-x: scroll !important;
  345. display: -webkit-box;
  346. }
  347. }
  348. .map-info {
  349. display: flex;
  350. justify-content: space-between;
  351. align-items: center;
  352. background-color: #fff;
  353. padding: 20rpx;
  354. }
  355. .map-text {
  356. h4 {
  357. font-size: 16px;
  358. }
  359. p {
  360. margin-top: 10rpx;
  361. color: #999;
  362. }
  363. }
  364. .map-btn {
  365. border: 1px solid #007AFF;
  366. color: #007AFF;
  367. padding: 5px 15px;
  368. border-radius: 30px;
  369. span {
  370. margin-left: 6rpx;
  371. }
  372. }
  373. .map-route-origin {
  374. position: relative;
  375. height: 200px;
  376. width: 15px;
  377. .map-route-circle {
  378. position: absolute;
  379. left: 0;
  380. top: 30px;
  381. height: 15px;
  382. width: 15px;
  383. border-radius: 50%;
  384. background-color: #999;
  385. border: 3px solid #fff;
  386. box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
  387. z-index: 99;
  388. }
  389. .map-route-name {
  390. position: absolute;
  391. top: 50px;
  392. width: 16px;
  393. line-height: 16px;
  394. z-index: 999;
  395. left: 3px;
  396. }
  397. &.map-geton{
  398. .map-route-circle {
  399. width: 24px;
  400. background-color: #fff;
  401. height: 24px;
  402. border: 3px solid #25ad3b;
  403. color:#25ad3b;
  404. text-align: center;
  405. line-height: 18px;
  406. font-size:10px;
  407. top:25px;
  408. left: -3px;
  409. }
  410. .map-route-car {
  411. height: 30px;
  412. width: 30px;
  413. position: absolute;
  414. right: -10px;
  415. top: 2px;
  416. img {
  417. height: 100%;
  418. width: 100%;
  419. }
  420. }
  421. }
  422. }
  423. .map-route-item {
  424. position: relative;
  425. height: 200px;
  426. width: 60px;
  427. .map-route-car {
  428. height: 30px;
  429. width: 30px;
  430. position: absolute;
  431. right: -10px;
  432. top: 2px;
  433. img {
  434. height: 100%;
  435. width: 100%;
  436. }
  437. }
  438. .map-route-circle {
  439. position: absolute;
  440. right: -2px;
  441. top: 30px;
  442. height: 15px;
  443. width: 15px;
  444. border-radius: 50%;
  445. background-color: #fff;
  446. border: 3px solid #1677ff;
  447. z-index: 99;
  448. }
  449. .map-route-line {
  450. height: 6px;
  451. background-color: #1677ff;
  452. width: 55px;
  453. position: absolute;
  454. left: 0px;
  455. top: 35px;
  456. z-index: 9;
  457. }
  458. .map-route-name {
  459. position: absolute;
  460. top: 50px;
  461. width: 16px;
  462. line-height: 16px;
  463. z-index: 999;
  464. right: -3px;
  465. text-align: center;
  466. }
  467. }
  468. .map-route-item.map-now {
  469. .map-route-car {
  470. height: 30px;
  471. width: 30px;
  472. position: absolute;
  473. left: 10px;
  474. top: 2px;
  475. img {
  476. height: 100%;
  477. width: 100%;
  478. }
  479. }
  480. .map-route-circle {
  481. border: 3px solid #ff6200;
  482. }
  483. .map-route-line {
  484. background-color: #ff6200;
  485. }
  486. }
  487. .map-route-item.map-after {
  488. .map-route-circle {
  489. border: 3px solid #999;
  490. }
  491. .map-route-line {
  492. background-color: #999;
  493. }
  494. }
  495. .map-route-item.map-geton {
  496. .map-geton-mark {
  497. width:20px;
  498. height: 20px;
  499. right: 0;
  500. position: absolute;
  501. right: -4px;
  502. top: 5px;
  503. img {
  504. height: 100%;
  505. width: 100%;
  506. }
  507. }
  508. .map-route-circle {
  509. width: 24px;
  510. height: 24px;
  511. border: 3px solid #25ad3b;
  512. color:#25ad3b;
  513. text-align: center;
  514. line-height: 18px;
  515. font-size:10px;
  516. top:25px;
  517. right: -8px;
  518. }
  519. .map-route-name {
  520. color: #25ad3b
  521. }
  522. }
  523. .map-route-item.map-geton1 {
  524. .map-geton-mark {
  525. width: 20px;
  526. height: 20px;
  527. right: 0;
  528. position: absolute;
  529. right: -4px;
  530. top: 5px;
  531. img {
  532. height: 100%;
  533. width: 100%;
  534. }
  535. }
  536. .map-route-circle {
  537. border: 3px solid #25ad3b;
  538. }
  539. .map-route-name {
  540. color: #25ad3b
  541. }
  542. }
  543. .add-foot {
  544. position: fixed;
  545. background-color: #fff;
  546. border-top: 1px solid #eee;
  547. z-index: 999;
  548. bottom: 0;
  549. left: 0;
  550. right: 0;
  551. height: 90rpx;
  552. display: flex;
  553. justify-content: space-between;
  554. .add-foot-price {
  555. display: flex;
  556. align-items: center;
  557. padding-left: 20rpx;
  558. font-size: 32rpx;
  559. span {
  560. color: #1677ff;
  561. }
  562. }
  563. .add-foot-btn {
  564. width: 240rpx;
  565. background-color: #1677ff;
  566. color: #fff;
  567. font-size: 32rpx;
  568. text-align: center;
  569. line-height: 90rpx;
  570. }
  571. }
  572. .navbar-right {
  573. display: flex;
  574. margin-right: 20rpx;
  575. span{
  576. color:rgb(96, 98, 102);
  577. margin-left: 3px;
  578. }
  579. }
  580. .slot-wrap {
  581. display: flex;
  582. align-items: center;
  583. flex: 1;
  584. }
  585. </style>