From bb732a1be0d5784170a6378939bee8874cdea7e8 Mon Sep 17 00:00:00 2001 From: liaoxinyu Date: Fri, 29 May 2026 10:52:50 +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 --- api/market.js | 5 +- layout/vButton.vue | 9 + pages/base/stockexchange-operation.vue | 24 +-- pages/stockexchange/exchange-transaction.vue | 216 ++++++++++++++----- pages/stockexchange/index.vue | 1 + pages/stockexchange/symbol-list.vue | 48 ++++- 6 files changed, 231 insertions(+), 72 deletions(-) diff --git a/api/market.js b/api/market.js index b7ffe6e..e1abf0e 100644 --- a/api/market.js +++ b/api/market.js @@ -65,7 +65,10 @@ class Market { static getstockCoinInfo(data){ return Serve.get(`/stock/getCoinInfo`,data) } - + // 是否显示颜色 + static getstocktradingOpen(data){ + return Serve.get(`/stock/tradingOpen`,data) + } } export default Market; \ No newline at end of file diff --git a/layout/vButton.vue b/layout/vButton.vue index d782f64..3e5b38f 100644 --- a/layout/vButton.vue +++ b/layout/vButton.vue @@ -205,4 +205,13 @@ export default { border-radius:inherit; } } +.colorless { + ::v-deep uni-button { + background: #999999; + color: #fff; + border:none; + border-radius:inherit; + box-shadow: 0px 0px 15px 0px rgba(199, 199, 199, 0.7); + } +} \ No newline at end of file diff --git a/pages/base/stockexchange-operation.vue b/pages/base/stockexchange-operation.vue index 4c9d9f4..1d28dca 100644 --- a/pages/base/stockexchange-operation.vue +++ b/pages/base/stockexchange-operation.vue @@ -68,7 +68,7 @@ @@ -98,10 +98,6 @@ export default { type: String, required: false, }, - stocksymbol: { - default: '', - type: String - } }, components: { exchangeTransaction, @@ -126,15 +122,14 @@ export default { watch: { isShow(n) { if (n) { - this.query = { symbol: this.stocksymbol }; setTimeout(() => { - this.ws.send({ + this.ws2.send({ cmd: "sub", msg: this.msg, }); }, 200); } else { - this.ws.send({ + this.ws2.send({ cmd: "unsub", msg: this.msg, }); @@ -143,7 +138,7 @@ export default { }, computed: { ...mapState({ - ws: "ws", + ws2: "ws2", }), isLogin() { return Boolean(uni.getStorageSync("token")); @@ -199,11 +194,11 @@ export default { // 链接socket linkSocket() { let msg = this.msg; - this.ws.send({ + this.ws2.send({ cmd: "sub", msg, }); - this.ws.on("message", (res) => { + this.ws2.on("message", (res) => { let { data, sub } = res; if (sub == msg) { this.marketList = data; @@ -227,11 +222,6 @@ export default { return curParam; }, }, - mounted() { - if (this.stocksymbol) { - this.query = { symbol: this.stocksymbol }; - } - }, created() { this.query = this.getQuery(); if (this.query.symbol) { @@ -241,7 +231,7 @@ export default { this.getCollect(); }, destroyed() { - this.ws.send({ + this.ws2.send({ cmd: "unsub", msg: 'exchangeMarketList', }) diff --git a/pages/stockexchange/exchange-transaction.vue b/pages/stockexchange/exchange-transaction.vue index b5903b1..61ed1ab 100644 --- a/pages/stockexchange/exchange-transaction.vue +++ b/pages/stockexchange/exchange-transaction.vue @@ -4,14 +4,14 @@ - {{ symbol }} + {{ activeCoin.coin_name }} {{increase.increaseStr}} - + {{ - form.direction == "buy" - ? this.$t("exchange.c3") - : this.$t("exchange.c4") - }} + v-if="tradingOpenshow==true"> + {{form.direction == "buy" ? this.$t("exchange.c3") : this.$t("exchange.c4")}} {{ activeCoin.coin_name }} + + {{form.direction == "buy" ? this.$t("exchange.c3") : this.$t("exchange.c4")}} + {{ activeCoin.coin_name }}