From 645730962750ed6a81b5b6d1a134706607b20576 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Mon, 29 Sep 2025 14:32:21 +0800
Subject: [PATCH] 1
---
src/views/home/components/HomeLtl.vue | 2 +-
src/views/home/components/HomeLb.vue | 2 +-
src/axios/api.js | 4 ++++
src/views/home/components/HomeRight.vue | 24 +++++++++++++++++++-----
4 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/src/axios/api.js b/src/axios/api.js
index f566df8..740f201 100644
--- a/src/axios/api.js
+++ b/src/axios/api.js
@@ -660,3 +660,7 @@
export function findByPostionSn(options) {
return post("/user/position/findByPostionSn.do", options);
}
+// 获取最低手数和股数
+export function queryStockBuySetting(options) {
+ return get("/api/user/queryStockBuySetting.do", options);
+}
\ No newline at end of file
diff --git a/src/views/home/components/HomeLb.vue b/src/views/home/components/HomeLb.vue
index 67b8e11..5e7d10b 100644
--- a/src/views/home/components/HomeLb.vue
+++ b/src/views/home/components/HomeLb.vue
@@ -8,7 +8,7 @@
</div>
<div class="order_list" v-if="activeName == '0'">
- <el-button type="primary" style="margin-left: 16px;" @click="CloseAll">{{ $t("一鍵平倉") }}</el-button>
+ <!-- <el-button type="primary" style="margin-left: 16px;" @click="CloseAll">{{ $t("一鍵平倉") }}</el-button> -->
<el-table height="100%" :data="tableData" style="width: 100%" size="small" empty-text="No Data"
@row-click="Choice">
<el-table-column prop="stockSpell" :label="$t('hj313')">
diff --git a/src/views/home/components/HomeLtl.vue b/src/views/home/components/HomeLtl.vue
index 4837761..8c56039 100644
--- a/src/views/home/components/HomeLtl.vue
+++ b/src/views/home/components/HomeLtl.vue
@@ -109,7 +109,7 @@
handler(val) {
// 根据当前股票类型连接对应的ws
if (val == "US")
- this.initWebSocket("wss://ws.isusstock.com/websocket-server");
+ this.initWebSocket("wss://usws.yanshiz.com/websocket-server");
else this.initWebSocket("wss://ws.acapl.net/websocket-server");
},
immediate: true,
diff --git a/src/views/home/components/HomeRight.vue b/src/views/home/components/HomeRight.vue
index 174c8a6..ea64cfa 100644
--- a/src/views/home/components/HomeRight.vue
+++ b/src/views/home/components/HomeRight.vue
@@ -16,7 +16,7 @@
</el-input>
<el-input v-model="bform.num" style="text-align: end" oninput="value=value.replace(/[^\d.]/g,'')">
- <div slot="prefix" class="inp_prefix flex-center">{{ $t("sl") }}</div>
+ <div slot="prefix" class="inp_prefix flex-center">{{ $t("sl") }}({{ $t('hj117') }})</div>
</el-input>
<div class="slider_box">
@@ -27,7 +27,7 @@
<div class="label">{{ $t("tc") }}</div>
<div class="value">
{{ obj.type | currencySymbol }}
- {{ (obj.nowPrice * bform.num) | _toLocaleString }}
+ {{ (obj.nowPrice * bform.num * stockNum) | _toLocaleString }}
<!-- <div v-if="obj.type != $mc">
≈ $
{{ (obj.nowPrice * bform.num * rate(obj.type)) | _toLocaleString }}
@@ -65,7 +65,7 @@
<div slot="prefix" class="inp_prefix flex-center">{{ $t("sp") }}</div>
</el-input>
- <el-input v-model="sform.num" style="text-align: end" oninput="value=value.replace(/[^\d.]/g,'')">
+ <el-input v-model="sform.num" style="text-align: end" oninput="value=value.replace(/[^\d.]/g,'')" disabled>
<div slot="prefix" class="inp_prefix flex-center">{{ $t("sl") }}</div>
</el-input>
@@ -121,6 +121,7 @@
depositAmount: "", // 存款金额
moneyData: [], // 账户金额
pages: {}, // 已购买股票信息
+ stockNum: 0, // 每手股数
};
},
props: {
@@ -147,9 +148,14 @@
},
watch: {
obj: {
- handler(val) {
+ handler(val, oldVal) {
this.sform.price = this.bform.price =
Math.floor(val.nowPrice * 100) / 100 || 0;
+
+ // 判断如果新获取的数据和旧的数据不一样,则重新获取每手股数
+ if (val.code != oldVal.code) {
+ this.getStockBuySetting(val.type)
+ }
},
immediate: true,
},
@@ -157,7 +163,7 @@
bVal(val) {
this.bform.num = Math.floor(
(this.CurrentMoneyData.availableBalance * (val / 100)) /
- this.obj.nowPrice
+ (this.obj.nowPrice * this.stockNum)
);
},
sVal(val) {
@@ -211,6 +217,7 @@
let data = await api.findByPostionSn(res);
if (data.status === 0) {
this.pages = data.data;
+ this.sform.num = data.data.orderNum;
}
},
// 平仓
@@ -226,6 +233,13 @@
this.$emit("Refresh");
}
}),
+ // 获取每手的股数
+ async getStockBuySetting(bayType) {
+ let data = await api.queryStockBuySetting({ stockType: bayType });
+ if (data.status === 0) {
+ this.stockNum = data.data[0].stockNum;
+ }
+ }
},
};
</script>
--
Gitblit v1.9.3