'; if (value[0].value) { return_msg += '역사:'+currency_mark + value[0].value+'
'; } if (value[1].value) { return_msg += '예측:'+currency_mark + value[1].value; } return return_msg } }, series: [ { data: data1, name: "역사", type: 'line', smooth: true, itemStyle: { color: '#adb5bd' }, areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgba(173,181,189,0.8)' }, { offset: 1, color: 'rgba(173,181,189,0.3)' } ]) }, }, { data: data2, name:"예측", type: 'line', itemStyle: { color: 'rgba(58,77,233)' }, smooth: true, areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgba(58,77,233,0.8)' }, { offset: 1, color: 'rgba(58,77,233,0.3)' } ]) } } ] }; if (document.getElementById("echarts-graph2").querySelector("canvas")) { echarts.dispose(document.getElementById("echarts-graph2")); } echarts.init(document.getElementById("echarts-graph2")).setOption(option, true); }, addMarket() { this.MarketList.push({ 'price': 1, 'sum': 100, 'num': 100, "oprate": "Buy" }); this.initDropDown(); }, handleDel(index) { let MarketList = this.MarketList; MarketList.splice(index, 1); }, handlePriceBlur(index) { this.MarketList[index].sum = (this.MarketList[index].num * this.MarketList[index].price).toFixed(2); }, handleSumBlur(index) { this.MarketList[index].num = (this.MarketList[index].sum / this.MarketList[index].price).toFixed(2); }, handleNumBlur(index) { this.MarketList[index].sum = (this.MarketList[index].num * this.MarketList[index].price).toFixed(2); }, hidetoptips() { vm.showtoptips = false; }, sendJoin() { var jsonString = this.slug; try { this.socket.emit('register', jsonString); } catch (error) { alert('Invalid JSON input. Please enter a valid JSON object.'); } }, collect() { this.$http.jsonp('https://www.kdj.com/api/user/collect?shou='+this.hasCollect+'&slug='+this.slug).then(function (res) { var data = res.body; if(data.code == 1) { if (this.hasCollect == 0) { this.hasCollect = 1; } else { this.hasCollect = 0 ; } } }, function () { window.location.href = "/ko/user/login"; }); }, lunbo(){ let swiper = new Swiper(".dggbFearSwiper", { loop: false, autoplay: { delay: 2500, disableOnInteraction: false, pauseOnMouseEnter: true, }, pagination: { el: ".swiper-pagination", clickable: true, }, }); swiper.el.onmouseover = function(){ swiper.autoplay.stop(); }; swiper.el.onmouseout = function(){ swiper.autoplay.start(); }; }, loadStatistics() { this.$http.jsonp('https://www.kdj.com/api/top/getCoinStatistics?slug='+this.slug).then(function (res) { var data = res.body.data; if (!data) { this.msg('no data'); } this.statistics = data; var currency_huilv = getCookie('currency_huilv'); var currency_mark = getCookie('currency_mark'); currency_mark = decodeURIComponent(currency_mark); var new_price = currency_huilv*data.olnyprice; new_price = new_price.toFixed(20); this.currencymark = currency_mark; this.price = this.decimal(new_price,false,true); }, function () { console.log('error'); }); }, loadCoinInfo() { this.$http.jsonp('https://www.kdj.com/api/top/get_coin_info?slug='+this.slug).then(function (res) { var data = res.body.data; if (!data) { this.msg('no data'); } this.coinInfo = data; }, function () { console.log('error'); }); }, calculate() { this.$http.jsonp('https://www.kdj.com/api/top/ordinary_calculate?slug=' + this.slug + '&calculateOption=' + this.calculateOption + '&investment_amount=' + this.investment_amount + '&doge_language=' + this.doge_language).then(function (res) { var data = res.body.data; if (!data) { } this.calculate_data = data; }, function () { console.log('error'); }); }, advanced_calculate() { var _this = this; var market_list = JSON.stringify(this.MarketList); this.$http.post('https://www.kdj.com/api/top/advanced_calculate', { slug: this.slug, market_list: this.MarketList }, { emulateJSON: true }).then(res => { var data = res.body.data; if (data.profit_rate == 0) { layer.msg('No buying and selling transactions, unable to calculate profit and loss') } if (data.profit_rate > 20) { var new_profit_high = _this.profit_high.replace('#profit_rate',data.profit_rate); _this.profit_high = new_profit_high; } else if (data.profit_rate > 0 && data.profit_rate < 20) { var new_profit_low = _this.profit_low.replace('#profit_rate',data.profit_rate); _this.profit_low = new_profit_low; } else if (data.profit_rate < -50) { var new_profit_gt_fifty = _this.profit_gt_fifty.replace('#profit_rate',data.profit_rate); _this.profit_gt_fifty = new_profit_gt_fifty; } else if (data.profit_rate > -50 && data.profit_rate < -10) { var new_profit_middle = _this.profit_middle.replace('#profit_rate',data.profit_rate); _this.profit_middle = new_profit_middle; } else if (data.profit_rate > -10 && data.profit_rate < 0) { var new_profit_lt_ten = _this.profit_lt_ten.replace('#profit_rate',data.profit_rate); _this.profit_lt_ten = new_profit_lt_ten; } var currency_mark = getCookie('currency_mark'); currency_mark = decodeURIComponent(currency_mark); if (currency_mark === 'null') { currency_mark = '$'; } var new_advanced_detail = _this.advanced_origin_detail.replace('#buy_sum',currency_mark+data.buy_sum); new_advanced_detail = new_advanced_detail.replace('#sell_num',data.sell_num); new_advanced_detail = new_advanced_detail.replace('#profit_sum',currency_mark+data.profit_sum); new_advanced_detail = new_advanced_detail.replace('#surplus_num',data.surplus_num); if (data.profit_rate >= 0) { new_advanced_detail = new_advanced_detail.replace('#profit_rate',""+data.profit_rate+"%"); } else { new_advanced_detail = new_advanced_detail.replace('#profit_rate',""+data.profit_rate+"%"); } _this.advanced_detail = new_advanced_detail; this.advanced_calculate_data = data; }); }, get_analysis_data(interval) { this.interval = interval; var doge_language = getCookie('doge_language'); this.$http.jsonp('https://www.kdj.com/api/top/get_analysis_data?slug=' + this.slug + '&interval=' + interval + '&doge_language=' + doge_language).then(function (res) { var data = res.body.data; if (data.length == 0) { this.qsUsdInShow = false; } else { this.analysis_data = data; this.qsUsdInShow = true; this.marketPair = data.marketPair; this.initEchart(); } }, function () { console.log('error'); }); }, get_predict_long() { var _this = this; this.$http.jsonp('https://www.kdj.com/api/top/get_predict_long?slug=' + this.slug).then(function (res) { var data = res.body.data.list; if (!data) { this.msg('no data'); } this.predict_long = data; var new_word_one = _this.word_one.replace('#max_year',res.body.data.max_year); _this.word_one = new_word_one; new_word_one = _this.word_one.replace('#max_price',res.body.data.max_price); _this.word_one = new_word_one; var new_word_two = _this.word_two.replace('#return',""+res.body.data.max_return+"%"); _this.word_two = new_word_two; }, function () { console.log('error'); }); }, loadLayui() { this.$nextTick(() => { layui.use(['layer', 'element'], () => { const layer = layui.layer; this.layui_layer = layer; const element = layui.element; const dropdown = layui.dropdown; this.layui_element = element; this.layui_element.init(); this.dropdown = dropdown; }); }); }, mouseDownHandler: function (e) { this.mouseOffset = e.clientX || e.changedTouches[0].clientX; this.mouseFlag = true; }, mouseUpHandler: function (e) { this.mouseFlag = false; }, mouseMoveHandler: function (tabelId, e) { let divData = document.getElementById(tabelId); if (this.mouseFlag) { divData.scrollLeft -= (- this.mouseOffset + (this.mouseOffset = (e.clientX || e.changedTouches[0].clientX))); } if (divData.scrollLeft > 10) { this.showshadow[tabelId] = true; } else { this.showshadow[tabelId] = false; } }, scrolltable: function (tabelId) { let divData = document.getElementById(tabelId); if (divData == null) { return; } let thead = divData.querySelector('thead'); if (window.innerWidth >= 768) { thead.style.setProperty("top", "0"); return; } let doffHeight = divData.offsetTop; let dHeight = divData.offsetHeight; if (window.scrollY > doffHeight && window.scrollY < doffHeight + dHeight) { thead.style.setProperty("top", (window.scrollY - doffHeight - 5) + "px"); } else { thead.style.setProperty("top", "0"); } }, initDropDown: function () { vm.$nextTick(() => { vm.dropdown.render({ elem: '.qsMarketSelectTitle', data: [{ title: 'Buy', id: 100 }, { title: 'Sell', id: 101 }], click: function (obj) { this.elem.find('span').text(obj.title); } }); }) }, addMarketList: function () { this.MarketList.push({ "price": "", "sum": "", "num": "", "oprate": "Buy" }); this.initDropDown(); }, initEchart: function () { var _this = this; layui.config({ base: '/assets/front/js/echarts/', debug: true }); layui.extend({ echarts: 'echarts' }); layui.use(['echarts'], function () { var echarts = layui.echarts; var option = { series: [ { type: 'gauge', center: ['50%', '80%'], startAngle: 180, endAngle: 0, min: 0, max: 60, splitNumber: 12, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#fbcdd1' }, { offset: 1, color: '#e1cfe3' } ] ) }, progress: { show: true, width: 0 }, pointer: { show: false }, axisLine: { lineStyle: { width: 15 } }, axisTick: { show: false }, splitLine: { show: false }, axisLabel: { show: false }, anchor: { show: false }, title: { show: false }, detail: { valueAnimation: true, width: '60%', lineHeight: 40, borderRadius: 8, offsetCenter: [0, '20%'], fontSize: 30, fontWeight: 'bolder', formatter: function (value) { }, color: '#333333', }, hide_axisLine: { lineStyle: { width: 30, color: [ [40, '#FF6E76'], [30, '#FDDD60'], [20, '#58D9F9'], [10, '#7CFFB2'] ] } }, axisLabel: { color: '#999999', fontSize: 15, fontWeight: 'bold', distance: -50, rotate: 'tangential', formatter: function (value) { } }, data: [ { value: _this.analysis_data.oscillators.VALUE } ] }, { type: 'gauge', center: ['50%', '80%'], startAngle: 180, endAngle: 0, min: 0, max: 60, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#f03343' }, { offset: 1, color: '#8b4392' } ] ) }, progress: { show: true, width: 15 }, pointer: { show: true, offsetCenter: [0, '10%'], icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z', length: '85%', itemStyle: { color: '#131722' } }, axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: false }, axisLabel: { show: false }, detail: { show: false }, data: [ { value: _this.analysis_data.oscillators.VALUE } ] } ] }; option.series[0].radius = '100%'; option.series[1].radius = '100%'; const qsUsdCont1 = document.getElementById("qsUsdCont1"); echarts.init(qsUsdCont1).setOption(option, true); var option = { series: [ { type: 'gauge', center: ['50%', '80%'], startAngle: 180, endAngle: 0, min: 0, max: 60, splitNumber: 12, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#fbcdd1' }, { offset: 1, color: '#e1cfe3' } ] ) }, progress: { show: true, width: 0 }, pointer: { show: false }, axisLine: { lineStyle: { width: 15 } }, axisTick: { show: false }, splitLine: { show: false }, axisLabel: { show: false }, anchor: { show: false }, title: { show: false }, detail: { valueAnimation: true, width: '60%', lineHeight: 40, borderRadius: 8, offsetCenter: [0, '20%'], fontSize: 30, fontWeight: 'bolder', formatter: function (value) { }, color: '#333333', }, hide_axisLine: { lineStyle: { width: 30, color: [ [40, '#FF6E76'], [30, '#FDDD60'], [20, '#58D9F9'], [10, '#7CFFB2'] ] } }, axisLabel: { color: '#999999', fontSize: 15, fontWeight: 'bold', distance: -50, rotate: 'tangential', formatter: function (value) { } }, data: [ { value: _this.analysis_data.summary.VALUE } ] }, { type: 'gauge', center: ['50%', '80%'], startAngle: 180, endAngle: 0, min: 0, max: 60, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#f03343' }, { offset: 1, color: '#8b4392' } ] ) }, progress: { show: true, width: 15 }, pointer: { show: true, offsetCenter: [0, '10%'], icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z', length: '85%', itemStyle: { color: '#131722' } }, axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: false }, axisLabel: { show: false }, detail: { show: false }, data: [ { value: _this.analysis_data.summary.VALUE } ] } ] }; option.series[0].radius = '100%'; option.series[1].radius = '100%'; const qsUsdCont2 = document.getElementById("qsUsdCont2"); var qsUsdCont2echart = echarts.init(qsUsdCont2); qsUsdCont2echart.setOption(option, true); window.addEventListener('resize', function() { qsUsdCont2echart.resize(); }); var option = { series: [ { type: 'gauge', center: ['50%', '80%'], startAngle: 180, endAngle: 0, min: 0, max: 60, splitNumber: 12, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#fbcdd1' }, { offset: 1, color: '#e1cfe3' } ] ) }, progress: { show: true, width: 0 }, pointer: { show: false }, axisLine: { lineStyle: { width: 15 } }, axisTick: { show: false }, splitLine: { show: false }, axisLabel: { show: false }, anchor: { show: false }, title: { show: false }, detail: { valueAnimation: true, width: '60%', lineHeight: 40, borderRadius: 8, offsetCenter: [0, '20%'], fontSize: 30, fontWeight: 'bolder', formatter: function (value) { }, color: '#333333', }, hide_axisLine: { lineStyle: { width: 30, color: [ [40, '#FF6E76'], [30, '#FDDD60'], [20, '#58D9F9'], [10, '#7CFFB2'] ] } }, axisLabel: { color: '#999999', fontSize: 15, fontWeight: 'bold', distance: -50, rotate: 'tangential', formatter: function (value) { } }, data: [ { value: _this.analysis_data.moving_averages.VALUE } ] }, { type: 'gauge', center: ['50%', '80%'], startAngle: 180, endAngle: 0, min: 0, max: 60, itemStyle: { color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [ { offset: 0, color: '#f03343' }, { offset: 1, color: '#8b4392' } ] ) }, progress: { show: true, width: 15 }, pointer: { show: true, offsetCenter: [0, '10%'], icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z', length: '85%', itemStyle: { color: '#131722' } }, axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: false }, axisLabel: { show: false }, detail: { show: false }, data: [ { value: _this.analysis_data.moving_averages.VALUE } ] } ] }; option.series[0].radius = '100%'; option.series[1].radius = '100%'; const qsUsdCont3 = document.getElementById("qsUsdCont3"); echarts.init(qsUsdCont3).setOption(option, true); }); } }, }); function selecttext(score){ if(score<25){ return '극도의 공포'; } else if(score>=25 && score<40){ return '두려움'; } else if(score>=40 && score<60){ return '중립적'; } else if(score>=60 && score<75){ return '탐욕'; } else if(score>=75){ return '극도의 탐욕'; } } function selectcolor(score){ if(score<25){ return "#E72C35"; } else if(score>=25 && score<40){ return "#F6684C"; } else if(score>=40 && score<60){ return "#FC9E43"; } else if(score>=60 && score<75){ return "#89C55E"; } else if(score>=75){ return "#28AF69"; } }