|
|
@@ -1,175 +1,156 @@
|
|
|
<template>
|
|
|
<view class="all">
|
|
|
- <template v-if="!upOnBtnData.show">
|
|
|
- <view class="padding-t-30"></view>
|
|
|
- <view class="tab">
|
|
|
- <view class="flex">
|
|
|
- <view class="tab-item " @click="changeTab(item,ind)" :class="{action:actionIndex==ind}"
|
|
|
- v-for="(item,ind) in gameList">
|
|
|
- {{item.name}}
|
|
|
- </view>
|
|
|
+ <view class="padding-t-30"></view>
|
|
|
+ <view class="tab">
|
|
|
+ <view class="flex-start">
|
|
|
+ <view class="tab-item " @click="changeTab(item,ind)" :class="{action:actionIndex==ind}"
|
|
|
+ v-for="(item,ind) in gameList">
|
|
|
+ {{item.name}}
|
|
|
</view>
|
|
|
- <l-echart class="top" ref="chart"></l-echart>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="center flex">
|
|
|
- <!-- 左 -->
|
|
|
- <view class="le">
|
|
|
- <view class="tit flex-start">
|
|
|
- <view class="ti1">{{$t('enter.u1')}}</view>
|
|
|
- <view class="ti2">({{$t('enter.u2')}})</view>
|
|
|
- </view>
|
|
|
- <view class="he">
|
|
|
- <view class="numbox flex-start">
|
|
|
- <view class="he1 flex" @click="gameMoneyValue=it" v-for="it in arMoneyList">
|
|
|
- <view class="wen">{{it}}</view>
|
|
|
- </view>
|
|
|
+ <l-echart class="top" ref="chart"></l-echart>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="center flex">
|
|
|
+ <!-- 左 -->
|
|
|
+ <view class="le">
|
|
|
+ <view class="tit flex-start">
|
|
|
+ <view class="ti1">{{$t('enter.u1')}}</view>
|
|
|
+ <view class="ti2">({{$t('enter.u2')}})</view>
|
|
|
+ </view>
|
|
|
+ <view class="he">
|
|
|
+ <view class="numbox flex-start">
|
|
|
+ <view class="he1 flex" @click="upOnBtnData.value=it" v-for="it in arMoneyList">
|
|
|
+ <view class="wen">{{it}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="yi flex-start">
|
|
|
- <image class="img" src="../../static/icon/le.png" mode=""></image>
|
|
|
- <view class="wz padding-l-10">{{history.base.token}}</view>
|
|
|
- <view class="qx padding-l-10" v-if="history.next.id">{{history.next.no}}</view>
|
|
|
- </view>
|
|
|
- <view class="shu">
|
|
|
- 0.064489
|
|
|
- </view>
|
|
|
</view>
|
|
|
- <!--右 -->
|
|
|
- <view class="ri">
|
|
|
- <view class="ti flex-center">
|
|
|
- <view class="t1">{{$t('enter.u3')}}</view>
|
|
|
- <view class="t2 padding-l-10">{{history.base.timebar}}</view>
|
|
|
- </view>
|
|
|
+ <view class="yi flex-start">
|
|
|
+ <image class="img" src="../../static/icon/le.png" mode=""></image>
|
|
|
+ <view class="wz padding-l-10">{{history.base.token}}</view>
|
|
|
+ <view class="qx padding-l-10" v-if="history.next.id">{{history.next.no}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="shu">
|
|
|
+ 0.064489
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!--右 -->
|
|
|
+ <view class="ri">
|
|
|
+ <view class="ti flex-center">
|
|
|
+ <view class="t1">{{$t('enter.u3')}}</view>
|
|
|
+ <view class="t2 padding-l-10">{{history.base.timebar}}</view>
|
|
|
+ </view>
|
|
|
|
|
|
- <view class="dh">
|
|
|
- <input class="input" type="number" v-model="gameMoneyValue">
|
|
|
- </view>
|
|
|
- <view class="btn">
|
|
|
- <view class="bt flex">
|
|
|
- <view class="btnItem btnle" @click="onbet(2)">
|
|
|
- <image class="imag" src="../../static/icon/xia.png" mode=""></image>
|
|
|
- <text class="xia">{{$t('enter.u4')}}</text>
|
|
|
- </view>
|
|
|
- <view class="btnItem btnri" @click="onbet(1)">
|
|
|
- <image class="imag" src="../../static/icon/shang.png" mode=""></image>
|
|
|
- <text class="xia">{{$t('enter.u6')}}</text>
|
|
|
- </view>
|
|
|
+ <view class="dh">
|
|
|
+ <input class="input" :placeholder="$t('enter.a9')" type="number" v-model="upOnBtnData.value">
|
|
|
+ </view>
|
|
|
+ <view class="btn">
|
|
|
+ <view class="bt flex">
|
|
|
+ <view class="btnItem btnle" @click="onPayBet(2)">
|
|
|
+ <image class="imag" src="../../static/icon/xia.png" mode=""></image>
|
|
|
+ <text class="xia">{{$t('enter.u4')}}</text>
|
|
|
</view>
|
|
|
- <view class="bt flex">
|
|
|
- <view class="btnItem btnle" @click="onbet(3)">
|
|
|
- <view class="xia">{{$t('enter.u5')}}</view>
|
|
|
- </view>
|
|
|
- <view class="btnItem btnri" @click="onbet(4)">
|
|
|
- <view class="xia">{{$t('enter.u7')}}</view>
|
|
|
- </view>
|
|
|
+ <view class="btnItem btnri" @click="onPayBet(1)">
|
|
|
+ <image class="imag" src="../../static/icon/shang.png" mode=""></image>
|
|
|
+ <text class="xia">{{$t('enter.u6')}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="db flex">
|
|
|
- <view class="jl">{{$t('enter.u8')}}</view>
|
|
|
- <view class="sj">
|
|
|
- <text v-if="time.H<10">0</text>
|
|
|
- {{time.H}}
|
|
|
+ <view class="bt flex">
|
|
|
+ <view class="btnItem btnle" @click="onPayBet(3)">
|
|
|
+ <view class="xia">{{$t('enter.u5')}}</view>
|
|
|
</view>
|
|
|
- <view class="sj">
|
|
|
- <text v-if="time.M<10">0</text>
|
|
|
- {{time.M}}
|
|
|
- </view>
|
|
|
- <view class="sj">
|
|
|
- <text v-if="time.S<10">0</text>
|
|
|
- {{time.S}}
|
|
|
+ <view class="btnItem btnri" @click="onPayBet(4)">
|
|
|
+ <view class="xia">{{$t('enter.u7')}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="kb"></view>
|
|
|
-
|
|
|
- <view class="last">
|
|
|
- <view class="flex">
|
|
|
- <text>{{$t('enter.u9')}}</text>
|
|
|
- <view class="flex" @click="nav">
|
|
|
- <text>{{$t('enter.u10')}}</text>
|
|
|
- <image class="lb" src="../../static/icon/jt.png" mode=""></image>
|
|
|
+
|
|
|
+ <view class="db flex">
|
|
|
+ <view class="jl">{{$t('enter.u8')}}</view>
|
|
|
+ <view class="sj">
|
|
|
+ <text v-if="time.H<10">0</text>
|
|
|
+ {{time.H}}
|
|
|
+ </view>
|
|
|
+ <view class="sj">
|
|
|
+ <text v-if="time.M<10">0</text>
|
|
|
+ {{time.M}}
|
|
|
+ </view>
|
|
|
+ <view class="sj">
|
|
|
+ <text v-if="time.S<10">0</text>
|
|
|
+ {{time.S}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="bg">
|
|
|
- <view class="biaotou flex">
|
|
|
- <view class="biwe">{{$t('enter.u11')}}</view>
|
|
|
- <view class="biwe">{{$t('enter.u12')}}</view>
|
|
|
- <view class="biwe">{{$t('enter.u13')}}</view>
|
|
|
- <view class="biwe">{{$t('enter.u14')}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="kb"></view>
|
|
|
+
|
|
|
+ <view class="last">
|
|
|
+ <view class="flex">
|
|
|
+ <text>{{$t('enter.u9')}}</text>
|
|
|
+ <view class="flex" @click="nav">
|
|
|
+ <text>{{$t('enter.u10')}}</text>
|
|
|
+ <image class="lb" src="../../static/icon/jt.png" mode=""></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="bg">
|
|
|
+ <view class="biaotou flex">
|
|
|
+ <view class="biwe">{{$t('enter.u11')}}</view>
|
|
|
+ <view class="biwe">{{$t('enter.u12')}}</view>
|
|
|
+ <view class="biwe">{{$t('enter.u13')}}</view>
|
|
|
+ <view class="biwe">{{$t('enter.u14')}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="list flex" v-for="(item,ind) in betList.list" :key="ind">
|
|
|
+ <view class="biwe flex-start">
|
|
|
+ <view class="tr">{{history.base.token}}</view>
|
|
|
+ <view class="nametip">{{history.base.timebar}}</view>
|
|
|
+ <image class="zz" src="../../static/icon/shang.png" mode=""></image>
|
|
|
</view>
|
|
|
- <view class="list flex" v-for="(item,ind) in betList.list" :key="ind">
|
|
|
- <view class="biwe flex-start">
|
|
|
- <view class="tr">{{history.base.token}}</view>
|
|
|
- <view class="nametip">{{history.base.timebar}}</view>
|
|
|
- <image class="zz" src="../../static/icon/shang.png" mode=""></image>
|
|
|
+ <view class="biwe">23.5000</view>
|
|
|
+ <view class="biwe">23.5000</view>
|
|
|
+ <view class="biwe flex">
|
|
|
+ <view class="list-buttom success margin-r-10">
|
|
|
+ {{$t('enter.u17')}}
|
|
|
</view>
|
|
|
- <view class="biwe">23.5000</view>
|
|
|
- <view class="biwe">23.5000</view>
|
|
|
- <view class="biwe flex">
|
|
|
- <view class="list-buttom success margin-r-10">
|
|
|
- {{$t('enter.u17')}}
|
|
|
- </view>
|
|
|
- <view class="list-buttom primary">
|
|
|
- {{$t('enter.u18')}}
|
|
|
- </view>
|
|
|
+ <view class="list-buttom primary">
|
|
|
+ {{$t('enter.u18')}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
- <view class="chz flex">
|
|
|
- <view>
|
|
|
- <view class="yue padding-b-10">{{$t('enter.u15')}}</view>
|
|
|
- <view class="yes">{{userWallet}}U</view>
|
|
|
- </view>
|
|
|
- <view class="flex-start" @click="navC">
|
|
|
- <view class="quc">{{$t('enter.u16')}}</view>
|
|
|
- <image class="choz" src="../../static/icon/jt.png" mode=""></image>
|
|
|
- </view>
|
|
|
+ <view class="chz flex">
|
|
|
+ <view>
|
|
|
+ <view class="yue padding-b-10">{{$t('enter.u15')}}</view>
|
|
|
+ <view class="yes">{{userWallet}}U</view>
|
|
|
+ </view>
|
|
|
+ <view class="flex-start" @click="navC">
|
|
|
+ <view class="quc">{{$t('enter.u16')}}</view>
|
|
|
+ <image class="choz" src="../../static/icon/jt.png" mode=""></image>
|
|
|
</view>
|
|
|
- <taber tab='entertainment'></taber>
|
|
|
- </template>
|
|
|
- <template v-if="upOnBtnData.show">
|
|
|
+ </view>
|
|
|
+ <uni-popup type="bottom" ref="popup" :mask-click="false" @maskClick='colsePayPassword'>
|
|
|
<view class="page">
|
|
|
-
|
|
|
<view>
|
|
|
<view class="pay-title">
|
|
|
- <text v-show="AffirmStatus === 1">请输入6位支付密码</text>
|
|
|
- <text v-show="AffirmStatus === 2">请设置6位支付密码</text>
|
|
|
- <text v-show="AffirmStatus === 3">请确认6位支付密码</text>
|
|
|
+ <text>{{$t('enter.b3')}}</text>
|
|
|
</view>
|
|
|
<view class="pay-password" @click="onPayUp">
|
|
|
- <view class="list">
|
|
|
- <text v-show="passwordArr.length >= 1">●</text>
|
|
|
- </view>
|
|
|
- <view class="list">
|
|
|
- <text v-show="passwordArr.length >= 2">●</text>
|
|
|
- </view>
|
|
|
- <view class="list">
|
|
|
- <text v-show="passwordArr.length >= 3">●</text>
|
|
|
- </view>
|
|
|
- <view class="list">
|
|
|
- <text v-show="passwordArr.length >= 4">●</text>
|
|
|
- </view>
|
|
|
- <view class="list">
|
|
|
- <text v-show="passwordArr.length >= 5">●</text>
|
|
|
- </view>
|
|
|
- <view class="list">
|
|
|
- <text v-show="passwordArr.length >= 6">●</text>
|
|
|
+ <view class="list" v-for="item in 6">
|
|
|
+ <text v-show="upOnBtnData.passwordArr.length >= item">●</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="hint">
|
|
|
<text>忘记支付密码?</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"></cc-defineKeyboard>
|
|
|
+ <cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"
|
|
|
+ :viewShow="true"></cc-defineKeyboard>
|
|
|
</view>
|
|
|
- </template>
|
|
|
+ </uni-popup>
|
|
|
+ <taber tab='entertainment' v-if="!upOnBtnData.show"></taber>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -211,7 +192,6 @@
|
|
|
arMoneyList: [
|
|
|
1, 5, 10, 20, 50, 100
|
|
|
],
|
|
|
- gameMoneyValue: 0,
|
|
|
actionIndex: 0,
|
|
|
// 当前游戏列表
|
|
|
gameList: [],
|
|
|
@@ -240,24 +220,21 @@
|
|
|
},
|
|
|
userWallet: 0,
|
|
|
upOnBtnData: {
|
|
|
+ // 是否显示底部导航栏
|
|
|
show: false,
|
|
|
- type: ''
|
|
|
+ type: '',
|
|
|
+ // 当前输入的密码
|
|
|
+ passwordArr: [],
|
|
|
+ value: '',
|
|
|
},
|
|
|
- AffirmStatus: 1,
|
|
|
- passwordArr: [],
|
|
|
- oldPasswordArr: [],
|
|
|
- newPasswordArr: [],
|
|
|
- afPasswordArr: [],
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {
|
|
|
-
|
|
|
- },
|
|
|
+ onLoad() {},
|
|
|
onShow() {
|
|
|
if (!this.hasLogin) {
|
|
|
uni.showModal({
|
|
|
- title: "登陆",
|
|
|
- content: '您未登录!是否马上登录?',
|
|
|
+ title: this.$t('enter.c4'),
|
|
|
+ content: this.$t('enter.b5'),
|
|
|
success: (e) => {
|
|
|
// 判断是否点击确认按钮
|
|
|
if (e.confirm) {
|
|
|
@@ -278,41 +255,77 @@
|
|
|
clearInterval(this.time.t)
|
|
|
},
|
|
|
methods: {
|
|
|
- onbet(type) {
|
|
|
+ // 点击触发支付事件
|
|
|
+ onPayBet(type) {
|
|
|
+ if (!this.upOnBtnData.value) {
|
|
|
+ uni.showToast({
|
|
|
+ title: this.$t('enter.a9'),
|
|
|
+ icon: "error"
|
|
|
+
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.upOnBtnData.type = type;
|
|
|
+ this.openPayPassword();
|
|
|
+ },
|
|
|
+ // 打开支付弹窗
|
|
|
+ openPayPassword() {
|
|
|
this.upOnBtnData.show = true;
|
|
|
- this.$refs.CodeKeyboard.show();
|
|
|
+ this.$refs.popup.open();
|
|
|
+ },
|
|
|
+ // 关闭支付弹窗
|
|
|
+ colsePayPassword() {
|
|
|
+ this.upOnBtnData.show = false;
|
|
|
+ this.$refs.popup.close();
|
|
|
},
|
|
|
|
|
|
KeyInfo(val) {
|
|
|
+ console.log(val);
|
|
|
+ let arr = this.upOnBtnData.passwordArr;
|
|
|
if (val.index >= 6) {
|
|
|
return;
|
|
|
}
|
|
|
// 判断是否输入的是删除键
|
|
|
if (val.keyCode === 8) {
|
|
|
// 删除最后一位
|
|
|
- this.passwordArr.splice(val.index + 1, 1)
|
|
|
+ arr.splice(val.index + 1, 1)
|
|
|
}
|
|
|
- // 判断是否输入的是.
|
|
|
+ // 判断是否输入的是取消案件
|
|
|
else if (val.keyCode == 190) {
|
|
|
+ this.colsePayPassword();
|
|
|
// 输入.无效
|
|
|
} else {
|
|
|
- this.passwordArr.push(val.key);
|
|
|
+ arr.push(val.key);
|
|
|
+ }
|
|
|
+ // 开始交易
|
|
|
+ if (arr.length == 6) {
|
|
|
+ this.colsePayPassword();
|
|
|
+ this.gameBetIn();
|
|
|
}
|
|
|
-
|
|
|
- uni.showModal({
|
|
|
- title: '温馨提示',
|
|
|
- content: '输入密码是 = ' + JSON.stringify(this.passwordArr)
|
|
|
- })
|
|
|
},
|
|
|
// 参与压住
|
|
|
gameBetIn(type) {
|
|
|
-
|
|
|
+ const that = this;
|
|
|
+ const upData = {
|
|
|
+ id: that.history.next.id,
|
|
|
+ bet: that.upOnBtnData.type,
|
|
|
+ num: that.upOnBtnData.value,
|
|
|
+ trade_password: that.upOnBtnData.passwordArr.join("")
|
|
|
+ };
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ gameBetIn(upData).then((res) => {
|
|
|
+ uni.hideLoading()
|
|
|
+ }).catch((res) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
},
|
|
|
// 获取用户余额信息
|
|
|
getUserWallet() {
|
|
|
gameWallet().then((res) => {
|
|
|
- this.userWallet = res.data.back.USDT.money.money
|
|
|
+ this.userWallet = +res.data.back.USDT.money.money
|
|
|
})
|
|
|
if (this.history.next.id) {
|
|
|
this.opTiem();
|
|
|
@@ -353,6 +366,7 @@
|
|
|
changeTab(item, ind) {
|
|
|
if (ind != this.actionIndex) {
|
|
|
this.actionIndex = ind;
|
|
|
+ clearInterval(this.time.t)
|
|
|
this.gameDataInit(item.id);
|
|
|
}
|
|
|
},
|
|
|
@@ -374,12 +388,12 @@
|
|
|
this.gameList = res.data.list;
|
|
|
})
|
|
|
},
|
|
|
- // 加载基础游戏信息
|
|
|
- async gameDataInit(id) {
|
|
|
+ // 重新加载基础游戏信息
|
|
|
+ async gameDataInit(id, reload = true) {
|
|
|
// 获取基础信息
|
|
|
await this.getGame(id);
|
|
|
//获取K线
|
|
|
- this.getGameKline();
|
|
|
+ this.getGameKline(reload);
|
|
|
// 获取游戏压住记录
|
|
|
this.gameBetList();
|
|
|
},
|
|
|
@@ -394,7 +408,7 @@
|
|
|
})
|
|
|
},
|
|
|
// 获取游戏K线信息
|
|
|
- getGameKline() {
|
|
|
+ getGameKline(reload = true) {
|
|
|
const that = this;
|
|
|
gameKline({
|
|
|
page: 1,
|
|
|
@@ -415,10 +429,11 @@
|
|
|
linearr.push(addar)
|
|
|
}
|
|
|
that.$nextTick(() => {
|
|
|
+ // 判断是否要重载数据
|
|
|
that.initKline({
|
|
|
xarr,
|
|
|
linearr
|
|
|
- })
|
|
|
+ }, reload)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
@@ -456,135 +471,162 @@
|
|
|
}
|
|
|
return result;
|
|
|
},
|
|
|
-
|
|
|
- async initKline(data) {
|
|
|
+ // 重载K线
|
|
|
+ async initKline(data, reload = true) {
|
|
|
const that = this;
|
|
|
try {
|
|
|
const chart = await this.$refs.chart.init(echarts);
|
|
|
- const upColor = '#00da3c';
|
|
|
- const downColor = '#ec0000';
|
|
|
- chart.setOption(
|
|
|
- (this.option = {
|
|
|
- animation: false,
|
|
|
- legend: {
|
|
|
- top: 10,
|
|
|
- left: 10,
|
|
|
- data: ['MA5', 'MA10', 'MA20'],
|
|
|
- textStyle: {
|
|
|
- color: '#999999'
|
|
|
- }
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
- axisPointer: {
|
|
|
- type: 'cross'
|
|
|
+ if (reload) {
|
|
|
+ const upColor = '#00da3c';
|
|
|
+ const downColor = '#ec0000';
|
|
|
+ chart.setOption(
|
|
|
+ (this.option = {
|
|
|
+ animation: false,
|
|
|
+ legend: {
|
|
|
+ top: 10,
|
|
|
+ left: 10,
|
|
|
+ data: ['MA5', 'MA10', 'MA20'],
|
|
|
+ textStyle: {
|
|
|
+ color: '#999999'
|
|
|
+ }
|
|
|
},
|
|
|
- borderWidth: 1,
|
|
|
- borderColor: '#ccc',
|
|
|
- padding: 10,
|
|
|
- textStyle: {
|
|
|
- color: '#000'
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'axis',
|
|
|
+ axisPointer: {
|
|
|
+ type: 'cross'
|
|
|
+ },
|
|
|
+ borderWidth: 1,
|
|
|
+ borderColor: '#ccc',
|
|
|
+ padding: 10,
|
|
|
+ textStyle: {
|
|
|
+ color: '#000'
|
|
|
+ },
|
|
|
+ position: function(pos, params, el, elRect, size) {
|
|
|
+ const obj = {
|
|
|
+ top: 10
|
|
|
+ };
|
|
|
+ obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 40;
|
|
|
+
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
},
|
|
|
- position: function(pos, params, el, elRect, size) {
|
|
|
- const obj = {
|
|
|
- top: 10
|
|
|
- };
|
|
|
- obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 40;
|
|
|
-
|
|
|
- return obj;
|
|
|
- }
|
|
|
- },
|
|
|
- dataZoom: [{
|
|
|
- type: 'inside',
|
|
|
- xAxisIndex: 0,
|
|
|
- start: 50,
|
|
|
- end: 100
|
|
|
- }],
|
|
|
- grid: [{
|
|
|
- left: 10,
|
|
|
- right: 55,
|
|
|
- bottom: 20,
|
|
|
- top: 45
|
|
|
- }],
|
|
|
+ dataZoom: [{
|
|
|
+ type: 'inside',
|
|
|
+ xAxisIndex: 0,
|
|
|
+ start: 50,
|
|
|
+ end: 100
|
|
|
+ }],
|
|
|
+ grid: [{
|
|
|
+ left: 10,
|
|
|
+ right: 55,
|
|
|
+ bottom: 20,
|
|
|
+ top: 45
|
|
|
+ }],
|
|
|
+ xAxis: [{
|
|
|
+ type: 'category',
|
|
|
+ data: data.xarr,
|
|
|
+ axisLine: {
|
|
|
+ onZero: false
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ min: 'dataMin',
|
|
|
+ max: 'dataMax',
|
|
|
+ axisPointer: {
|
|
|
+ z: 100
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ yAxis: [{
|
|
|
+ scale: true,
|
|
|
+ splitNumber: 4,
|
|
|
+ position: 'right',
|
|
|
+ axisTick: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ splitLine: {
|
|
|
+ show: false,
|
|
|
+ lineStyle: {
|
|
|
+ color: '#e3e3e3'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ inside: false,
|
|
|
+ formatter: '{value}\n',
|
|
|
+ color: '#999999'
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ series: [{
|
|
|
+ name: that.history.base.token + '-USDT',
|
|
|
+ type: 'candlestick',
|
|
|
+ data: data.linearr,
|
|
|
+ itemStyle: {
|
|
|
+ color: upColor,
|
|
|
+ color0: downColor,
|
|
|
+ borderColor: undefined,
|
|
|
+ borderColor0: undefined
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "MA5",
|
|
|
+ smooth: true,
|
|
|
+ type: 'line',
|
|
|
+ data: that.calculateMA(5, data),
|
|
|
+ showSymbol: false,
|
|
|
+ lineStyle: {
|
|
|
+ width: 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "MA10",
|
|
|
+ smooth: true,
|
|
|
+ type: 'line',
|
|
|
+ data: that.calculateMA(10, data),
|
|
|
+ showSymbol: false,
|
|
|
+ lineStyle: {
|
|
|
+ width: 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "MA20",
|
|
|
+ smooth: true,
|
|
|
+ type: 'line',
|
|
|
+ data: that.calculateMA(20, data),
|
|
|
+ showSymbol: false,
|
|
|
+ lineStyle: {
|
|
|
+ width: 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }),
|
|
|
+ true
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ chart.setOption({
|
|
|
xAxis: [{
|
|
|
type: 'category',
|
|
|
data: data.xarr,
|
|
|
- axisLine: {
|
|
|
- onZero: false
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- min: 'dataMin',
|
|
|
- max: 'dataMax',
|
|
|
- axisPointer: {
|
|
|
- z: 100
|
|
|
- }
|
|
|
- }],
|
|
|
- yAxis: [{
|
|
|
- scale: true,
|
|
|
- splitNumber: 4,
|
|
|
- position: 'right',
|
|
|
- axisTick: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: false,
|
|
|
- lineStyle: {
|
|
|
- color: '#e3e3e3'
|
|
|
- }
|
|
|
- },
|
|
|
- axisLabel: {
|
|
|
- inside: false,
|
|
|
- formatter: '{value}\n',
|
|
|
- color: '#999999'
|
|
|
- }
|
|
|
}],
|
|
|
series: [{
|
|
|
name: that.history.base.token + '-USDT',
|
|
|
- type: 'candlestick',
|
|
|
data: data.linearr,
|
|
|
- itemStyle: {
|
|
|
- color: upColor,
|
|
|
- color0: downColor,
|
|
|
- borderColor: undefined,
|
|
|
- borderColor0: undefined
|
|
|
- }
|
|
|
},
|
|
|
{
|
|
|
name: "MA5",
|
|
|
- smooth: true,
|
|
|
- type: 'line',
|
|
|
data: that.calculateMA(5, data),
|
|
|
- showSymbol: false,
|
|
|
- lineStyle: {
|
|
|
- width: 1
|
|
|
- }
|
|
|
},
|
|
|
{
|
|
|
name: "MA10",
|
|
|
- smooth: true,
|
|
|
- type: 'line',
|
|
|
data: that.calculateMA(10, data),
|
|
|
- showSymbol: false,
|
|
|
- lineStyle: {
|
|
|
- width: 1
|
|
|
- }
|
|
|
},
|
|
|
{
|
|
|
name: "MA20",
|
|
|
- smooth: true,
|
|
|
- type: 'line',
|
|
|
data: that.calculateMA(20, data),
|
|
|
- showSymbol: false,
|
|
|
- lineStyle: {
|
|
|
- width: 1
|
|
|
- }
|
|
|
},
|
|
|
]
|
|
|
- }),
|
|
|
- true
|
|
|
- )
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
} catch (e) {
|
|
|
console.log(e, 'cuowu');
|
|
|
@@ -620,11 +662,7 @@
|
|
|
$base: orangered; // 基础颜色
|
|
|
|
|
|
.page {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
width: 100%;
|
|
|
- height: 100%;
|
|
|
background-color: #FFFFFF;
|
|
|
|
|
|
.pay-title {
|