drawCard_infinite.vue 17 KB

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