index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="container">
  3. <image class="headImg" mode="aspectFill" src="/static/img/homeHead.jpeg"></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" @click="$navigateTo('/pages/excellentValue/excellentValue')">
  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" @click="toInvite"></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. onLoad(query) {
  62. console.log(query, 'query')
  63. if (query.inviteId) {
  64. getApp().globalData.inviteId = inviteId;
  65. } else {
  66. const scene = decodeURIComponent(query.scene)
  67. let inviteId = scene.split("=")[1]
  68. console.log(inviteId, 'inviteId')
  69. getApp().globalData.inviteId = inviteId;
  70. }
  71. },
  72. methods: {
  73. toInvite() {
  74. wx.navigateTo({url: '/pages/invite/invite'})
  75. }
  76. }
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .container {
  81. /* padding: 20px; */
  82. font-size: 14px;
  83. line-height: 24px;
  84. }
  85. .headImg {
  86. height: 180px;
  87. width: 100%;
  88. }
  89. .tabs {
  90. display: flex;
  91. justify-content: space-around;
  92. margin-top: 10px;
  93. > .tab {
  94. width: 20%;
  95. display: flex;
  96. flex-direction: column;
  97. justify-content: center;
  98. align-items: center;
  99. > image {
  100. width: 40px;
  101. height: 40px;
  102. }
  103. }
  104. }
  105. .buttons {
  106. margin-top: 5px;
  107. padding: 10px;
  108. display: flex;
  109. justify-content: space-between;
  110. > .left {
  111. width: calc(50vw - 15px);
  112. height: 40vw;
  113. image {
  114. width: 100%;
  115. height: 100%;
  116. }
  117. }
  118. > .right {
  119. width: calc(50vw - 15px);
  120. height: 40vw;
  121. display: flex;
  122. flex-direction: column;
  123. justify-content: space-between;
  124. align-items: center;
  125. image {
  126. width: 100%;
  127. height: calc(50% - 5px);
  128. }
  129. }
  130. }
  131. .list-title {
  132. font-size: 16px;
  133. font-weight: 600;
  134. text-align: center;
  135. padding: 10px;
  136. }
  137. .list {
  138. display: grid;
  139. grid-template-columns: 1fr 1fr;
  140. grid-gap: 10px;
  141. padding: 10px;
  142. .ka {
  143. width: calc(50vw - 15px);
  144. box-shadow: 0px 2px 8px 2px rgba(0,0,0,0.1);
  145. border-radius: 10px;
  146. // height: 60vw;
  147. .top {
  148. // height: 60vw;
  149. background: linear-gradient(180deg, #FAF1A7 0%, #FFE456 100%);
  150. text-align: center;
  151. display: flex;
  152. justify-content: center;
  153. image {
  154. width: 35vw;
  155. height: 50vw;
  156. }
  157. }
  158. .ka-info {
  159. padding: 10px;
  160. .ka-name {
  161. font-size: 15px;
  162. font-weight: 600;
  163. }
  164. .row {
  165. margin-top: 5px;
  166. display: flex;
  167. justify-content: space-between;
  168. .money {
  169. font-size: 16px;
  170. font-weight: 600;
  171. color: #FF2C43;
  172. }
  173. }
  174. }
  175. }
  176. }
  177. </style>