Handy_Cao 1 год назад
Родитель
Сommit
aa3e315cf7

+ 12 - 7
src/packages/mobile/views/pricing/detail/components/trade/Index.vue

@@ -41,11 +41,11 @@
                         </template>
                     </Field> 
                     <!-- 市价 -->
-                    <Field label="价格" v-if="formData.PriceMode === PriceMode.Market">
+                    <!-- <Field label="价格" v-if="formData.PriceMode === PriceMode.Market">
                         <template #input>
                             <span>{{ handleNumberValue(marketPrice) }}</span>
                         </template>
-                    </Field>
+                    </Field> -->
                     <!-- 允许成交范围 -->
                     <Field name="MarketMaxSub" label="允许成交范围" v-if="formData.PriceMode === PriceMode.Market">
                         <template #input>
@@ -57,7 +57,7 @@
                     <Field name="OrderPrice" :rules="formRules.OrderPrice" label="价格" v-if="formData.PriceMode === PriceMode.Limit">
                         <template #input>
                             <Stepper v-model="formData.OrderPrice" theme="round" button-size="22" :min="0"
-                             :auto-fixed="false" :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
+                             :auto-fixed="false" :decimal-length="decimalplace" :step="decimalvalue" />
                         </template>
                     </Field>
                     <!-- <Field name="SlPrice" :rules="formRules.SlPrice"
@@ -67,7 +67,7 @@
                         </template>
                         <template #input>
                             <Stepper v-model="formData.SlPrice" :disabled="!sl" theme="round" button-size="22" allow-empty
-                                :default-value="0" :min="0" :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
+                                :default-value="0" :min="0" :decimal-length="decimalplace" :step="decimalvalue" />
                         </template>
                     </Field> -->
                     <!-- <Field name="SpPrice" :rules="formRules.SpPrice"
@@ -77,7 +77,7 @@
                         </template>
                         <template #input>
                             <Stepper v-model="formData.SpPrice" :disabled="!sp" theme="round" button-size="22" allow-empty
-                                :default-value="0" :min="0" :decimal-length="quote?.decimalplace" :step="quote?.decimalvalue" />
+                                :default-value="0" :min="0" :decimal-length="decimalplace" :step="decimalvalue" />
                         </template>
                     </Field> -->
                     <template v-if="formData.BuyOrSell === BuyOrSell.Buy || quote?.tradeproperty !== 2">
@@ -131,9 +131,8 @@
 <script lang="ts" setup>
 import { useFuturesStore, useAccountStore, usePositionStore } from '@/stores'
 import { useNavigation } from '@mobile/router/navigation'
-import { handleNumberValue } from '@/filters'
 import { shallowRef, onMounted, computed, defineAsyncComponent } from 'vue'
-import { Form, Field, Button, FieldRule, FormInstance, Radio, RadioGroup, Checkbox, CellGroup } from 'vant'
+import { Form, Field, Button, FieldRule, FormInstance, Radio, RadioGroup, CellGroup } from 'vant'
 import { useOrder } from '@/business/trade'
 import { BuyOrSell, getBuyOrSellList, BuildType, getPricemode2List, PriceMode } from '@/constants/order'
 import { fullloading, dialog } from '@/utils/vant'
@@ -162,6 +161,12 @@ const formRef = shallowRef<FormInstance>()
 const { formData, formSubmit } = useOrder()
 
 const quote = futuresStore.getGoodsQuote(props.goodsCode)
+// 小数位以及步进值
+const { decimalplace = 0.0 } = quote.value ?? {}
+const quoteminunit = quote.value?.quoteminunit ?? 1.0
+const decimalvalue = Math.pow(10.0, -decimalplace)*(quoteminunit == 0 ? 1 : quoteminunit)
+
+// 计算市价
 const marketPrice = computed(() => {
     const { ask = 0, bid = 0 } = quote.value ?? {}
     return formData.BuyOrSell === BuyOrSell.Buy ? ask : bid

+ 5 - 2
src/packages/pc/views/footer/pricing/position/components/transfer/index.vue

@@ -41,8 +41,8 @@
                 </div>
             </el-form-item>
             <el-form-item prop="OrderPrice" label="转让价格">
-                <el-input-number placeholder="请输入价格" v-model="formData.OrderPrice" :step="quote?.decimalvalue"
-                    :precision="quote?.decimalplace" />
+                <el-input-number placeholder="请输入价格" v-model="formData.OrderPrice" :step="decimalvalue"
+                    :precision="decimalplace" />
             </el-form-item>
         </el-form> 
         <template #footer>
@@ -74,6 +74,9 @@ const props = defineProps({
 
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.position.goodscode)
+const { decimalplace = 0 } = quote.value ?? {}
+const quoteminunit = quote.value?.quoteminunit ?? 1
+const decimalvalue = Math.pow(10.0, -decimalplace)*(quoteminunit == 0 ? 1 : quoteminunit)
 
 const { formSubmit, formData, loading } = useOrder()
 const show = ref(true)

+ 3 - 17
src/packages/pc/views/market/trade/pricing/list/listing/index.vue

@@ -27,21 +27,6 @@
                         </el-radio>
                     </el-radio-group>
                 </el-form-item>
-                <el-form-item label="价格" v-if="formData.PriceMode === PriceMode.Market">
-                    <div class="el-form-item--col">
-                        <span :class="lastColor">{{ marketPrice.toFixed(decimalplace) }}</span>
-                        <div v-if="selectedGoods">
-                            <div class="row-price g-price-up">
-                                <Icon icon="Top" />
-                                <span>{{ selectedGoods.limitup.toFixed(decimalplace) }}</span>
-                            </div>
-                            <div class="row-price g-price-down">
-                                <Icon icon="Bottom" />
-                                <span>{{ selectedGoods.limitdown.toFixed(decimalplace) }}</span>
-                            </div>
-                        </div>
-                    </div>
-                </el-form-item>
                 <el-form-item prop="MarketMaxSub" label="点差" v-if="formData.PriceMode === PriceMode.Market">
                     <el-input-number ref="priceRef" placeholder="请输入" :min="0" :max="9999999999" v-model="formData.MarketMaxSub" 
                     @keyup.enter="submitFocus" integer />
@@ -103,7 +88,6 @@ import { BuyOrSell, getBuyOrSellList, getPricemode2List, PriceMode, BuildType }
 import { useOrder } from '@/business/trade'
 import { useFuturesStore, useSettingStore, useAccountStore, usePositionStore } 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()
@@ -167,7 +151,9 @@ const orderBuyOrSell = computed(() => settingStore.getSettingValue('orderBuyOrSe
 // 是否禁用价格输入
 const isDisabled = computed(() => [3, 4].includes(orderPriceType.value))
 // 小数位以及步进值
-const { decimalplace = 0.0, decimalvalue = 0.0, lastColor } = selectedGoods.value ?? { }
+const { decimalplace = 0.0 } = selectedGoods.value ?? {}
+const quoteminunit = selectedGoods.value?.quoteminunit ?? 1.0
+const decimalvalue = Math.pow(10.0, -decimalplace)*(quoteminunit == 0 ? 1 : quoteminunit)
 
 const formRules: FormRules = {
     OrderPrice: [{