index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065
  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 }}赛程 竞赛{{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 }} - {{ (Number(item.prize) || 0).toFixed(7) }}</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">{{ item.net_wins }}</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>竞赛消息
  162. </view>
  163. <view class="show-game-title" v-if="showType==1">
  164. 竞赛规则
  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 { getreportlogger,AES_CBC_ENCRYPT } 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 = (addr) => {
  306. privateKey.value = window.android.getPrivateKey();//app
  307. walletAddress.value = addr;
  308. getSysSetting();
  309. getGameMatchList();
  310. getnum(privateKey.value);
  311. };
  312. // 获取gas倍数
  313. const getSysSetting = async() => {
  314. let res = await sysSetting({category:'GasRate'});
  315. if(res.data){
  316. GasRate.value = res.data.GasRate
  317. }
  318. }
  319. sysSetting
  320. // 获取游戏赛事列表(三个tab)
  321. const getGameMatchList = async (type = true) => {
  322. let params = {
  323. dapp_id: 15,
  324. address:walletAddress.value
  325. };
  326. let res = await matchList(params);
  327. if (res.status == 200) {
  328. gameList.value = res.data;
  329. if(type){
  330. gameDetail.value = res.data[1];
  331. getGameRank(res.data[1].id);
  332. }else{
  333. gameDetail.value = res.data[2];
  334. }
  335. }
  336. };
  337. // 查询游戏赛事排名
  338. const getGameRank = async (id) => {
  339. received.value = false;
  340. let params = {
  341. dapp_id: 15,
  342. match_id:id,
  343. address:walletAddress.value
  344. };
  345. let res = await matchRank(params);
  346. if (res.status == 200) {
  347. gameRankList.value = res.data;
  348. gameRankList.value.forEach(item => {
  349. if(item.is_self && item.is_prize && gameCheck.value == 0){
  350. received.value = true;
  351. receivedItem.value = item;
  352. }
  353. });
  354. }
  355. };
  356. // 切换tab
  357. const selectGame = (value, item) => {
  358. gameCheck.value = value;
  359. gameDetail.value = item;
  360. getGameRank(item.id);
  361. };
  362. // 游戏规则弹出框
  363. const showGameMsg = ref(false);
  364. const showType=ref(0);
  365. const openGamePopup = (value) => {
  366. showGameMsg.value = true;
  367. showType.value=value;
  368. };
  369. // 获取余额
  370. const getnum = async (privateKey) =>{
  371. try {
  372. WGTbalance.value = await getBalance(privateKey,'wgt');
  373. STTbalance.value = await getBalance(privateKey,'stt');
  374. }catch(error){
  375. console.log(error)
  376. }
  377. }
  378. //校验报名
  379. const changeSign = async () =>{
  380. if (gameCheck.value != 2 || gameDetail.value?.is_enroll) return;
  381. let res = await verifyEnroll({dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value});
  382. if (res.status == 200) {
  383. entry_fee.value = Number(res.data.entry_fee).toFixed(2);
  384. wgt_price.value = Number(res.data.format?.wgt_price).toFixed(4);
  385. showGameBm.value = true;
  386. }
  387. }
  388. // 报名
  389. // const getMatchEnroll = async (hash) =>{
  390. // let res = await matchEnroll({
  391. // dapp_id:15,
  392. // match_id:gameList.value[gameCheck.value]?.id,
  393. // address:walletAddress.value,
  394. // entry_hash:hash
  395. // });
  396. // if (res.status == 200) {
  397. // uni.hideLoading()
  398. // uni.showToast({
  399. // title: '报名成功',
  400. // icon: 'none',
  401. // duration: 1000
  402. // })
  403. // setTimeout(() => {
  404. // getGameMatchList(false);
  405. // }, 1500);
  406. // }else{
  407. // uni.hideLoading()
  408. // }
  409. // }
  410. const changeWGT = async () => {
  411. if(WGTbalance.value < wgt_price.value){
  412. uni.showToast({
  413. title: '余额不足',
  414. icon: 'none',
  415. duration: 5000
  416. });
  417. return;
  418. }
  419. // await handleTokenSignUp(WGTForToken, wgt_price.value);
  420. await handleTokenSignUp('wgt', wgt_price.value);
  421. };
  422. const changeSTT = async () => {
  423. if(STTbalance.value < entry_fee.value){
  424. uni.showToast({
  425. title: '余额不足',
  426. icon: 'none',
  427. duration: 5000
  428. });
  429. return;
  430. }
  431. // await handleTokenSignUp(STTForToken, entry_fee.value);
  432. await handleTokenSignUp('stt', entry_fee.value);
  433. };
  434. const handleTokenSignUp = async (signUpFn, price) => {
  435. showGameBm.value = false;
  436. uni.showLoading({
  437. title: '报名中...',
  438. mask: true
  439. });
  440. try {
  441. // 加密
  442. let {ciphertext, iv} = await AES_CBC_ENCRYPT(privateKey.value) || {};
  443. if(!ciphertext || !iv){
  444. return;
  445. }
  446. // console.log(signUpFn, ciphertext, iv);
  447. let res = await enrollGameMatch({
  448. dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value,
  449. key: ciphertext, _m: iv, type: signUpFn
  450. });
  451. // console.log(res);
  452. if (res.status == 200) {
  453. uni.hideLoading()
  454. uni.showToast({
  455. title: '报名成功',
  456. icon: 'none',
  457. duration: 1000
  458. })
  459. setTimeout(() => {
  460. getGameMatchList(false);
  461. }, 1000);
  462. }else{
  463. uni.hideLoading()
  464. uni.showToast({
  465. title: res.message || "领取失败",
  466. icon: 'none',
  467. duration: 5000
  468. });
  469. }
  470. // const result = await signUpFn(privateKey.value, price,GasRate.value);
  471. // if (result.status === "success") {
  472. // await getMatchEnroll(result.hash);
  473. // } else {
  474. // uni.hideLoading();
  475. // uni.showToast({
  476. // title: result.message || "报名失败",
  477. // icon: 'none',
  478. // duration: 5000
  479. // });
  480. // }
  481. } catch (error) {
  482. console.log(error)
  483. uni.hideLoading();
  484. uni.showToast({
  485. title: error.message || "报名失败",
  486. icon: 'none',
  487. duration: 5000
  488. });
  489. }
  490. };
  491. //查询用户奖金信息
  492. const awardFun = async (item) => {
  493. if(item.is_receive) return;
  494. let res = await userPrize({dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value});
  495. if (res.status == 200) {
  496. if(!res.data.prize_money || res.data.prize_money == 0){
  497. uni.showToast({
  498. title: '正在结算中!',
  499. icon: 'none',
  500. duration: 1000
  501. })
  502. return;
  503. };
  504. // getreportlogger({params:res.data,name:'竞赛',type:'领取奖金'});
  505. getsendSingleReward(res.data.prize_money)
  506. }
  507. };
  508. // 领取用户奖金
  509. // const getClaimPrize = async (hash) =>{
  510. // let res = await claimPrize({
  511. // dapp_id:15,
  512. // match_id:gameDetail.value?.id,
  513. // address:walletAddress.value,
  514. // receive_hash:hash
  515. // });
  516. // if (res.status == 200) {
  517. // uni.showToast({
  518. // title: '领取成功',
  519. // icon: 'none',
  520. // duration: 1000
  521. // })
  522. // setTimeout(() => {
  523. // getGameRank(gameDetail.value?.id)
  524. // }, 500);
  525. // }
  526. // }
  527. const getsendSingleReward = async (prize_money) =>{
  528. uni.showLoading({
  529. title: '领取中...',
  530. mask: true
  531. });
  532. try {
  533. // 加密
  534. let {ciphertext, iv} = await AES_CBC_ENCRYPT(privateKey.value) || {};
  535. if(!ciphertext || !iv){
  536. return;
  537. }
  538. // console.log(ciphertext, iv);
  539. let res = await receiveGamePrize({
  540. dapp_id:15,match_id:gameDetail.value?.id,address:walletAddress.value,
  541. key: ciphertext, _m: iv,
  542. });
  543. console.log(res);
  544. if (res.status == 200) {
  545. uni.hideLoading()
  546. uni.showToast({
  547. title: '领取成功',
  548. icon: 'none',
  549. duration: 1000
  550. })
  551. setTimeout(() => {
  552. getGameRank(gameDetail.value?.id)
  553. }, 1000);
  554. } else {
  555. uni.hideLoading()
  556. uni.showToast({
  557. title: res.message || "领取失败",
  558. icon: 'none',
  559. duration: 5000
  560. });
  561. }
  562. // const result = await sendSingleReward(privateKey.value,prize_money,GasRate.value);
  563. // if (result.status === "success") {
  564. // await getClaimPrize(result.hash);
  565. // }else{
  566. // uni.showToast({
  567. // title: result.message || "领取失败",
  568. // icon: 'none',
  569. // duration: 5000
  570. // });
  571. // }
  572. } catch (error) {
  573. uni.showToast({
  574. title: error.message || "领取失败",
  575. icon: 'none',
  576. duration: 5000
  577. });
  578. }
  579. }
  580. // 下拉刷新
  581. const onRefresh = () => {
  582. if (triggered.value) {
  583. return
  584. }
  585. triggered.value = true;
  586. setTimeout(() => {
  587. getGameRank(gameDetail.value?.id);
  588. triggered.value = false;
  589. }, 1000)
  590. }
  591. </script>
  592. <style lang="scss" scoped>
  593. ::v-deep .uni-scroll-view-refresh-inner{
  594. background-color: transparent !important;
  595. }
  596. .card-item{
  597. width: 100%;
  598. }
  599. .home {
  600. height: 1100px;
  601. // position: absolute;
  602. // top: 0;
  603. // bottom: 0;
  604. // right: 0;
  605. // left: 0;
  606. // overflow-y: auto;
  607. .fix-box {
  608. position: fixed;
  609. right: 0;
  610. z-index: 99;
  611. top: 258rpx;
  612. .fix-item {
  613. border-radius: 40rpx 0 0 40rpx;
  614. background-color: #734210;
  615. color: #fff;
  616. text-align: center;
  617. padding: 6rpx 24rpx;
  618. box-sizing: border-box;
  619. font-size: 26rpx;
  620. margin-bottom: 12rpx;
  621. }
  622. }
  623. }
  624. .content {
  625. height: 1100px;
  626. display: flex;
  627. flex-direction: column;
  628. align-items: center;
  629. width: 100%;
  630. // min-height: 100%;
  631. padding: 32rpx;
  632. padding-top: 168rpx;
  633. box-sizing: border-box;
  634. background-image: url("@/static/image/home/page-bg.jpg");
  635. background-size: 100%;
  636. background-position: 0 0;
  637. background-repeat: no-repeat;
  638. .home-img {
  639. width: 100%;
  640. display: flex;
  641. justify-content: center;
  642. align-items: center;
  643. image {
  644. width: 154rpx;
  645. height: 154rpx;
  646. }
  647. }
  648. .home-btn-box {
  649. display: flex;
  650. justify-content: center;
  651. align-items: center;
  652. width: 100%;
  653. position: relative;
  654. .trade-num {
  655. font-size: 32rpx;
  656. text-align: center;
  657. color: #d4ac27;
  658. background: -webkit-gradient(
  659. linear,
  660. left top,
  661. left bottom,
  662. from(#fffbe1),
  663. to(#d4ac27)
  664. );
  665. background: linear-gradient(180deg, #fffbe1 0, #d4ac27);
  666. -webkit-background-clip: text;
  667. -webkit-text-fill-color: transparent;
  668. font-weight: 700;
  669. }
  670. .image-num {
  671. position: absolute;
  672. left: 0;
  673. right: 0;
  674. bottom: 0;
  675. top: 0;
  676. display: flex;
  677. justify-content: center;
  678. align-items: center;
  679. image {
  680. width: 208rpx;
  681. height: 40rpx;
  682. }
  683. }
  684. }
  685. .home-code {
  686. margin: 24rpx 0;
  687. width: 100%;
  688. .trade-border-box {
  689. width: 520rpx;
  690. height: 100rpx;
  691. margin: auto;
  692. background-image: url("@/static/image/trade/border-jinsai.png");
  693. background-size: 100% 100%;
  694. background-position: center center;
  695. background-repeat: no-repeat;
  696. display: flex;
  697. justify-content: center;
  698. align-items: center;
  699. font-size: 36rpx;
  700. color: #fff;
  701. }
  702. .trade-border-num {
  703. text-align: center;
  704. color: #fff;
  705. font-size: 32rpx;
  706. }
  707. }
  708. .trade-img-box {
  709. width: 100%;
  710. height: 384rpx;
  711. image {
  712. width: 100%;
  713. height: 100%;
  714. }
  715. }
  716. .bg1{
  717. background-image: url("@/static/image/trade/bg1.png");
  718. }
  719. .bg2{
  720. background-image: url("@/static/image/trade/bg2.png");
  721. }
  722. .bg3{
  723. background-image: url("@/static/image/trade/bg3.png");
  724. }
  725. .trade-process {
  726. height: 131rpx;
  727. width: 100%;
  728. background-position: center center;
  729. background-size: 100% 100%;
  730. background-repeat: no-repeat;
  731. display: flex;
  732. justify-content: space-between;
  733. align-items: center;
  734. // .trde-process-item {
  735. // width: 100%;
  736. // height: 100%;
  737. // color: #4C3F2E;
  738. // display: flex;
  739. // flex-direction: column;
  740. // justify-content: center;
  741. // align-items: center;
  742. // text-align: center;
  743. // .trade-game-name {
  744. // font-size: 28rpx;
  745. // font-weight: 600;
  746. // }
  747. // .trade-game-time {
  748. // font-size: 24rpx;
  749. // margin-top: 12rpx;
  750. // }
  751. // }
  752. .trde-process-item {
  753. width: 100%;
  754. height: 100%;
  755. display: flex;
  756. flex-direction: column;
  757. text-align: center;
  758. justify-content: center;
  759. align-items: center;
  760. color: #9c9c9c;
  761. overflow: hidden;
  762. padding-left: 36rpx;
  763. box-sizing: border-box;
  764. .trade-game-name {
  765. overflow: hidden;
  766. text-overflow: ellipsis;
  767. white-space: nowrap;
  768. width: 100%;
  769. font-size: 28rpx;
  770. font-weight: 600;
  771. }
  772. .trade-game-time {
  773. font-size: 24rpx;
  774. margin-top: 12rpx;
  775. }
  776. }
  777. .trde-process-item-active {
  778. width: 100%;
  779. height: 100%;
  780. display: flex;
  781. flex-direction: column;
  782. justify-content: center;
  783. text-align: center;
  784. align-items: center;
  785. color: #493D2A;
  786. overflow: hidden;
  787. padding-left: 36rpx;
  788. box-sizing: border-box;
  789. .trade-game-name {
  790. overflow: hidden;
  791. text-overflow: ellipsis;
  792. white-space: nowrap;
  793. width: 100%;
  794. font-size: 28rpx;
  795. font-weight: 600;
  796. }
  797. .trade-game-time {
  798. font-size: 24rpx;
  799. margin-top: 12rpx;
  800. }
  801. }
  802. }
  803. .trade-time-box {
  804. margin: 24rpx 0;
  805. font-size: 28rpx;
  806. color: #a29481;
  807. background: #53473a;
  808. // background: #6E573A;
  809. border-radius: 30rpx;
  810. width: 100%;
  811. padding: 24rpx;
  812. box-sizing: border-box;
  813. display: flex;
  814. flex-direction: column;
  815. align-items: center;
  816. .time-title {
  817. text {
  818. color: rgb(255, 214, 0);
  819. font-weight: 600;
  820. }
  821. }
  822. .time-box-index {
  823. margin-top: 13rpx;
  824. display: flex;
  825. justify-content: center;
  826. align-items: center;
  827. .time__item {
  828. display: flex;
  829. justify-content: center;
  830. align-items: center;
  831. .time-box {
  832. width: 70rpx;
  833. border-radius: 4rpx;
  834. height: 56rpx;
  835. background-color: #6b5d4b;
  836. color: #f3cf9b;
  837. margin: 0 10rpx;
  838. display: flex;
  839. justify-content: center;
  840. align-items: center;
  841. }
  842. }
  843. }
  844. .start-btn {
  845. height: 84rpx;
  846. width: 190rpx;
  847. background-image: url("@/static/image/trade/weibaoming-bg.png");
  848. background-position: center center;
  849. background-size: 100% 100%;
  850. background-repeat: no-repeat;
  851. display: flex;
  852. justify-content: center;
  853. align-items: center;
  854. margin: 12rpx 0;
  855. }
  856. .num-txt {
  857. text {
  858. color: rgb(255, 214, 0);
  859. font-weight: 600;
  860. }
  861. }
  862. .num-txt-small {
  863. color: #fff;
  864. font-size: 22rpx;
  865. }
  866. }
  867. .game-play-name {
  868. width: 342rpx;
  869. height: 64rpx;
  870. margin-top: 24rpx;
  871. background-image: url("@/static/image/trade/trade-title-bg.png");
  872. background-position: center center;
  873. background-size: 100% 100%;
  874. background-repeat: no-repeat;
  875. display: flex;
  876. justify-content: center;
  877. align-items: center;
  878. color: #f5b65f;
  879. font-size: 26rpx;
  880. font-weight: 700;
  881. }
  882. .game-list {
  883. width: 100%;
  884. // height: 600px;
  885. // overflow: auto;
  886. padding-bottom: 50px;
  887. .game-list-item {
  888. display: flex;
  889. justify-content: space-between;
  890. align-items: center;
  891. padding: 24rpx 0;
  892. box-sizing: border-box;
  893. border-bottom: 2rpx solid #3b3630;
  894. .game-item-left {
  895. display: flex;
  896. justify-content: center;
  897. align-items: center;
  898. width: 100%;
  899. .game-order-index {
  900. flex-shrink: 0;
  901. width: 64rpx;
  902. height: 64rpx;
  903. margin-right: 24rpx;
  904. display: flex;
  905. justify-content: center;
  906. align-items: center;
  907. font-size: 36rpx;
  908. color: #f2ce9a;
  909. font-weight: 700;
  910. image {
  911. width: 100%;
  912. height: 100%;
  913. }
  914. }
  915. .game-order-num {
  916. flex: 1;
  917. width: 100%;
  918. display: flex;
  919. justify-content: space-between;
  920. align-items: center;
  921. .game-num-txt {
  922. font-size: 28rpx;
  923. color: #f2ce9a;
  924. font-weight: 700;
  925. }
  926. .game-num-num {
  927. margin-top: 10rpx;
  928. font-size: 28rpx;
  929. color: #fff;
  930. display: flex;
  931. justify-content: space-between;
  932. align-items: center;
  933. }
  934. }
  935. }
  936. }
  937. }
  938. }
  939. .game-item-btn {
  940. width: 178rpx;
  941. height: 54rpx;
  942. background: url("@/static/image/trade/lingqu-btn-bg.png") 50% no-repeat;
  943. background-size: 100% 100%;
  944. display: block;
  945. color: #f7dbb1;
  946. font-size: 28rpx;
  947. display: flex;
  948. justify-content: center;
  949. align-items: center;
  950. margin: 12rpx 0;
  951. }
  952. .received-box{
  953. display: flex;
  954. align-items: center;
  955. }
  956. .show-game-msg {
  957. background: #000;
  958. border-radius: 25rpx;
  959. padding: 30rpx;
  960. box-sizing: border-box;
  961. width: 80vw;
  962. height: 60vh;
  963. display: flex;
  964. flex-direction: column;
  965. position: relative;
  966. .close-img {
  967. width: 50rpx;
  968. height: 50rpx;
  969. position: absolute;
  970. right: 0;
  971. top: 0;
  972. }
  973. .show-game-title {
  974. flex-shrink: 0;
  975. font-size: 32rpx;
  976. font-weight: 700;
  977. margin-bottom: 35rpx;
  978. text-align: center;
  979. color: #fff;
  980. text {
  981. color: rgb(255, 214, 0);
  982. margin-right: 10rpx;
  983. }
  984. }
  985. .show-game-content {
  986. padding-bottom: 24rpx;
  987. box-sizing: border-box;
  988. overflow-y: auto;
  989. flex: 1;
  990. font-size: 28rpx;
  991. font-weight: 700;
  992. color: #fff;
  993. .game-msg {
  994. color: #f1dc00;
  995. font-size: 26rpx;
  996. margin-bottom: 6rpx;
  997. text {
  998. color: #fff;
  999. font-weight: 600;
  1000. }
  1001. }
  1002. .desc-title {
  1003. padding: 12rpx 0;
  1004. box-sizing: border-box;
  1005. }
  1006. .dest-item {
  1007. font-weight: 400;
  1008. margin-bottom: 6rpx;
  1009. }
  1010. }
  1011. .show-game-bottom {
  1012. width: 100%;
  1013. flex-shrink: 0;
  1014. display: flex;
  1015. justify-content: space-between;
  1016. align-items: center;
  1017. gap: 24rpx;
  1018. .show-game-btn {
  1019. width: 100%;
  1020. background: linear-gradient(90deg, rgba(0, 179, 170, 0.7) 0, #00b3aa);
  1021. color: #fff;
  1022. height: 80rpx;
  1023. border-radius: 8rpx;
  1024. display: flex;
  1025. justify-content: center;
  1026. align-items: center;
  1027. }
  1028. .show-game-btn-wgt {
  1029. width: 100%;
  1030. background: linear-gradient(90deg, #ef602c83 0, #ef612c);
  1031. color: #fff;
  1032. height: 80rpx;
  1033. border-radius: 8rpx;
  1034. display: flex;
  1035. justify-content: center;
  1036. align-items: center;
  1037. }
  1038. .show-game-btn-stt {
  1039. width: 100%;
  1040. background: linear-gradient(90deg, #0190c470 0, #0191c4);
  1041. color: #fff;
  1042. height: 80rpx;
  1043. border-radius: 8rpx;
  1044. display: flex;
  1045. justify-content: center;
  1046. align-items: center;
  1047. // EF612C
  1048. }
  1049. }
  1050. }
  1051. ::v-deep .u-popup__content {
  1052. background: none !important;
  1053. }
  1054. </style>