Browse Source

Merge branch 'v20' of http://47.101.159.18:3000/Muchinfo/MTP20_WEB_GLOBAL into v20

li.shaoyi 2 năm trước cách đây
mục cha
commit
29d83b9dfc

+ 15 - 26
src/packages/pc/views/market/trade/swap/detail/order/index.vue

@@ -1,30 +1,18 @@
 <!-- 掉期市场 - 商品详情 - 买卖大厅 -->
 <template>
     <div class="app-goods-detail-order">
-        <app-table class="sell" :data="sellList" v-model:columns="sellColumns" :row-key="rowKey"
-            :expand-row-keys="expandKeys" @row-click="rowClick" showIndex>
-            <template #username="{ row }">
-                <span>{{ row.userid }}/{{ row.username }}</span>
-            </template>
-            <!-- 展开行 -->
-            <template #expand="{ row }">
-                <div class="buttonbar">
-                    <el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
-                        @click="onDelisting(row)">{{ getDelistingButtonTitles(0, row) }}</el-button>
-                </div>
+        <app-table class="sell" :data="sellList" v-model:columns="sellColumns" >
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <el-button type="primary" size="small" :disabled="isDisable(row)"
+                        @click="onDelisting(row)">{{ getDelistingButtonTitles( 0, row ) }}</el-button>
             </template>
         </app-table>
-        <app-table class="buy" :data="buyList" v-model:columns="buyColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
-            @row-click="rowClick" showIndex>
-            <template #username="{ row }">
-                <span>{{ row.userid }}/{{ row.username }}</span>
-            </template>
-            <!-- 展开行 -->
-            <template #expand="{ row }">
-                <div class="buttonbar">
-                    <el-button type="primary" size="small" :disabled="isDisable(row)" @click="onDelisting(row)">{{
+        <app-table class="buy" :data="buyList" v-model:columns="buyColumns">
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <el-button type="primary" size="small" :disabled="isDisable(row)" @click="onDelisting(row)">{{
                         getDelistingButtonTitles(1, row) }}</el-button>
-                </div>
             </template>
         </app-table>
         <component ref="componentRef" v-bind="{ selectedRow, quoteGoods }" :is="componentMap.get(componentId)"
@@ -37,13 +25,14 @@ import { shallowRef, defineAsyncComponent, watch, PropType, onUnmounted } from '
 import { useRequest } from '@/hooks/request'
 import { BuyOrSell } from '@/constants/order'
 import { useComponent } from '@/hooks/component'
-import { useComposeTable } from '@pc/components/base/table'
 import { queryTjmdTradeOrderDetail, queryMdUserSwapProtocol } from '@/services/api/swap'
-import { useLoginStore, useFuturesStore } from '@/stores'
+import {useFuturesStore } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
 import eventBus from '@/services/bus'
 import { getUserId } from '@/services/methods/user'
 
+const selectedRow = shallowRef<Model.TjmdTradeOrderDetailRsp>()
+
 const props = defineProps({
     goodsId: {
         type: Number,
@@ -60,7 +49,6 @@ const componentMap = new Map<string, unknown>([
     ['protocol', defineAsyncComponent(() => import('./protocol/index.vue'))], // 摘牌
 ])
 
-const loginStore = useLoginStore()
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.goodsId)
 
@@ -79,8 +67,7 @@ const status = (row: Model.TjmdTradeOrderDetailRsp) => {
     return protocolList.value.find((e) => e.areauserid === row.userid)?.protocolstatus ?? 1
 }
 
-const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TjmdTradeOrderDetailRsp>({ rowKey: 'orderid' })
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(()=> {
     // 获取买大厅数据
     getBuyList()
     // 获取卖大厅数据
@@ -143,12 +130,14 @@ const buyColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'orderprice', label: '买价' },
     { prop: 'orderqty', label: '买量' },
     { prop: 'username', label: '购买方' },
+    { prop: 'operate', label: '操作' },
 ])
 
 const sellColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'orderprice', label: '卖价' },
     { prop: 'orderqty', label: '卖量' },
     { prop: 'username', label: '销售方' },
+    { prop: 'operate', label: '操作' },
 ])
 
 const showComponent = (componentName: string, row: Model.TjmdTradeOrderDetailRsp) => {

+ 9 - 3
src/packages/pc/views/market/trade/swap/index.vue

@@ -41,6 +41,7 @@ import { useRequest } from '@/hooks/request'
 import { queryQuoteGoodsList } from '@/services/api/swap'
 import quoteSocket from '@/services/websocket/quote'
 import AppTable from '@pc/components/base/table/index.vue'
+import { ElMessage } from 'element-plus'
 
 const subscribe = quoteSocket.createSubscribe()
 const futuresStore = useFuturesStore()
@@ -107,9 +108,14 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
 ])
 
 const onRowClick = (row: Model.QuoteGoodsListRsp) => {
-    futuresStore.selectedGoodsId = row.refgoodsid
-    selectedRow.value = row
-    openComponent('detail')
+    /// 这里要去判断是否已经实名认证
+    if (userStore.hasAuth) {
+        futuresStore.selectedGoodsId = row.refgoodsid
+        selectedRow.value = row
+        openComponent('detail')
+    } else {
+        ElMessage('未实名认证,请先去实名认证,如果已提交实名认证,请耐心等待审核通过!')
+    }
 }
 
 futuresStore.onResponse(() => run())