drawCard_infinite.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. <template>
  2. <view class="container">
  3. <view class="head">
  4. <image class="img" :src="detail.prizeIcon" mode="aspectFill"></image>
  5. <view class="info">
  6. <view class="title row">
  7. {{ detail.name }}
  8. </view>
  9. <view class="row">
  10. <view class="price">
  11. ¥{{ detail.price }}
  12. <span class="text fontPFR">/张明信片</span>
  13. </view>
  14. <image
  15. @click="$navigateTo('/pages/rule/rule', { type: 1 })"
  16. class="button"
  17. :src="$fileUrl() + '/invite/button1.png'"
  18. mode="widthFix"
  19. ></image>
  20. </view>
  21. <view class="row">
  22. <!-- <view class="users">
  23. <image class="photo" :style="'left:' + index * 11 + 'px'" :src="$fileUrl() + '/Frame1.png'"
  24. v-for="(item, index) in userList" mode="widthFix"></image>
  25. </view> -->
  26. <!-- <view class="hot">
  27. <image :src="$fileUrl() + /first/hot.png" mode="widthFix"></image>
  28. {{ detail.hotNum }}
  29. </view> -->
  30. </view>
  31. </view>
  32. </view>
  33. <div v-if="detail.subType.includes('110')" class="oubox flex justify-around items-center">
  34. <div class="flex items-center" @click="showList">
  35. <img src="https://file.rongcyl.cn/festatic/bkm/ouking_a.png" class="w-10 h-10" />
  36. <div class="ml-1">
  37. <div class="fontPFSCS" style="font-size: 15px">欧王奖励</div>
  38. <div style="font-size: 12px">{{ ouCount }}届欧王</div>
  39. </div>
  40. </div>
  41. <div class="flex items-center">
  42. <img
  43. src="https://file.rongcyl.cn/festatic/bkm/x_a.png"
  44. class="w-10 h-10"
  45. v-if="detail.subType.includes('111')"
  46. />
  47. <img src="https://file.rongcyl.cn/festatic/bkm/x.png" class="w-10 h-10" v-else />
  48. <div class="ml-1" :style="{ color: detail.subType.includes('111') ? '' : '#a9bcd1' }">
  49. <div class="fontPFSCS" style="font-size: 15px">随机掉落</div>
  50. <div style="font-size: 12px">未开启</div>
  51. </div>
  52. </div>
  53. <div class="flex items-center">
  54. <img
  55. src="https://file.rongcyl.cn/festatic/bkm/free_a.png"
  56. class="w-10 h-10"
  57. v-if="detail.subType.includes('112')"
  58. />
  59. <img src="https://file.rongcyl.cn/festatic/bkm/free.png" class="w-10 h-10" v-else />
  60. <div class="ml-1" :style="{ color: detail.subType.includes('112') ? '' : '#a9bcd1' }">
  61. <div class="fontPFSCS" style="font-size: 15px">随机免单</div>
  62. <div style="font-size: 12px">未开启</div>
  63. </div>
  64. </div>
  65. </div>
  66. <view class="box" v-if="detail.subType && !detail.subType.includes('110')">
  67. <view class="boxContent">
  68. <view class="boxLeft">
  69. <view class="row1">
  70. <view class="text">连击 × {{ combos || 0 }}</view>
  71. <view class="text">
  72. {{ combos || 0 }}
  73. <span class="text1">/300</span>
  74. </view>
  75. </view>
  76. <view class="row2">
  77. <view class="row2content">
  78. <p>每连击300发未出传说赏,可获得一个宝箱。</p>
  79. <p>如果中间抽出传说赏,则清空连击次数。</p>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="boxRiaht">
  84. <image class="icon" :src="$fileUrl() + '/drawCard_infinite/icon1.png'" mode="widthFix"></image>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="buttons1">
  89. <image
  90. class="button"
  91. @click="tabClick(1)"
  92. style="margin-right: 20px"
  93. :src="$fileUrl() + `/drawCard_infinite/button1${active1 == 1 ? 'A' : ''}.png`"
  94. mode="widthFix"
  95. ></image>
  96. <image
  97. class="button"
  98. @click="tabClick(2)"
  99. :src="$fileUrl() + `/drawCard_infinite/button2${active1 == 2 ? 'A' : ''}.png`"
  100. mode="widthFix"
  101. ></image>
  102. </view>
  103. <view class="prizeList" v-if="active1 == 1">
  104. <view class="prizeRow" v-for="(item, index) in prizeList">
  105. <image class="bk" :src="$fileUrl() + '/drawCard_infinite/bk.png'" mode="scaleToFill"></image>
  106. <view class="prizeRowContent">
  107. <view class="prizesTitle">
  108. <span>
  109. <span style="font-size: 18px; margin-right: 5px; font-weight: 600">
  110. {{ $selectDictLabel(rewardType, item.type) }}
  111. </span>
  112. <span style="font-weight: 600">概率 {{ item.probability }}%</span>
  113. </span>
  114. <span class="sp">各类别赏中赏概率不代表具体产品中赏概率</span>
  115. </view>
  116. <view class="prizesItems">
  117. <view class="prize" v-for="(item2, index2) in item.prizeList">
  118. <view class="kaImg">
  119. <image class="kabk" :src="$fileUrl() + '/drawCard_infinite/kaBk.png'" mode="widthFix"></image>
  120. <image class="img" :src="item2.icon" mode="aspectFit"></image>
  121. </view>
  122. <view class="kaName">
  123. {{ item2.name }}
  124. </view>
  125. <view class="price">
  126. <span class="priceText">¥{{ detail.price }}</span>
  127. 参考价
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="winningRecord" v-if="active1 == 2">
  135. <view class="card" v-for="(item, index) in winningRecordList" :key="index">
  136. <view class="row">
  137. <view class="left">
  138. <image class="photo" :src="item.userAvtar" mode="aspectFill"></image>
  139. <span class="name">{{ item.userName }}</span>
  140. </view>
  141. <view class="right text1">
  142. <span style="margin-right: 5px">{{ item.creatTime }}</span>
  143. <span>No.{{ item.id }}</span>
  144. </view>
  145. </view>
  146. <view class="row" style="margin-top: 10px">
  147. <view class="left">
  148. <image class="img" :src="item.prizeIcon" mode="aspectFill"></image>
  149. <span class="name">{{ item.prizeName }}</span>
  150. </view>
  151. <view class="right" style="font-size: 14px">{{ $selectDictLabel(rewardType, item.prizeType) }} × 1</view>
  152. </view>
  153. </view>
  154. <div class="text-center" v-if="winningRecordList.length == 0">
  155. <image
  156. style="width: 80vw; margin: auto; margin-top: -40px"
  157. :src="$fileUrl() + '/noData.png'"
  158. mode="widthFix"
  159. ></image>
  160. <view class="text-center" style="margin-top: -30px; color: #999999">啊哦,没有任何内容</view>
  161. </div>
  162. </view>
  163. <view class="buttons2">
  164. <img
  165. @click="submit(1)"
  166. src="https://file.rongcyl.cn/festatic/bkm/1fuck.png"
  167. style="width: 116rpx; height: 116rpx"
  168. />
  169. <img
  170. @click="submit(3)"
  171. src="https://file.rongcyl.cn/festatic/bkm/3fuck.png"
  172. style="width: 116rpx; height: 116rpx"
  173. />
  174. <img
  175. @click="submit(5)"
  176. src="https://file.rongcyl.cn/festatic/bkm/5fuck.png"
  177. style="width: 116rpx; height: 116rpx"
  178. />
  179. <img
  180. @click="submit(10)"
  181. src="https://file.rongcyl.cn/festatic/bkm/10fuck.png"
  182. style="width: 116rpx; height: 116rpx"
  183. />
  184. </view>
  185. <paymentPopup ref="paymentPopup" @callBack="paymentSuccess" />
  186. <uni-popup ref="popup">
  187. <view class="popup-content oulist">
  188. <img src="https://file.rongcyl.cn/festatic/bkm/oulist.png" class="w-full h-full" />
  189. <div class="absolute left-0 right-0 bottom-0 overflow-scroll py-2" style="height: 270px">
  190. <div v-for="(ou, i) in ouList" :key="i" class="flex justify-between items-center px-2 py-2">
  191. <div class="flex mr-2">
  192. <img
  193. :src="`https://file.rongcyl.cn/festatic/bkm/${i + 1}.png`"
  194. v-if="i < 3"
  195. class="inline-block mt-1"
  196. style="width: 28px; height: 28px"
  197. />
  198. <span
  199. v-else
  200. class="bold inline-block mt-1"
  201. style="width: 28px; height: 28px; text-align: center; line-height: 28px"
  202. >
  203. {{ i + 1 }}
  204. </span>
  205. <img
  206. :src="ou.userAvtar"
  207. style="width: 34px; height: 34px; border-radius: 50%"
  208. class="inline-block ml-2"
  209. />
  210. </div>
  211. <div class="flex-1">
  212. <div style="font-size: 14px" class="bold">{{ ou.userName }}</div>
  213. <div style="font-size: 11px; color: #666666">
  214. <span style="margin-right: 18px">在线{{ ou.onlineTime }}分钟</span>
  215. <img src="https://file.rongcyl.cn/festatic/bkm/tri.png" class="w-4 h-4 inline-block relative top-1" />
  216. <span style="font-size: 12px; color: #666666">{{ ou.reward }} 奖励</span>
  217. </div>
  218. </div>
  219. <div>
  220. <span v-if="ou.status" style="color: #00c537; font-size: 12px">在线中</span>
  221. <span v-else style="font-size: 12px; color: #666666">{{ ou.downTime | formatTime }}下线</span>
  222. </div>
  223. </div>
  224. </div>
  225. </view>
  226. <div @click="closeList">
  227. <img
  228. src="https://file.rongcyl.cn/festatic/bkm/close.png"
  229. class="w-9 h-9 mt-6"
  230. style="margin-left: 50%; transform: translateX(-50%); z-index: 9999; position: relative"
  231. />
  232. </div>
  233. </uni-popup>
  234. <view style="width: 100%; height: 100px"></view>
  235. </view>
  236. </template>
  237. <script>
  238. import noData from '@/component/noData.vue'
  239. import { rewardType } from '@/utils/commonConfig.js'
  240. import { raffleDetailApi, prizeListApi, prizeUserListApi, combosApi, getOuCount, getOuList } from '@/api/drawCard.js'
  241. import { cardType, formatSeconds } from '@/utils/utils.js'
  242. import paymentPopup from '@/component/paymentPopup.vue'
  243. export default {
  244. components: {
  245. paymentPopup,
  246. noData,
  247. },
  248. onLoad(query) {
  249. console.log(query, 'query')
  250. if (query.id) {
  251. this.raffleId = query.id
  252. this.init()
  253. }
  254. },
  255. data() {
  256. return {
  257. rewardType: rewardType,
  258. active1: 1,
  259. detail: {},
  260. raffleId: null,
  261. prizeList: [],
  262. userIds: [],
  263. prizeUserList: [],
  264. winningRecordList: [],
  265. combos: 0,
  266. ouCount: 0,
  267. ouList: [],
  268. }
  269. },
  270. filters: {
  271. formatTime(dateString) {
  272. let month = dateString.substring(5, 7)
  273. let day = dateString.substring(8, 10)
  274. let time = dateString.substring(11, 16)
  275. return month + '/' + day + ' ' + time
  276. },
  277. },
  278. methods: {
  279. showList() {
  280. this.getOuKingList()
  281. this.$refs.popup.open('center')
  282. },
  283. closeList() {
  284. this.$refs.popup.close()
  285. },
  286. subType(value) {
  287. let index = null
  288. if (value == 120) {
  289. index = 1
  290. } else if (value == 110) {
  291. index = 2
  292. } else if (value == 111) {
  293. index = 3
  294. } else if (value == 112) {
  295. index = 4
  296. }
  297. return index
  298. },
  299. init() {
  300. // 获取卡包详情
  301. this.getDetail()
  302. this.tabClick(1)
  303. // 判断是否登录
  304. let hasLogin = getApp().globalData.hasLogin
  305. if (hasLogin) {
  306. this.getCombos()
  307. }
  308. },
  309. // 支付成功后回调
  310. paymentSuccess() {
  311. this.init()
  312. },
  313. clickDrawCard() {
  314. this.$refs.paymentPopup.show(this.raffleId, this.selectIndex, this.detail)
  315. },
  316. tabClick(index) {
  317. this.active1 = index
  318. if (index == 1) {
  319. //获取奖池
  320. this.getPrizeList()
  321. } else if (index == 2) {
  322. // 获取中奖记录
  323. this.getPrizeUserList()
  324. }
  325. },
  326. getOuKingList() {
  327. getOuList({ raffleId: this.raffleId, page: 1, limit: 1000 }).then(rs => {
  328. this.ouList = rs.data
  329. })
  330. },
  331. getDetail() {
  332. let params = {
  333. raffleId: this.raffleId,
  334. }
  335. raffleDetailApi(params).then(res => {
  336. console.log(res, '详情')
  337. this.detail = res.data
  338. if (res.data.subType.includes('110')) {
  339. getOuCount(params).then(rs => {
  340. this.ouCount = rs.data
  341. })
  342. }
  343. })
  344. this.getOuKingList()
  345. },
  346. getPrizeList() {
  347. let params = {
  348. raffleId: this.raffleId,
  349. }
  350. prizeListApi(params).then(res => {
  351. console.log(res, '奖池预览')
  352. let newArray = res.data
  353. for (var i = 0; i < res.data.length; i++) {
  354. if (res.data[i].type == 21) {
  355. newArray = []
  356. newArray.push(res.data[i])
  357. res.data.splice(i, 1)
  358. newArray.push(...res.data)
  359. break
  360. }
  361. }
  362. this.prizeList = newArray
  363. })
  364. },
  365. getPrizeUserList() {
  366. let params = {
  367. limit: 999,
  368. page: 1,
  369. raffleId: this.raffleId,
  370. }
  371. prizeUserListApi(params).then(res => {
  372. this.winningRecordList = res.data
  373. })
  374. },
  375. getCombos() {
  376. let params = {
  377. raffleId: this.raffleId,
  378. }
  379. combosApi(params).then(res => {
  380. console.log(res, '连击数')
  381. this.combos = res.data.combos
  382. })
  383. },
  384. submit(number) {
  385. let params = {
  386. raffleId: this.raffleId,
  387. }
  388. this.$refs.paymentPopup.show(params, number, this.detail)
  389. },
  390. },
  391. }
  392. </script>
  393. <style>
  394. .container >>> .uni-popup__wrapper.center {
  395. border-radius: 12px !important;
  396. }
  397. </style>
  398. <style scoped lang="scss">
  399. .oulist {
  400. width: 330px;
  401. height: 408px;
  402. overflow: hidden;
  403. position: relative;
  404. }
  405. .container {
  406. background: #9ec8f9;
  407. padding-top: 15px;
  408. overflow: auto;
  409. .head {
  410. background: #fff;
  411. border: 10px;
  412. padding: 15px;
  413. border-radius: 10px 10px 0 0;
  414. display: flex;
  415. justify-content: space-between;
  416. margin-bottom: 20px;
  417. .img {
  418. width: 106px;
  419. height: 106px;
  420. border-radius: 5px;
  421. overflow: hidden;
  422. margin-right: 10px;
  423. }
  424. .info {
  425. display: flex;
  426. flex-direction: column;
  427. justify-content: start;
  428. flex: 1;
  429. .row {
  430. margin: 5px 0;
  431. display: flex;
  432. justify-content: space-between;
  433. color: #999999;
  434. .button {
  435. width: 67px;
  436. }
  437. .hot {
  438. display: flex;
  439. font-size: 12px;
  440. color: #999999;
  441. image {
  442. width: 16px;
  443. }
  444. }
  445. .users {
  446. position: relative;
  447. .photo {
  448. position: absolute;
  449. width: 20px;
  450. height: 20px;
  451. border-radius: 50%;
  452. }
  453. }
  454. }
  455. .title {
  456. font-weight: 600;
  457. color: #000;
  458. }
  459. .price {
  460. font-size: 16px;
  461. font-weight: 600;
  462. color: #ff2c43;
  463. .text {
  464. font-size: 14px;
  465. color: #999999;
  466. font-weight: 500;
  467. }
  468. }
  469. }
  470. }
  471. .oubox {
  472. width: 95vw;
  473. height: 148rpx;
  474. background: rgba(255, 255, 255, 0.85);
  475. box-shadow: 0px 2px 6px 0px rgba(176, 123, 255, 0.3);
  476. border-radius: 24px;
  477. margin: auto;
  478. opacity: 1;
  479. border: 1px solid rgba(58, 67, 207, 1);
  480. }
  481. .box {
  482. margin: 0 10px 10px 10px;
  483. padding: 2px;
  484. background: linear-gradient(90deg, rgba(211, 252, 111, 1), rgba(61, 248, 255, 1));
  485. box-shadow: 0px 2px 6px 0px rgba(176, 123, 255, 0.3);
  486. border-radius: 24px;
  487. .boxContent {
  488. background: linear-gradient(90deg, #a4fcff 0%, #d3fc6e 100%);
  489. border-radius: 24px;
  490. opacity: 1;
  491. display: flex;
  492. padding: 8px 15px;
  493. .boxLeft {
  494. position: relative;
  495. flex: 1;
  496. .row1 {
  497. display: flex;
  498. justify-content: space-between;
  499. font-size: 18px;
  500. margin-bottom: 4px;
  501. .text {
  502. color: #000000;
  503. font-weight: 600;
  504. text-shadow: -2px -1px 0px rgba(255, 255, 255, 1);
  505. font-family: auto;
  506. }
  507. .text1 {
  508. text-shadow: none;
  509. font-weight: 500;
  510. }
  511. }
  512. .row2 {
  513. position: relative;
  514. top: 3px;
  515. height: 12vw;
  516. border-radius: 6vw;
  517. background: linear-gradient(90deg, #65c3e5 0%, #b1ff29 100%);
  518. .row2content {
  519. position: relative;
  520. top: -3px;
  521. background: #0d2a2c;
  522. height: 12vw;
  523. border-radius: 6vw;
  524. font-size: 10px;
  525. color: rgba(255, 255, 255, 0.9);
  526. display: flex;
  527. flex-direction: column;
  528. justify-content: center;
  529. align-items: flex-start;
  530. padding: 0 13px;
  531. }
  532. }
  533. }
  534. .boxRiaht {
  535. padding-left: 8vw;
  536. padding-right: 15px;
  537. display: flex;
  538. align-items: center;
  539. .icon {
  540. width: 12vw;
  541. height: 12vw;
  542. }
  543. }
  544. }
  545. }
  546. .buttons1 {
  547. display: flex;
  548. justify-content: center;
  549. .button {
  550. width: 38vw;
  551. height: 10vw;
  552. }
  553. }
  554. .prizeList {
  555. .prizeRow {
  556. position: relative;
  557. margin: 0 10px 10px 10px;
  558. padding-bottom: 10px;
  559. .bk {
  560. position: relative;
  561. width: 100%;
  562. height: 100%;
  563. position: absolute;
  564. top: 0;
  565. z-index: 1;
  566. }
  567. .prizeRowContent {
  568. position: relative;
  569. width: calc(100% - 30px);
  570. padding: 10px 15px;
  571. z-index: 2;
  572. .prizesTitle {
  573. font-size: 12px;
  574. padding-bottom: 5px;
  575. width: 100%;
  576. color: #fff;
  577. display: flex;
  578. justify-content: space-between;
  579. .sp {
  580. color: rgba(255, 255, 255, 0.7);
  581. padding-top: 8px;
  582. font-size: 10px;
  583. }
  584. }
  585. .prizesItems {
  586. background: #fffbe8;
  587. display: flex;
  588. width: calc(100% - 16px);
  589. padding: 8px;
  590. border-radius: 8px;
  591. .prize {
  592. width: 22vw;
  593. .kaImg {
  594. position: relative;
  595. .kabk {
  596. width: 100%;
  597. height: 100%;
  598. }
  599. .img {
  600. position: absolute;
  601. top: 0;
  602. width: 70%;
  603. height: 80%;
  604. left: 52%;
  605. top: 50%;
  606. transform: translateX(-50%) translateY(-50%);
  607. }
  608. }
  609. .kaName {
  610. width: 100%;
  611. overflow: hidden;
  612. white-space: nowrap;
  613. text-overflow: ellipsis;
  614. font-size: 12px;
  615. font-weight: 600;
  616. text-align: center;
  617. }
  618. .price {
  619. text-align: center;
  620. font-size: 10px;
  621. color: #999999;
  622. .priceText {
  623. color: #ff2c43;
  624. font-weight: 600;
  625. font-size: 12px;
  626. }
  627. }
  628. }
  629. }
  630. }
  631. }
  632. }
  633. .buttons2 {
  634. position: fixed;
  635. bottom: 10vw;
  636. display: flex;
  637. z-index: 4;
  638. justify-content: space-around;
  639. width: 100%;
  640. .button {
  641. width: 13vw;
  642. height: 13vw;
  643. font-size: 16px;
  644. color: #fff;
  645. background: linear-gradient(270deg, #531dbb 0%, #6e2fe5 100%);
  646. text-align: center;
  647. line-height: 13vw;
  648. border-radius: 4px;
  649. box-shadow: inset 0px 2px 3px 0px rgba(255, 255, 255, 0.25);
  650. position: relative;
  651. transform: rotate(45deg);
  652. font-weight: 600;
  653. p {
  654. transform: rotate(-45deg);
  655. }
  656. }
  657. }
  658. .winningRecord {
  659. .card {
  660. margin: 10px 10px 0 10px;
  661. border-radius: 8px;
  662. background: #fff;
  663. padding: 10px;
  664. .row {
  665. display: flex;
  666. justify-content: space-between;
  667. align-items: center;
  668. .left {
  669. display: flex;
  670. align-items: center;
  671. .photo {
  672. margin-right: 5px;
  673. width: 30px;
  674. height: 30px;
  675. border-radius: 50%;
  676. }
  677. .name {
  678. font-size: 14px;
  679. font-weight: 600;
  680. }
  681. .img {
  682. width: 40px;
  683. height: 40px;
  684. border-radius: 2px;
  685. margin-right: 5px;
  686. }
  687. }
  688. .text1 {
  689. color: #666666;
  690. font-size: 12px;
  691. }
  692. }
  693. }
  694. }
  695. }
  696. </style>