index --lod.vue 4.9 KB

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