From 405dc49f690cc53d473acf0db175f524f6cf7417 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Thu, 19 Jun 2025 15:22:16 +0800
Subject: [PATCH] 修改算法

---
 src/i18n/en-US/index.js                 |    2 
 src/i18n/Indonesian/index.js            |   63 ++++++++++----------
 src/components/perpetual-open/index.vue |   78 ++++++++++++++------------
 src/request/httpAxios.js                |    4 
 src/request/index.js                    |   16 ++--
 src/i18n/es/index.js                    |    1 
 src/i18n/CN/index.js                    |    2 
 7 files changed, 89 insertions(+), 77 deletions(-)

diff --git a/src/components/perpetual-open/index.vue b/src/components/perpetual-open/index.vue
index 3fe795d..07b5d11 100644
--- a/src/components/perpetual-open/index.vue
+++ b/src/components/perpetual-open/index.vue
@@ -161,7 +161,7 @@
             <input
               :placeholder="
                 selectIndex == 1
-                  ? $t('张数')
+                  ? $t('手数')
                   : $t('最少') + initFutrue && initFutrue.para
                   ? $t('最小金额') + initFutrue.para[paraIndex].buy_min
                   : ''
@@ -191,21 +191,23 @@
           </div>
           <template v-if="selectIndex == 1">
             <div class="mt-40 mb-30 w-full flex justify-between items-center">
-              <span class="font-22 font-400 text-grey">{{
-                $t("可开张数")
-              }}</span
-              >{{ form.lever_rate }}
+              <span class="font-22 font-400 text-grey">
+                {{ $t("可开") }}{{ $t("手数") }}
+                <!-- {{initFutrue.amount / (initData.amount + 0.0375) * form.lever_rate }}  //  -->
+                <!-- {{ initFutrue.amount }} // 余额 -->
+              </span>
+              {{ form.lever_rate }}
               <span
                 class="font-22 font-400 textColor"
                 v-if="form.lever_rate == 25"
               >
                 {{
                   Math.floor(
-                    (initFutrue.amount - initFutrue.amount * 0.0375) /
-                      initData.amount
+                    (initFutrue.amount / (initData.amount + 0.0375)) *
+                      form.lever_rate
                   )
                 }}
-                {{ $t("张") }}
+                {{ $t("手数") }}
               </span>
               <span
                 class="font-22 font-400 textColor"
@@ -213,11 +215,11 @@
               >
                 {{
                   Math.floor(
-                    (initFutrue.amount - initFutrue.amount * 0.075) /
-                      initData.amount
+                    (initFutrue.amount / (initData.amount + 0.075)) *
+                      form.lever_rate
                   )
                 }}
-                {{ $t("张") }}
+                {{ $t("手数") }}
               </span>
               <span
                 class="font-22 font-400 textColor"
@@ -225,11 +227,11 @@
               >
                 {{
                   Math.floor(
-                    (initFutrue.amount - initFutrue.amount * 0.15) /
-                      initData.amount
+                    (initFutrue.amount / (initData.amount + 0.15)) *
+                      form.lever_rate
                   )
                 }}
-                {{ $t("张") }}
+                {{ $t("手数") }}
               </span>
               <span
                 class="font-22 font-400 textColor"
@@ -237,11 +239,11 @@
               >
                 {{
                   Math.floor(
-                    (initFutrue.amount - initFutrue.amount * 0.3) /
-                      initData.amount
+                    (initFutrue.amount / (initData.amount + 0.3)) *
+                      form.lever_rate
                   )
                 }}
-                {{ $t("张") }}
+                {{ $t("手数") }}
               </span>
             </div>
             <!-- <vue-slider v-bind="options" v-model="form.amount"></vue-slider> -->
@@ -270,20 +272,16 @@
             <div class="flex justify-between mt-30">
               <div class="text-grey">{{ $t("合约金额") }}</div>
               <div class="textColor">
-                {{
-                  (
-                    initData.amount *
-                    (form.amount / 1) *
-                    form.lever_rate
-                  ).toFixed(4)
-                }}
+                {{ (form.amount * initData.amount).toFixed(4) }}
                 USDT
               </div>
             </div>
             <div class="flex justify-between mt-30">
               <div class="text-grey">{{ $t("保证金") }}</div>
               <div class="textColor">
