index --lod.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view class="container">
  3. <image class="headImg" mode="aspectFill" :src="$fileUrl() + '/homeHead.jpeg'"></image>
  4. <view class="headBarrage">
  5. </view>
  6. <view class="tabs">
  7. <view class="tab">
  8. <image :src="$fileUrl() + '/Frame3.png'" alt="">
  9. <span>全部</span>
  10. </view>
  11. <view class="tab" @click="$navigateTo('/pages/excellentValue/excellentValue')">
  12. <image :src="$fileUrl() + '/Frame4.png'" alt="">
  13. <span>超值挑战</span>
  14. </view>
  15. <view class="tab">
  16. <image :src="$fileUrl() + '/Frame2.png'" alt="">
  17. <span>拍卖专区</span>
  18. </view>
  19. <view class="tab">
  20. <image :src="$fileUrl() + '/Frame1.png'" alt="">
  21. <span>VIP福利</span>
  22. </view>
  23. </view>
  24. <view class="buttons">
  25. <view class="left">
  26. <image :src="$fileUrl() + '/button3.png'" @click="toInvite"></image>
  27. </view>
  28. <view class="right">
  29. <image :src="$fileUrl() + '/button1.png'"></image>
  30. <image :src="$fileUrl() + '/button2.png'"
  31. @click="$navigateTo('/pages/raffle/raffle')"></image>
  32. </view>
  33. </view>
  34. <view class="list-title">
  35. - 热门推荐 -
  36. </view>
  37. <view class="list">
  38. <view class="ka" v-for="(item, index) in kaList">
  39. <view class="top">
  40. <image mode="aspectFit" :src="$fileUrl() + '/ka.jpeg'"></image>
  41. </view>
  42. <view class="ka-info">
  43. <view class="ka-name">
  44. 宝可梦简中原盒拆拆乐
  45. </view>
  46. <view class="row">
  47. <uni-tag text="创意热销" inverted type="default"></uni-tag>
  48. <view class="money">
  49. ¥9.9
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. messageListApi
  60. } from "@/api/common.js"
  61. export default {
  62. data() {
  63. return {
  64. kaList: 6,
  65. messageList: [],
  66. barrageData: [],
  67. barrageIndex: 0,
  68. timeOut: null,
  69. }
  70. },
  71. onLoad(query) {
  72. if (query.inviteId) {
  73. getApp().globalData.inviteId = query.inviteId;
  74. } else {
  75. const scene = decodeURIComponent(query.scene)
  76. let inviteId = scene.split("=")[1]
  77. console.log(inviteId, 'inviteId')
  78. getApp().globalData.inviteId = inviteId;
  79. }
  80. },
  81. onShow() {
  82. this.getMessage()
  83. },
  84. methods: {
  85. getMessage() {
  86. let params = {
  87. limit: 20,
  88. page: 1,
  89. }
  90. messageListApi(params).then(res => {
  91. this.messageList = res.data.list
  92. this.initBarrage()
  93. })
  94. },
  95. // 初始化弹幕
  96. initBarrage() {
  97. },
  98. toInvite() {
  99. wx.navigateTo({
  100. url: '/pages/invite/invite'
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .container {
  108. /* padding: 20px; */
  109. font-size: 14px;
  110. line-height: 24px;
  111. }
  112. .headImg {
  113. height: 180px;
  114. width: 100%;
  115. }
  116. .headBarrage {
  117. height: 180px;
  118. width: 100%;
  119. position: absolute;
  120. top: 0;
  121. }
  122. .tabs {
  123. display: flex;
  124. justify-content: space-around;
  125. margin-top: 10px;
  126. >.tab {
  127. width: 20%;
  128. display: flex;
  129. flex-direction: column;
  130. justify-content: center;
  131. align-items: center;
  132. >image {
  133. width: 40px;
  134. height: 40px;
  135. }
  136. }
  137. }
  138. .buttons {
  139. margin-top: 5px;
  140. padding: 10px;
  141. display: flex;
  142. justify-content: space-between;
  143. >.left {
  144. width: calc(50vw - 15px);
  145. height: 40vw;
  146. image {
  147. width: 100%;
  148. height: 100%;
  149. }
  150. }
  151. >.right {
  152. width: calc(50vw - 15px);
  153. height: 40vw;
  154. display: flex;
  155. flex-direction: column;
  156. justify-content: space-between;
  157. align-items: center;
  158. image {
  159. width: 100%;
  160. height: calc(50% - 5px);
  161. }
  162. }
  163. }
  164. .list-title {
  165. font-size: 16px;
  166. font-weight: 600;
  167. text-align: center;
  168. padding: 10px;
  169. }
  170. .list {
  171. display: grid;
  172. grid-template-columns: 1fr 1fr;
  173. grid-gap: 10px;
  174. padding: 10px;
  175. .ka {
  176. width: calc(50vw - 15px);
  177. box-shadow: 0px 2px 8px 2px rgba(0, 0, 0, 0.1);
  178. border-radius: 10px;
  179. // height: 60vw;
  180. .top {
  181. // height: 60vw;
  182. background: linear-gradient(180deg, #FAF1A7 0%, #FFE456 100%);
  183. text-align: center;
  184. display: flex;
  185. justify-content: center;
  186. image {
  187. width: 35vw;
  188. height: 50vw;
  189. }
  190. }
  191. .ka-info {
  192. padding: 10px;
  193. .ka-name {
  194. font-size: 15px;
  195. font-weight: 600;
  196. }
  197. .row {
  198. margin-top: 5px;
  199. display: flex;
  200. justify-content: space-between;
  201. .money {
  202. font-size: 16px;
  203. font-weight: 600;
  204. color: #FF2C43;
  205. }
  206. }
  207. }
  208. }
  209. }
  210. .bullet {
  211. height: 30px;
  212. line-height: 30px;
  213. padding: 0 10px;
  214. border-radius: 15px;
  215. background-color: rgba(0, 0, 0, 0.3);
  216. color: #fff;
  217. }
  218. </style>