drawCard_last.vue 26 KB

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