This commit is contained in:
2026-01-14 14:48:14 +08:00
parent 7862d37545
commit 801a973801
8 changed files with 36 additions and 12 deletions

View File

@@ -403,7 +403,12 @@
turnoverTbData: [], //成交记录
entrustTbData: [], //委托定单
//深度数据
depthsData: {},
depthsData: {
asks: [],
bids: [],
price: 0,
cnyPrice: 0
},
domWidth: 0,
asksDepth: 0,
@@ -1027,14 +1032,33 @@
this.$socket.subscribe(`market.${symbol}.depth.${mergeDepth}`, 'market-depth');
this.$socket.on('market-depth', (data) => {
this.depthsData = data.tick;
if(kline && kline.contentWindow) {
// 处理双层 JSON 字符串
try {
if(data.result) {
let result = JSON.parse(data.result);
if(result.tick) {
this.depthsData = JSON.parse(result.tick);
}
} else if(data.tick) {
this.depthsData = typeof data.tick === 'string' ? JSON.parse(data.tick) : data.tick;
}
if(this.depthsData && kline && kline.contentWindow) {
kline.contentWindow.set_current_depth(this.depthsData);
}
if(this.depthsData) {
this.processDepthData()
}
} catch(e) {
console.error('解析深度数据失败:', e, data);
}
})
},
processDepthData(){
if(!this.depthsData || !this.depthsData.asks || !this.depthsData.bids) {
console.warn('深度数据为空或格式错误', this.depthsData);
return;
}
let {asks, bids} = this.depthsData;
let {priceScale, buyFeeRate, sellFeeRate,numScale} = this.currentMarket;
if(this.currentBuyItem.price === '' && bids.length > 0 && this.currentBuyItem.canBuyAmount === '') {

View File

@@ -11,4 +11,4 @@
// hm.src = "https://hm.baidu.com/hm.js?b4837d50cf55e64e8da2130f1ae8e997";
// var s = document.getElementsByTagName("script")[0];
// s.parentNode.insertBefore(hm, s);
// })();</script><script type=text/javascript src=/static/js/manifest.91d8b21da8c741af5c63.js></script><script type=text/javascript src=/static/js/vendor.0d306d721fa4eca4e4ea.js></script><script type=text/javascript src=/static/js/app.6040d417623130efbb8e.js></script></body></html>
// })();</script><script type=text/javascript src=/static/js/manifest.481aaeae1b883e5a1167.js></script><script type=text/javascript src=/static/js/vendor.0d306d721fa4eca4e4ea.js></script><script type=text/javascript src=/static/js/app.6040d417623130efbb8e.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
!function(e){function c(a){if(d[a])return d[a].exports;var f=d[a]={i:a,l:!1,exports:{}};return e[a].call(f.exports,f,f.exports,c),f.l=!0,f.exports}var a=window.webpackJsonp;window.webpackJsonp=function(d,n,t){for(var r,b,o,i=0,u=[];i<d.length;i++)b=d[i],f[b]&&u.push(f[b][0]),f[b]=0;for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);for(a&&a(d,n,t);u.length;)u.shift()();if(t)for(i=0;i<t.length;i++)o=c(c.s=t[i]);return o};var d={},f={47:0};c.e=function(e){function a(){r.onerror=r.onload=null,clearTimeout(b);var c=f[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}var d=f[e];if(0===d)return new Promise(function(e){e()});if(d)return d[2];var n=new Promise(function(c,a){d=f[e]=[c,a]});d[2]=n;var t=document.getElementsByTagName("head")[0],r=document.createElement("script");r.type="text/javascript",r.charset="utf-8",r.async=!0,r.timeout=12e4,c.nc&&r.setAttribute("nonce",c.nc),r.src=c.p+"static/js/"+e+"."+{0:"dc6414110c503674b5a6",1:"ea56ad8dd5d68646daea",2:"d02e8da5d2425b3abe7d",3:"a5034031b218bfc8bf0a",4:"3a31def876d81528641e",5:"55f644ae3ea937093622",6:"85bee17e4902de4a9ccb",7:"5e31923ed89c99462386",8:"f617d318c2411b8250c5",9:"b13f0fdfb63845b2d2bd",10:"f6c60b6ef2360efb6f65",11:"7fc6d7a8ab554ce7d245",12:"8a3fd93a31ff1371e24b",13:"15924c36aa1a8aecef22",14:"042424dc880c07768e98",15:"d76249aadd6b40861af5",16:"adcd4f2408712cd6a225",17:"4ea30b10b41ea8ed0559",18:"b525d8c4c4e577832858",19:"ecf7fc15747348e05cdf",20:"3b851313b2a2c069bc98",21:"9fe1339f00fb17f535d5",22:"1770c47fc7536c9419bd",23:"60f7228bbb61307ede00",24:"daedc0a1563d469065e5",25:"b804466da864228a9b9d",26:"76fd6880edc5d6c9c6ac",27:"4313571b2a29dcc5bf64",28:"67ecdd0e59b01bd57432",29:"73df6ec04ad07c2c1371",30:"382e2781642a999f6768",31:"109c0da4e83f95d5480c",32:"0535b59baba4bd20b0ed",33:"eac8ad88455c881ef1be",34:"90f8fdf654acc1f0d734",35:"cbc7d1a54e49e8197ce9",36:"1d355294209e499b22ab",37:"20d9b16a4be4b6910e5e",38:"3d367bea534f9080b660",39:"d784630316fde96155e0",40:"87ac8499cd30afa85a73",41:"20ee0cf8bc14eea4bbfc",42:"b8c35f2ecaf791363f3b",43:"38bcbf137ef960a51727",44:"1844d416059cdd4f80ad",45:"0d306d721fa4eca4e4ea",46:"6040d417623130efbb8e"}[e]+".js";var b=setTimeout(a,12e4);return r.onerror=r.onload=a,t.appendChild(r),n},c.m=e,c.c=d,c.i=function(e){return e},c.d=function(e,a,d){c.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:d})},c.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(a,"a",a),a},c.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},c.p="/",c.oe=function(e){throw e}}([]);
//# sourceMappingURL=manifest.91d8b21da8c741af5c63.js.map
!function(e){function c(a){if(d[a])return d[a].exports;var f=d[a]={i:a,l:!1,exports:{}};return e[a].call(f.exports,f,f.exports,c),f.l=!0,f.exports}var a=window.webpackJsonp;window.webpackJsonp=function(d,n,t){for(var r,b,o,i=0,u=[];i<d.length;i++)b=d[i],f[b]&&u.push(f[b][0]),f[b]=0;for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);for(a&&a(d,n,t);u.length;)u.shift()();if(t)for(i=0;i<t.length;i++)o=c(c.s=t[i]);return o};var d={},f={47:0};c.e=function(e){function a(){r.onerror=r.onload=null,clearTimeout(b);var c=f[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}var d=f[e];if(0===d)return new Promise(function(e){e()});if(d)return d[2];var n=new Promise(function(c,a){d=f[e]=[c,a]});d[2]=n;var t=document.getElementsByTagName("head")[0],r=document.createElement("script");r.type="text/javascript",r.charset="utf-8",r.async=!0,r.timeout=12e4,c.nc&&r.setAttribute("nonce",c.nc),r.src=c.p+"static/js/"+e+"."+{0:"dc6414110c503674b5a6",1:"ea56ad8dd5d68646daea",2:"d02e8da5d2425b3abe7d",3:"a5034031b218bfc8bf0a",4:"3a31def876d81528641e",5:"55f644ae3ea937093622",6:"85bee17e4902de4a9ccb",7:"5e31923ed89c99462386",8:"f617d318c2411b8250c5",9:"b13f0fdfb63845b2d2bd",10:"f6c60b6ef2360efb6f65",11:"7fc6d7a8ab554ce7d245",12:"8a3fd93a31ff1371e24b",13:"0673978e6ad4850d8a84",14:"042424dc880c07768e98",15:"d76249aadd6b40861af5",16:"adcd4f2408712cd6a225",17:"4ea30b10b41ea8ed0559",18:"b525d8c4c4e577832858",19:"ecf7fc15747348e05cdf",20:"3b851313b2a2c069bc98",21:"9fe1339f00fb17f535d5",22:"1770c47fc7536c9419bd",23:"60f7228bbb61307ede00",24:"daedc0a1563d469065e5",25:"b804466da864228a9b9d",26:"76fd6880edc5d6c9c6ac",27:"4313571b2a29dcc5bf64",28:"67ecdd0e59b01bd57432",29:"73df6ec04ad07c2c1371",30:"382e2781642a999f6768",31:"109c0da4e83f95d5480c",32:"0535b59baba4bd20b0ed",33:"eac8ad88455c881ef1be",34:"90f8fdf654acc1f0d734",35:"cbc7d1a54e49e8197ce9",36:"1d355294209e499b22ab",37:"20d9b16a4be4b6910e5e",38:"3d367bea534f9080b660",39:"d784630316fde96155e0",40:"87ac8499cd30afa85a73",41:"20ee0cf8bc14eea4bbfc",42:"b8c35f2ecaf791363f3b",43:"38bcbf137ef960a51727",44:"1844d416059cdd4f80ad",45:"0d306d721fa4eca4e4ea",46:"6040d417623130efbb8e"}[e]+".js";var b=setTimeout(a,12e4);return r.onerror=r.onload=a,t.appendChild(r),n},c.m=e,c.c=d,c.i=function(e){return e},c.d=function(e,a,d){c.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:d})},c.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(a,"a",a),a},c.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},c.p="/",c.oe=function(e){throw e}}([]);
//# sourceMappingURL=manifest.481aaeae1b883e5a1167.js.map