1
PC-20250623MANY\Administrator
2025-09-29 645730962750ed6a81b5b6d1a134706607b20576
1
4 files modified
32 ■■■■ changed files
src/axios/api.js 4 ●●●● patch | view | raw | blame | history
src/views/home/components/HomeLb.vue 2 ●●● patch | view | raw | blame | history
src/views/home/components/HomeLtl.vue 2 ●●● patch | view | raw | blame | history
src/views/home/components/HomeRight.vue 24 ●●●● patch | view | raw | blame | history
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);
}
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')">
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,
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>