li.shaoyi 2 lat temu
rodzic
commit
d9544b270a

+ 8 - 11
public/html/gywm.htm

@@ -16,15 +16,15 @@ xmlns="http://www.w3.org/TR/REC-html40">
   <o:Author>W BJ</o:Author>
   <o:LastAuthor>Microsoft</o:LastAuthor>
   <o:Revision>2</o:Revision>
-  <o:TotalTime>6</o:TotalTime>
-  <o:Created>2022-12-10T01:23:00Z</o:Created>
-  <o:LastSaved>2022-12-10T01:23:00Z</o:LastSaved>
+  <o:TotalTime>8</o:TotalTime>
+  <o:Created>2023-01-09T08:32:00Z</o:Created>
+  <o:LastSaved>2023-01-09T08:32:00Z</o:LastSaved>
   <o:Pages>1</o:Pages>
-  <o:Words>61</o:Words>
-  <o:Characters>348</o:Characters>
+  <o:Words>43</o:Words>
+  <o:Characters>246</o:Characters>
   <o:Lines>2</o:Lines>
   <o:Paragraphs>1</o:Paragraphs>
-  <o:CharactersWithSpaces>408</o:CharactersWithSpaces>
+  <o:CharactersWithSpaces>288</o:CharactersWithSpaces>
   <o:Version>15.00</o:Version>
  </o:DocumentProperties>
  <o:CustomDocumentProperties>
@@ -846,13 +846,10 @@ mso-hansi-theme-font:minor-latin'>“铁合金掌上行”平台运营主体公
 mso-char-indent-count:2.0;line-height:150%'><span style='font-family:宋体;
 mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
 宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;
-mso-hansi-theme-font:minor-latin'>我们的核心管理团队为是由铁合金现期、生产、贸易、合规领域中的资深专业人士组成,具有非常丰富的行业实战经验。我们致力于通过整合期现产业资源、金融资源、市场资源、信息资源,帮助上游生产端企业提前锁定用户、节约销售成本、有序组织生产、实现产能优配;解决账期长,回款难,现金流紧张的难题,实现“保供稳价”的目的。为投资铁合金大宗商品的机构用户提供稳定的货源,及仓储物流服务,提供更多投资安全和便利,并为铁合金期货市场用户提供期现对冲服务。解决贸易端贸易商购销铁合金资金压力大,账期漫长,贸易融资成本高的难点。</span></p>
+mso-hansi-theme-font:minor-latin'>我们的核心管理团队为是由铁合金现期、生产、贸易、合规领域中的资深专业人士组成,具有非常丰富的行业实战经验。我们致力于通过整合期现产业资源、市场资源、信息资源,帮助上游生产端企业提前锁定用户、节约销售成本、有序组织生产、实现产能优配;解决账期长,回款难,现金流紧张的难题,实现“保供稳价”的目的。解决贸易端贸易商购销铁合金资金压力大,账期漫长,贸易融资成本高的难点。</span></p>
 
 <p class=MsoNormal align=left style='text-align:left;text-indent:21.0pt;
-mso-char-indent-count:2.0;line-height:150%'><span style='font-family:宋体;
-mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
-宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;
-mso-hansi-theme-font:minor-latin'>我们通过整合各种资源,实现现货市场和期货市场的联动,实现真正意义的“期现联动”,让金融服务实体落到实处。</span></p>
+mso-char-indent-count:2.0;line-height:150%'><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
 
 </div>
 

+ 11 - 18
public/html/yhkhfxgzs.htm

@@ -16,15 +16,15 @@ xmlns="http://www.w3.org/TR/REC-html40">
   <o:Author>W BJ</o:Author>
   <o:LastAuthor>Microsoft</o:LastAuthor>
   <o:Revision>2</o:Revision>
-  <o:TotalTime>0</o:TotalTime>
-  <o:Created>2022-12-10T01:25:00Z</o:Created>
-  <o:LastSaved>2022-12-10T01:25:00Z</o:LastSaved>
+  <o:TotalTime>3</o:TotalTime>
+  <o:Created>2023-01-09T08:32:00Z</o:Created>
+  <o:LastSaved>2023-01-09T08:32:00Z</o:LastSaved>
   <o:Pages>1</o:Pages>
