index.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. <template>
  2. <view class="home">
  3. <view class="content">
  4. <Header @update:address="handleAddressUpdate"></Header>
  5. <view class="home-img">
  6. <image src="@/static/image/trade/jinsai-icon.png" mode="widthFix" />
  7. </view>
  8. <view class="home-btn-box">
  9. <view class="trade-num">奖池数量</view>
  10. <view class="image-num">
  11. <image src="@/static/image/trade/title-bg.png" mode="scaleToFill" />
  12. </view>
  13. </view>
  14. <view class="home-code">
  15. <view class="trade-border-box"> STT {{ (Number(gameList[2]?.prev_bonus) || 0).toFixed(6) }}</view>
  16. <view class="trade-border-num"
  17. >≈¥{{ ((Number(gameList[2]?.prev_bonus) || 0) * 7.2).toFixed(2) }}</view
  18. >
  19. </view>
  20. <view class="trade-img-box">
  21. <image src="@/static/image/trade/money-box.png" mode="aspectFit" />
  22. </view>
  23. <view class="card-item">
  24. <view class="trade-process" :class="bgClass">
  25. <view
  26. :class="
  27. gameCheck == index
  28. ? 'trde-process-item-active'
  29. : 'trde-process-item'
  30. "
  31. v-for="(item, index) in gameList"
  32. :key="index"
  33. @click="selectGame(index, item)"
  34. >
  35. <view class="trade-game-name">{{ item?.title || '暂无活跃'}}</view>
  36. <view class="trade-game-time" v-if="item"
  37. >{{ dayjs(item?.date).format("MM/DD") }}-{{
  38. dayjs(item?.end_date).format("MM/DD")
  39. }}</view
  40. >
  41. </view>
  42. </view>
  43. <view class="trade-time-box" v-if="gameDetail">
  44. <view class="time-title">
  45. 距离 <text>{{ gameDetail.title }} AT榜{{gameCheck == '2'?'开始':'结束'}} </text>还有
  46. </view>
  47. <up-count-down
  48. :time="
  49. dayjs(gameDetail.end_date).valueOf() - dayjs(new Date()).valueOf()
  50. "
  51. format="DD:HH:mm:ss"
  52. autoStart
  53. millisecond
  54. @change="onChange"
  55. >
  56. <view class="time-box-index">
  57. <view class="time__item"
  58. ><view class="time-box">{{ timeData.days }}</view> 天</view
  59. >
  60. <view class="time__item">
  61. <view class="time-box">{{
  62. timeData.hours > 10 ? timeData.hours : "0" + timeData.hours
  63. }}</view>
  64. 时</view
  65. >
  66. <view class="time__item"
  67. ><view class="time-box">
  68. {{ timeData.minutes }}
  69. </view>
  70. 分</view
  71. >
  72. <view class="time__item"
  73. ><view class="time-box">{{ timeData.seconds }}</view
  74. >秒</view
  75. >
  76. </view>
  77. </up-count-down>
  78. <view
  79. class="start-btn" v-if="!received"
  80. @click="changeSign"
  81. :style="{ color: gameCheck == 2 || gameDetail.is_enroll? '#fff' : '' }">{{ gameCheck == 2 && !gameDetail.is_enroll ? "报名" : (gameDetail.is_enroll ? "已报名" : "未报名") }}</view
  82. >
  83. <view class="received-box" v-else>
  84. <view style="margin-right: 5px;">{{ (Number(receivedItem.prize) || 0).toFixed(7) }}</view>
  85. <view class="game-item-btn" @click="awardFun(receivedItem)">
  86. {{receivedItem.is_receive?'已领取':'领取'}}
  87. </view>
  88. </view>
  89. <view class="num-txt" v-if="gameCheck != 2"
  90. >奖池数量:<text>STT{{ (Number(gameDetail.bonus) || 0).toFixed(6) }}</text>
  91. </view>
  92. <view class="num-txt-small" v-if="gameCheck != 2"
  93. >≈¥{{ ((Number(gameDetail.bonus) || 0) * 7.2).toFixed(2) }}</view
  94. >
  95. </view>
  96. </view>
  97. <view class="game-play-name">活跃名次</view>
  98. <scroll-view style="height: 600px;" :scroll-y="true" refresher-enabled="true" refresher-background="#rgba(0,0,0,0)"
  99. :refresher-triggered="triggered" @refresherrefresh="onRefresh">
  100. <view class="game-list">
  101. <view class="game-list-item" v-for="(item, index) in gameRankList" :key="index">
  102. <view class="game-item-left">
  103. <view class="game-order-index">
  104. <image
  105. src="@/static/image/trade/one.png"
  106. v-if="index == 0"
  107. mode="scaleToFill"
  108. />
  109. <image
  110. src="@/static/image/trade/two.png"
  111. v-if="index == 1"
  112. mode="scaleToFill"
  113. />
  114. <image
  115. src="@/static/image/trade/three.png"
  116. v-if="index == 2"
  117. mode="scaleToFill"
  118. />
  119. <text v-if="index != 0 && index != 1 && index != 2">{{
  120. index + 1
  121. }}</text>
  122. </view>
  123. <view class="game-order-num">
  124. <view class="game-num-txt">
  125. <view>{{`${item.address.slice(0, 4)}...${item.address.slice(-4)}` }}</view>
  126. <view class="game-num-num">{{ gameDetail?.title }}</view>
  127. </view>
  128. <view class="game-num-txt" v-if="item.is_self && item.is_prize && gameCheck == 0">
  129. <view class="game-item-btn" @click="awardFun(item)">{{item.is_receive?'已领取':'领取'}}</view>
  130. </view>
  131. <view class="game-num-txt" v-else>
  132. <view>排名奖励</view>
  133. <view class="game-num-num">{{ (Number(item.prize) || 0).toFixed(7) }}</view>
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. </scroll-view>
  140. </view>
  141. <view class="fix-box">
  142. <view class="fix-item" @click="openGamePopup(1)">活跃规则</view>
  143. <!-- <view class="fix-item" @click="openGamePopup(2)">活跃名次</view> -->
  144. </view>
  145. <!-- 规则和名次 -->
  146. <up-popup
  147. :show="showGameMsg"
  148. :round="10"
  149. mode="center"
  150. :closeOnClickOverlay="true"
  151. @close="showGameMsg = false"
  152. >
  153. <view class="show-game-msg">
  154. <image
  155. class="close-img"
  156. src="@/static/image/home/alert-pay-close.png"
  157. mode="scaleToFill"
  158. @click="showGameMsg = false"
  159. />
  160. <!-- <view class="show-game-title" v-if="showType==2">
  161. <text>{{ gameDetail.title }}活跃</text>AT榜消息
  162. </view> -->
  163. <view class="show-game-title" v-if="showType==1">
  164. AT榜规则
  165. </view>
  166. <!-- 名次 -->
  167. <!-- <view class="show-game-content" v-if="showType==2">
  168. <view class="game-msg">1:活跃开始时间:{{ gameDetail.date }} 00:00:00</view>
  169. <view class="game-msg"
  170. >2:活跃结束时间:{{ gameDetail.end_date }} 23:59:59</view
  171. >
  172. <view class="game-msg"
  173. >3:参与场次:<text>0场;</text>输:<text>0局;</text>赢:<text
  174. >0局;</text
  175. ></view
  176. >
  177. <view class="game-msg">4:排名奖励:<text>0局</text></view>
  178. <view class="desc-title">注意:</view>
  179. <view class="dest-item">①: 当期活跃信息可能存在延迟,仅供参考;</view>
  180. <view class="dest-item"
  181. >②:如当期活跃奖励未在有效期内领取,将视为放弃;</view
  182. >
  183. <view class="dest-item"
  184. >③:赢局次数小于等于0的地址参与排名,但没有奖励分配;</view
  185. >
  186. <view class="dest-item" style="color: red"
  187. >④:每场活跃中相同地址频繁对战,场次将不作为有效局数;
  188. </view>
  189. <view class="dest-item" style="color: red"
  190. >⑤:对于恶意刷单地址,平台将永久封禁账号;</view
  191. >
  192. </view> -->
  193. <!-- 规则 -->
  194. <view class="show-game-content" v-if="showType==1">
  195. <view class="game-msg">1: 活跃报名截止时间:每期活跃开始前</view>
  196. <view class="game-msg"
  197. >2: 活跃奖励结算时间:每期活跃结束后(约需要1-30分钟)</view
  198. >
  199. <view class="game-msg"
  200. >3: 活跃奖励领取时间:每期活跃结束结算完成后</view
  201. >
  202. <view class="game-msg"
  203. >4:活跃奖励失效时间:当期活跃结束后,下期活跃结束前</view
  204. >
  205. <view class="game-msg"
  206. >5:活跃奖励规则: 当期奖池金额</view
  207. >
  208. <view class="dest-item" style="color: red;font-size: 24rpx;" v-for="(item,i) in gameDetail?.rules" :key="i">
  209. <text>{{ i == 0?'①':i == 1?'②':'③' }}</text>:{{item.rule}}
  210. </view>
  211. <!-- <view class="desc-title">注意:</view>
  212. <view class="dest-item">①: 如当期活跃奖励未在有效期内领取,将视为放弃;</view>
  213. <view class="dest-item"
  214. >②:赢局次数小于等于0的地址参与排名,但没有奖励分配;</view
  215. >
  216. <view class="dest-item" style="color:red;"
  217. >③:每场活跃中相同地址频繁对战,场次将不作为有效局数;</view
  218. >
  219. <view class="dest-item" style="color:red;"
  220. >④:对于恶意刷单地址,平台将永久封禁账号;</view
  221. > -->
  222. </view>
  223. <view class="show-game-bottom">
  224. <view class="show-game-btn" @click="showGameMsg = false">关闭</view>
  225. </view>
  226. </view>
  227. </up-popup>
  228. <!-- 报名 -->
  229. <up-popup
  230. :show="showGameBm"
  231. :round="10"
  232. mode="center"
  233. :closeOnClickOverlay="true"
  234. @close="showGameBm = false"
  235. >
  236. <view class="show-game-msg" style="height: 40vh">
  237. <image
  238. class="close-img"
  239. src="@/static/image/home/alert-pay-close.png"
  240. mode="scaleToFill"
  241. @click="showGameBm = false"
  242. />
  243. <view class="show-game-title"> <text>活跃</text>报名 </view>
  244. <view class="show-game-content">
  245. <view class="desc-title" style="color: red">报名方式①:</view>
  246. <view class="game-msg" style="font-weight: 400"
  247. >消耗 <text style="color: #d4ac27">{{entry_fee}} STT</text> 等值 WGT:</view
  248. >
  249. <view class="game-msg"
  250. >≈<text>{{wgt_price}}</text>WGT<text
  251. style="color: #d4ac27; font-size: 20rpx"
  252. >(钱包扣除)</text
  253. ></view
  254. >
  255. <view class="dest-item" style="color: #aaa">(WGT钱包余额{{ (Number(WGTbalance) || 0).toFixed(6) }})</view>
  256. <view class="desc-title" style="color: red">报名方式②:</view>
  257. <view class="game-msg"
  258. >消耗{{entry_fee}} STT
  259. <text style="color: #d4ac27; font-size: 20rpx"
  260. >(钱包扣除)</text
  261. ></view
  262. >
  263. <view class="dest-item" style="color: #aaa">(STT钱包余额{{ (Number(STTbalance) || 0).toFixed(6) }})</view>
  264. </view>
  265. <view class="show-game-bottom">
  266. <view class="show-game-btn-wgt" @click="changeWGT">WGT报名</view>
  267. <view class="show-game-btn-stt" @click="changeSTT">STT报名</view>
  268. </view>
  269. </view>
  270. </up-popup>
  271. </view>
  272. </template>
  273. <script setup>
  274. import { ref, onMounted,computed, reactive } from "vue";
  275. import Header from "@/components/Header";
  276. import { sendSingleReward,WGTForToken,STTForToken,getBalance } from "@/utils/web.js";
  277. import { matchList, matchRank, matchInfo,verifyEnroll,matchEnroll,userPrize,claimPrize,sysSetting,enrollGameMatch,receiveGamePrize } from "@/api/game";
  278. import { getWalletInfo,AES_CBC_ENCRYPT,cryptoDecode } from "@/utils/utils.js";
  279. import dayjs from "dayjs";
  280. const timeData = ref({});
  281. const onChange = (e) => {
  282. timeData.value = e;
  283. };
  284. const walletAddress = ref('');
  285. const gameList = ref([]);
  286. const gameRankList = ref([]);
  287. const gameDetail = ref({});
  288. const gameCheck = ref(1);//选中tab
  289. const showGameBm = ref(false);
  290. const WGTbalance = ref(0);
  291. const STTbalance = ref(0);
  292. const entry_fee = ref(0);
  293. const wgt_price = ref(0);
  294. const triggered = ref(false);
  295. const received = ref(false);
  296. const receivedItem = ref({});
  297. const GasRate = ref(1);
  298. const privateKey = ref('');
  299. // const privateKey = ref("4d8d38c6433c9552a11181b64a234814cd83f5b0d2c7306545ee097da9c0e4b2");//H5
  300. const bgClass = computed(() => {
  301. if (gameCheck.value === 0) return 'bg1';
  302. if (gameCheck.value === 1) return 'bg2';
  303. return 'bg3';
  304. });
  305. const handleAddressUpdate = async (addr) => {
  306. const {privateKey} = await getWalletInfo();
  307. privateKey.value = privateKey;
  308. walletAddress.value = addr;
  309. getSysSetting();
  310. getGameMatchList();
  311. getnum(privateKey.value);
  312. };
  313. // 获取gas倍数
  314. const getSysSetting = async() => {
  315. let res = await sysSetting({category:'GasRate'});
  316. if(res.data){
  317. GasRate.value = res.data.GasRate
  318. }
  319. }
  320. sysSetting
  321. // 获取游戏赛事列表(三个tab)
  322. const getGameMatchList = async (type = true) => {
  323. let params = {
  324. dapp_id: 15,
  325. address:walletAddress.value
  326. };
  327. let res = await matchList(params);
  328. if (res.status == 200) {
  329. gameList.value = res.data;
  330. if(type){
  331. gameDetail.value = res.data[1];
  332. getGameRank(res.data[1].id);
  333. }else{
  334. gameDetail.value = res.data[2];
  335. }
  336. }
  337. };
  338. // 查询游戏赛事排名
  339. const getGameRank = async (id) => {
  340. received.value = false;
  341. let params = {
  342. dapp_id: 15,
  343. match_id:id,
  344. address:walletAddress.value
  345. };
  346. let res = await matchRank(params);
  347. if (res.status == 200) {
  348. gameRankList.value = res.data;
  349. gameRankList.value.forEach(item => {
  350. if(item.is_self && item.is_prize && gameCheck.value == 0){
  351. received.value = true;
  352. receivedItem.value = item;
  353. }
  354. });
  355. }
  356. };
  357. // 切换tab
  358. const selectGame = (value, item) => {
  359. gameCheck.value = value;
  360. gameDetail.value = item;
  361. getGameRank(item.id);
  362. };
  363. // 游戏规则弹出框
  364. const showGameMsg = ref(false);
  365. const showType=ref(0);
  366. const openGamePopup = (value) => {
  367. showGameMsg.value = true;
  368. showType.value=value;
  369. };
  370. // 获取余额
  371. const getnum = async (privateKey) =>{
  372. try {
  373. WGTbalance.value = await getBalance(privateKey,'wgt');
  374. STTbalance.value = await getBalance(privateKey,'stt');
  375. }catch(error){
  376. console.log(error)
  377. }
  378. }
  379. //校验报名
  380. const changeSign = async () =>{
  381. if (gameCheck.value != 2 || gameDetail.value?.is_enroll) return;
  382. let res = await verifyEnroll({dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value});
  383. if (res.status == 200) {
  384. entry_fee.value = Number(res.data.entry_fee).toFixed(2);
  385. wgt_price.value = Number(res.data.format?.wgt_price).toFixed(4);
  386. showGameBm.value = true;
  387. }
  388. }
  389. // 报名
  390. // const getMatchEnroll = async (hash) =>{
  391. // let res = await matchEnroll({
  392. // dapp_id:15,
  393. // match_id:gameList.value[gameCheck.value]?.id,
  394. // address:walletAddress.value,
  395. // entry_hash:hash
  396. // });
  397. // if (res.status == 200) {
  398. // uni.hideLoading()
  399. // uni.showToast({
  400. // title: '报名成功',
  401. // icon: 'none',
  402. // duration: 1000
  403. // })
  404. // setTimeout(() => {
  405. // getGameMatchList(false);
  406. // }, 1500);
  407. // }else{
  408. // uni.hideLoading()
  409. // }
  410. // }
  411. const changeWGT = async () => {
  412. if(WGTbalance.value < wgt_price.value){
  413. uni.showToast({
  414. title: '余额不足',
  415. icon: 'none',
  416. duration: 5000
  417. });
  418. return;
  419. }
  420. // await handleTokenSignUp(WGTForToken, wgt_price.value);
  421. await handleTokenSignUp('wgt', wgt_price.value);
  422. };
  423. const changeSTT = async () => {
  424. if(STTbalance.value < entry_fee.value){
  425. uni.showToast({
  426. title: '余额不足',
  427. icon: 'none',
  428. duration: 5000
  429. });
  430. return;
  431. }
  432. // await handleTokenSignUp(STTForToken, entry_fee.value);
  433. await handleTokenSignUp('stt', entry_fee.value);
  434. };
  435. const handleTokenSignUp = async (signUpFn, price) => {
  436. showGameBm.value = false;
  437. uni.showLoading({
  438. title: '报名中...',
  439. mask: true
  440. });
  441. try {
  442. // 加密
  443. let {ciphertext, iv} = await AES_CBC_ENCRYPT(privateKey.value) || {};
  444. if(!ciphertext || !iv){
  445. return;
  446. }
  447. // console.log(signUpFn, ciphertext, iv);
  448. let res = await enrollGameMatch({
  449. dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value,
  450. key: ciphertext, _m: iv, type: signUpFn
  451. });
  452. // console.log(res);
  453. if (res.status == 200) {
  454. uni.hideLoading()
  455. uni.showToast({
  456. title: '报名成功',
  457. icon: 'none',
  458. duration: 1000
  459. })
  460. setTimeout(() => {
  461. getGameMatchList(false);
  462. }, 1000);
  463. }else{
  464. uni.hideLoading()
  465. uni.showToast({
  466. title: res.message || "领取失败",
  467. icon: 'none',
  468. duration: 5000
  469. });
  470. }
  471. // const result = await signUpFn(privateKey.value, price,GasRate.value);
  472. // if (result.status === "success") {
  473. // await getMatchEnroll(result.hash);
  474. // } else {
  475. // uni.hideLoading();
  476. // uni.showToast({
  477. // title: result.message || "报名失败",
  478. // icon: 'none',
  479. // duration: 5000
  480. // });
  481. // }
  482. } catch (error) {
  483. console.log(error)
  484. uni.hideLoading();
  485. uni.showToast({
  486. title: error.message || "报名失败",
  487. icon: 'none',
  488. duration: 5000
  489. });
  490. }
  491. };
  492. //查询用户奖金信息
  493. const awardFun = async (item) => {
  494. if(item.is_receive) return;
  495. let res = await userPrize({dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value});
  496. if (res.status == 200) {
  497. if(!res.data.prize_money || res.data.prize_money == 0){
  498. uni.showToast({
  499. title: '正在结算中!',
  500. icon: 'none',
  501. duration: 1000
  502. })
  503. return;
  504. };
  505. // getreportlogger({params:res.data,name:'AT榜',type:'领取奖金'});
  506. getsendSingleReward(res.data.prize_money)
  507. }
  508. };
  509. // 领取用户奖金
  510. // const getClaimPrize = async (hash) =>{
  511. // let res = await claimPrize({
  512. // dapp_id:15,
  513. // match_id:gameDetail.value?.id,
  514. // address:walletAddress.value,
  515. // receive_hash:hash
  516. // });
  517. // if (res.status == 200) {
  518. // uni.showToast({
  519. // title: '领取成功',
  520. // icon: 'none',
  521. // duration: 1000
  522. // })
  523. // setTimeout(() => {
  524. // getGameRank(gameDetail.value?.id)
  525. // }, 500);
  526. // }
  527. // }
  528. const getsendSingleReward = async (prize_money) =>{
  529. uni.showLoading({
  530. title: '领取中...',
  531. mask: true
  532. });
  533. try {
  534. // 加密
  535. let {ciphertext, iv} = await AES_CBC_ENCRYPT(privateKey.value) || {};
  536. if(!ciphertext || !iv){
  537. return;
  538. }
  539. // console.log(ciphertext, iv);
  540. let res = await receiveGamePrize({
  541. dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value,
  542. key: ciphertext, _m: iv,
  543. });
  544. console.log(res);
  545. if (res.status == 200) {
  546. uni.hideLoading()
  547. uni.showToast({
  548. title: '领取成功',
  549. icon: 'none',
  550. duration: 1000
  551. })
  552. setTimeout(() => {
  553. getGameRank(gameDetail.value?.id)
  554. }, 1000);
  555. } else {
  556. uni.hideLoading()
  557. uni.showToast({
  558. title: res.message || "领取失败",
  559. icon: 'none',
  560. duration: 5000
  561. });
  562. }
  563. // const result = await sendSingleReward(privateKey.value,prize_money,GasRate.value);
  564. // if (result.status === "success") {
  565. // await getClaimPrize(result.hash);
  566. // }else{
  567. // uni.showToast({
  568. // title: result.message || "领取失败",
  569. // icon: 'none',
  570. // duration: 5000
  571. // });
  572. // }
  573. } catch (error) {
  574. uni.showToast({
  575. title: error.message || "领取失败",
  576. icon: 'none',
  577. duration: 5000
  578. });
  579. }
  580. }
  581. // 下拉刷新
  582. const onRefresh = () => {
  583. if (triggered.value) {
  584. return
  585. }
  586. triggered.value = true;
  587. setTimeout(() => {
  588. getGameRank(gameDetail.value?.id);
  589. triggered.value = false;
  590. }, 1000)
  591. }
  592. </script>
  593. <style lang="scss" scoped>
  594. ::v-deep .uni-scroll-view-refresh-inner{
  595. background-color: transparent !important;
  596. }
  597. .card-item{
  598. width: 100%;
  599. }
  600. .home {
  601. height: 1100px;
  602. // position: absolute;
  603. // top: 0;
  604. // bottom: 0;
  605. // right: 0;
  606. // left: 0;
  607. // overflow-y: auto;
  608. .fix-box {
  609. position: fixed;
  610. right: 0;
  611. z-index: 99;
  612. top: 258rpx;
  613. .fix-item {
  614. border-radius: 40rpx 0 0 40rpx;
  615. background-color: #734210;
  616. color: #fff;
  617. text-align: center;
  618. padding: 6rpx 24rpx;
  619. box-sizing: border-box;
  620. font-size: 26rpx;
  621. margin-bottom: 12rpx;
  622. }
  623. }
  624. }
  625. .content {
  626. height: 1100px;
  627. display: flex;
  628. flex-direction: column;
  629. align-items: center;
  630. width: 100%;
  631. // min-height: 100%;
  632. padding: 32rpx;
  633. padding-top: 168rpx;
  634. box-sizing: border-box;
  635. background-image: url("@/static/image/home/page-bg.jpg");
  636. background-size: 100%;
  637. background-position: 0 0;
  638. background-repeat: no-repeat;
  639. .home-img {
  640. width: 100%;
  641. display: flex;
  642. justify-content: center;
  643. align-items: center;
  644. image {
  645. width: 154rpx;
  646. height: 154rpx;
  647. }
  648. }
  649. .home-btn-box {
  650. display: flex;
  651. justify-content: center;
  652. align-items: center;
  653. width: 100%;
  654. position: relative;
  655. .trade-num {
  656. font-size: 32rpx;
  657. text-align: center;
  658. color: #d4ac27;
  659. background: -webkit-gradient(
  660. linear,
  661. left top,
  662. left bottom,
  663. from(#fffbe1),
  664. to(#d4ac27)
  665. );
  666. background: linear-gradient(180deg, #fffbe1 0, #d4ac27);
  667. -webkit-background-clip: text;
  668. -webkit-text-fill-color: transparent;
  669. font-weight: 700;
  670. }
  671. .image-num {
  672. position: absolute;
  673. left: 0;
  674. right: 0;
  675. bottom: 0;
  676. top: 0;
  677. display: flex;
  678. justify-content: center;
  679. align-items: center;
  680. image {
  681. width: 208rpx;
  682. height: 40rpx;
  683. }
  684. }
  685. }
  686. .home-code {
  687. margin: 24rpx 0;
  688. width: 100%;
  689. .trade-border-box {
  690. width: 520rpx;
  691. height: 100rpx;
  692. margin: auto;
  693. background-image: url("@/static/image/trade/border-jinsai.png");
  694. background-size: 100% 100%;
  695. background-position: center center;
  696. background-repeat: no-repeat;
  697. display: flex;
  698. justify-content: center;
  699. align-items: center;
  700. font-size: 36rpx;
  701. color: #fff;
  702. }
  703. .trade-border-num {
  704. text-align: center;
  705. color: #fff;
  706. font-size: 32rpx;
  707. }
  708. }
  709. .trade-img-box {
  710. width: 100%;
  711. height: 384rpx;
  712. image {
  713. width: 100%;
  714. height: 100%;
  715. }
  716. }
  717. .bg1{
  718. background-image: url("@/static/image/trade/bg1.png");
  719. }
  720. .bg2{
  721. background-image: url("@/static/image/trade/bg2.png");
  722. }
  723. .bg3{
  724. background-image: url("@/static/image/trade/bg3.png");
  725. }
  726. .trade-process {
  727. height: 131rpx;
  728. width: 100%;
  729. background-position: center center;
  730. background-size: 100% 100%;
  731. background-repeat: no-repeat;
  732. display: flex;
  733. justify-content: space-between;
  734. align-items: center;
  735. // .trde-process-item {
  736. // width: 100%;
  737. // height: 100%;
  738. // color: #4C3F2E;
  739. // display: flex;
  740. // flex-direction: column;
  741. // justify-content: center;
  742. // align-items: center;
  743. // text-align: center;
  744. // .trade-game-name {
  745. // font-size: 28rpx;
  746. // font-weight: 600;
  747. // }
  748. // .trade-game-time {
  749. // font-size: 24rpx;
  750. // margin-top: 12rpx;
  751. // }
  752. // }
  753. .trde-process-item {
  754. width: 100%;
  755. height: 100%;
  756. display: flex;
  757. flex-direction: column;
  758. text-align: center;
  759. justify-content: center;
  760. align-items: center;
  761. color: #9c9c9c;
  762. overflow: hidden;
  763. padding-left: 36rpx;
  764. box-sizing: border-box;
  765. .trade-game-name {
  766. overflow: hidden;
  767. text-overflow: ellipsis;
  768. white-space: nowrap;
  769. width: 100%;
  770. font-size: 28rpx;
  771. font-weight: 600;
  772. }
  773. .trade-game-time {
  774. font-size: 24rpx;
  775. margin-top: 12rpx;
  776. }
  777. }
  778. .trde-process-item-active {
  779. width: 100%;
  780. height: 100%;
  781. display: flex;
  782. flex-direction: column;
  783. justify-content: center;
  784. text-align: center;
  785. align-items: center;
  786. color: #493D2A;
  787. overflow: hidden;
  788. padding-left: 36rpx;
  789. box-sizing: border-box;
  790. .trade-game-name {
  791. overflow: hidden;
  792. text-overflow: ellipsis;
  793. white-space: nowrap;
  794. width: 100%;
  795. font-size: 28rpx;
  796. font-weight: 600;
  797. }
  798. .trade-game-time {
  799. font-size: 24rpx;
  800. margin-top: 12rpx;
  801. }
  802. }
  803. }
  804. .trade-time-box {
  805. margin: 24rpx 0;
  806. font-size: 28rpx;
  807. color: #a29481;
  808. background: #53473a;
  809. // background: #6E573A;
  810. border-radius: 30rpx;
  811. width: 100%;
  812. padding: 24rpx;
  813. box-sizing: border-box;
  814. display: flex;
  815. flex-direction: column;
  816. align-items: center;
  817. .time-title {
  818. text {
  819. color: rgb(255, 214, 0);
  820. font-weight: 600;
  821. }
  822. }
  823. .time-box-index {
  824. margin-top: 13rpx;
  825. display: flex;
  826. justify-content: center;
  827. align-items: center;
  828. .time__item {
  829. display: flex;
  830. justify-content: center;
  831. align-items: center;
  832. .time-box {
  833. width: 70rpx;
  834. border-radius: 4rpx;
  835. height: 56rpx;
  836. background-color: #6b5d4b;
  837. color: #f3cf9b;
  838. margin: 0 10rpx;
  839. display: flex;
  840. justify-content: center;
  841. align-items: center;
  842. }
  843. }
  844. }
  845. .start-btn {
  846. height: 84rpx;
  847. width: 190rpx;
  848. background-image: url("@/static/image/trade/weibaoming-bg.png");
  849. background-position: center center;
  850. background-size: 100% 100%;
  851. background-repeat: no-repeat;
  852. display: flex;
  853. justify-content: center;
  854. align-items: center;
  855. margin: 12rpx 0;
  856. }
  857. .num-txt {
  858. text {
  859. color: rgb(255, 214, 0);
  860. font-weight: 600;
  861. }
  862. }
  863. .num-txt-small {
  864. color: #fff;
  865. font-size: 22rpx;
  866. }
  867. }
  868. .game-play-name {
  869. width: 342rpx;
  870. height: 64rpx;
  871. margin-top: 24rpx;
  872. background-image: url("@/static/image/trade/trade-title-bg.png");
  873. background-position: center center;
  874. background-size: 100% 100%;
  875. background-repeat: no-repeat;
  876. display: flex;
  877. justify-content: center;
  878. align-items: center;
  879. color: #f5b65f;
  880. font-size: 26rpx;
  881. font-weight: 700;
  882. }
  883. .game-list {
  884. width: 100%;
  885. // height: 600px;
  886. // overflow: auto;
  887. padding-bottom: 50px;
  888. .game-list-item {
  889. display: flex;
  890. justify-content: space-between;
  891. align-items: center;
  892. padding: 24rpx 0;
  893. box-sizing: border-box;
  894. border-bottom: 2rpx solid #3b3630;
  895. .game-item-left {
  896. display: flex;
  897. justify-content: center;
  898. align-items: center;
  899. width: 100%;
  900. .game-order-index {
  901. flex-shrink: 0;
  902. width: 64rpx;
  903. height: 64rpx;
  904. margin-right: 24rpx;
  905. display: flex;
  906. justify-content: center;
  907. align-items: center;
  908. font-size: 36rpx;
  909. color: #f2ce9a;
  910. font-weight: 700;
  911. image {
  912. width: 100%;
  913. height: 100%;
  914. }
  915. }
  916. .game-order-num {
  917. flex: 1;
  918. width: 100%;
  919. display: flex;
  920. justify-content: space-between;
  921. align-items: center;
  922. .game-num-txt {
  923. font-size: 28rpx;
  924. color: #f2ce9a;
  925. font-weight: 700;
  926. }
  927. .game-num-num {
  928. margin-top: 10rpx;
  929. font-size: 28rpx;
  930. color: #fff;
  931. display: flex;
  932. justify-content: space-between;
  933. align-items: center;
  934. }
  935. }
  936. }
  937. }
  938. }
  939. }
  940. .game-item-btn {
  941. width: 178rpx;
  942. height: 54rpx;
  943. background: url("@/static/image/trade/lingqu-btn-bg.png") 50% no-repeat;
  944. background-size: 100% 100%;
  945. display: block;
  946. color: #f7dbb1;
  947. font-size: 28rpx;
  948. display: flex;
  949. justify-content: center;
  950. align-items: center;
  951. margin: 12rpx 0;
  952. }
  953. .received-box{
  954. display: flex;
  955. align-items: center;
  956. }
  957. .show-game-msg {
  958. background: #000;
  959. border-radius: 25rpx;
  960. padding: 30rpx;
  961. box-sizing: border-box;
  962. width: 80vw;
  963. height: 45vh;
  964. display: flex;
  965. flex-direction: column;
  966. position: relative;
  967. .close-img {
  968. width: 50rpx;
  969. height: 50rpx;
  970. position: absolute;
  971. right: 0;
  972. top: 0;
  973. }
  974. .show-game-title {
  975. flex-shrink: 0;
  976. font-size: 32rpx;
  977. font-weight: 700;
  978. margin-bottom: 35rpx;
  979. text-align: center;
  980. color: #fff;
  981. text {
  982. color: rgb(255, 214, 0);
  983. margin-right: 10rpx;
  984. }
  985. }
  986. .show-game-content {
  987. padding-bottom: 24rpx;
  988. box-sizing: border-box;
  989. overflow-y: auto;
  990. flex: 1;
  991. font-size: 28rpx;
  992. font-weight: 700;
  993. color: #fff;
  994. .game-msg {
  995. color: #f1dc00;
  996. font-size: 26rpx;
  997. margin-bottom: 6rpx;
  998. text {
  999. color: #fff;
  1000. font-weight: 600;
  1001. }
  1002. }
  1003. .desc-title {
  1004. padding: 12rpx 0;
  1005. box-sizing: border-box;
  1006. }
  1007. .dest-item {
  1008. font-weight: 400;
  1009. margin-bottom: 6rpx;
  1010. }
  1011. }
  1012. .show-game-bottom {
  1013. width: 100%;
  1014. flex-shrink: 0;
  1015. display: flex;
  1016. justify-content: space-between;
  1017. align-items: center;
  1018. gap: 24rpx;
  1019. .show-game-btn {
  1020. width: 100%;
  1021. background: linear-gradient(90deg, rgba(0, 179, 170, 0.7) 0, #00b3aa);
  1022. color: #fff;
  1023. height: 80rpx;
  1024. border-radius: 8rpx;
  1025. display: flex;
  1026. justify-content: center;
  1027. align-items: center;
  1028. }
  1029. .show-game-btn-wgt {
  1030. width: 100%;
  1031. background: linear-gradient(90deg, #ef602c83 0, #ef612c);
  1032. color: #fff;
  1033. height: 80rpx;
  1034. border-radius: 8rpx;
  1035. display: flex;
  1036. justify-content: center;
  1037. align-items: center;
  1038. }
  1039. .show-game-btn-stt {
  1040. width: 100%;
  1041. background: linear-gradient(90deg, #0190c470 0, #0191c4);
  1042. color: #fff;
  1043. height: 80rpx;
  1044. border-radius: 8rpx;
  1045. display: flex;
  1046. justify-content: center;
  1047. align-items: center;
  1048. // EF612C
  1049. }
  1050. }
  1051. }
  1052. ::v-deep .u-popup__content {
  1053. background: none !important;
  1054. }
  1055. </style>