1
PC-20250623MANY\Administrator
2025-08-11 16cfa24c67682909a1e810e206ee8a6655e859ed
1
10 files modified
3 files added
483 ■■■■ changed files
src/assets/img/transfer.png patch | view | raw | blame | history
src/assets/img/充值缴费.png patch | view | raw | blame | history
src/axios/api.js 3 ●●●●● patch | view | raw | blame | history
src/components/tabHead.vue 31 ●●●● patch | view | raw | blame | history
src/locales/cht.json 5 ●●●● patch | view | raw | blame | history
src/locales/en.json 49 ●●●● patch | view | raw | blame | history
src/locales/hi.json 5 ●●●● patch | view | raw | blame | history
src/page/home/homeIndex.vue 27 ●●●● patch | view | raw | blame | history
src/page/trading/TradeNew.vue 10 ●●●● patch | view | raw | blame | history
src/page/trading/buy.vue 32 ●●●● patch | view | raw | blame | history
src/page/user/account.vue 14 ●●●●● patch | view | raw | blame | history
src/page/user/transferNew.vue 297 ●●●●● patch | view | raw | blame | history
src/router/index.js 10 ●●●●● patch | view | raw | blame | history
src/assets/img/transfer.png
src/assets/img/充值缴费.png
src/axios/api.js
@@ -11,6 +11,9 @@
export function queryStockConfig(options) {
  return post("/api/user/queryStockConfig.do", options);
}
export function queryStockConfigTwo(options) {
  return post("/api/user/queryStockConfigTwo.do", options);
}
export function getchicang(options) {
  return post("user/position/list.do", options);
}
src/components/tabHead.vue
@@ -16,19 +16,34 @@
      <slot></slot>
    </div>
    <!-- 搜索弹窗 -->
    <van-popup v-model="searchShow" round position="bottom" :style="{ height: '80%' }">
    <van-popup
      v-model="searchShow"
      round
      position="bottom"
      :style="{ height: '80%' }"
    >
      <div class="popup_head">
        <van-icon name="arrow-left" size=".5em" @click="searchShow = false" />
        <div class="popup_input">
          <van-field v-model="searchValue" :placeholder="$t('hj37')" left-icon="search" clearable />
          <van-field
            v-model="searchValue"
            :placeholder="$t('hj37')"
            left-icon="search"
            clearable
          />
        </div>
        <van-button type="primary" round @click="submit">{{
          $t("Search")
        }}</van-button>
      </div>
      <van-list v-model="loading" :finished="finished" :finished-text="$t('hj43')" @load="onLoad"
        v-if="(lists && lists.length > 0) || !finished">
      <van-list
        v-model="loading"
        :finished="finished"
        :finished-text="$t('hj43')"
        @load="onLoad"
        v-if="(lists && lists.length > 0) || !finished"
      >
        <van-cell v-for="item in lists" :key="item.id" @click="toDetails(item)">
          <div class="search_item">
            <div class="search_item_left">
