active-area.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view :class="['active-area bg-white', type]">
  3. <view class="active-hd flex row-between" v-if="title">
  4. <view class="xxl bold">{{title}}</view>
  5. <router-link :to="url" v-if="url && type == 'hot'">
  6. <view class="sm">更多 <u-icon name="arrow-right"></u-icon>
  7. </view>
  8. </router-link>
  9. </view>
  10. <view class="active-con">
  11. <scroll-view style="white-space: nowrap;" :scroll-x="true" v-if="type == 'hot'">
  12. <view class="goods-wrap">
  13. <goods-list :show-bg="false" type="row-hot" :list="list"></goods-list>
  14. </view>
  15. </scroll-view>
  16. <goods-list v-if="type == 'new'" type="new" :list="list" :show-bg="false"></goods-list>
  17. </view>
  18. <router-link :to="url" v-if="url && type == 'new'">
  19. <view class="bg-white xs flex row-center more">查看更多 <u-icon name="arrow-right">
  20. </u-icon>
  21. </view>
  22. </router-link>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. name: "active-area",
  28. props: {
  29. title: String,
  30. url: String,
  31. list: {
  32. type: Array,
  33. default: () => ([])
  34. },
  35. type: String
  36. },
  37. data() {
  38. return {
  39. };
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .active-area {
  45. background-size: 100% auto;
  46. background-repeat: no-repeat;
  47. border-radius: 14rpx;
  48. overflow: hidden;
  49. &.new {
  50. background-image: url(../../static/images/index_new_bg.png);
  51. }
  52. &.hot {
  53. background-image: url(../../static/images/index_hot_bg.png);
  54. }
  55. .active-hd {
  56. padding: 24rpx 20rpx;
  57. }
  58. .goods-wrap {
  59. padding: 0 20rpx 20rpx;
  60. display: inline-block;
  61. }
  62. .more {
  63. height: 80rpx;
  64. border-top: $-solid-border;
  65. }
  66. }
  67. </style>