From 88f97c892a9907e035eb6292cb8bd2b86d4ec5c8 Mon Sep 17 00:00:00 2001 From: liaoxinyu Date: Fri, 29 May 2026 10:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=82=A1=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/market.js | 5 +- src/assets/scss/base/_common.scss | 2 +- src/assets/scss/theme/_dark.scss | 30 ++++- src/i18n/de.json | 2 +- src/i18n/en.json | 2 +- src/i18n/fra.json | 2 +- src/i18n/it.json | 2 +- src/i18n/jp.json | 2 +- src/i18n/kor.json | 2 +- src/i18n/pt.json | 2 +- src/i18n/spa.json | 2 +- src/i18n/tr.json | 2 +- src/i18n/tw.json | 2 +- src/views/exchangeStock/book-trades.vue | 13 +- src/views/exchangeStock/index.vue | 47 +++++-- src/views/exchangeStock/make-deal.vue | 158 ++++++++++++++++++++---- src/views/exchangeStock/order-list.vue | 20 +-- 17 files changed, 231 insertions(+), 64 deletions(-) diff --git a/src/api/market.js b/src/api/market.js index e43c7ea..7fa807b 100644 --- a/src/api/market.js +++ b/src/api/market.js @@ -63,7 +63,10 @@ class Market { static getstockCoinInfo(params) { return server.get(`/stock/getCoinInfo`,{ params }); } - + // 是否显示颜色 + static getstocktradingOpen(params) { + return server.get(`/stock/tradingOpen`,{ params }); + } } export default Market; \ No newline at end of file diff --git a/src/assets/scss/base/_common.scss b/src/assets/scss/base/_common.scss index 07512f0..2864dfd 100644 --- a/src/assets/scss/base/_common.scss +++ b/src/assets/scss/base/_common.scss @@ -151,7 +151,7 @@ } .table td, .table th { - border-top: 1px solid #4e4e5d; + // border-top: 1px solid #4e4e5d; } .input-group-text { diff --git a/src/assets/scss/theme/_dark.scss b/src/assets/scss/theme/_dark.scss index 512ef8b..a826c5e 100644 --- a/src/assets/scss/theme/_dark.scss +++ b/src/assets/scss/theme/_dark.scss @@ -192,8 +192,8 @@ } #dark .market-trade { - border: 1px solid #2a2e39; - background: #131722; + // border: 1px solid #2a2e39; + // background: #131722; } #dark .market-trade .nav .nav-item .nav-link.active { @@ -744,4 +744,30 @@ #dark .account_card{ background-color: #161c3c; // border: 1px solid #202951; +} +#dark .exchange-history .nav{ + background: #121212; +} +#dark .market-order{ + border: 1px solid #404040; +} +#dark .ob-heading { + border: 1px solid #333; + box-shadow: 0 0 5px #555; +} +#dark .Tab_sell1{ + color: #ffffff; +} +#dark .Tab_buy1{ + color: #ffffff; +} +#dark .input-group-text{ + border: 1px solid #404040; + background-color: #121212; +} +#dark .form-control{ + background-color: #121212; +} +#dark .market-trade p{ + color: #e7e7e7; } \ No newline at end of file diff --git a/src/i18n/de.json b/src/i18n/de.json index 8d47eb2..e249b06 100644 --- a/src/i18n/de.json +++ b/src/i18n/de.json @@ -1133,7 +1133,7 @@ "hh15": "Nachrichten", "hh16": "Entdecken", "hh17": "Jetzt mit dem Mining beginnen", - "hh18": "Registrieren Sie sich jetzt bei Bonds, um die aktuellsten Nachrichten zu erhalten und sofort mit dem Mining zu starten.", + "hh18": "Registrieren Sie sich jetzt bei Muzkcoin, um die aktuellsten Nachrichten zu erhalten und sofort mit dem Mining zu starten.", "hh19": "E-Mail-Adresse eingeben", "hh20": "Abonnieren", "hh21": "Alle anzeigen", diff --git a/src/i18n/en.json b/src/i18n/en.json index 4c5d399..3968520 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1236,7 +1236,7 @@ "hh15": "News", "hh16": "Explore", "hh17": "Start mining now", - "hh18": "Join now with Bonds to get the latest news and start mining now", + "hh18": "Join now with Muzkcoin to get the latest news and start mining now", "hh19": "Enter your email", "hh20": "Subscribe", "hh21": "See All", diff --git a/src/i18n/fra.json b/src/i18n/fra.json index e5fca30..b1a69ff 100644 --- a/src/i18n/fra.json +++ b/src/i18n/fra.json @@ -1133,7 +1133,7 @@ "hh15": "Actualités", "hh16": "Explorer", "hh17": "Commencez le minage dès maintenant", - "hh18": "Rejoignez Bonds dès maintenant pour recevoir les dernières actualités et commencer le minage sans attendre.", + "hh18": "Rejoignez Muzkcoin dès maintenant pour recevoir les dernières actualités et commencer le minage sans attendre.", "hh19": "Saisissez votre e-mail", "hh20": "S'abonner", "hh21": "Tout voir", diff --git a/src/i18n/it.json b/src/i18n/it.json index 2e17921..eb63749 100644 --- a/src/i18n/it.json +++ b/src/i18n/it.json @@ -1132,7 +1132,7 @@ "hh15": "Notizie", "hh16": "Esplora", "hh17": "Inizia il mining ora", - "hh18": "Iscriviti ora con Bonds per ricevere le ultime notizie e iniziare subito il mining", + "hh18": "Iscriviti ora con Muzkcoin per ricevere le ultime notizie e iniziare subito il mining", "hh19": "Inserisci la tua email", "hh20": "Iscriviti", "hh21": "Vedi tutto", diff --git a/src/i18n/jp.json b/src/i18n/jp.json index 85649c2..dac8d98 100644 --- a/src/i18n/jp.json +++ b/src/i18n/jp.json @@ -1131,7 +1131,7 @@ "hh15": "ニュース", "hh16": "探索する", "hh17": "今すぐマイニングを開始", - "hh18": "Bondsに今すぐ登録して、最新ニュースを受け取り、マイニングを始めましょう。", + "hh18": "Muzkcoinに今すぐ登録して、最新ニュースを受け取り、マイニングを始めましょう。", "hh19": "メールアドレスを入力", "hh20": "購読する", "hh21": "すべて見る", diff --git a/src/i18n/kor.json b/src/i18n/kor.json index ddddb93..0c52553 100644 --- a/src/i18n/kor.json +++ b/src/i18n/kor.json @@ -1131,7 +1131,7 @@ "hh15": "뉴스", "hh16": "둘러보기", "hh17": "지금 채굴 시작하기", - "hh18": "Bonds에 지금 가입하고 최신 뉴스를 받아보며 채굴을 시작하세요", + "hh18": "Muzkcoin에 지금 가입하고 최신 뉴스를 받아보며 채굴을 시작하세요", "hh19": "이메일 주소 입력", "hh20": "구독하기", "hh21": "전체 보기", diff --git a/src/i18n/pt.json b/src/i18n/pt.json index 3e7a3af..ce18a04 100644 --- a/src/i18n/pt.json +++ b/src/i18n/pt.json @@ -1132,7 +1132,7 @@ "hh15": "Notícias", "hh16": "Explorar", "hh17": "Comece a minerar agora", - "hh18": "Cadastre-se agora na Bonds para receber as últimas notícias e começar a minerar imediatamente", + "hh18": "Cadastre-se agora na Muzkcoin para receber as últimas notícias e começar a minerar imediatamente", "hh19": "Insira seu e-mail", "hh20": "Assinar", "hh21": "Ver Tudo", diff --git a/src/i18n/spa.json b/src/i18n/spa.json index 2f8341e..12b6304 100644 --- a/src/i18n/spa.json +++ b/src/i18n/spa.json @@ -1132,7 +1132,7 @@ "hh15": "Noticias", "hh16": "Explorar", "hh17": "Empieza a minar ahora", - "hh18": "Únete ahora con Bonds para recibir las últimas noticias y empezar a minar de inmediato.", + "hh18": "Únete ahora con Muzkcoin para recibir las últimas noticias y empezar a minar de inmediato.", "hh19": "Introduce tu correo electrónico", "hh20": "Suscribirse", "hh21": "Ver todo", diff --git a/src/i18n/tr.json b/src/i18n/tr.json index 8fd76d9..496e578 100644 --- a/src/i18n/tr.json +++ b/src/i18n/tr.json @@ -1132,7 +1132,7 @@ "hh15": "Haberler", "hh16": "Keşfet", "hh17": "Hemen madenciliğe başla", - "hh18": "En son haberleri almak ve hemen madenciliğe başlamak için Bonds'a şimdi katılın", + "hh18": "En son haberleri almak ve hemen madenciliğe başlamak için Muzkcoin'a şimdi katılın", "hh19": "E-posta adresinizi girin", "hh20": "Abone Ol", "hh21": "Tümünü Gör", diff --git a/src/i18n/tw.json b/src/i18n/tw.json index bc6d80f..77496f4 100644 --- a/src/i18n/tw.json +++ b/src/i18n/tw.json @@ -1166,7 +1166,7 @@ "hh15": "新聞資訊", "hh16": "探索", "hh17": "立即開始挖礦", - "hh18": "立即加入 Bonds,取得最新資訊並開始挖礦", + "hh18": "立即加入 Muzkcoin,取得最新資訊並開始挖礦", "hh19": "輸入您的電子郵件", "hh20": "訂閱", "hh21": "全部", diff --git a/src/views/exchangeStock/book-trades.vue b/src/views/exchangeStock/book-trades.vue index b1c7100..f55cd13 100644 --- a/src/views/exchangeStock/book-trades.vue +++ b/src/views/exchangeStock/book-trades.vue @@ -19,12 +19,12 @@
- + {{ item.price|omitTo(priceDecimals) }} - {{ item.amount|omitTo(qtyDecimals) }} + {{ item.amount|omitTo(qtyDecimals) }} {{ item.price|multiple(item.amount, priceDecimals) }}
@@ -61,12 +61,12 @@
- + {{ item.price|omitTo(priceDecimals) }} - {{ item.amount|omitTo(qtyDecimals) }} + {{ item.amount|omitTo(qtyDecimals) }} {{ item.price|multiple(item.amount, priceDecimals) }}
@@ -310,6 +310,7 @@ export default { left: 0; top: 0; height: 100%; + width: 100%; z-index: 100; cursor: pointer; @@ -381,8 +382,8 @@ export default { \ No newline at end of file diff --git a/src/views/exchangeStock/make-deal.vue b/src/views/exchangeStock/make-deal.vue index 79fc1cf..53a748b 100644 --- a/src/views/exchangeStock/make-deal.vue +++ b/src/views/exchangeStock/make-deal.vue @@ -62,7 +62,7 @@ -
+

{{$t('nav.c12')}}

{{$t('order.buy')}}
@@ -191,7 +191,8 @@ {{ $t('exchange.balance') }} {{fromBalance}} {{pair.from}}

- + +
@@ -237,7 +238,8 @@ - {{ msgList.sell[2] }} + + {{ msgList.sell[4] }}
@@ -272,7 +274,8 @@ {{ $t('exchange.balance') }} {{fromBalance}} {{pair.from}}

- + +
@@ -298,6 +301,11 @@ export default { cacheTotal: 0, // 存放市价单输入的总值 cachePrice: null, // 存放最新价格 + + timeoutId: null, + intervalId: null, + tradingOpenshow:false, + timer: null, // 气泡弹框内容和触发 visibles: { @@ -375,8 +383,9 @@ export default { if (!this.isMarket) { this.buyorder.amount = Math.division(val, this.buyorder.entrust_price); } else { // 市价单 缓存总值 - this.cacheTotal = val; - this.buyorder.amount = this.cacheTotal + // this.cacheTotal = val; + // this.buyorder.amount = this.cacheTotal + this.buyorder.amount = Math.division(val, this.buyorder.entrust_price,6); } } }, @@ -453,6 +462,91 @@ export default { }); }, + + + tradingOpen(){ + Market.getstocktradingOpen().then(res => { + // console.log(res); + this.tradingOpenshow = res + }).catch(err => {}); + }, + // 开启定时任务逻辑 + startSchedule() { + // const now = new Date(); + // const minutes = now.getMinutes(); + // const seconds = now.getSeconds(); + // const milliseconds = now.getMilliseconds(); + + // let msUntilNextTime = 0; // 距离下一次调用的毫秒数 + + // // 计算距离下一个 00分 或 30分 还有多久 + // if (minutes < 30) { + // // 当前在 0~29 分之间,目标是 30 分 + // msUntilNextTime = (30 - minutes) * 60000 - seconds * 1000 - milliseconds; + // } else { + // // 当前在 30~59 分之间,目标是下一个 00 分 (60分) + // msUntilNextTime = (60 - minutes) * 60000 - seconds * 1000 - milliseconds; + // } + + // console.log(`距离下次刷新还有 ${Math.round(msUntilNextTime / 1000)} 秒`); + + // // 1. 先用 setTimeout 等待到下一个整点或半点 + // this.timeoutId = setTimeout(() => { + // // 到达整点/半点,执行一次请求 + // this.tradingOpen(); + + // // 2. 之后开启 setInterval,每隔固定的 30 分钟执行一次 + // const THIRTY_MINUTES_MS = 30 * 60 * 1000; + // this.intervalId = setInterval(() => { + // this.tradingOpen(); + // }, THIRTY_MINUTES_MS); + + // }, msUntilNextTime); + + this.timer = setInterval(() => { + const now = new Date(); + const minutes = now.getMinutes(); + const seconds = now.getSeconds(); + + let remainingSeconds = 0; + + // 1. 如果正好是 00分00秒 或 30分00秒,说明时间到了! + if (minutes % 30 === 0 && seconds === 0) { + remainingSeconds = 0; + console.log(`距离下次刷新还有 ${remainingSeconds} 秒,正在执行刷新...`); + + // 触发接口调用 + this.tradingOpen(); + } + // 2. 否则,计算距离下一次刷新的秒数 + else { + if (minutes < 30) { + // 如果当前是 0~29 分,目标是 30 分 + remainingSeconds = (30 - minutes) * 60 - seconds; + } else { + // 如果当前是 30~59 分,目标是 60 分 (下一个整点) + remainingSeconds = (60 - minutes) * 60 - seconds; + } + + // 一直打印倒计时提示 + // console.log(`距离下次刷新还有 ${remainingSeconds} 秒`); + } + }, 1000); + }, + + // 清除定时器的方法 + // clearSchedule() { + // if (this.timeoutId) { + // clearTimeout(this.timeoutId); + // this.timeoutId = null; + // } + // if (this.intervalId) { + // clearInterval(this.intervalId); + // this.intervalId = null; + // } + // }, + + renderBuyAmount(val, index) { // console.Info(val) // console.Info(this.buyorder) @@ -645,10 +739,12 @@ export default { if (this.empty(order.amount)) { flag = false; this.visibles[orderType].marketAmount = true; + this.visibles[orderType].limitAmount = true; this.msgList[orderType][4] = this.$t('nav.a6'); } else if (order.amount < this.minQty) { flag = false; this.visibles[orderType].marketAmount = true; + this.visibles[orderType].limitAmount = true; this.msgList[orderType][4] = this.$t('nav.a7')+` ${this.minQty}`; } } @@ -717,9 +813,18 @@ export default { created() { this.getCoinInfo() + + this.tradingOpen() + this.startSchedule(); + this.reset(); }, - + beforeDestroy() { + // this.clearSchedule(); + if (this.timer) { + clearInterval(this.timer); + } + }, } @@ -785,7 +890,7 @@ export default { .Tab_buy1{ width: 50%; height: 40px; - color: #000; + color: #000000; line-height: 40px; text-align: center; border-radius: 40px; @@ -802,23 +907,32 @@ export default { .Tab_sell1{ width: 50%; height: 40px; - // color: #ffffff; + color: #000000; line-height: 40px; text-align: center; border-radius: 40px; } -// .market-trade input{ -// border: 1px solid #404040; -// } -// .input-group-text{ -// border: 1px solid #404040; -// background-color: #121212; -// } -// .form-control{ -// background-color: #121212; -// } -// .market-trade p{ -// color: #e7e7e7; -// } +.market-trade input{ + border: 1px solid #e7e7e7; +} +.input-group-text{ + border: 1px solid #e7e7e7; + background-color: #fff; +} +.form-control{ + background-color: #fff; +} +.market-trade p{ + color: #767676; +} +.colorless{ + background: #999999; + color: #fff; + text-transform: uppercase; + padding: 10px; + margin-top: 30px; + width: 100%; + box-shadow: 0px 0px 15px 0px rgba(199, 199, 199, 0.7); +} diff --git a/src/views/exchangeStock/order-list.vue b/src/views/exchangeStock/order-list.vue index 3545991..2520151 100644 --- a/src/views/exchangeStock/order-list.vue +++ b/src/views/exchangeStock/order-list.vue @@ -1,5 +1,5 @@