index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="content">
  3. <car-common ref="common" ></car-common>
  4. <u-navbar :is-back="false" title="">
  5. <view class="slot-wrap">
  6. <view class="navbar-left">
  7. <u-dropdown ref="uDropdown">
  8. <u-dropdown-item title="荆州">
  9. <view class="slot-content">
  10. <view class="u-text-center">沙市</view>
  11. <view class="u-text-center">湖南</view>
  12. <view class="u-text-center">湖北</view>
  13. <u-button type="primary" @click="closeDropdown">确定</u-button>
  14. </view>
  15. </u-dropdown-item>
  16. </u-dropdown>
  17. </view>
  18. <view class="search-wrap" >
  19. <u-search placeholder="查线路、站点" @click="gotoQuery" :disabled="true" :show-action="false"></u-search>
  20. </view>
  21. <view class="navbar-right" @click="getScan">
  22. <u-icon name="saoma" custom-prefix="custom-icon" size="40" color="#333"></u-icon>
  23. </view>
  24. </view>
  25. </u-navbar>
  26. <view class="banner">
  27. <u-swiper :list="list" @click="clickSwiper"></u-swiper>
  28. </view>
  29. <view v-if="!getPointBl" style="text-align:center;margin-top: 40px;" >
  30. <img src="static/img/getPointError.png" style="width: 50%;" alt="" >
  31. <view>无法获取定位信息,请打开手机定位功能</view>
  32. <u-button :custom-style="btn" size="medium" shape="circle" plain @click="getPoint(true)" >刷新</u-button>
  33. </view>
  34. <view v-if="getPointBl&&siteList.length==0" style="text-align:center;margin-top: 40px;" >
  35. <img src="static/img/null.png" style="width: 50%;" alt="" >
  36. <view>附近暂无站点信息</view>
  37. <u-button :custom-style="btn" size="medium" shape="circle" plain @click="getPoint(true)" >刷新</u-button>
  38. </view>
  39. <view class="index-floor" v-for="item,index in siteList" :key="index">
  40. <view class="title">
  41. <u-icon name="zhanpai" custom-prefix="custom-icon" size="40" color="#1677ff"></u-icon>
  42. <span>{{item.stationName}}</span>
  43. </view>
  44. <view class="content">
  45. <view class="route">
  46. <view class="route-item" v-for="li,i in item.nearbyShiftDTOList" :key="i" @click="gotoLine(li)">
  47. <view class="route-text">
  48. <h4>{{li.routeName}}</h4>
  49. <p>开往 {{li.endStationName}}</p>
  50. </view>
  51. <view class="route-gap" >
  52. <view class="route-gap stop">
  53. <span>{{li.distance}}米</span>
  54. <u-icon name="arrow-right" color="#999" size="28"></u-icon>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import api from './index.js'
  65. export default api
  66. </script>
  67. <style>
  68. page{background-color: #f7f7f7;}
  69. </style>
  70. <style scoped lang="scss">
  71. .btn{
  72. border-color: #1677FF ;
  73. }
  74. .slot-wrap {
  75. display: flex;
  76. align-items: center;
  77. flex: 1;
  78. }
  79. .navbar-right {
  80. display: flex;
  81. margin-right: 20rpx;
  82. }
  83. .navbar-left{
  84. display: flex;
  85. align-items: center;
  86. margin-left: 20rpx;
  87. span{
  88. margin-right: 6rpx;
  89. font-size: 14px;
  90. }
  91. }
  92. .search-wrap {
  93. margin: 0 20rpx;
  94. flex: 1;
  95. }
  96. .banner{
  97. padding: 20rpx;
  98. background-color: #fff;
  99. }
  100. .slot-content{
  101. background-color: #fff;
  102. }
  103. .index-floor{
  104. margin: 20rpx;
  105. background-color: #fff;
  106. border-radius: 20rpx;
  107. .title{
  108. padding: 20rpx;
  109. border-bottom: 1px solid #f7f7f7;
  110. display: flex;
  111. align-items: center;
  112. span{
  113. margin-left: 10rpx;
  114. font-size: 16px;
  115. font-weight: bold;
  116. }
  117. }
  118. .text{
  119. padding: 20rpx;
  120. border-bottom: 1px solid #f7f7f7;
  121. display: flex;
  122. align-items: center;
  123. span{
  124. margin-left: 10rpx;
  125. font-size: 12px;
  126. }
  127. }
  128. }
  129. .route{
  130. margin:0 20rpx;
  131. }
  132. .route-item{
  133. padding: 20rpx 0;
  134. border-bottom: 1px solid #f7f7f7;
  135. display: flex;
  136. justify-content: space-between;
  137. align-items: center;
  138. &:last-child{
  139. border: none;
  140. }
  141. h4{
  142. font-size: 32rpx;
  143. }
  144. p{
  145. margin-top: 6rpx;
  146. color:#999;
  147. }
  148. }
  149. .route-gap{
  150. span{
  151. font-size: 32rpx;
  152. font-weight: bold;
  153. margin-right: 10rpx;
  154. color:#1677ff;
  155. }
  156. &.stop{
  157. span{color:#ff731d}
  158. }
  159. }
  160. </style>