Handy_Cao 2 anni fa
parent
commit
e386f3bc09

+ 15 - 3
src/packages/mobile/views/swap/list/Index.vue

@@ -42,11 +42,12 @@ import { computed, onUnmounted, onActivated } from 'vue'
 import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { useNavigation } from '@mobile/router/navigation'
-import { queryQuoteGoodsList } from '@/services/api/swap'
+import { queryQuoteGoodsList, queryMdUserSwapProtocol } from '@/services/api/swap'
 import { useFuturesStore, useUserStore } from '@/stores'
 import quoteSocket from '@/services/websocket/quote'
 import AppList from '@mobile/components/base/list/index.vue'
 import { showToast } from 'vant'
+import { getUserId } from '@/services/methods/user'
 
 defineProps({
     showBackButton: {
@@ -60,6 +61,13 @@ const futuresStore = useFuturesStore()
 const userStore = useUserStore()
 const subscribe = quoteSocket.createSubscribe()
 
+/// 查询用户掉期协议签署表
+const { dataList: protocolList} = useRequest(queryMdUserSwapProtocol, {
+    params: {
+        userId: getUserId()
+    }
+})
+
 const { dataList, run } = useRequest(queryQuoteGoodsList, {
     manual: true,
     params: {
@@ -115,8 +123,12 @@ const columns: Model.TableColumn[] = [
 const rowClick = (row: Model.QuoteGoodsListRsp) => {
     /// 这里要去判断是否已经实名认证
     if (userStore.hasAuth) {
-        setGlobalUrlParams(row)
-        router.push({ name: 'swap-detail' })
+        if (protocolList.value.length != 0) {
+            setGlobalUrlParams(row)
+            router.push({ name: 'swap-detail' })
+        } else {
+            showToast('请前往‘我的’-’合同签署‘,进行签署相应的合同条例才能进行交易!')
+        }
     } else {
         showToast('未实名认证,请先去实名认证,如果已提交实名认证,请耐心等待审核通过!')
     }

+ 16 - 4
src/packages/pc/views/market/trade/swap/index.vue

@@ -38,10 +38,11 @@ import { useComponent } from '@/hooks/component'
 import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
 import { useFuturesStore, useUserStore } from '@/stores'
 import { useRequest } from '@/hooks/request'
-import { queryQuoteGoodsList } from '@/services/api/swap'
+import { queryQuoteGoodsList, queryMdUserSwapProtocol  } from '@/services/api/swap'
 import quoteSocket from '@/services/websocket/quote'
 import AppTable from '@pc/components/base/table/index.vue'
 import { ElMessage } from 'element-plus'
+import { getUserId } from '@/services/methods/user'
 
 const subscribe = quoteSocket.createSubscribe()
 const futuresStore = useFuturesStore()
@@ -54,6 +55,13 @@ const componentMap = new Map<string, unknown>([
     ['detail', defineAsyncComponent(() => import('./detail/index.vue'))], // 详情
 ])
 
+/// 查询用户掉期协议签署表
+const { dataList: protocolList} = useRequest(queryMdUserSwapProtocol, {
+    params: {
+        userId: getUserId()
+    }
+})
+
 const { dataList, run } = useRequest(queryQuoteGoodsList, {
     manual: true,
     params: {
@@ -110,9 +118,13 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
 const onRowClick = (row: Model.QuoteGoodsListRsp) => {
     /// 这里要去判断是否已经实名认证
     if (userStore.hasAuth) {
-        futuresStore.selectedGoodsId = row.refgoodsid
-        selectedRow.value = row
-        openComponent('detail')
+        if (protocolList.value.length != 0) {
+            futuresStore.selectedGoodsId = row.refgoodsid
+            selectedRow.value = row
+            openComponent('detail')
+        } else {
+            ElMessage('请前往手机App进入‘我的’-’合同签署‘功能,进行签署相应的合同条例才能进行交易!')
+        }
     } else {
         ElMessage('未实名认证,请先去实名认证,如果已提交实名认证,请耐心等待审核通过!')
     }