Handy_Cao 2 jaren geleden
bovenliggende
commit
2792f90586

+ 21 - 3
src/packages/mobile/views/swap/detail/components/delisting/Index.vue

@@ -31,8 +31,16 @@
             </Field>
             <Field name="OrderQty" :rules="formRules.OrderQty" label="挂牌数量">
                 <template #input>
-                    <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0" :step="0.01"
-                        :max="selectedRow.orderqty" :auto-fixed="false" @change="calculateDelistingAmount"/>
+                    <div class="g-qty-group">
+                        <div class="g-qty-group__stepper">
+                            <Stepper v-model="formData.OrderQty" theme="round" :max="selectedRow.orderqty" button-size="22" :min="0"
+                                :step="qtyStep" integer  @change="calculateDelistingAmount"/>
+                        </div>
+                        <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
+                            <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
+                            </Radio>
+                        </RadioGroup>
+                    </div>
                 </template>
             </Field>
             <Field label="估算金额" v-if="priceMove === 3">
@@ -64,6 +72,7 @@ import { handleRequestBigNumber } from '@/filters'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
 import { useOrder } from '@/business/trade'
+import { BuyOrSell } from '@/constants/order'
 import { fullloading, dialog } from '@/utils/vant'
 import { useRequest } from '@/hooks/request'
 import { queryTjmdTodayAccountMargin } from '@/services/api/swap'
@@ -72,7 +81,10 @@ import AppPopup from '@mobile/components/base/popup/index.vue'
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
 const { formData, formSubmit } = useOrder()
-
+// 数量步长列表
+const qtyStepList = [1, 5, 10, 20, 30, 50]
+// 数量步长
+const qtyStep = shallowRef(qtyStepList[0]) 
 /// 挂牌金额
 const amount = shallowRef(0.0)
 /// 履约保证金
@@ -137,6 +149,12 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
     }],
 }
 
+const onRadioChange = (value: number) => {
+    formData.OrderQty = value
+    /// 计算摘牌金额
+    calculateDelistingAmount()
+}
+
 /// 查询交易保证金信息
 useRequest(queryTjmdTodayAccountMargin, {
     params: {

+ 22 - 4
src/packages/mobile/views/swap/detail/components/listing/Index.vue

@@ -20,19 +20,28 @@
             </Field>
             <Field name="OrderPrice" :rules="formRules.OrderPrice" label="挂牌价格" v-if="priceMove === 2">
                 <template #input>
-                    <Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :auto-fixed="false"
+                    <Stepper v-model="formData.OrderPrice" input-width="160px" theme="round" button-size="22" :auto-fixed="false"
                         :step="0.01" @change="calculateListingAmount"/>
                 </template>
             </Field>
             <Field name="MarketMaxSub" :rules="formRules.MarketMaxSub" label="点差" v-if="priceMove === 3">
                 <template #input>
-                    <Stepper v-model="formData.MarketMaxSub" theme="round" button-size="22" :auto-fixed="false"
+                    <Stepper v-model="formData.MarketMaxSub" input-width="160px" theme="round" button-size="22" :auto-fixed="false"
                         :step="0.01" @change="calculateListingAmount"/>
                 </template>
             </Field>
             <Field name="OrderQty" :rules="formRules.OrderQty" label="挂牌数量">
                 <template #input>
-                    <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :auto-fixed="false" integer @change="calculateListingAmount" />
+                    <div class="g-qty-group">
+                        <div class="g-qty-group__stepper">
+                            <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0"
+                                :step="qtyStep" integer  @change="calculateListingAmount"/>
+                        </div>
+                        <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
+                            <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
+                            </Radio>
+                        </RadioGroup>
+                    </div>
                 </template>
             </Field>
             <Field label="估算价格" v-if="priceMove === 3">
@@ -98,7 +107,10 @@ const props = defineProps({
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
 const userStore = useUserStore()
-
+// 数量步长列表
+const qtyStepList = [1, 5, 10, 20, 30, 50]
+// 数量步长
+const qtyStep = shallowRef(qtyStepList[0]) 
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据
@@ -194,6 +206,12 @@ const calculateListingAmount = () => {
     }
 }
 
+const onRadioChange = (value: number) => {
+    formData.OrderQty = value
+    /// 计算挂牌金额
+    calculateListingAmount()
+}
+
 /// 计算基差范围
 const calculateBasis = () => {
      /// 获取配置