li.shaoyi 2 anos atrás
pai
commit
ca6ab88ce0

+ 1 - 7
src/packages/mobile/router/navigation.ts

@@ -27,12 +27,6 @@ export function useNavigation() {
         }
     }
 
-    // 获取参数字符串----废弃待优化
-    const getParamString = (name: string) => {
-        // https://github.com/vuejs/router/releases/tag/v4.1.0
-        return route.params[name] ?? ''
-    }
-
     // 获取查询字符串
     const getQueryString = (name: string) => {
         const qs = route.query[name]
@@ -105,6 +99,7 @@ export function useNavigation() {
     // 路由守卫
     const beforeRouteLeave = (callback: () => boolean) => {
         onBeforeRouteLeave((to, from, next) => {
+            console.log(to,from)
             if (callback()) {
                 next()
             } else {
@@ -119,7 +114,6 @@ export function useNavigation() {
         hasHistory,
         setGlobalUrlParams,
         getGlobalUrlParams,
-        getParamString,
         getQueryString,
         getQueryStringToNumber,
         backHome,

+ 4 - 6
src/packages/mobile/views/spot/add/components/buy/index.vue

@@ -44,7 +44,6 @@
 
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent } from 'vue'
-import { onBeforeRouteLeave } from 'vue-router'
 import { CellGroup, Button, Field, Form, FormInstance, Stepper, FieldRule, showSuccessToast, showFailToast } from 'vant'
 import { fullloading } from '@/utils/vant'
 import { handleRequestBigNumber } from '@/filters'
@@ -54,7 +53,7 @@ import { useHdWROrder } from '@/business/trade'
 const WarehouseReceipt = defineAsyncComponent(() => import('./warehouse-receipt.vue'))
 const Performance = defineAsyncComponent(() => import('@mobile/components/modules/performance/index.vue'))
 
-const { routerBack } = useNavigation()
+const { routerBack, beforeRouteLeave } = useNavigation()
 const { formData, listingSubmit, amount } = useHdWROrder()
 const formRef = shallowRef<FormInstance>()
 const performanceRef = shallowRef()
@@ -126,13 +125,12 @@ const formSubmit = () => {
 }
 
 // 离开页面前关闭组件
-onBeforeRouteLeave((to, from, next) => {
+beforeRouteLeave(() => {
     if (showWarehouseReceipt.value) {
         showWarehouseReceipt.value = false
-        next(false)
+        return false
     } else {
-        const flag = performanceRef.value?.closed()
-        next(flag)
+        return performanceRef.value?.closed()
     }
 })
 </script>

+ 3 - 5
src/packages/mobile/views/spot/add/components/sell/index.vue

@@ -59,7 +59,6 @@
 
 <script lang="ts" setup>
 import { shallowRef, computed, defineAsyncComponent } from 'vue'
-import { onBeforeRouteLeave } from 'vue-router'
 import { CellGroup, Button, Field, Form, FormInstance, Stepper, FieldRule, showSuccessToast, showFailToast } from 'vant'
 import { fullloading } from '@/utils/vant'
 import { BuyOrSell } from '@/constants/order'
@@ -72,7 +71,7 @@ import AppSelect from '@mobile/components/base/select/index.vue'
 
 const Performance = defineAsyncComponent(() => import('@mobile/components/modules/performance/index.vue'))
 
-const { routerBack } = useNavigation()
+const { routerBack, beforeRouteLeave } = useNavigation()
 const { formData, listingSubmit, amount } = useHdWROrder()
 const accountStore = useAccountStore()
 const formRef = shallowRef<FormInstance>()
@@ -175,8 +174,7 @@ const formSubmit = () => {
 }
 
 // 离开页面前关闭组件
-onBeforeRouteLeave((to, from, next) => {
-    const flag = performanceRef.value?.closed()
-    next(flag)
+beforeRouteLeave(() => {
+    return performanceRef.value?.closed()
 })
 </script>

+ 0 - 13
src/packages/mobile/views/swap/detail/components/delisting/Index.less

@@ -1,13 +0,0 @@
-.swap-delisting {
-  &__form {
-      .van-stepper {
-          display: flex;
-          align-items: center;
-          width: 100%;
-
-          &__input {
-              flex: 1;
-          }
-      }
-  }
-}

+ 25 - 17
src/packages/mobile/views/swap/detail/components/delisting/Index.vue

@@ -1,6 +1,6 @@
 <template>
-    <app-popup :title="'摘牌'" v-model:show="showModal" :refresh="refresh">
-        <Form class="swap-delisting__form" ref="formRef" @submit="onSubmit" v-if="props">
+    <app-popup class="g-form" :title="'摘牌'" v-model:show="showModal" :refresh="refresh">
+        <Form class="g-form__container" ref="formRef" @submit="onSubmit" v-if="props">
             <Field label="交易账户">
                 <template #input>
                     <span>{{ accountStore.currentAccountId }}</span>
@@ -26,7 +26,9 @@
             </Field>
             <Field label="挂牌价格" v-if="priceMove === 2">
                 <template #input>
-                    <span :class="quote?.lastColor">{{ selectedRow.pricemode === 3 ? (selectedRow.marketmaxsub+(quote?.last ?? 0.0)).toFixed(goods?.decimalplace ?? 2.0) : selectedRow.orderprice }}</span>
+                    <span :class="quote?.lastColor">{{ selectedRow.pricemode === 3 ? (selectedRow.marketmaxsub +
+                        (quote?.last
+                            ?? 0.0)).toFixed(goods?.decimalplace ?? 2.0) : selectedRow.orderprice }}</span>
                 </template>
             </Field>
             <Field label="挂牌价格" v-if="selectedRow.pricemode === 3">
@@ -42,15 +44,19 @@
                     <span>{{ selectedRow.orderqty }}</span>
                 </template>
             </Field>
-            <el-form-item v-if="priceMode != 1" prop="OrderPrice" :label="selectedRow.buyorsell === 0 ? '卖出价格' : '买入价格'">
-                <el-input-number placeholder="请输入" :min="0.0" :step="Math.pow(10, -1*(goods?.decimalplace ?? 0))" :precision="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice" @change="calculateDelistingAmount"/>
-            </el-form-item>
+            <Field v-if="priceMode !== 1" prop="OrderPrice" :label="selectedRow.buyorsell === 0 ? '卖出价格' : '买入价格'">
+                <template #input>
+                    <Stepper theme="round" button-size="22" :min="0.0" :step="Math.pow(10, -1 * (goods?.decimalplace ?? 0))"
+                        :decimal-length="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice"
+                        @change="calculateDelistingAmount" />
+                </template>
+            </Field>
             <Field name="OrderQty" :rules="formRules.OrderQty" label="摘牌数量">
                 <template #input>
                     <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"/>
+                            <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 }}
@@ -76,7 +82,9 @@
             </Field>
         </Form>
         <template #footer>
-            <Button type="danger" block round @click="formRef?.submit">{{ selectedRow.buyorsell === 0 ? '卖出' : '买入' }}</Button>
+            <Button type="danger" block round @click="formRef?.submit">
+                {{ selectedRow.buyorsell === 0 ? '卖出' : '买入' }}
+            </Button>
         </template>
     </app-popup>
 </template>
@@ -116,7 +124,7 @@ const refresh = shallowRef(false) // 是否刷新父组件数据
 // 数量步长列表
 const qtyStepList = [1, 5, 10, 20, 30, 50]
 // 数量步长
-const qtyStep = shallowRef(qtyStepList[0]) 
+const qtyStep = shallowRef(qtyStepList[0])
 /// 挂牌金额
 const amount = shallowRef(0.0)
 /// 履约保证金
@@ -128,7 +136,7 @@ const priceMode = shallowRef(EPriceMode.PRICEMODE_MARKET)
 /// 保证金配置
 const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
 /// 商品信息
-const goods = computed(() => futuresStore.getGoods(props.selectedRow.goodsid) ) 
+const goods = computed(() => futuresStore.getGoods(props.selectedRow.goodsid))
 /// 默认价格为挂牌价格
 formData.OrderPrice = props.selectedRow.orderprice ?? 0.0
 /// 商品价格
@@ -184,23 +192,23 @@ const calculateDelistingAmount = () => {
         if (props.selectedRow.pricemode === 3) {
             if (MarginAlgorithm === 1) {
                 /// 价格*数量*合约单位*保证金比例
-                permargin.value = ((quote.value?.last ?? 0.0)+(marketmaxsub))*OrderQty*agreeunit*MarketMarginValue
+                permargin.value = ((quote.value?.last ?? 0.0) + (marketmaxsub)) * OrderQty * agreeunit * MarketMarginValue
             } else {
                 /// 数量*保证金值
-                permargin.value = OrderQty*MarketMarginValue
+                permargin.value = OrderQty * MarketMarginValue
             }
-            amount.value = OrderQty*((quote.value?.last ?? 0.0)+(marketmaxsub))*agreeunit
+            amount.value = OrderQty * ((quote.value?.last ?? 0.0) + (marketmaxsub)) * agreeunit
         } else {
             const { OrderPrice = 0.0 } = formData
             /// 按比例
             if (MarginAlgorithm === 1) {
                 /// 价格*数量*合约单位*保证金比例
-                permargin.value = OrderPrice*OrderQty*agreeunit*MarketMarginValue
+                permargin.value = OrderPrice * OrderQty * agreeunit * MarketMarginValue
             } else {
                 /// 数量*保证金值
-                permargin.value = OrderQty*MarketMarginValue
+                permargin.value = OrderQty * MarketMarginValue
             }
-            amount.value = OrderQty*OrderPrice*agreeunit
+            amount.value = OrderQty * OrderPrice * agreeunit
         }
     }
 }

+ 0 - 5
src/packages/sbyj/views/mine/index.vue

@@ -80,11 +80,6 @@
         </app-block>
         <app-block class="g-navmenu">
             <CellGroup>
-                <Cell is-link :to="{ name: 'bank-capital' }">
-                    <template #title>
-                        <Iconfont icon="g-icon-capital">资金信息</Iconfont>
-                    </template>
-                </Cell>
                 <Cell is-link :to="{ name: 'account-certification' }" v-if="authStatus !== AuthStatus.Certified">
                     <template #title>
                         <Iconfont icon="g-icon-certification">实名认证</Iconfont>