|
|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
|
<app-view class="market-detail">
|
|
|
<template #header>
|
|
|
- <app-navbar :title="quote?.goodsname" />
|
|
|
+ <app-navbar :title="quote?.goodsname">
|
|
|
+ <template #right>
|
|
|
+ <Icon v-if="system_1012 != '0'" name="bars" size="20px" @click="showChart" />
|
|
|
+ </template>
|
|
|
+ </app-navbar>
|
|
|
</template>
|
|
|
<div class="market-detail__form" v-if="quote">
|
|
|
<div class="form-price">
|
|
|
@@ -168,7 +172,7 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
import { shallowRef, onMounted, onUnmounted, computed, onActivated, defineAsyncComponent } from 'vue'
|
|
|
-import { Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, showToast, ActionSheet, Checkbox } from 'vant'
|
|
|
+import { Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, showToast, ActionSheet, Checkbox, Icon } from 'vant'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useGlobalStore, useFuturesStore, useUserStore, useSBYJOrderStore } from '@/stores'
|
|
|
import { getGoodsUnitName } from '@/constants/unit'
|
|
|
@@ -181,7 +185,7 @@ import quoteSocket from '@/services/websocket/quote'
|
|
|
import { queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
import { getUserId } from '@/services/methods/user'
|
|
|
|
|
|
-const { getQueryString } = useNavigation()
|
|
|
+const { getQueryString, router } = useNavigation()
|
|
|
const { formData, formSubmit } = useOrder()
|
|
|
const { getSBYJMyOrders, getOrderListByGoodsId } = useSBYJOrderStore()
|
|
|
const globalStore = useGlobalStore()
|
|
|
@@ -204,6 +208,9 @@ const show = shallowRef(false)
|
|
|
/// 能否下单交易
|
|
|
const canBankSign = shallowRef(false)
|
|
|
|
|
|
+const { getSystemParamValue } = useUserStore()
|
|
|
+const system_1012 = getSystemParamValue('1012') ?? '1'
|
|
|
+
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['detail', defineAsyncComponent(() => import('../../order/detail/index.vue'))], // 详情
|
|
|
['supplement', defineAsyncComponent(() => import('../../order/list/components/supplement-deposit/index.vue'))], // 补充
|
|
|
@@ -236,6 +243,15 @@ const qtyStepList = computed(() => {
|
|
|
]
|
|
|
})
|
|
|
|
|
|
+const showChart = () => {
|
|
|
+ router.push({
|
|
|
+ name: 'market-chart',
|
|
|
+ query: {
|
|
|
+ goodscode: quote.value?.goodscode ?? ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
const commit = (buyOrSell: BuyOrSell) => {
|
|
|
/// 这里要去判断是否已经实名认证
|
|
|
if (userStore.hasAuth) {
|
|
|
@@ -253,13 +269,23 @@ const commit = (buyOrSell: BuyOrSell) => {
|
|
|
|
|
|
// 下单
|
|
|
const onSubmit = () => {
|
|
|
+
|
|
|
+ // 计算提示信息
|
|
|
+ const { marketid = 0, goodsid = 0, goodunitid = 0 } = quote.value ?? {}
|
|
|
+ const { marginalgorithm = 0, transferdepositratio = 0.0 } = goods ?? {}
|
|
|
+ const totalamount = orderQty.value*(formData.OrderPrice ?? 0)
|
|
|
+ const orderPrice = `定价价格:${formData.OrderPrice ?? 0}\n`
|
|
|
+ const qty = `订单数量:${orderQty.value}${getGoodsUnitName(goodunitid)}\n`
|
|
|
+ const orderamount = `订单总额:${formatDecimal(totalamount)}\n`
|
|
|
+ const margin = `预付定金:${marginalgorithm === 1 ? totalamount*transferdepositratio : orderQty.value*transferdepositratio}\n`
|
|
|
+ const message = orderPrice + qty + orderamount + margin
|
|
|
+
|
|
|
dialog({
|
|
|
allowHtml: true,
|
|
|
- message: `确认要提交吗?`,
|
|
|
+ title: '订单明细',
|
|
|
+ message: message,
|
|
|
showCancelButton: true,
|
|
|
}).then(() => {
|
|
|
-
|
|
|
- const { marketid = 0, goodsid = 0 } = quote.value ?? {}
|
|
|
/// 获取对应的市场ID
|
|
|
formData.MarketID = marketid
|
|
|
formData.PriceMode = EPriceMode.PRICEMODE_MARKET
|