@@ -57,6 +72,7 @@
<script>
import * as api from "@/axios/api";
import handleDt from "@/utils/deTh";
import { Toast } from "vant";
export default {
  name: "tabHead",
  data() {
@@ -95,7 +111,8 @@
  methods: {
    // 跳转客服页面
    aRouter1() {
      window.open(this.onlineService);
      // window.open(this.onlineService);
      Toast(this.$t("kf1"));
    },
    // 获取客服地址
    async getInfoSite() {
@@ -114,7 +131,7 @@
      // 跳转设置页面
      this.$router.push("/setting");
    },
    onLoad: handleDt.throttle(async function (a, b) {
    onLoad: handleDt.throttle(async function(a, b) {
      // 搜索列表加载
      this.finished = false;
      let opt = {
@@ -168,7 +185,7 @@
          type: item.stock_type
        }
      });
    },
    }
  }
};
</script>
src/locales/cht.json
@@ -686,5 +686,8 @@
  "ni":"印度股票指數",
  "hk1":"香港",
  "tw":"臺灣",
  "id1":"印度"
  "id1":"印度",
  "kf1": "需要任何幫助請聯繫您的專屬交易助理或開戶專員",
  "划转": "劃轉",
  "汇率": "匯率"
}
src/locales/en.json
@@ -663,28 +663,31 @@
  "信用分": "Credit Score",
  "剩余贷款额度": "Remaining Loan Amount",
  "贷款申请": "Loan Application",
  "还款":"Repayment",
  "确认还款吗":"Confirm repayment",
  "日内":"In the meantime",
  "建仓成本":"Position-building cost",
  "已申购":"Already purchased",
  "还款": "Repayment",
  "确认还款吗": "Confirm repayment",
  "日内": "In the meantime",
  "建仓成本": "Position-building cost",
  "已申购": "Already purchased",
  "hj316": "Please enter bank cardholder name",
  "Password": "Password",
  "rnv":"Real Name Verification",
  "it1":"ID Type",
  "dl1":"Driver License",
  "pa1":"Passport",
  "ot1":"Other",
  "in1":"Identification Number",
  "fsi1":"Front Side of ID Photo",
  "bsi1":"Back Side of ID Photo",
  "uv1":"Under Verification",
  "sc":"Stock Code",
  "abc":"Add bank card",
  "hksi":"Hong Kong Stock Index",
  "tsi":"Taiwan Stock Index",
  "ni":"Indian stock index",
  "hk1":"Hong Kong",
  "tw":"Taiwan",
  "id1":"India"
}
  "rnv": "Real Name Verification",
  "it1": "ID Type",
  "dl1": "Driver License",
  "pa1": "Passport",
  "ot1": "Other",
  "in1": "Identification Number",
  "fsi1": "Front Side of ID Photo",
  "bsi1": "Back Side of ID Photo",
  "uv1": "Under Verification",
  "sc": "Stock Code",
  "abc": "Add bank card",
  "hksi": "Hong Kong Stock Index",
  "tsi": "Taiwan Stock Index",
  "ni": "Indian stock index",
  "hk1": "Hong Kong",
  "tw": "Taiwan",
  "id1": "India",
  "kf1": "If you need any assistance, please contact your dedicated trading assistant or account opening specialist.",
  "划转": "Transfer",
  "汇率": "Exchange rate"
}
src/locales/hi.json
@@ -686,5 +686,8 @@
  "ni": "भारतीय स्टॉक इंडेक्स",
  "hk1": "हांगकांग",
  "tw": "ताइवान",
  "id1": "भारत"
  "id1": "भारत",
  "kf1": "यदि आपको कोई सहायता चाहिए, तो कृपया अपने समर्पित व्यापार सहायक या खाता खोलने विशेषज्ञ से संपर्क करें।",
  "划转": "स्थानांतरण",
  "汇率": "विनिमय दर"
}
src/page/home/homeIndex.vue
@@ -23,7 +23,7 @@
      </div>
      <div class="swiper">
        <div class="swiper-wrapper flex-between">
          <div class="swiper-slide">
          <!-- <div class="swiper-slide">
            <div class="nav_item flex-start" @click="toPage('/aiTrading')">
              <img src="../../assets/img/home_1.png" alt="" />
              <span>{{ $t("量化交易") }}</span>
@@ -34,17 +34,29 @@
              <img src="../../assets/img/home_2.png" alt="" />
              <span>{{ $t("hj621") }}</span>
            </div>
          </div>
          </div> -->
          <div class="swiper-slide">
            <div class="nav_item flex-start" @click="toPage('/ipo')">
              <img src="../../assets/img/home_3.png" alt="" />
              <span>IPO</span>
            </div>
          </div>
          <div class="swiper-slide">
          <!-- <div class="swiper-slide">
            <div class="nav_item flex-start" @click="toPage('/fund')">
              <img src="../../assets/img/home_4.png" alt="" />
              <span>{{ $t("理财基金") }}</span>
            </div>
          </div> -->
          <div class="swiper-slide">
            <div class="nav_item flex-start" @click="toPage('/recharge')">
              <img src="@/assets/img/充值缴费.png" alt="" />
              <span>{{ $t("hj172") }}</span>
            </div>
          </div>
          <div class="swiper-slide">
            <div class="nav_item flex-start" @click="toPage('/banklist')">
              <img src="@/assets/img/充值缴费.png" alt="" />
              <span>{{ $t("hj147") }}</span>
            </div>
          </div>
        </div>
