drawCard_last.vue 26 KB

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