drawCard_infinite.vue 19 KB

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