|
|
|
@ -8,10 +8,14 @@ |
|
|
|
<a href="oige.html"><p class="market_list border-bottom-grey">OIGEUSDT</p></a> |
|
|
|
<a href="gql.html"><p class="market_list border-bottom-grey">GQLUSDT</p></a> |
|
|
|
<a href="rpn.html"><p class="market_list border-bottom-grey">RPNUSDT</p></a> --> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('PYTN')" :style="{'color': title=='PYTN'?'red':'white'}">PYTNUSDT</p> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('OIGE')" :style="{'color': title=='OIGE'?'red':'white'}">OIGEUSDT</p> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('GQL')" :style="{'color': title=='GQL'?'red':'white'}">GQLUSDT</p> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('RPN')" :style="{'color': title=='RPN'?'red':'white'}">RPNUSDT</p> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('PYTN')" |
|
|
|
:style="{'color': fullPath =='PytnUsdt'?'red':'white'}">PYTNUSDT</p> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('OIGE')" |
|
|
|
:style="{'color': fullPath =='OigeUsdt'?'red':'white'}">OIGEUSDT</p> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('GQL')" |
|
|
|
:style="{'color': fullPath =='GqlUsdt'?'red':'white'}">GQLUSDT</p> |
|
|
|
<p class="market_list border-bottom-grey" @click="handleClick('RPN')" |
|
|
|
:style="{'color': fullPath =='RpnUsdt'?'red':'white'}">RPNUSDT</p> |
|
|
|
</div> |
|
|
|
<!-- 右侧内容 --> |
|
|
|
<div class="layui-body" style="top: 0 !important;bottom:0"> |
|
|
|
@ -45,9 +49,11 @@ |
|
|
|
</button> |
|
|
|
</blockquote> |
|
|
|
|
|
|
|
<HelloWorld :name='title'></HelloWorld> |
|
|
|
<router-view :title="title" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="site-tree-mobile"><i class="layui-icon"></i></div> |
|
|
|
<div class="site-mobile-shade"></div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -55,63 +61,115 @@ |
|
|
|
import $ from 'jquery'; |
|
|
|
// import 'layui-src/src/layui.js'; |
|
|
|
// import 'layui-src/src/css/layui.css'; |
|
|
|
import HelloWorld from '@/components/HelloWorld.vue'; |
|
|
|
import PytnUsdt from '@/components/PytnUsdt.vue'; |
|
|
|
// import '../../static/kline/src/klineCharts.js'; |
|
|
|
export default { |
|
|
|
name: "HomeView", |
|
|
|
components: { |
|
|
|
HelloWorld |
|
|
|
PytnUsdt |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
title:"PYTN" |
|
|
|
title: "PYTN", |
|
|
|
fullPath:"" |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
isMobile() { |
|
|
|
return window.innerWidth <= 768; // 根据你的需求设置移动端的判断条件 |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
$('.interval_btn').on('click', function(){ |
|
|
|
if(kcChart != null || kcChart != undefined){ |
|
|
|
var _this = $(this); |
|
|
|
kcCurrentData.interval = _this.attr('data-interval'); |
|
|
|
// 请求历史数据 |
|
|
|
kcHistoryKeyId = 1; |
|
|
|
var rang = setKLineVisibleRange(parseInt(Date.now() / 1000)); |
|
|
|
$.ajax({ |
|
|
|
url: "https://dfmg.dficoins.com/api/getkkline", |
|
|
|
type: 'get', |
|
|
|
async: false, |
|
|
|
data: { |
|
|
|
symbol: getSymbol(), |
|
|
|
interval: getSecondsByInterval(kcCurrentData.interval), |
|
|
|
times: kcHistoryKeyId, |
|
|
|
from: rang.from, |
|
|
|
to: rang.to + (365 * 86400) |
|
|
|
}, |
|
|
|
beforeSend: function(){ |
|
|
|
loading_index = layer.load(1, { |
|
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景 |
|
|
|
}); |
|
|
|
}, |
|
|
|
success:function (result) { //成功回调 |
|
|
|
console.log(result); |
|
|
|
if(result.status){ |
|
|
|
loadMoreKline(result.data, true, result.code); |
|
|
|
$('.interval_btn').removeClass('active'); |
|
|
|
_this.addClass('active'); |
|
|
|
}else{ |
|
|
|
|
|
|
|
} |
|
|
|
layer.close(loading_index); |
|
|
|
}, |
|
|
|
error: function(xhr){ |
|
|
|
layer.close(loading_index); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
$('.interval_btn').on('click', function() { |
|
|
|
if (kcChart != null || kcChart != undefined) { |
|
|
|
var _this = $(this); |
|
|
|
kcCurrentData.interval = _this.attr('data-interval'); |
|
|
|
// 请求历史数据 |
|
|
|
kcHistoryKeyId = 1; |
|
|
|
var rang = setKLineVisibleRange(parseInt(Date.now() / 1000)); |
|
|
|
$.ajax({ |
|
|
|
url: "https://dfmg.dficoins.com/api/getkkline", |
|
|
|
type: 'get', |
|
|
|
async: false, |
|
|
|
data: { |
|
|
|
symbol: getSymbol(), |
|
|
|
interval: getSecondsByInterval(kcCurrentData.interval), |
|
|
|
times: kcHistoryKeyId, |
|
|
|
from: rang.from, |
|
|
|
to: rang.to + (365 * 86400) |
|
|
|
}, |
|
|
|
beforeSend: function() { |
|
|
|
loading_index = layer.load(1, { |
|
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景 |
|
|
|
}); |
|
|
|
}, |
|
|
|
success: function(result) { //成功回调 |
|
|
|
console.log(result); |
|
|
|
if (result.status) { |
|
|
|
loadMoreKline(result.data, true, result.code); |
|
|
|
$('.interval_btn').removeClass('active'); |
|
|
|
_this.addClass('active'); |
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
layer.close(loading_index); |
|
|
|
}, |
|
|
|
error: function(xhr) { |
|
|
|
layer.close(loading_index); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
//手机设备的简单适配 |
|
|
|
$('.site-tree-mobile').on('click', function() { |
|
|
|
$('body').addClass('site-mobile'); |
|
|
|
}); |
|
|
|
$('.site-mobile-shade').on('click', function() { |
|
|
|
$('body').removeClass('site-mobile'); |
|
|
|
}); |
|
|
|
window.addEventListener('resize', this.handleResize); |
|
|
|
// 初始化设置 fullPath |
|
|
|
this.fullPath = this.$route.fullPath.split('/')[1]; |
|
|
|
// 监听路由改变 |
|
|
|
this.$router.afterEach((to, from) => { |
|
|
|
this.fullPath = to.fullPath.split('/')[1]; |
|
|
|
}); |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
window.removeEventListener('resize', this.handleResize); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleClick(name){ |
|
|
|
handleResize() { |
|
|
|
if (this.isMobile) { |
|
|
|
location.reload(); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleClick(name) { |
|
|
|
this.title = name |
|
|
|
switch (name) { |
|
|
|
case 'PYTN': |
|
|
|
this.$router.push({ |
|
|
|
path: '/PytnUsdt' |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'OIGE': |
|
|
|
this.$router.push({ |
|
|
|
path: '/OigeUsdt' |
|
|
|
}); |
|
|
|
break; |
|
|
|
case 'GQL': |
|
|
|
this.$router.push({ |
|
|
|
path: '/GqlUsdt' |
|
|
|
}); |
|
|
|
break; |
|
|
|
default: |
|
|
|
this.$router.push({ |
|
|
|
path: '/RpnUsdt' |
|
|
|
}); |
|
|
|
break; |
|
|
|
} |
|
|
|
$('body').removeClass('site-mobile'); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|