newPeople.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="newPeople">
  3. <view class="header">
  4. <view class="inputSearch" @click="clickSearch">
  5. <image src="@/static/img/search.png"></image>
  6. 请输入关键词
  7. </view>
  8. </view>
  9. <data-list :data='data'></data-list>
  10. </view>
  11. </template>
  12. <script>
  13. import { loadIndexs } from '@/api/index.js';
  14. import dataList from '@/components/datalist.vue'
  15. export default {
  16. data() {
  17. return {
  18. data: {
  19. page: 1,
  20. limit: 10,
  21. sum: 0,
  22. loadingType: 'loadmore',
  23. data: []
  24. }
  25. }
  26. },
  27. components: {
  28. dataList
  29. },
  30. mounted() {
  31. this.init()
  32. },
  33. methods: {
  34. // 點擊搜索框
  35. clickSearch() {
  36. uni.navigateTo({
  37. url: '/pages/product/search'
  38. });
  39. },
  40. init() {
  41. this.getData()
  42. },
  43. getData() {
  44. loadIndexs().then(res => {
  45. this.data = res.data.info.bastList
  46. this.loadingType = 'nomore'
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. $grey: #95A0B1;
  54. $text: #333333;
  55. $red: #FF4C4C;
  56. .newPeople {
  57. .header {
  58. background-color: #fff;
  59. padding: 30rpx;
  60. .inputSearch {
  61. line-height: 35rpx;
  62. text-align: center;
  63. color: $grey;
  64. padding: 10rpx 20rpx;
  65. border-radius: 50rpx;
  66. background-color: $page-color-base;
  67. image {
  68. width: 32rpx;
  69. height: 32rpx;
  70. margin: 0 20rpx;
  71. margin-bottom: -3rpx;
  72. }
  73. }
  74. }
  75. .list {
  76. padding: 20rpx;
  77. display: flex;
  78. justify-content: space-between;
  79. flex-wrap: wrap;
  80. .item {
  81. background-color: #fff;
  82. border-radius: 10rpx;
  83. overflow: hidden;
  84. // box-shadow: 2rpx 2rpx 10rpx #e1e1e1;
  85. margin: 10rpx 0;
  86. width: 48%;
  87. height: 0;
  88. padding-bottom: calc(48% + 120rpx);
  89. .img {
  90. border-radius: 10rpx;
  91. overflow: hidden;
  92. width: 100%;
  93. height: 0;
  94. padding-bottom: 100%;
  95. image {
  96. width: 100%;
  97. height: 100%;
  98. }
  99. }
  100. .name {
  101. margin: 0 10rpx;
  102. font-size: 30rpx;
  103. font-weight: bold;
  104. }
  105. .allprice {
  106. padding: 20rpx 0;
  107. .price {
  108. color: $red;
  109. }
  110. .ot-price {
  111. color: $grey;
  112. text-decoration: line-through;
  113. font-size: 26rpx;
  114. }
  115. }
  116. }
  117. }
  118. .load {
  119. text-align: center;
  120. color: $grey;
  121. font-size: 28rpx;
  122. }
  123. }
  124. </style>