drawCard_infinite.vue 17 KB

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