From 68a34d95db63a264e7a577051d586ea496c63ca0 Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Sat, 29 Jun 2024 18:31:56 +0800
Subject: [PATCH] 123

---
 src/components/perpetual-open/index.vue |  125 ++++++++++++++++++++---------------------
 1 files changed, 60 insertions(+), 65 deletions(-)

diff --git a/src/components/perpetual-open/index.vue b/src/components/perpetual-open/index.vue
index 9e127cd..156f7a1 100644
--- a/src/components/perpetual-open/index.vue
+++ b/src/components/perpetual-open/index.vue
@@ -45,12 +45,13 @@
         </div>
       </div>
       <div>
-        <img
-          src="../../assets/image/public/k-line.png"
-          alt="line-img"
-          class="w-38 h-35"
-          @click="jump"
-        />
+        <span @click="jump">
+          <img
+            src="../../assets/image/public/k-line.png"
+            alt="line-img"
+            class="w-38 h-35"
+          />
+        </span>
       </div>
     </div>
     <div class="pt-30 pb-20">
@@ -63,7 +64,7 @@
             </div>
             <div class="text-right items-end justify-end">
               <div class="">{{ $t("数量") }}</div>
-              <div class="mt-4">({{ symbol.toUpperCase() || "--" }})</div>
+              <div class="mt-4">({{ symbol | _symbolName() }})</div>
             </div>
           </div>
           <div
@@ -169,22 +170,22 @@
         </div>
         <div class="w-440 flex flex-col">
           <template v-if="selectIndex == 1">
-            <div class="flex items-center h-66 rounded-lg text-grey">
-              <p
+            <!-- <div class="flex items-center h-66 rounded-lg text-grey"> -->
+             <!-- <p
                 class="font-28 flex-1 flex items-center justify-center h-66 long"
                 :class="currentType == 'long' ? 'long' : ''"
                 @click="changeTab('long')"
               >
                 {{ $t("开多") }}
-              </p>
-              <p
+              </p> -->
+              <!-- <p
                 class="font-28 flex-1 ml-20 flex items-center justify-center h-66 short"
                 :class="currentType == 'short' ? 'short' : ''"
                 @click="changeTab('short')"
               >
                 {{ $t("开空") }}
-              </p>
-            </div>
+              </p> -->
+            <!-- </div> -->
             <div class="mt-30 mb-30" style="position: relative">
               <div
                 class="box-show flex justify-between items-center w-full h-76 rounded-lg textColor"
@@ -220,41 +221,7 @@
             :initFutrue="initFutrue"
             @paraId="onParaId"
           />
-          <div
-            class="h-76 lh-76 mb-30 flex pr-20 justify-center rounded-lg newcolor1 box-show"
-            v-if="selectIndex == 1"
-          >
-            <input
-              placeholder=""
-              class="w-full pl-20 h-76 border-none text-left rounded-lg"
-              :disabled="type / 1 === 1"
-              @focus="focus = true"
-              v-model="form.price"
-            />
-            <span class="ml-20">USDT</span>
-          </div>
-          <!-- <div
-            class="h-76 lh-76 inputBackground mb-30 flex pr-20 justify-center rounded-lg textColor"
-            v-if="selectIndex == 1"
-          >
-            <input
-              :placeholder="selectIndex == 1 ? $t('请输入止盈金额') : ''"
-              class="inputBackground pl-20 h-76 border-none text-left rounded-lg"
-              v-model="form.stop_price_profit"
-            />
-            <span class="font-22 font-400 textColor">{{ $t("止盈") }}</span>
-          </div> -->
-          <!-- <div
-            class="h-76 lh-76 inputBackground mb-30 flex pr-20 justify-center rounded-lg textColor"
-            v-if="selectIndex == 1"
-          >
-            <input
-              :placeholder="selectIndex == 1 ? $t('请输入止损金额') : ''"
-              class="inputBackground pl-20 h-76 border-none text-left rounded-lg"
-              v-model="form.stop_price_loss"
-            />
-            <span class="font-22 font-400 textColor">{{ $t("止损") }}</span>
-          </div> -->
+          
           <div class="w-440 flex items-center box-show h-76 lh-76 rounded-lg">
             <div
               v-if="selectIndex == 1"
@@ -277,7 +244,7 @@
                   ? $t('最小金额') + initFutrue.para[paraIndex].buy_min
                   : ''
               "
-              class="border-none text-center newcolor1"
+              class="border-none text-center "
               style="width: 156px"
               v-model="form.amount"
               type="number"
@@ -288,12 +255,13 @@
               style="height: 100%"
             >
               <template v-if="selectIndex == 1">
-                <img
-                  @click="onAdd"
-                  src="../../assets/image/public/add.png"
-                  alt="reduce"
-                  class="w-30 h-30"
-                />
+                <div @click="onAdd">
+                  <img
+                    src="../../assets/image/public/add.png"
+                    alt="reduce"
+                    class="w-30 h-30"
+                  />
+                </div>
               </template>
               <template v-else>
                 <span class="textColor">USDT</span>