-  <o:Words>88</o:Words>
-  <o:Characters>503</o:Characters>
-  <o:Lines>4</o:Lines>
+  <o:Words>74</o:Words>
+  <o:Characters>427</o:Characters>
+  <o:Lines>3</o:Lines>
   <o:Paragraphs>1</o:Paragraphs>
-  <o:CharactersWithSpaces>590</o:CharactersWithSpaces>
+  <o:CharactersWithSpaces>500</o:CharactersWithSpaces>
   <o:Version>15.00</o:Version>
  </o:DocumentProperties>
  <o:CustomDocumentProperties>
@@ -881,8 +881,7 @@ mso-char-indent-count:2.0;line-height:150%'><span lang=EN-US style='font-family:
 宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
 minor-fareast;mso-hansi-theme-font:minor-fareast'>1</span><span
 style='font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:
-宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast'>、铁合金产品作为工业炼钢领域的重要产品,近<span
-lang=EN-US>2</span>年来价格存在巨大涨跌波动,用户在铁合金掌上行平台的购销铁合金产品前,请用户自行在第三方信息渠道学习了解有关铁合金产品的有关知识及价格行情,以便作出适合自己的购销行为。<span
+宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast'>、铁合金产品作为工业炼钢领域的重要产品,用户在铁合金掌上行平台的购销铁合金产品前,请用户自行在第三方信息渠道学习了解有关铁合金产品的有关知识及价格行情,以便作出适合自己的购销行为。<span
 lang=EN-US><o:p></o:p></span></span></p>
 
 <p class=MsoNormal align=left style='text-align:left;text-indent:21.0pt;
@@ -898,7 +897,7 @@ mso-char-indent-count:2.0;line-height:150%'><span lang=EN-US style='font-family:
 宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
 minor-fareast;mso-hansi-theme-font:minor-fareast'>3</span><span
 style='font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:
-宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast'>、铁合金掌上行平台从未授权、指示任何人员以任何方式向用户发出具倾向性的购销铁合金产品的投资建议,也不会向用户承诺购销铁合金产品会获得某种收益。<span
+宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast'>、铁合金掌上行平台从未授权、指示任何人员以任何方式向用户发出具倾向性的购销建议,也不会向用户承诺购销铁合金产品会获得某种收益。<span
 lang=EN-US><o:p></o:p></span></span></p>
 
 <p class=MsoNormal align=left style='text-align:left;text-indent:21.0pt;
@@ -914,19 +913,13 @@ mso-char-indent-count:2.0;line-height:150%'><span lang=EN-US style='font-family:
 宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
 minor-fareast;mso-hansi-theme-font:minor-fareast'>5</span><span
 style='font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:
-宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast'>、铁合金掌上行平台在用户购销铁合金产品过程中,设置了多种付款比例供用户选择,每种付款比例项下的购销行为可能因用户资金情况或行情波动或用户其他原因存在不同的购销风险,请用户谨慎、合理选择适合自己的购销付款方式。<span
+宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast'>、铁合金掌上行平台在用户购销铁合金产品过程中,设置了多种付款比例供用户选择,每种付款比例项下的购销行为可能因用户资金情况存在不同的购销风险,请用户谨慎、合理选择适合自己的购销付款方式。<span
 lang=EN-US><o:p></o:p></span></span></p>
 
 <p class=MsoNormal align=left style='text-align:left;text-indent:21.1pt;
 mso-char-indent-count:2.0;line-height:150%'><b><u><span style='font-family:
 宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
-minor-fareast;mso-hansi-theme-font:minor-fareast'>任何投资交易均具有一定的投资交易风险,用户在铁合金掌上行平台进行铁合金产品的购销交易同样具有一定的风险,该类风险可能来源于铁合金产品市场行情的波动和用户自身的资金情况及用户对有关信息的判断等一些不可抗力因素。<span
-lang=EN-US><o:p></o:p></span></span></u></b></p>
-
-<p class=MsoNormal align=left style='text-align:left;text-indent:21.1pt;
-mso-char-indent-count:2.0;line-height:150%'><b><u><span style='font-family:
-宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
-minor-fareast;mso-hansi-theme-font:minor-fareast'>铁合金掌上行平台提示用户:购销有风险,下单需谨慎!<span
+minor-fareast;mso-hansi-theme-font:minor-fareast'>任何购销交易均具有一定的交易风险,用户在铁合金掌上行平台进行铁合金产品的购销交易同样具有一定的风险,铁合金掌上行平台提示用户:购销有风险,下单需谨慎!<span
 lang=EN-US><o:p></o:p></span></span></u></b></p>
 
 <p class=MsoNormal align=right style='text-align:right;text-indent:21.0pt;

