index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template style="background-color: red">
  2. <div
  3. style="
  4. background-image: url(https://file.rongcyl.cn/festatic/bkm/bg_i.png);
  5. background-repeat: no-repeat;
  6. background-position: center center;
  7. background-size: contain;
  8. background-color: #000;
  9. padding-bottom: 80px;
  10. "
  11. >
  12. <img src="https://file.rongcyl.cn/festatic/bkm/banner.png" class="w-full" style="height: 400rpx" />
  13. <div
  14. style="
  15. background: rgba(0, 0, 0, 0.85);
  16. background-image: url(https://file.rongcyl.cn/festatic/bkm/box.png);
  17. background-size: cover;
  18. "
  19. >
  20. <div class="flex justify-between">
  21. <img src="https://file.rongcyl.cn/festatic/bkm/activity.png" class="area" />
  22. <img
  23. src="https://file.rongcyl.cn/festatic/bkm/task.png"
  24. class="area"
  25. @click="$navigateTo('/pages/task/index')"
  26. />
  27. <img
  28. src="https://file.rongcyl.cn/festatic/bkm/invite.png"
  29. class="area"
  30. @click="$navigateTo('/pages/invite/invite')"
  31. />
  32. </div>
  33. <div class="flex justify-between m-2 co">
  34. <img src="https://file.rongcyl.cn/festatic/bkm/center.png" class="center" />
  35. <div class="clicks flex-1 overflow-scroll flex flex-nowrap">
  36. <div class="ml-2 mt-2 inline-block relative" v-for="c in click" :key="c">
  37. <img src="https://file.rongcyl.cn/festatic/bkm/click.png" />
  38. <div class="absolute top-4 left-0 text-center right-0">
  39. <div class="bold fs12">闯关9-2</div>
  40. <div class="fs11 text-zinc-600">闯关9-2</div>
  41. </div>
  42. </div>
  43. </div>
  44. <img src="https://file.rongcyl.cn/festatic/bkm/more.png" class="more" />
  45. </div>
  46. <div class="flex justify-between m-2">
  47. <img src="https://file.rongcyl.cn/festatic/bkm/c1.png" class="c" />
  48. <img src="https://file.rongcyl.cn/festatic/bkm/c2.png" class="c" />
  49. <img src="https://file.rongcyl.cn/festatic/bkm/c3.png" class="c" />
  50. <img src="https://file.rongcyl.cn/festatic/bkm/c4.png" class="c" />
  51. </div>
  52. <div class="tabs">
  53. <div class="tab" :class="{ active: type == 0 }" @click="type = 0">全部</div>
  54. <div class="tab" :class="{ active: type == 5 }" @click="type = 5">FIRST赏</div>
  55. <div class="tab" :class="{ active: type == 2 }" @click="type = 2">LAST赏</div>
  56. <div class="tab" :class="{ active: type == 3 }" @click="type = 3">全套赏</div>
  57. <div class="tab" :class="{ active: type == 1 }" @click="type = 1">无限赏</div>
  58. <!-- <div class="tab" :class="{ active: type == 4 }" @click="type = 4">抽盒机</div> -->
  59. </div>
  60. <div class="cards">
  61. <div class="card relative" v-for="(item, i) in list" @click="$navigateTo('/pages/first2/index')" :key="i">
  62. <img
  63. :src="`https://file.rongcyl.cn/festatic/bkm/tags/${item.type}.png`"
  64. class="absolute top-0 left-0"
  65. style="width: 62px; height: 24px"
  66. />
  67. <img :src="item.icon" />
  68. <div class="mt-1">{{ item.name }}</div>
  69. <div class="flex justify-between" style="font-size: 13px; margin-top: 12rpx">
  70. <div
  71. style="
  72. border-radius: 3px;
  73. height: 20px;
  74. line-height: 20px;
  75. text-align: center;
  76. background: #fc5b20;
  77. color: #fff;
  78. padding: 0 8rpx;
  79. "
  80. >
  81. 创意热销
  82. </div>
  83. <div>
  84. <span style="font-size: 14px; margin-right: 4px; color: #fc5b20" class="bold">{{ item.totalNum }}</span>
  85. <span style="color: #666666">销量</span>
  86. </div>
  87. </div>
  88. <div style="color: #fc5b20; margin-top: 12rpx">
  89. <span class="fs14">¥</span>
  90. <span class="bold fs16">{{ item.price }}</span>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="p">
  95. <img src="https://file.rongcyl.cn/festatic/bkm/p.png" />
  96. <div class="absolute text-white bottom-2 fs11 text-center left-0 right-0">3333</div>
  97. </div>
  98. </div>
  99. <div
  100. class="fixed left-0 right-0 bottom-0 pb-1 bg-black flex justify-around items-center fs13"
  101. style="color: #b4c9da; height: 80px"
  102. >
  103. <div class="text-center">
  104. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/home_a.png" class="w-7 h-7" />
  105. <div style="color: #fc5b20">首页</div>
  106. </div>
  107. <div class="text-center">
  108. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/shop.png" class="w-7 h-7" />
  109. <div>商城</div>
  110. </div>
  111. <div class="text-center">
  112. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/cc.png" class="w-8 h-8" />
  113. <div>抽卡机</div>
  114. </div>
  115. <div class="text-center">
  116. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/bag.png" class="w-7 h-7" />
  117. <div>背包</div>
  118. </div>
  119. <div class="text-center">
  120. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/mine.png" class="w-7 h-7" />
  121. <div>我的</div>
  122. </div>
  123. </div>
  124. </div>
  125. </template>
  126. <script>
  127. import { raffleListApi } from '@/api/drawCard'
  128. export default {
  129. data() {
  130. return {
  131. click: 6,
  132. list: [],
  133. type: 0,
  134. }
  135. },
  136. created() {
  137. this.getList()
  138. },
  139. watch: {
  140. type() {
  141. this.getList()
  142. },
  143. },
  144. methods: {
  145. getList() {
  146. let params = {
  147. limit: 999,
  148. page: 1,
  149. type: this.type || '',
  150. }
  151. raffleListApi(params).then(res => {
  152. let list = res.data.list
  153. for (var i = 0; i < list.length; i++) {
  154. if (list[i].subType) {
  155. list[i].subType = list[i].subType.split(',')
  156. }
  157. }
  158. this.list = list
  159. })
  160. },
  161. },
  162. }
  163. </script>
  164. <style scoped lang="scss">
  165. .area {
  166. width: 168px;
  167. height: 88px;
  168. }
  169. .c {
  170. width: 82px;
  171. height: 47px;
  172. }
  173. .center {
  174. width: 38px;
  175. height: 98px;
  176. }
  177. .clicks {
  178. height: 98px;
  179. background-image: linear-gradient(to bottom, #ffaea6, #ff654c);
  180. img {
  181. height: 82px;
  182. width: 82px;
  183. }
  184. }
  185. .more {
  186. width: 28px;
  187. height: 98px;
  188. }
  189. .p {
  190. position: fixed;
  191. bottom: 120px;
  192. right: 20px;
  193. img {
  194. width: 50px;
  195. height: 50px;
  196. }
  197. }
  198. .tabs {
  199. display: flex;
  200. justify-content: space-around;
  201. .tab {
  202. font-size: 16px;
  203. font-weight: 400;
  204. color: #fff;
  205. padding: 10px 0;
  206. &.active {
  207. font-weight: 600;
  208. border-bottom: 2px solid #fc5b20;
  209. color: #fc5b20;
  210. }
  211. }
  212. }
  213. .cards {
  214. margin-top: 20px;
  215. display: flex;
  216. justify-content: space-between;
  217. padding: 0 20rpx;
  218. flex-wrap: wrap;
  219. .card {
  220. box-sizing: border-box;
  221. width: 344rpx;
  222. // height: 500rpx;
  223. background: #fff;
  224. border-radius: 10px;
  225. margin-bottom: 20rpx;
  226. padding: 20rpx;
  227. padding-bottom: 12rpx;
  228. img {
  229. width: 308rpx;
  230. height: 308rpx;
  231. border-radius: 8px;
  232. }
  233. }
  234. }
  235. </style>