@@ -290,8 +302,8 @@
        padding: 0 0.25em 0 0.25em;
        .swiper-slide {
          width: 2.1875em;
          height: 2.5em;
          width: 3em;
          height: 2.8em;
          .nav_item {
            background-color: #fff;
@@ -299,11 +311,10 @@
            width: 100%;
            height: 100%;
            flex-direction: column;
            padding-top: 0.25em;
            padding: 0.25em 0.15em 0;
            padding: 0.45em 0.15em 0;
            img {
              width: 0.75em;
              width: 0.95em;
              margin-bottom: 0.25em;
            }
src/page/trading/TradeNew.vue
@@ -5,10 +5,10 @@
    <div class="order_tabs">
      <van-tabs v-model="active" swipe-threshold="1">
        <van-tab :title="$t('hj160')" name=""></van-tab>
        <van-tab title="AI" name="4"></van-tab>
        <van-tab :title="$t('hj621')" name="3"></van-tab>
        <van-tab title="IPO" name="2"></van-tab>
        <van-tab :title="$t('日内')" name="0"></van-tab>
        <van-tab :title="$t('美股指数')" name="US"></van-tab>
        <van-tab :title="$t('hksi')" name="HK"></van-tab>
        <van-tab :title="$t('tsi')" name="TW"></van-tab>
        <van-tab :title="$t('ni')" name="IN"></van-tab>
      </van-tabs>
    </div>
@@ -131,7 +131,7 @@
    async getList() {
      let data = await api.getchicang({
        state: 0,
        positionType: this.active,
        stockType: this.active,
        pageNum: this.pageNum,
        pageSize: this.pageSize
      });
src/page/trading/buy.vue
@@ -129,16 +129,10 @@
                  (nowPrice * selectCycle.replace("X", "") * num)
                    | _toLocaleString
                }}
                <span v-if="bayType != 'US'">
                  ≈ $
                  {{
                    (nowPrice * selectCycle.replace("X", "") * num * rate)
                      | _toLocaleString
                  }}
                </span>
              </span>
              <span style="white-space: nowarp">
                $ {{ moneyData.availableBalance | _toLocaleString }}
                {{ bayType | currencySymbol }}
                {{ moneyData.availableBalance | _toLocaleString }}
              </span>
            </div>
          </div>
@@ -155,17 +149,6 @@
                    2
                  )
                }}
                <span v-if="bayType != 'US'">
                  ≈ $
                  {{
                    (nowPrice *
                      selectCycle.replace("X", "") *
                      num *
                      sxf *
                      rate)
                      | _toLocaleString
                  }}
                </span>
              </span>
              <span style="white-space: nowarp"> </span>
            </div>
