index.vue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061
  1. <template>
  2. <view class="container" :style="{paddingBottom:heightMath.bottomHeight+'px'}">
  3. <countdown-time :downTime='initPaopao.timeStart' :list='list' :isClose='initPaopao.isClose'
  4. @timeOut='startGame'></countdown-time>
  5. <!-- 头部banner -->
  6. <view class="topBox">
  7. <image class="topImgBg" src="../../static/img/ganme01/gamebg.png" mode="widthFix"></image>
  8. <!-- <view class="leftGz">
  9. 规则
  10. </view> -->
  11. <view class="moneyIcon flex">
  12. <image class="icon" src="../../static/img/ganme01/icontb.png" mode="scaleToFill"></image>
  13. <text>{{userinfo.integral}}</text>
  14. </view>
  15. <!-- <view class="jlBox flex">
  16. <image class="icon" src="../../static/img/ganme01/iconjlu.png" mode="scaleToFill"></image>
  17. <text>
  18. 记录>
  19. </text>
  20. </view> -->
  21. </view>
  22. <view class="userBg" :style="{animationPlayState:initPaopao.gameState==1?'running':'paused'}">
  23. </view>
  24. <!-- 头部bannerEnd -->
  25. <!-- 跑道 -->
  26. <view class="content">
  27. <view class="listItem" v-for="(item,index) in list">
  28. <view class="line" v-if="index>0"></view>
  29. <view class="itemBox">
  30. <!-- 当前跑道数 -->
  31. <view class="indexItem flex" :style="{left:initPaopao.gameState>0?'-200rpx':'150rpx'}">
  32. <view class="leftI"></view>
  33. <view class="LeftInd">
  34. {{index+1}}
  35. </view>
  36. </view>
  37. <!-- 当前跑道数 -->
  38. <!-- 名次排行 -->
  39. <!-- 右侧头像 -->
  40. <view class="rightImgAv flex"
  41. :style="{marginRight:item.margin+'rpx',transitionDuration: item.time+'s'}">
  42. <view class="amdImg" :style="{
  43. animationDuration:item.speed +'s',
  44. animationPlayState:item.paopao?'running':'paused',
  45. backgroundImage:`url(${urlFile}/static/img/ganme01/xdwP0${index+1}.png)`
  46. }">
  47. </view>
  48. </view>
  49. <!-- 右侧头像END -->
  50. <!-- 左侧详情 -->
  51. <view class="levelBox flex" :class="{noWin:item.pm!=1,win:item.pm==1}"
  52. :style="{marginRight:item.onEnd?0:'',transitionDuration: item.time+'s'}">
  53. <view class="levelLeft flex">
  54. <view class="imgAvBox flex" :class="{noWin:item.pm!=1,win:item.pm==1}">
  55. <image class="imgAv" :src="`../../static/img/ganme01/xdw0${index+1}.png`"
  56. mode="widthFix">
  57. </image>
  58. </view>
  59. <view class="levelContent">
  60. <view class="levelItemName" :class="{noWin:item.pm!=1,win:item.pm==1}">
  61. {{item.name}}
  62. </view>
  63. <view class="levelItemEnName">
  64. {{item.enName}}
  65. </view>
  66. </view>
  67. <view class="rightTIp"></view>
  68. </view>
  69. <view class="levelRight">
  70. {{item.pm}}
  71. </view>
  72. </view>
  73. <!-- 左侧详情END -->
  74. <!-- 名次排行END -->
  75. </view>
  76. </view>
  77. <image class="saidao" :style="{marginRight:(initPaopao.gameState==2)?'170rpx':'-30rpx'}"
  78. src="../../static/img/ganme01/saidao.png" mode="widthFix"></image>
  79. </view>
  80. <!-- 跑道END -->
  81. <!-- 底部投票 -->
  82. <view class="bottomBox">
  83. <!-- 底部标题 -->
  84. <view class="bottomTitle flex">
  85. <view class="titleLeft flex">
  86. <image class="titleRtip" src="../../static/img/ganme01/icongj.png" mode="widthFix"></image>
  87. <view class="title">
  88. 猜冠军
  89. </view>
  90. <view class="tip">
  91. 猜对得1分红积分
  92. </view>
  93. </view>
  94. <view class="titleRight flex">
  95. <image class="rightIcon" src="../../static/img/ganme01/iconrw.png" mode="widthFix"></image>
  96. <view class="rightNum">
  97. {{initPaopao.userNum}}
  98. </view>
  99. </view>
  100. </view>
  101. <!-- 底部标题END -->
  102. <!-- 动物列表 -->
  103. <view class="bottoItemList flex">
  104. <view v-for="(item,index) in list" class="item flex" @click="checkedItem(item.key)"
  105. :class="{itemchecked:initPaopao.checked==item.key}">
  106. <image class="itemIcon" :src="`../../static/img/ganme01/xdw0${index+1}.png`" mode="widthFix">
  107. </image>
  108. <view class="nameBox">
  109. <view class="name">
  110. {{item.name}}
  111. </view>
  112. <view class="nameTip">
  113. {{item.enName}}
  114. </view>
  115. </view>
  116. <view class="topMoneyTip flex" v-if="item.money>0">
  117. <image class="topMoneyTipIcon" src="../../static/img/ganme01/icontb.png" mode="widthFix">
  118. </image>
  119. <text class="itemMoney">
  120. {{item.money}}
  121. </text>
  122. </view>
  123. </view>
  124. </view>
  125. <!-- 动物列表END -->
  126. <view class="buttomBox flex">
  127. <!-- <image class="leftIcon" src="../../static/img/ganme01/iconDj.png" mode="widthFix"></image> -->
  128. <view class="buttom flex">
  129. <view class="buttomLeft flex">
  130. <view>
  131. <view class="name">
  132. 积分
  133. </view>
  134. <view class="num">
  135. 100
  136. </view>
  137. </view>
  138. </view>
  139. <view class="buttomRight flex">
  140. <view class="left">
  141. <view class="tip">
  142. 消耗100积分
  143. </view>
  144. <view class="tip">
  145. 中奖后获得1分红积分
  146. </view>
  147. </view>
  148. <view class="right flex" @click="onStart">
  149. <view class="cont">
  150. </view>
  151. <view>
  152. 竞猜
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. <view class="backMask" v-if="initPaopao.isClose==true"></view>
  159. </view>
  160. <!-- 底部投票END -->
  161. <ljt :show="initPaopao.phShow" :list='list' @change='phbMask'></ljt>
  162. <popup :status="initPaopao.winStatus" :money='initPaopao.winMoney' @close='initGame'></popup>
  163. </view>
  164. </template>
  165. <script>
  166. import {
  167. getUserInfo
  168. } from "../../api/login.js"
  169. import {
  170. mapState
  171. } from "vuex"
  172. import {
  173. gameDetail,
  174. gameSetCu,
  175. gameGameLast
  176. } from "../../api/game.js"
  177. import countdownTime from "./compon/paopao-countdown.vue"
  178. import ljt from "./compon/paopao-ljt.vue"
  179. import popup from "./compon/paopao-popup.vue"
  180. export default {
  181. components: {
  182. countdownTime,
  183. ljt,
  184. popup,
  185. },
  186. computed: {
  187. ...mapState(['urlFile'])
  188. },
  189. data() {
  190. return {
  191. // 游戏基础数据保存对象
  192. initPaopao: {
  193. onBgAnimation: false, //座位席背景动画
  194. checked: 1, //当前选中的要投票的人物
  195. game: '', //保存跑步中的游戏对象
  196. gameState: 0, //判断游戏状态0未开始,1跑步中,2已结束
  197. marginSt: 630, //开始时右侧距离
  198. marginEnd: 30, //结束时右侧距离
  199. sp: 500, //每秒移动距离
  200. time: 5, //跑步计算间隔时间
  201. baseTime: 2, //最低移动需要时间
  202. isClose: true, //倒计时是否关闭
  203. timeStart: 10086, //下次游戏开始时间
  204. userNum: 0, //参与当前游戏的用户数
  205. money: 0, //投注获取积分
  206. getGameData: '', //获取游戏结果数据定时器
  207. winXdw: 0, //保存上局胜利的小动物
  208. winMoney: 0, //保存胜利后获取的积分数
  209. winStatus: 0, //0不显示1获奖2未获奖
  210. phShow: false //是否显示排行结果
  211. },
  212. heightMath: {
  213. pageHeight: 0,
  214. bannerHeight: 0,
  215. bottomHeight: 0,
  216. cMathNum: 30,
  217. },
  218. pageWidth: 0, //页面宽度
  219. list: [{
  220. key: 1,
  221. name: '猴子',
  222. enName: 'Monkey',
  223. onEnd: false, //是否已经跑步结束
  224. margin: 630, //动物离右侧的距离
  225. time: 1, //动物移动时动画效果时间
  226. pm: 0, //排名
  227. money: 0, //当前所投注的金额
  228. speed: 1, //小动物跑步速度
  229. paopao: false, //小动物是否开始跑步
  230. },
  231. {
  232. key: 2,
  233. name: '老虎',
  234. enName: 'Tiger',
  235. onEnd: false,
  236. margin: 630,
  237. time: 1,
  238. pm: 0,
  239. money: 0,
  240. speed: 1, //小动物跑步速度
  241. paopao: false, //小动物是否开始跑步
  242. },
  243. {
  244. key: 3,
  245. name: '老鼠',
  246. enName: 'Mouse',
  247. onEnd: false,
  248. margin: 630,
  249. time: 1,
  250. pm: 0,
  251. money: 0,
  252. speed: 1, //小动物跑步速度
  253. paopao: false, //小动物是否开始跑步
  254. },
  255. {
  256. key: 4,
  257. name: '龙',
  258. enName: 'Dragon',
  259. onEnd: false,
  260. margin: 630,
  261. time: 1,
  262. pm: 0,
  263. money: 0,
  264. speed: 1, //小动物跑步速度
  265. paopao: false, //小动物是否开始跑步
  266. },
  267. {
  268. key: 5,
  269. name: '马',
  270. enName: 'Horse',
  271. onEnd: false,
  272. margin: 630,
  273. time: 1,
  274. pm: 0,
  275. money: 0,
  276. speed: 1, //小动物跑步速度
  277. paopao: false, //小动物是否开始跑步
  278. },
  279. {
  280. key: 6,
  281. name: '猪',
  282. enName: 'Pig',
  283. onEnd: false,
  284. margin: 630,
  285. time: 1,
  286. pm: 0,
  287. money: 0,
  288. speed: 1, //小动物跑步速度
  289. paopao: false, //小动物是否开始跑步
  290. },
  291. ],
  292. userinfo: {
  293. integral: 0
  294. },
  295. loadUserData: false, //是否加载过数据
  296. phList: [] //跑步排行
  297. };
  298. },
  299. onLoad(option) {
  300. if (option.token) {
  301. // 保存token;
  302. uni.setStorageSync('token', option.token)
  303. }
  304. // 初始化跑步
  305. this.init();
  306. },
  307. onShow() {
  308. console.log(this.urlFile);
  309. // 获取用户数据
  310. this.getUserInfo();
  311. },
  312. onReady: function(option) {
  313. let that = this;
  314. setTimeout((e) => {
  315. uni.createSelectorQuery().select(".topBox").fields({
  316. size: true,
  317. }, (e) => {
  318. that.heightMath.bannerHeight = e.height;
  319. }).exec();
  320. uni.createSelectorQuery().select(".bottomBox").fields({
  321. size: true,
  322. }, (e) => {
  323. that.heightMath.bottomHeight = e.height;
  324. }).exec();
  325. uni.createSelectorQuery().select(".container").fields({
  326. size: true,
  327. }, (e) => {
  328. that.heightMath.pageHeight = e.height;
  329. that.pageWidth = e.width;
  330. }).exec();
  331. }, 50)
  332. },
  333. methods: {
  334. // 刷新游戏数据
  335. gameRefresh() {
  336. // 保证只加载一次游戏数据
  337. if (this.userinfo.uid && !this.loadUserData) {
  338. this.loadUserData = true;
  339. // 获取游戏数据
  340. this.gameDetail();
  341. }
  342. },
  343. // 测试结束游戏
  344. // stopGame() {
  345. // // 清除倒计时
  346. // clearInterval(this.initPaopao.getGameData)
  347. // // 保存第一名数据
  348. // this.initPaopao.winXdw = 1
  349. // this.initPaopao.winMoney = 100
  350. // // 结束游戏
  351. // this.onEndGame();
  352. // },
  353. // 排行榜遮罩层事件
  354. phbMask(e) {
  355. console.log();
  356. if (e.show == false) {
  357. console.log("结果");
  358. if (this.initPaopao.winMoney > 0) {
  359. this.initPaopao.winStatus = 1
  360. } else {
  361. this.initPaopao.winStatus = 2
  362. }
  363. console.log("结果", this.initPaopao.winStatus);
  364. }
  365. },
  366. // 定时获取游戏结果
  367. getGameData() {
  368. gameGameLast().then((e) => {
  369. if (e.data.last_open.length > 0) {
  370. // 清除倒计时
  371. clearInterval(this.initPaopao.getGameData)
  372. // 保存第一名数据
  373. this.initPaopao.winXdw = e.data.last_open[0];
  374. this.initPaopao.winMoney = e.data.my
  375. this.phShow = true; //显示排行
  376. // 结束游戏
  377. this.onEndGame();
  378. }
  379. }).catch((e) => {
  380. console.log(e);
  381. })
  382. },
  383. // 获取当前进行中的游戏基础数据
  384. gameDetail() {
  385. gameDetail().then((e) => {
  386. try {
  387. // 下一次场游戏预计开始时间
  388. this.initPaopao.timeStart = e.data.last_game.time * 1000 + e.data.time_span * 1000 - 1000;
  389. for (let i = 0; i < this.list.length; i++) {
  390. this.list[i].winNum = e.data.times[i + 1];
  391. }
  392. const data = (new Date()).getTime();
  393. // 判断是否已经倒计时结束开始游戏
  394. if (data - this.initPaopao.timeStart < 0) {
  395. // 显示倒计时弹窗
  396. this.initPaopao.isClose = false;
  397. } else {
  398. // 关闭倒计时弹窗
  399. this.initPaopao.isClose = true;
  400. // 游戏开始
  401. this.startGame()
  402. }
  403. // 当前参与游戏的用户数量
  404. this.initPaopao.userNum = e.data.join_member
  405. // 保存投的积分
  406. this.initPaopao.money = +e.data.join_price
  407. // 保存投注信息
  408. const join = e.data.join
  409. for (let i = 0; i < join.length; i++) {
  410. this.list[join[i].num - 1].money = (+join[i].ticket) * this.initPaopao.money
  411. }
  412. } catch (e) {
  413. console.log(e, '错误');
  414. //TODO handle the exception
  415. }
  416. }).catch((e) => {
  417. console.log(e);
  418. })
  419. },
  420. // 获取用户信息
  421. getUserInfo() {
  422. getUserInfo().then((e) => {
  423. this.userinfo = e.data;
  424. this.userinfo.integral = +e.data.integral;
  425. this.gameRefresh();
  426. }).catch((e) => {
  427. console.log(e);
  428. })
  429. },
  430. // 初始化右侧距离
  431. init() {
  432. // 初始化右侧距离
  433. for (let i = 0; i < this.list.length; i++) {
  434. this.list[i].margin = this.initPaopao.marginSt
  435. }
  436. },
  437. // 结果展示
  438. // 初始化游戏
  439. initGame() {
  440. clearInterval(this.initPaopao.game);
  441. // 初始化游戏进度
  442. this.initPaopao.gameState = 0;
  443. // 初始化获取积分弹窗
  444. this.initPaopao.winStatus = 0;
  445. // 初始化获取的资金
  446. this.initPaopao.winMoney = 0;
  447. // 初始化允许投注
  448. this.initPaopao.isClose = false;
  449. // 初始化获取游戏信息
  450. this.gameDetail();
  451. for (var i = 0; i < this.list.length; i++) {
  452. let item = this.list[i]
  453. item.onEnd = false;
  454. item.time = 0;
  455. item.margin = this.initPaopao.marginSt;
  456. item.money = 0;
  457. }
  458. },
  459. // 游戏开始
  460. startGame() {
  461. // 设置当前游戏状态为跑步中
  462. this.initPaopao.gameState = 1;
  463. // 设置背景观众席开始动画
  464. this.initPaopao.onBgAnimation = true;
  465. // 游戏倒计时显示隐藏
  466. this.initPaopao.isClose = true;
  467. // 开始调用跑步
  468. this.runGame();
  469. // 开始调用获取游戏数据
  470. this.getGameData()
  471. // 清除倒计时
  472. clearInterval(this.initPaopao.getGameData)
  473. // 定时获取游戏数据
  474. this.initPaopao.getGameData = setInterval(() => {
  475. this.getGameData()
  476. }, 20000)
  477. },
  478. // 小动物跑步结束后执行方法
  479. onEndGame() {
  480. this.endGame().then(() => {
  481. // 显示排行榜
  482. this.initPaopao.phShow = true;
  483. // 复制数组
  484. const ar = this.list.map((e) => {
  485. return e
  486. })
  487. // 更新列表显示正确的排行榜
  488. this.$set(this, 'list', ar)
  489. })
  490. },
  491. // 小动物跑步结束
  492. endGame() {
  493. return new Promise((ok, erro) => {
  494. const that = this;
  495. try {
  496. clearInterval(that.initPaopao.game);
  497. // 保存当前第一名
  498. const one = that.initPaopao.winXdw;
  499. const Paopao = that.initPaopao;
  500. for (let i = 0; i < that.list.length; i++) {
  501. const item = that.list[i]
  502. // 随机跑步距离
  503. if (one == item.key) {
  504. item.margin = Paopao.marginEnd;
  505. item.time = Paopao.baseTime
  506. } else {
  507. // 保障除开第一名外其他动物距离终点比第一名远
  508. item.margin = Math.floor(Math.random() * 530) + 150;
  509. item.time = Math.ceil(Math.random() * 3) + Paopao.baseTime;
  510. }
  511. // 设置第一名的排名
  512. if (item.key == one) {
  513. item.pm = 1
  514. }
  515. }
  516. // 用于保存除开第一名外的当前排名位置
  517. const arr = that.list.map((e) => {
  518. return e;
  519. }).sort((e, b) => {
  520. return e.margin - b.margin
  521. }).filter((item, index, arr) => {
  522. return item.key != one;
  523. });
  524. // 保证第一名已跑到头部
  525. setTimeout(() => {
  526. // 设置当前游戏已经结束
  527. Paopao.gameState = 2;
  528. // 保存多少时间后最后一名到达终点
  529. let timeEnd = 0
  530. for (let i = 0; i < that.list.length; i++) {
  531. const item = that.list[i]
  532. // 随机跑步距离
  533. item.onEnd = true;
  534. item.time = item.margin / 300 * 2;
  535. // 关闭动物跑步
  536. setTimeout((e) => {
  537. item.paopao = false;
  538. },item.time*1000)
  539. // 判断是否为最后一名到达终点
  540. if (timeEnd < item.time) {
  541. timeEnd = item.time
  542. }
  543. // 初始化最初距离
  544. item.margin = Paopao.marginEnd;
  545. // 保存每个动物的当前排名
  546. for (let s = 0; s < arr.length; s++) {
  547. if (arr[s].key == item.key) {
  548. item.pm = s + 2
  549. }
  550. }
  551. }
  552. // 判断最后一个小动物是否跑完
  553. setTimeout((e) => {
  554. ok()
  555. }, timeEnd * 1000 + 1000)
  556. }, 1500)
  557. } catch (e) {
  558. erro(e)
  559. //TODO handle the exception
  560. }
  561. })
  562. },
  563. // 游戏跑动中的距离
  564. runGame() {
  565. // 计算小动物跑步
  566. this.randomObj()
  567. clearInterval(this.initPaopao.game)
  568. // 循环计算小动物跑步
  569. this.initPaopao.game = setInterval((e) => {
  570. this.randomObj()
  571. }, 5000)
  572. },
  573. // 随机小动物跑步及动画时间
  574. randomObj() {
  575. for (var i = 0; i < this.list.length; i++) {
  576. // 保存当前距离,用于计算跑步速度
  577. const actionMargin = this.list[i].margin;
  578. // 随机新跑步距离
  579. this.list[i].margin = Math.floor(Math.random() * 530) + 100;
  580. this.list[i].paopao = true;
  581. // 判断是否减速
  582. if (this.list[i].margin > actionMargin) {
  583. this.list[i].speed = (this.list[i].margin - actionMargin) / this.list[i].margin + 0.5;
  584. } else {
  585. this.list[i].speed = 0.5 - (actionMargin-this.list[i].margin ) / actionMargin*0.5;
  586. }
  587. // 随机跑步速度
  588. this.list[i].time = Math.ceil(Math.random() * 3) + this.initPaopao.baseTime;
  589. }
  590. },
  591. // 选中的要投票的小动物
  592. checkedItem(ind) {
  593. this.initPaopao.checked = ind
  594. },
  595. // 开始竞猜投票
  596. onStart() {
  597. if (this.userinfo.integral - this.initPaopao.money < 0) {
  598. uni.showModal({
  599. title: '错误',
  600. content: '您的积分余额不足无法参与竞猜',
  601. showCancel: false,
  602. });
  603. return
  604. } else {
  605. // 增加投注金额
  606. this.list[this.initPaopao.checked - 1].money += this.initPaopao.money;
  607. this.userinfo.integral -= this.initPaopao.money;
  608. }
  609. // 游戏
  610. gameSetCu({
  611. num: this.initPaopao.checked,
  612. ticket: 1,
  613. }).then((e) => {
  614. console.log(e, '返回');
  615. }).catch((e) => {
  616. console.log(e);
  617. })
  618. }
  619. }
  620. };
  621. </script>
  622. <style lang="scss">
  623. @keyframes bgA {
  624. from {
  625. background-position: 0 0;
  626. }
  627. to {
  628. background-position: -1316rpx 0;
  629. }
  630. }
  631. .flex {
  632. display: flex;
  633. justify-content: space-between;
  634. align-items: center;
  635. }
  636. .buttomBox {
  637. padding-top: 10rpx;
  638. .leftIcon {
  639. width: 120rpx;
  640. margin-right: 20rpx;
  641. }
  642. .buttom {
  643. flex-grow: 1;
  644. border-radius: 20rpx;
  645. height: 110rpx;
  646. font-weight: bold;
  647. overflow: hidden;
  648. .buttomLeft {
  649. background: linear-gradient(0deg, #F5B231, #F5CA31);
  650. height: 100%;
  651. justify-content: center;
  652. min-width: 150rpx;
  653. .name {
  654. text-align: center;
  655. font-size: 24rpx;
  656. }
  657. .num {
  658. font-size: 48rpx;
  659. text-align: center;
  660. }
  661. }
  662. .buttomRight {
  663. flex-grow: 1;
  664. color: #FFFFFF;
  665. height: 100%;
  666. padding: 0 20rpx;
  667. background: linear-gradient(0deg, #E9254E, #F4869D);
  668. .left {
  669. font-size: 24rpx;
  670. line-height: 1.5;
  671. }
  672. .cont {
  673. height: 40rpx;
  674. width: 2px;
  675. background-color: #FFFFFF;
  676. margin-right: 40rpx;
  677. }
  678. .right {
  679. font-size: 60rpx;
  680. margin-right: 20rpx;
  681. }
  682. }
  683. }
  684. }
  685. .content {
  686. background: linear-gradient(0deg, #F2977C, #FFCBBC);
  687. padding-top: 10rpx;
  688. position: relative;
  689. .saidao {
  690. transition: margin-right 1s linear;
  691. // position: absolute;
  692. // right: 170rpx;
  693. // top: 0;
  694. width: 30rpx;
  695. z-index: 1;
  696. margin-top: -660rpx;
  697. float: right;
  698. margin-right: 170rpx;
  699. }
  700. .listItem {
  701. .line {
  702. background: #FFFFFF;
  703. opacity: 0.6;
  704. width: 100%;
  705. height: 10rpx;
  706. }
  707. .itemBox {
  708. height: 100rpx;
  709. overflow: hidden;
  710. position: relative;
  711. z-index: 5;
  712. .indexItem {
  713. position: absolute;
  714. left: 150rpx;
  715. top: 0;
  716. height: 100%;
  717. transition: left 1s linear;
  718. .leftI {
  719. width: 4px;
  720. height: 60rpx;
  721. background-color: #FFFFFF;
  722. }
  723. .LeftInd {
  724. line-height: 1;
  725. margin: 0 30rpx;
  726. color: #FFFFFF;
  727. font-size: 60rpx;
  728. font-weight: bold;
  729. }
  730. }
  731. .levelBox {
  732. padding: 5rpx 50rpx;
  733. width: 400rpx;
  734. height: 100rpx;
  735. float: right;
  736. margin-right: 100%;
  737. transition: margin-right 0.3s ease-out;
  738. &.win {
  739. background: linear-gradient(90deg, rgba(255, 113, 143, 0), #F5B231, rgba($color: #F5CA31, $alpha: 0.72), rgba(255, 113, 143, 0));
  740. }
  741. &.noWin {
  742. background: linear-gradient(90deg, rgba(255, 113, 143, 0), #FF718F, rgba(255, 113, 143, 0.72), rgba(255, 113, 143, 0));
  743. }
  744. .levelLeft {
  745. align-items: stretch;
  746. height: 90rpx;
  747. .imgAvBox {
  748. border: 2px solid #FFFFFF;
  749. border-radius: 999rpx;
  750. padding: 10rpx;
  751. z-index: 1;
  752. &.win {
  753. background-color: rgba($color: #F5CA31, $alpha: 1);
  754. }
  755. &.noWin {
  756. background-color: rgba(255, 113, 143, 1);
  757. }
  758. .imgAv {
  759. width: 70rpx;
  760. }
  761. }
  762. .rightTIp {
  763. height: 100%;
  764. border-bottom: 90rpx solid #FFFFFF;
  765. border-right: 45rpx solid rgba($color: #FFFFFF, $alpha: 0);
  766. }
  767. .levelContent {
  768. width: 150rpx;
  769. margin-left: -45rpx;
  770. align-self: stretch;
  771. height: 100%;
  772. background-color: #FFFFFF;
  773. color: #7B3C0E;
  774. font-weight: bold;
  775. .levelItemName {
  776. padding-left: 45rpx;
  777. font-size: 28rpx;
  778. line-height: 50rpx;
  779. &.win {
  780. background: linear-gradient(90deg, rgba($color: #F5CA31, $alpha: 0.72), rgba(255, 113, 143, 0));
  781. }
  782. &.noWin {
  783. background: linear-gradient(90deg, rgba(255, 113, 143, 0.72), rgba(255, 113, 143, 0));
  784. }
  785. }
  786. .levelItemEnName {
  787. padding-left: 45rpx;
  788. font-size: 20rpx;
  789. line-height: 1.5;
  790. }
  791. }
  792. }
  793. .levelRight {
  794. font-size: 60rpx;
  795. font-weight: bold;
  796. color: #FFFFFF;
  797. text-shadow: 0px 3rpx 7rpx rgba(0, 0, 0, 0.52);
  798. }
  799. }
  800. .rightImgAv {
  801. transition: margin-right 1s linear;
  802. margin-right: 50rpx;
  803. margin-left: 60rpx;
  804. float: right;
  805. height: 100%;
  806. z-index: 1;
  807. .imgAv {
  808. width: 90rpx;
  809. }
  810. .amdImg {
  811. width: 60px;
  812. height: 60px;
  813. background-size: auto 60px;
  814. animation-name: paopao;
  815. animation-duration: 1s;
  816. animation-timing-function: steps(13);
  817. animation-iteration-count: infinite;
  818. animation-play-state: paused;
  819. }
  820. }
  821. }
  822. }
  823. }
  824. .bottomBox {
  825. position: fixed;
  826. bottom: 0;
  827. left: 0;
  828. right: 0;
  829. border-top-left-radius: 50rpx;
  830. border-top-right-radius: 50rpx;
  831. background-image: url(../../static/img/ganme01/bottomBg.png);
  832. background-repeat: no-repeat;
  833. background-size: 100% auto;
  834. background-color: #F2977C;
  835. color: #7B3C0E;
  836. font-weight: bold;
  837. line-height: 1;
  838. padding: 0 20rpx;
  839. padding-bottom: 30rpx;
  840. z-index: 99;
  841. .backMask {
  842. position: absolute;
  843. top: 0;
  844. left: 0;
  845. right: 0;
  846. bottom: 0;
  847. background-color: rgba($color: #000000, $alpha: 0.3);
  848. }
  849. .bottomTitle {
  850. padding: 30rpx 5rpx;
  851. .titleLeft {
  852. .titleRtip {
  853. width: 60rpx;
  854. margin-right: 10rpx;
  855. }
  856. .title {
  857. font-size: 38rpx;
  858. margin-right: 10rpx;
  859. }
  860. .tip {
  861. font-size: 28rpx;
  862. }
  863. }
  864. .titleRight {
  865. .rightIcon {
  866. width: 30rpx;
  867. margin-right: 5rpx;
  868. }
  869. .rightNum {
  870. font-size: 35rpx;
  871. }
  872. }
  873. }
  874. .bottoItemList {
  875. flex-wrap: wrap;
  876. .item {
  877. width: 225rpx;
  878. height: 110rpx;
  879. border: 3px solid #FFFFFF;
  880. border-radius: 15rpx;
  881. padding: 0 10rpx;
  882. margin-bottom: 20rpx;
  883. position: relative;
  884. &.itemchecked {
  885. border-color: #FF2553;
  886. }
  887. .itemIcon {
  888. width: 90rpx;
  889. }
  890. .nameBox {
  891. .name {
  892. font-size: 28rpx;
  893. }
  894. .nameTip {
  895. font-size: 20rpx;
  896. }
  897. }
  898. .topMoneyTip {
  899. padding: 0 15rpx;
  900. border-radius: 50rpx;
  901. position: absolute;
  902. top: -15rpx;
  903. height: 35rpx;
  904. right: 20rpx;
  905. background-color: $color-red;
  906. .topMoneyTipIcon {
  907. width: 24rpx;
  908. margin-right: 10rpx;
  909. }
  910. .itemMoney {
  911. color: $font-color-white;
  912. font-size: 24rpx;
  913. line-height: 1;
  914. }
  915. }
  916. }
  917. }
  918. }
  919. .container {
  920. line-height: 1;
  921. background-color: #F2977C;
  922. .userBg {
  923. z-index: 60;
  924. position: relative;
  925. margin-top: -50rpx;
  926. height: 130rpx;
  927. background-image: url(../../static/img/ganme01/pp.png);
  928. background-size: auto 130rpx;
  929. background-repeat: repeat-x;
  930. animation: bgA 8s infinite linear;
  931. animation-play-state: paused;
  932. }
  933. .topBox {
  934. position: relative;
  935. line-height: 0;
  936. .topImgBg {
  937. width: 750rpx;
  938. }
  939. .leftGz {
  940. width: 1.8rem;
  941. line-height: 1.3;
  942. background: #FFFFFF;
  943. opacity: 0.8;
  944. border-radius: 0rpx 10rpx 10rpx 0rpx;
  945. position: absolute;
  946. left: 0;
  947. bottom: 10rpx;
  948. color: $font-color;
  949. padding: 20rpx 10rpx;
  950. }
  951. .moneyIcon,
  952. .jlBox {
  953. height: 50rpx;
  954. line-height: 1;
  955. // min-width: 180rpx;
  956. border-radius: 50rpx 0px 0px 50rpx;
  957. padding: 0 20rpx;
  958. position: absolute;
  959. background-color: #7B3C0E;
  960. right: 0;
  961. .icon {
  962. width: 30rpx;
  963. margin-right: 10rpx;
  964. height: 30rpx;
  965. }
  966. }
  967. .moneyIcon {
  968. color: $font-color;
  969. background: #FAF9F4;
  970. opacity: 0.8;
  971. bottom: 80rpx;
  972. }
  973. .jlBox {
  974. color: #FFFFFF;
  975. bottom: 10rpx;
  976. }
  977. }
  978. }
  979. @keyframes paopao {
  980. 100% {
  981. // background-position: -585px;
  982. background-position: -780px;
  983. }
  984. }
  985. </style>