1
PC-20250623MANY\Administrator
2025-08-16 832a37044afeea095d43535bcec6d2e71c4d2409
1
6 files modified
414 ■■■■ changed files
src/main.js 1 ●●●● patch | view | raw | blame | history
src/views/account/account.vue 129 ●●●● patch | view | raw | blame | history
src/views/account/components/Trasferire.vue 190 ●●●●● patch | view | raw | blame | history
src/views/account/components/Withdraw.vue 30 ●●●● patch | view | raw | blame | history
src/views/home/components/HomeRight.vue 35 ●●●●● patch | view | raw | blame | history
src/views/ipo/ipo.vue 29 ●●●● patch | view | raw | blame | history
src/main.js
@@ -77,6 +77,7 @@
Vue.prototype.$message = Message;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$confirm = MessageBox.confirm;
import "./assets/style/variables.scss";
src/views/account/account.vue
@@ -11,27 +11,6 @@
      </div>
      <div class="flex-between" style="width: 100%">
        <div class="overview-content">
          <div class="overview-item">
            <div class="item-label">{{ $t("hj49") }}</div>
            <div class="item-value">
              {{ moneyData.symbol }} {{ moneyData.totalMoney }}
            </div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("hj48") }}</div>
            <div class="item-value">
              {{ moneyData.symbol }} {{ moneyData.availableBalance }}
            </div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("ff1") }}</div>
            <div class="item-value">
              {{ moneyData.symbol }} {{ moneyData.freezeMoney }}
            </div>
          </div>
        </div>
        <div class="action-buttons">
            <el-button
              type="success"
@@ -101,6 +80,29 @@
        <div class="market-header">
          <h3>{{ $t("美国") }}</h3>
        </div>
        <div
          class="overview-content"
          v-for="i in moneyData"
          :key="i.id"
          v-show="i.accectType == 'US'"
        >
          <div class="overview-item">
            <div class="item-label">{{ $t("hj49") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.totalMoney }}</div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("hj48") }}</div>
            <div class="item-value">
              {{ i.symbol }} {{ i.availableBalance }}
            </div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("ff1") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.freezeMoney }}</div>
          </div>
        </div>
        <div class="market-content">
          <div class="market-row">
            <div class="market-label">
@@ -149,6 +151,29 @@
        <div class="market-header">
          <h3>{{ $t("hk1") }}</h3>
        </div>
        <div
          class="overview-content"
          v-for="i in moneyData"
          :key="i.id"
          v-show="i.accectType == 'HK'"
        >
          <div class="overview-item">
            <div class="item-label">{{ $t("hj49") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.totalMoney }}</div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("hj48") }}</div>
            <div class="item-value">
              {{ i.symbol }} {{ i.availableBalance }}
            </div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("ff1") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.freezeMoney }}</div>
          </div>
        </div>
        <div class="market-content">
          <div class="market-row">
            <div class="market-label">
@@ -197,11 +222,34 @@
        </div>
      </div>
    </div>
    <div class="market-data page-w a_card" style="padding-top: 0;">
    <div class="market-data page-w a_card" style="padding-top: 0">
      <div class="market-section sb_b">
        <div class="market-header">
          <h3>{{ $t("tw") }}</h3>
        </div>
        <div
          class="overview-content"
          v-for="i in moneyData"
          :key="i.id"
          v-show="i.accectType == 'TW'"
        >
          <div class="overview-item">
            <div class="item-label">{{ $t("hj49") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.totalMoney }}</div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("hj48") }}</div>
            <div class="item-value">
              {{ i.symbol }} {{ i.availableBalance }}
            </div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("ff1") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.freezeMoney }}</div>
          </div>
        </div>
        <div class="market-content">
          <div class="market-row">
            <div class="market-label">
@@ -254,6 +302,29 @@
        <div class="market-header">
          <h3>{{ $t("id1") }}</h3>
        </div>
        <div
          class="overview-content"
          v-for="i in moneyData"
          :key="i.id"
          v-show="i.accectType == 'IN'"
        >
          <div class="overview-item">
            <div class="item-label">{{ $t("hj49") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.totalMoney }}</div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("hj48") }}</div>
            <div class="item-value">
              {{ i.symbol }} {{ i.availableBalance }}
            </div>
          </div>
          <div class="overview-item">
            <div class="item-label">{{ $t("ff1") }}</div>
            <div class="item-value">{{ i.symbol }} {{ i.freezeMoney }}</div>
          </div>
        </div>
        <div class="market-content">
          <div class="market-row">
            <div class="market-label">