+ 3 - 4
src/business/contract/index.ts

@@ -1,5 +1,4 @@
 import { shallowRef, reactive } from 'vue'
-import { formatDate } from '@/filters'
 import { useDataTable } from '@/hooks/datatable'
 import { EchartsDataset } from '@/hooks/echarts/line/interface'
 import { queryTHJPurchaseTransfer, queryTHJPurchaseTransferDetail } from '@/services/api/contract'
@@ -59,9 +58,9 @@ export function useContractDetails(wrstandardid: number) {
             success: (res) => {
                 details.value = res.data
 
-                res.data.history.forEach(({ c, ts }) => {
-                    chartData.price.push(c)
-                    chartData.date.push(formatDate(ts, 'YYYY-MM-DD'))
+                res.data.spotgoodspricelogs.forEach(({ spotgoodsprice, tradedate }) => {
+                    chartData.price.push(spotgoodsprice)
+                    chartData.date.push(tradedate)
                 })
             },
             complete: () => {

+ 3 - 2
src/components/base/echarts/core.ts

@@ -3,7 +3,7 @@
  */
 import * as echarts from 'echarts/core'
 import { CandlestickChart, CandlestickSeriesOption, BarChart, BarSeriesOption, LineChart, LineSeriesOption } from 'echarts/charts'
-import { MarkLineComponent, DatasetComponent, DataZoomComponent, GridComponent, GridComponentOption } from 'echarts/components'
+import { MarkLineComponent, DatasetComponent, DataZoomComponent, GridComponent, GridComponentOption, TooltipComponent } from 'echarts/components'
 import { CanvasRenderer } from 'echarts/renderers'
 
 echarts.use([
@@ -14,7 +14,8 @@ echarts.use([
     GridComponent,
     BarChart,
     CandlestickChart,
-    CanvasRenderer
+    CanvasRenderer,
+    TooltipComponent
 ])
 
 type ECOption = echarts.ComposeOption<CandlestickSeriesOption | BarSeriesOption | LineSeriesOption | GridComponentOption>;

+ 11 - 10
src/components/base/echarts/index.less

@@ -7,28 +7,29 @@
         }
 
         &-item {
-            display    : flex;
+            display: flex;
             align-items: center;
 
             span:first-child {
-                display       : table-cell;
-                width         : 40px;
-                text-align    : left;
+                display: table-cell;
+                width: 40px;
+                text-align: left;
                 vertical-align: middle;
             }
 
             span:last-child {
-                width     : 100px;
+                font-weight: bold;
                 text-align: right;
+                margin-left: 20px;
             }
 
             i {
-                display      : inline-block;
-                font-size    : 0;
-                margin-right : 8px;
+                display: inline-block;
+                font-size: 0;
+                margin-right: 8px;
                 border-radius: 50%;
-                width        : 7px;
-                height       : 7px;
+                width: 7px;
+                height: 7px;
             }
         }
     }

+ 3 - 1
src/hooks/echarts/line/dataset.ts

@@ -9,7 +9,9 @@ export function useDataset() {
                 date: [],
                 price: [],
             },
-        }
+        },
+        yAxisMin: (value) => value.min,
+        yAxisMax: (value) => value.max,
     })
 
     // 清空数据

+ 2 - 0
src/hooks/echarts/line/interface.ts

