weixin_52219567 1 week ago
parent
commit
b2884b4e70
4 changed files with 34 additions and 1 deletions
  1. 8 0
      src/api/home/diy.ts
  2. 6 0
      src/router/index.ts
  3. 1 1
      src/utils/siteConfig.ts
  4. 19 0
      src/views/home/pc-index.vue

+ 8 - 0
src/api/home/diy.ts

@@ -73,3 +73,11 @@ export function getIsUseDiy(query: any) {
     params: query
   });
 }
+
+export function getPcDiyIndexPageById(query: any) {
+  return request({
+    url: '/mall/indexDiyPcPage/getPcDiyIndexPageById',
+    method: 'get',
+    params: query
+  });
+}

+ 6 - 0
src/router/index.ts

@@ -122,6 +122,12 @@ export const constantRoutes: RouteRecordRaw[] = [
         name: 'indexEnterprise',
         meta: { title: '企业首页', search: 'hide', header: 'hide', foot: 'hide' }
       },
+      {
+        path: '/pcIndex',
+        component: () => import('@/views/home/pc-index.vue'),
+        name: 'homePcIndex',
+        meta: { title: '' }
+      },
       {
         path: '/theme',
         component: () => import('@/views/home/theme.vue'),

+ 1 - 1
src/utils/siteConfig.ts

@@ -31,7 +31,7 @@ const REVERSE_DOMAIN_MAP: Record<string, string> = Object.entries(DOMAIN_MAP).re
 
 // 每个站点允许的路由 (保持不变)
 export const SITE_ROUTES: Record<any, string[]> = {
-  www: ['/', '/index', '/indexDiy', '/indexData', '/indexDataDiy', '/theme', '/indexEnterprise'], //优易365主站
+  www: ['/', '/index', '/indexDiy', '/indexData', '/indexDataDiy', '/theme', '/indexEnterprise', '/pcIndex'], //优易365主站
   b: ['/indexB'], //企业购商城
   mro: ['/indexMro', '/indexMroDiy'], //工业品商城
   fuli: ['/indexFuli', '/indexFuliDiy'], //福礼商城

+ 19 - 0
src/views/home/pc-index.vue

@@ -0,0 +1,19 @@
+<template>
+  <div class="w100%">
+    <diyIndex v-if="dataInfo && dataInfo.isHome" :dataInfo="dataInfo"></diyIndex>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { getPcDiyIndexPageById } from '@/api/home/diy';
+import diyIndex from '@/views/home/pccomponents/index.vue';
+const route = useRoute();
+const dataInfo = ref<any>(null);
+getPcDiyIndexPageById({ id: route.query.id }).then((res) => {
+  if (res.code == 200) {
+    dataInfo.value = res.data;
+  }
+});
+</script>
+
+<style lang="scss" scoped></style>