فهرست منبع

xxxx 修改水贝亿爵的Bug

Handy_Cao 2 سال پیش
والد
کامیت
d46f6d3d3e

+ 3 - 0
src/filters/index.ts

@@ -145,6 +145,9 @@ export function handleRequestBigNumber(value: string) {
  * @param decimal 保留小数位
  */
 export function parsePercent(value = 0, decimal = 2) {
+    if (Number.isNaN(value)) {
+        return 0
+    }
     const val = formatDecimal(value * 100, decimal, false)
     return val + '%'
 }

+ 1 - 1
src/packages/sbyj/views/order/history/index.vue

@@ -21,7 +21,7 @@
                                 <li>
                                     <span>订单重量</span>
                                     <span>
-                                        {{ item.holderqty * item.agreeunit }}
+                                        {{ item.openqty * item.agreeunit }}
                                         {{ getGoodsUnitName(item.goodunitid) }}
                                     </span>
                                 </li>

+ 21 - 0
src/packages/sbyj/views/order/list/components/close-holder/index.less

@@ -0,0 +1,21 @@
+.g-form {
+    .form-price {
+        display: flex;
+        padding: .32rem 0;
+    
+        dl {
+            flex: 1;
+            text-align: center;
+    
+            dt {
+                margin-bottom: .1rem;
+            }
+    
+            dd {
+                font-size: .56rem;
+                font-weight: bold;
+            }
+        }
+    }
+}
+

+ 16 - 2
src/packages/sbyj/views/order/list/components/close-holder/index.vue

@@ -5,6 +5,16 @@
             <template #header>
                 <app-navbar title="订单转让" @back="closed" />
             </template>
+            <div class="form-price" v-if="quote">
+                <dl>
+                    <dt>回购价</dt>
+                    <dd :class="quote.bidColor">{{ handleNumberValue(formatDecimal(quote.bid, quote.decimalplace)) }}</dd>
+                </dl>
+                <dl>
+                    <dt>销售价</dt>
+                    <dd :class="quote.askColor">{{ handleNumberValue(formatDecimal(quote.ask, quote.decimalplace)) }}</dd>
+                </dl>
+            </div>
             <Form ref="formRef" class="g-form__container" @submit="onSubmit">
                 <CellGroup inset>
                     <Cell title="可用重量" :value="enableqty + getGoodsUnitName(selectedRow.goodsUnitID)" />
@@ -38,7 +48,7 @@
 import { shallowRef, PropType, onMounted, onUnmounted, computed } from 'vue'
 import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule, RadioGroup, Radio } from 'vant'
 import { fullloading } from '@/utils/vant'
-import { handleRequestBigNumber } from '@/filters'
+import { handleRequestBigNumber, handleNumberValue, formatDecimal } from '@/filters'
 import { getGoodsUnitName } from '@/constants/unit'
 import { useOrder } from '@/business/trade'
 import { useFuturesStore } from '@/stores'
@@ -143,4 +153,8 @@ onUnmounted(() => subscribe.stop())
 defineExpose({
     closed,
 })
-</script>
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>