Commit daa7ebe1 by lei

1

parent 02b3d41d
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
import AnnSvg from "/public/images/svg/filter/announcement.svg"; import AnnSvg from "/public/images/svg/filter/announcement.svg";
import closeSvg from "/public/images/svg/filter/close.svg"; import closeSvg from "/public/images/svg/filter/close.svg";
import { tgUrl } from "@/utils/open"; import { tgUrl } from "@/utils/open";
import { Button as TButton } from "tdesign-vue-next";
interface AnnLocalData {
last?: number;
value?: string;
}
// 是否展示广告 // 是否展示广告
const hasOpen = ref(false); const hasOpen = ref(false);
// 获取当前时间 // 获取当前时间
...@@ -38,11 +42,15 @@ const getCurTime = () => { ...@@ -38,11 +42,15 @@ const getCurTime = () => {
return date.valueOf(); return date.valueOf();
}; };
onMounted(() => { onMounted(() => {
let open = JSON.parse(window.localStorage.getItem("openAnn")); let localData = window.localStorage.getItem("openAnn");
if (open && Object.keys(open).length) { let stringifyData: AnnLocalData = {};
if (localData) {
stringifyData = JSON.parse(localData);
}
if (stringifyData && Object.keys(stringifyData).length) {
// 获取当前时间 // 获取当前时间
let curTime = getCurTime(); let curTime = getCurTime();
if (curTime - open.last >= 86400000) { if (curTime - (stringifyData.last ?? 0) >= 86400000) {
hasOpen.value = true; hasOpen.value = true;
} else { } else {
hasOpen.value = false; hasOpen.value = false;
......
import { useState } from '#app'; import { useState } from "#app";
interface UserInfo {
name: string;
vip_type?: string;
avatar?: string;
vip_time?: string;
is_bind?: number;
id: number;
}
// 用户token // 用户token
export const useUserToken = () => { export const useUserToken = () => {
return useState('userToken', () => ''); return useState("userToken", () => "");
}; };
// 用户信息 // 用户信息
export const useTokenInfo = () => { export const useTokenInfo = () => {
return useState('userInfo', () => ({ return useState(
name: '---', "userInfo",
vip_type: '免费会员', () =>
})); ({
name: "---",
vip_type: "免费会员",
} as UserInfo)
);
}; };
// 需要切换的路由 // 需要切换的路由
export const useChangeRouter = () => { export const useChangeRouter = () => {
return useState('ChangeRouterPath', () => ({ return useState("ChangeRouterPath", () => ({
name: 'router', name: "router",
path: '/user', path: "/user",
id: 0, id: 0,
})); }));
}; };
// 修改用户信息中的某个属性或多个属性 // 修改用户信息中的某个属性或多个属性
export const useUserName = () => { export const useUserName = () => {
return useState('UserName', () => ({ return useState("UserName", () => ({
name: 'router', name: "router",
path: '/user', path: "/user",
})); }));
}; };
...@@ -11,6 +11,7 @@ interface filterfield { ...@@ -11,6 +11,7 @@ interface filterfield {
page_size?: number; page_size?: number;
date_orderby?: string; date_orderby?: string;
sort?: string; sort?: string;
[key: string]: string | number | undefined;
} }
let filter: filterfield = { let filter: filterfield = {
pool_column: "wb", pool_column: "wb",
......
import { defineNuxtPlugin } from "#app";
import {
Button as TButton,
Input as TInput,
Loading as TLoading,
TabPanel as TTabPanel,
Tooltip as TTooltip,
Select as TSelect,
Popup as TPopup,
Dialog as TDialog,
Option as TOption,
Switch as TSwitch,
Checkbox as TCheckbox,
Swiper as TSwiper,
SwiperItem as TSwiperItem,
} from "tdesign-vue-next";
const components = [
TButton,
TInput,
TLoading,
TTabPanel,
TTooltip,
TSelect,
TPopup,
TDialog,
TOption,
TSwitch,
TCheckbox,
TSwiper,
TSwiperItem,
];
export default defineNuxtPlugin((nuxtApp) => {
components.forEach((item: any) => {
nuxtApp.vueApp.use(item);
});
});
const vImage = { const vImage = {
mounted: async (el: HTMLImageElement) => { mounted: async (el: HTMLImageElement) => {
// let imgURL = el.src; //获取图片地址 console.log(el);
// if (imgURL) {
// let copyNode = el.cloneNode(true);
// // 给一个默认图片
// let defaultImg = "/images/img/empty.png";
// copyNode.src = defaultImg;
// // 在头部添加一个gif加载动画
// let parent = el.parentNode;
// parent?.insertBefore(copyNode);
// el.style.display = "none";
// el.onerror = () => {
// el.src = defaultImg;
// };
// }
}, },
}; };
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import QrCode from "qrcode"; import QrCode from "qrcode";
import { Dialog as TDialog } from "tdesign-vue-next";
const props = defineProps({ const props = defineProps({
QrCodevisible: Boolean, QrCodevisible: Boolean,
QrCode: String, QrCode: String,
...@@ -34,7 +35,9 @@ const props = defineProps({ ...@@ -34,7 +35,9 @@ const props = defineProps({
const emit = defineEmits(["closeDialog"]); const emit = defineEmits(["closeDialog"]);
const getQrcode = () => { const getQrcode = () => {
let canvas = document.querySelector(`#${props.id}`); let canvas = document.querySelector(`#${props.id}`);
QrCode.toCanvas(canvas, props.QrCode); if (props.QrCode) {
QrCode.toCanvas(canvas, props.QrCode);
}
}; };
watch( watch(
() => props.QrCode, () => props.QrCode,
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { Select as TSelect, SelectValue } from "tdesign-vue-next";
const props = defineProps({ const props = defineProps({
type: { type: {
type: String, type: String,
...@@ -30,9 +31,11 @@ const languageOptions = [ ...@@ -30,9 +31,11 @@ const languageOptions = [
value: "en", value: "en",
}, },
]; ];
const changeLanguage = (v: string) => { const changeLanguage = (v: SelectValue) => {
locale.value = v; if (typeof v == "string") {
localStorage.setItem("lang", v); locale.value = v;
localStorage.setItem("lang", v);
}
}; };
</script> </script>
......
...@@ -10,26 +10,26 @@ ...@@ -10,26 +10,26 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import ThemeLightSvg from '/public/images/svg/header/theme-light.svg'; import ThemeLightSvg from "/public/images/svg/header/theme-light.svg";
import ThemeDarkSvg from '/public/images/svg/header/theme-dark.svg'; import ThemeDarkSvg from "/public/images/svg/header/theme-dark.svg";
import { Tooltip as TTooltip } from "tdesign-vue-next";
// 当前主题 // 当前主题
const theme = useCurTheme(); const theme = useCurTheme();
const themeLabel = computed(() => { const themeLabel = computed(() => {
return theme.value === 'light' ? '点击切换夜间模式' : '点击切换白天模式'; return theme.value === "light" ? "点击切换夜间模式" : "点击切换白天模式";
}); });
const changeTheme = () => { const changeTheme = () => {
if (theme.value === 'light') { if (theme.value === "light") {
theme.value = 'dark'; theme.value = "dark";
} else { } else {
theme.value = 'light'; theme.value = "light";
} }
document.documentElement.setAttribute('theme-mode', theme.value); document.documentElement.setAttribute("theme-mode", theme.value);
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '@/style/flex.less'; @import "@/style/flex.less";
.theme-change { .theme-change {
width: 28px; width: 28px;
height: 28px; height: 28px;
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
</span> </span>
<div class="comfim-box"> <div class="comfim-box">
<t-button @click="comfimawalY"> <t-button @click="comfimawalY">
<slot name="comfirm">{{ $t('user.Confirm') }}</slot> <slot name="comfirm">{{ $t("user.Confirm") }}</slot>
</t-button> </t-button>
<t-button @click="closeDialog"> <t-button @click="closeDialog">
<slot name="close">{{ $t('user.Cancel') }}</slot> <slot name="close">{{ $t("user.Cancel") }}</slot>
</t-button> </t-button>
</div> </div>
</div> </div>
...@@ -25,27 +25,28 @@ ...@@ -25,27 +25,28 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Dialog as TDialog, Button as TButton } from "tdesign-vue-next";
const props = defineProps({ const props = defineProps({
confirmDialog: Boolean, confirmDialog: Boolean,
}); });
const emit = defineEmits(['closeComfrimDialog', 'comfimawal']); const emit = defineEmits(["closeComfrimDialog", "comfimawal"]);
// 取消 // 取消
const closeDialog = () => { const closeDialog = () => {
emit('closeComfrimDialog', false); emit("closeComfrimDialog", false);
}; };
// 确认 // 确认
const comfimawalY = () => { const comfimawalY = () => {
emit('comfimawal', true); emit("comfimawal", true);
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
// 红点 // 红点
@import '@/style/components/dot.less'; @import "@/style/components/dot.less";
// 第二层dialog的蒙层颜色 // 第二层dialog的蒙层颜色
@import '@/style/components/hierarchyDialog.less'; @import "@/style/components/hierarchyDialog.less";
@import '@/style/variables.less'; @import "@/style/variables.less";
@import '@/style/flex.less'; @import "@/style/flex.less";
.hierarchy-dialog { .hierarchy-dialog {
:deep(.t-dialog) { :deep(.t-dialog) {
padding: 12px; padding: 12px;
......
<!--
* @Author: walker.liu
* @Date: 2022-03-09 11:10:22
* @Copyright(C): 2019-2020 ZP Inc. All rights reserved.
-->
<template> <template>
<div class="chart-box-wrapper"> <div class="chart-box-wrapper">
<div class="header" v-if="title || $slots['title']"> <div class="header" v-if="title || $slots['title']">
...@@ -13,7 +8,7 @@ ...@@ -13,7 +8,7 @@
class="go-ana-btn custom_button_back_border" class="go-ana-btn custom_button_back_border"
size="small" size="small"
@click="goAnalysis" @click="goAnalysis"
>{{ $t('collection.goAna') }}</t-button >{{ $t("collection.goAna") }}</t-button
> >
</div> </div>
<div class="chart-switch"> <div class="chart-switch">
...@@ -34,29 +29,34 @@ ...@@ -34,29 +29,34 @@
</div> </div>
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
import { filterChainObj } from '@/constants/UnifiedManagementChain'; import { filterChainObj } from "@/constants/UnifiedManagementChain";
import { Button as TButton } from "tdesign-vue-next";
const router = useRouter(); const router = useRouter();
const props = defineProps({ const props = withDefaults(
title: String, defineProps<{
subTitle: String, title?: string;
r24h: String, subTitle?: string;
token: String, r24h?: string;
tb: String, token?: string;
currentPath: String, tb?: string;
name: String, currentPath?: string;
// 是否需要header信息 name?: string;
hasHeader: { hasHeader?: boolean;
type: Boolean, }>(),
default: true, {
}, hasHeader: true,
}); name: "",
tb: "",
currentPath: "",
}
);
const goAnalysis = () => { const goAnalysis = () => {
// 临时存储 // 临时存储
window.sessionStorage.setItem('echart-box', props.name); window.sessionStorage.setItem("echart-box", props.name);
let Obj = filterChainObj('value', props.currentPath); let Obj = filterChainObj("value", props.currentPath);
let params: any = { let params: any = {
tb: tb:
props.tb[0] === 'd' ? props.tb.slice(1, props.tb.length) + '' : props.tb, props.tb[0] === "d" ? props.tb.slice(1, props.tb.length) + "" : props.tb,
path: Obj.name, path: Obj.name,
}; };
const routeUrl = router.resolve({ const routeUrl = router.resolve({
...@@ -66,8 +66,8 @@ const goAnalysis = () => { ...@@ -66,8 +66,8 @@ const goAnalysis = () => {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '@/style/variables.less'; @import "@/style/variables.less";
@import '@/style/flex.less'; @import "@/style/flex.less";
.chart-box-wrapper { .chart-box-wrapper {
margin-top: 2px; margin-top: 2px;
background: var(--td--right-back-color-2); background: var(--td--right-back-color-2);
...@@ -87,7 +87,7 @@ const goAnalysis = () => { ...@@ -87,7 +87,7 @@ const goAnalysis = () => {
border-bottom: 1px solid var(--new-border-9); border-bottom: 1px solid var(--new-border-9);
padding-left: 8px; padding-left: 8px;
.dja(space-between,center); .dja(space-between,center);
font-family: 'Medium'; font-family: "Medium";
span { span {
display: block; display: block;
white-space: nowrap; white-space: nowrap;
...@@ -96,7 +96,7 @@ const goAnalysis = () => { ...@@ -96,7 +96,7 @@ const goAnalysis = () => {
} }
.go-ana-btn { .go-ana-btn {
margin-right: 6px; margin-right: 6px;
font-family: 'Medium'; font-family: "Medium";
} }
} }
.left { .left {
...@@ -119,7 +119,7 @@ const goAnalysis = () => { ...@@ -119,7 +119,7 @@ const goAnalysis = () => {
flex-wrap: wrap; flex-wrap: wrap;
row-gap: 6px; row-gap: 6px;
& > :deep(*) { & > :deep(*) {
font-family: 'Regular'; font-family: "Regular";
.label { .label {
color: #7b7d87; color: #7b7d87;
} }
...@@ -141,7 +141,7 @@ const goAnalysis = () => { ...@@ -141,7 +141,7 @@ const goAnalysis = () => {
.t-radio-button { .t-radio-button {
font-size: @font-size-s; font-size: @font-size-s;
padding: 2px 20px; padding: 2px 20px;
font-family: 'Medium'; font-family: "Medium";
} }
.t-is-checked { .t-is-checked {
background: var(--new-background-7); background: var(--new-background-7);
......
...@@ -55,12 +55,17 @@ ...@@ -55,12 +55,17 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { MessagePlugin } from "tdesign-vue-next"; import {
MessagePlugin,
Dialog as TDialog,
Tooltip as TTooltip,
} from "tdesign-vue-next";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import Timefilter from "/public/images/svg/analysis/timefilter.svg"; import Timefilter from "/public/images/svg/analysis/timefilter.svg";
import { import {
DatePicker as TDatePicker, DatePicker as TDatePicker,
TimePicker as TTimePicker, TimePicker as TTimePicker,
Button as TButton,
} from "tdesign-vue-next"; } from "tdesign-vue-next";
const route = useRoute(); const route = useRoute();
const emit = defineEmits(["change"]); const emit = defineEmits(["change"]);
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
</chart-box> </chart-box>
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
import ChartBox from './ChartBox.vue'; import ChartBox from "./ChartBox.vue";
import { Loading as TLoading } from "tdesign-vue-next";
const props = defineProps({ const props = defineProps({
token: String, token: String,
url: String, url: String,
...@@ -63,12 +64,12 @@ onMounted(() => { ...@@ -63,12 +64,12 @@ onMounted(() => {
} }
}, 5000); }, 5000);
}); });
const changeTwitter = (url) => { const changeTwitter = (url: string) => {
// twitter_url.value = url; // twitter_url.value = url;
// window.__twttr.widgets.init = false; // window.__twttr.widgets.init = false;
// window.__twttr.widgets.loaded = false; // window.__twttr.widgets.loaded = false;
// window.twttr.widgets.load(); // window.twttr.widgets.load();
let script: any = document.getElementById('twitter-script'); let script: any = document.getElementById("twitter-script");
if (script) { if (script) {
script.remove(); script.remove();
let win: any = window; let win: any = window;
...@@ -77,37 +78,38 @@ const changeTwitter = (url) => { ...@@ -77,37 +78,38 @@ const changeTwitter = (url) => {
// window.twttr.widgets.load(); // window.twttr.widgets.load();
} }
let timestamp = new Date().getTime(); let timestamp = new Date().getTime();
getScript('/widgets.js?t=' + timestamp).then(() => { getScript("/widgets.js?t=" + timestamp).then(() => {
let iframeBox = document.getElementById('twitter-iframe'); let iframeBox: HTMLElement | null =
document.getElementById("twitter-iframe");
// 优化代码 用户频繁点击一直执行删除推文(解决页面嵌入多个推文) // 优化代码 用户频繁点击一直执行删除推文(解决页面嵌入多个推文)
while (iframeBox.lastChild) { while (iframeBox && iframeBox.lastChild) {
iframeBox.removeChild(iframeBox.lastChild); iframeBox.removeChild(iframeBox.lastChild);
} }
let element = document.createElement('a'); let element = document.createElement("a");
element.setAttribute('href', url); element.setAttribute("href", url);
element.setAttribute('class', 'twitter-timeline narrow-scrollbar'); element.setAttribute("class", "twitter-timeline narrow-scrollbar");
element.setAttribute('theme', 'dark'); element.setAttribute("theme", "dark");
element.setAttribute('data-chrome', 'noheader nofooter transparent'); element.setAttribute("data-chrome", "noheader nofooter transparent");
element.setAttribute('data-height', '314'); element.setAttribute("data-height", "314");
element.setAttribute('data-width', '348px'); element.setAttribute("data-width", "348px");
element.setAttribute('data-aria-polite', 'assertive'); element.setAttribute("data-aria-polite", "assertive");
iframeBox?.appendChild(element); iframeBox?.appendChild(element);
}); });
}; };
const getScript = (path) => { const getScript = (path: string) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let head = document.getElementsByTagName('head')[0]; let head = document.getElementsByTagName("head")[0];
let script: any = document.createElement('script'); let script: any = document.createElement("script");
script.src = path; script.src = path;
script.type = 'text/javascript'; script.type = "text/javascript";
script.id = 'twitter-script'; script.id = "twitter-script";
head.appendChild(script); head.appendChild(script);
script.onload = script.onreadystatechange = function () { script.onload = script.onreadystatechange = function () {
/*判断是否加载成功*/ /*判断是否加载成功*/
if ( if (
!this.readyState || !this.readyState ||
this.readyState === 'loaded' || this.readyState === "loaded" ||
this.readyState === 'complete' this.readyState === "complete"
) { ) {
script.onload = script.onreadystatechange = null; script.onload = script.onreadystatechange = null;
return resolve; return resolve;
...@@ -120,7 +122,7 @@ const getScript = (path) => { ...@@ -120,7 +122,7 @@ const getScript = (path) => {
// const socialInfo = computed(() => store.getters['token/getSocialInfo'](props.token)); // const socialInfo = computed(() => store.getters['token/getSocialInfo'](props.token));
</script> </script>
<style lang="less"> <style lang="less">
@import '@/style/flex.less'; @import "@/style/flex.less";
.empty-twitter { .empty-twitter {
height: 330px; height: 330px;
} }
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
</div> </div>
<template #content> <template #content>
<div class="s-header-fox-box"> <div class="s-header-fox-box">
<div class="fox-title">{{ $t('header.FoxwalletTitle') }}</div> <div class="fox-title">{{ $t("header.FoxwalletTitle") }}</div>
<div class="wallet-Connect"> <div class="wallet-Connect">
<t-button class="center-btn-box" @click="connectionFox"> <t-button class="center-btn-box" @click="connectionFox">
<template #icon> <template #icon>
<img :src="Imgs.FoxSvg" alt="" class="icon" /> <img :src="Imgs.FoxSvg" alt="" class="icon" />
</template> </template>
{{ $t('header.FoxwalletTitle2') }} {{ $t("header.FoxwalletTitle2") }}
</t-button> </t-button>
</div> </div>
</div> </div>
...@@ -24,32 +24,36 @@ ...@@ -24,32 +24,36 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { MessagePlugin } from 'tdesign-vue-next'; import {
import detectEthereumProvider from '@metamask/detect-provider'; MessagePlugin,
import { useI18n } from 'vue-i18n'; Popup as TPopup,
Button as TButton,
} from "tdesign-vue-next";
import detectEthereumProvider from "@metamask/detect-provider";
import { useI18n } from "vue-i18n";
const i18n = useI18n(); const i18n = useI18n();
let provider; let provider: any = null;
if (process.client) { if (process.client) {
provider = detectEthereumProvider(); provider = detectEthereumProvider();
} }
const Imgs = { const Imgs = {
FoxSvg: '/images/svg/header/fox.svg', FoxSvg: "/images/svg/header/fox.svg",
}; };
// 用户token // 用户token
const Cookie = useCookie('userCookie'); const Cookie = useCookie("userCookie");
const hasdisabled = ref(false); const hasdisabled = ref(false);
const defaultTitle = computed(() => i18n.t('header.Foxwalletbutton')); const defaultTitle = computed(() => i18n.t("header.Foxwalletbutton"));
const UserAddress = useUserAddress(); const UserAddress = useUserAddress();
// 连接钱包后展示的文字 // 连接钱包后展示的文字
const AfterConnection = ref(''); const AfterConnection = ref("");
// 用户原始交易地址 // 用户原始交易地址
const account = ref(''); const account = ref("");
onBeforeMount(() => { onBeforeMount(() => {
// 是否可以连接 // 是否可以连接
// console.log(ethereum.isConnected()); // console.log(ethereum.isConnected());
let ConnectFox = window.sessionStorage.getItem('ConnectFox'); let ConnectFox = window.sessionStorage.getItem("ConnectFox");
let eth: any = window; let eth: any = window;
if (ConnectFox === 'true' && eth.ethereum?.isConnected()) { if (ConnectFox === "true" && eth.ethereum?.isConnected()) {
// 这里自动连接钱包,不需要存储本地 // 这里自动连接钱包,不需要存储本地
hasdisabled.value = true; hasdisabled.value = true;
getConnectFox(); getConnectFox();
...@@ -58,7 +62,7 @@ onBeforeMount(() => { ...@@ -58,7 +62,7 @@ onBeforeMount(() => {
const connectionFox = () => { const connectionFox = () => {
if (!provider) { if (!provider) {
MessagePlugin.warning('请先下载MetaMask'); MessagePlugin.warning("请先下载MetaMask");
return; return;
} }
// 连接钱包 // 连接钱包
...@@ -67,14 +71,14 @@ const connectionFox = () => { ...@@ -67,14 +71,14 @@ const connectionFox = () => {
const getConnectFox = async () => { const getConnectFox = async () => {
if (!Cookie.value) { if (!Cookie.value) {
MessagePlugin.closeAll(); MessagePlugin.closeAll();
MessagePlugin.warning('请先登录'); MessagePlugin.warning("请先登录");
return; return;
} }
// 这里是用户主动连接,临时存储到本地,刷新页面时自动赋值 // 这里是用户主动连接,临时存储到本地,刷新页面时自动赋值
let eth: any = window; let eth: any = window;
try { try {
const accounts = await eth.ethereum.request({ const accounts = await eth.ethereum.request({
method: 'eth_requestAccounts', method: "eth_requestAccounts",
}); });
if (accounts[0]) { if (accounts[0]) {
account.value = accounts[0]; account.value = accounts[0];
...@@ -82,7 +86,7 @@ const getConnectFox = async () => { ...@@ -82,7 +86,7 @@ const getConnectFox = async () => {
accounts[0].length - 4, accounts[0].length - 4,
accounts[0].length accounts[0].length
)}`; )}`;
window.sessionStorage.setItem('ConnectFox', 'true'); window.sessionStorage.setItem("ConnectFox", "true");
// 禁用下拉菜单 // 禁用下拉菜单
setTimeout(() => { setTimeout(() => {
hasdisabled.value = true; hasdisabled.value = true;
...@@ -90,7 +94,7 @@ const getConnectFox = async () => { ...@@ -90,7 +94,7 @@ const getConnectFox = async () => {
} }
UserAddress.value = account.value; UserAddress.value = account.value;
} catch (e) { } catch (e) {
MessagePlugin.warning(i18n.t('MessagePlugin.Foxwallet')); MessagePlugin.warning(i18n.t("MessagePlugin.Foxwallet"));
hasdisabled.value = false; hasdisabled.value = false;
return; return;
} }
...@@ -98,7 +102,7 @@ const getConnectFox = async () => { ...@@ -98,7 +102,7 @@ const getConnectFox = async () => {
</script> </script>
<style lang="less"> <style lang="less">
@import '@/style/flex.less'; @import "@/style/flex.less";
// dropdown挂载在根元素 // dropdown挂载在根元素
.s-header-fox-box { .s-header-fox-box {
width: 240px; width: 240px;
...@@ -107,14 +111,14 @@ const getConnectFox = async () => { ...@@ -107,14 +111,14 @@ const getConnectFox = async () => {
padding: 0 0 6px 6px; padding: 0 0 6px 6px;
font-weight: bold; font-weight: bold;
user-select: none; user-select: none;
font-family: 'bold'; font-family: "bold";
} }
.wallet-Connect { .wallet-Connect {
.t-button { .t-button {
width: 100%; width: 100%;
background-color: var(--td--main-btn-color-1); background-color: var(--td--main-btn-color-1);
border: none; border: none;
font-family: 'Medium'; font-family: "Medium";
.icon { .icon {
padding-right: 8px; padding-right: 8px;
} }
...@@ -138,7 +142,7 @@ const getConnectFox = async () => { ...@@ -138,7 +142,7 @@ const getConnectFox = async () => {
font-weight: 700; font-weight: 700;
font-size: 15px; font-size: 15px;
color: var(--td--main-btn-color-1); color: var(--td--main-btn-color-1);
font-family: 'bold'; font-family: "bold";
} }
} }
</style> </style>
...@@ -18,17 +18,17 @@ ...@@ -18,17 +18,17 @@
<div class="small-userinfo"> <div class="small-userinfo">
<div class="small-logo"> <div class="small-logo">
<userOneSvg></userOneSvg> <userOneSvg></userOneSvg>
<p class="small-logo-p1">{{ userInfo.name ?? '-----' }}</p> <p class="small-logo-p1">{{ userInfo.name ?? "-----" }}</p>
<p class="small-logo-p2"> <p class="small-logo-p2">
{{ userInfo.vip_type ?? '免费会员' }} {{ userInfo.vip_type ?? "免费会员" }}
</p> </p>
<div class="post-box"> <div class="post-box">
<div class="small-item"> <div class="small-item">
<p class="small-p1">{{ $t('header.email') }}</p> <p class="small-p1">{{ $t("header.email") }}</p>
<p class="small-p2">-------</p> <p class="small-p2">-------</p>
</div> </div>
<div class="small-item"> <div class="small-item">
<p class="small-p1">{{ $t('header.wallets') }}</p> <p class="small-p1">{{ $t("header.wallets") }}</p>
<p class="small-p2">-------</p> <p class="small-p2">-------</p>
</div> </div>
</div> </div>
...@@ -39,22 +39,22 @@ ...@@ -39,22 +39,22 @@
@click="gotoMember('/user/personal')" @click="gotoMember('/user/personal')"
> >
<userTwo class="icon"></userTwo> <userTwo class="icon"></userTwo>
<p>{{ $t('user.PersonalInfo') }}</p> <p>{{ $t("user.PersonalInfo") }}</p>
</div> </div>
<div class="small-iconData" @click="gotoMember('/user/member')"> <div class="small-iconData" @click="gotoMember('/user/member')">
<VipSvg class="icon"></VipSvg> <VipSvg class="icon"></VipSvg>
<p>{{ $t('user.MemberCenter') }}</p> <p>{{ $t("user.MemberCenter") }}</p>
</div> </div>
<div <div
class="small-iconData" class="small-iconData"
@click="gotoMember('/user/InviteWelfare')" @click="gotoMember('/user/InviteWelfare')"
> >
<InvitationSvg class="icon"></InvitationSvg> <InvitationSvg class="icon"></InvitationSvg>
<p>{{ $t('user.InvitationCenter') }}</p> <p>{{ $t("user.InvitationCenter") }}</p>
</div> </div>
<div class="small-iconData" @click="gotoMember('install')"> <div class="small-iconData" @click="gotoMember('install')">
<InstallSvg class="icon"></InstallSvg> <InstallSvg class="icon"></InstallSvg>
<p>{{ $t('header.settings') }}</p> <p>{{ $t("header.settings") }}</p>
</div> </div>
<div class="small-iconData" @click="logout"> <div class="small-iconData" @click="logout">
<logoutSvg <logoutSvg
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
class="icon last-icon" class="icon last-icon"
></logoutSvg> ></logoutSvg>
<HomeLogoutSvg v-else class="icon last-icon"></HomeLogoutSvg> <HomeLogoutSvg v-else class="icon last-icon"></HomeLogoutSvg>
<p v-if="Cookie">{{ $t('header.logout') }}</p> <p v-if="Cookie">{{ $t("header.logout") }}</p>
<p v-else>{{ $t('header.goLogin') }}</p> <p v-else>{{ $t("header.goLogin") }}</p>
</div> </div>
</div> </div>
</div> </div>
...@@ -79,26 +79,26 @@ ...@@ -79,26 +79,26 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import userTwo from '/public/images/svg/header/userTwo.svg'; import userTwo from "/public/images/svg/header/userTwo.svg";
import DefaultAvatar from '/public/images/svg/header/default-avatar.svg'; import DefaultAvatar from "/public/images/svg/header/default-avatar.svg";
import upDownSvg from '/public/images/svg/header/upDown.svg'; import upDownSvg from "/public/images/svg/header/upDown.svg";
import VipSvg from '/public/images/svg/header/vip.svg'; import VipSvg from "/public/images/svg/header/vip.svg";
import InvitationSvg from '/public/images/svg/header/invitation.svg'; import InvitationSvg from "/public/images/svg/header/invitation.svg";
import InstallSvg from '/public/images/svg/header/install.svg'; import InstallSvg from "/public/images/svg/header/install.svg";
import logoutSvg from '/public/images/svg/header/logout.svg'; import logoutSvg from "/public/images/svg/header/logout.svg";
import HomeLogoutSvg from '/public/images/svg/header/homeLogout.svg'; import HomeLogoutSvg from "/public/images/svg/header/homeLogout.svg";
import userOneSvg from '/public/images/svg/header/userOne.svg'; import userOneSvg from "/public/images/svg/header/userOne.svg";
import { MessagePlugin } from 'tdesign-vue-next'; import { MessagePlugin, Popup as TPopup } from "tdesign-vue-next";
const router = useRouter(); const router = useRouter();
const userInfo = useTokenInfo(); const userInfo = useTokenInfo();
// 当前主题 // 当前主题
const mode = useCurTheme(); const mode = useCurTheme();
// 用户token // 用户token
const Cookie = useCookie('userCookie'); const Cookie = useCookie("userCookie");
// 点击不同选项 // 点击不同选项
const gotoMember = (label: string) => { const gotoMember = (label: string) => {
if (label === 'install') { if (label === "install") {
return; return;
} }
const resUrl = router.resolve({ const resUrl = router.resolve({
...@@ -110,21 +110,21 @@ const gotoMember = (label: string) => { ...@@ -110,21 +110,21 @@ const gotoMember = (label: string) => {
const logout = () => { const logout = () => {
if (!Cookie.value) { if (!Cookie.value) {
router.push({ router.push({
path: '/login', path: "/login",
}); });
} else { } else {
// 退出 // 退出
if (Cookie.value) { if (Cookie.value) {
Cookie.value = ''; Cookie.value = "";
MessagePlugin.success('退出成功'); MessagePlugin.success("退出成功");
} }
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import '@/style/variables.less'; @import "@/style/variables.less";
@import '@/style/flex.less'; @import "@/style/flex.less";
.user-info { .user-info {
.da(); .da();
cursor: pointer; cursor: pointer;
......
...@@ -106,7 +106,11 @@ import { WebS } from "@/utils/TokenTrans"; ...@@ -106,7 +106,11 @@ import { WebS } from "@/utils/TokenTrans";
import SearchRecords from "./searchRecords.vue"; import SearchRecords from "./searchRecords.vue";
import SearchList from "./searchList.vue"; import SearchList from "./searchList.vue";
import * as Cache from "@/utils/cache"; import * as Cache from "@/utils/cache";
import { Drawer as TDrawer } from "tdesign-vue-next"; import {
Drawer as TDrawer,
Input as TInput,
Loading as TLoading,
} from "tdesign-vue-next";
import { getPopupMaxHeight } from "@/utils/plugin/PopupTool"; import { getPopupMaxHeight } from "@/utils/plugin/PopupTool";
const keyword = ref(""); const keyword = ref("");
const inputPlaceholder = ref(""); const inputPlaceholder = ref("");
...@@ -177,7 +181,7 @@ const getHeight = () => { ...@@ -177,7 +181,7 @@ const getHeight = () => {
} }
let search_popup = document.getElementById("search-drawer"); let search_popup = document.getElementById("search-drawer");
if (search_popup) { if (search_popup) {
let child = search_popup.children[1]; let child = <HTMLElement>search_popup.children[1];
if (child) { if (child) {
child.style.maxHeight = PopupMaxHeight.value + "px"; child.style.maxHeight = PopupMaxHeight.value + "px";
} }
......
...@@ -69,13 +69,19 @@ ...@@ -69,13 +69,19 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { LoadingPlugin, MessagePlugin } from "tdesign-vue-next"; import {
LoadingPlugin,
MessagePlugin,
Button as TButton,
FormRule,
} from "tdesign-vue-next";
import md5 from "md5"; import md5 from "md5";
import request from "@/utils/request"; import request from "@/utils/request";
import { import {
Icon as TIcon, Icon as TIcon,
Form as TForm, Form as TForm,
FormItem as TFormItem, FormItem as TFormItem,
Input as TInput,
} from "tdesign-vue-next"; } from "tdesign-vue-next";
const emit = defineEmits(["registerSuccess", "go"]); const emit = defineEmits(["registerSuccess", "go"]);
...@@ -83,7 +89,7 @@ const emit = defineEmits(["registerSuccess", "go"]); ...@@ -83,7 +89,7 @@ const emit = defineEmits(["registerSuccess", "go"]);
const userToken = useUserToken(); const userToken = useUserToken();
interface FormData { interface FormData {
email: string; email: string;
password?: string; password: string;
} }
const formData = ref<FormData>({ const formData = ref<FormData>({
email: "", email: "",
...@@ -95,11 +101,11 @@ const formRules = computed(() => { ...@@ -95,11 +101,11 @@ const formRules = computed(() => {
email: [ email: [
{ required: true, message: "email required", type: "error" }, { required: true, message: "email required", type: "error" },
{ email: true, message: "email error", type: "error" }, { email: true, message: "email error", type: "error" },
], ] as FormRule[],
password: [ password: [
{ required: true, message: "password required", type: "error" }, { required: true, message: "password required", type: "error" },
// { min: 6, message: '至少需要6位', type: 'error' }, // { min: 6, message: '至少需要6位', type: 'error' },
], ] as FormRule[],
}; };
return rules; return rules;
}); });
...@@ -112,8 +118,8 @@ const onSubmit = async ({ validateResult }: any) => { ...@@ -112,8 +118,8 @@ const onSubmit = async ({ validateResult }: any) => {
if (validateResult === true) { if (validateResult === true) {
let params: FormData = { let params: FormData = {
email: formData.value.email, email: formData.value.email,
password: md5(formData.value.password),
}; };
params.password = md5(formData.value.password);
LoadingPlugin(true); LoadingPlugin(true);
let data: any; let data: any;
try { try {
......
...@@ -121,7 +121,14 @@ ...@@ -121,7 +121,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { MessagePlugin, LoadingPlugin } from "tdesign-vue-next"; import {
MessagePlugin,
LoadingPlugin,
Checkbox as TCheckbox,
Input as TInput,
Button as TButton,
FormRule,
} from "tdesign-vue-next";
import request from "@/utils/request"; import request from "@/utils/request";
import md5 from "md5"; import md5 from "md5";
import { useCounter } from "@/hooks"; import { useCounter } from "@/hooks";
...@@ -130,7 +137,6 @@ import { ...@@ -130,7 +137,6 @@ import {
Form as TForm, Form as TForm,
FormItem as TFormItem, FormItem as TFormItem,
} from "tdesign-vue-next"; } from "tdesign-vue-next";
const [countDown, handleCounter] = useCounter(); const [countDown, handleCounter] = useCounter();
const props = defineProps({ const props = defineProps({
InvitCode: String, InvitCode: String,
...@@ -155,7 +161,7 @@ const showPsw2 = ref(false); ...@@ -155,7 +161,7 @@ const showPsw2 = ref(false);
const form = ref(null); const form = ref(null);
const emit = defineEmits(["go"]); const emit = defineEmits(["go"]);
// 数据校验 // 数据校验
const repasswordValidator = (value) => { const repasswordValidator = (value: string) => {
if (formData.value.password === value) { if (formData.value.password === value) {
return { result: true }; return { result: true };
} else { } else {
...@@ -200,15 +206,15 @@ const FORM_RULES = { ...@@ -200,15 +206,15 @@ const FORM_RULES = {
email: [ email: [
{ required: true, message: "email required", type: "error" }, { required: true, message: "email required", type: "error" },
{ email: true, message: "email error", type: "error" }, { email: true, message: "email error", type: "error" },
], ] as FormRule[],
password: [ password: [
{ required: true, message: "password required", type: "error" }, { required: true, message: "password required", type: "error" },
// { min: 6, message: '至少需要6位', type: 'error' }, // { min: 6, message: '至少需要6位', type: 'error' },
], ] as FormRule[],
password2: [ password2: [
{ required: true, message: "confirm password required", type: "error" }, { required: true, message: "confirm password required", type: "error" },
{ validator: repasswordValidator }, { validator: repasswordValidator },
], ] as FormRule[],
}; };
const onSubmit = async ({ validateResult }: any) => { const onSubmit = async ({ validateResult }: any) => {
if (validateResult === true) { if (validateResult === true) {
...@@ -238,7 +244,7 @@ const onSubmit = async ({ validateResult }: any) => { ...@@ -238,7 +244,7 @@ const onSubmit = async ({ validateResult }: any) => {
} }
}; };
const goLogin = (val) => { const goLogin = () => {
emit("go", "login"); emit("go", "login");
}; };
</script> </script>
......
...@@ -104,17 +104,23 @@ ...@@ -104,17 +104,23 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { MessagePlugin, LoadingPlugin } from "tdesign-vue-next";
import { useCounter } from "@/hooks";
import { ArrowLeftIcon } from "tdesign-icons-vue-next";
import request from "@/utils/request";
import md5 from "md5";
import { useI18n } from "vue-i18n";
import { import {
MessagePlugin,
LoadingPlugin,
Checkbox as TCheckbox,
Button as TButton,
FormRule,
Icon as TIcon, Icon as TIcon,
Form as TForm, Form as TForm,
FormItem as TFormItem, FormItem as TFormItem,
Input as TInput,
SubmitContext,
} from "tdesign-vue-next"; } from "tdesign-vue-next";
import { useCounter } from "@/hooks";
import { ArrowLeftIcon } from "tdesign-icons-vue-next";
import request from "@/utils/request";
import md5 from "md5";
import { useI18n } from "vue-i18n";
const { t } = useI18n(); const { t } = useI18n();
const INITIAL_DATA = { const INITIAL_DATA = {
...@@ -171,15 +177,15 @@ const FORM_RULES = { ...@@ -171,15 +177,15 @@ const FORM_RULES = {
email: [ email: [
{ required: true, message: t("login.EMailRequired"), type: "error" }, { required: true, message: t("login.EMailRequired"), type: "error" },
{ email: true, message: t("login.entercorrectemail"), type: "error" }, { email: true, message: t("login.entercorrectemail"), type: "error" },
], ] as FormRule[],
vcCode: [ vcCode: [
{ required: true, message: t("login.Verificatioquired"), type: "error" }, { required: true, message: t("login.Verificatioquired"), type: "error" },
{ min: 4, message: t("login.Captchaerror"), type: "error" }, { min: 4, message: t("login.Captchaerror"), type: "error" },
], ] as FormRule[],
password: [ password: [
{ required: true, message: t("login.PasswordRequired"), type: "error" }, { required: true, message: t("login.PasswordRequired"), type: "error" },
{ min: 6, message: t("login.Ateeded"), type: "error" }, { min: 6, message: t("login.Ateeded"), type: "error" },
], ] as FormRule[],
password2: [ password2: [
{ {
required: true, required: true,
...@@ -187,11 +193,11 @@ const FORM_RULES = { ...@@ -187,11 +193,11 @@ const FORM_RULES = {
type: "error", type: "error",
}, },
{ validator: repasswordValidator }, { validator: repasswordValidator },
], ] as FormRule[],
}; };
const emit = defineEmits(["go"]); const emit = defineEmits(["go"]);
const onSubmit = async ({ validateResult }) => { const onSubmit = async ({ validateResult }: SubmitContext) => {
if (validateResult === true) { if (validateResult === true) {
if (!formData.value.checked) { if (!formData.value.checked) {
MessagePlugin.error("请同意用户隐私政策"); MessagePlugin.error("请同意用户隐私政策");
......
...@@ -84,7 +84,6 @@ const goHome = () => { ...@@ -84,7 +84,6 @@ const goHome = () => {
.login-wrapper { .login-wrapper {
background-color: var(--td-bg-color-page); background-color: var(--td-bg-color-page);
display: flex; display: flex;
min-height: 800px;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
overflow-y: hidden; overflow-y: hidden;
......
...@@ -39,6 +39,7 @@ import ChainSearch from "/public/images/svg/filter/chainSearch.svg"; ...@@ -39,6 +39,7 @@ import ChainSearch from "/public/images/svg/filter/chainSearch.svg";
import { ChevronDownIcon } from "tdesign-icons-vue-next"; import { ChevronDownIcon } from "tdesign-icons-vue-next";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { isChildOf, getPopupFixedSite } from "@/utils/plugin/PopupTool"; import { isChildOf, getPopupFixedSite } from "@/utils/plugin/PopupTool";
import { Input as TInput } from "tdesign-vue-next";
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const ChainImgIndex = ref(0); const ChainImgIndex = ref(0);
...@@ -189,15 +190,15 @@ const popupContent = () => { ...@@ -189,15 +190,15 @@ const popupContent = () => {
return ( return (
<div class="custom-chose-chain-content"> <div class="custom-chose-chain-content">
<div class="search-box"> <div class="search-box">
<t-input <TInput
placeholder={t("Search.search")} placeholder={t("Search.search")}
prefixIcon={() => <ChainSearch></ChainSearch>} prefixIcon={() => <ChainSearch></ChainSearch>}
onChange={InputChange} onChange={InputChange}
></t-input> ></TInput>
</div> </div>
<div class="chain-box-body narrow-scrollbar"> <div class="chain-box-body narrow-scrollbar">
{filterList.list.map((item: any) => ( {filterList.list.map((item: any) => (
<NuxtLink to={getChainHref(item)} class="chain-box"> <nuxt-link to={getChainHref(item)} class="chain-box">
<div <div
class="chain-box-child" class="chain-box-child"
onClick={selectChange.bind(this, item.value)} onClick={selectChange.bind(this, item.value)}
...@@ -205,7 +206,7 @@ const popupContent = () => { ...@@ -205,7 +206,7 @@ const popupContent = () => {
<img src={item.img} alt="" /> <img src={item.img} alt="" />
<span>{item.fullName}</span> <span>{item.fullName}</span>
</div> </div>
</NuxtLink> </nuxt-link>
))} ))}
</div> </div>
</div> </div>
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<template v-else> <template v-else>
<div <div
class="drag-icon custom-collection-drag" class="drag-icon custom-collection-drag"
@mousedown="MouseStart(index)" @mousedown="MouseStart($event, index)"
> >
<DragSvg></DragSvg> <DragSvg></DragSvg>
</div> </div>
...@@ -151,7 +151,6 @@ ...@@ -151,7 +151,6 @@
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { useI18n } from "vue-i18n";
import EditSvg from "/public/images/svg/collection/edit.svg"; import EditSvg from "/public/images/svg/collection/edit.svg";
import DefaultTokenSvg from "/public/images/svg/collection/filter-default-icon.svg"; import DefaultTokenSvg from "/public/images/svg/collection/filter-default-icon.svg";
import StickyTopSvg from "/public/images/svg/collection/StickyTop.svg"; import StickyTopSvg from "/public/images/svg/collection/StickyTop.svg";
...@@ -169,7 +168,7 @@ import { ...@@ -169,7 +168,7 @@ import {
import CustomTableSort from "./tableSort.vue"; import CustomTableSort from "./tableSort.vue";
import { filterChainObj } from "@/constants/UnifiedManagementChain"; import { filterChainObj } from "@/constants/UnifiedManagementChain";
import { deleteCollection, changeCollection } from "@/utils/cache"; import { deleteCollection, changeCollection } from "@/utils/cache";
const { t } = useI18n(); import { Checkbox as TCheckbox } from "tdesign-vue-next";
const router = useRouter(); const router = useRouter();
const chain = useChain(); const chain = useChain();
const ChainObj = ref<any>({}); const ChainObj = ref<any>({});
...@@ -234,7 +233,7 @@ const toEdit = () => { ...@@ -234,7 +233,7 @@ const toEdit = () => {
} }
}; };
// 鼠标按下 // 鼠标按下
const MouseStart = (index: number, e: any) => { const MouseStart = (e: any, index: number) => {
MouseParameter.index = index; MouseParameter.index = index;
// 开始位置 // 开始位置
MouseParameter.StartY = e.clientY; MouseParameter.StartY = e.clientY;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}" }"
> >
<t-swiper :duration="300" :interval="50000" :type="swiperType"> <t-swiper :duration="300" :interval="50000" :type="swiperType">
<t-swiper-item v-for="item in picList.list" :key="item"> <t-swiper-item v-for="(item, index) in picList.list" :key="index">
<img <img
:src="item.picture_link" :src="item.picture_link"
alt="" alt=""
...@@ -24,8 +24,13 @@ ...@@ -24,8 +24,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import request from "@/utils/request"; import request from "@/utils/request";
const swiperType = ref("default"); import { Swiper as TSwiper, SwiperItem as TSwiperItem } from "tdesign-vue-next";
const picList = reactive({ interface picListType {
goto_link: string;
picture_link: string;
}
const swiperType = ref<"default" | "card">("default");
const picList = reactive<{ list: picListType[] }>({
list: [], list: [],
}); });
const goDetail = (item: any) => { const goDetail = (item: any) => {
......
...@@ -6,12 +6,7 @@ ...@@ -6,12 +6,7 @@
> >
<div class="history-btns"> <div class="history-btns">
<div class="left"> <div class="left">
<t-radio-group <t-radio-group v-model="groupbtn" class="custom-group2">
v-model="groupbtn"
class="custom-group2"
:options="groupList"
@change="groupbtnChange"
>
<t-radio-button <t-radio-button
v-for="item of groupList" v-for="item of groupList"
:key="item.value" :key="item.value"
...@@ -42,11 +37,6 @@ ...@@ -42,11 +37,6 @@
:asyncLoading="loadingNode" :asyncLoading="loadingNode"
:loading="loading" :loading="loading"
:header-affixed-top="tablesticky" :header-affixed-top="tablesticky"
:scroll="{
type: '',
bufferSize: 10,
}"
@filter-change="onFilterChange"
v-show="groupbtn === 'table'" v-show="groupbtn === 'table'"
> >
<template #st="{ row }"> <template #st="{ row }">
...@@ -65,7 +55,7 @@ ...@@ -65,7 +55,7 @@
}}</span> }}</span>
</template> </template>
<template #txn="{ row }"> <template #txn="{ row }">
<a class="jump-txn" href="javascript:;" @click="goTxn(row)"> <a class="jump-txn" href="javascript:;" @click="goTxn(row.hash)">
{{ row.hash.substr(0, 6) }} {{ row.hash.substr(0, 6) }}
</a> </a>
</template> </template>
...@@ -106,20 +96,61 @@ import { ...@@ -106,20 +96,61 @@ import {
Table as TTable, Table as TTable,
RadioGroup as TRadioGroup, RadioGroup as TRadioGroup,
RadioButton as TRadioButton, RadioButton as TRadioButton,
Loading as TLoading,
Button as TButton,
PrimaryTableCol,
TableRowData,
RowClassNameParams,
} from "tdesign-vue-next"; } from "tdesign-vue-next";
const props = defineProps<{
currentPath: string;
tb: string;
PoolAddress: string;
token?: string;
mt: string;
}>();
interface HistoryValue {
bn: number;
date: string;
h100: number;
hash: string;
index: number;
nh: number;
oldsr: number;
oldtokenNumStr: number;
sn: number;
sr: number;
newSr?: string;
st: string;
tokenNumStr: string;
ts: number;
tsStr: string;
up: number;
upStr: string;
vn: string;
vnStr: string;
}
interface HistoryFilterEmitValue {
visible: boolean;
value: {
type: string;
min: number;
max: number;
filterName: string;
filtervalue: string;
};
}
const i18n = useI18n(); const i18n = useI18n();
let interval = null; let interval: number | null = null;
const tokenVisible = ref(false);
const baseTokenVisible = ref(false);
// 是否首次加载表格 // 是否首次加载表格
const hasOneTable = ref(false); const hasOneTable = ref(false);
const resultData = reactive({ const resultData = reactive({
// 表格数据 // 表格数据
list: [], list: [] as HistoryValue[],
// 筛选结果 // 筛选结果
filterlist: [], filterlist: [] as HistoryValue[],
// 所有数据 // 所有数据
allList: [], allList: [] as HistoryValue[],
/** /**
* 当前展示的数据是筛选数据还是全部数据--true为全部数据,false为筛选数据 * 当前展示的数据是筛选数据还是全部数据--true为全部数据,false为筛选数据
* 用于判断是否需要异步加载 * 用于判断是否需要异步加载
...@@ -137,7 +168,7 @@ const dialogvisible = ref(false); ...@@ -137,7 +168,7 @@ const dialogvisible = ref(false);
// 对话框标题 // 对话框标题
const dialogTitle = ref({}); const dialogTitle = ref({});
// 滚动元素 // 滚动元素
let historyList = ref(null); let historyList = ref<HTMLDivElement>();
// 当前选中的按钮 // 当前选中的按钮
const groupbtn = ref("table"); const groupbtn = ref("table");
// 按钮组 // 按钮组
...@@ -158,30 +189,29 @@ const groupList = computed(() => [ ...@@ -158,30 +189,29 @@ const groupList = computed(() => [
const JoinUs = (url: string) => { const JoinUs = (url: string) => {
window.open(url); window.open(url);
}; };
// 关闭定时器
const closeInterval = () => {
if (interval) {
window.clearInterval(interval);
}
};
// 表格表头吸顶 // 表格表头吸顶
const tablesticky = ref(null); const tablesticky = ref<{
offsetTop: number;
zIndex: number;
container: string;
} | null>(null);
const asyncLoading = ref(""); const asyncLoading = ref("");
const props = defineProps({
currentPath: String,
tb: String,
PoolAddress: String,
token: String,
mt: String,
});
// 自增赋值给key // 自增赋值给key
let thisIndex = 1; let thisIndex = 1;
const groupbtnChange = (value: string) => {
if (value == "order") {
}
};
watch( watch(
() => props.PoolAddress, () => props.PoolAddress,
(v) => { (v) => {
if (v) { if (v) {
// 先注销上个定时器 // 先注销上个定时器
clearInterval(interval); closeInterval();
resultData.list = []; resultData.list = [];
asyncLoading.value = ""; asyncLoading.value = "";
getHistoryList("fetch"); getHistoryList("fetch");
...@@ -210,7 +240,7 @@ watch( ...@@ -210,7 +240,7 @@ watch(
} }
getHistoryList("fetch"); getHistoryList("fetch");
handleScrollEvent(); handleScrollEvent();
interval = setInterval(getHistoryList, 10000); interval = window.setInterval(getHistoryList, 10000);
} }
} }
); );
...@@ -218,17 +248,13 @@ const monitor = (e: any) => { ...@@ -218,17 +248,13 @@ const monitor = (e: any) => {
let isExist = e.target.visibilityState; let isExist = e.target.visibilityState;
if (isExist === "visible") { if (isExist === "visible") {
// 先关再开 // 先关再开
if (interval) { closeInterval();
clearInterval(interval);
}
// 开启前立即请求一次 // 开启前立即请求一次
getHistoryList(); getHistoryList();
interval = setInterval(getHistoryList, 10000); interval = window.setInterval(getHistoryList, 10000);
} else { } else {
// 离开页面 // 离开页面
if (interval) { closeInterval();
clearInterval(interval);
}
} }
}; };
// 滚动事件 // 滚动事件
...@@ -245,8 +271,9 @@ const ScrollClick = () => { ...@@ -245,8 +271,9 @@ const ScrollClick = () => {
onMounted(() => { onMounted(() => {
// 注册滚动监听,滚动时重新显示吸顶表头 // 注册滚动监听,滚动时重新显示吸顶表头
historyList.value.addEventListener("scroll", ScrollClick); if (historyList.value) {
historyList.value.addEventListener("scroll", ScrollClick);
}
// 监听是否切除页面 // 监听是否切除页面
document.addEventListener("visibilitychange", monitor); document.addEventListener("visibilitychange", monitor);
...@@ -259,9 +286,7 @@ onMounted(() => { ...@@ -259,9 +286,7 @@ onMounted(() => {
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
clearInterval(interval); closeInterval();
});
onUnmounted(() => {
// 注销滚动监听 // 注销滚动监听
if (historyList.value) { if (historyList.value) {
historyList.value.removeEventListener("scroll", ScrollClick, false); historyList.value.removeEventListener("scroll", ScrollClick, false);
...@@ -277,26 +302,29 @@ const MydisplayColumns = reactive({ ...@@ -277,26 +302,29 @@ const MydisplayColumns = reactive({
"vnStr", "vnStr",
"upStr", "upStr",
"nh", "nh",
"sr", "newSr",
"h100", "h100",
"txn", "txn",
], ],
}); });
const handleScrollEvent = () => { const handleScrollEvent = () => {
let dom = document.getElementById("history-list-wrapper"); let dom = document.getElementById("history-list-wrapper");
dom.onscroll = (e) => { if (dom) {
if (asyncLoading.value === "loading" || asyncLoading.value === "end") { dom.onscroll = () => {
return; if (asyncLoading.value === "loading" || asyncLoading.value === "end") {
} return;
if ( }
Math.abs(dom.scrollHeight - dom.clientHeight - dom.scrollTop) < 100 && if (
resultData.status dom &&
) { Math.abs(dom.scrollHeight - dom.clientHeight - dom.scrollTop) < 100 &&
getHistoryList("fetch"); resultData.status
} ) {
}; getHistoryList("fetch");
}
};
}
}; };
const loadingNode = (h) => { const loadingNode = () => {
if (asyncLoading.value === "end" || asyncLoading.value === "stop") { if (asyncLoading.value === "end" || asyncLoading.value === "stop") {
return ( return (
<div class="asyncLoadingTitle"> <div class="asyncLoadingTitle">
...@@ -314,7 +342,7 @@ const loadingNode = (h) => { ...@@ -314,7 +342,7 @@ const loadingNode = (h) => {
} else { } else {
return ( return (
<div style="color:var(--td--main-btn-color-1)"> <div style="color:var(--td--main-btn-color-1)">
<t-loading size="small" text="正在加载中,请稍后..."></t-loading> <TLoading size="small" text="正在加载中,请稍后..."></TLoading>
</div> </div>
); );
} }
...@@ -408,11 +436,11 @@ const getHistoryList = async (type = "update") => { ...@@ -408,11 +436,11 @@ const getHistoryList = async (type = "update") => {
// 全部数据里面必须要有值,才合并去重 // 全部数据里面必须要有值,才合并去重
result = filterRepeatTimestamp(resultData.allList, result); result = filterRepeatTimestamp(resultData.allList, result);
} }
result.forEach((item, index) => { result.forEach((item: HistoryValue) => {
// sr保留一个旧值 // sr保留一个旧值
if (item.sr) { if (item.sr) {
item.oldsr = item.sr; item.oldsr = item.sr;
item.sr = parsePercent(parseFloat(item.sr).toFixed(3)); item.newSr = parsePercent(parseFloat(item.sr + "").toFixed(3));
} }
thisIndex += 1; thisIndex += 1;
item.index = thisIndex; item.index = thisIndex;
...@@ -453,29 +481,14 @@ const resetClick = () => { ...@@ -453,29 +481,14 @@ const resetClick = () => {
resultData.status = true; resultData.status = true;
asyncLoading.value = "load-more"; asyncLoading.value = "load-more";
}; };
const filterObj = reactive({
type: "",
tokenNum: { min: "", max: "" },
baseTokenNum: { min: "", max: "" },
});
const togglePopup = (v) => { const goTxn = (hash: string) => {
if (v === "token") {
tokenVisible.value = !tokenVisible.value;
} else {
baseTokenVisible.value = !baseTokenVisible.value;
}
};
const onFilterChange = (v, context) => {
console.log(v, context);
};
const goTxn = (item) => {
let Obj = filterChainObj("value", props.currentPath); let Obj = filterChainObj("value", props.currentPath);
if (Obj) { if (Obj) {
window.open(`${Obj.url.website.hashLink}${item.hash}`); window.open(`${Obj.url.website.hashLink}${hash}`);
} }
}; };
const getRowClasss = ({ row }) => { const getRowClasss = ({ row }: RowClassNameParams<TableRowData>) => {
return row.st; return row.st;
}; };
// 打开筛选框 // 打开筛选框
...@@ -484,7 +497,7 @@ const openfilterDialog = (label: any) => { ...@@ -484,7 +497,7 @@ const openfilterDialog = (label: any) => {
dialogvisible.value = true; dialogvisible.value = true;
}; };
// 关闭弹窗 // 关闭弹窗
const closeDialog = ({ visible, value }) => { const closeDialog = ({ visible, value }: HistoryFilterEmitValue) => {
dialogvisible.value = visible; dialogvisible.value = visible;
// 判断是否需要筛选 // 判断是否需要筛选
if (value.type == "filter-self") { if (value.type == "filter-self") {
...@@ -527,11 +540,11 @@ const getfilterTimeList = async (value: any) => { ...@@ -527,11 +540,11 @@ const getfilterTimeList = async (value: any) => {
// 阻止异步加载 // 阻止异步加载
resultData.status = false; resultData.status = false;
if (result.length) { if (result.length) {
result.forEach((item, index) => { result.forEach((item: HistoryValue) => {
// sr保留一个旧值 // sr保留一个旧值
if (item.sr) { if (item.sr) {
item.oldsr = item.sr; item.oldsr = item.sr;
item.sr = parsePercent(parseFloat(item.sr).toFixed(3)); item.newSr = parsePercent(parseFloat(item.sr + "").toFixed(3));
} }
thisIndex += 1; thisIndex += 1;
item.index = thisIndex; item.index = thisIndex;
...@@ -561,139 +574,141 @@ const getfilterTimeList = async (value: any) => { ...@@ -561,139 +574,141 @@ const getfilterTimeList = async (value: any) => {
} catch (e) {} } catch (e) {}
}; };
const columns = computed(() => [ const columns = computed(
{ () =>
colKey: "tsStr", [
title: (h, { colIndex }) => ( {
<div class="filter-header filter-time"> colKey: "tsStr",
<span>{i18n.t("TableList.date")}</span> title: () => (
<span <div class="filter-header filter-time">
class="icon" <span>{i18n.t("TableList.date")}</span>
onClick={openfilterDialog.bind(this, { <span
title: i18n.t("TableList.date"), class="icon"
value: "ts", onClick={openfilterDialog.bind(this, {
})} title: i18n.t("TableList.date"),
> value: "ts",
<FilterSvg></FilterSvg> })}
</span> >
</div> <FilterSvg></FilterSvg>
), </span>
}, </div>
{ ),
colKey: "st", },
title: (h, { colIndex }) => ( {
<div class="filter-header"> colKey: "st",
<span class="name">{i18n.t("TableList.type")}</span> title: () => (
<span class="icon" onClick={filterHistoryList.bind(this, "type")}> <div class="filter-header">
<FilterBuyAndSellSVG></FilterBuyAndSellSVG> <span class="name">{i18n.t("TableList.type")}</span>
</span> <span class="icon" onClick={filterHistoryList.bind(this, "type")}>
</div> <FilterBuyAndSellSVG></FilterBuyAndSellSVG>
), </span>
align: "center", </div>
}, ),
{ align: "center",
colKey: "tokenNumStr", },
title: (h, { colIndex }) => ( {
<div class="filter-header"> colKey: "tokenNumStr",
<span class="name">{i18n.t("TableList.amountToken")}</span> title: () => (
<span <div class="filter-header">
class="icon" <span class="name">{i18n.t("TableList.amountToken")}</span>
onClick={openfilterDialog.bind(this, { <span
title: i18n.t("TableList.amountToken"), class="icon"
value: "oldtokenNumStr", onClick={openfilterDialog.bind(this, {
})} title: i18n.t("TableList.amountToken"),
> value: "oldtokenNumStr",
<FilterSvg></FilterSvg> })}
</span> >
</div> <FilterSvg></FilterSvg>
), </span>
align: "center", </div>
}, ),
{ align: "center",
colKey: "vnStr", },
title: (h, { colIndex }) => ( {
<div class="filter-header"> colKey: "vnStr",
<span class="name">{i18n.t("TableList.AmountUSD")}</span> title: () => (
<span <div class="filter-header">
class="icon" <span class="name">{i18n.t("TableList.AmountUSD")}</span>
onClick={openfilterDialog.bind(this, { <span
title: i18n.t("TableList.AmountUSD"), class="icon"
value: "vn", onClick={openfilterDialog.bind(this, {
})} title: i18n.t("TableList.AmountUSD"),
> value: "vn",
<FilterSvg></FilterSvg> })}
</span> >
</div> <FilterSvg></FilterSvg>
), </span>
align: "center", </div>
}, ),
{ align: "center",
colKey: "upStr", },
title: (h, { colIndex }) => ( {
<div class="filter-header"> colKey: "upStr",
<span class="name">{i18n.t("TableList.hisPrice")}</span> title: () => (
<span <div class="filter-header">
class="icon" <span class="name">{i18n.t("TableList.hisPrice")}</span>
onClick={openfilterDialog.bind(this, { <span
title: i18n.t("TableList.hisPrice"), class="icon"
value: "up", onClick={openfilterDialog.bind(this, {
})} title: i18n.t("TableList.hisPrice"),
> value: "up",
<FilterSvg></FilterSvg> })}
</span> >
</div> <FilterSvg></FilterSvg>
), </span>
align: "center", </div>
}, ),
{ align: "center",
colKey: "nh", },
title: (h, { colIndex }) => ( {
<div class="filter-header"> colKey: "nh",
<span class="name">{i18n.t("TableList.NewHolder")}</span> title: () => (
<span class="icon" onClick={filterHistoryList.bind(this, "nh")}> <div class="filter-header">
<FilterBuyAndSellSVG></FilterBuyAndSellSVG> <span class="name">{i18n.t("TableList.NewHolder")}</span>
</span> <span class="icon" onClick={filterHistoryList.bind(this, "nh")}>
</div> <FilterBuyAndSellSVG></FilterBuyAndSellSVG>
), </span>
align: "center", </div>
}, ),
{ align: "center",
colKey: "sr", },
// title: i18n.t('TableList.SellRatio'), {
title: (h, { colIndex }) => ( colKey: "newSr",
<div class="filter-header"> title: () => (
<span class="name">{i18n.t("TableList.SellRatio")}</span> <div class="filter-header">
<span <span class="name">{i18n.t("TableList.SellRatio")}</span>
class="icon" <span
onClick={openfilterDialog.bind(this, { class="icon"
title: i18n.t("TableList.SellRatio"), onClick={openfilterDialog.bind(this, {
value: "oldsr", title: i18n.t("TableList.SellRatio"),
})} value: "oldsr",
> })}
<FilterSvg></FilterSvg> >
</span> <FilterSvg></FilterSvg>
</div> </span>
), </div>
align: "center", ),
}, align: "center",
{ },
colKey: "h100", {
title: (h, { colIndex }) => ( colKey: "h100",
<div class="filter-header"> title: () => (
<span class="name">{i18n.t("TableList.top100Holders")}</span> <div class="filter-header">
<span class="icon" onClick={filterHistoryList.bind(this, "top100")}> <span class="name">{i18n.t("TableList.top100Holders")}</span>
<FilterBuyAndSellSVG></FilterBuyAndSellSVG> <span class="icon" onClick={filterHistoryList.bind(this, "top100")}>
</span> <FilterBuyAndSellSVG></FilterBuyAndSellSVG>
</div> </span>
), </div>
align: "center", ),
}, align: "center",
{ },
colKey: "txn", {
title: i18n.t("TableList.hisTxn"), colKey: "txn",
align: "center", title: i18n.t("TableList.hisTxn"),
}, align: "center",
]); },
] as PrimaryTableCol<TableRowData>[]
);
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "@/style/flex.less"; @import "@/style/flex.less";
......
...@@ -21,43 +21,44 @@ ...@@ -21,43 +21,44 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { filterChainObj } from '@/constants/UnifiedManagementChain'; import { filterChainObj } from "@/constants/UnifiedManagementChain";
import { Tooltip as TTooltip, Button as TButton } from "tdesign-vue-next";
const props = defineProps<{ const props = defineProps<{
tb: string; tb: string;
type: string; type: string;
content: string; content: string;
row?: any; row?: any;
}>(); }>();
const emit = defineEmits(['CustomClick']); const emit = defineEmits(["CustomClick"]);
// 筛选链下标 // 筛选链下标
// 当前链 // 当前链
const chain = useChain(); const chain = useChain();
const filterchain = () => { const filterchain = () => {
return filterChainObj('value', chain.value); return filterChainObj("value", chain.value);
}; };
const getDetailLink = computed(() => { const getDetailLink = computed(() => {
const { tb, type } = props; const { tb, type } = props;
let tbname = ''; let tbname = "";
if (tb[0] == 'd') { if (tb[0] == "d") {
tbname = tb.slice(1, tb.length) + ''; tbname = tb.slice(1, tb.length) + "";
} else { } else {
tbname = tb; tbname = tb;
} }
let Obj = filterchain(); let Obj = filterchain();
let path = Obj.name; let path = Obj.name;
if (type == 'detail') { if (type == "detail") {
return `/${path}/${tbname}`; return `/${path}/${tbname}`;
} }
if (type == 'collection') { if (type == "collection") {
return ''; return "";
} else { } else {
return `/analysis/${path}/${tbname}`; return `/analysis/${path}/${tbname}`;
} }
}); });
const getType = () => { const getType = () => {
const { type, row } = props; const { type, row } = props;
if (type == 'collection') { if (type == "collection") {
emit('CustomClick', row); emit("CustomClick", row);
} }
}; };
......
...@@ -117,7 +117,13 @@ import TokenInfo from "./TokenInfo.vue"; ...@@ -117,7 +117,13 @@ import TokenInfo from "./TokenInfo.vue";
import TokenPool from "./TokenPool.vue"; import TokenPool from "./TokenPool.vue";
import TokenSocialList from "./TokenSocialList.vue"; import TokenSocialList from "./TokenSocialList.vue";
import * as Cache from "@/utils/cache"; import * as Cache from "@/utils/cache";
import { MessagePlugin, Tabs as TTabs } from "tdesign-vue-next"; import {
MessagePlugin,
Tabs as TTabs,
TabPanel as TTabPanel,
Button as TButton,
TabValue,
} from "tdesign-vue-next";
import Detailsicon from "/public/images/svg/rightDetail/detailsicon.svg"; import Detailsicon from "/public/images/svg/rightDetail/detailsicon.svg";
import Favo from "/public/images/svg/rightDetail/favo.svg"; import Favo from "/public/images/svg/rightDetail/favo.svg";
import CollectionSvg from "/public/images/svg/rightDetail/colection.svg"; import CollectionSvg from "/public/images/svg/rightDetail/colection.svg";
...@@ -149,18 +155,18 @@ const headerBtns = computed(() => [ ...@@ -149,18 +155,18 @@ const headerBtns = computed(() => [
value: "echart", value: "echart",
}, },
]); ]);
const props = defineProps({ const props = defineProps<{
token: String, token: string;
scene: String, scene: string;
tb: String, tb: string;
currentPath: String, currentPath: string;
r24h: Number, r24h: number;
mt: String, mt: string;
up: Number, up?: number;
}); }>();
const emit = defineEmits(["update:setPool", "SettwitterRul"]); const emit = defineEmits(["update:setPool", "SettwitterRul"]);
const r24h = ref(""); const r24h = ref("");
const numR24h = ref(""); const numR24h = ref<string>("");
// 收藏列表是否首次加载 // 收藏列表是否首次加载
const CollectionOnload = ref(false); const CollectionOnload = ref(false);
// 判断当前路由,隐藏右侧详情box中的折线图模块 // 判断当前路由,隐藏右侧详情box中的折线图模块
...@@ -190,7 +196,7 @@ const getPriceRange = () => { ...@@ -190,7 +196,7 @@ const getPriceRange = () => {
let newR24h = parseFloat((proR24h + "").replace("-", "")); let newR24h = parseFloat((proR24h + "").replace("-", ""));
// 原价 // 原价
let oldPrice = props.up / (1 - newR24h); let oldPrice = props.up / (1 - newR24h);
numR24h.value = oldPrice - props.up; numR24h.value = oldPrice - props.up + "";
numR24h.value = "-" + parseCoinAmount(numR24h.value); numR24h.value = "-" + parseCoinAmount(numR24h.value);
} else if (proR24h == 0) { } else if (proR24h == 0) {
numR24h.value = "+0"; numR24h.value = "+0";
...@@ -198,7 +204,7 @@ const getPriceRange = () => { ...@@ -198,7 +204,7 @@ const getPriceRange = () => {
// +,涨 // +,涨
// 原价 // 原价
let oldPrice = props.up / (proR24h + 1); let oldPrice = props.up / (proR24h + 1);
numR24h.value = props.up - oldPrice; numR24h.value = props.up - oldPrice + "";
numR24h.value = "+" + parseCoinAmount(numR24h.value); numR24h.value = "+" + parseCoinAmount(numR24h.value);
} }
r24h.value = parsePercent(proR24h + ""); r24h.value = parsePercent(proR24h + "");
...@@ -238,7 +244,7 @@ watch( ...@@ -238,7 +244,7 @@ watch(
} }
); );
// 流动池tab改变 // 流动池tab改变
const changeTab = (value) => { const changeTab = (value: TabValue) => {
if (value === "pool") { if (value === "pool") {
isPool.value = true; isPool.value = true;
} }
...@@ -294,7 +300,7 @@ watch( ...@@ -294,7 +300,7 @@ watch(
); );
// 点击查看token详情信息 // 点击查看token详情信息
// v-if v-show同时使用,折线图第一次加载后,不在使用v-if,减少请求 // v-if v-show同时使用,折线图第一次加载后,不在使用v-if,减少请求
const gotoDetail = (value) => { const gotoDetail = (value: string) => {
if (value == "collection" && !CollectionOnload.value) { if (value == "collection" && !CollectionOnload.value) {
CollectionOnload.value = true; CollectionOnload.value = true;
} }
...@@ -317,7 +323,7 @@ const monitor = computed((value) => { ...@@ -317,7 +323,7 @@ const monitor = computed((value) => {
}; };
}); });
// 接收右侧详情流动池address // 接收右侧详情流动池address
const changePool = (PoolValue) => { const changePool = (PoolValue: string) => {
PoolAddress.value = PoolValue; PoolAddress.value = PoolValue;
emit("update:setPool", PoolValue); emit("update:setPool", PoolValue);
}; };
......
...@@ -227,7 +227,16 @@ import discordSvg from "/public/images/svg/filter/discord.svg"; ...@@ -227,7 +227,16 @@ import discordSvg from "/public/images/svg/filter/discord.svg";
import emailSvg from "/public/images/svg/filter/email.svg"; import emailSvg from "/public/images/svg/filter/email.svg";
import phoneSvg from "/public/images/svg/filter/phone.svg"; import phoneSvg from "/public/images/svg/filter/phone.svg";
import CustomerSvg from "/public/images/svg/filter/Customer.svg"; import CustomerSvg from "/public/images/svg/filter/Customer.svg";
import { Form as TForm, FormItem as TFormItem } from "tdesign-vue-next"; import {
Form as TForm,
FormItem as TFormItem,
Input as TInput,
Dialog as TDialog,
Option as TOption,
Switch as TSwitch,
Select as TSelect,
Button as TButton,
} from "tdesign-vue-next";
import { import {
TIME_RANGE_OPTIONS, TIME_RANGE_OPTIONS,
PRICE_RANGE_OPTIONS, PRICE_RANGE_OPTIONS,
......
...@@ -36,12 +36,11 @@ ...@@ -36,12 +36,11 @@
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { useI18n } from "vue-i18n";
import SubmitSvg from "/public/images/svg/rightDetail/submit.svg"; import SubmitSvg from "/public/images/svg/rightDetail/submit.svg";
import ConnectCloseSvg from "/public/images/svg/rightDetail/connectClose.svg"; import ConnectCloseSvg from "/public/images/svg/rightDetail/connectClose.svg";
import { submitInfoLink } from "@/constants/global"; import { submitInfoLink } from "@/constants/global";
import { Dialog as TDialog, Button as TButton } from "tdesign-vue-next";
const visible = ref(false); const visible = ref(false);
const { t } = useI18n();
const OpenDialog = () => { const OpenDialog = () => {
visible.value = true; visible.value = true;
}; };
......
...@@ -4,6 +4,7 @@ import "./index.less"; ...@@ -4,6 +4,7 @@ import "./index.less";
import SubmitSvg from "/public/images/svg/rightDetail/submit.svg"; import SubmitSvg from "/public/images/svg/rightDetail/submit.svg";
import ConnectCloseSvg from "/public/images/svg/rightDetail/connectClose.svg"; import ConnectCloseSvg from "/public/images/svg/rightDetail/connectClose.svg";
import { submitInfoLink } from "@/constants/global"; import { submitInfoLink } from "@/constants/global";
import { Dialog as TDialog, Button as TButton } from "tdesign-vue-next";
export default defineComponent({ export default defineComponent({
setup() { setup() {
const visible = ref(false); const visible = ref(false);
...@@ -27,7 +28,7 @@ export default defineComponent({ ...@@ -27,7 +28,7 @@ export default defineComponent({
<SubmitSvg></SubmitSvg> <SubmitSvg></SubmitSvg>
<span class="span1">更新社区信息</span> <span class="span1">更新社区信息</span>
</div> </div>
<t-dialog <TDialog
footer={false} footer={false}
v-model:visible={visible.value} v-model:visible={visible.value}
placement="center" placement="center"
...@@ -46,15 +47,15 @@ export default defineComponent({ ...@@ -46,15 +47,15 @@ export default defineComponent({
<p>{t("home.message5")}</p> <p>{t("home.message5")}</p>
</div> </div>
<div class="message-popup-footer"> <div class="message-popup-footer">
<t-button class="clear-btn" onClick={closeDialog}> <TButton class="clear-btn" onClick={closeDialog}>
{t("user.Cancel")} {t("user.Cancel")}
</t-button> </TButton>
<t-button class="submit-btn" onClick={submit}> <TButton class="submit-btn" onClick={submit}>
{t("home.toSubmit")} {t("home.toSubmit")}
</t-button> </TButton>
</div> </div>
</div> </div>
</t-dialog> </TDialog>
</div> </div>
); );
}, },
......
...@@ -13,60 +13,61 @@ ...@@ -13,60 +13,61 @@
</div> </div>
<div class="time-range-data"> <div class="time-range-data">
<div class="item"> <div class="item">
<div class="label">{{ $t('home.newHolder') }}</div> <div class="label">{{ $t("home.newHolder") }}</div>
<div class="value new">{{ timeMap[current].newHolders ?? '-' }}</div> <div class="value new">{{ timeMap[current].newHolders ?? "-" }}</div>
</div> </div>
<div class="item"> <div class="item">
<div class="label">{{ $t('home.txns') }}</div> <div class="label">{{ $t("home.txns") }}</div>
<div class="value">{{ timeMap[current].txns ?? '-' }}</div> <div class="value">{{ timeMap[current].txns ?? "-" }}</div>
</div> </div>
<div class="item"> <div class="item">
<div class="label">{{ $t('TableList.buys') }}</div> <div class="label">{{ $t("TableList.buys") }}</div>
<div class="value">{{ timeMap[current].buys ?? '-' }}</div> <div class="value">{{ timeMap[current].buys ?? "-" }}</div>
</div> </div>
<div class="item"> <div class="item">
<div class="label">{{ $t('TableList.sells') }}</div> <div class="label">{{ $t("TableList.sells") }}</div>
<div class="value">{{ timeMap[current].sells ?? '-' }}</div> <div class="value">{{ timeMap[current].sells ?? "-" }}</div>
</div> </div>
<div class="item"> <div class="item">
<div class="label">{{ $t('TableList.volume') }}</div> <div class="label">{{ $t("TableList.volume") }}</div>
<div class="value">{{ timeMap[current].vns ?? '-' }}</div> <div class="value">{{ timeMap[current].vns ?? "-" }}</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { parseNumberToK } from '@/utils/tool'; import { parseNumberToK } from "@/utils/tool";
import request from '@/utils/request'; import request from "@/utils/request";
import { useI18n } from 'vue-i18n'; import { useI18n } from "vue-i18n";
import { Button as TButton } from "tdesign-vue-next";
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps<{
token: String, token: string;
currentPath: String, currentPath: string;
tb: String, tb: string;
PoolAddress: String, PoolAddress: string;
mt: String, mt: string;
}); }>();
// 当前链 // 当前链
const chain = useChain(); const chain = useChain();
const current = ref('5m'); const current = ref("5m");
const tabOptions = computed(() => { const tabOptions = computed(() => {
return [ return [
{ {
label: t('TableList.time1'), label: t("TableList.time1"),
value: '5m', value: "5m",
}, },
{ {
label: t('TableList.time2'), label: t("TableList.time2"),
value: '1h', value: "1h",
}, },
{ {
label: t('TableList.time3'), label: t("TableList.time3"),
value: '4h', value: "4h",
}, },
{ {
label: t('TableList.time4'), label: t("TableList.time4"),
value: '24h', value: "24h",
}, },
]; ];
}); });
...@@ -81,19 +82,19 @@ watch( ...@@ -81,19 +82,19 @@ watch(
Object.keys(timeMap).forEach((item, index) => { Object.keys(timeMap).forEach((item, index) => {
timeMap[item] = {}; timeMap[item] = {};
}); });
getTimeList(''); getTimeList("");
} }
} }
); );
const timeMap: any = reactive({ const timeMap: any = reactive({
'5m': {}, "5m": {},
'1h': {}, "1h": {},
'4h': {}, "4h": {},
'24h': {}, "24h": {},
}); });
watch(current, (v) => { watch(current, (v) => {
if (timeMap[v].newHolders === undefined) { if (timeMap[v].newHolders === undefined) {
getTimeList(''); getTimeList("");
} }
}); });
watch( watch(
...@@ -107,7 +108,7 @@ watch( ...@@ -107,7 +108,7 @@ watch(
} }
} }
); );
const getTimeList = async (PoolAddress) => { const getTimeList = async (PoolAddress: string) => {
if (!props.token) { if (!props.token) {
return; return;
} }
...@@ -120,14 +121,14 @@ const getTimeList = async (PoolAddress) => { ...@@ -120,14 +121,14 @@ const getTimeList = async (PoolAddress) => {
}, },
}) })
.then((result: any) => { .then((result: any) => {
result.vns = '$' + parseNumberToK(result.vns); result.vns = "$" + parseNumberToK(result.vns);
timeMap[current.value] = result; timeMap[current.value] = result;
}); });
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import '@/style/flex.less'; @import "@/style/flex.less";
@import '@/style/variables.less'; @import "@/style/variables.less";
.token-time-range { .token-time-range {
margin-top: 8px; margin-top: 8px;
border-radius: 3px; border-radius: 3px;
...@@ -142,7 +143,7 @@ const getTimeList = async (PoolAddress) => { ...@@ -142,7 +143,7 @@ const getTimeList = async (PoolAddress) => {
background: var(--td--right-back-color-2); background: var(--td--right-back-color-2);
border-radius: 0; border-radius: 0;
margin: 0; margin: 0;
font-family: 'bold'; font-family: "bold";
} }
.active { .active {
background: #287eff; background: #287eff;
...@@ -171,14 +172,14 @@ const getTimeList = async (PoolAddress) => { ...@@ -171,14 +172,14 @@ const getTimeList = async (PoolAddress) => {
color: var(--new-color-7); color: var(--new-color-7);
font-size: 12px; font-size: 12px;
margin-bottom: 6px; margin-bottom: 6px;
font-family: 'Regular'; font-family: "Regular";
} }
.value { .value {
color: var(--td-text-color-primary); color: var(--td-text-color-primary);
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
margin-bottom: 6px; margin-bottom: 6px;
font-family: 'Medium'; font-family: "Medium";
&.new { &.new {
color: #23ab94; color: #23ab94;
} }
......
...@@ -221,7 +221,6 @@ import { ...@@ -221,7 +221,6 @@ import {
IS_HPT_LIST, IS_HPT_LIST,
} from "@/constants/token"; } from "@/constants/token";
import { import {
chain_options,
filterChainObj, filterChainObj,
SwitchCurrency, SwitchCurrency,
} from "@/constants/UnifiedManagementChain"; } from "@/constants/UnifiedManagementChain";
...@@ -229,7 +228,14 @@ import FilterTips from "./FilterTips.vue"; ...@@ -229,7 +228,14 @@ import FilterTips from "./FilterTips.vue";
import ResetSvg from "/public/images/svg/filter/reset.svg"; import ResetSvg from "/public/images/svg/filter/reset.svg";
import SmartSvg from "/public/images/svg/filter/Smart.svg"; import SmartSvg from "/public/images/svg/filter/Smart.svg";
import QuestionSvg from "/public/images/svg/filter/Question.svg"; import QuestionSvg from "/public/images/svg/filter/Question.svg";
import { MessagePlugin } from "tdesign-vue-next"; import {
MessagePlugin,
Option as TOption,
Tooltip as TTooltip,
Switch as TSwitch,
Select as TSelect,
Button as TButton,
} from "tdesign-vue-next";
import SmartAlerts from "./SmartAlerts.vue"; import SmartAlerts from "./SmartAlerts.vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import ChoseChain from "./ChoseChain.vue"; import ChoseChain from "./ChoseChain.vue";
...@@ -289,7 +295,7 @@ const ContractDetection = computed(() => [ ...@@ -289,7 +295,7 @@ const ContractDetection = computed(() => [
// 当前链整个对象数据 // 当前链整个对象数据
const ChainObj = ref(); const ChainObj = ref();
if (route.params.chain) { if (route.params.chain && typeof route.params.chain == "string") {
let Obj = filterChainObj("name", route.params.chain, true); let Obj = filterChainObj("name", route.params.chain, true);
if (Obj) { if (Obj) {
ChainObj.value = Obj; ChainObj.value = Obj;
...@@ -313,12 +319,6 @@ const Reset = () => { ...@@ -313,12 +319,6 @@ const Reset = () => {
MessagePlugin.closeAll(); MessagePlugin.closeAll();
MessagePlugin.success(t("MessagePlugin.resetSuccess")); MessagePlugin.success(t("MessagePlugin.resetSuccess"));
}; };
// 反选按钮
const ReverseBtn = (label: string, value: string) => {
if (formData[label] === value) {
formData[label] = "";
}
};
const allHpt = () => { const allHpt = () => {
Cur_hpt_list.value = []; Cur_hpt_list.value = [];
}; };
...@@ -366,7 +366,7 @@ const filterFn = async () => { ...@@ -366,7 +366,7 @@ const filterFn = async () => {
try { try {
// 是否加入貔貅检测 // 是否加入貔貅检测
if (Cur_hpt_list.value.length) { if (Cur_hpt_list.value.length) {
Cur_hpt_list.value.forEach((item: any) => { Cur_hpt_list.value.forEach((item: string) => {
if (formData.iSHpt == "yes") { if (formData.iSHpt == "yes") {
GlbFilter.value[item] = "1"; GlbFilter.value[item] = "1";
} else { } else {
......
...@@ -4,22 +4,22 @@ ...@@ -4,22 +4,22 @@
<div v-if="poolInfo.length > 0" class="pool-token-info"> <div v-if="poolInfo.length > 0" class="pool-token-info">
<div class="pool-token-header"> <div class="pool-token-header">
<div class="Mating-pool"> <div class="Mating-pool">
<span>{{ $t('tokenInfo.pair') }}</span> <span>{{ $t("tokenInfo.pair") }}</span>
</div> </div>
<div class="Mating-AMM"> <div class="Mating-AMM">
<span>AMM</span> <span>AMM</span>
</div> </div>
<div class="Currency-amount"> <div class="Currency-amount">
<span>{{ $t('tokenInfo.poolCoinNum') }}</span> <span>{{ $t("tokenInfo.poolCoinNum") }}</span>
</div> </div>
<div class="total-turnover"> <div class="total-turnover">
<span>{{ $t('tokenInfo.total') }}</span> <span>{{ $t("tokenInfo.total") }}</span>
</div> </div>
</div> </div>
<div <div
class="pool-token-line" class="pool-token-line"
v-for="(item, index) in poolInfo" v-for="(item, index) in poolInfo"
:key="item" :key="item.address"
@click="switchPool(item, index)" @click="switchPool(item, index)"
> >
<div <div
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
{{ item.swap }} {{ item.swap }}
</div> </div>
<div class="balance-info"> <div class="balance-info">
<span>{{ item.total?.ub ?? '--' }}</span> <span>{{ item.total?.ub ?? "--" }}</span>
</div> </div>
<div class="liquidity-info"> <div class="liquidity-info">
{{ item.total?.vn ?? '--' }} {{ item.total?.vn ?? "--" }}
</div> </div>
</div> </div>
</div> </div>
...@@ -59,26 +59,37 @@ ...@@ -59,26 +59,37 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import TableEmpty from '@/components/TableEmpty.vue'; import TableEmpty from "@/components/TableEmpty.vue";
import request from '@/utils/request'; import request from "@/utils/request";
import { parseNumberToK, parseCoinAmount } from '@/utils/tool'; import { parseNumberToK, parseCoinAmount } from "@/utils/tool";
import { WebS } from '@/utils/TokenTrans'; import { WebS } from "@/utils/TokenTrans";
// import { goDetailK } from '@/utils/router/routerGo'; // import { goDetailK } from '@/utils/router/routerGo';
import { filterChainObj } from '@/constants/UnifiedManagementChain'; import { filterChainObj } from "@/constants/UnifiedManagementChain";
import { Loading as TLoading } from "tdesign-vue-next";
const route = useRoute(); const route = useRoute();
const props = defineProps({ const props = defineProps<{
poolToken: { poolToken: string;
type: String, currentPath: string;
default: () => {}, tb: string;
}, mt: string;
currentPath: String, }>();
tb: String, const emit = defineEmits(["update:address"]);
mt: String, interface PoolListValue {
}); address: string;
const emit = defineEmits(['update:address']); pair: string;
pair1: string;
pair2: string;
swap: string;
total: {
swap: string;
ub: string;
vn: string | number;
type: string;
};
}
// 当前链 // 当前链
const chain = useChain(); const chain = useChain();
const poolInfo = ref([]); const poolInfo = ref<PoolListValue[]>([]);
watch( watch(
() => props.poolToken, () => props.poolToken,
(v) => { (v) => {
...@@ -89,16 +100,16 @@ watch( ...@@ -89,16 +100,16 @@ watch(
} }
); );
const currentPoolValue = ref(); const currentPoolValue = ref();
const currentPoolAddress = ref(''); const currentPoolAddress = ref("");
onMounted(() => { onMounted(() => {
getPoolToken(); getPoolToken();
}); });
// 监听当前流动池 // 监听当前流动池
const monitoring = (index) => { const monitoring = (index: number) => {
if (currentPoolValue.value === index) { if (currentPoolValue.value === index) {
return ''; return "";
} else { } else {
return 'none'; return "none";
} }
}; };
...@@ -107,7 +118,7 @@ const getPoolToken = async () => { ...@@ -107,7 +118,7 @@ const getPoolToken = async () => {
isLoading.value = true; isLoading.value = true;
const res: any = await request.get( const res: any = await request.get(
`/v1${ `/v1${
route.name !== 'tokenIndex' ? props.currentPath : chain.value route.name !== "tokenIndex" ? props.currentPath : chain.value
}/getRightPondInfo`, }/getRightPondInfo`,
{ {
params: { params: {
...@@ -118,35 +129,35 @@ const getPoolToken = async () => { ...@@ -118,35 +129,35 @@ const getPoolToken = async () => {
try { try {
if (res.list.length > 0) { if (res.list.length > 0) {
// 拆分字段内容 // 拆分字段内容
res.list.forEach((item, index) => { res.list.forEach((item: PoolListValue, index: number) => {
if (props.tb.toLowerCase().substr(1) === item.address.toLowerCase()) { if (props.tb.toLowerCase().substr(1) === item.address.toLowerCase()) {
currentPoolValue.value = index; currentPoolValue.value = index;
} }
let pairs = item.pair.split('/'); let pairs = item.pair.split("/");
let pair1 = pairs[0]; let pair1 = pairs[0];
let pair2 = pairs[1]; let pair2 = pairs[1];
item.pair1 = pair1; item.pair1 = pair1;
item.pair2 = pair2; item.pair2 = pair2;
// item.pair_balance = item.pair_balance.toLocaleString(); // item.pair_balance = item.pair_balance.toLocaleString();
if (item.total?.ub) { if (item.total?.ub) {
item.total.ub = '$' + parseNumberToK(item.total.ub); item.total.ub = "$" + parseNumberToK(item.total.ub);
} }
if (item.total?.vn) { if (item.total?.vn) {
if (item.total?.vn.toString().indexOf('e') !== -1) { if (item.total?.vn.toString().indexOf("e") !== -1) {
item.total.vn = parseCoinAmount(item.total?.vn); item.total.vn = parseCoinAmount(item.total?.vn);
} else { } else {
item.total.vn = '$' + Math.round(item.total?.vn); item.total.vn = "$" + Math.round(parseFloat(item.total.vn + ""));
} }
} }
if (item.swap === '') { if (item.swap === "") {
item.swap = 'None'; item.swap = "None";
} }
}); });
poolInfo.value = res.list; poolInfo.value = res.list;
// 判断是哪个池子 // 判断是哪个池子
let index = res.list.findIndex((item: any, index: number) => { let index = res.list.findIndex((item: any, index: number) => {
let tb = let tb =
props.tb[0] === 'd' ? props.tb.slice(1, props.tb.length) : props.tb; props.tb[0] === "d" ? props.tb.slice(1, props.tb.length) : props.tb;
let obj1 = WebS(item.address); let obj1 = WebS(item.address);
let obj2 = WebS(tb); let obj2 = WebS(tb);
return obj1.token === obj2.token; return obj1.token === obj2.token;
...@@ -156,13 +167,14 @@ const getPoolToken = async () => { ...@@ -156,13 +167,14 @@ const getPoolToken = async () => {
isLoading.value = false; isLoading.value = false;
} }
isLoading.value = false; isLoading.value = false;
console.log(poolInfo.value);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
isLoading.value = false; isLoading.value = false;
} }
}; };
// 切换流动池 // 切换流动池
const switchPool = (item, index) => { const switchPool = (item: PoolListValue, index: number) => {
// currentPoolValue.value = index; // currentPoolValue.value = index;
// currentPoolAddress.value = item.address; // currentPoolAddress.value = item.address;
...@@ -170,7 +182,7 @@ const switchPool = (item, index) => { ...@@ -170,7 +182,7 @@ const switchPool = (item, index) => {
if (currentPoolValue.value === index) { if (currentPoolValue.value === index) {
return; return;
} }
let Obj = filterChainObj('value', chain.value); let Obj = filterChainObj("value", chain.value);
// 打开新的流动池 // 打开新的流动池
let params = { let params = {
path: Obj.name, path: Obj.name,
...@@ -180,8 +192,8 @@ const switchPool = (item, index) => { ...@@ -180,8 +192,8 @@ const switchPool = (item, index) => {
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import '@/style/variables.less'; @import "@/style/variables.less";
@import '@/style/flex.less'; @import "@/style/flex.less";
.token-pool-wrapper { .token-pool-wrapper {
margin-top: 12px; margin-top: 12px;
font-size: 12px; font-size: 12px;
...@@ -197,7 +209,7 @@ const switchPool = (item, index) => { ...@@ -197,7 +209,7 @@ const switchPool = (item, index) => {
font-size: @font-size-s; font-size: @font-size-s;
white-space: nowrap; white-space: nowrap;
border-bottom: 1px solid var(--td-component-border); border-bottom: 1px solid var(--td-component-border);
font-family: 'Medium'; font-family: "Medium";
.Mating-pool { .Mating-pool {
width: 28%; width: 28%;
padding-left: 10px; padding-left: 10px;
...@@ -221,7 +233,7 @@ const switchPool = (item, index) => { ...@@ -221,7 +233,7 @@ const switchPool = (item, index) => {
font-size: @font-size-s; font-size: @font-size-s;
padding: 0 6px; padding: 0 6px;
position: relative; position: relative;
font-family: 'Regular'; font-family: "Regular";
.dot-box { .dot-box {
width: 10px; width: 10px;
height: 10px; height: 10px;
......
...@@ -15,6 +15,7 @@ import DeleteSvg from "/public/images/svg/collection/delete.svg"; ...@@ -15,6 +15,7 @@ import DeleteSvg from "/public/images/svg/collection/delete.svg";
import { myCollect } from "@/utils/api"; import { myCollect } from "@/utils/api";
import Animation from "@/components/Animation.vue"; import Animation from "@/components/Animation.vue";
import { loading_background } from "@/constants/global"; import { loading_background } from "@/constants/global";
import { Checkbox as TCheckbox } from "tdesign-vue-next";
import { import {
TableSort, TableSort,
TableSortAsc, TableSortAsc,
...@@ -294,7 +295,7 @@ export default defineComponent({ ...@@ -294,7 +295,7 @@ export default defineComponent({
"" ""
) : ( ) : (
<td class="edit-td"> <td class="edit-td">
<t-checkbox v-model={item.select}></t-checkbox> <TCheckbox v-model={item.select}></TCheckbox>
</td> </td>
)} )}
<td> <td>
...@@ -354,9 +355,9 @@ export default defineComponent({ ...@@ -354,9 +355,9 @@ export default defineComponent({
{!LatestStatus() ? ( {!LatestStatus() ? (
<div class="collection-footer"> <div class="collection-footer">
<div class="check-all"> <div class="check-all">
<t-checkbox v-model={checkAll.value} onChange={onCheckAll}> <TCheckbox v-model={checkAll.value} onChange={onCheckAll}>
{t("collection.selectall")} {t("collection.selectall")}
</t-checkbox> </TCheckbox>
</div> </div>
<div class="delete-collection" onClick={DeleteSelected}> <div class="delete-collection" onClick={DeleteSelected}>
<DeleteSvg></DeleteSvg> <DeleteSvg></DeleteSvg>
......
...@@ -95,7 +95,13 @@ ...@@ -95,7 +95,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { MessagePlugin, InputNumber as TInputNumber } from "tdesign-vue-next"; import {
MessagePlugin,
InputNumber as TInputNumber,
Dialog as TDialog,
Button as TButton,
InputNumberValue,
} from "tdesign-vue-next";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { import {
DatePicker as TDatePicker, DatePicker as TDatePicker,
...@@ -108,9 +114,12 @@ const props = defineProps({ ...@@ -108,9 +114,12 @@ const props = defineProps({
const emit = defineEmits(["update:visible"]); const emit = defineEmits(["update:visible"]);
const dialogVisible = ref(false); const dialogVisible = ref(false);
// input最大值最小值-number类型 // input最大值最小值-number类型
const inputV = reactive({ const inputV = reactive<{
min: null, min: InputNumberValue;
max: null, max: InputNumberValue;
}>({
min: 0,
max: 0,
}); });
// 日期选择 // 日期选择
const CurDate = ref(""); const CurDate = ref("");
...@@ -119,22 +128,27 @@ const time1 = ref(""); ...@@ -119,22 +128,27 @@ const time1 = ref("");
const time2 = ref(""); const time2 = ref("");
const choseTime = ref([0, 0]); const choseTime = ref([0, 0]);
// 记录上次的筛选条件 // 记录上次的筛选条件
const hisfilter = reactive({ const hisfilter = reactive<{
[key: string]: {
min: InputNumberValue;
max: InputNumberValue;
};
}>({
oldtokenNumStr: { oldtokenNumStr: {
min: null, min: 0,
max: null, max: 0,
}, },
vn: { vn: {
min: null, min: 0,
max: null, max: 0,
}, },
up: { up: {
min: null, min: 0,
max: null, max: 0,
}, },
oldsr: { oldsr: {
min: null, min: 0,
max: null, max: 0,
}, },
}); });
const i18n = useI18n(); const i18n = useI18n();
...@@ -143,9 +157,10 @@ watch( ...@@ -143,9 +157,10 @@ watch(
(v) => { (v) => {
dialogVisible.value = v; dialogVisible.value = v;
if (v && props.option && props.option.value !== "ts") { if (v && props.option && props.option.value !== "ts") {
console.log("我执行了");
// 监听打开事件,将对应的筛选条件放入input // 监听打开事件,将对应的筛选条件放入input
inputV.min = hisfilter[props.option.value].min; inputV.min = hisfilter[props.option.value as keyof typeof hisfilter].min;
inputV.max = hisfilter[props.option.value].max; inputV.max = hisfilter[props.option.value as keyof typeof hisfilter].max;
} }
} }
); );
...@@ -157,7 +172,7 @@ const closeDialog = () => { ...@@ -157,7 +172,7 @@ const closeDialog = () => {
}, },
}); });
}; };
const submit = (value) => { const submit = (value: string) => {
if (value !== "ts") { if (value !== "ts") {
if (!inputV.min || !inputV.max) { if (!inputV.min || !inputV.max) {
MessagePlugin.closeAll(); MessagePlugin.closeAll();
...@@ -169,8 +184,8 @@ const submit = (value) => { ...@@ -169,8 +184,8 @@ const submit = (value) => {
return; return;
} }
// 提交前记录本次筛选条件 // 提交前记录本次筛选条件
hisfilter[props.option.value].min = inputV.min; hisfilter[props.option.value as keyof typeof hisfilter]["min"] = inputV.min;
hisfilter[props.option.value].max = inputV.max; hisfilter[props.option.value as keyof typeof hisfilter]["max"] = inputV.max;
emit("update:visible", { emit("update:visible", {
visible: false, visible: false,
value: { value: {
...@@ -213,7 +228,7 @@ const submit = (value) => { ...@@ -213,7 +228,7 @@ const submit = (value) => {
} }
}; };
// 具体时分秒-1 // 具体时分秒-1
const onTimeChange = (value) => { const onTimeChange = (value: string) => {
if (CurDate.value && value) { if (CurDate.value && value) {
// 拼接日期并转换为时间戳 // 拼接日期并转换为时间戳
let date = new Date(CurDate.value + " " + time1.value); let date = new Date(CurDate.value + " " + time1.value);
...@@ -221,7 +236,7 @@ const onTimeChange = (value) => { ...@@ -221,7 +236,7 @@ const onTimeChange = (value) => {
} }
}; };
// 2 // 2
const onTimeChange2 = (value) => { const onTimeChange2 = (value: string) => {
if (CurDate.value && value) { if (CurDate.value && value) {
// 拼接日期并转换为时间戳 // 拼接日期并转换为时间戳
let date = new Date(CurDate.value + " " + time2.value); let date = new Date(CurDate.value + " " + time2.value);
......
import { defineComponent, ref } from 'vue'; import { defineComponent, ref } from "vue";
import { useI18n } from 'vue-i18n'; import { useI18n } from "vue-i18n";
import './index.less'; import "./index.less";
import ConnectCloseSvg from '/public/images/svg/rightDetail/connectClose.svg'; import ConnectCloseSvg from "/public/images/svg/rightDetail/connectClose.svg";
import { filterChainObj, getSwap } from '@/constants/UnifiedManagementChain'; import { filterChainObj, getSwap } from "@/constants/UnifiedManagementChain";
import SubmitTableText from '../submitTableText.vue'; import SubmitTableText from "../submitTableText.vue";
import useSocial from '@/hooks/useSocial'; import useSocial from "@/hooks/useSocial";
import { Popup as TPopup } from "tdesign-vue-next";
export default defineComponent({ export default defineComponent({
props: { props: {
chat: Object as any, chat: Object as any,
token: String, token: String,
}, },
emits: ['update:visible'], emits: ["update:visible"],
setup(props, { emit }) { setup(props, { emit }) {
const DialogVisible = ref(false); const DialogVisible = ref(false);
const chain = useChain(); const chain = useChain();
...@@ -19,19 +20,19 @@ export default defineComponent({ ...@@ -19,19 +20,19 @@ export default defineComponent({
const { otherLink, openSocialLink } = useSocial(); const { otherLink, openSocialLink } = useSocial();
const tokenList = ref([ const tokenList = ref([
{ {
img: '', img: "",
url: '', url: "",
title: 'website', title: "website",
alt: 'website', alt: "website",
label: t('home.ViewContract'), label: t("home.ViewContract"),
}, },
{ {
img: '', img: "",
url: '', url: "",
title: 'Transaction', title: "Transaction",
alt: 'Trading platform', alt: "Trading platform",
label: t('home.TokenTrading'), label: t("home.TokenTrading"),
type: 'default', type: "default",
}, },
]); ]);
// 右侧数据 // 右侧数据
...@@ -49,16 +50,16 @@ export default defineComponent({ ...@@ -49,16 +50,16 @@ export default defineComponent({
// 使用表格里的swap // 使用表格里的swap
tokenList.value[1].img = swapObj.value.img; tokenList.value[1].img = swapObj.value.img;
tokenList.value[1].url = swapObj.value.url; tokenList.value[1].url = swapObj.value.url;
tokenList.value[1].type = 'swap'; tokenList.value[1].type = "swap";
} else { } else {
tokenList.value[1].img = ChainObj.value.url.Transaction.img; tokenList.value[1].img = ChainObj.value.url.Transaction.img;
tokenList.value[1].url = ChainObj.value.url.Transaction.link; tokenList.value[1].url = ChainObj.value.url.Transaction.link;
tokenList.value[1].type = 'default'; tokenList.value[1].type = "default";
} }
}; };
// 更换交易平台及官方浏览器 // 更换交易平台及官方浏览器
const changeLink = () => { const changeLink = () => {
ChainObj.value = filterChainObj('value', chain.value); ChainObj.value = filterChainObj("value", chain.value);
// 更换图标和链接 // 更换图标和链接
// 官方浏览器 // 官方浏览器
tokenList.value[0].img = ChainObj.value.url.website.img; tokenList.value[0].img = ChainObj.value.url.website.img;
...@@ -104,14 +105,14 @@ export default defineComponent({ ...@@ -104,14 +105,14 @@ export default defineComponent({
return ( return (
<div class="custom-submit-info-dialog-box"> <div class="custom-submit-info-dialog-box">
<div class="submit-info-title"> <div class="submit-info-title">
<span class="label">{t('home.Connect')}</span> <span class="label">{t("home.Connect")}</span>
<span onClick={closeDialog} class="close-icon"> <span onClick={closeDialog} class="close-icon">
<ConnectCloseSvg></ConnectCloseSvg> <ConnectCloseSvg></ConnectCloseSvg>
</span> </span>
</div> </div>
<div class="submit-info-body"> <div class="submit-info-body">
<div class="body-left"> <div class="body-left">
<div class="label">{t('home.token2')}</div> <div class="label">{t("home.token2")}</div>
{tokenList.value.map((item: any) => ( {tokenList.value.map((item: any) => (
<div> <div>
<div <div
...@@ -122,7 +123,7 @@ export default defineComponent({ ...@@ -122,7 +123,7 @@ export default defineComponent({
<img <img
src={item.img} src={item.img}
alt="" alt=""
class={[item.url ? '' : 'active']} class={[item.url ? "" : "active"]}
/> />
<span>{item.label}</span> <span>{item.label}</span>
</div> </div>
...@@ -130,7 +131,7 @@ export default defineComponent({ ...@@ -130,7 +131,7 @@ export default defineComponent({
))} ))}
</div> </div>
<div class="body-right"> <div class="body-right">
<div class="label">{t('home.info')}</div> <div class="label">{t("home.info")}</div>
{otherLink.value.map((item: any) => ( {otherLink.value.map((item: any) => (
<div <div
class="value" class="value"
...@@ -140,7 +141,7 @@ export default defineComponent({ ...@@ -140,7 +141,7 @@ export default defineComponent({
<img <img
src={item.img} src={item.img}
alt="" alt=""
class={[item.url ? '' : 'active']} class={[item.url ? "" : "active"]}
/> />
<span>{item.label}</span> <span>{item.label}</span>
</div> </div>
...@@ -155,7 +156,7 @@ export default defineComponent({ ...@@ -155,7 +156,7 @@ export default defineComponent({
DialogVisible.value = visible; DialogVisible.value = visible;
}; };
return () => ( return () => (
<t-popup <TPopup
content={popupContent} content={popupContent}
placement="bottom-left" placement="bottom-left"
trigger="click" trigger="click"
...@@ -164,12 +165,11 @@ export default defineComponent({ ...@@ -164,12 +165,11 @@ export default defineComponent({
onVisibleChange={onVisibleChange} onVisibleChange={onVisibleChange}
> >
<img <img
placement="top"
class="social-img" class="social-img"
src="/images/svg/rightDetail/more.svg" src="/images/svg/rightDetail/more.svg"
alt="more" alt="more"
/> />
</t-popup> </TPopup>
); );
}, },
}); });
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
<div class="left-token-name"> <div class="left-token-name">
<div class="token-name-child"> <div class="token-name-child">
<template v-if="getImg"> <template v-if="getImg">
<img :src="getImg" alt="swap" v-image /> <ClientOnly>
<img :src="getImg" alt="swap" v-image />
</ClientOnly>
</template> </template>
<template v-else> <template v-else>
<AvatarVue <AvatarVue
...@@ -218,7 +220,7 @@ const getImg = computed(() => { ...@@ -218,7 +220,7 @@ const getImg = computed(() => {
border-radius: 50%; border-radius: 50%;
} }
:not(:first-child) { & > :last-child {
margin-left: 10px; margin-left: 10px;
} }
.avatar-icon { .avatar-icon {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import AscSvg from "/public/images/svg/collection/asc.svg"; import AscSvg from "/public/images/svg/collection/asc.svg";
import DescSvg from "/public/images/svg/collection/desc.svg"; import DescSvg from "/public/images/svg/collection/desc.svg";
import { Tooltip as TTooltip } from "tdesign-vue-next";
const props = defineProps({ const props = defineProps({
sort: String, sort: String,
field: String, field: String,
......
...@@ -51,6 +51,10 @@ import { ...@@ -51,6 +51,10 @@ import {
MessagePlugin, MessagePlugin,
Form as TForm, Form as TForm,
FormItem as TFormItem, FormItem as TFormItem,
Input as TInput,
Button as TButton,
FormRule,
SubmitContext,
} from "tdesign-vue-next"; } from "tdesign-vue-next";
import md5 from "md5"; import md5 from "md5";
...@@ -67,7 +71,7 @@ const backCenter = () => { ...@@ -67,7 +71,7 @@ const backCenter = () => {
emit("backPersonal", true); emit("backPersonal", true);
}; };
// 数据校验 // 数据校验
const repasswordValidator = (value) => { const repasswordValidator = (value: string) => {
if (formData.password === value) { if (formData.password === value) {
return { result: true }; return { result: true };
} else { } else {
...@@ -78,14 +82,14 @@ const FORM_RULES = { ...@@ -78,14 +82,14 @@ const FORM_RULES = {
password: [ password: [
{ required: true, message: "密码必填", type: "error" }, { required: true, message: "密码必填", type: "error" },
{ min: 6, message: "至少需要6位", type: "error" }, { min: 6, message: "至少需要6位", type: "error" },
], ] as FormRule[],
password_confirmation: [ password_confirmation: [
{ required: true, message: "确认密码必填", type: "error" }, { required: true, message: "确认密码必填", type: "error" },
{ validator: repasswordValidator }, { validator: repasswordValidator },
], ] as FormRule[],
}; };
// 提交 // 提交
const onSubmit = async ({ validateResult }) => { const onSubmit = async ({ validateResult }: SubmitContext) => {
if (validateResult === true) { if (validateResult === true) {
const res: any = await request.post( const res: any = await request.post(
"/api/user/edit/password", "/api/user/edit/password",
......
...@@ -42,7 +42,11 @@ ...@@ -42,7 +42,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Divider as TDivider } from "tdesign-vue-next"; import {
Divider as TDivider,
Dialog as TDialog,
Button as TButton,
} from "tdesign-vue-next";
import comfirmDialog from "@/views/CustomComponent/comfirmDialog.vue"; import comfirmDialog from "@/views/CustomComponent/comfirmDialog.vue";
const props = defineProps({ const props = defineProps({
InvitedVisible: Boolean, InvitedVisible: Boolean,
......
...@@ -76,7 +76,12 @@ import CopySvg from "/public/images/svg/header/copy.svg"; ...@@ -76,7 +76,12 @@ import CopySvg from "/public/images/svg/header/copy.svg";
import comfirmDialog from "@/views/CustomComponent/comfirmDialog.vue"; import comfirmDialog from "@/views/CustomComponent/comfirmDialog.vue";
import ChangePassword from "./ChangePassword.vue"; import ChangePassword from "./ChangePassword.vue";
import request from "@/utils/request"; import request from "@/utils/request";
import { MessagePlugin } from "tdesign-vue-next"; import {
MessagePlugin,
Input as TInput,
Tooltip as TTooltip,
Button as TButton,
} from "tdesign-vue-next";
const route = useRoute(); const route = useRoute();
const userInfo = useTokenInfo(); const userInfo = useTokenInfo();
const Cookie = useCookie("userCookie"); const Cookie = useCookie("userCookie");
......
...@@ -139,7 +139,11 @@ import InvitedDialog from "./InvitedDialog.vue"; ...@@ -139,7 +139,11 @@ import InvitedDialog from "./InvitedDialog.vue";
import RecordDialog from "./recordDialog.vue"; import RecordDialog from "./recordDialog.vue";
import request from "@/utils/request"; import request from "@/utils/request";
import useCopy from "@/hooks/useCopy"; import useCopy from "@/hooks/useCopy";
import { InputNumber as TInputNumber } from "tdesign-vue-next"; import {
InputNumber as TInputNumber,
Dialog as TDialog,
Button as TButton,
} from "tdesign-vue-next";
import QrCodeDialog from "@/views/CustomComponent/QrCodeDialog.vue"; import QrCodeDialog from "@/views/CustomComponent/QrCodeDialog.vue";
const { doCopy } = useCopy(); const { doCopy } = useCopy();
const Cookie = useCookie("userCookie"); const Cookie = useCookie("userCookie");
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
> >
<template #body> <template #body>
<div class="logout-body"> <div class="logout-body">
<p class="title">{{ $t('user.LogoutSure') }}</p> <p class="title">{{ $t("user.LogoutSure") }}</p>
<div class="comfim"> <div class="comfim">
<t-button @click="DetermineT">{{ $t('user.Confirm') }}</t-button> <t-button @click="DetermineT">{{ $t("user.Confirm") }}</t-button>
<t-button class="Cancel" @click="closeLogout">{{ <t-button class="Cancel" @click="closeLogout">{{
$t('user.Cancel') $t("user.Cancel")
}}</t-button> }}</t-button>
</div> </div>
</div> </div>
...@@ -20,15 +20,16 @@ ...@@ -20,15 +20,16 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Dialog as TDialog, Button as TButton } from "tdesign-vue-next";
const visible = ref(true); const visible = ref(true);
const Cookie = useCookie('userCookie'); const Cookie = useCookie("userCookie");
const ChangeRouter = useChangeRouter(); const ChangeRouter = useChangeRouter();
// 退出登录 // 退出登录
const DetermineT = () => { const DetermineT = () => {
Cookie.value = ''; Cookie.value = "";
// 通知tab切换路由 // 通知tab切换路由
ChangeRouter.value.name = 'personal'; ChangeRouter.value.name = "personal";
ChangeRouter.value.path = '/user/personal'; ChangeRouter.value.path = "/user/personal";
ChangeRouter.value.id += 1; ChangeRouter.value.id += 1;
visible.value = false; visible.value = false;
// 清空Cookie // 清空Cookie
...@@ -36,16 +37,16 @@ const DetermineT = () => { ...@@ -36,16 +37,16 @@ const DetermineT = () => {
// 取消 // 取消
const closeLogout = () => { const closeLogout = () => {
// 通知tab切换路由 // 通知tab切换路由
ChangeRouter.value.name = 'personal'; ChangeRouter.value.name = "personal";
ChangeRouter.value.path = '/user/personal'; ChangeRouter.value.path = "/user/personal";
ChangeRouter.value.id += 1; ChangeRouter.value.id += 1;
visible.value = false; visible.value = false;
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '@/style/variables.less'; @import "@/style/variables.less";
@import '@/style/flex.less'; @import "@/style/flex.less";
:deep(.t-dialog) { :deep(.t-dialog) {
.t-dialog__body { .t-dialog__body {
padding-bottom: 16px; padding-bottom: 16px;
......
...@@ -82,7 +82,12 @@ ...@@ -82,7 +82,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import PayFox from "./payFox.vue"; import PayFox from "./payFox.vue";
import request from "@/utils/request"; import request from "@/utils/request";
import { MessagePlugin, Divider as TDivider } from "tdesign-vue-next"; import {
MessagePlugin,
Divider as TDivider,
Input as TInput,
Button as TButton,
} from "tdesign-vue-next";
// 用户信息 // 用户信息
const userInfo = useTokenInfo(); const userInfo = useTokenInfo();
// 用户token // 用户token
......
...@@ -43,32 +43,36 @@ ...@@ -43,32 +43,36 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import request from '@/utils/request'; import request from "@/utils/request";
import { MessagePlugin } from 'tdesign-vue-next'; import {
const props = defineProps({ MessagePlugin,
hasPayDialog: Boolean, Dialog as TDialog,
price: String, Button as TButton,
}); } from "tdesign-vue-next";
const props = defineProps<{
hasPayDialog: boolean;
price: string;
}>();
// 用户交易地址 // 用户交易地址
const userAddress = useUserAddress(); const userAddress = useUserAddress();
// 用户token // 用户token
const userToken = useUserToken(); const userToken = useUserToken();
// 用户所有信息 // 用户所有信息
const userInfo = useTokenInfo(); const userInfo = useTokenInfo();
const emit = defineEmits(['closePayDialog']); const emit = defineEmits(["closePayDialog"]);
const closeDialog = () => { const closeDialog = () => {
emit('closePayDialog', false); emit("closePayDialog", false);
// console.log(userToken.value); // console.log(userToken.value);
}; };
// 交易轮询 // 交易轮询
let Interval: any = null; let Interval: any = null;
// 默认的选择币 // 默认的选择币
const defaBtn = ref({ const defaBtn = ref({
label: 'BUSD', label: "BUSD",
value: 1, value: 1,
}); });
// 收款地址--先写死,之后从接口获取 // 收款地址--先写死,之后从接口获取
let MyAddress = '0x1601f342dBfbf76d27Fe35C09fFfEa7bfCCaE4b5'; let MyAddress = "0x1601f342dBfbf76d27Fe35C09fFfEa7bfCCaE4b5";
const moring = computed((label: string) => { const moring = computed((label: string) => {
return function (label: string) { return function (label: string) {
return defaBtn.value.label === label; return defaBtn.value.label === label;
...@@ -77,19 +81,19 @@ const moring = computed((label: string) => { ...@@ -77,19 +81,19 @@ const moring = computed((label: string) => {
// img // img
const Imgs = [ const Imgs = [
{ {
img: '/images/svg/user/usdt.svg', img: "/images/svg/user/usdt.svg",
value: 'USDT', value: "USDT",
address: '0x55d398326f99059fF775485246999027B3197955', address: "0x55d398326f99059fF775485246999027B3197955",
}, },
{ {
img: '/images/svg/user/busd.svg', img: "/images/svg/user/busd.svg",
value: 'BUSD', value: "BUSD",
address: '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56', address: "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
}, },
{ {
img: '/images/svg/user/usdc.svg', img: "/images/svg/user/usdc.svg",
value: 'USDC', value: "USDC",
address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
}, },
]; ];
// 切换支付方式 // 切换支付方式
...@@ -101,7 +105,7 @@ const changeb = (label: string, index: number) => { ...@@ -101,7 +105,7 @@ const changeb = (label: string, index: number) => {
const recharge = (hash: string, price: number) => { const recharge = (hash: string, price: number) => {
request request
.post( .post(
'/api/recharge', "/api/recharge",
{ {
hash: hash, hash: hash,
amount: price, amount: price,
...@@ -119,7 +123,7 @@ const recharge = (hash: string, price: number) => { ...@@ -119,7 +123,7 @@ const recharge = (hash: string, price: number) => {
} }
) )
.then((res: any) => { .then((res: any) => {
if (res.code === 2 && 'token' in res.data) { if (res.code === 2 && "token" in res.data) {
userToken.value = res.data.token; userToken.value = res.data.token;
} }
}); });
...@@ -128,18 +132,18 @@ const recharge = (hash: string, price: number) => { ...@@ -128,18 +132,18 @@ const recharge = (hash: string, price: number) => {
const Payment = () => { const Payment = () => {
let eth: any = window; let eth: any = window;
// 转换后的收款地址 // 转换后的收款地址
let MyNewAddress = MyAddress.substring(2).padStart(64, '0'); let MyNewAddress = MyAddress.substring(2).padStart(64, "0");
// 实际价格--props.price // 实际价格--props.price
// 测试价格 // 测试价格
// let price = 0.01; // let price = 0.01;
// 转换后的价格 // 转换后的价格
let newPrice = (parseInt(props.price) * Math.pow(10, 18)) let newPrice = (parseInt(props.price) * Math.pow(10, 18))
.toString(16) .toString(16)
.padStart(64, '0'); .padStart(64, "0");
// 小狐狸支付 // 小狐狸支付
eth.ethereum eth.ethereum
.request({ .request({
method: 'eth_sendTransaction', method: "eth_sendTransaction",
params: [ params: [
{ {
// 用户钱包地址 // 用户钱包地址
...@@ -150,11 +154,11 @@ const Payment = () => { ...@@ -150,11 +154,11 @@ const Payment = () => {
// gasPrice: "0x12a05f200", // gasPrice: "0x12a05f200",
// gas: "0x16e360", // gas: "0x16e360",
// 交易数据十六进制 交易0xa9059cbb 目标钱包地址(我们的钱包地址) 交易金额(十六转换) // 交易数据十六进制 交易0xa9059cbb 目标钱包地址(我们的钱包地址) 交易金额(十六转换)
data: '0xa9059cbb' + MyNewAddress + newPrice, data: "0xa9059cbb" + MyNewAddress + newPrice,
}, },
], ],
}) })
.then((hash) => { .then((hash: string) => {
// 交易hash // 交易hash
if (hash) { if (hash) {
// 发送充值信息 // 发送充值信息
...@@ -163,7 +167,7 @@ const Payment = () => { ...@@ -163,7 +167,7 @@ const Payment = () => {
Interval = setInterval(() => { Interval = setInterval(() => {
request request
.post( .post(
'/api/recharge/check', "/api/recharge/check",
{ {
hash: hash, hash: hash,
}, },
...@@ -175,27 +179,27 @@ const Payment = () => { ...@@ -175,27 +179,27 @@ const Payment = () => {
) )
.then((res: any) => { .then((res: any) => {
if (res.data.status == 1) { if (res.data.status == 1) {
MessagePlugin.success('支付成功'); MessagePlugin.success("支付成功");
// 关闭轮询 // 关闭轮询
clearInterval(Interval); clearInterval(Interval);
// 关闭弹窗 // 关闭弹窗
emit('closePayDialog', false); emit("closePayDialog", false);
} else if (res.code === 2 && 'token' in res.data) { } else if (res.code === 2 && "token" in res.data) {
userToken.value = res.data.token; userToken.value = res.data.token;
} }
}); });
}, 2000); }, 2000);
} }
}) })
.catch((e) => { .catch((e: any) => {
// 关闭轮询 // 关闭轮询
clearInterval(Interval); clearInterval(Interval);
if (e.code == -32602) { if (e.code == -32602) {
MessagePlugin.closeAll(); MessagePlugin.closeAll();
MessagePlugin.warning('未连接钱包'); MessagePlugin.warning("未连接钱包");
} else { } else {
MessagePlugin.closeAll(); MessagePlugin.closeAll();
MessagePlugin.warning('交易关闭'); MessagePlugin.warning("交易关闭");
} }
}); });
// //
...@@ -207,8 +211,8 @@ onMounted(() => { ...@@ -207,8 +211,8 @@ onMounted(() => {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import '@/style/flex.less'; @import "@/style/flex.less";
@import '@/style/variables.less'; @import "@/style/variables.less";
.pay-dialog-box { .pay-dialog-box {
:deep(.t-dialog) { :deep(.t-dialog) {
width: 420px; width: 420px;
......
...@@ -68,7 +68,11 @@ ...@@ -68,7 +68,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { Table as TTable } from "tdesign-vue-next"; import {
Table as TTable,
Dialog as TDialog,
Button as TButton,
} from "tdesign-vue-next";
import QrCodeDialog from "@/views/CustomComponent/QrCodeDialog.vue"; import QrCodeDialog from "@/views/CustomComponent/QrCodeDialog.vue";
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
......
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