@@ -388,7 +459,7 @@
      :dialogVisible.sync="trasferireVisible"
      v-if="trasferireVisible"
      @onClose="getMoney"
      :maxNum="Math.floor(moneyData.availableBalance * 100) / 100"
      :moneyData="moneyData"
    ></Trasferire>
    <!-- 充值弹窗 -->
    <Deposit
@@ -402,7 +473,7 @@
      :dialogVisible.sync="withdrawVisible"
      v-if="withdrawVisible"
      @onClose="getMoney"
      :maxNum="Math.floor(moneyData.availableBalance * 100) / 100"
      :moneyData="moneyData"
    ></Withdraw>
    <!-- 贷款申请弹窗 -->
@@ -474,7 +545,7 @@
  data() {
    return {
      nav: 1,
      moneyData: {}, // 账户金额
      moneyData: [], // 账户金额
      userInfo: {}, // 用户信息
      positionData: {}, // 账户持仓数据
      depositAmount: "", // 存款金额
@@ -509,7 +580,7 @@
    async getMoney() {
      let data = await api.getMoney();
      if (data.status === 0) {
        this.moneyData = data.data[0];
        this.moneyData = data.data;
      }
    },
    // 获取用户信息
@@ -593,8 +664,8 @@
.overview-content {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  width: 50%;
  // margin-bottom: 20px;
  padding: 15px 20px 0;
}
.overview-item {
@@ -615,7 +686,7 @@
.action-buttons {
  display: flex;
  justify-content: flex-end;
  justify-content: flex-start;
  margin-bottom: 20px;
  width: 50%;
src/views/account/components/Trasferire.vue
@@ -1,23 +1,54 @@
<template>
    <el-dialog :title="$t('劃轉')" :visible.sync="dialogVisible" width="720px" :before-close="onClose">
  <el-dialog
    :title="$t('劃轉')"
    :visible.sync="dialogVisible"
    width="720px"
    :before-close="onClose"
  >
        <el-form ref="withdrawform" :model="form" label-width="auto" :rules="rules">
            <el-form-item :label="$t('从')" prop="fromType">
                <div class="flex-center">
                    <el-select @change="getExchangeRate" v-model="form.fromType" :placeholder="$t('請選擇')">
                        <el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.name">
          <el-select
            @change="getExchangeRate"
            v-model="form.fromType"
            :placeholder="$t('請選擇')"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.name"
              :value="item.name"
            >
                        </el-option>
                    </el-select>
                    <el-input v-model.number="form.amt" @input="amtinput" type="number"></el-input>
                    <el-button type="primary" style="margin-left: 10px" @click="form.amt = maxNum"
                        class="submit">{{ $t("最大") }}</el-button>
          <el-input
            v-model.number="form.amt"
            @input="amtinput"
            type="number"
          ></el-input>
          <el-button
            type="primary"
            style="margin-left: 10px"
            @click="form.amt = maxNum"
            class="submit"
            >{{ $t("最大") }}</el-button
          >
                </div>
            </el-form-item>
            <el-form-item :label="$t('到')" prop="toType">
                <div class="flex-center">
                    <el-select @change="getExchangeRate" v-model="form.toType" :placeholder="$t('請選擇')">
                        <el-option v-for="item in actions" :key="item.value" :label="item.name" :value="item.name">
          <el-select
            @change="getExchangeRate"
            v-model="form.toType"
            :placeholder="$t('請選擇')"
          >
            <el-option
              v-for="item in actions"
              :key="item.value"
              :label="item.name"
              :value="item.name"
            >
                        </el-option>
                    </el-select>
                    <el-input v-model.number="price" disabled type="number"></el-input>
@@ -65,52 +96,70 @@
                allMoney: "",
                moneylist:[],  //全部账户信息
                rules: {
                    fromType: [{
        fromType: [
          {
                        required: true,
                        message: this.$t("請選擇"),
                        trigger: "change"
                    }, ],
                    toType: [{
                        required: true,
                        message: this.$t("請選擇"),
                        trigger: "change"
                    }],
                    bankId: [{
                        required: true,
                        message: this.$t("請選擇"),
                        trigger: "change"
                    }, ],
                    amt: [{
                        required: true,
                        message: this.$t("请输入")
                    }],
            trigger: "change",
                },
                options: [{
        ],
        toType: [
          {
            required: true,
            message: this.$t("請選擇"),
            trigger: "change",
          },
        ],
        bankId: [
          {
            required: true,
            message: this.$t("請選擇"),
            trigger: "change",
          },
        ],
        amt: [
          {
            required: true,
            message: this.$t("请输入"),
          },
        ],
      },
      options: [
        {
                    name: "US",
                    value: "USD"
                }, {
          value: "USD",
        },
        {
                    name: "HK",
                    value: "HKD"
                }, {
          value: "HKD",
        },
        {
                    name: "IN",
                    value: "INR"
                }, {
          value: "INR",
        },
        {
                    name: "TW",
                    value: "TWD"
                }],
                actions: [{
          value: "TWD",
        },
      ],
      actions: [
        {
                    name: "US",
                    value: "USD"
                }, {
          value: "USD",
        },
        {
                    name: "HK",
                    value: "HKD"
                }, {
          value: "HKD",
        },
        {
                    name: "IN",
                    value: "INR"
                }, {
          value: "INR",
        },
        {
                    name: "TW",
                    value: "TWD"
                }],
          value: "TWD",
        },
      ],
                yhkactions: [],
            };
        },
@@ -119,32 +168,39 @@
                type: Boolean,
                default: false,
            },
            //可用余额
            maxNum: {
                type: Number,
                default: 0,
    moneyData: {
      type: Array,
      default: () => [],
    },
  },
  computed: {
    maxNum() {
      let max = 0;
      this.moneyData.forEach((i) => {
        if (i.accectType == this.form.fromType) max = i.availableBalance;
      });
      return max;
            },
        },
        created() {
            this.getExchangeRate()
            this.getfee()
            this.getMoney()
    this.getExchangeRate();
    this.getfee();
    this.getMoney();
        },
        methods: {
            async getMoney() {
                let data = await api.getMoney();
                if (data.status === 0) {
                    this.moneylist = data.data
        this.moneylist = data.data;
                }
            },
            amtinput(e) {
                this.price = e * this.rata
      this.price = e * this.rata;
            },
            async getfee() {
                let data = await api.getfee();
                if (data.status == 0) {
                    this.handling_fee = data.data.cValue
        this.handling_fee = data.data.cValue;
                }
            },
            async getExchangeRate() {
@@ -153,23 +209,23 @@
                let selectedName = this.form.fromType;
                let toselectedName = this.form.toType;
                if (selectedName == toselectedName) {
                    this.rata = '1'
                    return
        this.rata = "1";
        return;
                }
                let selectedItem = this.options.find(item => item.name === selectedName);
                let toselectedItem = this.actions.find(item => item.name === toselectedName);
                this.moneylist.forEach((item) => {
                  if (item.symbolCode == selectedItem.value ) {
                    this.maxNum = item.availableBalance;
                  }
                });
      let selectedItem = this.options.find(
        (item) => item.name === selectedName
      );
      let toselectedItem = this.actions.find(
        (item) => item.name === toselectedName
      );
                
                let data = await api.getRateInfo();
                data.data &&
                    data.data.forEach((item) => {
                        if (item.currency == selectedItem.value && item.conversionCurrency == toselectedItem
                            .value) {
          if (
            item.currency == selectedItem.value &&
            item.conversionCurrency == toselectedItem.value
          ) {
                            this.rata = item.rata;
                        }
                    });
src/views/account/components/Withdraw.vue
@@ -58,7 +58,13 @@
      <el-form-item v-if="!!form.assetsType">
        <div class="ts">
          {{ $t("可用餘額") }}
          {{ maxNum }} USD
          {{ maxNum }}
          <span
            v-for="i in moneyData"
            :key="i.id"
            v-show="i.accectType == form.assetsType"
            >{{ i.symbolCode }}</span
          >
        </div>
      </el-form-item>
@@ -93,7 +99,12 @@
        ],
        amt: [{ required: true, message: this.$t("请输入") }],
      },
      options: [{ name: "US", value: "USD" },{ name: "HK", value: "HKD" },{ name: "IN", value: "INR" },{ name: "TW", value: "TWD" }],
      options: [
        { name: "US", value: "USD" },
        { name: "HK", value: "HKD" },
        { name: "IN", value: "INR" },
        { name: "TW", value: "TWD" },
      ],
      actions: [{ name: this.$t("hj215"), value: "YHK" }],
      yhkactions: [],
    };
@@ -103,9 +114,18 @@
      type: Boolean,
      default: false,
    },
    maxNum: {
      type: Number,
      default: 0,
    moneyData: {
      type: Array,
      default: () => [],
    },
  },
  computed: {
    maxNum() {
      let max = 0;
      this.moneyData.forEach((i) => {
        if (i.accectType == this.form.assetsType) max = i.availableBalance;
      });
      return max;
    },
  },
  created() {
src/views/home/components/HomeRight.vue
@@ -45,17 +45,17 @@
        <div class="value">
          {{ obj.type | currencySymbol }}
          {{ (obj.nowPrice * bform.num) | _toLocaleString }}
          <div v-if="obj.type != $mc">
          <!-- <div v-if="obj.type != $mc">
            ≈ $
            {{ (obj.nowPrice * bform.num * rate(obj.type)) | _toLocaleString }}
          </div>
          </div> -->
        </div>
      </div>
      <div class="info_item flex-between">
        <div class="label">{{ $t("hj48") }}</div>
        <div class="value">
          {{ moneyData.symbol }} {{ moneyData.availableBalance }}
          {{ CurrentMoneyData.symbol }} {{ CurrentMoneyData.availableBalance }}
        </div>
      </div>
@@ -104,10 +104,10 @@
        <div class="value">
          {{ obj.type | currencySymbol }}
          {{ (obj.nowPrice * sform.num) | _toLocaleString }}
          <div v-if="obj.type != $mc">
          <!-- <div v-if="obj.type != $mc">
            ≈ $
            {{ (obj.nowPrice * sform.num * rate(obj.type)) | _toLocaleString }}
          </div>
          </div> -->
        </div>
      </div>
@@ -145,7 +145,7 @@
        100: "100%",
      },
      depositAmount: "", // 存款金额
      moneyData: {}, // 账户金额
      moneyData: [], // 账户金额
      pages: {}, // 已购买股票信息
    };
  },
