Handy_Cao 3 ay önce
ebeveyn
işleme
adf9b762d8

+ 20 - 3
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -90,7 +90,7 @@ import { Form, FormInstance, Button, CellGroup, FieldRule, Field, RadioGroup, Ra
 import { fullloading, dialog } from '@/utils/vant'
 import { BuyOrSell } from '@/constants/order'
 import { useOrder } from '@/business/trade'
-import { useAccountStore, useFuturesStore, usePositionStore } from '@/stores'
+import { useAccountStore, useFuturesStore, usePositionStore, useUserStore } from '@/stores'
 import { EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType, EOrderOperateType } from '@/constants/client'
 import AppModal from '@/components/base/modal/index.vue'
 import Stepper from '@mobile/components/base/stepper/index.vue'
@@ -112,6 +112,7 @@ const props = defineProps({
     }
 })
 
+const userStore = useUserStore()
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
 const positionStore = usePositionStore()
@@ -122,8 +123,24 @@ const { formData, formSubmit } = useOrder()
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据
-const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
-const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
+
+
+// 数量步长列表
+const qtyStepList = computed(() => {
+    // 任务 #6640
+    const param1009 = userStore.getSystemParamValue('1009')
+
+    if (param1009) {
+        const values = param1009.split(',')
+        const { traderules = [], agreeunit = 0 } = quote.value ?? {}
+        const { ParamValue = 1 } = traderules.find((e) => e.RuleID === 103) ?? {}
+        const min = ParamValue * agreeunit // ParamValue 是数量
+
+        return values.map((value) => (+value) * min)
+    }
+    return []
+})
+const qtyStep = shallowRef(qtyStepList.value[0]) // 数量步长
 
 const isTrademode16 = computed(() => quote.value?.trademode === 16)
 

+ 19 - 3
src/packages/pc/views/market/trade/goods/list/listing/index.vue

@@ -90,22 +90,38 @@ import { ElMessage, ElMessageBox, FormInstance, FormRules } from 'element-plus'
 import { EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType, EOrderOperateType } from '@/constants/client'
 import { BuyOrSell, getBuyOrSellList } from '@/constants/order'
 import { useOrder } from '@/business/trade'
-import { useFuturesStore, useSettingStore, useAccountStore, usePositionStore, i18n } from '@/stores'
+import { useFuturesStore, useSettingStore, useAccountStore, usePositionStore, useUserStore, i18n } from '@/stores'
 import Forex from '@pc/components/modules/quote/forex/index.vue'
 import Icon from '@pc/components/base/icon/index.vue'
 
 const accountStore = useAccountStore()
 const settingStore = useSettingStore()
+const userStore = useUserStore()
 const futuresStore = useFuturesStore()
 
 const { selectedGoodsId, selectedGoods, marketGoodsList } = futuresStore.$toRefs()
 const { formData, loading, formSubmit } = useOrder()
 const positionStore = usePositionStore()
 const formRef = shallowRef<FormInstance>()
-const qtyStepList = [1, 10, 100] // 数量步长列表
-const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 const { t } = i18n.global
 
+// 数量步长列表
+const qtyStepList = computed(() => {
+    // 任务 #6640
+    const param1009 = userStore.getSystemParamValue('1009')
+
+    if (param1009) {
+        const values = param1009.split(',')
+        const { traderules = [], agreeunit = 0 } = selectedGoods.value ?? {}
+        const { ParamValue = 1 } = traderules.find((e) => e.RuleID === 103) ?? {}
+        const min = ParamValue * agreeunit // ParamValue 是数量
+
+        return values.map((value) => (+value) * min)
+    }
+    return []
+})
+const qtyStep = shallowRef(qtyStepList.value[0]) // 数量步长
+
 const priceRef = shallowRef()
 const qtyRef = shallowRef()
 const submitRef = shallowRef()

+ 1 - 2
src/packages/sbyj/views/market/detail/composables.ts

@@ -25,7 +25,6 @@ export function useSetup() {
     const goodscode = getQueryString('goodscode') ?? ''
     const quote = futuresStore.getGoodsQuote(goodscode)
     const goods = futuresStore.getGoods(goodscode)
-    const qtyStep = shallowRef(1) // 数量步长
     const orderQty = shallowRef(1) // 数量
     const subscribe = quoteSocket.createSubscribe()
 
@@ -56,9 +55,9 @@ export function useSetup() {
 
             return values.map((value) => (+value) * min)
         }
-
         return []
     })
+    const qtyStep = shallowRef(qtyStepList.value[0]) // 数量步长
 
     //  获取用户交易个性化设置
     const { dataList: settings } = useRequest(queryUserTradeSettings)