index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="body">
  3. <uniSwiperDot :info="info" :current="current" field="content" mode="default" :dots-styles=dotsStyles>
  4. <swiper autoplay="true" circular="true" interval="4000" duration="500" class="swiper-box">
  5. <swiper-item v-for="(item ,index) in info" :key="index" @click="clickItem(item)">
  6. <image class="imagestyle" :src="item.cover.url" mode=""></image>
  7. </swiper-item>
  8. </swiper>
  9. </uniSwiperDot>
  10. <view class="content">
  11. <view class="RedCar" @click="buyCar">
  12. <p
  13. style="width: 46vw; text-align: center; color: red; line-height: 10vw; margin-top: 8vw; font-weight: 550;">
  14. 买车</p>
  15. <p style="width: 46vw; text-align: center; color: #e0e0e0e0;"> <span>BUY</span>
  16. <sapn>CAR</sapn>
  17. </p>
  18. <!-- <p>
  19. <image style="width: 50vw; height: 50vw; margin-top: -7vw; " src="../../static/redcar.png"></image>
  20. </p> -->
  21. </view>
  22. <view class="whiteCar" @click="sellCar">
  23. <p style="width: 46vw; text-align: center; color: blue; margin-top: 10vw; font-weight: 550;">卖车</p>
  24. <p style="width: 46vw; text-align: center; color: #e0e0e0e0; margin-top: 2vw;"> <span>BUY</span>
  25. <sapn>CAR</sapn>
  26. </p>
  27. <!-- <p>
  28. <image style="width: 40vw; height: 40vw; margin-top: -3vw; margin-left: 5vw; "
  29. src="../../static/whiteCar.png"></image>
  30. </p> -->
  31. </view>
  32. </view>
  33. <view class="floot">
  34. <view class="model" v-for="(item,index) in NewCarList" :key="index" @click="newDetial(item)">
  35. <view style="margin-left: 2vw; margin-top: 2vw;">
  36. <image style="width: 15vw; height: 15vw;" :src="item.img.url"></image>
  37. </view>
  38. <view style="margin-top: 5vw; margin-left: 3vw;">
  39. <p
  40. style="width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; ">
  41. {{item.name}}
  42. </p>
  43. <p> <span style="font-size: 0.75rem;">指导价:</span> <span
  44. style="font-size: 0.75rem; color: red;">{{Number(item.min_price/10000)}}万起</span>
  45. </p>
  46. </view>
  47. <view
  48. style="width: 20vw; margin-left: 2vw; margin-top: 6vw; height: 8vw; background-color: #fff5f5; color: red; text-align: center; font-size: 0.75rem; line-height: 8vw; border-radius: 4vw;">
  49. <p>{{item.brand_name}} </p>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import uniSwiperDot from '../../uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue'
  57. export default {
  58. components: {
  59. uniSwiperDot
  60. },
  61. data() {
  62. return {
  63. dotsStyles: {
  64. backgroundColor: 'rgba(83, 200, 249,0.3)',
  65. border: '1px rgba(83, 200, 249,0.3) solid',
  66. color: '#fff',
  67. bottom: 2,
  68. selectedBackgroundColor: 'white',
  69. selectedBorder: '1px rgba(83, 200, 249,0.9) solid'
  70. },
  71. info: [],
  72. NewCarList: []
  73. }
  74. },
  75. onLoad() {
  76. this.getNewCarList(1, '')
  77. this.Swiper()
  78. },
  79. methods: {
  80. newDetial(item) {
  81. uni.navigateTo({
  82. url: '/pages/index/newCarDetial?DetialInfo=' + encodeURIComponent(JSON.stringify(item))
  83. })
  84. },
  85. // 热门车系
  86. getNewCarList(is_hot, name) {
  87. this.$api.getNewCar(is_hot, name, res => {
  88. if (res.code == 0) {
  89. this.NewCarList = res.data
  90. }
  91. })
  92. },
  93. clickItem(item) {
  94. console.log(item)
  95. uni.navigateTo({
  96. url: '/pages/index/active?id=' + item.id
  97. })
  98. },
  99. Swiper() {
  100. this.$api.getSwiper(res => {
  101. if (res.code == 0) {
  102. this.info = res.data
  103. }
  104. })
  105. },
  106. buyCar() {
  107. uni.navigateTo({
  108. url: "/pages/index/buyCar"
  109. })
  110. },
  111. sellCar() {
  112. uni.navigateTo({
  113. url: "/pages/index/sellCar"
  114. })
  115. }
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .body {
  121. width: 100vw;
  122. height: 100vh;
  123. .content {
  124. width: 92vw;
  125. height: 20vh;
  126. margin-left: 4vw;
  127. box-sizing: border-box;
  128. border-top: 0.5px solid #f6f6f6;
  129. border-bottom: 0.5px solid #f6f6f6;
  130. display: flex;
  131. margin-top: 2vw;
  132. .RedCar {
  133. width: 46vw;
  134. border-right: 0.5px solid #f6f6f6;
  135. }
  136. .whiteCar {
  137. width: 46vw;
  138. }
  139. }
  140. .floot {
  141. width: 100vw;
  142. height: 40vh;
  143. overflow-y: auto;
  144. box-sizing: border-box;
  145. padding:0 4vw ;
  146. .model {
  147. width: 92vw;
  148. height: 20vw;
  149. display: flex;
  150. margin-top: 2vw;
  151. background-color: #f8f8f8;
  152. }
  153. }
  154. .imagestyle {
  155. margin-top: 0vw;
  156. width: 100%;
  157. height: 100%;
  158. }
  159. .swiper-box {
  160. height: 60vw;
  161. }
  162. // .swiper-box {
  163. // height: 40vw;
  164. // }
  165. // .imagestyle {
  166. // margin-top: 0vw;
  167. // width: 100%;
  168. // height: 100%
  169. // }
  170. }
  171. </style>