|
@@ -84,7 +84,9 @@ var app = new Vue({
|
|
|
|
|
|
|
|
|
this.scoketInit()
|
|
|
- this.gcb()
|
|
|
+ if(this.typeId == 'GCB-USDT') {
|
|
|
+ this.gcb()
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
@@ -95,28 +97,40 @@ var app = new Vue({
|
|
|
this.getDealHis();
|
|
|
},
|
|
|
methods: {
|
|
|
+ sgToFixed(num,digit=2){
|
|
|
+ let nums=(num||0).toString().split('.');
|
|
|
+ return nums[0]+'.'+(nums[1]||'0').padEnd(digit, "0");
|
|
|
+ },
|
|
|
|
|
|
gcb() {
|
|
|
let that = this
|
|
|
axiosGet('/Levertade/gcb', {}).then(res => {
|
|
|
console.log(JSON.stringify(res), 'gcb++++')
|
|
|
console.log(res.name,'res.name+++++++++++++++++++++++++++')
|
|
|
- that.txData.name = res.name
|
|
|
- that.txData.lastPrice = +res.last
|
|
|
- that.txData.high = +res.max_price
|
|
|
- that.txData.volume = +res.hou_price
|
|
|
- that.txData.low = +res.min_price
|
|
|
- console.log(that.txData.lastPrice,that.txData.volume,'lastPricelastPricelastPricelastPricelastPricelastPrice')
|
|
|
- that.txData.upRate = ((that.txData.lastPrice - that.txData.volume) / that.txData
|
|
|
- .volume * 100).toFixed(2)
|
|
|
- txData.upFlag = +that.txData.upRate > 0 ? 1 : 2;
|
|
|
- if (that.timer) {
|
|
|
- clearTimeout(that.timer)
|
|
|
- that.timer = null
|
|
|
+ if(that.typeId == 'GCB-USDT') {
|
|
|
+ that.txData.name = res.name
|
|
|
+ that.txData.lastPrice = +res.last
|
|
|
+ that.txData.high = that.sgToFixed(+res.max_price)
|
|
|
+ that.txData.volume = that.sgToFixed(+res.hou_price)
|
|
|
+ that.txData.low = that.sgToFixed(+res.min_price)
|
|
|
+ console.log(that.txData.lastPrice,that.txData.volume,'lastPricelastPricelastPricelastPricelastPricelastPrice')
|
|
|
+ that.txData.upRate = that.sgToFixed(((that.txData.lastPrice - that.txData.volume) / that.txData
|
|
|
+ .volume * 100).toFixed(2))
|
|
|
+ txData.upFlag = +that.txData.upRate > 0 ? 1 : 2;
|
|
|
+ if (that.timer) {
|
|
|
+ clearTimeout(that.timer)
|
|
|
+ that.timer = null
|
|
|
+ }
|
|
|
+ that.timer = setTimeout(() => {
|
|
|
+ that.gcb()
|
|
|
+ },5000)
|
|
|
+ }else {
|
|
|
+ if (that.timer) {
|
|
|
+ clearTimeout(that.timer)
|
|
|
+ that.timer = null
|
|
|
+ }
|
|
|
}
|
|
|
- that.timer = setTimeout(() => {
|
|
|
- that.gcb()
|
|
|
- },5000)
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -682,15 +696,24 @@ var app = new Vue({
|
|
|
for (var i = 0; i < params.length; i++) {
|
|
|
if (params[i].seriesName === '日K') {
|
|
|
time = params[i].name;
|
|
|
- open = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
|
|
|
- 1], 2)) : 0;
|
|
|
- close = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
|
|
|
- 2], 2)) : 0;
|
|
|
- low = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
|
|
|
- 3], 2)) : 0;
|
|
|
- high = params[i].data.length > 1 ? Number(that.formatterNum(params[i].data[
|
|
|
- 4], 2)) : 0;
|
|
|
- amount = params[i].data.length > 1 ? Number(that.formatterNum(params[i]
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ open = params[i].data.length > 1 ? that.sgToFixed(that.formatterNum(params[i].data[
|
|
|
+ 1], 2)*1) : 0;
|
|
|
+ close = params[i].data.length > 1 ?that.sgToFixed(that.formatterNum(params[i].data[
|
|
|
+ 2], 2)*1) : 0;
|
|
|
+ low = params[i].data.length > 1 ? that.sgToFixed(that.formatterNum(params[i].data[
|
|
|
+ 3], 2)*1) : 0;
|
|
|
+ high = params[i].data.length > 1 ? that.sgToFixed(that.formatterNum(params[i].data[
|
|
|
+ 4], 2)*1) : 0;
|
|
|
+ amount = params[i].data.length > 1 ? that.sgToFixed(that.formatterNum(params[i]
|
|
|
.data[5], 2)) : 0;
|
|
|
|
|
|
tooltip = '<div class="charts-tooltip">' +
|