li.shaoyi 2 years ago
parent
commit
892faba9ef

+ 1 - 1
src/business/user/account.ts

@@ -159,7 +159,7 @@ export function useRequestSignCompleted() {
     const signCompleted = async () => {
     const signCompleted = async () => {
         try {
         try {
             loading.value = true
             loading.value = true
-            return await requestSignCompleted({})
+            return await requestSignCompleted()
         } finally {
         } finally {
             loading.value = false
             loading.value = false
         }
         }

+ 132 - 0
src/packages/pc/components/base/table-v2/index.less

@@ -0,0 +1,132 @@
+.app-table-v2 {
+    --el-mask-color: rgba(0, 0, 0, .25);
+
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+
+    &__header {
+        display: flex;
+        align-items: center;
+
+        >.block {
+            display: inline-flex;
+            align-items: center;
+            gap: 10px;
+            padding: 6px;
+
+            &:empty {
+                display: none;
+            }
+
+            &--right {
+                margin-left: auto;
+            }
+        }
+    }
+
+    &__container {
+        flex: 1;
+        overflow: hidden;
+    }
+
+    &__footer {
+        &:empty {
+            display: none;
+        }
+    }
+
+    .el-table-v2 {
+        --el-bg-color: transparent; //表格背景颜色
+        --el-table-row-hover-bg-color: #172b56; // 表格行鼠标经过背景色
+        --el-table-border-color: #161a1c; // 表格边框颜色
+        --el-table-border: 1px solid var(--el-table-border-color); // 表格边框
+    }
+
+    .el-table {
+        --el-table-bg-color: transparent; //表格背景颜色
+        --el-table-text-color: #e5e5e5; //表格文字颜色
+        --el-table-border-color: #161a1c; // 表格边框颜色
+        --el-table-border: 1px solid var(--el-table-border-color); // 表格边框
+        --el-table-header-bg-color: #212629; // 表头背景颜色
+        --el-table-header-text-color: #556772; // 表头文字颜色
+        --el-table-tr-bg-color: var(--el-table-bg-color); // 表格行背景颜色
+        --el-table-row-hover-bg-color: #172b56; // 表格行鼠标经过背景色
+        --el-table-expanded-cell-bg-color: var(--el-table-bg-color); // 展开行背景颜色
+        --el-table-current-row-bg-color: #172b56; // 当前行高亮颜色
+
+        width: 100%;
+
+        th.el-table__cell {
+            height: 30px;
+            font-weight: normal;
+            padding: 4px 0;
+        }
+
+        td.el-table__cell {
+            padding: 4px 0;
+
+            .el-table__placeholder:empty {
+                display: none;
+            }
+        }
+
+        td.el-table-fixed-column {
+
+            &--left,
+            &--right {
+                --el-bg-color: #181e22; // 非全局待处理
+            }
+        }
+
+        &__expanded-cell {
+            padding: 4px !important;
+
+            &:empty {
+                display: none;
+            }
+
+            .buttonbar,
+            .app-auth {
+                position: sticky;
+                right: 5px;
+                display: table;
+                margin-left: auto;
+            }
+        }
+    }
+
+    .el-table {
+
+        &.buy,
+        &.sell {
+            --el-table-row-hover-bg-color: var(--el-table-bg-color); // 表格行鼠标经过背景色
+            --el-table-current-row-bg-color: var(--el-table-bg-color); // 当前行高亮颜色
+
+            td.el-table {
+
+                // &__cell:not(&__expanded-cell):first-child,
+                // &__cell:is(&__expand-column)+td {
+                //     background-color: var(--el-table-header-bg-color);
+                // }
+
+                &__cell:not(&__expanded-cell):first-child {
+                    background-color: var(--el-table-header-bg-color);
+                }
+
+                &__expanded-cell,
+                &__expanded-cell:hover {
+                    background-color: #000 !important;
+                }
+            }
+        }
+
+        &.buy {
+            --el-table-bg-color: #271112; //表格背景颜色
+        }
+
+        &.sell {
+            --el-table-bg-color: #10251d; //表格背景颜色
+        }
+    }
+}

+ 58 - 0
src/packages/pc/components/base/table-v2/index.ts

@@ -0,0 +1,58 @@
+import { ref, shallowRef } from 'vue'
+import type { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'
+import { ComposeTableOptions } from './types'
+
+/**
+ * 组合表格函数
+ * @param rowKey 表格主键key
+ */
+export function useComposeTable<T>({ rowKey }: ComposeTableOptions<T>) {
+    // 表格选中的行数据
+    const selectedRow = ref<T>()
+
+    // 表格展开行,对应 row-key 中的值
+    const expandKeys = shallowRef<T[keyof T][]>([])
+
+    // 右键菜单
+    const contextmenu = ref({
+        show: false,
+        clientX: 0,
+        clientY: 0,
+    })
+
+    // 表格行点击事件
+    const rowClick = (row: T) => {
+        const keyValue = row[rowKey]
+        if (expandKeys.value.includes(keyValue)) {
+            expandKeys.value = []
+        } else {
+            expandKeys.value = [keyValue]
+        }
+        selectedRow.value = row
+    }
+
+    // 表格右键事件
+    const rowContextmenu = (row: T, column: TableColumnCtx<T>, event: MouseEvent) => {
+        // 阻止浏览器右键
+        event.preventDefault()
+
+        // 表格选中的行数据
+        selectedRow.value = row
+
+        // 显示表格右键菜单
+        contextmenu.value = {
+            show: true,
+            clientX: event.clientX,
+            clientY: event.clientY,
+        }
+    }
+
+    return {
+        rowKey,
+        expandKeys,
+        selectedRow,
+        contextmenu,
+        rowClick,
+        rowContextmenu,
+    }
+}

+ 51 - 0
src/packages/pc/components/base/table-v2/index.vue

@@ -0,0 +1,51 @@
+<template>
+  <div class="app-table-v2">
+    <el-auto-resizer v-if="dataList.length">
+      <template #default="{ height, width }">
+        <el-table-v2 :data="dataList" :columns="columns"  :width="width" :height="height" :header-height="32" :row-height="32" />
+      </template>
+    </el-auto-resizer>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+
+defineProps({
+  dataList: {
+    type: Array,
+    required: true
+  }
+})
+
+const columns = shallowRef([
+  {
+    key: 'goodsname',
+    dataKey: 'goodsname',
+    title: '订单合约',
+    width: 150
+  },
+  {
+    key: 'buyorsell',
+    dataKey: 'buyorsell',
+    title: '类型',
+    width: 150
+  },
+  {
+    key: 'orderprice',
+    dataKey: 'orderprice',
+    title: '委托价',
+    width: 150
+  },
+  {
+    key: 'orderqty',
+    dataKey: 'orderqty',
+    title: '委托数量',
+    width: 150
+  }
+])
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 7 - 0
src/packages/pc/components/base/table-v2/types.ts

@@ -0,0 +1,7 @@
+/**
+ * 组合表格配置项
+ */
+export interface ComposeTableOptions<T> {
+    rowKey: keyof T;
+    columnKey?: string;
+}

+ 2 - 1
src/packages/pc/components/layouts/footer/index.less

@@ -36,7 +36,8 @@
         flex: 1;
         flex: 1;
         overflow: hidden;
         overflow: hidden;
 
 
-        .app-table {
+        .app-table,
+        .app-table-v2 {
             background-color: #181e22;
             background-color: #181e22;
         }
         }
     }
     }

+ 1 - 0
src/packages/pc/views/footer/goods/detail/index.vue

@@ -23,6 +23,7 @@ import { shallowRef, onUnmounted, defineAsyncComponent } from 'vue'
 import { getBuyOrSellName } from '@/constants/order'
 import { getBuyOrSellName } from '@/constants/order'
 import { useRequest } from '@/hooks/request'
 import { useRequest } from '@/hooks/request'
 import { useComponent } from '@/hooks/component'
 import { useComponent } from '@/hooks/component'
+import { useDataTable } from '@/hooks/datatable'
 import { queryTradeHolderDetail } from '@/services/api/order'
 import { queryTradeHolderDetail } from '@/services/api/order'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppTable from '@pc/components/base/table/index.vue'
 import eventBus from '@/services/bus'
 import eventBus from '@/services/bus'

+ 30 - 27
src/packages/qxst/views/account/certification/components/certification-next/Index.vue

@@ -28,7 +28,8 @@
                     </template>
                     </template>
                     <template v-if="secondStepList.every(e => e.recordstatus === 3)">
                     <template v-if="secondStepList.every(e => e.recordstatus === 3)">
                         <template v-for="(item, index) in thirdStepList" :key="index">
                         <template v-for="(item, index) in thirdStepList" :key="index">
-                            <Cell title="视频认证" :icon="iconName(item.recordstatus)" @click="faceAuth()" is-link />
+                            <Cell title="视频认证" :icon="iconName(item.recordstatus)" @click="faceAuth(item.recordstatus)"
+                                :is-link="item.recordstatus !== 3" />
                         </template>
                         </template>
                     </template>
                     </template>
                 </CellGroup>
                 </CellGroup>
@@ -132,33 +133,35 @@ const signer = (item: Model.UserESignRecordRsq) => {
 }
 }
 
 
 // 视频认证
 // 视频认证
-const faceAuth = () => {
-    plus.requestPermissionCamera({
-        onSuccess: () => {
-            plus.requestPermissionRecordAudio({
-                onSuccess: () => {
-                    /// 进行视频认证
-                    willFaceFormData.idCardNo = props.formData.idCard
-                    willFaceFormData.realName = props.formData.name
-                    /// loading
-                    fullloading((hideLoading) => {
-                        willFace().then((res) => {
-                            hideLoading()
-                            openWebview(res.data.faceUrl)
-                        }).catch((err) => {
-                            hideLoading(err, 'fail')
+const faceAuth = (status: number) => {
+    if (status !== 3) {
+        plus.requestPermissionCamera({
+            onSuccess: () => {
+                plus.requestPermissionRecordAudio({
+                    onSuccess: () => {
+                        /// 进行视频认证
+                        willFaceFormData.idCardNo = props.formData.idCard
+                        willFaceFormData.realName = props.formData.name
+                        /// loading
+                        fullloading((hideLoading) => {
+                            willFace().then((res) => {
+                                hideLoading()
+                                openWebview(res.data.faceUrl)
+                            }).catch((err) => {
+                                hideLoading(err, 'fail')
+                            })
                         })
                         })
-                    })
-                },
-                onError: (err) => {
-                    showFailToast(err)
-                }
-            })
-        },
-        onError: (err) => {
-            showFailToast(err)
-        }
-    })
+                    },
+                    onError: (err) => {
+                        showFailToast(err)
+                    }
+                })
+            },
+            onError: (err) => {
+                showFailToast(err)
+            }
+        })
+    }
 }
 }
 
 
 /// 最终提交
 /// 最终提交