index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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. "
  10. >
  11. <img src="https://file.rongcyl.cn/festatic/bkm/banner.png" class="w-full" style="height: 400rpx" />
  12. <div
  13. style="
  14. background: rgba(0, 0, 0, 0.85);
  15. background-image: url(https://file.rongcyl.cn/festatic/bkm/box.png);
  16. background-size: cover;
  17. "
  18. >
  19. <div class="flex justify-between">
  20. <img src="https://file.rongcyl.cn/festatic/bkm/activity.png" class="area" @click="activity" />
  21. <img
  22. src="https://file.rongcyl.cn/festatic/bkm/task.png"
  23. class="area"
  24. @click="$navigateTo('/pages/task/index')"
  25. />
  26. <img
  27. src="https://file.rongcyl.cn/festatic/bkm/invite.png"
  28. class="area"
  29. @click="$navigateTo('/pages/invite/invite')"
  30. />
  31. </div>
  32. <div class="flex justify-between m-2 co">
  33. <img src="https://file.rongcyl.cn/festatic/bkm/center.png" class="center" />
  34. <div class="clicks flex-1 overflow-scroll flex flex-nowrap">
  35. <div class="ml-2 mt-2 inline-block relative" v-for="c in couponList" :key="c.id" @click="receive(c)">
  36. <img src="https://file.rongcyl.cn/festatic/bkm/click.png" />
  37. <div class="absolute top-4 left-0 text-center right-0">
  38. <div class="bold fs12">{{ c.name }}</div>
  39. <div class="fs11 text-zinc-600">{{ c.desc }}</div>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- <img src="https://file.rongcyl.cn/festatic/bkm/more.png" class="more" /> -->
  44. </div>
  45. <div class="flex justify-between m-2">
  46. <img src="https://file.rongcyl.cn/festatic/bkm/c1.png" class="c" />
  47. <img src="https://file.rongcyl.cn/festatic/bkm/c2.png" @click="$navigateTo('/pages/vip/vip')" class="c" />
  48. <img src="https://file.rongcyl.cn/festatic/bkm/c3.png" class="c" />
  49. <img src="https://file.rongcyl.cn/festatic/bkm/c4.png" class="c" />
  50. </div>
  51. <div class="tabs">
  52. <div class="tab" :class="{ active: type == 0 }" @click="type = 0">热门</div>
  53. <div class="tab" :class="{ active: type == 5 }" @click="type = 5">FIRST赏</div>
  54. <div class="tab" :class="{ active: type == 2 }" @click="type = 2">LAST赏</div>
  55. <div class="tab" :class="{ active: type == 3 }" @click="type = 3">全套赏</div>
  56. <div class="tab" :class="{ active: type == 1 }" @click="type = 1">无限赏</div>
  57. <!-- <div class="tab" :class="{ active: type == 4 }" @click="type = 4">抽盒机</div> -->
  58. </div>
  59. <div class="cards">
  60. <div class="card relative" v-for="(item, i) in list" @click="$navigateTo('/pages/first2/index')" :key="i">
  61. <img
  62. :src="`https://file.rongcyl.cn/festatic/bkm/tags/${item.type}.png`"
  63. class="absolute top-0 left-0"
  64. style="width: 62px; height: 24px"
  65. />
  66. <img :src="item.icon" />
  67. <div class="mt-1">{{ item.name }}</div>
  68. <!-- <div class="flex justify-between" style="font-size: 13px; margin-top: 12rpx">
  69. <img src="https://file.rongcyl.cn/festatic/bkm/imgv2/raffle/tag2.png" style="height: 35rpx; width: 80rpx" />
  70. <div>
  71. <span style="font-size: 14px; margin-right: 4px; color: #fc5b20" class="bold">{{ item.totalNum }}</span>
  72. <span style="color: #666666">销量</span>
  73. </div>
  74. </div> -->
  75. <div class="flex justify-between">
  76. <div style="color: #fc5b20; margin-top: 12rpx">
  77. <span class="fs14">¥</span>
  78. <span class="bold fs16">{{ item.price }}</span>
  79. </div>
  80. <div v-if="item.subType">
  81. <div class="tag" v-if="item.subType.includes('110')">欧王</div>
  82. <div class="tag" v-if="item.subType.includes('120')">连击</div>
  83. <div class="tag" v-if="item.subType.includes('112')">免单</div>
  84. </div>
  85. <div
  86. style="margin-top: 12rpx; color: #a79e9e; font-size: 12px"
  87. v-if="!item.subType && (type == 5 || type == 2)"
  88. >
  89. 剩余 {{ item.balaceNum }}/ {{ item.totalNum }}
  90. </div>
  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. import { couponCenter, couponReceive } from '@/api/coupon'
  129. export default {
  130. data() {
  131. return {
  132. list: [],
  133. type: 0,
  134. couponList: [],
  135. }
  136. },
  137. created() {
  138. this.getList()
  139. this.getCouponList()
  140. },
  141. watch: {
  142. type() {
  143. this.getList()
  144. },
  145. },
  146. methods: {
  147. activity() {
  148. wx.showToast({
  149. title: '敬请期待',
  150. icon: 'none',
  151. })
  152. },
  153. receive(item) {
  154. if (item.status == 1) return
  155. couponReceive({ couponId: item.id }).then(res => {
  156. wx.showToast({
  157. title: '领取成功',
  158. icon: 'none',
  159. })
  160. this.getCouponList()
  161. })
  162. },
  163. getCouponList() {
  164. couponCenter().then(res => {
  165. this.couponList = res.data
  166. })
  167. },
  168. getList() {
  169. let params = {
  170. limit: 999,
  171. page: 1,
  172. type: this.type || '',
  173. isHot: this.type == 0,
  174. }
  175. raffleListApi(params).then(res => {
  176. let list = res.data.list
  177. for (var i = 0; i < list.length; i++) {
  178. if (list[i].subType) {
  179. list[i].subType = list[i].subType.split(',')
  180. }
  181. }
  182. this.list = list
  183. })
  184. },
  185. },
  186. }
  187. </script>
  188. <style scoped lang="scss">
  189. .area {
  190. width: 168px;
  191. height: 88px;
  192. }
  193. .c {
  194. width: 82px;
  195. height: 47px;
  196. }
  197. .center {
  198. width: 38px;
  199. height: 98px;
  200. }
  201. .clicks {
  202. height: 98px;
  203. background-image: linear-gradient(to bottom, #ffaea6, #ff654c);
  204. img {
  205. height: 82px;
  206. width: 82px;
  207. }
  208. }
  209. .tag {
  210. border-radius: 3px;
  211. margin-top: 12rpx;
  212. height: 20px;
  213. line-height: 20px;
  214. text-align: center;
  215. background: #fc5b20;
  216. color: #fff;
  217. padding: 0 8rpx;
  218. font-size: 13px;
  219. display: inline-block;
  220. margin-left: 10px;
  221. }
  222. .more {
  223. width: 28px;
  224. height: 98px;
  225. }
  226. .p {
  227. position: fixed;
  228. bottom: 120px;
  229. right: 20px;
  230. img {
  231. width: 50px;
  232. height: 50px;
  233. }
  234. }
  235. .tabs {
  236. display: flex;
  237. justify-content: space-around;
  238. .tab {
  239. font-size: 16px;
  240. font-weight: 400;
  241. color: #fff;
  242. padding: 10px 0;
  243. &.active {
  244. font-weight: 600;
  245. border-bottom: 2px solid #fc5b20;
  246. color: #fc5b20;
  247. }
  248. }
  249. }
  250. .cards {
  251. margin-top: 20px;
  252. display: flex;
  253. justify-content: space-between;
  254. padding: 0 20rpx;
  255. flex-wrap: wrap;
  256. .card {
  257. box-sizing: border-box;
  258. width: 344rpx;
  259. // height: 500rpx;
  260. background: #fff;
  261. border-radius: 10px;
  262. margin-bottom: 20rpx;
  263. padding: 20rpx;
  264. padding-bottom: 12rpx;
  265. img {
  266. width: 308rpx;
  267. height: 308rpx;
  268. border-radius: 8px;
  269. }
  270. }
  271. }
  272. </style>