index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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/clicked.png" v-if="c.status == 1" />
  37. <img src="https://file.rongcyl.cn/festatic/bkm/click.png" v-if="c.status == 0" />
  38. <div class="absolute top-4 left-0 text-center right-0">
  39. <div class="bold fs12">{{ c.name }}</div>
  40. <div class="fs11 text-zinc-600">{{ c.desc }}</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" @click="$navigateTo('/pages/vip/vip')" 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
  68. :src="`https://file.rongcyl.cn/festatic/bkm/tags/tag1.png`"
  69. class="absolute top-0 right-0"
  70. style="width: 88rpx; height: 88rpx"
  71. v-if="item.subType && item.subType.includes('110')"
  72. />
  73. <img
  74. :src="`https://file.rongcyl.cn/festatic/bkm/tags/tag2.png`"
  75. class="absolute top-0 right-0"
  76. style="width: 88rpx; height: 88rpx"
  77. v-if="item.subType && item.subType.includes('120')"
  78. />
  79. <img
  80. :src="`https://file.rongcyl.cn/festatic/bkm/tags/tag3.png`"
  81. class="absolute top-0 right-0"
  82. style="width: 88rpx; height: 88rpx"
  83. v-if="item.subType && item.subType.includes('112')"
  84. />
  85. <img :src="item.icon" />
  86. <div class="mt-1">{{ item.name }}</div>
  87. <!-- <div class="flex justify-between" style="font-size: 13px; margin-top: 12rpx">
  88. <img src="https://file.rongcyl.cn/festatic/bkm/imgv2/raffle/tag2.png" style="height: 35rpx; width: 80rpx" />
  89. <div>
  90. <span style="font-size: 14px; margin-right: 4px; color: #fc5b20" class="bold">{{ item.totalNum }}</span>
  91. <span style="color: #666666">销量</span>
  92. </div>
  93. </div> -->
  94. <div class="flex justify-between">
  95. <div style="color: #fc5b20; margin-top: 12rpx">
  96. <span class="fs14">¥</span>
  97. <span class="bold fs16">{{ item.price }}</span>
  98. </div>
  99. <!-- <div v-if="item.subType">
  100. <div class="tag" v-if="item.subType.includes('110')">欧王</div>
  101. <div class="tag" v-if="item.subType.includes('120')">连击</div>
  102. <div class="tag" v-if="item.subType.includes('112')">免单</div>
  103. </div> -->
  104. <div
  105. style="margin-top: 12rpx; color: #a79e9e; font-size: 12px"
  106. v-if="!item.subType && (item.type == 5 || item.type == 2)"
  107. >
  108. 剩余 {{ item.balaceNum }}/ {{ item.totalNum }}
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="p" @click="$navigateTo('/pages/integralRecord/integralRecord')">
  114. <img src="https://file.rongcyl.cn/festatic/bkm/p.png" />
  115. <div class="absolute text-white bottom-2 fs11 text-center left-0 right-0">{{ userInfo.integral }}</div>
  116. </div>
  117. </div>
  118. <!-- <div
  119. class="fixed left-0 right-0 bottom-0 pb-1 bg-black flex justify-around items-center fs13"
  120. style="color: #b4c9da; height: 80px"
  121. >
  122. <div class="text-center">
  123. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/home_a.png" class="w-7 h-7" />
  124. <div style="color: #fc5b20">首页</div>
  125. </div>
  126. <div class="text-center">
  127. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/shop.png" class="w-7 h-7" />
  128. <div>商城</div>
  129. </div>
  130. <div class="text-center">
  131. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/cc.png" class="w-8 h-8" />
  132. <div>抽卡机</div>
  133. </div>
  134. <div class="text-center">
  135. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/bag.png" class="w-7 h-7" />
  136. <div>背包</div>
  137. </div>
  138. <div class="text-center">
  139. <img src="https://file.rongcyl.cn/festatic/bkm/index2tabs/mine.png" class="w-7 h-7" />
  140. <div>我的</div>
  141. </div>
  142. </div> -->
  143. </div>
  144. </template>
  145. <script>
  146. import { raffleListApi } from '@/api/drawCard'
  147. import { couponCenter, couponReceive } from '@/api/coupon'
  148. import { userInfoApi } from '@/api/user.js'
  149. export default {
  150. data() {
  151. return {
  152. list: [],
  153. type: 0,
  154. couponList: [],
  155. userInfo: {},
  156. }
  157. },
  158. created() {
  159. this.getList()
  160. this.getCouponList()
  161. if (wx.getStorageSync('token')) {
  162. userInfoApi().then(res => {
  163. this.userInfo = res.data
  164. })
  165. }
  166. },
  167. watch: {
  168. type() {
  169. this.getList()
  170. },
  171. },
  172. methods: {
  173. activity() {
  174. wx.showToast({
  175. title: '敬请期待',
  176. icon: 'none',
  177. })
  178. },
  179. receive(item) {
  180. if (item.status == 1) return
  181. couponReceive({ couponId: item.id }).then(res => {
  182. wx.showToast({
  183. title: '领取成功',
  184. icon: 'none',
  185. })
  186. this.getCouponList()
  187. })
  188. },
  189. getCouponList() {
  190. couponCenter().then(res => {
  191. this.couponList = res.data
  192. })
  193. },
  194. getList() {
  195. let params = {
  196. limit: 999,
  197. page: 1,
  198. type: this.type || '',
  199. isHot: this.type == 0,
  200. }
  201. raffleListApi(params).then(res => {
  202. let list = res.data.list
  203. for (var i = 0; i < list.length; i++) {
  204. if (list[i].subType) {
  205. list[i].subType = list[i].subType.split(',')
  206. }
  207. }
  208. this.list = list
  209. })
  210. },
  211. },
  212. }
  213. </script>
  214. <style scoped lang="scss">
  215. .area {
  216. width: 168px;
  217. height: 88px;
  218. }
  219. .c {
  220. width: 82px;
  221. height: 47px;
  222. }
  223. .center {
  224. width: 38px;
  225. height: 98px;
  226. }
  227. .clicks {
  228. height: 98px;
  229. background-image: linear-gradient(to bottom, #ffaea6, #ff654c);
  230. img {
  231. height: 82px;
  232. width: 82px;
  233. }
  234. }
  235. .tag {
  236. border-radius: 3px;
  237. margin-top: 12rpx;
  238. height: 20px;
  239. line-height: 20px;
  240. text-align: center;
  241. background: #fc5b20;
  242. color: #fff;
  243. padding: 0 8rpx;
  244. font-size: 13px;
  245. display: inline-block;
  246. margin-left: 10px;
  247. }
  248. .more {
  249. width: 28px;
  250. height: 98px;
  251. }
  252. .p {
  253. position: fixed;
  254. bottom: 120px;
  255. right: 20px;
  256. img {
  257. width: 50px;
  258. height: 50px;
  259. }
  260. }
  261. .tabs {
  262. display: flex;
  263. justify-content: space-around;
  264. .tab {
  265. font-size: 16px;
  266. font-weight: 400;
  267. color: #fff;
  268. padding: 10px 0;
  269. &.active {
  270. font-weight: 600;
  271. border-bottom: 2px solid #fc5b20;
  272. color: #fc5b20;
  273. }
  274. }
  275. }
  276. .cards {
  277. margin-top: 20px;
  278. display: flex;
  279. justify-content: space-between;
  280. padding: 0 20rpx;
  281. flex-wrap: wrap;
  282. .card {
  283. box-sizing: border-box;
  284. width: 344rpx;
  285. // height: 500rpx;
  286. background: #fff;
  287. border-radius: 10px;
  288. margin-bottom: 20rpx;
  289. padding: 20rpx;
  290. padding-bottom: 12rpx;
  291. img {
  292. width: 308rpx;
  293. height: 308rpx;
  294. border-radius: 8px;
  295. }
  296. }
  297. }
  298. </style>