@@ -310,6 +278,31 @@
                 {{ $t("张") }}
               </span>
             </div>
+			<!-- <div
+			  class="h-76 lh-76 inputBackground mb-30 flex pr-20 justify-center rounded-lg textColor" style="margin-top:20px"
+			>
+			 <input
+			    :placeholder="selectIndex == 1 ? $t('请输入止盈金额') : ''"
+			    class="inputBackground pl-20 h-76 border-none text-left rounded-lg"
+			    v-model="form.stop_price_profit"
+			  />
+			  <span class="font-22 font-400 textColor">{{ $t("止盈") }}</span>
+			</div>
+			<div
+			  class="h-76 lh-76 inputBackground mb-30 flex pr-20 justify-center rounded-lg textColor" style="margin-bottom:20px"
+			  v-if="selectIndex == 1"
+			>
+			  <input
+			    :placeholder="selectIndex == 1 ? $t('请输入止损金额') : ''"
+			    class="inputBackground pl-20 h-76 border-none text-left rounded-lg"
+			    v-model="form.stop_price_loss"
+			  />
+			  <span class="font-22 font-400 textColor">{{ $t("止损") }}</span>
+			</div> -->
+			<!-- <div class="btn" style="width: 100%;display: flex;justify-content: center;align-items: center;">
+						 <div class="btn_right" style="width: 50%;text-align: center;height: 100%;display: flex;justify-content: center;align-items: center;">{{$t('取消')}}</div>
+						 <div class="btn_left" @click="iszyzs=false" style="width: 50%;text-align: center;height: 100%;display: flex;justify-content: center;align-items: center;">{{$t('确认')}}</div>
+			</div> -->
             <!-- <vue-slider v-bind="options" v-model="form.amount"></vue-slider> -->
             <!-- <vue-slider class="mainBox" v-bind="options" :marks="marks" v-model="form.volume" :hide-label="true"  width="90%"
               :railStyle="{ background: '#404040', height: '4px' }"
@@ -333,6 +326,10 @@
             ></amount-slider>
           </template>
           <template v-if="selectIndex == 1 && userInfo.token">
+			  <div class="flex justify-between mt-30">
+			    <div class="newcolor1">{{ $t("可用USDT") }}</div>
+			    <div class="textColor">{{ initFutrue.amount | nan }} USDT</div>
+			  </div>
             <div class="flex justify-between mt-30">
               <div class="newcolor1">{{ $t("合约金额") }}</div>
               <div class="textColor">
@@ -385,7 +382,6 @@
             <template v-if="selectIndex == 1">
               <div
                 class="w-full h-80 lh-80 bg-green flex text-white rounded-md mt-50"
-                v-if="currentType == 'long'"
                 @click="order('long')"
               >
                 <div
@@ -408,7 +404,6 @@
               </div>
               <div
                 class="w-full h-80 lh-80 bg-red flex text-white rounded-md mt-50"
-                v-if="currentType == 'short'"
                 @click="order('short')"
               >
                 <div
@@ -417,9 +412,6 @@
                   v-if="selectIndex == 1"
                 >
                   {{ $t("开空") }}
-                  <!-- <span class="right-word font-22 text-center">{{
-                    $t("看跌")
-                  }}</span> -->
                 </div>
                 <div
                   class="relative font-34 text-center"
@@ -438,9 +430,9 @@
               >
                 <div class="font-34 relative text-center" style="flex-grow: 1">
                   {{ $t("开多") }}
-                  <span class="right-word font-22 text-center">{{
+                <!--  <span class="right-word font-22 text-center">{{
                     $t("看涨")
-                  }}</span>
+                  }}</span> -->
                 </div>
               </div>
               <div
@@ -452,9 +444,9 @@
               >
                 <div class="relative font-34 text-center" style="flex-grow: 1">
                   {{ $t("开空") }}
-                  <span class="right-word font-22 text-center">{{
+                  <!-- <span class="right-word font-22 text-center">{{
                     $t("看跌")
-                  }}</span>
+                  }}</span> -->
                 </div>
               </div>
             </template>
@@ -474,6 +466,7 @@
         </div>
       </div>
     </div>
+	
     <van-popup v-model="show" class="rounded-2xl">
       <popup-delivery
         showBtns
@@ -586,7 +579,7 @@
         this.form.price = val;
       }
       this.form.para_id =
-        this.initFutrue.para && this.initFutrue.para[this.paraIndex].para_id; // 不优雅,不可靠
+        this.initFutrue.para && this.initFutrue.para[this.paraIndex]?.para_id; // 不优雅,不可靠
       // this.form.symbol = this.symbol.toLowerCase()
     },
     initOpen: {
@@ -668,6 +661,7 @@
       theme: "home/theme",
     }),
     initData() {
+		
       let obj = null;
       if (this.selectIndex / 1 === 1) {
         obj = this.initOpen;
@@ -703,6 +697,7 @@
       value: 0,
       isShow: false,
       title: this.$t("市价"),
+	  iszyzs:false,
       paraIndex: 0,
       selectData: [
         { title: this.$t("市价"), type: "1" },

--
Gitblit v1.9.3