@@ -159,6 +159,18 @@
      default: null,
    },
  },
  computed: {
    // 当前账户金额
    CurrentMoneyData() {
      let obj = {};
      this.moneyData.forEach((i) => {
        if (i.accectType == this.obj.type) {
          obj = i;
        }
      });
      return obj;
    },
  },
  watch: {
    obj: {
      handler(val) {
@@ -169,14 +181,9 @@
    },
    // 通过进度条来计算数量
    bVal(val) {
      if (this.obj.type != this.$mc)
        this.bform.num = Math.floor(
          (this.moneyData.availableBalance * (val / 100)) /
            (this.obj.nowPrice * this.rate(this.obj.type))
        );
      else
        this.bform.num = Math.floor(
          (this.moneyData.availableBalance * (val / 100)) / this.obj.nowPrice
        (this.CurrentMoneyData.availableBalance * (val / 100)) /
          this.obj.nowPrice
        );
    },
    sVal(val) {
@@ -202,7 +209,7 @@
    async getMoney() {
      let data = await api.getMoney();
      if (data.status === 0) {
        this.moneyData = data.data[0];
        this.moneyData = data.data;
      }
    },
    // 买卖,买:0,卖:1
src/views/ipo/ipo.vue
@@ -135,19 +135,42 @@
  methods: {
    // 打开购买弹窗
    buyOpen(i) {
      this.$confirm("", this.$t("操作确认"), {
      // this.$confirm("", this.$t("操作确认"), {
      //   confirmButtonText: this.$t("qr"),
      //   cancelButtonText: this.$t("qx"),
      // })
      //   .then(async () => {
      //     // 申购
      //     let opt = {
      //       newCode: i.code,
      //       applyNums: i.orderNumber,
      //       password: i.password,
      //       newlistId: i.newlistId,
      //       type: i.type,
      //     };
      //     let data = await api.getNewAdd(opt);
      //     if (data.status == 0) {
      //       this.$message.success(data.msg);
      //       this.init(); // 重新获取列表
      //     }
      //   })
      //   .catch(() => {});
      this.$prompt(this.$t("sl"), this.$t("操作确认"), {
        confirmButtonText: this.$t("qr"),
        cancelButtonText: this.$t("qx"),
      })
        .then(async () => {
        .then(async (val) => {
          // 申购
          let opt = {
            newCode: i.code,
            applyNums: i.orderNumber,
            applyNums: val.value,
            password: i.password,
            newlistId: i.newlistId,
            type: i.type,
          };
          let data = await api.getNewAdd(opt);
          if (data.status == 0) {