@@ -6,6 +6,8 @@ import { ECOption } from '@/components/base/echarts/core'
  */
 export interface EchartsDataset {
     line: Dataset;
+    yAxisMin: (value: { min: number; max: number; }) => number; // Y轴最大刻度
+    yAxisMax: (value: { min: number; max: number; }) => number; // Y轴最小刻度
 }
 
 /**

+ 33 - 2
src/hooks/echarts/line/options.ts

@@ -35,7 +35,8 @@ export function useOptions(dataset: EchartsDataset) {
 
     const initOptions = () => {
         const { xAxisLineColor } = options.colors
-        const { line } = dataset
+        const { line, yAxisMin, yAxisMax } = dataset
+        const { price } = line.source
 
         options.line = {
             dataset: line,
@@ -46,10 +47,41 @@ export function useOptions(dataset: EchartsDataset) {
                 bottom: '16px',
                 containLabel: true,
             },
+            tooltip: {
+                trigger: 'axis',
+                axisPointer: {
+                    type: 'cross'
+                },
+                className: 'tooltip',
+                formatter: (params: unknown[]) => {
+                    let result = ''
+                    // eslint-disable-next-line
+                    params.forEach((item: any, index: number) => {
+                        const [time, value] = item.data
+                        if (index === 0) {
+                            result += '<div class="tooltip-title">' + time + '</div>'
+                        }
+                        result += '<div class="tooltip-item"><span><i style="background-color:' + item.color + ';"></i>价格</span><span>' + value + '</span></div>'
+                    })
+                    return result
+                },
+            },
+            dataZoom: {
+                type: 'inside',
+                startValue: price.length - 120, // 起始显示K线条数(最新120条)
+                endValue: price.length,
+                minValueSpan: 10, // 限制窗口缩放显示最少数据条数
+                maxValueSpan: 400, // 限制窗口缩放显示最大数据条数
+            },
             xAxis: {
                 type: 'category',
             },
             yAxis: {
+                min: yAxisMin,
+                max: yAxisMax,
+                axisPointer: {
+                    show: false, // 不显示坐标指示器
+                },
                 splitLine: {
                     lineStyle: {
                         // 坐标分隔线颜色
@@ -60,7 +92,6 @@ export function useOptions(dataset: EchartsDataset) {
             // series 中不指定 yAxisId 或 yAxisIndex 默认关联 yAxis 第一个配置,xAxis 配置同理
             series: [
                 {
-                    name: '分时',
                     type: 'line',
                     smooth: true,
                     symbol: 'none', //中时有小圆点

+ 29 - 0
src/hooks/echarts/smoothedline/dataset.ts

@@ -0,0 +1,29 @@
+import { reactive } from 'vue'
+import { EchartsDataset } from './interface'
+
+export function useDataset() {
+    const dataset = reactive<EchartsDataset>({
+        line: {
+            dimensions: ['date', 'price'],
+            source: {
+                date: [],
+                price: [],
+            },
+        },
+        yAxisMin: (value) => value.min,
+        yAxisMax: (value) => value.max,
+    })
+
+    // 清空数据
+    const clearData = () => {
+        dataset.line.source = {
+            date: [],
+            price: [],
+        };
+    }
+
+    return {
+        dataset,
+        clearData,
+    }
+}

+ 80 - 0
src/hooks/echarts/smoothedline/index.ts

@@ -0,0 +1,80 @@
+import { ref, computed, watch } from 'vue'
+import { useFuturesStore } from '@/stores'
+import { formatDate } from '@/filters'
+import { queryHistoryTikDatas } from '@/services/api/quote'
+import { useDataset } from './dataset'
+import { useOptions } from './options'
+
+export function useSmoothedLineChart(goodscode: string) {
+    const { getQuoteDayInfoByCode } = useFuturesStore()
+    const { dataset, clearData } = useDataset()
+    const { options, initOptions, updateOptions } = useOptions(dataset)
+
+    const loading = ref(false)
+    const isEmpty = ref(false)
+    const dataIndex = ref(-1); // 当前数据索引值
+    const quote = getQuoteDayInfoByCode(goodscode) // 实时行情
+
+    // 当前选中的数据项
+    const selectedItem = computed(() => {
+        const { price } = dataset.line.source;
+        return {
+            price: price[dataIndex.value] ?? '--',
+        }
+    })
+
+    /**
+     * 初始化数据
+     */
+    const initData = () => {
+        clearData();
+        dataIndex.value = -1;
+        isEmpty.value = true;
+        loading.value = true;
+
+        queryHistoryTikDatas({
+            data: {
+                goodsCode: goodscode,
+                startTime: formatDate(new Date().toISOString(), 'YYYY-MM-DD 00:00:00'),
+                endTime: formatDate(new Date().toISOString(), 'YYYY-MM-DD 23:59:59'),
+                isAsc: true,
+            },
+            success: (res) => {
+                if (res.data.length) {
+                    const { date, price } = dataset.line.source
+                    dataIndex.value = res.data.length - 1
+                    isEmpty.value = false
+
+                    res.data.forEach(({ PE, TS }) => {
+                        date.push(formatDate(TS, 'HH:mm:ss'))
+                        price.push(PE)
+                    })
+                }
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    // 监听行情推送
+    watch(() => quote.value?.last, () => {
+        if (!loading.value && quote.value) {
+            const { last, lasttime } = quote.value
+            const { date, price } = dataset.line.source
+            date.push(formatDate(lasttime, 'HH:mm:ss'))
+            price.push(last)
+            updateOptions()
+        }
+    })
+
+    return {
+        options,
+        loading,
+        isEmpty,
+        dataIndex,
+        selectedItem,
+        initData,
+        initOptions,
+    }
+}

+ 45 - 0
src/hooks/echarts/smoothedline/interface.ts

@@ -0,0 +1,45 @@
+
+import { ECOption } from '@/components/base/echarts/core'
+
+/**
+ * 图表数据集
+ */
+export interface EchartsDataset {
+    line: Dataset;
+    yAxisMin: (value: { min: number; max: number; }) => number; // Y轴最大刻度
+    yAxisMax: (value: { min: number; max: number; }) => number; // Y轴最小刻度
+}
+
+/**
+ * 图表数据源
+ */
+export interface Dataset {
+    dimensions: (keyof Line)[];
+    source: Line;
+}
+
+/**
+ * 折线
+ */
+export type Line = {
+    date: string[], // xAxis数据,必须是第一个属性
+    price: number[], // 价格
+}
+
+/**
+ * 图表配置项
+ */
+export interface EchartsOptions {
+    colors: Colors;
+    line: ECOption;
+}
+
+/**
+ * 图表颜色
+ */
+export interface Colors {
+    upColor: string;
+    downColor: string;
+    xAxisLineColor: string;
+    yAxisLineColor: string;
+}

+ 160 - 0
src/hooks/echarts/smoothedline/options.ts

@@ -0,0 +1,160 @@
+import { reactive, watch } from 'vue'
+import { timerInterceptor } from '@/utils/timer'
+import { useThemeStore } from '@/stores'
+import { EchartsDataset, EchartsOptions, Colors } from './interface'
+
+const { appTheme } = useThemeStore();
+
+function getColors() {
+    // 默认主题色配置
+    const defaultColors: Colors = {
+        upColor: '#ff3333',
+        downColor: '#0aab62',
+        xAxisLineColor: 'rgba(128,128,128,.1)',
+        yAxisLineColor: 'rgba(128,128,128,.1)',
+    }
+
+    const colors = {
+        default: defaultColors,
+        dark: defaultColors,
+        light: {
+            ...defaultColors,
+            downColor: '#00A843',
+        }
+    }
+
+    return colors[appTheme.value];
+}
+
+export function useOptions(dataset: EchartsDataset) {
+    // 图表配置项
+    const options = reactive<EchartsOptions>({
+        colors: getColors(),
+        line: {},
+    })
+
+    const initOptions = () => {
+        const { xAxisLineColor } = options.colors
+        const { line, yAxisMin, yAxisMax } = dataset
+        const { price } = line.source
+
+        options.line = {
+            dataset: line,
+            grid: {
+                left: '16px',
+                right: '16px',
+                top: '24px',
+                bottom: '16px',
+                containLabel: true,
+            },
+            tooltip: {
+                trigger: 'axis',
+                axisPointer: {
+                    type: 'cross'
+                },
+                className: 'tooltip',
+                formatter: (params: unknown[]) => {
+                    let result = ''
+                    // eslint-disable-next-line
+                    params.forEach((item: any, index: number) => {
+                        const [time, value] = item.data
+                        if (index === 0) {
+                            result += '<div class="tooltip-title">' + time + '</div>'
+                        }
+                        result += '<div class="tooltip-item"><span><i style="background-color:' + item.color + ';"></i>收盘</span><span>' + value + '</span></div>'
+                    })
+                    return result
+                },
+            },
+            dataZoom: {
+                type: 'inside',
+                startValue: price.length - 120, // 起始显示K线条数(最新120条)
+                endValue: price.length,
+                minValueSpan: 10, // 限制窗口缩放显示最少数据条数
+                maxValueSpan: 400, // 限制窗口缩放显示最大数据条数
+            },
+            xAxis: {
+                type: 'category',
+            },
+            yAxis: {
+                min: yAxisMin,
+                max: yAxisMax,
+                axisPointer: {
+                    show: false, // 不显示坐标指示器
+                },
+                splitLine: {
+                    lineStyle: {
+                        // 坐标分隔线颜色
+                        color: xAxisLineColor,
+                    },
+                },
+            },
+            // series 中不指定 yAxisId 或 yAxisIndex 默认关联 yAxis 第一个配置,xAxis 配置同理
+            series: [
+                {
+                    type: 'line',
+                    smooth: true,
+                    symbol: 'none', //中时有小圆点
+                    // 最新价标线
+                    markLine: {
+                        symbolSize: 6,
+                        // 标线标签样式
+                        label: {
+                            color: '#fff',
+                            backgroundColor: 'rgba(128,128,128,.75)',
+                            padding: 5,
+                            borderRadius: 3,
+                            position: 'insideEndBottom',
+                        },
+                        // 标线样式
+                        lineStyle: {
+                            type: 'dashed',
+                            color: 'rgba(102,102,102,.6)'
+                        },
+                        data: [
+                            {
+                                // 收盘价
+                                yAxis: price.length ? price[price.length - 1] : 0,
+                            },
+                        ],
+                    },
+                },
+            ],
+        }
+    }
+
+    // 动态更新数据
+    const updateOptions = timerInterceptor.setThrottle(() => {
+        const { line } = dataset
+        const { price } = line.source
+
+        options.line = {
+            dataset: {
+                source: line.source,
+            },
+            series: [
+                {
+                    markLine: {
+                        data: [
+                            {
+                                yAxis: price.length ? price[price.length - 1] : 0, // 最新价
+                            },
+                        ],
+                    },
+                },
+            ],
+        }
+    }, 1000)
+
+    // 监听主题变化
+    watch(appTheme, () => {
+        options.colors = getColors();
+        initOptions();
+    })
+
+    return {
+        options,
+        initOptions,
+        updateOptions,
+    }
+}

+ 1 - 1
src/packages/mobile/components/modules/echarts-line/index.vue

@@ -32,7 +32,7 @@ const props = defineProps({
     },
 })
 
-const { options, dataIndex, selectedItem, initData, initOptions } = useLineChart()
+const { options, dataIndex, initData, initOptions } = useLineChart()
 const isEmpty = shallowRef(false)
 
 watch(() => props.loading, (status) => {

+ 6 - 6
src/packages/mobile/views/home/components/main/index.less

@@ -85,21 +85,21 @@
             &-title {
                 display: flex;
                 align-items: center;
-                margin-bottom: .1rem;
+                margin-bottom: .12rem;
 
                 img {
-                    width: .24rem;
-                    height: .24rem;
+                    width: .28rem;
+                    height: .28rem;
                     margin-right: .08rem;
                 }
 
                 span {
-                    font-size: .26rem;
+                    font-size: .28rem;
                     font-weight: bold;
 
                     +span {
                         color: #999;
-                        font-size: .24rem;
+                        font-size: .26rem;
                         font-weight: normal;
                         margin-left: .1rem;
                     }
@@ -116,7 +116,7 @@
                 justify-content: space-around;
                 align-items: center;
                 height: inherit;
-                font-size: .24rem;
+                font-size: .26rem;
             }
         }
     }

+ 2 - 3
src/packages/mobile/views/home/components/main/index.vue

@@ -68,7 +68,7 @@
             </SwipeItem>
           </Swipe>
         </section>
-        <section class="scrollbar" v-if="dataList.length">
+        <section class="scrollbar" v-if="false">
           <h4 class="scrollbar-title">
             <img src="@mobile/assets/icons/futures.png" />
             <span>期货行情</span>
@@ -134,7 +134,7 @@ import { queryMarketRun } from "@/services/api/goods";
 import { queryThjSpotQuoteConfig } from "@/services/api/market";
 
 const { router, routerTo } = useNavigation();
-const { dataList, quoteSubscribe } = useFuturesList();
+const { dataList } = useFuturesList();
 const refreshing = shallowRef(false); // 是否处于加载中状态
 const topBanners = shallowRef<Model.ImageConfigsRsp[]>([]); // 轮播图列表
 const bodyBanners = shallowRef<Model.ImageConfigsRsp[]>([]); // 轮播图列表
@@ -209,7 +209,6 @@ queryThjSpotQuoteConfig({
 })
 
 onRefresh();
-quoteSubscribe.start();
 </script>
 
 <style lang="less">

+ 3 - 3
src/packages/mobile/views/market/list/index.vue

@@ -7,9 +7,9 @@
             <Tab title="现货">
                 <app-spot />
             </Tab>
-            <Tab title="郑商所">
+            <!-- <Tab title="郑商所">
                 <app-quote />
-            </Tab>
+            </Tab> -->
         </Tabs>
     </app-view>
 </template>
@@ -17,7 +17,7 @@
 <script lang="ts" setup>
 import { Tab, Tabs } from 'vant'
 import AppSpot from './components/spot/index.vue'
-import AppQuote from './components/quote/index.vue'
+//import AppQuote from './components/quote/index.vue'
 </script>
 
 <style lang="less">

+ 9 - 2
src/services/api/quote/index.ts

@@ -2,15 +2,22 @@ import { httpRequest } from '@/services/http'
 import { HttpParams } from '@/services/http/interface'
 
 /**
- * 历史行情
+ * 查询行情历史数据
  */
 export function queryHistoryDatas(params: HttpParams<{ req: { goodscode?: string }, rsp: Model.QueryHistoryDatasRsp[] }>) {
     return httpRequest('/Quote/QueryHistoryDatas', 'get', params);
 }
 
 /**
- * 历史行情
+ * 分时图数据查询
  */
 export function queryTSData(params: HttpParams<{ req: { goodscode?: string }, rsp: Model.QueryTSDataRsp }>) {
     return httpRequest('/Quote/QueryTSData', 'get', params);
+}
+
+/**
+ * 查询行情Tik数据
+ */
+export function queryHistoryTikDatas(params: HttpParams<{ req: Model.HistoryTikDatasReq, rsp: Model.HistoryTikDatasRsp[] }>) {
+    return httpRequest('/Quote/QueryHistoryTikDatas', 'get', params);
 }

+ 5 - 11
src/types/model/contract.d.ts

@@ -36,6 +36,8 @@ declare namespace Model {
             transferprice: number; // 转让价格
         }[];
         goodsinfo: {
+            minivalue: number;// 最小变动值
+            minivaluedp: number;// 最小变动值小数位
             pictureurls: string; // 详情图片(逗号分隔)
             refgoodscode: string; // 参考商品代码
             refgoodsid: number; // 参考商品ID
@@ -44,17 +46,9 @@ declare namespace Model {
             wrstandardid: number; // 现货商品ID(自增 SEQ_GOODS 确保不重复)
             wrstandardname: string; // 现货商品名称(模糊查询)
         };
-        history: {
-            c: number; // 收盘价
-            f: boolean; // 是否补充数据
-            h: number; // 最高价
-            hv: number; // 持仓量
-            l: number; // 最低价
-            o: number; // 开盘价
-            s: number; // 结算价,日线周期(包括)以上才有
-            ts: string; // 时间
-            tt: number; // 总金额
-            tv: number; // 总量(成交量)
+        spotgoodspricelogs: {
+            spotgoodsprice: number; // 现货价格
+            tradedate: string; // 交易日(yyyyMMdd)
         }[];
     }
 }

+ 25 - 0
src/types/model/quote.d.ts

@@ -175,4 +175,29 @@ declare namespace Model {
             tradeweekday: number;
         }
     }
+
+    /** 查询行情Tik数据 请求 */
+    interface HistoryTikDatasReq {
+        goodsCode: string; // 商品代码
+        startTime?: string; // 开始时间,格式:yyyy-MM-dd HH:mm:ss
+        endTime?: string; // 结束时间,格式:yyyy-MM-dd HH:mm:ss
+        count?: number; // 条数
+        isAsc?: boolean; // 是否按时间顺序排序(默认为时间倒序排序)
+    }
+
+    /** 查询行情Tik数据 响应 */
+    interface HistoryTikDatasRsp {
+        AV: number; // 卖量
+        Ask: number; // 卖价
+        BV: number; // 买量
+        Bid: number; // 买价
+        HI: number; // 单笔持仓
+        HV: number; // 持仓量
+        PE: number; // 现价
+        TDR: number; // 交易方向,0:买 1:卖
+        TK: number; // 交易类型
+        TS: string; // 行情时间文本
+        TT: number; // 现金额
+        Vol: number; // 现量
+    }
 }