swiperList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view :class="['swiper-box' , DataType === 1 && addressList.length > 0 ? '' : 'hide-element' ]" @touchmove="(e) => {return false}" :style="{'bottom': bottom }">
  3. <esc-swiper ref="swiper" :autoplay="false" :circular="false" :current.sync="current" :size="addressList.length"
  4. :plus="2" :width="750" :height="317" :itemWidth="623" :space="20">
  5. <esc-swiper-item v-for="(item, idx) in addressList" :index="idx" :key="`swiper_${idx}`">
  6. <view class="swiper-content" id="details" @click.stop="e => {onViewDetails(item , e)}">
  7. <view class="content-info">
  8. <image v-if="item.icon" class="info-logo" :src="item.icon" mode="scaleToFill"></image>
  9. <image v-else class="info-logo" src="@/static/map/default-icon.png" mode="scaleToFill"></image>
  10. <view class="info-text">
  11. <text class="info-name nvue-one-row">{{item.name}}</text>
  12. <view class="info-more">
  13. <view class="more-text">
  14. <view class="auto-width-item">
  15. <view class="bottomTextView">
  16. <text class="bottomText nvue-one-row">{{getTypeName(item)}}</text>
  17. </view>
  18. </view>
  19. <text class="info-site nvue-one-row">{{(item.distance/1000).toFixed(1)}}公里</text>
  20. <text class="info-site nvue-one-row">{{item.detailedAddress}}</text>
  21. </view>
  22. <view class="more-btn" id="goMap" @click.stop="toHere(item)">
  23. <image class="toimg" src="@/static/map/location.png" mode="scaleToFill">
  24. </image>
  25. <text class="btn-text">到这里</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <text class="content-details nvue-two-row">{{item.intro}}</text>
  31. </view>
  32. </esc-swiper-item>
  33. </esc-swiper>
  34. </view>
  35. </template>
  36. <script>
  37. import Mixin from "./Mixin.js"
  38. export default {
  39. mixins: [Mixin],
  40. props: {
  41. },
  42. // classifyList
  43. data() {
  44. return {
  45. current: 0,
  46. bottom: '40px'
  47. }
  48. },
  49. watch: {
  50. current: {
  51. handler: function(newC, oldC) {
  52. this.$emit('onCurrent', newC)
  53. },
  54. immediate: true
  55. }
  56. },
  57. created() {
  58. const platform = uni.getSystemInfoSync().platform + '';
  59. // ios 系统
  60. if (platform.toLowerCase() == "ios") {
  61. this.bottom = '70px'
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. @import url("./style.scss");
  68. .swiper-box {
  69. position: absolute;
  70. left: 0;
  71. z-index: 1;
  72. // background-color: skyblue;
  73. .swiper-content {
  74. width: 623rpx;
  75. height: 317rpx;
  76. background-color: #fff;
  77. border-radius: 20rpx;
  78. overflow: hidden;
  79. padding: 20rpx;
  80. .content-info {
  81. height: 168rpx;
  82. flex-direction: row;
  83. align-items: stretch;
  84. justify-content: space-between;
  85. .info-logo {
  86. width: 168rpx;
  87. height: 168rpx;
  88. border-radius: 20rpx;
  89. }
  90. .info-text {
  91. width: 390rpx;
  92. height: 168rpx;
  93. flex-direction: column;
  94. .info-name {
  95. font-size: 30rpx;
  96. height: 42rpx;
  97. font-family: PingFang SC, PingFang SC-Bold;
  98. font-weight: 700;
  99. color: #333333;
  100. }
  101. .info-more {
  102. height: 126rpx;
  103. flex-direction: row;
  104. justify-content: space-between;
  105. align-items: flex-end;
  106. .more-text {
  107. height: 126rpx;
  108. flex-direction: column;
  109. justify-content: space-between;
  110. width: 268rpx;
  111. padding-right: 20rpx;
  112. // .info-tag {
  113. // height: 42rpx;
  114. // font-size: 24rpx;
  115. // background-color: #E3FCFC;
  116. // }
  117. .bottomTextView {
  118. border-radius: 20rpx 0px;
  119. height: 42rpx;
  120. font-size: 24rpx;
  121. background-color: #E3FCFC;
  122. .bottomText {
  123. line-height: 42rpx;
  124. padding: 0 22rpx;
  125. font-size: 24rpx;
  126. color: #43BDD6;
  127. }
  128. }
  129. .info-site {
  130. font-size: 24rpx;
  131. font-family: PingFang SC, PingFang SC-Medium;
  132. color: #666666;
  133. }
  134. }
  135. .more-btn {
  136. width: 122rpx;
  137. height: 50rpx;
  138. // background: linear-gradient(90deg,#45c7d5 4%, #3cb7d1 93%);
  139. background-color: #45c7d5;
  140. border-radius: 25rpx;
  141. flex-direction: row;
  142. justify-content: center;
  143. align-items: center;
  144. .toimg {
  145. width: 22rpx;
  146. height: 24rpx;
  147. }
  148. .btn-text {
  149. font-size: 24rpx;
  150. font-family: PingFang SC, PingFang SC-Regular;
  151. font-weight: 400;
  152. color: #ffffff;
  153. }
  154. }
  155. }
  156. }
  157. }
  158. .content-details {
  159. padding-top: 25rpx;
  160. height: 109rpx;
  161. font-size: 30rpx;
  162. font-family: PingFang SC, PingFang SC-Regular;
  163. font-weight: 400;
  164. color: #1a1a1a;
  165. }
  166. }
  167. }
  168. .auto-width-item {
  169. overflow: hidden;
  170. flex-direction: row;
  171. }
  172. </style>