li.shaoyi пре 3 година
родитељ
комит
4ea8052ef5

+ 8 - 0
src/router/index.ts

@@ -1776,6 +1776,14 @@ const routes: Array<RouteRecordRaw> = [
                         meta: {
                             requireAuth: true,
                         },
+                    },
+                    {
+                        path: 'spot_trade_advertisement',
+                        name: 'spot_trade_advertisement',
+                        component: () => import('@/views/market/spot_trade/spot_trade_advertisement/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
                     }
                 ]
             },

+ 17 - 1
src/services/go/commonService/index.ts

@@ -4,6 +4,7 @@ import { setAllEnum } from '@/services/bus/allEnum';
 import { geLoginID_number } from '@/services/bus/login';
 import { localStorageUtil } from '@/utils/storage';
 import moment from 'moment';
+import { OperationTabMenu } from '@/services/go/commonService/interface';
 import { commonSearch_go } from '../index';
 import * as type from './interface';
 
@@ -100,7 +101,22 @@ export function GetPCMenus(): Promise<string> {
     };
     Object.assign(param, obj)
     return commonSearch_go('/Common/GetClientMenus', param)
-        .then((res) => {
+        .then((res: OperationTabMenu[]) => {
+            const first = res.find((e) => e.code === 'market');
+            const second = first?.children.find((e) => e.code === 'spot_trade');
+
+            second?.children.push({
+                code: 'spot_trade_advertisement',
+                isshow: true,
+                rulekey: 'spot_trade_advertisement',
+                sort: 0,
+                title: '融资融货',
+                type: 1,
+                url: '',
+                remark: '',
+                children: []
+            })
+
             APP.set('menus', res);
             console.log('交易端菜单', res);
             return 'ok';

+ 10 - 1
src/services/go/wrtrade/index.ts

@@ -56,7 +56,8 @@ import {
     WrStandardFactoryItemEx,
     WrTradeDetail,
     WrTradeOrderDetailReq,
-    WrTradeOrderDetailRsp
+    WrTradeOrderDetailRsp,
+    QueryWrClientAdSpaceConfigRsp
 } from "@/services/go/wrtrade/interface";
 
 /**
@@ -396,3 +397,11 @@ export function queryWrPerformanceStepType(): Promise<QueryWrPerformanceStepType
     });
 }
 
+/**
+ * /WrTrade2/QueryWrClientAdSpaceConfig 查询固定广告配置
+ */
+export function queryWrClientAdSpaceConfig(): Promise<QueryWrClientAdSpaceConfigRsp[]> {
+    return commonSearch_go('/WrTrade2/QueryWrClientAdSpaceConfig', {}).catch((err) => {
+        throw new Error(`查询固定广告配置: ${err}`);
+    });
+}

+ 18 - 0
src/services/go/wrtrade/interface.ts

@@ -1187,4 +1187,22 @@ export interface QueryWrPerformanceStepTypeRsp {
     canauto: number; // 能否自动确认 - 0:不可自动确认 1:可自动确认 (可设置自动确认步骤: 1:买方支付 3:买方自提 5:买方确认货 7:买方确认票)
     steptypeid: number; // 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
     steptypename: string; // 步骤类型名称
+}
+
+/**
+ * 查询固定广告配置
+ */
+export interface QueryWrClientAdSpaceConfigRsp {
+    adspaceid: number;// 广告位ID
+    adspacename: string;// 广告位名称
+    adspacetype: number;// 广告位类型 - 1:固定广告位
+    areauserid: number;// 所属机构ID
+    createdate: string;// 创建时间
+    imagepath: string;// 图片
+    modifierid: number;// 操作人
+    recsize: string;// 推荐尺寸
+    title: string;// 标题
+    updatedate: string;// 更新时间
+    urlcontent: string;// 链接(地址\商品ID\功能菜单Key\appid)
+    urltype: number;// 链接类型 - 0:无 1:直接地址 2:商品ID 3:图片详情 4:App功能 5:微信小程序
 }

+ 12 - 0
src/views/market/spot_trade/spot_trade_advertisement/index.less

@@ -0,0 +1,12 @@
+.ad{
+    display: flex;
+    flex-direction: column;
+    overflow-y: auto;
+    align-items: center;
+    padding: 2px;
+
+    &-img{
+        width: fit-content;
+        max-width: 100%;
+    }
+}

+ 34 - 0
src/views/market/spot_trade/spot_trade_advertisement/index.vue

@@ -0,0 +1,34 @@
+<template>
+  <div class="ad">
+    <template v-for="(item,index) in adList" :key="index">
+      <img class="ad-img" :src="item.urlcontent" v-if="item.urlcontent" />
+    </template>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+import { queryWrClientAdSpaceConfig } from '@/services/go/wrtrade';
+import { QueryWrClientAdSpaceConfigRsp } from "@/services/go/wrtrade/interface";
+import { initData } from '@/common/methods';
+
+export default defineComponent({
+  setup() {
+    const adList = ref<QueryWrClientAdSpaceConfigRsp[]>([]);
+
+    initData(() => {
+      queryWrClientAdSpaceConfig().then((res) => {
+        adList.value = res.filter((e) => e.adspaceid === 30);
+      })
+    })
+
+    return {
+      adList
+    }
+  }
+})
+</script>
+
+<style lang="less" scoped>
+@import './index.less';
+</style>