|
|
@@ -1,33 +1,68 @@
|
|
|
<template>
|
|
|
<app-view class="market-detail">
|
|
|
<template #header>
|
|
|
- <app-navbar :title="futuresStore.getGoodsName(goodsCode) ?? '商品详情'" />
|
|
|
+ <app-navbar title="点价详情" />
|
|
|
</template>
|
|
|
- <component :is="Price" v-bind="{ goodsCode }" />
|
|
|
- <component :is="Chart" v-bind="{ goodsCode }" @ready="onReady" />
|
|
|
- <component :is="Tik" v-bind="{ goodsCode, startTime, endTime }" />
|
|
|
+ <table style="width: 100%;">
|
|
|
+ <tr>
|
|
|
+ <td style="text-align: center;">回购价</td>
|
|
|
+ <td style="text-align: center;">销售价</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="text-align: center;">449.81</td>
|
|
|
+ <td style="text-align: center;">450.00</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <Form class="pricing-detail__form" ref="formRef" style="padding: 0.2rem; background-color: white;"
|
|
|
+ @submit="onSubmit">
|
|
|
+ <Field name="OrderQty">
|
|
|
+ <template #input>
|
|
|
+ <Stepper v-model="formData.OrderQty" :rules="formRules.OrderQty" theme="round" button-size="22"
|
|
|
+ :auto-fixed="false" integer />
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
+ </Form>
|
|
|
+ <table style="width: 100%;">
|
|
|
+ <tr>
|
|
|
+ <td style="width: calc(`100% / 4`); text-align: center;"><Button>100g</Button></td>
|
|
|
+ <td style="width: calc(`100% / 4`); text-align: center;"><Button>500g</Button></td>
|
|
|
+ <td style="width: calc(`100% / 4`); text-align: center;"><Button>1000g</Button></td>
|
|
|
+ <td style="width: calc(`100% / 4`); text-align: center;"><Button>5000g</Button></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <div>
|
|
|
+ <span><Button>我要卖料</Button></span>
|
|
|
+ <span><Button>我要买料</Button></span>
|
|
|
+ </div>
|
|
|
+ <div>订单明细</div>
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
-import { formatDate } from '@/filters'
|
|
|
-import { useNavigation } from '@/packages/sbyj/router/navigation'
|
|
|
-import { useFuturesStore } from '@/stores'
|
|
|
|
|
|
-const Price = defineAsyncComponent(() => import('@/packages/sbyj/components/modules/quote/price/index.vue'))
|
|
|
-const Chart = defineAsyncComponent(() => import('@/packages/sbyj/components/modules/quote/chart/index.vue'))
|
|
|
-const Tik = defineAsyncComponent(() => import('@/packages/sbyj/components/modules/quote/tik/index.vue'))
|
|
|
+import { useOrder } from '@/business/trade'
|
|
|
+import { shallowRef, onMounted, onUnmounted, computed } from 'vue'
|
|
|
+import { Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, Checkbox } from 'vant'
|
|
|
|
|
|
-const { getQueryString } = useNavigation()
|
|
|
-const goodsCode = getQueryString('goodscode')
|
|
|
-const futuresStore = useFuturesStore()
|
|
|
+const { formData, formSubmit } = useOrder()
|
|
|
|
|
|
-const startTime = shallowRef<string>()
|
|
|
-const endTime = shallowRef<string>()
|
|
|
+onMounted(() => {
|
|
|
+ formData.OrderQty = 100
|
|
|
+})
|
|
|
|
|
|
-const onReady = (start: string, end: string) => {
|
|
|
- startTime.value = formatDate(start)
|
|
|
- endTime.value = formatDate(end)
|
|
|
+// 表单验证规则
|
|
|
+const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
|
|
|
+ OrderQty: [{
|
|
|
+ message: '请输入数量',
|
|
|
+ validator: () => {
|
|
|
+ return !!formData.OrderQty
|
|
|
+ }
|
|
|
+ }],
|
|
|
}
|
|
|
+
|
|
|
+// 下单
|
|
|
+const onSubmit = () => {
|
|
|
+ console.log("onSubmit")
|
|
|
+}
|
|
|
+
|
|
|
</script>
|