index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <page-loading :loading="loading">
  3. <view class="product-page">
  4. <view class="logo logo-black" />
  5. <u-search
  6. v-model="keywords"
  7. placeholder="搜索展厅"
  8. :show-action="false"
  9. shape="square"
  10. bg-color="#fff"
  11. border-color="#ccc"
  12. height="84rpx"
  13. @search="handleSearch"
  14. />
  15. <view
  16. class="cases-list dir-left-wrap"
  17. >
  18. <view
  19. v-for="(item,index) in lists"
  20. :key="index"
  21. class="cases-item main-left"
  22. @click="$u.route({url:`/pages/case/detail?id=${item.id}`})"
  23. >
  24. <view class="detail cross-center main-center">
  25. <!-- <text>热销展厅排名</text>-->
  26. <view class="name"> {{ item.name }}</view>
  27. </view>
  28. <view class="cover-img">
  29. <image :src="item.cover_img" mode="aspectFill" />
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </page-loading>
  35. </template>
  36. <script>
  37. import PageLoading from '../../components/PageLoading'
  38. export default {
  39. name: 'Product',
  40. components: { PageLoading },
  41. data() {
  42. return {
  43. loading: false,
  44. keywords: '',
  45. limit: 3,
  46. page: 1,
  47. lists: []
  48. }
  49. },
  50. computed: {},
  51. methods: {
  52. handleSearch() {
  53. this.$u.route({ url: `/pages/case/list?keywords=${this.keywords}` })
  54. },
  55. getLists() {
  56. this.$api.cases.search({
  57. limit: this.limit,
  58. page: this.page
  59. }).then(res => {
  60. this.loading = false
  61. this.lists = res.data
  62. })
  63. }
  64. },
  65. onLoad() {
  66. this.loading = true
  67. this.getLists()
  68. },
  69. onShow() {
  70. this.getLists()
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .product-page {
  76. padding: 0 30rpx;
  77. overflow: hidden;
  78. height: 100vh;
  79. .logo{
  80. margin: 30rpx auto;
  81. }
  82. .cases-list{
  83. margin-top: 80rpx;
  84. .cases-item{
  85. width: 690rpx;
  86. margin-bottom: 10rpx;
  87. &:last-child{
  88. margin-bottom: 0;
  89. }
  90. .detail{
  91. font-size: 24rpx;
  92. color: #333333;
  93. background: #F2F2F2;
  94. flex: 1;
  95. text{
  96. color: #b4936d;
  97. }
  98. .name{
  99. font-size: 32rpx;
  100. }
  101. }
  102. .cover-img{
  103. width: 410rpx;
  104. height: 235rpx;
  105. image{
  106. width: 100%;
  107. height: 100%;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. </style>