123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770 |
- <template>
- <view class="all">
- <view class="">
- <view
- class="echart"
- id="mychart"
- style="width: 750rpx; height: 700rpx"></view>
- </view>
- <view class="center">
- <!-- 左 -->
- <view class="le">
- <view class="tit">
- <view class="ti1">{{$t('enter.u1')}}</view>
- <view class="ti2">({{$t('enter.u2')}})</view>
- </view>
- <view class="he">
- <view class="sh">
- <view class="he1">
- <view class="wen">1</view>
- </view>
- <view class="he1">
- <view class="wen">5</view>
- </view>
- <view class="he1">
- <view class="wen">10</view>
- </view>
- </view>
- <view class="sh">
- <view class="he1">
- <view class="wen">20</view>
- </view>
- <view class="he1">
- <view class="wen">50</view>
- </view>
- <view class="he1">
- <view class="wen">100</view>
- </view>
- </view>
- </view>
- <view class="yi">
- <view class="">
- <image
- class="img"
- src="../../static/icon/le.png"
- mode=""></image>
- </view>
- <view class="">
- <view class="wz">TRX</view>
- </view>
- <view class="">
- <view class="qx">10203009期</view>
- </view>
- </view>
- <view class="shu">
- <view class="">0.064489</view>
- </view>
- </view>
- <!--右 -->
- <view class="ri">
- <view class="ti">
- <view class="t1">{{$t('enter.u3')}}</view>
- <view class="t2">60{{$t('enter.u19')}}</view>
- <view class="">
- <image
- class="ima"
- src="../../static/icon/jt.png"
- mode=""></image>
- </view>
- </view>
- <view class="dh">
- <view class="te">1</view>
- </view>
- <view class="btn">
- <view class="bt">
- <view class="btnle">
- <view class="ble">
- <image
- class="imag"
- src="../../static/icon/xia.png"
- mode=""></image>
- <view class="xia">{{$t('enter.u4')}}</view>
- </view>
- </view>
- <view class="btnri">
- <view class="ble">
- <image
- class="imag"
- src="../../static/icon/shang.png"
- mode=""></image>
- <view class="xia">{{$t('enter.u6')}}</view>
- </view>
- </view>
- </view>
- <view class="bt">
- <view class="btnle">
- <view class="ble">
- <!-- <image
- class="imag"
- src="../../static/icon/xia.png"
- mode=""></image> -->
- <view class="xia">{{$t('enter.u5')}}</view>
- </view>
- </view>
- <view class="btnri">
- <view class="ble">
- <!-- <image
- class="imag"
- src="../../static/icon/shang.png"
- mode=""></image> -->
- <view class="xia">{{$t('enter.u7')}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="db">
- <view class="jl">{{$t('enter.u8')}}</view>
- <view class="sj">
- <view class="">00</view>
- </view>
- <view class="sj">
- <view class="">00</view>
- </view>
- <view class="sj">
- <view class="">52</view>
- </view>
- </view>
- </view>
- </view>
- <view class="kb"></view>
- <view class="last">
- <view class="yi">
- <view class="dd">{{$t('enter.u9')}}</view>
- <view
- class="aa"
- @click="nav">
- <view class="ls">{{$t('enter.u10')}}</view>
- <view class="lb">
- <image
- class="lb"
- src="../../static/icon/jt.png"
- mode=""></image>
- </view>
- </view>
- </view>
- </view>
- <view class="bg">
- <view class="biaotou">
- <view class="biwe">{{$t('enter.u11')}}</view>
- <view class="biwe1">{{$t('enter.u12')}}</view>
- <view class="biwe2">{{$t('enter.u13')}}</view>
- <view class="biwe3">{{$t('enter.u14')}}</view>
- </view>
- </view>
- <view
- class="neirong"
- v-for="item in 3"
- :key="item">
- <view class="nr1">
- <view class="tr">TRX</view>
- <view class="wf">{{$t('enter.u20')}}</view>
- <view class="">
- <image
- class="zz"
- src="../../static/icon/shang.png"
- mode=""></image>
- </view>
- </view>
- <view class="nr2">23.5000</view>
- <view class="nr2">23.5000</view>
- <view class="fil">
- <view class="wanc">
- <view class="wc">{{$t('enter.u17')}}</view>
- </view>
- <view class="xiangq">
- <view class="xq">{{$t('enter.u18')}}</view>
- </view>
- </view>
- </view>
- <view class="chz">
- <view class="ye">
- <view class="yue">{{$t('enter.u15')}}</view>
- <view class="yes">2955.3000U</view>
- </view>
- <view
- class="chong"
- @click="navC">
- <view class="quc">{{$t('enter.u16')}}</view>
- <view class="">
- <image
- class="choz"
- src="../../static/icon/jt.png"
- mode=""></image>
- </view>
- </view>
- </view>
- <view class="aaa"></view>
- <taber tab='entertainment'></taber>
- </view>
- </template>
- <script>
- import * as echarts from "echarts";
- import { getGame, SZlineData } from "@/api/game.js";
- import taber from "@/components/footer/footer.vue";
- export default {
- components: {
- taber
- },
- data() {
- return {
- data: [
- [20, 34, 10, 38], //今开、当前价格、最低价格、最高价
- [40, 35, 30, 50],
- [31, 38, 33, 44],
- [38, 15, 5, 42],
- [28, 20, 15, 40],
- [18, 15, 25, 52],
- [48, 15, 45, 12],
- [28, 20, 15, 40],
- [28, 20, 15, 40],
- [28, 20, 15, 40],
- ],
- include_function: {
- id: '',
- name: '',
-
- }
- };
- },
- onLoad() {
- // this.SZlineData()
- this.getGame();
- },
- mounted() {
- this.initEcharts();
- },
- methods: {
- async getGame() {
- try {
- const res = await getGame();
- this.include_function = res.data.game
- console.log('123',this.include_function);
- console.log("12312", res);
- } catch (error) {
- // console.error("请求出错", error);
- }
- },
- // async SZlineData() {
- // try {
- // const res = await SZlineData();
- // console.log('123', res);
- // // this.kline =
- // } catch (error) {
- // console.error('请求出错', error);
- // }
- // },
- // 均值计算
- calculateMA(dayCount, data) {
- const result = [];
- for (let i = 0, len = data.length; i < len; i++) {
- if (i < dayCount) {
- result.push("-");
- continue;
- }
- let sum = 0;
- for (let j = 0; j < dayCount; j++) {
- sum += data[i - j][1];
- }
- // 保留两位小数
- result.push((sum / dayCount).toFixed(2));
- }
- return result;
- },
- initEcharts() {
- const option = {
- tooltip: {},
- legend: {
- top: 30,
- data: ["MA5", "MA10", "MA20"],
- },
- xAxis: {
- data: [
- "2017-10-24",
- "2017-10-25",
- "2017-10-26",
- "2017-10-27",
- "2017-10-28",
- "2017-10-29",
- "2017-10-30",
- "2017-10-30",
- "2017-10-30",
- "2017-10-30",
- "2017-10-30",
- ],
- },
- yAxis: {},
- series: [
- {
- type: "candlestick",
- data: this.data,
- },
- {
- name: "MA5",
- type: "line",
- data: this.calculateMA(5, this.data),
- smooth: true,
- showSymbol: false,
- lineStyle: {
- // normal: {
- width: 1,
- // },
- },
- },
- {
- name: "MA10",
- type: "line",
- data: this.calculateMA(10, this.data),
- smooth: true,
- showSymbol: false,
- lineStyle: {
- // normal: {
- width: 1,
- // },
- },
- },
- {
- name: "MA20",
- type: "line",
- data: this.calculateMA(20, this.data),
- smooth: true,
- showSymbol: false,
- lineStyle: {
- // normal: {
- width: 1,
- // },
- },
- },
- ],
- };
- const myChart = echarts.init(
- document.getElementById("mychart")
- );
- myChart.setOption(option);
- //随着屏幕大小调节图表
- window.addEventListener("resize", () => {
- myChart.resize();
- });
- },
- // 页面逻辑
- nav() {
- uni.navigateTo({
- url: "/pages/history/history",
- });
- },
- navC() {
- uni.navigateTo({
- url: "/pages/recharge/recharge",
- });
- },
- },
- };
- </script>
- <style>
- .all {
- width: 750rpx;
- /* height: 2500rpx; */
- height: 100%;
- background-color: #000000;
- }
- .echart {
- background-color: #191a1f;
- }
- .center {
- width: 680rpx;
- height: 470rpx;
- margin-top: 30rpx;
- margin-left: 30rpx;
- display: flex;
- justify-content: space-between;
- }
- .tit {
- display: flex;
- justify-content: start;
- }
- .ti1 {
- /* width: 256rpx; */
- height: 24rpx;
- font-size: 25rpx;
- font-weight: bold;
- color: #ffffff;
- }
- .ti2 {
- /* width: 256rpx; */
- height: 24rpx;
- font-size: 22rpx;
- font-weight: bold;
- color: #999999;
- }
- .he1 {
- width: 83rpx;
- height: 83rpx;
- background: #fdaf41;
- border-radius: 10rpx;
- margin-top: 36rpx;
- margin-right: 21rpx;
- }
- .wen {
- /* padding-top: 25rpx;
- margin-left: 30rpx; */
- height: 22rpx;
- font-size: 30rpx;
- font-weight: 800;
- color: #000000;
- line-height: 70rpx;
- text-align: center;
- }
- .sh {
- display: flex;
- justify-content: start;
- /* margin: 21rpx; */
- /* margin-right: 21rpx; */
- }
- .yi {
- display: flex;
- justify-content: start;
- margin-top: 53rpx;
- }
- .img {
- width: 41rpx;
- height: 42rpx;
- }
- .wz {
- height: 22rpx;
- font-size: 29rpx;
- font-weight: bold;
- color: #ffffff;
- margin-left: 7rpx;
- }
- .qx {
- height: 24rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: #ffffff;
- margin-left: 10rpx;
- }
- .shu {
- height: 39rpx;
- font-size: 51rpx;
- font-weight: bold;
- color: #fdb242;
- }
- .ti {
- display: flex;
- justify-content: start;
- }
- .t1 {
- height: 24rpx;
- font-size: 26rpx;
- font-weight: bold;
- color: #ffffff;
- margin-left: 90rpx;
- }
- .t2 {
- height: 24rpx;
- font-size: 26rpx;
- font-weight: bold;
- color: #fdaf41;
- margin-left: 19rpx;
- }
- .ima {
- width: 16rpx;
- height: 10rpx;
- margin-left: 15rpx;
- }
- .dh {
- width: 322rpx;
- height: 83rpx;
- background: #efefef;
- border-radius: 10rpx;
- margin-top: 25rpx;
- }
- .te {
- text-align: center;
- /* padding-top: 25rpx; */
- height: 32rpx;
- font-size: 44rpx;
- font-weight: 800;
- color: #000000;
- line-height: 70rpx;
- }
- .btn {
- width: 322rpx;
- height: 160rpx;
- margin-top: 30rpx;
- }
- .bt {
- display: flex;
- justify-content: start;
- }
- .btnle {
- width: 157rpx;
- height: 72rpx;
- border: 1rpx solid;
- border-radius: 50rpx 0 0 50rpx;
- background-color: #df5660;
- margin-top: 10rpx;
- }
- .ble {
- display: flex;
- justify-content: center;
- }
- .imag {
- width: 32rpx;
- height: 20rpx;
- /* margin-left: 44rpx; */
- margin-top: 25rpx;
- }
- .xia {
- height: 25rpx;
- font-size: 28rpx;
- font-weight: 800;
- color: #ffffff;
- line-height: 70rpx;
- }
- .btnri {
- width: 157rpx;
- height: 72rpx;
- border: 1rpx solid;
- border-radius: 0 50rpx 50rpx 0;
- background-color: #5bb786;
- margin-left: 10rpx;
- margin-top: 10rpx;
- }
- .db {
- display: flex;
- justify-content: start;
- }
- .jl {
- height: 23rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: #999999;
- margin-top: 45rpx;
- }
- .sj {
- width: 41rpx;
- height: 39rpx;
- background: #bfbfbf;
- border-radius: 3rpx;
- margin-left: 15rpx;
- margin-top: 42rpx;
- }
- .kb {
- width: 750rpx;
- height: 20rpx;
- background-color: #191a1f;
- }
- .last {
- width: 680rpx;
- height: 40rpx;
- background-color: #000000;
- display: flex;
- justify-content: start;
- margin-left: 32rpx;
- }
- .dd {
- height: 23rpx;
- font-size: 24rpx;
- font-weight: 800;
- color: #fff;
- line-height: 30rpx;
- }
- .aa {
- display: flex;
- justify-content: start;
- }
- .ls {
- height: 23rpx;
- font-size: 24rpx;
- font-weight: 800;
- color: #fff;
- line-height: 30rpx;
- margin-left: 460rpx;
- }
- .lb image {
- width: 14rpx;
- height: 20rpx;
- color: #fff;
- margin-left: 10rpx;
- }
- .bg {
- width: 680rpx;
- height: 120rpx;
- background-color: #000000;
- display: flex;
- justify-content: space-between;
- margin-left: 30rpx;
- margin-top: 30rpx;
- }
- .biaotou {
- display: flex;
- justify-content: center;
- margin-top: 40rpx;
- }
-
- .biwe {
- height: 27rpx;
- font-size: 28rpx;
- font-weight: 800;
- color: #fff;
- /* margin-left: 30rpx; */
- }
- .biwe1 {
- height: 27rpx;
- font-size: 28rpx;
- font-weight: 800;
- color: #fff;
- padding-left: 100rpx;
- }
- .biwe2 {
- height: 27rpx;
- font-size: 28rpx;
- font-weight: 800;
- color: #fff;
- padding-left: 90rpx;
- }
- .biwe3 {
- height: 27rpx;
- font-size: 28rpx;
- font-weight: 800;
- color: #fff;
- padding-left: 43rpx;
- }
- .neirong {
- display: flex;
- justify-content: start;
- width: 700rpx;
- height: 70rpx;
- margin-left: 32rpx;
- }
- .nr1 {
- display: flex;
- justify-content: start;
- }
- .tr {
- height: 21rpx;
- font-size: 28rpx;
- font-weight: 800;
- color: #ffffff;
- line-height: 30rpx;
- }
- .wf {
- height: 17rpx;
- font-size: 18rpx;
- font-weight: 800;
- color: #999999;
- line-height: 30rpx;
- margin-left: 8rpx;
- }
- .zz {
- width: 22rpx;
- height: 14rpx;
- color: #5bb786;
- margin-left: 8rpx;
- }
- .nr2 {
- height: 20rpx;
- font-size: 26rpx;
- font-weight: bold;
- color: #ffffff;
- line-height: 30rpx;
- margin-left: 45rpx;
- }
- .wanc {
- width: 111rpx;
- height: 31rpx;
- background: #25b287;
- border-radius: 16rpx;
- margin-left: 18rpx;
- }
- .wc {
- height: 16rpx;
- font-size: 16rpx;
- font-weight: bold;
- color: #ffffff;
- line-height: 30rpx;
- text-align: center;
- }
- .fil {
- display: flex;
- justify-content: start;
- }
- .xiangq {
- width: 103rpx;
- height: 31rpx;
- background: #01ebf6;
- border-radius: 16rpx;
- margin-left: 8rpx;
- }
- .xq {
- height: 16rpx;
- font-size: 16rpx;
- font-weight: bold;
- color: #000000;
- line-height: 30rpx;
- text-align: center;
- }
- .chz {
- width: 687rpx;
- height: 126rpx;
- background: #191a1f;
- border-radius: 20rpx;
- margin-left: 32rpx;
- margin-top: 40rpx;
- display: flex;
- justify-content: start;
- }
- .yue {
- height: 27rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #ffffff;
- margin-left: 31rpx;
- padding-top: 27rpx;
- }
- .yes {
- height: 27rpx;
- font-size: 35rpx;
- font-weight: bold;
- color: #fdaf41;
- margin-left: 32rpx;
- margin-top: 40rpx;
- }
- .chong {
- display: flex;
- justify-content: start;
- }
- .quc {
- height: 24rpx;
- font-size: 26rpx;
- font-weight: 500;
- color: #ffffff;
- margin-top: 51rpx;
- margin-left: 306rpx;
- }
- .choz {
- width: 22rpx;
- height: 14rpx;
- margin-top: 62rpx;
- /* color: #5bb786; */
- }
- .aaa {
- width: 750rpx;
- height: 30rpx;
- background-color: #000000;
- }
- </style>
|