Commit fb6f8b0c by haojie

1

parent b8150715
...@@ -12,12 +12,7 @@ export const useTableHeadToken = () => { ...@@ -12,12 +12,7 @@ export const useTableHeadToken = () => {
// 通知收藏内容更新 // 通知收藏内容更新
export const CollectionChange = () => { export const CollectionChange = () => {
return useState('CollectionTable', () => { return useState('CollectionTable', () => 0);
return {
value: 1,
isOpen: null,
};
});
}; };
// 通知右侧详情,取消收藏 // 通知右侧详情,取消收藏
......
export const TOKEN_NAME = "dexnav-token"; export const TOKEN_NAME = 'dexnav-token';
export const submitInfoLink = "https://forms.gle/v1xuZF3hJ6ey8SPx9"; export const submitInfoLink = 'https://forms.gle/v1xuZF3hJ6ey8SPx9';
// loading背景色
export const loading_background = 'rgba(240,240,240,0.2)';
...@@ -10,18 +10,22 @@ export default function () { ...@@ -10,18 +10,22 @@ export default function () {
threeMax: 0, threeMax: 0,
}); });
const getMaxNum = (list: any, key: string) => { const getMaxNum = (list: any, key: string) => {
const max = Math.max(...list); if (list) {
// 这样处理是为了不让最大值刚好到坐标轴最顶部 const max = Math.max(...list);
if (Math.ceil(max / 9.5) * 10 == 0) { // 这样处理是为了不让最大值刚好到坐标轴最顶部
maxNum[key] = 1; if (Math.ceil(max / 9.5) * 10 == 0) {
} else { maxNum[key] = 1;
maxNum[key] = Math.ceil(max / 9.5) * 10; } else {
maxNum[key] = Math.ceil(max / 9.5) * 10;
}
} }
}; };
const getMinNum = (list: any, key: string) => { const getMinNum = (list: any, key: string) => {
const min = Math.min(...list); if (list && list.length) {
// 这样处理是为了不让最大值刚好到坐标轴最底部 const min = Math.min(...list);
maxNum[key] = Math.floor(min / 12) * 10; // 这样处理是为了不让最大值刚好到坐标轴最底部
maxNum[key] = Math.floor(min / 12) * 10;
}
}; };
return { return {
......
...@@ -196,6 +196,11 @@ const cn = { ...@@ -196,6 +196,11 @@ const cn = {
token: '币种', token: '币种',
newHolder: '新持有人', newHolder: '新持有人',
Numbertrades: '交易笔数', Numbertrades: '交易笔数',
editor: '编辑收藏',
top: '置顶',
sort: '拖动',
selectall: '全选',
delete: '删除',
}, },
Search: { Search: {
search: '搜索', search: '搜索',
......
...@@ -192,6 +192,11 @@ const cn = { ...@@ -192,6 +192,11 @@ const cn = {
token: 'token', token: 'token',
newHolder: 'New holders', newHolder: 'New holders',
Numbertrades: 'Number trades', Numbertrades: 'Number trades',
editor: 'Editor favorites',
top: 'Top',
sort: 'Sort',
selectall: 'Select all',
delete: 'Delete',
}, },
Search: { Search: {
search: 'Search', search: 'Search',
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"vue-i18n": "^9.2.2" "vue-i18n": "^9.2.2"
}, },
"devDependencies": { "devDependencies": {
"axios": "^1.3.1", "axios": "^0.24.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"less": "^4.1.3", "less": "^4.1.3",
"less-loader": "^11.1.0", "less-loader": "^11.1.0",
...@@ -3119,12 +3119,6 @@ ...@@ -3119,12 +3119,6 @@
"integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==",
"dev": true "dev": true
}, },
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
"node_modules/autoprefixer": { "node_modules/autoprefixer": {
"version": "10.4.13", "version": "10.4.13",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz",
...@@ -3170,14 +3164,12 @@ ...@@ -3170,14 +3164,12 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.3.1", "version": "0.24.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
"integrity": "sha512-78pWJsQTceInlyaeBQeYZ/QgZeWS8hGeKiIJiDKQe3hEyBb7sEMq0K4gjx+Va6WHTYO4zI/RRl8qGRzn0YMadA==", "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.14.4"
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
} }
}, },
"node_modules/balanced-match": { "node_modules/balanced-match": {
...@@ -3793,18 +3785,6 @@ ...@@ -3793,18 +3785,6 @@
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz",
"integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ=="
}, },
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/commander": { "node_modules/commander": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
...@@ -4210,15 +4190,6 @@ ...@@ -4210,15 +4190,6 @@
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz", "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz",
"integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==" "integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ=="
}, },
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true,
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/delegate": { "node_modules/delegate": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
...@@ -4967,20 +4938,6 @@ ...@@ -4967,20 +4938,6 @@
"is-callable": "^1.1.3" "is-callable": "^1.1.3"
} }
}, },
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dev": true,
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/formdata-polyfill": { "node_modules/formdata-polyfill": {
"version": "4.0.10", "version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
...@@ -6717,6 +6674,7 @@ ...@@ -6717,6 +6674,7 @@
"version": "1.52.0", "version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"peer": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
...@@ -6725,6 +6683,7 @@ ...@@ -6725,6 +6683,7 @@
"version": "2.1.35", "version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"peer": true,
"dependencies": { "dependencies": {
"mime-db": "1.52.0" "mime-db": "1.52.0"
}, },
...@@ -8190,12 +8149,6 @@ ...@@ -8190,12 +8149,6 @@
"integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==",
"dev": true "dev": true
}, },
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"dev": true
},
"node_modules/prr": { "node_modules/prr": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
...@@ -13417,12 +13370,6 @@ ...@@ -13417,12 +13370,6 @@
"integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==",
"dev": true "dev": true
}, },
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
"autoprefixer": { "autoprefixer": {
"version": "10.4.13", "version": "10.4.13",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.13.tgz",
...@@ -13443,14 +13390,12 @@ ...@@ -13443,14 +13390,12 @@
"integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw=="
}, },
"axios": { "axios": {
"version": "1.3.1", "version": "0.24.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
"integrity": "sha512-78pWJsQTceInlyaeBQeYZ/QgZeWS8hGeKiIJiDKQe3hEyBb7sEMq0K4gjx+Va6WHTYO4zI/RRl8qGRzn0YMadA==", "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
"dev": true, "dev": true,
"requires": { "requires": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.14.4"
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
} }
}, },
"balanced-match": { "balanced-match": {
...@@ -13879,15 +13824,6 @@ ...@@ -13879,15 +13824,6 @@
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz",
"integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ=="
}, },
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"requires": {
"delayed-stream": "~1.0.0"
}
},
"commander": { "commander": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
...@@ -14183,12 +14119,6 @@ ...@@ -14183,12 +14119,6 @@
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz", "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.2.tgz",
"integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==" "integrity": "sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ=="
}, },
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true
},
"delegate": { "delegate": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
...@@ -14761,17 +14691,6 @@ ...@@ -14761,17 +14691,6 @@
"is-callable": "^1.1.3" "is-callable": "^1.1.3"
} }
}, },
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dev": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"formdata-polyfill": { "formdata-polyfill": {
"version": "4.0.10", "version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
...@@ -16055,12 +15974,14 @@ ...@@ -16055,12 +15974,14 @@
"mime-db": { "mime-db": {
"version": "1.52.0", "version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"peer": true
}, },
"mime-types": { "mime-types": {
"version": "2.1.35", "version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"peer": true,
"requires": { "requires": {
"mime-db": "1.52.0" "mime-db": "1.52.0"
} }
...@@ -17106,12 +17027,6 @@ ...@@ -17106,12 +17027,6 @@
"integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==", "integrity": "sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==",
"dev": true "dev": true
}, },
"proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"dev": true
},
"prr": { "prr": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"postinstall": "nuxt prepare" "postinstall": "nuxt prepare"
}, },
"devDependencies": { "devDependencies": {
"axios": "^1.3.1", "axios": "^0.24.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"less": "^4.1.3", "less": "^4.1.3",
"less-loader": "^11.1.0", "less-loader": "^11.1.0",
......
<svg width="12" height="6" viewBox="0 0 12 6" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 1H12" stroke="#9EA1A8" stroke-width="2"/>
<line y1="5" x2="12" y2="5" stroke="#9EA1A8" stroke-width="2"/>
</svg>
\ No newline at end of file
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.00039 1.8543C1.8698 1.85111 1.73989 1.87408 1.6183 1.92185C1.49672 1.96962 1.38593 2.04123 1.29244 2.13247C1.19895 2.2237 1.12465 2.33272 1.07393 2.4531C1.0232 2.57348 0.99707 2.70279 0.99707 2.83342C0.99707 2.96405 1.0232 3.09336 1.07393 3.21374C1.12465 3.33412 1.19895 3.44314 1.29244 3.53437C1.38593 3.62561 1.49672 3.69722 1.6183 3.74499C1.73989 3.79277 1.8698 3.81573 2.00039 3.81255H11.9993C12.1299 3.81573 12.2598 3.79277 12.3814 3.74499C12.503 3.69722 12.6138 3.62561 12.7073 3.53437C12.8007 3.44314 12.875 3.33412 12.9258 3.21374C12.9765 3.09336 13.0026 2.96405 13.0026 2.83342C13.0026 2.70279 12.9765 2.57348 12.9258 2.4531C12.875 2.33272 12.8007 2.2237 12.7073 2.13247C12.6138 2.04123 12.503 1.96962 12.3814 1.92185C12.2598 1.87408 12.1299 1.85111 11.9993 1.8543H2.00097H2.00039ZM7.69255 5.47446C7.50889 5.29087 7.25983 5.18773 7.00014 5.18773C6.74045 5.18773 6.49139 5.29087 6.30772 5.47446L1.30797 10.4742C1.21274 10.5641 1.13651 10.6722 1.08379 10.7921C1.03107 10.912 1.00293 11.0412 1.00104 11.1722C0.999146 11.3032 1.02354 11.4332 1.07277 11.5545C1.122 11.6759 1.19507 11.7861 1.28766 11.8788C1.38024 11.9714 1.49047 12.0445 1.61181 12.0938C1.73316 12.1431 1.86315 12.1675 1.99411 12.1657C2.12506 12.1638 2.25432 12.1358 2.37423 12.0831C2.49414 12.0304 2.60227 11.9542 2.69222 11.859L7.00014 7.55113L11.3075 11.859C11.4923 12.0367 11.7395 12.1348 11.9959 12.1323C12.2523 12.1298 12.4974 12.0268 12.6787 11.8455C12.86 11.6642 12.963 11.419 12.9656 11.1626C12.9681 10.9062 12.87 10.6591 12.6923 10.4742L7.69255 5.47446Z" fill="#9EA1A8"/>
</svg>
\ No newline at end of file
<svg width="12" height="8" viewBox="0 0 12 8" fill="" xmlns="http://www.w3.org/2000/svg">
<path d="M5.19212 0.732744C5.51188 0.350785 6.0992 0.350784 6.41896 0.732743L10.9846 6.18647C11.4205 6.7072 11.0503 7.5 10.3712 7.5H1.23991C0.560795 7.5 0.190556 6.7072 0.626488 6.18647L5.19212 0.732744Z" fill=""/>
</svg>
\ No newline at end of file
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_626_8405)">
<path d="M11.7348 2.45955C12.441 2.55955 13.1754 2.43142 13.7519 2.52986C14.6848 2.68924 15.1582 3.48299 15.0566 4.65174H13.9269C13.8957 6.72517 13.9098 8.7783 13.9098 10.8595C13.9098 11.9095 13.9973 13.0127 13.8926 13.9549C13.7941 14.8439 13.141 15.3861 12.3457 15.5189C11.5598 15.6502 10.5176 15.5533 9.65038 15.5533C7.83163 15.5533 5.98945 15.5892 4.20819 15.5533C3.34101 15.5361 2.70038 15.2611 2.31288 14.7361C1.92538 14.2111 1.96444 13.4174 1.96444 12.4752V4.65174H0.88632C0.71132 3.57674 1.17694 2.8033 1.96444 2.54861C2.54413 2.36111 3.31601 2.51267 4.13788 2.46111C4.07069 1.3033 4.13476 0.425174 5.12851 0.304861C5.57382 0.251736 6.16757 0.304861 6.71132 0.304861H9.87538C10.4785 0.304861 11.0957 0.247049 11.4051 0.514236C11.8316 0.881424 11.7207 1.73299 11.7348 2.45955ZM5.21445 1.45017V2.49392H10.6566V1.39861H5.23163C5.21132 1.40174 5.21288 1.42517 5.21445 1.45017ZM4.15351 4.77205V11.397C4.15351 11.9627 4.02382 13.1689 4.36288 13.4142C4.49726 13.5111 4.84569 13.5267 5.00663 13.4142C5.35663 13.1705 5.23319 11.9986 5.23319 11.4142V4.72049H4.17226C4.15038 4.72205 4.15194 4.74705 4.15351 4.77205ZM7.38788 4.77205V11.1877C7.38788 11.6939 7.2707 12.8924 7.47538 13.2392C7.60976 13.4689 8.06601 13.572 8.29257 13.3955C8.60038 13.1549 8.46601 11.8861 8.46601 11.3611V4.71892H7.40507C7.38476 4.72205 7.38632 4.74705 7.38788 4.77205ZM10.6566 4.77205V11.483C10.6566 12.1705 10.5223 13.2252 10.9691 13.4127C11.1644 13.4955 11.5098 13.4314 11.5957 13.3611C11.8879 13.1205 11.7519 11.833 11.7519 11.3267V4.72049H10.6738C10.6535 4.72205 10.6551 4.74705 10.6566 4.77205Z" fill="#9EA1A8"/>
</g>
<defs>
<clipPath id="clip0_626_8405">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>
\ No newline at end of file
<svg width="12" height="8" viewBox="0 0 12 8" fill="" xmlns="http://www.w3.org/2000/svg">
<path d="M6.86355 7.26726C6.54379 7.64922 5.95646 7.64922 5.6367 7.26726L1.07107 1.81353C0.635141 1.2928 1.00538 0.5 1.68449 0.5L10.8158 0.5C11.4949 0.5 11.8651 1.2928 11.4292 1.81353L6.86355 7.26726Z" fill=""/>
</svg>
\ No newline at end of file
<svg width="37" height="36" viewBox="0 0 37 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="18.04" cy="18.0001" r="18" transform="rotate(90 18.04 18.0001)" fill="#EDF0F4"/>
<rect x="29.04" y="8.00015" width="22" height="22" rx="11" transform="rotate(90 29.04 8.00015)" fill="#8C8C8C"/>
<rect x="24.594" y="12.4461" width="12.8014" height="12.8014" rx="6.40069" transform="rotate(90 24.594 12.4461)" fill="#EDF0F4"/>
<g clip-path="url(#clip0_0_1)">
<rect width="10.9999" height="22" transform="translate(29.04 8.00015) rotate(90)" fill="#EDF0F4"/>
<rect x="22.1504" y="-0.556305" width="18.2242" height="18.2242" rx="9.11211" transform="rotate(90 22.1504 -0.556305)" fill="#EDF0F4"/>
</g>
<rect x="16.2386" y="8.00018" width="4.44599" height="9.1986" rx="1" transform="rotate(90 16.2386 8.00018)" fill="#141414"/>
<rect x="29.04" y="8.00015" width="4.44599" height="9.1986" rx="1" transform="rotate(90 29.04 8.00015)" fill="#141414"/>
<rect x="16.2386" y="17.1986" width="4.44599" height="9.1986" rx="1" transform="rotate(-180 16.2386 17.1986)" fill="#343434"/>
<path d="M29.04 16.1986C29.04 16.7509 28.5923 17.1986 28.04 17.1986L25.594 17.1986C25.0417 17.1986 24.594 16.7509 24.594 16.1986L24.594 9.00001C24.594 8.44772 25.0417 8.00001 25.594 8.00001L28.04 8.00001C28.5923 8.00001 29.04 8.44772 29.04 9.00001L29.04 16.1986Z" fill="#343434"/>
<defs>
<clipPath id="clip0_0_1">
<rect width="10.9999" height="22" fill="white" transform="translate(29.04 8.00015) rotate(90)"/>
</clipPath>
</defs>
</svg>
\ No newline at end of file
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
--new-border-4: rgb(224, 227, 234); --new-border-4: rgb(224, 227, 234);
--new-border-5: #287eff; --new-border-5: #287eff;
--new-border-6: #f0f1f5; --new-border-6: #f0f1f5;
--new-border-7: #f5f8fc;
--new-color-1: #6d6d6d; --new-color-1: #6d6d6d;
--new-color-2: #287eff; --new-color-2: #287eff;
...@@ -153,6 +154,7 @@ ...@@ -153,6 +154,7 @@
--new-border-4: none; --new-border-4: none;
--new-border-5: #428dff; --new-border-5: #428dff;
--new-border-6: #151515; --new-border-6: #151515;
--new-border-7: #0b1217;
--new-color-1: #a9a9a9; --new-color-1: #a9a9a9;
--new-color-2: #28b2ff; --new-color-2: #28b2ff;
......
import request from '@/utils/request';
import { getCollectionList } from '@/utils/cache';
import { parseCoinAmount, parsePercent } from '@/utils/tool';
/*
收藏模块接口--有两个路由使用了接口
*/
export const myCollect = async () => {
let collections = getCollectionList();
if (collections === false || collections.length == 0) {
return;
}
let tags = collections.map((item: any) => item.hash);
// 过滤有问题的tb
tags.forEach((item: any, index: number) => {
if (item.indexOf('[') !== -1 || !item) {
tags.splice(index, 1);
}
});
try {
const res: any = await request.post('/favorites', tags);
let tmp = (res || []).filter((item: any) => item);
tmp.forEach((item: any, index: number) => {
item.up = parseCoinAmount(item.up);
item.old24h = item.r24h;
item.r24h = parsePercent(parseFloat(item.r24h).toFixed(3));
if (item.r24h[0] !== '-') {
item.r24h = '+' + item.r24h;
}
item.tb = collections[index].hash;
item.symbol = collections[index].symbol;
item.path = collections[index].path;
item.token = collections[index].token;
// 交易对
item.pair = item.symbol + '/' + item.ps;
// 行内select
item.select = false;
});
return tmp;
} catch (e) {
return false;
}
};
const COLLECT_KEY = 'COLLECTION_LIST'; export const COLLECT_KEY = 'COLLECTION_LIST';
// export const isCollectionToken = ()=> { // export const isCollectionToken = ()=> {
// const res = localStorage.getItem(COLLECT_KEY); // const res = localStorage.getItem(COLLECT_KEY);
// if(!res){ // if(!res){
...@@ -21,7 +21,7 @@ export const getCollectionList = () => { ...@@ -21,7 +21,7 @@ export const getCollectionList = () => {
return []; return [];
} }
}; };
export const hasSet = (hash) => { export const hasSet = (hash: string) => {
const res = localStorage.getItem(COLLECT_KEY); const res = localStorage.getItem(COLLECT_KEY);
if (!res) { if (!res) {
return false; return false;
...@@ -31,38 +31,62 @@ export const hasSet = (hash) => { ...@@ -31,38 +31,62 @@ export const hasSet = (hash) => {
if (tokenList === false) { if (tokenList === false) {
return false; return false;
} }
return tokenList.findIndex((item) => item.hash === hash) > -1; return tokenList.findIndex((item: any) => item.hash === hash) > -1;
} catch (error) { } catch (error) {
return false; return false;
} }
}; };
export const setCollection = (token) => { export const setCollection = (token: any) => {
const res = localStorage.getItem(COLLECT_KEY); const res = localStorage.getItem(COLLECT_KEY);
let list = []; let list: any = [];
if (res) { if (res) {
try { try {
const tokenList = JSON.parse(res); const tokenList = JSON.parse(res);
list = [...tokenList]; list = [...tokenList];
} catch (error) {} } catch (error) {
console.log(error);
}
} }
if (list.findIndex((item) => item.hash == token.hash) === -1) { if (list.findIndex((item: any) => item.hash == token.hash) === -1) {
list = [token].concat(list); list = [token].concat(list);
localStorage.setItem(COLLECT_KEY, JSON.stringify(list)); localStorage.setItem(COLLECT_KEY, JSON.stringify(list));
} }
}; };
// 修改本地的收藏列表顺序
export const changeCollection = (list: any) => {
let newList: any = [];
let Obj: any = {};
list.forEach((item: any) => {
Obj = {};
Obj.hash = item.tb;
Obj.path = item.path;
Obj.symbol = item.symbol;
newList.push(Obj);
});
localStorage.setItem(COLLECT_KEY, JSON.stringify(newList));
};
export const deleteCollection = (tokenHash) => { export const deleteCollection = (tokenHash: any[]) => {
const res = localStorage.getItem(COLLECT_KEY); const res = localStorage.getItem(COLLECT_KEY);
if (res) { if (res) {
try { try {
const tokenList = JSON.parse(res); let tokenList = JSON.parse(res);
let newList = JSON.parse(JSON.stringify(tokenList));
if (tokenList !== false) { if (tokenList !== false) {
let index = tokenList.findIndex((item) => (item.hash === tokenHash)); tokenHash.forEach((it: any) => {
if (index >= 0) { let index = newList.findIndex((item: any) => item.hash === it.tb);
tokenList.splice(index, 1); if (index >= 0) {
localStorage.setItem(COLLECT_KEY, JSON.stringify(tokenList)); tokenList.splice(index, 1);
} localStorage.setItem(COLLECT_KEY, JSON.stringify(tokenList));
}
});
} }
} catch (error) {} } catch (error) {
console.log(error);
}
} }
}; };
export const deleteAll = () => {
localStorage.setItem(COLLECT_KEY, JSON.stringify([]));
};
/*
* @Author: lei 2897821407@qq.com
* @Date: 2022-09-05 09:58:04
* @LastEditors: lei 2897821407@qq.com
* @LastEditTime: 2022-09-05 11:13:00
* @FilePath: \dexnav_web\src\utils\request.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import axios from 'axios'; import axios from 'axios';
// import { TOKEN_NAME } from '@/config/global';
// import Cookies from 'js-cookie';
// import Store, { store } from '@/store/index';
import { MessagePlugin } from 'tdesign-vue-next'; import { MessagePlugin } from 'tdesign-vue-next';
const instance = axios.create({ const instance = axios.create({
...@@ -70,7 +59,7 @@ instance.interceptors.response.use( ...@@ -70,7 +59,7 @@ instance.interceptors.response.use(
return data; return data;
} else { } else {
MessagePlugin.closeAll(); MessagePlugin.closeAll();
MessagePlugin.error(data.msg || '请求错误,请稍后重试'); MessagePlugin.error(data.msg || '请求错误');
return Promise.reject(data.msg); return Promise.reject(data.msg);
} }
} }
...@@ -78,7 +67,8 @@ instance.interceptors.response.use( ...@@ -78,7 +67,8 @@ instance.interceptors.response.use(
(err) => { (err) => {
const { config } = err; const { config } = err;
const { code, message: msg } = err.response.data; const { code, message: msg } = err.response.data;
MessagePlugin.error(msg || '请求错误,请稍后重试'); MessagePlugin.closeAll();
MessagePlugin.error(msg || '请求错误');
if (!config || !config.retry) return Promise.reject(err); if (!config || !config.retry) return Promise.reject(err);
config.retryCount = config.retryCount || 0; config.retryCount = config.retryCount || 0;
......
...@@ -442,3 +442,54 @@ export const TableSort = (list: any, field: string) => { ...@@ -442,3 +442,54 @@ export const TableSort = (list: any, field: string) => {
} }
return list; return list;
}; };
// 升序
export const TableSortAsc = (list: any, field: string) => {
let maxIndex, temp;
for (let i = 0; i < list.length - 1; i++) {
maxIndex = i;
for (let j = i + 1; j < list.length; j++) {
if (list[j][field] < list[maxIndex][field]) {
maxIndex = j;
}
}
temp = list[i];
list[i] = list[maxIndex];
list[maxIndex] = temp;
}
return list;
};
/**
* 将数组中的某一项置顶
*/
export const ArrayItemSticky = (list: any, index: number) => {
let newlist = [list[index]];
if (index === 0) {
return list;
} else {
for (let i = 0; i < list.length; i++) {
if (i !== index) {
newlist.push(list[i]);
}
}
return newlist;
}
};
/**
* 将数组中的某一项移动到指定位置
* @param list
* @param oldindex -- 移动之前item的下标
* @param newIndex -- 需要移动到哪个下标
*/
export const ArraySpecifiedPosition = (
list: any,
oldindex: number,
newIndex: number
) => {
let obj = list[oldindex];
// 旧的item去掉
list.splice(oldindex, 1);
list.splice(newIndex, 0, obj);
return list;
};
...@@ -95,7 +95,7 @@ const getData = () => { ...@@ -95,7 +95,7 @@ const getData = () => {
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
}); });
request request
.get(`/v1/${chain.value}/analysis/getBuyAndSellNumber`, { .get(`/v1${chain.value}/analysis/getBuyAndSellNumber`, {
params: { params: {
tag: props.tb, tag: props.tb,
date: date.value, date: date.value,
......
...@@ -97,7 +97,7 @@ const getData = () => { ...@@ -97,7 +97,7 @@ const getData = () => {
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
}); });
request request
.get(`/v1/${chain.value}/analysis/getDiscordData`, { .get(`/v1${chain.value}/analysis/getDiscordData`, {
params: { params: {
tag: props.token, tag: props.token,
date: date.value, date: date.value,
......
...@@ -99,7 +99,7 @@ const getData = () => { ...@@ -99,7 +99,7 @@ const getData = () => {
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
}); });
request request
.get(`/v1/${chain.value}/analysis/getNhData`, { .get(`/v1${chain.value}/analysis/getNhData`, {
params: { params: {
tag: props.tb, tag: props.tb,
date: date.value, date: date.value,
......
...@@ -101,7 +101,7 @@ const getData = () => { ...@@ -101,7 +101,7 @@ const getData = () => {
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
}); });
request request
.get(`/v1/${chain.value}/analysis/getTurnover`, { .get(`/v1${chain.value}/analysis/getTurnover`, {
params: { params: {
tag: props.tb, tag: props.tb,
date: date.value, date: date.value,
......
...@@ -84,7 +84,7 @@ const getData = () => { ...@@ -84,7 +84,7 @@ const getData = () => {
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
}); });
request request
.get(`/v1/${chain.value}/analysis/getUbData`, { .get(`/v1${chain.value}/analysis/getUbData`, {
params: { params: {
tb: props.tb, tb: props.tb,
date: date.value, date: date.value,
......
...@@ -96,7 +96,7 @@ const getData = () => { ...@@ -96,7 +96,7 @@ const getData = () => {
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
}); });
request request
.get(`/v1/${chain.value}/analysis/getTelegramData`, { .get(`/v1${chain.value}/analysis/getTelegramData`, {
params: { params: {
tag: props.token, tag: props.token,
date: date.value, date: date.value,
......
...@@ -88,15 +88,20 @@ const initChart = () => { ...@@ -88,15 +88,20 @@ const initChart = () => {
myChart = echarts.init(chartDom, 'vintage'); myChart = echarts.init(chartDom, 'vintage');
}; };
const getData = () => { const getData = () => {
if (!props.tb) {
return;
}
myChart && myChart &&
myChart.showLoading({ myChart.showLoading({
maskColor: 'rgba(255,255,255,0)', maskColor: 'rgba(255,255,255,0)',
textColor: 'rgb(150,150,150)', //文字颜色 textColor: 'rgb(150,150,150)', //文字颜色
}); });
let newtb =
props.tb[0] == 'd' ? props.tb.slice(1, props.tb.length) : props.tb;
request request
.get(`/v1/${chain.value}/analysis/getTop100Change`, { .get(`/v1${chain.value}/analysis/getTop100Change`, {
params: { params: {
tag: props.tb, tag: newtb,
date: date.value, date: date.value,
}, },
}) })
......
...@@ -96,7 +96,7 @@ const getData = () => { ...@@ -96,7 +96,7 @@ const getData = () => {
textColor: 'rgb(150,150,150)', //文字颜色 textColor: 'rgb(150,150,150)', //文字颜色
}); });
request request
.get(`/v1/${chain.value}/analysis/getTwitter`, { .get(`/v1${chain.value}/analysis/getTwitter`, {
params: { params: {
tag: props.token, tag: props.token,
date: date.value, date: date.value,
......
...@@ -89,5 +89,6 @@ const props = defineProps({ ...@@ -89,5 +89,6 @@ const props = defineProps({
height: calc(100vh - 120px); height: calc(100vh - 120px);
width: 100%; width: 100%;
overflow-y: scroll; overflow-y: scroll;
background: var(--td--right-back-color-2);
} }
</style> </style>
...@@ -454,7 +454,7 @@ const goDetail = (row) => { ...@@ -454,7 +454,7 @@ const goDetail = (row) => {
width: 100%; width: 100%;
.total-token-info-fa { .total-token-info-fa {
overflow: auto; overflow: auto;
height: calc(100vh - 320px); height: calc(100vh - 240px);
background: @td--Search-drawer-back-color; background: @td--Search-drawer-back-color;
.total-token-info { .total-token-info {
position: relative; position: relative;
......
<!--
* @Author: walker.liu
* @Date: 2022-04-09 14:54:44
* @Copyright(C): 2019-2020 ZP Inc. All rights reserved.
-->
<template> <template>
<div> <div>
<ClientOnly> <ClientOnly>
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</div> </div>
</template> </template>
<template v-if="ifDetails"> <template v-if="ifDetails">
<div v-show="details == 'echart'" class="all-echarts"> <div v-show="defaBtn == 'echart'" class="all-echarts">
<details-echarts <details-echarts
:token="props.token" :token="props.token"
:tb="tb" :tb="tb"
...@@ -260,7 +260,7 @@ watch( ...@@ -260,7 +260,7 @@ watch(
() => locale.value, () => locale.value,
(v) => { (v) => {
if (defaBtn.value == 'echart') { if (defaBtn.value == 'echart') {
ifDetails.value = false; // ifDetails.value = true;
} else { } else {
WatchEcharts.value += 1; WatchEcharts.value += 1;
} }
...@@ -278,11 +278,11 @@ const gotoDetail = (value) => { ...@@ -278,11 +278,11 @@ const gotoDetail = (value) => {
MessagePlugin.warning(t('MessagePlugin.plToken')); MessagePlugin.warning(t('MessagePlugin.plToken'));
return; return;
} }
defaBtn.value = value; if (value === 'echart') {
if (defaBtn.value === 'echart') {
tb.value = props.tb; tb.value = props.tb;
ifDetails.value = true; ifDetails.value = true;
} }
defaBtn.value = value;
}; };
// 监听按钮点击事件,切换样式 // 监听按钮点击事件,切换样式
const monitor = computed((value) => { const monitor = computed((value) => {
...@@ -337,6 +337,8 @@ watch( ...@@ -337,6 +337,8 @@ watch(
background: none; background: none;
color: var(--td-search-btn-back-1); color: var(--td-search-btn-back-1);
font-weight: bold; font-weight: bold;
margin: 0;
padding: 0;
.details-icon-cl { .details-icon-cl {
width: 30px; width: 30px;
fill: var(--td-search-btn-back-1); fill: var(--td-search-btn-back-1);
......
...@@ -137,6 +137,8 @@ const getTableList = async () => { ...@@ -137,6 +137,8 @@ const getTableList = async () => {
RightInfo.value.r24h = result.list[0].r24h; RightInfo.value.r24h = result.list[0].r24h;
isFirst.value = false; isFirst.value = false;
} }
} else {
resultData.list = [];
} }
} catch (e) { } catch (e) {
loading.value = false; loading.value = false;
......
...@@ -3,35 +3,194 @@ ...@@ -3,35 +3,194 @@
background-color: var(--td-bg-color-container); background-color: var(--td-bg-color-container);
border: var(--new-border-2); border: var(--new-border-2);
border-radius: 0 0 @border-radius @border-radius; border-radius: 0 0 @border-radius @border-radius;
position: relative;
overflow-y: auto;
user-select: none;
.custom-collection-header { .custom-collection-header {
height: 40px; height: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 12px; padding: 0 12px;
position: sticky;
top: 0;
z-index: 100;
background-color: var(--td-bg-color-container);
.title { .title {
font-size: 15px; font-size: 15px;
} }
.edit-icon { .edit-icon {
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer;
.Finish-text {
font-weight: 400;
font-size: 12px;
color: #287eff;
}
} }
} }
.custom-collection-table { .custom-collection-table {
padding: 0 12px;
table { table {
width: 100%; width: 100%;
tr { border-spacing: 0;
th { thead {
color: red; tr {
background: #f4f5f7;
border-radius: 10px;
th {
color: #8e8a8a;
font-weight: 500;
font-size: 12px;
.r24h-th-sort {
display: flex;
justify-content: center;
align-items: center;
}
}
.token-th {
text-align: left;
padding-left: 12px;
}
& > :first-child {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
& > :last-child {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
} }
} }
} }
tbody { tbody {
.flip-list-move {
transition: transform 0.8s;
}
/* 效果过程 */
.flip-list-enter-active,
.flip-list-leave-active {
transition: all 0.3s linear;
}
/* 进场的瞬间与离场的效果添加 */
.flip-list-enter,
.flip-list-leave-to {
opacity: 0;
transform: translateX(200px);
}
tr { tr {
transition: background 0.3s;
&:hover {
background: rgb(245, 245, 245);
transition: background 0.3s;
}
td { td {
text-align: center; text-align: center;
border-bottom: 1px solid var(--new-border-7);
.col-token-td {
display: flex;
align-items: center;
max-width: 90px;
.token {
font-weight: 600;
font-size: 12px;
text-align: left;
}
.pair {
font-weight: 400;
font-size: 12px;
color: #7c858e;
text-align: left;
transform: scale(0.8);
transform-origin: 0 0;
}
.token-icon {
display: flex;
align-items: center;
padding-right: 4px;
}
}
.price,
.r24h {
font-weight: 600;
font-size: 14px;
}
.up {
color: #5ab055;
}
.down {
color: rgb(248, 82, 96);
}
.drag-icon {
height: 100%;
cursor: pointer;
}
}
.edit-td {
.t-checkbox {
.t-checkbox__input {
border-radius: 50%;
}
}
.t-is-checked {
.t-checkbox__input {
background-color: var(--td--main-btn-color-1);
border: 1px solid var(--td--main-btn-color-1);
}
}
}
.col-holder-tx-td {
font-weight: 600;
font-size: 12px;
.sticky-top-icon {
cursor: pointer;
}
}
}
.tr-pointer {
cursor: pointer;
}
.tr-none {
cursor: auto;
}
}
}
.collection-footer {
position: sticky;
bottom: 0;
height: 47px;
border-top: 1px solid #d7dce4;
background-color: var(--td-bg-color-container);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 12px;
.check-all {
.t-checkbox {
.t-checkbox__input {
border-radius: 50%;
}
.t-checkbox__label {
font-weight: 400;
font-size: 12px;
color: #4d4d4d;
} }
} }
.t-is-checked {
.t-checkbox__input {
background-color: var(--td--main-btn-color-1);
border: 1px solid var(--td--main-btn-color-1);
}
}
}
.delete-collection {
cursor: pointer;
display: flex;
align-items: center;
.delete-text {
padding-left: 6px;
}
} }
} }
} }
import { defineComponent, computed } from 'vue'; import { defineComponent } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { StarFilledIcon } from 'tdesign-icons-vue-next'; import { StarFilledIcon } from 'tdesign-icons-vue-next';
import CopySvg from '/public/images/svg/rightDetail/copy.svg'; import CopySvg from '/public/images/svg/rightDetail/copy.svg';
import useCopy from '@/hooks/useCopy'; import useCopy from '@/hooks/useCopy';
import { parseCoinAmount } from '@/utils/tool';
import * as Cache from '@/utils/cache'; import * as Cache from '@/utils/cache';
import './index.less'; import './index.less';
import CollectionSvg2 from '/public/images/svg/rightDetail/colection2.svg'; import CollectionSvg2 from '/public/images/svg/rightDetail/colection2.svg';
import CollectionSvg3 from '/public/images/svg/rightDetail/collection-yes.svg'; import CollectionSvg3 from '/public/images/svg/rightDetail/collection-yes.svg';
import Price from './price.vue';
export default defineComponent({ export default defineComponent({
props: { props: {
tokenInfo: Object as any, tokenInfo: Object as any,
...@@ -20,11 +20,20 @@ export default defineComponent({ ...@@ -20,11 +20,20 @@ export default defineComponent({
emits: ['update:isInCollection'], emits: ['update:isInCollection'],
setup(props, { emit }) { setup(props, { emit }) {
const { t } = useI18n(); const { t } = useI18n();
// 收藏表格是否更新
const CollectionCl = CollectionChange();
const { doCopy } = useCopy(); const { doCopy } = useCopy();
const collectData = () => { const collectData = () => {
const { tokenInfo, isInCollection, tb, currentPath } = props; const { tokenInfo, isInCollection, tb, currentPath } = props;
if (isInCollection) { if (isInCollection) {
Cache.deleteCollection(tb); if (tb) {
Cache.deleteCollection([
{
tb: tb,
},
]);
}
emit('update:isInCollection', false); emit('update:isInCollection', false);
} else { } else {
Cache.setCollection({ Cache.setCollection({
...@@ -34,8 +43,8 @@ export default defineComponent({ ...@@ -34,8 +43,8 @@ export default defineComponent({
}); });
emit('update:isInCollection', true); emit('update:isInCollection', true);
} }
// // 通知select中的收藏数据更新 // 通知select中的收藏数据更新
// CollectionCl.value.value += 1; CollectionCl.value += 1;
}; };
const r24hColor = () => { const r24hColor = () => {
if (props.r24h) { if (props.r24h) {
...@@ -46,25 +55,6 @@ export default defineComponent({ ...@@ -46,25 +55,6 @@ export default defineComponent({
} }
} }
}; };
const getPrice = () => {
try {
const { tokenInfo } = props;
if (tokenInfo) {
if ('up' in tokenInfo) {
let up = parseCoinAmount(tokenInfo.up);
if (up.indexOf('{') !== -1) {
up = up.slice(0, up.length - 2);
}
return up;
} else {
return '';
}
}
} catch (e) {
console.log(e);
return '';
}
};
return () => ( return () => (
<div class="header-token-box"> <div class="header-token-box">
<div class="header-token-info"> <div class="header-token-info">
...@@ -102,8 +92,7 @@ export default defineComponent({ ...@@ -102,8 +92,7 @@ export default defineComponent({
color: r24hColor(), color: r24hColor(),
}} }}
> >
{props.tokenInfo ? getPrice() : ''} <Price tokenInfo={props.tokenInfo}></Price>
{/* <span>{props.tokenInfo ? getPrice() : ''}</span> */}
</div> </div>
<div <div
class="r24h-cl" class="r24h-cl"
......
<template>
<div class="">{{ getPrice() }}</div>
</template>
<script lang="ts" setup>
import { parseCoinAmount } from '@/utils/tool';
const props = defineProps<{
tokenInfo: any;
}>();
const getPrice = () => {
try {
const { tokenInfo } = props;
if (tokenInfo) {
if ('up' in tokenInfo) {
let up = parseCoinAmount(tokenInfo.up);
if (up.indexOf('{') !== -1) {
up = up.slice(0, up.length - 2);
}
return up;
} else {
return '';
}
}
} catch (e) {
console.log(e);
return '';
}
};
</script>
<style lang="less"></style>
<template>
<div class="custom-sort-th">
<AscSvg
:class="{ active: sorttype === 'asc' }"
class="sort-icon asc"
@click="sortChange('asc')"
></AscSvg>
<DescSvg
:class="{ active: sorttype === 'desc' }"
class="sort-icon desc"
@click="sortChange('desc')"
></DescSvg>
</div>
</template>
<script lang="ts" setup>
import AscSvg from '/public/images/svg/collection/asc.svg';
import DescSvg from '/public/images/svg/collection/desc.svg';
const props = defineProps({
sort: String,
field: String,
options: Object as any,
});
const emit = defineEmits(['submitSort']);
// 当前排序状态
const sorttype = ref('all');
const sortChange = (value: string) => {
const { options, field } = props;
if (value == sorttype.value) {
// 代表重复点击--恢复表格初始状态
sorttype.value = 'all';
} else {
sorttype.value = value;
}
emit('submitSort', {
sort: sorttype.value,
field: field,
});
};
watch(
() => props.options[props.options.field],
(v) => {
console.log(v);
}
);
</script>
<style lang="less">
.custom-sort-th {
padding-left: 4px;
.sort-icon {
display: block;
fill: #7b7d87;
cursor: pointer;
transition: all 0.2s;
&:hover {
fill: var(--td--main-btn-color-1);
transition: all 0.2s;
}
}
.asc {
padding: 2px 0;
}
.active {
fill: var(--td--main-btn-color-1);
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment