drawCard_infinite.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. <template>
  2. <view class="container">
  3. <view class="head">
  4. <image class="img" :src="$fileUrl() + '/ka.jpeg'" 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.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 }}</view>
  71. <view class="text">
  72. {{ combos }}
  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. <view class="button" @click="submit(1)">
  165. <p>一发</p>
  166. </view>
  167. <view class="button" @click="submit(3)">
  168. <p>三发</p>
  169. </view>
  170. <view class="button" @click="submit(5)">
  171. <p>五发</p>
  172. </view>
  173. <view class="button" @click="submit(10)">
  174. <p>十发</p>
  175. </view>
  176. </view>
  177. <paymentPopup ref="paymentPopup" @callBack="paymentSuccess" />
  178. <uni-popup ref="popup">
  179. <view class="popup-content oulist">
  180. <img src="https://file.rongcyl.cn/festatic/bkm/oulist.png" class="w-full h-full" />
  181. <div class="absolute left-0 right-0 bottom-0 overflow-scroll" style="height: 300px">
  182. <div v-for="ou in ouList">{{ ou.userName }}</div>
  183. </div>
  184. </view>
  185. <div @click="closeList">
  186. <img
  187. src="https://file.rongcyl.cn/festatic/bkm/close.png"
  188. class="w-9 h-9 mt-6"
  189. style="margin-left: 50%; transform: translateX(-50%); z-index: 9999; position: relative"
  190. />
  191. </div>
  192. </uni-popup>
  193. <view style="width: 100%; height: 100px"></view>
  194. </view>
  195. </template>
  196. <script>
  197. import noData from '@/component/noData.vue'
  198. import { rewardType } from '@/utils/commonConfig.js'
  199. import { raffleDetailApi, prizeListApi, prizeUserListApi, combosApi, getOuCount, getOuList } from '@/api/drawCard.js'
  200. import { cardType, formatSeconds } from '@/utils/utils.js'
  201. import paymentPopup from '@/component/paymentPopup.vue'
  202. export default {
  203. components: {
  204. paymentPopup,
  205. noData,
  206. },
  207. onLoad(query) {
  208. console.log(query, 'query')
  209. if (query.id) {
  210. this.raffleId = query.id
  211. this.init()
  212. }
  213. this.paymentSuccess()
  214. },
  215. data() {
  216. return {
  217. rewardType: rewardType,
  218. active1: 1,
  219. detail: {},
  220. raffleId: null,
  221. prizeList: [],
  222. userIds: [],
  223. prizeUserList: [],
  224. winningRecordList: [],
  225. combos: 0,
  226. ouCount: 0,
  227. ouList: [],
  228. }
  229. },
  230. methods: {
  231. showList() {
  232. this.$refs.popup.open('center')
  233. },
  234. closeList() {
  235. this.$refs.popup.close()
  236. },
  237. subType(value) {
  238. let index = null
  239. if (value == 120) {
  240. index = 1
  241. } else if (value == 110) {
  242. index = 2
  243. } else if (value == 111) {
  244. index = 3
  245. } else if (value == 112) {
  246. index = 4
  247. }
  248. return index
  249. },
  250. init() {
  251. // 获取卡包详情
  252. this.getDetail()
  253. this.tabClick(1)
  254. this.getCombos()
  255. //ssssss
  256. },
  257. // 支付成功后回调
  258. paymentSuccess() {
  259. let _this = this
  260. this.getCombos()
  261. this.tabClick(1)
  262. },
  263. clickDrawCard() {
  264. this.$refs.paymentPopup.show(this.raffleId, this.selectIndex, this.detail)
  265. },
  266. tabClick(index) {
  267. this.active1 = index
  268. if (index == 1) {
  269. //获取奖池
  270. this.getPrizeList()
  271. } else if (index == 2) {
  272. // 获取中奖记录
  273. this.getPrizeUserList()
  274. }
  275. },
  276. getDetail() {
  277. let params = {
  278. raffleId: this.raffleId,
  279. }
  280. raffleDetailApi(params).then(res => {
  281. console.log(res, '详情')
  282. this.detail = res.data
  283. if (res.data.subType.includes('110')) {
  284. getOuCount(params).then(rs => {
  285. this.ouCount = rs.data.count
  286. })
  287. getOuList({ ...params, page: 1, limit: 1000 }).then(rs => {
  288. this.ouList = rs.data
  289. })
  290. }
  291. })
  292. },
  293. getPrizeList() {
  294. let params = {
  295. raffleId: this.raffleId,
  296. }
  297. prizeListApi(params).then(res => {
  298. console.log(res, '奖池预览')
  299. let newArray = res.data
  300. for (var i = 0; i < res.data.length; i++) {
  301. if (res.data[i].type == 21) {
  302. newArray = []
  303. newArray.push(res.data[i])
  304. res.data.splice(i, 1)
  305. newArray.push(...res.data)
  306. break
  307. }
  308. }
  309. this.prizeList = newArray
  310. })
  311. },
  312. getPrizeUserList() {
  313. let params = {
  314. limit: 999,
  315. page: 1,
  316. raffleId: this.raffleId,
  317. }
  318. prizeUserListApi(params).then(res => {
  319. this.winningRecordList = res.data
  320. })
  321. },
  322. getCombos() {
  323. let params = {
  324. raffleId: this.raffleId,
  325. }
  326. combosApi(params).then(res => {
  327. console.log(res, '连击数')
  328. this.combos = res.data.combos
  329. })
  330. },
  331. submit(number) {
  332. this.$refs.paymentPopup.show(this.raffleId, number, this.detail)
  333. },
  334. },
  335. }
  336. </script>
  337. <style>
  338. .container >>> .uni-popup__wrapper.center {
  339. border-radius: 12px !important;
  340. }
  341. </style>
  342. <style scoped lang="scss">
  343. .oulist {
  344. width: 330px;
  345. height: 408px;
  346. overflow: hidden;
  347. position: relative;
  348. }
  349. .container {
  350. background: #9ec8f9;
  351. padding-top: 15px;
  352. overflow: auto;
  353. .head {
  354. background: #fff;
  355. border: 10px;
  356. padding: 15px;
  357. border-radius: 10px 10px 0 0;
  358. display: flex;
  359. justify-content: space-between;
  360. margin-bottom: 20px;
  361. .img {
  362. width: 106px;
  363. height: 106px;
  364. border-radius: 5px;
  365. overflow: hidden;
  366. margin-right: 10px;
  367. }
  368. .info {
  369. display: flex;
  370. flex-direction: column;
  371. justify-content: start;
  372. flex: 1;
  373. .row {
  374. margin: 5px 0;
  375. display: flex;
  376. justify-content: space-between;
  377. color: #999999;
  378. .button {
  379. width: 67px;
  380. }
  381. .hot {
  382. display: flex;
  383. font-size: 12px;
  384. color: #999999;
  385. image {
  386. width: 16px;
  387. }
  388. }
  389. .users {
  390. position: relative;
  391. .photo {
  392. position: absolute;
  393. width: 20px;
  394. height: 20px;
  395. border-radius: 50%;
  396. }
  397. }
  398. }
  399. .title {
  400. font-weight: 600;
  401. color: #000;
  402. }
  403. .price {
  404. font-size: 16px;
  405. font-weight: 600;
  406. color: #ff2c43;
  407. .text {
  408. font-size: 14px;
  409. color: #999999;
  410. font-weight: 500;
  411. }
  412. }
  413. }
  414. }
  415. .oubox {
  416. width: 95vw;
  417. height: 148rpx;
  418. background: rgba(255, 255, 255, 0.85);
  419. box-shadow: 0px 2px 6px 0px rgba(176, 123, 255, 0.3);
  420. border-radius: 24px;
  421. margin: auto;
  422. opacity: 1;
  423. border: 1px solid rgba(58, 67, 207, 1);
  424. }
  425. .box {
  426. margin: 0 10px 10px 10px;
  427. padding: 2px;
  428. background: linear-gradient(90deg, rgba(211, 252, 111, 1), rgba(61, 248, 255, 1));
  429. box-shadow: 0px 2px 6px 0px rgba(176, 123, 255, 0.3);
  430. border-radius: 24px;
  431. .boxContent {
  432. background: linear-gradient(90deg, #a4fcff 0%, #d3fc6e 100%);
  433. border-radius: 24px;
  434. opacity: 1;
  435. display: flex;
  436. padding: 8px 15px;
  437. .boxLeft {
  438. position: relative;
  439. flex: 1;
  440. .row1 {
  441. display: flex;
  442. justify-content: space-between;
  443. font-size: 18px;
  444. margin-bottom: 4px;
  445. .text {
  446. color: #000000;
  447. font-weight: 600;
  448. text-shadow: -2px -1px 0px rgba(255, 255, 255, 1);
  449. font-family: auto;
  450. }
  451. .text1 {
  452. text-shadow: none;
  453. font-weight: 500;
  454. }
  455. }
  456. .row2 {
  457. position: relative;
  458. top: 3px;
  459. height: 12vw;
  460. border-radius: 6vw;
  461. background: linear-gradient(90deg, #65c3e5 0%, #b1ff29 100%);
  462. .row2content {
  463. position: relative;
  464. top: -3px;
  465. background: #0d2a2c;
  466. height: 12vw;
  467. border-radius: 6vw;
  468. font-size: 10px;
  469. color: rgba(255, 255, 255, 0.9);
  470. display: flex;
  471. flex-direction: column;
  472. justify-content: center;
  473. align-items: flex-start;
  474. padding: 0 13px;
  475. }
  476. }
  477. }
  478. .boxRiaht {
  479. padding-left: 8vw;
  480. padding-right: 15px;
  481. display: flex;
  482. align-items: center;
  483. .icon {
  484. width: 12vw;
  485. height: 12vw;
  486. }
  487. }
  488. }
  489. }
  490. .buttons1 {
  491. display: flex;
  492. justify-content: center;
  493. .button {
  494. width: 38vw;
  495. height: 10vw;
  496. }
  497. }
  498. .prizeList {
  499. .prizeRow {
  500. position: relative;
  501. margin: 0 10px 10px 10px;
  502. padding-bottom: 10px;
  503. .bk {
  504. position: relative;
  505. width: 100%;
  506. height: 100%;
  507. position: absolute;
  508. top: 0;
  509. z-index: 1;
  510. }
  511. .prizeRowContent {
  512. position: relative;
  513. width: calc(100% - 30px);
  514. padding: 10px 15px;
  515. z-index: 2;
  516. .prizesTitle {
  517. font-size: 12px;
  518. padding-bottom: 5px;
  519. width: 100%;
  520. color: #fff;
  521. display: flex;
  522. justify-content: space-between;
  523. .sp {
  524. color: rgba(255, 255, 255, 0.7);
  525. padding-top: 8px;
  526. font-size: 10px;
  527. }
  528. }
  529. .prizesItems {
  530. background: #fffbe8;
  531. display: flex;
  532. width: calc(100% - 16px);
  533. padding: 8px;
  534. border-radius: 8px;
  535. .prize {
  536. width: 22vw;
  537. .kaImg {
  538. position: relative;
  539. .kabk {
  540. width: 100%;
  541. height: 100%;
  542. }
  543. .img {
  544. position: absolute;
  545. top: 0;
  546. width: 70%;
  547. height: 80%;
  548. left: 52%;
  549. top: 50%;
  550. transform: translateX(-50%) translateY(-50%);
  551. }
  552. }
  553. .kaName {
  554. width: 100%;
  555. overflow: hidden;
  556. white-space: nowrap;
  557. text-overflow: ellipsis;
  558. font-size: 12px;
  559. font-weight: 600;
  560. text-align: center;
  561. }
  562. .price {
  563. text-align: center;
  564. font-size: 10px;
  565. color: #999999;
  566. .priceText {
  567. color: #ff2c43;
  568. font-weight: 600;
  569. font-size: 12px;
  570. }
  571. }
  572. }
  573. }
  574. }
  575. }
  576. }
  577. .buttons2 {
  578. position: fixed;
  579. bottom: 10vw;
  580. display: flex;
  581. z-index: 4;
  582. justify-content: space-around;
  583. width: 100%;
  584. .button {
  585. width: 13vw;
  586. height: 13vw;
  587. font-size: 16px;
  588. color: #fff;
  589. background: linear-gradient(270deg, #531dbb 0%, #6e2fe5 100%);
  590. text-align: center;
  591. line-height: 13vw;
  592. border-radius: 4px;
  593. box-shadow: inset 0px 2px 3px 0px rgba(255, 255, 255, 0.25);
  594. position: relative;
  595. transform: rotate(45deg);
  596. font-weight: 600;
  597. p {
  598. transform: rotate(-45deg);
  599. }
  600. }
  601. }
  602. .winningRecord {
  603. .card {
  604. margin: 10px 10px 0 10px;
  605. border-radius: 8px;
  606. background: #fff;
  607. padding: 10px;
  608. .row {
  609. display: flex;
  610. justify-content: space-between;
  611. align-items: center;
  612. .left {
  613. display: flex;
  614. align-items: center;
  615. .photo {
  616. margin-right: 5px;
  617. width: 30px;
  618. height: 30px;
  619. border-radius: 50%;
  620. }
  621. .name {
  622. font-size: 14px;
  623. font-weight: 600;
  624. }
  625. .img {
  626. width: 40px;
  627. height: 40px;
  628. border-radius: 2px;
  629. margin-right: 5px;
  630. }
  631. }
  632. .text1 {
  633. color: #666666;
  634. font-size: 12px;
  635. }
  636. }
  637. }
  638. }
  639. }
  640. </style>