index.vue 12 KB

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