li.shaoyi 2 лет назад
Родитель
Сommit
11a333959d

+ 26 - 24
src/hooks/echarts/candlestick/index.ts

@@ -55,30 +55,32 @@ export function useCandlestickChart(goodscode: string) {
      * @param cycletype 周期类型
      */
     const initData = (cycletype: ChartCycleType) => {
-        clearData();
-        dataIndex.value = -1;
-        options.cycleType = cycletype;
-        loading.value = true;
-        isEmpty.value = true;
-
-        // 获取历史行情
-        queryHistoryDatas({
-            data: {
-                cycleType: cycletype,
-                goodsCode: goodscode,
-                count: 1440,
-            }
-        }).then((res) => {
-            // 日期升序排序
-            const data = res.data.sort((a, b) => moment(a.ts).valueOf() - moment(b.ts).valueOf());
-            if (data.length) {
-                dataIndex.value = data.length - 1;
-                isEmpty.value = false;
-                handleData(data);
-            }
-        }).finally(() => {
-            loading.value = false;
-        })
+        if (goodscode) {
+            clearData();
+            dataIndex.value = -1;
+            options.cycleType = cycletype;
+            loading.value = true;
+            isEmpty.value = true;
+
+            // 获取历史行情
+            queryHistoryDatas({
+                data: {
+                    cycleType: cycletype,
+                    goodsCode: goodscode,
+                    count: 1440,
+                }
+            }).then((res) => {
+                // 日期升序排序
+                const data = res.data.sort((a, b) => moment(a.ts).valueOf() - moment(b.ts).valueOf());
+                if (data.length) {
+                    dataIndex.value = data.length - 1;
+                    isEmpty.value = false;
+                    handleData(data);
+                }
+            }).finally(() => {
+                loading.value = false;
+            })
+        }
     }
 
     /**

+ 21 - 19
src/hooks/echarts/timeline/index.ts

@@ -29,26 +29,28 @@ export function useTimelineChart(goodscode: string) {
      * 初始化数据
      */
     const initData = () => {
-        clearData()
-        dataIndex.value = -1
-        isEmpty.value = true
-        loading.value = true
+        if (goodscode) {
+            clearData()
+            dataIndex.value = -1
+            isEmpty.value = true
+            loading.value = true
 
-        // 获取历史行情
-        queryTSData({
-            data: {
-                goodsCode: goodscode
-            }
-        }).then((res) => {
-            const { historyDatas } = res.data
-            if (historyDatas.length) {
-                dataIndex.value = historyDatas.length - 1
-                isEmpty.value = false
-                handleData(res.data)
-            }
-        }).finally(() => {
-            loading.value = false
-        })
+            // 获取历史行情
+            queryTSData({
+                data: {
+                    goodsCode: goodscode
+                }
+            }).then((res) => {
+                const { historyDatas } = res.data
+                if (historyDatas.length) {
+                    dataIndex.value = historyDatas.length - 1
+                    isEmpty.value = false
+                    handleData(res.data)
+                }
+            }).finally(() => {
+                loading.value = false
+            })
+        }
     }
 
     /**

+ 1 - 1
src/packages/qxst/components/modules/quote/chart/kline/index.vue

@@ -64,7 +64,7 @@ import AppTabs from '@/components/base/tabs/index.vue'
 const props = defineProps({
     goodsCode: {
         type: String,
-        default: '',
+        required: true
     },
     // 周期类型
     cycleType: {

+ 1 - 1
src/packages/qxst/components/modules/quote/chart/timeline/index.vue

@@ -24,7 +24,7 @@ import AppEcharts from '@/components/base/echarts/index.vue'
 const props = defineProps({
     goodsCode: {
         type: String,
-        default: '',
+        required: true
     },
 })
 

+ 6 - 0
src/packages/qxst/views/account/certification/components/certification-next/Index.vue

@@ -149,8 +149,14 @@ const faceAuth = () => {
                             hideLoading(err, 'fail')
                         })
                     })
+                },
+                onError: (err) => {
+                    showFailToast(err)
                 }
             })
+        },
+        onError: (err) => {
+            showFailToast(err)
         }
     })
 }

+ 2 - 2
src/utils/h5plus/index.ts

@@ -492,7 +492,7 @@ export default new (class {
     /**
      * 请求摄像头权限
      */
-    requestPermissionCamera(options: Partial<{ onSuccess: () => void; onError: (message?: string) => void; }> = {}) {
+    requestPermissionCamera(options: Partial<{ onSuccess: () => void; onError: (message: string) => void; }> = {}) {
         const { onSuccess, onError } = options
         if (this.hasPlus()) {
             this.onPlusReady((plus) => {
@@ -518,7 +518,7 @@ export default new (class {
     /**
      * 请求麦克风权限
      */
-    requestPermissionRecordAudio(options: Partial<{ onSuccess: () => void; onError: (message?: string) => void; }> = {}) {
+    requestPermissionRecordAudio(options: Partial<{ onSuccess: () => void; onError: (message: string) => void; }> = {}) {
         const { onSuccess, onError } = options
         if (this.hasPlus()) {
             this.onPlusReady((plus) => {