index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view class="container">
  3. <image class="headImg" mode="aspectFill" src="/static/img/homeHead.png"></image>
  4. <view class="tabs">
  5. <view class="tab">
  6. <image src="/static/img/Frame3.png" alt="">
  7. <span>全部</span>
  8. </view>
  9. <view class="tab">
  10. <image src="/static/img/Frame4.png" alt="">
  11. <span>超值挑战</span>
  12. </view>
  13. <view class="tab">
  14. <image src="/static/img/Frame2.png" alt="">
  15. <span>拍卖专区</span>
  16. </view>
  17. <view class="tab">
  18. <image src="/static/img/Frame1.png" alt="">
  19. <span>VIP福利</span>
  20. </view>
  21. </view>
  22. <view class="buttons">
  23. <view class="left">
  24. <image src="/static/img/button3.png"></image>
  25. </view>
  26. <view class="right">
  27. <image src="/static/img/button1.png"></image>
  28. <image src="/static/img/button2.png"></image>
  29. </view>
  30. </view>
  31. <view class="list-title">
  32. - 热门推荐 -
  33. </view>
  34. <view class="list">
  35. <view class="ka" v-for="(item, index) in kaList">
  36. <view class="top">
  37. <image mode="aspectFit" src="../../static/img/ka.jpeg"></image>
  38. </view>
  39. <view class="ka-info">
  40. <view class="ka-name">
  41. 宝可梦简中原盒拆拆乐
  42. </view>
  43. <view class="row">
  44. <uni-tag text="创意热销" inverted type="default"></uni-tag>
  45. <view class="money">
  46. ¥9.9
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. kaList: 6,
  59. }
  60. },
  61. methods: {
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .container {
  67. /* padding: 20px; */
  68. font-size: 14px;
  69. line-height: 24px;
  70. }
  71. .headImg {
  72. height: 180px;
  73. width: 100%;
  74. }
  75. .tabs {
  76. display: flex;
  77. justify-content: space-around;
  78. margin-top: 10px;
  79. > .tab {
  80. width: 20%;
  81. display: flex;
  82. flex-direction: column;
  83. justify-content: center;
  84. align-items: center;
  85. > image {
  86. width: 40px;
  87. height: 40px;
  88. }
  89. }
  90. }
  91. .buttons {
  92. margin-top: 5px;
  93. padding: 10px;
  94. display: flex;
  95. justify-content: space-between;
  96. > .left {
  97. width: calc(50vw - 15px);
  98. height: 40vw;
  99. image {
  100. width: 100%;
  101. height: 100%;
  102. }
  103. }
  104. > .right {
  105. width: calc(50vw - 15px);
  106. height: 40vw;
  107. display: flex;
  108. flex-direction: column;
  109. justify-content: space-between;
  110. align-items: center;
  111. image {
  112. width: 100%;
  113. height: calc(50% - 5px);
  114. }
  115. }
  116. }
  117. .list-title {
  118. font-size: 16px;
  119. font-weight: 600;
  120. text-align: center;
  121. padding: 10px;
  122. }
  123. .list {
  124. display: grid;
  125. grid-template-columns: 1fr 1fr;
  126. grid-gap: 10px;
  127. padding: 10px;
  128. .ka {
  129. width: calc(50vw - 15px);
  130. box-shadow: 0px 2px 8px 2px rgba(0,0,0,0.1);
  131. border-radius: 10px;
  132. // height: 60vw;
  133. .top {
  134. // height: 60vw;
  135. background: linear-gradient(180deg, #FAF1A7 0%, #FFE456 100%);
  136. text-align: center;
  137. display: flex;
  138. justify-content: center;
  139. image {
  140. width: 35vw;
  141. height: 50vw;
  142. }
  143. }
  144. .ka-info {
  145. padding: 10px;
  146. .ka-name {
  147. font-size: 15px;
  148. font-weight: 600;
  149. }
  150. .row {
  151. margin-top: 5px;
  152. display: flex;
  153. justify-content: space-between;
  154. .money {
  155. font-size: 16px;
  156. font-weight: 600;
  157. color: #FF2C43;
  158. }
  159. }
  160. }
  161. }
  162. }
  163. </style>