new.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view class="center">
  3. <view class="top">
  4. <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image>
  5. <view class="title">
  6. 新品
  7. </view>
  8. </view>
  9. <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  10. <swiper-item class="carousel-item" @click="bannerNavToUrl(item)"><image src="../../static/img/new.png" /></swiper-item>
  11. </swiper>
  12. <view class="hotgoods" v-if="firstList.length != 0">
  13. <view class="hotgoods-item" v-for="item in firstList" :key="item.id" @click="navToDetailPage(item)">
  14. <view class="image-wrapper"><image :src="item.image" mode="scaleToFill"></image></view>
  15. <view class="title clamp margin-c-20">{{ item.store_name }}</view>
  16. <view class="hot-price">
  17. <view class="price">
  18. <text class="font-size-sm">¥</text>
  19. {{ item.price }}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { tabbar1 } from '@/utils/tabbar.js';
  28. export default {
  29. data() {
  30. return {
  31. current: 3,
  32. tabbar: tabbar1,
  33. firstList:[],
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="less">
  39. page,
  40. .center {
  41. min-height: 100%;
  42. height: auto;
  43. background: #FFFFFF;
  44. }
  45. .top {
  46. position: relative;
  47. width: 100%;
  48. height: 400rpx;
  49. .top-bg {
  50. position: absolute;
  51. top: 0;
  52. left: 0;
  53. right: 0;
  54. width: 100%;
  55. height: 100%;
  56. }
  57. .title {
  58. position: relative;
  59. z-index: 2;
  60. padding: 30rpx 0;
  61. font-size: 34rpx;
  62. font-family: PingFang SC;
  63. font-weight: bold;
  64. color: #FFFFFF;
  65. text-align: center;
  66. }
  67. }
  68. .carousel {
  69. width: 700rpx;
  70. height: 300rpx;
  71. margin: -280rpx auto 0;
  72. image {
  73. width: 700rpx;
  74. height: 300rpx;
  75. }
  76. }
  77. </style>