-                {{ ((initData.amount * (form.amount / 1)) | nan).toFixed(4) }}
+                {{
+                  ((form.amount * initData.amount) / form.lever_rate).toFixed(4)
+                }}
                 USDT
               </div>
             </div>
@@ -307,7 +305,7 @@
                 USDT
               </div>
               <div class="textColor" v-if="form.lever_rate == 200">
-                {{ (initData.amount * (form.amount / 1) * 0.3).toFixed(4) }}
+                {{ ((form.amount * 0.3) / form.lever_rate).toFixed(4) }}
                 USDT
               </div>
             </div>
@@ -803,7 +801,7 @@
         stop_price_profit: "",
         stop_price_loss: "",
         price: "",
-        amount: "", // 数量
+        amount: 0, // 数量
         para_id: "", // 交割周琦id
       },
       focus: false,
@@ -859,7 +857,7 @@
   methods: {
     //获取张数
     getAmount(val) {
-      this.form.amount = val;
+      this.form.amount = val || 0;
       // if(this.form.lever_rate==25){
       //  this.form.amount = Math.floor((this.initFutrue.amount-(this.initFutrue.amount *  0.0375))/this.initData.amount)
       // }else if(this.form.lever_rate==50){
@@ -876,23 +874,31 @@
       // vol = this.initOpen.volume / 1;
       if (this.form.lever_rate == 25) {
         vol = Math.floor(
-          (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
-            this.initData.amount
+          // (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
+          //   this.initData.amount
+          (this.initFutrue.amount / (this.initData.amount + 0.0375)) *
+            this.form.lever_rate
         );
       } else if (this.form.lever_rate == 50) {
         vol = Math.floor(
-          (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
-            this.initData.amount
+          // (this.initFutrue.amount - this.initFutrue.amount * 0.0375) /
+          //   this.initData.amount
+          (this.initFutrue.amount / (this.initData.amount + 0.075)) *
+            this.form.lever_rate
         );
       } else if (this.form.lever_rate == 100) {
         vol = Math.floor(
-          (this.initFutrue.amount - this.initFutrue.amount * 0.15) /
-            this.initData.amount
+          // (this.initFutrue.amount - this.initFutrue.amount * 0.15) /
+          //   this.initData.amount
+          (this.initFutrue.amount / (this.initData.amount + 0.15)) *
+            this.form.lever_rate
         );
       } else {
         vol = Math.floor(
-          (this.initFutrue.amount - this.initFutrue.amount * 0.3) /
-            this.initData.amount
+          // (this.initFutrue.amount - this.initFutrue.amount * 0.3) /
+          //   this.initData.amount
+          (this.initFutrue.amount / (this.initData.amount + 0.3)) *
+            this.form.lever_rate
         );
       }
       return Math.floor(vol);
diff --git a/src/i18n/CN/index.js b/src/i18n/CN/index.js
index 014b5b5..ca93bd8 100644
--- a/src/i18n/CN/index.js
+++ b/src/i18n/CN/index.js
@@ -1076,6 +1076,8 @@
     '可用USDT': '可用USDT',
     '张': '張',
     '可开张数': '可開張數',
+    '可开': '可開',
+    '手数': '手數',
     '证件照片': '證件照片',
     "可平张数": "可平張數",
     "交易量": "交易量",
diff --git a/src/i18n/Indonesian/index.js b/src/i18n/Indonesian/index.js
index c65a864..b4c4059 100644
--- a/src/i18n/Indonesian/index.js
+++ b/src/i18n/Indonesian/index.js
@@ -1,41 +1,41 @@
 export default {
-	"ICO": "ICO",
-	"ICO记录": "Catatan ICO",
-	"申请时间": "Waktu aplikasi",
-	"认缴": "berlangganan",
-	"已认购": "Sudah berlangganan",
-	"已中签": "Menang",
-	"已认缴": "Sudah berlangganan",
-	"未中签": "Tidak Menang",
-	"单价:": "Harga satuan:",
-	"认购": "berlangganan",
-	"新币预览": "Pratinjau Koin Baru",
-	"配售": "Menempatkan",
-	"中签结果": "Hasil Kemenangan",
-	"认购成功": "Langganan berhasil",
-	"认缴成功": "Langganan berhasil",
-	"配售成功": "Penempatan berhasil",
-	"认购时间": "Waktu berlangganan",
-	"配售时间": "Waktu penempatan",
-	"中签": "Menang",
-	"上市时间": "Waktunya memasarkan",
-	"开始时间": "waktu mulai",
-	"结束时间": "waktu berakhir",
-	"钱包余额": "Saldo Dompet",
-	"总价": "Total Harga",
-	'请输入止盈金额': 'Ambil jumlah keuntungan',
-	'请输入止损金额': 'Hentikan jumlah kerugian',
-    "当前有待处理提现订单,请稍后提现!":"Saat ini ada pesanan penarikan yang tertunda, harap tarik nanti!",
-    '未绑定谷歌验证器,暂时无法提现,点击前往绑定':`Unbound Google Authenticator, untuk sementara tidak dapat menarik uang tunai, klik untuk mengikat`,
-    '请输入谷歌验证码':'Silakan masukkan kode verifikasi Google',
-    '需要绑定谷歌验证器才可以提现':'Anda harus mengikat Google Authenticator untuk menarik uang tunai',
+    "ICO": "ICO",
+    "ICO记录": "Catatan ICO",
+    "申请时间": "Waktu aplikasi",
+    "认缴": "berlangganan",
+    "已认购": "Sudah berlangganan",
+    "已中签": "Menang",
+    "已认缴": "Sudah berlangganan",
+    "未中签": "Tidak Menang",
+    "单价:": "Harga satuan:",
+    "认购": "berlangganan",
+    "新币预览": "Pratinjau Koin Baru",
+    "配售": "Menempatkan",
+    "中签结果": "Hasil Kemenangan",
+    "认购成功": "Langganan berhasil",
+    "认缴成功": "Langganan berhasil",
+    "配售成功": "Penempatan berhasil",
+    "认购时间": "Waktu berlangganan",
+    "配售时间": "Waktu penempatan",
+    "中签": "Menang",
+    "上市时间": "Waktunya memasarkan",
+    "开始时间": "waktu mulai",
+    "结束时间": "waktu berakhir",
+    "钱包余额": "Saldo Dompet",
+    "总价": "Total Harga",
+    '请输入止盈金额': 'Ambil jumlah keuntungan',
+    '请输入止损金额': 'Hentikan jumlah kerugian',
+    "当前有待处理提现订单,请稍后提现!": "Saat ini ada pesanan penarikan yang tertunda, harap tarik nanti!",
+    '未绑定谷歌验证器,暂时无法提现,点击前往绑定': `Unbound Google Authenticator, untuk sementara tidak dapat menarik uang tunai, klik untuk mengikat`,
+    '请输入谷歌验证码': 'Silakan masukkan kode verifikasi Google',
+    '需要绑定谷歌验证器才可以提现': 'Anda harus mengikat Google Authenticator untuk menarik uang tunai',
     '请输入试用码': 'Silakan masukkan kode uji coba',
     '试用账号申请': 'Aplikasi akun percobaan',
     '试用码': 'Kode percobaan',
     '点此联系客服': 'Klik di sini untuk menghubungi layanan pelanggan',
     '取得试用码': 'Dapatkan kode percobaan',
     '试用账户': 'Akun demo',
-    '已开通账户':'Akun telah dibuka',
+    '已开通账户': 'Akun telah dibuka',
     '主题模式': 'Modus tema',
     '白天模式': 'Modus siang',
     '黑夜模式': 'Mode gelap',
@@ -1124,6 +1124,7 @@
     '可用USDT': 'USDT yang bisa digunakan',
     '张': 'Lembar',
     '可开张数': 'Lembar yang dapat dibuka',
+    '手数': 'Jumlah',
     '证件照片': 'Foto identitas',
     "可平张数": "Lembar yang dapat diperlihatkan",
     "交易量": "Jumlah transaksi",
diff --git a/src/i18n/en-US/index.js b/src/i18n/en-US/index.js
index 3ec3c8f..2602b5b 100644
--- a/src/i18n/en-US/index.js
+++ b/src/i18n/en-US/index.js
@@ -1084,6 +1084,8 @@
   "可用USDT": 'Available USDT',
   "张": 'volumes',
   "可开张数": 'Volumes available',
+  '手数': 'Hands',
+  '可开': 'Open',
   "证件照片": 'ID Photos',
   '结算价格': 'Settlement price',
   '。您可以在钱包账户中查看详情。': '. You can check the details in your wallet account.',
diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js
index 36997f4..0c359f8 100644
--- a/src/i18n/es/index.js
+++ b/src/i18n/es/index.js
@@ -1054,6 +1054,7 @@
   "可用USDT": "Disponible en USDT",
   "张": "sábana",
   "可开张数": "Número de aperturas",
+  '手数': 'Número de pedidos',
   "证件照片": "Foto de carné",
   "可平张数": "Número de hojas planas",
   "交易量": "Volumen de operaciones",
diff --git a/src/request/httpAxios.js b/src/request/httpAxios.js
index e83cfe9..540d605 100644
--- a/src/request/httpAxios.js
+++ b/src/request/httpAxios.js
@@ -20,7 +20,7 @@
 // 创建
 const request = axios.create({
   baseURL: baseUrl,
-  timeout: 8000, // 超时时间
+  timeout: 8000000, // 超时时间
   //   withCredentials: true,
   headers: {
     "Content-Type": "application/json;charset=UTF-8",
@@ -109,7 +109,7 @@
   },
   (error) => {
     if (error.code == "ERR_NETWORK") {
-      Toast({ message: "ERR_NETWORK", type: "fail", duration: 1000 });
+      // Toast({ message: "ERR_NETWORK", type: "fail", duration: 1000 });
     } else if (error.code == "ECONNABORTED") {
       //Toast({ message: 'Network Timeout', type: 'fail', duration: 2000 })
       return Promise.reject(error);
diff --git a/src/request/index.js b/src/request/index.js
index 281011a..453431a 100644
--- a/src/request/index.js
+++ b/src/request/index.js
@@ -16,7 +16,7 @@
 // 创建
 const request = axios.create({
   baseURL: baseUrl,
-  timeout: 8000, // 超时时间
+  timeout: 8000000, // 超时时间
   //   withCredentials: true,
   headers: {
     'Content-Type': 'application/json;charset=UTF-8',
@@ -28,7 +28,7 @@
 // 拦截请求
 request.interceptors.request.use(config => {
   if (config.loading) {
-    Toast.loading({ duration: 0, forbidClick: true })
+    // Toast.loading({ duration: 0, forbidClick: true })
   }
   //if (store?.state?.user?.userInfo?.token) {
   if (store.state.user.userInfo.token != undefined && store.state.user.userInfo.token !== '') {
@@ -60,7 +60,7 @@
 // 拦截响应
 request.interceptors.response.use(res => { // 200开头的
   if (res.config.loading) {
-    Toast.clear()
+    // Toast.clear()
   }
 
   // console.log(res);
@@ -81,17 +81,17 @@
     // break;
     default:
       if (msg != undefined) {
-        Toast.fail({
-          // icon: 'none',
-          message: i18n.t(msg)
-        });
+        // Toast.fail({
+        //   // icon: 'none',
+        //   message: i18n.t(msg)
+        // });
       }
       //console.log('错误')
       return Promise.reject(res.data)
   }
 }, error => {
   if (error.code == 'ERR_NETWORK') {
-    Toast({ message: 'ERR_NETWORK', type: 'fail', duration: 1000 })
+    // Toast({ message: 'ERR_NETWORK', type: 'fail', duration: 1000 })
   } else if (error.code == 'ECONNABORTED') {
     //Toast({ message: 'Network Timeout', type: 'fail', duration: 2000 })
     return Promise.reject(error);

--
Gitblit v1.9.3