@@ -412,14 +395,9 @@
      let data = await api.getMoney();
      // let type = this.bayType === "SZHB" ? "US" : this.bayType;
      if (data.status === 0) {
        // const newArr = data.data.filter(item => item.accectType === type);
        // this.moneyData = newArr[0] || {};
        this.moneyData = data.data[0];
        // console.log(this.bayType, newArr);
        // 判断是否登录
        // this.moneyList = data.data;
        data.data.forEach(i => {
          if (i.accectType == this.bayType) this.moneyData = i;
        });
      }
    },
    handleBack() {
src/page/user/account.vue
@@ -18,9 +18,9 @@
        <span>{{ $t("hj244") }}</span>
      </div>
      <div class="wallet_price flex-between">
        <span>{{ moneyData.symbol }} {{ moneyData.totalMoney }}</span>
        <span>{{ moneyData.symbol }} {{ moneyData.availableBalance }}</span>
      <div class="wallet_price flex-between" v-for="i in moneyData" :key="i.id">
        <span>{{ i.symbol }} {{ i.totalMoney }}</span>
        <span>{{ i.symbol }} {{ i.availableBalance }}</span>
      </div>
      <div class="wallet_price_name flex-between">
@@ -46,6 +46,10 @@
      <div class="tab flex-center" @click="toPage('/rechargelist')">
        <img src="@/assets/img/jl.png" alt="" />
        <span>{{ $t("jl") }}</span>
      </div>
      <div class="tab flex-center" @click="toPage('/transferNew')">
        <img src="@/assets/img/jl.png" alt="" />
        <span>{{ $t("划转") }}</span>
      </div>
    </div>
@@ -230,7 +234,7 @@
  data() {
    return {
      userInfo: {}, // 用户信息
      moneyData: {}, // 账户金额
      moneyData: [], // 账户金额, 包含可用余额数组
      positionData: {} // 账户持仓数据
    };
  },
@@ -239,7 +243,7 @@
    async getMoney() {
      let data = await api.getMoney();
      if (data.status === 0) {
        this.moneyData = data.data[0];
        this.moneyData = data.data;
      }
    },
    // 获取账户持仓数据
src/page/user/transferNew.vue
New file
@@ -0,0 +1,297 @@
<template>
  <div class="transfer_new">
    <van-nav-bar
      :placeholder="true"
      :safe-area-inset-top="true"
      :title="$t('划转')"
      left-arrow
      @click-left="$router.go(-1)"
    >
    </van-nav-bar>
    <div style="position: relative;">
      <div class="card">
        <div class="flex-center">
          <span style="margin-right: 1em;">{{ $t("从") }}</span>
          <van-field
            v-model="moneyRevise"
            type="number"
            :placeholder="$t('请输入')"
          >
            <template #button>
              <van-button
                size="small"
                class="butn2"
                type="primary"
                @click="onMax"
              >
                {{ $t("全部") }}
              </van-button>
            </template>
          </van-field>
          <span style="margin-left: 1em;">{{ cValue.currency }}</span>
        </div>
        <div class="mt-1">
          <van-popover
            v-model="showPopover"
            trigger="click"
            :actions="actions"
            @select="onSelect"
            placement="bottom-start"
          >
            <template #reference>
              <div class="lv">{{ cValue.text }}</div>
            </template>
          </van-popover>
        </div>
      </div>
      <div class="card mt-1">
        <div class="flex-center">
          <span style="margin-right: 1em;">{{ $t("到") }}</span>
          <div style="flex:1">
            ≈ {{ this.moneyReviseTo || 0 }} {{ dValue.currency }}
          </div>
        </div>
        <div class="mt-1">
          <van-popover
            v-model="showPopover1"
            trigger="click"
            :actions="actions"
            @select="onSelect1"
            placement="bottom-start"
          >
            <template #reference>
              <div class="lv">{{ dValue.text }}</div>
            </template>
          </van-popover>
        </div>
      </div>
      <img src="@/assets/img/transfer.png" class="swap" @click="onSwap" />
    </div>
    <div class="flex-between transfer_a">
      <span>{{ $t("汇率") }}</span>
      <span>
        1 {{ cValue.currency }} <van-icon name="exchange" /> {{ exRate }}
        {{ dValue.currency }}</span
      >
    </div>
    <div class="flex-between transfer_a">
      <span>{{ $t("hj44") }}</span>
      <span>
        {{ Math.ceil(sxf * moneyRevise * 1000) / 1000 }} {{ cValue.currency }}
      </span>
    </div>
    <van-button type="info" class="butn" @click="submit">
      {{ $t("qr") }}
    </van-button>
  </div>
</template>
<script>
import * as api from "@/axios/api";
import { Toast } from "vant";
export default {
  data() {
    return {
      moneyRevise: 0, // 划转金额
      showPopover: false,
      showPopover1: false,
      actions: [
        { text: this.$t("美国"), value: "US", currency: "USD" },
        { text: this.$t("hk1"), value: "HK", currency: "HKD" },
        { text: this.$t("tw"), value: "TW", currency: "TWD" },
        { text: this.$t("id1"), value: "IN", currency: "INR" }
      ],
      cValue: {},
      dValue: {},
      usM: {}, // 账户金额 us
      twM: {}, // 账户金额 tw
      inM: {}, // 账户金额 in
      hkM: {}, // 账户金额 hk
      arrRate: [], // 汇率
      sxf: 0.01 // 手续费比例
    };
  },
  computed: {
    moneyReviseTo() {
      return Math.floor(this.moneyRevise * this.exRate * 100) / 100;
    },
    exRate() {
      let rate = 1;
      this.arrRate.forEach(item => {
        if (
          item.currency == this.cValue.currency &&
          item.conversionCurrency == this.dValue.currency
        )
          rate = item.rata;
      });
      return rate;
    }
  },
  created() {
    this.cValue = this.actions[0]; // 默认值
    this.dValue = this.actions[1]; // 默认值
    this.getMoney();
    this.getExchangeRate();
    this.queryStockConfig();
  },
  methods: {
    // 获取汇率
    async getExchangeRate() {
      let data = await api.getRateInfo();
      if (data.status === 0) {
        this.arrRate = data.data;
      }
    },
    onMax() {
      switch (this.cValue.currency) {
        case "USD":
          this.moneyRevise = this.usM.availableBalance;
          break;
        case "HKD":
          this.moneyRevise = this.hkM.availableBalance;
          break;
        case "TWD":
          this.moneyRevise = this.twM.availableBalance;
          break;
        case "INR":
          this.moneyRevise = this.inM.availableBalance;
          break;
        default:
          break;
      }
    },
    // 获取手续比例
    async queryStockConfig() {
      let data = await api.queryStockConfigTwo();
      if (data.status === 0) {
        this.sxf = data.data.cValue;
      }
    },
    // 获取账户金额
    async getMoney() {
      let data = await api.getMoney();
      if (data.status === 0) {
        data.data.forEach(item => {
          if (item.accectType == "US") this.usM = item;
          else if (item.accectType == "TW") this.twM = item;
          else if (item.accectType == "IN") this.inM = item;
          else if (item.accectType == "HK") this.hkM = item;
        });
      }
    },
    // 划转上下调换
    onSwap() {
      let a = this.cValue,
        b = this.dValue;
      this.cValue = b;
      this.dValue = a;
    },
    // 选择
    onSelect(action) {
      this.cValue = action;
    },
    // 选择
    onSelect1(action) {
      this.dValue = action;
    },
    async submit() {
      let opt = {
        fromType: this.cValue.value,
        toType: this.dValue.value,
        amt: this.moneyRevise
      };
      let data = await api.transfer(opt);
      if (data.status === 0) {
        Toast.success(this.$t(data.msg));
        this.getMoney();
      }
    }
  }
};
</script>
<style lang="less" scoped>
/deep/ .van-nav-bar__content {
  height: 65px;
}
/deep/ .van-nav-bar__title {
  font-family: "DINPro";
  width: 100%;
  height: 1.17333em;
  display: flex;
  justify-content: center;
  align-items: center;
  font-style: normal;
  font-weight: 700;
  font-size: 0.48em;
  color: #14181f;
}
.transfer_new {
  padding: 0rem 0.25em 0.5em 0.25em;
  width: 100%;
  min-height: 100vh;
  background: #fff;
  font-size: 10vw;
  .transfer_a {
    font-size: 0.4em;
    padding-top: 1em;
  }
  .butn {
    width: 100%;
    margin-top: 40px;
    height: 60px;
    border-radius: 8px;
    background: #c4d600;
    border: none;
  }
  .butn2 {
    border-radius: 8px;
    background: #c4d600;
    border: none;
  }
  .card {
    background: #f7f7f7;
    padding: 2em 1.2em;
    border-radius: 0.5em;
    font-size: 0.4em;
    border: none;
    .lv {
      color: #c4d600;
    }
  }
  .swap {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1em;
  }
  .hint {
    font-size: 0.35em;
    margin-bottom: 150px;
    span {
      color: #333;
    }
  }
  .label_but {
    color: #333;
  }
  .transfer_label {
    font-size: 0.4em;
  }
}
</style>
src/router/index.js
@@ -119,6 +119,16 @@
      },
      component: () => import("@/page/markets/markets.vue")
    },
    {
      path: "/transferNew",
      name: "transferNew",
      meta: {
        title: i18n.t("划转"),
        requireAuth: true,
        index: 1
      },
      component: () => import("@/page/user/transferNew.vue")
    },
    // AI量化交易
    {
      path: "/aiTrading",