entertainment.vue 23 KB

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