huangbin 4 年之前
父节点
当前提交
265fb3432c

+ 5 - 3
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/delisting/index.vue

@@ -87,8 +87,8 @@
                                 :min="0"
                                 :max="99"
                                 v-model:value="formState.num" />
-                <MinusOutlined @click="decreasePrice" />
-                <PlusOutlined @click="increasePrice" />
+                <MinusOutlined @click="decreaseNumber" />
+                <PlusOutlined @click="increaseNumber" />
                 <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
               </a-form-item>
             </a-col>
@@ -172,7 +172,7 @@ import { v4 as uuidv4 } from 'uuid';
 import { defineComponent, PropType, ref } from 'vue';
 import { useUserType } from '../setup';
 import { FormParam } from './interface';
-import { handleForm } from './setup';
+import { handleForm, useBlocksPrice, useBlocksNumber } from './setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -292,6 +292,8 @@ export default defineComponent({
             isBuy,
             useUserType,
             isLimit,
+            ...useBlocksPrice(),
+            ...useBlocksNumber(),
         };
     },
 });

+ 28 - 1
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/delisting/setup.ts

@@ -28,4 +28,31 @@ export function handleForm() {
         formRef.value.resetFields()
     })
     return { rules, formState, formRef }
-}
+}
+
+// 价格
+export const useBlocksPrice = () => {
+    const priceCheck = ref<boolean>(false); // 是否可议价
+    function increasePrice() {
+        formState.price++;
+    }
+    function decreasePrice() {
+        if (formState.price) {
+            formState.price--;
+        }
+    }
+    return { priceCheck, increasePrice, decreasePrice };
+};
+
+// 数量
+export const useBlocksNumber = () => {
+    function increaseNumber() {
+        formState.num++;
+    }
+    function decreaseNumber() {
+        if (formState.num) {
+            formState.num--;
+        }
+    }
+    return { increaseNumber, decreaseNumber };
+};