drawCard_last.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925
  1. <template style="background-color: red">
  2. <div
  3. style="
  4. height: 100vh;
  5. background: linear-gradient(216deg, #fe854c 0%, #ff9a5a 100%);
  6. box-sizing: border-box;
  7. overflow: scroll;
  8. "
  9. >
  10. <div
  11. class="first2"
  12. :style="{
  13. background: 'url(https://file.rongcyl.cn/festatic/bkm/first2/bg.png)',
  14. height: 'calc(100vh - 160rpx)',
  15. 'background-repeat': 'no-repeat',
  16. 'background-position': 'center center',
  17. 'background-size': '100% 100%',
  18. 'box-sizing': 'border-box',
  19. overflow: 'scroll',
  20. 'padding-bottom': '160rpx',
  21. }"
  22. >
  23. <PageTitle color="#fff" title="LAST赏详情" />
  24. <div class="card relative">
  25. <div class="flex pt-3 px-3">
  26. <image :src="detail.icon" style="width: 168rpx; height: 169rpx; border-radius: 16rpx" mode="aspectFill" />
  27. <div class="flex-1 pl-2">
  28. <div style="font-weight: 900; height: 42rpx">{{ detail.name || '' }}</div>
  29. <div class="flex justify-between">
  30. <div>
  31. <span class="bold" style="color: #ff2c43; font-size: 24rpx">¥</span>
  32. <span class="bold" style="color: #ff2c43; font-size: 38rpx">
  33. {{ priceLeft }}
  34. </span>
  35. <span class="bold" style="color: #ff2c43; font-size: 28rpx">.{{ priceRight }}</span>
  36. <span style="color: #4e504f; font-size: 28rpx">/张明信片</span>
  37. </div>
  38. <div class="pt-2">
  39. <img
  40. @click="$navigateTo('/pages/rule/rule', { type: 5 })"
  41. src="https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/first2/rule.png"
  42. style="width: 134rpx; height: 48rpx"
  43. />
  44. </div>
  45. </div>
  46. <div class="flex justify-between" style="margin-top: 10rpx">
  47. <div>
  48. <img
  49. src="https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/item.png"
  50. style="
  51. width: 40rpx;
  52. height: 40rpx;
  53. border-radius: 50%;
  54. display: inline-block;
  55. border: 2rpx solid #fff;
  56. "
  57. />
  58. <img
  59. src="https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/item.png"
  60. class="relative right-2"
  61. style="
  62. width: 40rpx;
  63. height: 40rpx;
  64. border-radius: 50%;
  65. display: inline-block;
  66. border: 2rpx solid #fff;
  67. "
  68. />
  69. <img
  70. src="https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/item.png"
  71. class="relative right-4"
  72. style="
  73. width: 40rpx;
  74. height: 40rpx;
  75. border-radius: 50%;
  76. display: inline-block;
  77. border: 2rpx solid #fff;
  78. "
  79. />
  80. <img
  81. src="https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/item.png"
  82. class="relative right-6"
  83. style="
  84. width: 40rpx;
  85. height: 40rpx;
  86. border-radius: 50%;
  87. display: inline-block;
  88. border: 2rpx solid #fff;
  89. "
  90. />
  91. <img
  92. src="https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/item.png"
  93. class="relative right-8"
  94. style="
  95. width: 40rpx;
  96. height: 40rpx;
  97. border-radius: 50%;
  98. display: inline-block;
  99. border: 2rpx solid #fff;
  100. "
  101. />
  102. </div>
  103. <div class="flex items-center">
  104. <img
  105. src="https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/first2/hot.png"
  106. class="relative right-2"
  107. style="width: 32rpx; height: 32rpx; display: inline-block"
  108. />
  109. <span style="color: #fc5b20" class="fs11">{{ detail.hotNum }}</span>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <div
  115. class="absolute left-0 right-0 bottom-6 mx-auto"
  116. style="
  117. width: 670rpx;
  118. height: 128rpx;
  119. background: url(https://fudaanfang.oss-cn-hangzhou.aliyuncs.com/festatic/bkm/first2/notice_c.png) no-repeat
  120. center center;
  121. background-size: cover;
  122. "
  123. >
  124. <view
  125. class="absolute top-1 left-2"
  126. style="width: 120rpx; height: 28rpx; font-size: 24rpx; font-weight: 600; color: #e1ff13"
  127. >
  128. {{ lockData.userId ? '锁箱倒计时' : '锁箱说明' }}
  129. </view>
  130. <div class="text-white fs12 mt-5 px-2 pt-1 lockBox">
  131. <view class="text" v-if="!lockData.userId">
  132. <p>本福袋连续购买10发,即开启5分钟保护机制</p>
  133. <p>锁箱后,每抽一发加10秒</p>
  134. </view>
  135. <view class="info" v-else>
  136. <image class="photo" :src="lockData.userAvtar" mode="aspectFill"></image>
  137. <view class="right">
  138. <view class="row">
  139. <view class="name">{{ lockData.userName }}</view>
  140. <view class="">
  141. <!-- 保护倒计时: -->
  142. <span v-if="lockHour != '00'">
  143. <span class="time">{{ lockHour }}</span>
  144. :
  145. </span>
  146. <span>
  147. <span class="time">{{ lockMin }}</span>
  148. :
  149. </span>
  150. <span>
  151. <span class="time">{{ lockSecond }}</span>
  152. </span>
  153. </view>
  154. </view>
  155. <!-- <view class="row">
  156. <view class="tip">目前已开启自动保护机制</view>
  157. </view> -->
  158. </view>
  159. </view>
  160. </div>
  161. </div>
  162. <div
  163. class="absolute left-0 right-0 bottom-1 mx-auto"
  164. style="
  165. width: 690rpx;
  166. height: 24rpx;
  167. background: #4f5150;
  168. box-shadow: inset 0rpx 8rpx 8rpx 0rpx rgba(0, 0, 0, 0.8);
  169. border-radius: 44rpx 44rpx 44rpx 44rpx;
  170. opacity: 1;
  171. "
  172. >
  173. <div
  174. class="absolute top-1 mx-auto"
  175. style="
  176. left: 10rpx;
  177. right: 10rpx;
  178. width: 670rpx;
  179. min-height: 890rpx;
  180. background: linear-gradient(180deg, #ccd3d9 0%, #ffffff 5%);
  181. border-radius: 0rpx 0rpx 0rpx 0rpx;
  182. opacity: 1;
  183. "
  184. >
  185. <div class="flex justify-around" style="margin: 20rpx 0">
  186. <img
  187. src="https://file.rongcyl.cn/festatic/bkm/first2/tab1.png"
  188. v-if="tabIndex !== 1"
  189. @click="tabIndex = 1"
  190. style="width: 126rpx; height: 32rpx"
  191. />
  192. <img
  193. v-if="tabIndex == 1"
  194. src="https://file.rongcyl.cn/festatic/bkm/first2/tab1a.png"
  195. @click="tabIndex = 1"
  196. style="width: 126rpx; height: 32rpx"
  197. />
  198. <img
  199. v-if="tabIndex !== 2"
  200. src="https://file.rongcyl.cn/festatic/bkm/first2/tab2.png"
  201. @click="tabIndex = 2"
  202. style="width: 126rpx; height: 32rpx"
  203. />
  204. <img
  205. v-if="tabIndex == 2"
  206. src="https://file.rongcyl.cn/festatic/bkm/first2/tab2a.png"
  207. @click="tabIndex = 2"
  208. style="width: 126rpx; height: 32rpx"
  209. />
  210. <img
  211. v-if="tabIndex != 3"
  212. src="https://file.rongcyl.cn/festatic/bkm/first2/tab3.png"
  213. @click="tabIndex = 3"
  214. style="width: 126rpx; height: 32rpx"
  215. />
  216. <img
  217. v-if="tabIndex == 3"
  218. src="https://file.rongcyl.cn/festatic/bkm/first2/tab3a.png"
  219. @click="tabIndex = 3"
  220. style="width: 126rpx; height: 32rpx"
  221. />
  222. </div>
  223. <div class="cardList list" style="padding: 10rpx 16rpx 20rpx 16rpx" v-if="tabIndex == 1">
  224. <div
  225. :class="['flex', 'items-center', 'justify-center', item.status == 0 ? 'c1' : 'c2']"
  226. v-for="(item, index) in cardList"
  227. @click="clickCard(item)"
  228. >
  229. <numImg v-if="item.status == 0" class="num" :value="item" :type="2" />
  230. <img
  231. v-if="item.status == 2"
  232. src="https://file.rongcyl.cn/festatic/bkm/first2/gift_a.png"
  233. style="width: 60rpx; height: 72rpx"
  234. />
  235. <img
  236. v-if="item.status == 1"
  237. src="https://file.rongcyl.cn/festatic/bkm/first2/lock.png"
  238. style="width: 60rpx; height: 60rpx"
  239. />
  240. <image
  241. v-if="item.check"
  242. class="checkBk"
  243. src="https://file.rongcyl.cn/festatic/bkm/imgv2/first/cardCheck.png"
  244. mode="widthFix"
  245. ></image>
  246. </div>
  247. </div>
  248. <div class="list pt-4" style="position: relative" v-if="tabIndex == 2">
  249. <div v-for="(item, index) in prizeList" :key="index">
  250. <div class="titleTip">概率:{{ item.probability }}%(此概率为当前赏级概率)</div>
  251. <Title :title="$selectDictLabel(rewardType, item.type).split('赏')[0]" />
  252. <div class="flex pl-3 pt-3 mb-3" style="background-color: #f6f0e9">
  253. <div
  254. v-for="(item2, index2) in item.prizeList"
  255. @click="showImg(item2)"
  256. :class="['mr-2', item2.leftNum == 0 ? 'grey' : '']"
  257. style="width: 168rpx; background-color: #f9f6f2; border-radius: 8rpx; margin-bottom: 20rpx"
  258. >
  259. <image
  260. :src="item2.icon"
  261. mode="aspectFill"
  262. style="width: 144rpx; height: 144rpx; border-radius: 10rpx; margin: auto"
  263. />
  264. <div class="fs13 pl-2 prizeName">{{ item2.name }}</div>
  265. <div style="color: #ea6636" class="pl-2">
  266. <span class="fs11">参考价</span>
  267. <span class="fs14 bold">{{ detail.price }}</span>
  268. </div>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. <div class="list winningRecord" style="padding: 20rpx 0" v-if="tabIndex == 3">
  274. <view class="winningRecordCard" v-for="(item, index) in winningRecordList" :key="index">
  275. <image class="photo" :src="item.userAvtar" mode="aspectFill"></image>
  276. <view style="flex: 1">
  277. <view class="row">
  278. <view class="left">
  279. <span class="name">{{ item.userName }}</span>
  280. </view>
  281. <view class="right text1" style="flex: initial">
  282. <span>{{ item.creatTime }}</span>
  283. </view>
  284. </view>
  285. <view class="row" style="margin-top: 20rpx">
  286. <view class="left">
  287. <image class="img" :src="item.prizeIcon" mode="aspectFill"></image>
  288. </view>
  289. <view class="right" style="font-size: 28rpx">
  290. <view class="name">{{ item.prizeName }}</view>
  291. <view class="row">
  292. <view class="type">{{ $selectDictLabel(rewardType, item.prizeType) }} × 1</view>
  293. <span style="font-size: 24rpx">No.{{ item.id }}</span>
  294. </view>
  295. </view>
  296. </view>
  297. </view>
  298. </view>
  299. </div>
  300. <img
  301. src="https://file.rongcyl.cn/festatic/bkm/first2/dots.png"
  302. class="absolute mx-auto inline-block left-0 right-0"
  303. style="width: 612rpx; height: 24rpx; bottom: -12rpx"
  304. />
  305. </div>
  306. </div>
  307. </div>
  308. <div class="fixed right-2 bottom-20" style="height: 460rpx">
  309. <img
  310. v-if="detail.resultUrl"
  311. @click="toDloadFilePopup(detail.resultUrl)"
  312. src="https://file.rongcyl.cn/festatic/bkm/first2/fu.png"
  313. style="width: 88rpx; height: 88rpx; margin-bottom: 24rpx"
  314. />
  315. <img
  316. @click="toKnapsack"
  317. src="https://file.rongcyl.cn/festatic/bkm/first2/bag.png"
  318. style="width: 88rpx; height: 88rpx; margin-bottom: 24rpx"
  319. />
  320. <img
  321. @click="refresh"
  322. src="https://file.rongcyl.cn/festatic/bkm/first2/refresh.png"
  323. style="width: 88rpx; height: 88rpx; margin-bottom: 24rpx"
  324. />
  325. <button open-type="share" class="share_btn">
  326. <img
  327. src="https://file.rongcyl.cn/festatic/bkm/first2/share.png"
  328. style="width: 88rpx; height: 88rpx; margin-bottom: 24rpx"
  329. />
  330. </button>
  331. </div>
  332. <div class="buy items-center">
  333. <div class="pica ml-2" style="margin-top: -38rpx">
  334. <img src="https://file.rongcyl.cn/festatic/bkm/first2/pica.png" class="w-full h-full" />
  335. </div>
  336. <div class="flex-1 text-white fs12 ml12 relative bottom-3 pl-3">
  337. <span class="inline-block">已选{{ selectIndex.length }}个 合计:</span>
  338. <span class="inline-block" style="color: #ea6636">
  339. <span class="bold">¥</span>
  340. <span class="fs18 bold">{{ (selectIndex.length * detail.price).toFixed(2) }}</span>
  341. </span>
  342. </div>
  343. <img
  344. @click="submit"
  345. src="https://file.rongcyl.cn/festatic/bkm/first2/bug.png"
  346. class="b_btn relative bottom-3 right-2"
  347. />
  348. </div>
  349. </div>
  350. <paymentPopup ref="paymentPopup" @callBack="paymentSuccess" />
  351. <imgPopup ref="imgPopup" />
  352. </div>
  353. </template>
  354. <script>
  355. import imgPopup from '@/component/imgPopup.vue'
  356. import { rewardType } from '@/utils/commonConfig.js'
  357. import {
  358. prizePoolStatusApi,
  359. drawCardSubmitApi,
  360. raffleDetailApi,
  361. prizeListApi,
  362. prizeUserListApi,
  363. getLockInfoApi,
  364. } from '@/api/drawCard.js'
  365. import { cardType, formatSeconds, toDloadFilePopup } from '@/utils/utils.js'
  366. import numImg from '@/component/numImg.vue'
  367. import paymentPopup from '@/component/paymentPopup.vue'
  368. import Title from '@/component/title.vue'
  369. import PageTitle from '@/component/pageTitle.vue'
  370. const { v4: uuidv4 } = require('uuid')
  371. export default {
  372. data() {
  373. return {
  374. toDloadFilePopup: toDloadFilePopup,
  375. rewardType: rewardType,
  376. safeAreaTop: '0rpx',
  377. tabIndex: 1,
  378. params: {
  379. raffleId: '',
  380. limit: 999,
  381. page: 1,
  382. },
  383. detail: {},
  384. cardList: [],
  385. selectIndex: [],
  386. prizeList: [],
  387. winningRecordList: [],
  388. userId: wx.getStorageSync('userId'),
  389. uuid: '',
  390. socketTimer: null,
  391. lockTimeCountdown: null,
  392. lockData: null,
  393. lockTime: '',
  394. }
  395. },
  396. components: {
  397. Title,
  398. PageTitle,
  399. imgPopup,
  400. paymentPopup,
  401. numImg,
  402. },
  403. computed: {
  404. priceLeft() {
  405. let num = 0
  406. if (this.detail.price) {
  407. num = ('' + this.detail.price).split('.')[0]
  408. }
  409. return num
  410. },
  411. priceRight() {
  412. let num = 0
  413. if (this.detail.price) {
  414. num = ('' + this.detail.price).split('.')[1]
  415. }
  416. return num
  417. },
  418. // 锁箱小时
  419. lockHour() {
  420. let tiem = this.lockTime * 1000
  421. let timeText = formatSeconds(tiem)
  422. timeText = timeText.split(':')[0]
  423. return timeText
  424. },
  425. // 锁箱分钟
  426. lockMin() {
  427. let tiem = this.lockTime * 1000
  428. let timeText = formatSeconds(tiem)
  429. timeText = timeText.split(':')[1]
  430. return timeText
  431. },
  432. // 锁箱秒
  433. lockSecond() {
  434. let tiem = this.lockTime * 1000
  435. let timeText = formatSeconds(tiem)
  436. timeText = timeText.split(':')[2]
  437. return timeText
  438. },
  439. },
  440. onLoad(query) {
  441. console.log(query, 'query')
  442. if (query.id) {
  443. this.params.raffleId = query.id
  444. this.init()
  445. }
  446. this.paymentSuccess()
  447. },
  448. mounted() {
  449. this.getSafeAreaTop()
  450. },
  451. methods: {
  452. init() {
  453. // 获取卡牌商品列表
  454. this.getCardList()
  455. // 获取卡包详情
  456. this.getDetail()
  457. //获取奖池
  458. this.getPrizeList()
  459. // 中奖记录
  460. this.getPrizeUserList()
  461. // 初始化锁箱
  462. this.initLock()
  463. // 连接锁箱Socket
  464. this.connectSocket()
  465. },
  466. leave() {
  467. console.log('离开页面')
  468. // 离开页面
  469. // 关闭倒计时
  470. clearInterval(this.lockTimeCountdown)
  471. // 关闭心跳测试
  472. clearInterval(this.socketTimer)
  473. // 关闭对话连接
  474. wx.closeSocket()
  475. },
  476. initLock() {
  477. // 获取锁箱信息
  478. let _this = this
  479. let params = {
  480. raffleId: this.params.raffleId,
  481. }
  482. getLockInfoApi(params).then(res => {
  483. console.log(res, '锁箱')
  484. if (res.data.userId) {
  485. _this.lockData = res.data
  486. _this.lockTime = res.data.expireTime
  487. _this.initLockTimeCountdown()
  488. } else {
  489. _this.lockData = {}
  490. _this.lockTime = ''
  491. }
  492. })
  493. },
  494. initLockTimeCountdown() {
  495. let _this = this
  496. if (_this.lockTimeCountdown) {
  497. clearInterval(_this.lockTimeCountdown)
  498. _this.lockTimeCountdown = null
  499. }
  500. _this.lockTimeCountdown = setInterval(() => {
  501. console.log('22')
  502. _this.lockTime = _this.lockTime - 1
  503. if (_this.lockTime <= 0) {
  504. clearInterval(_this.lockTimeCountdown)
  505. _this.lockTimeCountdown = null
  506. _this.initLock()
  507. }
  508. }, 1000)
  509. },
  510. connectSocket() {
  511. let _this = this
  512. let uuid = uuidv4()
  513. let url = 'wss://mall.rongtongh.cn/websocket/raffleId' + this.params.raffleId + ':' + uuid
  514. function connect() {
  515. wx.connectSocket({
  516. url: url,
  517. })
  518. wx.onSocketOpen(function (res) {
  519. console.log(res, 'WebSocket连接已打开!')
  520. // wx.sendSocketMessage({
  521. // data: JSON.stringify(user),
  522. // })
  523. _this.socketTimer = setInterval(function () {
  524. console.log('发送消息')
  525. wx.sendSocketMessage({
  526. data: '12313',
  527. })
  528. }, 30 * 1000)
  529. })
  530. wx.onSocketMessage(function (res) {
  531. console.log(data, 'WebSocket接受信息')
  532. let data = JSON.parse(res.data)
  533. if (res.data.userId) {
  534. _this.lockData = data
  535. _this.lockTime = data.expireTime
  536. _this.initLockTimeCountdown()
  537. }
  538. })
  539. wx.onSocketClose(function (res) {
  540. console.log('WebSocket连接已关闭!')
  541. setTimeout(() => {
  542. console.log('re connect')
  543. // connect()
  544. }, 2000)
  545. })
  546. }
  547. connect()
  548. },
  549. toKnapsack() {
  550. // 跳转背包界面
  551. wx.navigateTo({
  552. url: '/pages/knapsack/knapsack',
  553. })
  554. },
  555. showImg(value) {
  556. this.$refs.imgPopup.show(value)
  557. },
  558. getPrizeUserList() {
  559. let params = {
  560. limit: 9999,
  561. page: 1,
  562. raffleId: this.params.raffleId,
  563. }
  564. prizeUserListApi(params).then(res => {
  565. this.winningRecordList = res.data
  566. })
  567. },
  568. getCardList() {
  569. prizePoolStatusApi(this.params).then(res => {
  570. console.log(res, '卡牌分页')
  571. for (var i = 0; i < res.data.list.length; i++) {
  572. res.data.list[i].check = false
  573. }
  574. this.cardList = res.data.list
  575. this.selectFormat()
  576. })
  577. },
  578. // 标记已经选中卡牌
  579. selectFormat() {
  580. for (var i = 0; i < this.cardList.length; i++) {
  581. if (this.selectIndex.includes(this.cardList[i].number)) {
  582. this.cardList[i].check = true
  583. }
  584. }
  585. },
  586. getDetail() {
  587. let params = {
  588. raffleId: this.params.raffleId,
  589. }
  590. raffleDetailApi(params).then(res => {
  591. console.log(res, '详情')
  592. this.detail = res.data
  593. })
  594. },
  595. getPrizeList() {
  596. let params = {
  597. raffleId: this.params.raffleId,
  598. }
  599. prizeListApi(params).then(res => {
  600. console.log(res, '奖池预览')
  601. let newArray = res.data
  602. for (var i = 0; i < res.data.length; i++) {
  603. if (res.data[i].type == 22) {
  604. newArray = []
  605. newArray.push(res.data[i])
  606. res.data.splice(i, 1)
  607. newArray.push(...res.data)
  608. break
  609. }
  610. }
  611. this.prizeList = newArray
  612. })
  613. },
  614. // 选中取消选中卡牌
  615. clickCard(item) {
  616. if (item.status == 0) {
  617. item.check = !item.check
  618. }
  619. // 如果是选中
  620. let index = this.selectIndex.indexOf(item.number)
  621. if (item.check && index == -1) {
  622. this.selectIndex.push(item.number)
  623. } else if (!item.check && index != -1) {
  624. this.selectIndex.splice(index, 1)
  625. }
  626. },
  627. // 支付成功后回调
  628. paymentSuccess() {
  629. let _this = this
  630. console.log('刷新抽卡界面')
  631. // 刷新界面
  632. _this.refresh()
  633. },
  634. getSafeAreaTop() {
  635. wx.getSystemInfo({
  636. success: res => {
  637. this.safeAreaTop = res.safeArea.top + 'px'
  638. },
  639. })
  640. },
  641. refresh() {
  642. wx.showLoading()
  643. setTimeout(function () {
  644. wx.hideLoading()
  645. }, 1000)
  646. this.init()
  647. this.selectIndex = []
  648. for (var i = 0; i < this.cardList.length; i++) {
  649. this.cardList[i].check = false
  650. }
  651. },
  652. submit() {
  653. if (this.selectIndex.length == 0) {
  654. wx.showToast({
  655. title: '请选则要购买的卡牌。',
  656. icon: 'none',
  657. })
  658. return
  659. }
  660. let params = {
  661. raffleId: this.params.raffleId,
  662. }
  663. this.$refs.paymentPopup.show(params, this.selectIndex, this.detail)
  664. },
  665. back() {
  666. wx.navigateBack({ delta: 1 })
  667. },
  668. },
  669. }
  670. </script>
  671. <style scoped lang="scss">
  672. .first2 {
  673. padding-top: v-bind(safeAreaBottom);
  674. color: v-bind(color);
  675. .card {
  676. width: 710rpx;
  677. margin: auto;
  678. background-color: #fff;
  679. border-radius: 20rpx;
  680. height: 400rpx;
  681. margin-top: 36rpx;
  682. }
  683. .c1 {
  684. background-image: url(https://file.rongcyl.cn/festatic/bkm/imgv2/ka/kabk2.png);
  685. // width: 96rpx;
  686. height: 128rpx;
  687. background-repeat: no-repeat;
  688. background-position: center center;
  689. background-size: contain;
  690. margin-bottom: 14rpx;
  691. position: relative;
  692. .checkBk {
  693. position: absolute;
  694. width: 105%;
  695. }
  696. }
  697. .c2 {
  698. background-image: url(https://file.rongcyl.cn/festatic/bkm/imgv2/ka/kabk4.png);
  699. // width: 96rpx;
  700. height: 128rpx;
  701. background-repeat: no-repeat;
  702. background-position: center center;
  703. background-size: contain;
  704. margin-bottom: 14rpx;
  705. }
  706. .buy {
  707. position: fixed;
  708. left: 0;
  709. right: 0;
  710. bottom: 0;
  711. width: 750rpx;
  712. height: 160rpx;
  713. background: #000000;
  714. opacity: 1;
  715. display: flex;
  716. .pica {
  717. width: 88rpx;
  718. height: 88rpx;
  719. }
  720. .b_btn {
  721. width: 232rpx;
  722. height: 76rpx;
  723. }
  724. }
  725. }
  726. .cardList {
  727. display: grid;
  728. grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
  729. }
  730. .list {
  731. // height: calc(100% - 32rpx - 40rpx - 40rpx);
  732. // overflow: auto;
  733. }
  734. .prizeName {
  735. width: 100%;
  736. white-space: nowrap;
  737. text-overflow: ellipsis;
  738. }
  739. .titleTip {
  740. position: absolute;
  741. z-index: 2;
  742. height: 64rpx;
  743. line-height: 84rpx;
  744. padding-left: 25vw;
  745. font-size: 24rpx;
  746. color: #fff;
  747. }
  748. .winningRecord {
  749. .winningRecordCard {
  750. margin-top: 20rpx;
  751. border-radius: 16rpx;
  752. background: #f7f0e8;
  753. padding: 20rpx;
  754. display: flex;
  755. // box-shadow: 2rpx 2rpx 6rpx #b7b7b7;
  756. .photo {
  757. // flex: 1;
  758. margin-right: 16rpx;
  759. width: 10vw;
  760. height: 10vw;
  761. border-radius: 50%;
  762. }
  763. .row {
  764. display: flex;
  765. justify-content: space-between;
  766. align-items: center;
  767. .left {
  768. display: flex;
  769. align-items: center;
  770. .name {
  771. font-size: 28rpx;
  772. font-weight: 600;
  773. }
  774. .img {
  775. width: 15vw;
  776. height: 15vw;
  777. border-radius: 4rpx;
  778. margin-right: 10rpx;
  779. }
  780. }
  781. .right {
  782. flex: 1;
  783. .name {
  784. font-size: 28rpx;
  785. height: 10vw;
  786. overflow: hidden;
  787. text-overflow: ellipsis;
  788. display: -webkit-box;
  789. -webkit-box-orient: vertical;
  790. -webkit-line-clamp: 2;
  791. }
  792. }
  793. .type {
  794. padding: 0 4rpx;
  795. background: #fc5b20;
  796. color: #fff;
  797. font-size: 22rpx;
  798. border-radius: 4rpx;
  799. }
  800. .text1 {
  801. color: #666666;
  802. font-size: 24rpx;
  803. }
  804. }
  805. }
  806. }
  807. .share_btn {
  808. background-color: transparent;
  809. border-width: 0 !important;
  810. border-radius: 0;
  811. overflow: initial;
  812. text-align: start;
  813. padding: 0;
  814. box-shadow: none !important;
  815. -webkit-tap-highlight-color: transparent;
  816. &::after {
  817. border: none;
  818. }
  819. }
  820. .lockBox {
  821. display: flex;
  822. // justify-content: center;
  823. align-items: center;
  824. .text {
  825. color: #fff;
  826. // font-weight: 600;
  827. font-size: 28rpx;
  828. }
  829. .info {
  830. display: flex;
  831. width: 100%;
  832. justify-content: center;
  833. .photo {
  834. width: 9vw;
  835. height: 9vw;
  836. border-radius: 50%;
  837. padding: 0 30rpx;
  838. }
  839. .right {
  840. margin-left: 20rpx;
  841. flex: 1;
  842. display: flex;
  843. flex-direction: column;
  844. align-items: center;
  845. justify-content: center;
  846. .row {
  847. width: 100%;
  848. color: #fff;
  849. font-size: 24rpx;
  850. margin-bottom: 4rpx;
  851. position: relative;
  852. display: flex;
  853. align-items: center;
  854. .time {
  855. padding: 4rpx;
  856. color: #565656;
  857. background: #e1ff13;
  858. margin: 0 16rpx;
  859. border-radius: 10rpx;
  860. font-weight: 600;
  861. font-size: 24rpx;
  862. }
  863. .name {
  864. font-size: 26rpx;
  865. font-weight: 600;
  866. color: #fff;
  867. width: 40%;
  868. white-space: nowrap;
  869. text-overflow: ellipsis;
  870. overflow: hidden;
  871. }
  872. .tip {
  873. font-size: 22rpx;
  874. position: absolute;
  875. right: 0;
  876. font-weight: 500;
  877. color: #fff;
  878. }
  879. }
  880. }
  881. }
  882. }
  883. </style>