dataList.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view :class="[ DataType === 2 ? '' : 'hide-element' ]">
  3. <template v-if="DataType === 2">
  4. <babTouchbox :minHeight="0.35" :smallHeight="0.1" :maxHeight="0.8" :touchHeight="64"
  5. @currentHeight="setTouchHeight" @maxtHeight="setScrollMaxHeight">
  6. <scroll-view :style="{'height':TouchHeight - 40 +'px' }" scroll-y="true" :show-scrollbar="false">
  7. <template>
  8. <!-- loading -->
  9. <view :class="['address-list' , addressList && addressList.length > 0 ? '' : 'hide-element']">
  10. <view class="address-item" v-for="(item, index) in addressList"
  11. :key="`address_item_${index}`" @click.stop="onViewDetails(item)">
  12. <view class="address-headline">
  13. <text class="headline-name nvue-one-row">{{item.name}}</text>
  14. <view class="headline-distance">
  15. <text class="distance-text">距我{{getDistance(item.distance)}}</text>
  16. <image class="distance-icon" src="@/static/map/arrows.png" mode="aspectFit">
  17. </image>
  18. </view>
  19. </view>
  20. <view class="location-info">
  21. <image class="location-icon" src="@/static/map-dot.png" mode="aspectFit"></image>
  22. <text class="location-text nvue-one-row">{{item.detailedAddress}}</text>
  23. </view>
  24. <view class="times">
  25. <text class="time-info nvue-one-row">{{item.intro}}</text>
  26. </view>
  27. </view>
  28. </view>
  29. <view
  30. :class="['empty-box' , loading || (addressList && addressList.length > 0) ? 'hide-element' : '']">
  31. <image class="empty-img" src="@/static/map/empty-img.png" mode="aspectFit"></image>
  32. <text class="empty-text">暂无数据</text>
  33. </view>
  34. </template>
  35. </scroll-view>
  36. </babTouchbox>
  37. </template>
  38. </view>
  39. </template>
  40. <script>
  41. import Mixin from "./Mixin.js"
  42. import babTouchbox from '@/components/bab-Touchbox/bab-Touchbox';
  43. import EmptyDate from '@/components/EmptyDate/EmptyDate';
  44. export default {
  45. mixins: [Mixin],
  46. props: {
  47. loading: {
  48. type: Boolean,
  49. default: true
  50. }
  51. },
  52. components: {
  53. babTouchbox,
  54. EmptyDate
  55. },
  56. // classifyList
  57. data() {
  58. return {
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. @import url("./style.scss");
  65. .address-list {
  66. .address-item {
  67. height: 176rpx;
  68. border-bottom-width: 1rpx;
  69. border-bottom-style: solid;
  70. border-bottom-color: #EDEDED;
  71. padding: 30rpx 0 20rpx;
  72. flex-direction: column;
  73. justify-content: space-between;
  74. .address-headline {
  75. flex-direction: row;
  76. justify-content: space-between;
  77. align-items: center;
  78. .headline-name {
  79. flex: 1;
  80. font-size: 28rpx;
  81. font-weight: 500;
  82. color: #1a1a1a;
  83. }
  84. .headline-distance {
  85. width: 200rpx;
  86. flex-direction: row;
  87. justify-content: flex-end;
  88. align-items: center;
  89. .distance-text {
  90. font-size: 24rpx;
  91. font-weight: 300;
  92. text-align: left;
  93. color: #666666;
  94. }
  95. .distance-icon {
  96. width: 28rpx;
  97. height: 28rpx;
  98. }
  99. }
  100. }
  101. .location-info {
  102. flex-direction: row;
  103. align-items: center;
  104. .location-icon {
  105. width: 21.54rpx;
  106. height: 25.96rpx;
  107. }
  108. .location-text {
  109. flex: 1;
  110. padding-left: 5rpx;
  111. font-size: 24rpx;
  112. font-weight: 300;
  113. color: #808080;
  114. }
  115. }
  116. .times {
  117. .time-info {
  118. font-size: 24rpx;
  119. font-weight: 300;
  120. color: #808080;
  121. }
  122. }
  123. }
  124. }
  125. .auto-width-item {
  126. overflow: hidden;
  127. flex-direction: row;
  128. }
  129. .nvue-one-row {
  130. text-overflow: ellipsis; //文字超出省略号
  131. lines: 1; //文字行数
  132. }
  133. .nvue-two-row {
  134. text-overflow: ellipsis; //文字超出省略号
  135. lines: 2; //文字行数
  136. }
  137. .empty-box {
  138. padding-top: 60rpx;
  139. flex-direction: column;
  140. align-items: center;
  141. justify-content: center;
  142. .empty-img {
  143. width: 204rpx;
  144. height: 193rpx;
  145. }
  146. .empty-text {
  147. padding: 32rpx;
  148. opacity: 0.59;
  149. color: #999999;
  150. font-size: 30rpx;
  151. font-weight: 400;
  152. }
  153. }
  154. </style>