entertainment.vue 23 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096
  1. <template>
  2. <view class="all">
  3. <view class="padding-t-30"></view>
  4. <view class="tab">
  5. <view class="flex-start">
  6. <view class="tab-item " @click="changeTab(item,ind)" :class="{action:actionIndex==ind}"
  7. v-for="(item,ind) in gameList">
  8. {{item.name}}
  9. </view>
  10. </view>
  11. <l-echart class="top" ref="chart"></l-echart>
  12. </view>
  13. <view class="center flex">
  14. <!-- 左 -->
  15. <view class="le">
  16. <view class="tit flex-start">
  17. <view class="ti1">{{$t('enter.u1')}}</view>
  18. <view class="ti2">({{$t('enter.u2')}} {{history.base.max_bet*1}}U)</view>
  19. </view>
  20. <view class="he">
  21. <view class="numbox flex-start">
  22. <view class="he1 flex" @click="upOnBtnData.value=it" v-for="it in arMoneyList">
  23. <view class="wen">{{it}}</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="yi flex-start">
  28. <!-- <image class="img" src="../../static/icon/le.png" mode=""></image> -->
  29. <view class="wz padding-l-10">{{history.base.token}}</view>
  30. <view class="qx padding-l-10" v-if="history.next.id">{{history.next.no}}</view>
  31. </view>
  32. <view class="shu">
  33. {{KlineList.c*1}}
  34. </view>
  35. </view>
  36. <!--右 -->
  37. <view class="ri">
  38. <view class="ti flex-center">
  39. <view class="t1">{{$t('enter.u3')}}</view>
  40. <view class="t2 padding-l-10">{{history.base.timebar}}</view>
  41. </view>
  42. <view class="dh">
  43. <input class="input" :placeholder="'USDT'+$t('enter.a9')" type="number" v-model="upOnBtnData.value">
  44. </view>
  45. <view class="btn">
  46. <view class="bt flex">
  47. <view class="btnItem btnle" @click="onPayBet(2)">
  48. <image class="imag" src="../../static/icon/xia.png" mode=""></image>
  49. <text class="xia">{{$t('enter.u4')}}</text>
  50. </view>
  51. <view class="btnItem btnri" @click="onPayBet(1)">
  52. <image class="imag" src="../../static/icon/shang.png" mode=""></image>
  53. <text class="xia">{{$t('enter.u6')}}</text>
  54. </view>
  55. </view>
  56. <view class="bt flex">
  57. <view class="btnItem btnle" @click="onPayBet(3)">
  58. <view class="xia">{{$t('enter.u5')}}</view>
  59. </view>
  60. <view class="btnItem btnri" @click="onPayBet(4)">
  61. <view class="xia">{{$t('enter.u7')}}</view>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="db flex">
  66. <view class="jl">{{$t('enter.u8')}}</view>
  67. <view class="sj">
  68. <text v-if="time.H<10">0</text>
  69. {{time.H}}
  70. </view>
  71. <view class="sj">
  72. <text v-if="time.M<10">0</text>
  73. {{time.M}}
  74. </view>
  75. <view class="sj">
  76. <text v-if="time.S<10">0</text>
  77. {{time.S}}
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="kb"></view>
  83. <view class="last">
  84. <view class="flex">
  85. <text>{{$t('enter.u9')}}</text>
  86. <view class="flex" @click="nav(`/pages/game/history?id=${history.base.id}`)">
  87. <text>{{$t('enter.u10')}}</text>
  88. <image class="lb" src="../../static/icon/jt.png" mode="scaleToFill"></image>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="bg">
  93. <view class="biaotou flex">
  94. <view class="biwe">{{$t('enter.u11')}}</view>
  95. <view class="biwe">{{$t('enter.u12')}}</view>
  96. <view class="biwe">{{$t('enter.u13')}}</view>
  97. <view class="biwe">{{$t('enter.u14')}}</view>
  98. </view>
  99. <view class="list flex" v-for="(item,ind) in betList.list" :key="ind">
  100. <view class="biwe flex-start">
  101. <view class="tr">{{history.base.token}}</view>
  102. <view class="nametip">{{history.base.timebar}}</view>
  103. <image v-if="item.bet==1" class="zz" src="../../static/icon/shang.png" mode="scaleToFill"></image>
  104. <image v-if="item.bet==2" class="zz" src="../../static/icon/xia.png" mode="scaleToFill"></image>
  105. <view v-if="item.bet==3" class="nametip red">{{$t('enter.u5')}}</view>
  106. <view v-if="item.bet==4" class="nametip green">{{$t('enter.u7')}}</view>
  107. </view>
  108. <view class="biwe">{{item.num*1}}</view>
  109. <view class="biwe">{{item.sexy}}</view>
  110. <view class="biwe flex-center">
  111. <view v-if="item.status==0" class="list-buttom primary margin-r-10">
  112. {{$t('enter.a4')}}
  113. </view>
  114. <view class="list-buttom red" v-if="item.result==1">
  115. {{$t('enter.a5')}}
  116. </view>
  117. <view class="list-buttom success" v-if="item.result===0">
  118. {{$t('enter.a6')}}
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <view class="chz flex" @click="nav('/pages/user/money/recharge')">
  124. <view>
  125. <view class="yue padding-b-10">{{$t('enter.u15')}}</view>
  126. <view class="yes">{{userWallet}}U</view>
  127. </view>
  128. <view class="flex-start">
  129. <view class="quc">{{$t('enter.u16')}}</view>
  130. <image class="choz" src="../../static/icon/jt.png" mode="scaleToFill"></image>
  131. </view>
  132. </view>
  133. <uni-popup type="bottom" ref="popup" :mask-click="false" @maskClick='colsePayPassword'>
  134. <inputPassword @commit='KeyInfo'></inputPassword>
  135. </uni-popup>
  136. <uni-popup type="center" ref="popupDetail">
  137. <view class="alert-detail">
  138. <view class="padding-c-30 padding-t-30 padding-b-30">
  139. <view class="flex">
  140. <view class="type">
  141. {{$t('gameList.a5')}}
  142. </view>
  143. <view class="num" v-if="alertDetail.ts">
  144. {{getTime(alertDetail.ts)}}
  145. </view>
  146. </view>
  147. <view class="flex">
  148. <view class="type">
  149. open
  150. </view>
  151. <view class="num">
  152. {{alertDetail.o*1}}
  153. </view>
  154. </view>
  155. <view class="flex">
  156. <view class="type">
  157. close
  158. </view>
  159. <view class="num">
  160. {{alertDetail.c*1}}
  161. </view>
  162. </view>
  163. <view class="flex">
  164. <view class="type">
  165. lowest
  166. </view>
  167. <view class="num">
  168. {{alertDetail.l*1}}
  169. </view>
  170. </view>
  171. <view class="flex">
  172. <view class="type">
  173. highest
  174. </view>
  175. <view class="num">
  176. {{alertDetail.h*1}}
  177. </view>
  178. </view>
  179. </view>
  180. <button class="button" type="default" @click="$refs.popupDetail.close()"><text
  181. class="button-text">{{$t("safe.d7")}}</text></button>
  182. </view>
  183. </uni-popup>
  184. <taber tab='entertainment' v-if="!upOnBtnData.show"></taber>
  185. </view>
  186. </view>
  187. </template>
  188. <script>
  189. import * as echarts from '@/uni_modules/lime-echart/static/echarts.min'
  190. import {
  191. getGame,
  192. gameKline,
  193. getGameList,
  194. gameWallet,
  195. gameBetList,
  196. gameBetIn
  197. } from "@/api/game.js";
  198. import {
  199. mapState,
  200. mapMutations
  201. } from 'vuex';
  202. import {
  203. saveUrl,
  204. interceptor
  205. } from '@/utils/loginUtils.js';
  206. import taber from "@/components/footer/footer.vue";
  207. import {
  208. getTime
  209. } from '@/utils/rocessor.js';
  210. import inputPassword from "@/components/input-password/input-password.vue";
  211. export default {
  212. components: {
  213. taber,
  214. inputPassword
  215. },
  216. computed: {
  217. ...mapState("user", ["hasLogin"]),
  218. },
  219. data() {
  220. return {
  221. arMoneyList: [
  222. 1, 5, 10, 20, 50, 100
  223. ],
  224. actionIndex: 0,
  225. // 当前游戏列表
  226. gameList: [],
  227. // 游戏信息
  228. history: {
  229. list: [], //游戏进行记录
  230. page: 1,
  231. limit: 10,
  232. // 基础数据
  233. base: {},
  234. next: "",
  235. now: {}
  236. },
  237. time: {
  238. H: 0,
  239. M: 0,
  240. S: 0,
  241. // 保存倒计时对象
  242. t: ''
  243. },
  244. // 游戏押注记录
  245. betList: {
  246. list: [], //游戏进行记录
  247. page: 1,
  248. limit: 10,
  249. },
  250. userWallet: 0,
  251. // 当前最新K线数据
  252. KlineList: {
  253. c: ''
  254. },
  255. upOnBtnData: {
  256. // 是否显示底部导航栏
  257. show: false,
  258. type: '',
  259. // 当前输入的密码
  260. passwordArr: '',
  261. value: '',
  262. },
  263. // 弹窗数据像晴
  264. alertDetail: {
  265. },
  266. // 保存获取下次游戏对象
  267. getNextTimeObj: ''
  268. };
  269. },
  270. onLoad() {},
  271. onShow() {
  272. if (!this.hasLogin) {
  273. uni.showModal({
  274. title: this.$t('enter.c4'),
  275. content: this.$t('enter.b5'),
  276. success: (e) => {
  277. // 判断是否点击确认按钮
  278. if (e.confirm) {
  279. // 保存当前页面地址
  280. saveUrl()
  281. // 跳转页面
  282. interceptor()
  283. }
  284. }
  285. })
  286. return
  287. }
  288. this.getUserWallet();
  289. this.gameInit();
  290. },
  291. // 关闭循环
  292. onHide() {
  293. // 倒计时清理
  294. this.initData();
  295. },
  296. methods: {
  297. getTime,
  298. // 弹窗详情
  299. alertDetailOpen(item) {
  300. console.log(item);
  301. this.alertDetail = item.room.result_info;
  302. this.$refs.popupDetail.open();
  303. },
  304. // 倒计时清理
  305. initData() {
  306. const that = this
  307. // 关闭倒计时
  308. clearInterval(that.getNextTimeObj);
  309. clearInterval(that.time.t);
  310. // 清空倒计时对象
  311. that.getNextTimeObj = '';
  312. this.time = {
  313. H: 0,
  314. M: 0,
  315. S: 0,
  316. t: ''
  317. };
  318. },
  319. // 点击触发支付事件
  320. onPayBet(type) {
  321. if (!this.upOnBtnData.value) {
  322. uni.showToast({
  323. title: this.$t('enter.a9'),
  324. icon: "error"
  325. })
  326. return
  327. }
  328. if (!this.history.next) {
  329. uni.showModal({
  330. title: this.$t('enter.c4'),
  331. content: this.$t('enter.a3'),
  332. showCancel: false,
  333. });
  334. return
  335. }
  336. this.upOnBtnData.type = type;
  337. this.openPayPassword();
  338. },
  339. // 打开支付弹窗
  340. openPayPassword() {
  341. this.upOnBtnData.show = true;
  342. this.$refs.popup.open();
  343. },
  344. // 关闭支付弹窗
  345. colsePayPassword() {
  346. this.upOnBtnData.show = false;
  347. this.$refs.popup.close();
  348. },
  349. // 密码输入完成后调用下注
  350. KeyInfo(val) {
  351. const that = this;
  352. that.upOnBtnData.passwordArr = val;
  353. that.colsePayPassword();
  354. const typeList = [that.$t('enter.u6'),that.$t('enter.u4'),that.$t('enter.u5'),that.$t('enter.u7')];
  355. uni.showModal({
  356. title: that.$t('enter.c4'),
  357. content: `${that.$t('enter.a8')}${that.upOnBtnData.value}USDT${that.$t('enter.a10')}${typeList[that.upOnBtnData.type-1]}`,
  358. success: res => {
  359. if(res.confirm){
  360. that.gameBetIn();
  361. }
  362. },
  363. });
  364. },
  365. // 参与压住
  366. gameBetIn(type) {
  367. const that = this;
  368. const upData = {
  369. id: that.history.next.id,
  370. bet: that.upOnBtnData.type,
  371. num: that.upOnBtnData.value,
  372. trade_password: that.upOnBtnData.passwordArr
  373. };
  374. uni.showLoading({
  375. mask: true
  376. })
  377. that.upOnBtnData.value = '';
  378. gameBetIn(upData).then((res) => {
  379. uni.hideLoading()
  380. uni.showToast({
  381. title: res.msg
  382. });
  383. that.gameBetList();
  384. }).catch((res) => {
  385. uni.hideLoading();
  386. uni.showToast({
  387. title: res.msg
  388. });
  389. })
  390. },
  391. // 获取用户余额信息
  392. getUserWallet() {
  393. gameWallet().then((res) => {
  394. this.userWallet = +res.data.back.USDT.money.money
  395. })
  396. },
  397. // 开始倒计时
  398. async opTiem() {
  399. const that = this;
  400. try {
  401. // 判斷是否有游戲信息并且有正在進行中游戏
  402. if (that.history.base.id && that.history.next) {
  403. // console.log(that.history.base.id, that.history.next,
  404. // 'that.history.base.id && that.history.next');
  405. that.time.t = setInterval(() => {
  406. that.getOutTime();
  407. }, 1000)
  408. }
  409. } catch (e) {
  410. console.log(e, '定时');
  411. }
  412. },
  413. // 获取倒计时时间
  414. getOutTime() {
  415. const that = this;
  416. const da = (new Date()).getTime();
  417. const timenum = that.history.next.open_time * 1000 - da;
  418. // console.log(timenum, that.history.next.open_time, da, '计算');
  419. if (timenum > 0) {
  420. that.time.H = Math.floor(timenum / 1000 / 60 / 60);
  421. that.time.S = Math.floor(timenum / 1000 % 60)
  422. that.time.M = Math.floor(timenum / 1000 / 60 % 60);
  423. }
  424. if (that.time.H == 0 && that.time.M == 0 && that.time.S == 0) {
  425. console.log('归0');
  426. clearInterval(that.time.t);
  427. // 延时调用防止数据重复加载
  428. setTimeout(() => {
  429. that.getGame(that.history.base.id)
  430. that.getGameKline();
  431. }, 2000)
  432. }
  433. },
  434. // 游戏tab切换
  435. changeTab(item, ind) {
  436. const that = this;
  437. if (ind != this.actionIndex) {
  438. that.actionIndex = ind;
  439. // 清理倒计时
  440. that.initData();
  441. // 重新加载数据
  442. that.gameDataInit(item.id);
  443. }
  444. },
  445. // 初始化
  446. async gameInit() {
  447. // 获取游戏列表
  448. await this.getGameList();
  449. // 加载游戏数据
  450. this.gameDataInit(this.history.base.id || this.gameList[0].id)
  451. },
  452. // 加载游戏列表
  453. getGameList() {
  454. return getGameList().then((res) => {
  455. this.gameList = res.data.list;
  456. // console.log('1111111111',this.gameList);
  457. })
  458. },
  459. // 重新加载基础游戏信息
  460. async gameDataInit(id, reload = true) {
  461. // 获取基础信息
  462. await this.getGame(id);
  463. //获取K线
  464. this.getGameKline(reload);
  465. // 获取游戏压住记录
  466. this.gameBetList();
  467. },
  468. // 获取游戏压住记录
  469. gameBetList() {
  470. gameBetList({
  471. page: 1,
  472. limit: 10,
  473. id: this.history.base.id,
  474. }).then((res) => {
  475. this.betList.list = res.data.bet_log.map((res)=>{
  476. res.num=Number(res.num);
  477. res.get=Number(res.get);
  478. res.sexy = res.get-res.num
  479. return res
  480. });
  481. })
  482. },
  483. // 获取游戏K线信息
  484. getGameKline(reload = true) {
  485. const that = this;
  486. const lineNum = this.history.base.decimal;
  487. gameKline({
  488. page: 1,
  489. limit: 60
  490. }, that.history.base.id).then((res) => {
  491. that.KlineList = res.data.list[0];
  492. let list = res.data.list.reverse();
  493. // x轴记录
  494. let xarr = [];
  495. // 打点数据
  496. let linearr = [];
  497. for (let i = 0; i < list.length; i++) {
  498. const ll = list[i];
  499. const time = new Date(+ll.ts);
  500. const addar = [+(+ll.o).toFixed(lineNum), +(+ll.c).toFixed(lineNum), +(+ll.l).toFixed(lineNum), +(+ll.h)
  501. .toFixed(lineNum)
  502. ];
  503. xarr.push(`${time.getHours()}:${time.getMinutes()}`)
  504. linearr.push(addar)
  505. }
  506. that.$nextTick(() => {
  507. // 判断是否要重载数据
  508. that.initKline({
  509. xarr,
  510. linearr
  511. }, reload)
  512. })
  513. })
  514. },
  515. // 获取当前项目信息
  516. getGame(id) {
  517. const that = this;
  518. return getGame({
  519. page: that.history.page,
  520. limit: that.history.limit
  521. }, id).then(({
  522. data
  523. }) => {
  524. that.history.list = data.list || [];
  525. that.history.base = data.game || {};
  526. that.history.next = data.next_game || '';
  527. that.history.now = data.now_game || '';
  528. // 是否不存在启动中的活动并判断防止重复调用创建倒计时
  529. if (!that.history.next && !that.getNextTimeObj) {
  530. that.getNextTimeObj = setInterval(() => {
  531. that.getGame(id)
  532. }, 1000)
  533. return
  534. }
  535. if (that.history.next && that.getNextTimeObj) {
  536. clearInterval(that.getNextTimeObj);
  537. // 清空倒计时对象
  538. that.getNextTimeObj = '';
  539. }
  540. // 判断是否有活动并且正在进行中
  541. if (that.history.next && !that.getNextTimeObj) {
  542. that.opTiem();
  543. }
  544. })
  545. },
  546. // 均值计算
  547. calculateMA(dayCount, data) {
  548. var result = [];
  549. for (var i = 0, len = data.linearr.length; i < len; i++) {
  550. if (i < dayCount) {
  551. result.push('-');
  552. continue;
  553. }
  554. var sum = 0;
  555. for (var j = 0; j < dayCount; j++) {
  556. sum += data.linearr[i - j][1];
  557. }
  558. result.push(+(sum / dayCount).toFixed(5));
  559. }
  560. return result;
  561. },
  562. // 重载K线
  563. async initKline(data, reload = true) {
  564. const that = this;
  565. try {
  566. const chart = await this.$refs.chart.init(echarts);
  567. if (reload) {
  568. const upColor = '#00da3c';
  569. const downColor = '#ec0000';
  570. chart.setOption(
  571. (this.option = {
  572. animation: false,
  573. legend: {
  574. top: 10,
  575. left: 10,
  576. data: ['MA5', 'MA10', 'MA20'],
  577. textStyle: {
  578. color: '#999999'
  579. }
  580. },
  581. tooltip: {
  582. trigger: 'axis',
  583. axisPointer: {
  584. type: 'cross'
  585. },
  586. borderWidth: 1,
  587. borderColor: '#ccc',
  588. padding: 10,
  589. textStyle: {
  590. color: '#000'
  591. },
  592. position: function(pos, params, el, elRect, size) {
  593. const obj = {
  594. top: 10
  595. };
  596. obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 40;
  597. return obj;
  598. }
  599. },
  600. dataZoom: [{
  601. type: 'inside',
  602. xAxisIndex: 0,
  603. start: 50,
  604. end: 100
  605. }],
  606. grid: [{
  607. left: 10,
  608. right: 55,
  609. bottom: 20,
  610. top: 45
  611. }],
  612. xAxis: [{
  613. type: 'category',
  614. data: data.xarr,
  615. axisLine: {
  616. onZero: false
  617. },
  618. splitLine: {
  619. show: false
  620. },
  621. min: 'dataMin',
  622. max: 'dataMax',
  623. axisPointer: {
  624. z: 100
  625. }
  626. }],
  627. yAxis: [{
  628. scale: true,
  629. splitNumber: 4,
  630. position: 'right',
  631. axisTick: {
  632. show: false
  633. },
  634. splitLine: {
  635. show: false,
  636. lineStyle: {
  637. color: '#e3e3e3'
  638. }
  639. },
  640. axisLabel: {
  641. inside: false,
  642. formatter: '{value}\n',
  643. color: '#999999'
  644. }
  645. }],
  646. series: [{
  647. name: that.history.base.token + '-USDT',
  648. type: 'candlestick',
  649. data: data.linearr,
  650. itemStyle: {
  651. color: upColor,
  652. color0: downColor,
  653. borderColor: undefined,
  654. borderColor0: undefined
  655. }
  656. },
  657. {
  658. name: "MA5",
  659. smooth: true,
  660. type: 'line',
  661. data: that.calculateMA(5, data),
  662. showSymbol: false,
  663. lineStyle: {
  664. width: 1
  665. }
  666. },
  667. {
  668. name: "MA10",
  669. smooth: true,
  670. type: 'line',
  671. data: that.calculateMA(10, data),
  672. showSymbol: false,
  673. lineStyle: {
  674. width: 1
  675. }
  676. },
  677. {
  678. name: "MA20",
  679. smooth: true,
  680. type: 'line',
  681. data: that.calculateMA(20, data),
  682. showSymbol: false,
  683. lineStyle: {
  684. width: 1
  685. }
  686. },
  687. ]
  688. }),
  689. true
  690. )
  691. } else {
  692. chart.setOption({
  693. xAxis: [{
  694. type: 'category',
  695. data: data.xarr,
  696. }],
  697. series: [{
  698. name: that.history.base.token + '-USDT',
  699. data: data.linearr,
  700. },
  701. {
  702. name: "MA5",
  703. data: that.calculateMA(5, data),
  704. },
  705. {
  706. name: "MA10",
  707. data: that.calculateMA(10, data),
  708. },
  709. {
  710. name: "MA20",
  711. data: that.calculateMA(20, data),
  712. },
  713. ]
  714. })
  715. }
  716. } catch (e) {
  717. console.log(e, 'cuowu');
  718. //TODO handle the exception
  719. }
  720. },
  721. // 页面跳转
  722. nav(url) {
  723. console.log('tz');
  724. if (!this.hasLogin) {
  725. uni.showModal({
  726. title: this.$t('enter.c4'),
  727. content: this.$t('enter.b5'),
  728. success: (e) => {
  729. // 判断是否点击确认按钮
  730. if (e.confirm) {
  731. // 保存当前页面地址
  732. saveUrl()
  733. // 跳转页面
  734. interceptor()
  735. }
  736. }
  737. })
  738. return
  739. }
  740. uni.navigateTo({
  741. url,
  742. fail(err) {
  743. console.log(err);
  744. }
  745. });
  746. },
  747. },
  748. };
  749. </script>
  750. <style lang="scss">
  751. .all {
  752. width: 750rpx;
  753. /* height: 2500rpx; */
  754. height: 100%;
  755. padding-top: var(--status-bar-height);
  756. padding-bottom: 30rpx;
  757. }
  758. .tab {
  759. padding: 30rpx 20rpx;
  760. margin: 0 30rpx;
  761. background-color: #191A1F;
  762. border-radius: 20px;
  763. .tab-item {
  764. color: #FFF;
  765. font-size: $font-lg;
  766. padding: 0 20rpx;
  767. padding-bottom: 10rpx;
  768. &.action {
  769. color: #F5A944;
  770. border-bottom: 1px solid #F5A944;
  771. }
  772. }
  773. .top {
  774. height: 530rpx;
  775. width: 100%;
  776. }
  777. }
  778. .center {
  779. padding: 30rpx;
  780. line-height: 1;
  781. align-items: flex-start;
  782. .le,
  783. .ri {
  784. width: 50%;
  785. }
  786. .le {
  787. .tit {
  788. font-weight: bold;
  789. .ti1 {
  790. font-size: 26rpx;
  791. color: #ffffff;
  792. }
  793. .ti2 {
  794. font-size: 22rpx;
  795. padding-left: 10rpx;
  796. color: #999999;
  797. }
  798. }
  799. .he {
  800. padding-top: 40rpx;
  801. .numbox {
  802. flex-wrap: wrap;
  803. .he1 {
  804. background: #fdaf41;
  805. border-radius: 10rpx;
  806. margin-bottom: 40rpx;
  807. margin-right: 20rpx;
  808. width: 84rpx;
  809. height: 84rpx;
  810. justify-content: center;
  811. .wen {
  812. font-size: 30rpx;
  813. font-weight: bold;
  814. color: #000000;
  815. }
  816. }
  817. }
  818. }
  819. .yi {
  820. color: #ffffff;
  821. font-size: $font-base;
  822. .img {
  823. width: 41rpx;
  824. height: 42rpx;
  825. }
  826. .wz {
  827. font-weight: bold;
  828. }
  829. }
  830. .shu {
  831. padding-top: 10rpx;
  832. font-size: 51rpx;
  833. font-weight: bold;
  834. color: #fdb242;
  835. }
  836. }
  837. .ri {
  838. .ti {
  839. font-size: 26rpx;
  840. font-weight: bold;
  841. .t1 {
  842. color: #ffffff;
  843. }
  844. .t2 {
  845. color: #fdaf41;
  846. }
  847. }
  848. .dh {
  849. width: 100%;
  850. padding: 20rpx 30rpx;
  851. margin-top: 30rpx;
  852. background: #efefef;
  853. border-radius: 10rpx;
  854. .te {
  855. font-size: 44rpx;
  856. font-weight: 800;
  857. color: #000000;
  858. }
  859. }
  860. .btn {
  861. padding-top: 30rpx;
  862. .bt {
  863. padding-bottom: 10rpx;
  864. .btnItem {
  865. width: 49%;
  866. height: 70rpx;
  867. line-height: 70rpx;
  868. text-align: center;
  869. .imag {
  870. width: 32rpx;
  871. height: 20rpx;
  872. }
  873. .xia {
  874. font-size: 28rpx;
  875. font-weight: 800;
  876. color: #ffffff;
  877. }
  878. }
  879. .btnle {
  880. border-radius: 50rpx 0 0 50rpx;
  881. background-color: #df5660;
  882. }
  883. .btnri {
  884. border-radius: 0 50rpx 50rpx 0;
  885. background-color: #5bb786;
  886. }
  887. }
  888. }
  889. .db {
  890. justify-content: flex-end;
  891. padding-top: 30rpx;
  892. .jl {
  893. font-size: 24rpx;
  894. font-weight: 400;
  895. color: #999999;
  896. }
  897. .sj {
  898. width: 40rpx;
  899. height: 40rpx;
  900. background: #bfbfbf;
  901. border-radius: 3rpx;
  902. text-align: center;
  903. line-height: 40rpx;
  904. margin-left: 10rpx;
  905. }
  906. }
  907. }
  908. }
  909. .kb {
  910. width: 750rpx;
  911. height: 20rpx;
  912. background-color: #191a1f;
  913. }
  914. .last {
  915. padding: 30rpx;
  916. line-height: 1;
  917. font-size: 24rpx;
  918. font-weight: 800;
  919. color: #fff;
  920. .lb {
  921. width: 14rpx;
  922. height: 20rpx;
  923. margin-left: 10rpx;
  924. }
  925. }
  926. .bg {
  927. padding: 0 30rpx;
  928. background-color: #000000;
  929. color: #fff;
  930. text-align: center;
  931. font-size: 28rpx;
  932. padding-bottom: 30rpx;
  933. .biaotou {
  934. font-weight: 800;
  935. padding-bottom: 10rpx;
  936. }
  937. .biwe {
  938. width: 25%;
  939. .zz {
  940. width: 22rpx;
  941. height: 14rpx;
  942. margin-left: 8rpx;
  943. }
  944. .nametip {
  945. font-size: 18rpx;
  946. color: #999999;
  947. padding-left: 8rpx;
  948. &.green {
  949. color: #5bb786;
  950. }
  951. &.red {
  952. color: #df5660;
  953. }
  954. }
  955. }
  956. .biwe:nth-child(1) {
  957. flex-shrink: 0;
  958. text-align: left;
  959. align-items: flex-end;
  960. }
  961. .biwe:nth-child(4) {
  962. flex-shrink: 0;
  963. width: 200rpx;
  964. }
  965. .list {
  966. font-weight: bold;
  967. padding: 20rpx 0;
  968. border-bottom: 1px solid rgba(43, 42, 38, 0.52);
  969. }
  970. .list-buttom {
  971. width: 100rpx;
  972. border-radius: 30rpx;
  973. font-size: 16rpx;
  974. padding: 10rpx 0;
  975. &.success {
  976. background: $color-green;
  977. }
  978. &.red{
  979. background: $color-yellow;
  980. }
  981. &.primary {
  982. background: #01ebf6;
  983. color: #000000;
  984. }
  985. }
  986. }
  987. .chz {
  988. background: #191a1f;
  989. border-radius: 20rpx;
  990. margin: 0 30rpx;
  991. color: #ffffff;
  992. font-weight: bold;
  993. padding: 20rpx 30rpx;
  994. .yue {
  995. font-size: 28rpx;
  996. }
  997. .yes {
  998. color: #fdaf41;
  999. }
  1000. .quc {
  1001. font-size: 26rpx;
  1002. font-weight: 500;
  1003. color: #ffffff;
  1004. }
  1005. .choz {
  1006. width: 22rpx;
  1007. height: 14rpx;
  1008. }
  1009. }
  1010. .alert-detail {
  1011. background-color: #FFF;
  1012. border-radius: 10rpx;
  1013. width: 500rpx;
  1014. .flex {
  1015. padding: 10rpx 0;
  1016. }
  1017. }
  1018. </style>