weixin_52219567 1 день назад
Родитель
Сommit
4fd4328e0a

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

@@ -27,6 +27,15 @@ export function getDiyProductPage(query: any) {
   });
   });
 }
 }
 
 
+// 大客户站点商品
+export function getCustomerProductPage(query: any) {
+  return request({
+    url: '/product/indexSiteProduct/getCustomerProductPage',
+    method: 'get',
+    params: query
+  });
+}
+
 //商品
 //商品
 export function getServiceCaseList(query: any) {
 export function getServiceCaseList(query: any) {
   return request({
   return request({

+ 5 - 2
src/layout/components/header.vue

@@ -28,12 +28,14 @@
               <ArrowDown />
               <ArrowDown />
             </el-icon>
             </el-icon>
           </div>
           </div>
-          <div class="userInfo-box" @click="onPath('/indexEnterprise')">切换到企业</div>
+          <!-- <div class="userInfo-box" @click="onPath('/indexEnterprise')">切换到企业</div> -->
           <div class="userInfo-box">姓名:{{ userInfo.user.nickName }}</div>
           <div class="userInfo-box">姓名:{{ userInfo.user.nickName }}</div>
           <div class="userInfo-box" @click="onlogout">退出登录</div>
           <div class="userInfo-box" @click="onlogout">退出登录</div>
         </div>
         </div>
         <div v-if="!userInfo.user" class="header-text end" @click="onPath('/login')" style="cursor: pointer">请登录</div>
         <div v-if="!userInfo.user" class="header-text end" @click="onPath('/login')" style="cursor: pointer">请登录</div>
         <div v-if="!userInfo.user" class="header-text hig" @click="onPath('/breg')">免费注册</div>
         <div v-if="!userInfo.user" class="header-text hig" @click="onPath('/breg')">免费注册</div>
+        <div v-if="route.path == '/indexEnterprise'" class="header-text" @click="onPath('/')">切换到个人</div>
+        <div v-else class="header-text" @click="onPath('/indexEnterprise')">切换到企业</div>
         <div class="header-text" @click="onPath('/order/orderManage')">我的订单</div>
         <div class="header-text" @click="onPath('/order/orderManage')">我的订单</div>
         <div class="header-text" @click="onPath('/enterprise/companyInfo')">会员中心</div>
         <div class="header-text" @click="onPath('/enterprise/companyInfo')">会员中心</div>
         <div class="header-text" @click="onPath('/theme?id=1')">人才招聘</div>
         <div class="header-text" @click="onPath('/theme?id=1')">人才招聘</div>
@@ -49,6 +51,7 @@ import { useUserStore } from '@/store/modules/user';
 import { onPath } from '@/utils/siteConfig';
 import { onPath } from '@/utils/siteConfig';
 import Cookies from 'js-cookie';
 import Cookies from 'js-cookie';
 import { getInfo } from '@/api/login';
 import { getInfo } from '@/api/login';
+const route = useRoute();
 const userInfoOpen = ref<any>(false);
 const userInfoOpen = ref<any>(false);
 const userInfo = ref<any>({});
 const userInfo = ref<any>({});
 
 
@@ -167,7 +170,7 @@ const onlogout = () => {
         &.open {
         &.open {
           background-color: #ffffff;
           background-color: #ffffff;
           box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
           box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
-          height: 146px;
+          height: 110x;
           overflow: visible;
           overflow: visible;
           .userInfo-customer {
           .userInfo-customer {
             color: #e7000b;
             color: #e7000b;

+ 4 - 0
src/views/home/index-dataDiy.vue

@@ -1,6 +1,10 @@
 <template>
 <template>
   <div class="w100%">
   <div class="w100%">
     <diyIndex v-if="dataInfo && dataInfo.isHome" :dataInfo="dataInfo"></diyIndex>
     <diyIndex v-if="dataInfo && dataInfo.isHome" :dataInfo="dataInfo"></diyIndex>
+    <template v-else>
+      <div class="h-[30px]"></div>
+      <el-empty description="您的专属页面还未设计,请联系管理员~" />
+    </template>
   </div>
   </div>
 </template>
 </template>
 
 

+ 1 - 1
src/views/home/pccomponents/index.ts

@@ -70,7 +70,7 @@ export const componentImportConfigs: any = [
     icon: 'iconfont iconfuwenbenpc',
     icon: 'iconfont iconfuwenbenpc',
     id: 18,
     id: 18,
     enabled: true,
     enabled: true,
-    components: markRaw(headRef.value),
+    components: markRaw(headDataRef.value),
     fid: 1
     fid: 1
   },
   },
   {
   {

+ 1 - 0
src/views/home/pccomponents/index.vue

@@ -26,6 +26,7 @@ const loadComponents = async () => {
   const datas = JSON.parse(props.dataInfo.property);
   const datas = JSON.parse(props.dataInfo.property);
   collapse.value.forEach((item1: any) => {
   collapse.value.forEach((item1: any) => {
     datas.forEach((item2: any) => {
     datas.forEach((item2: any) => {
+      item2.clientId = props.dataInfo.clientId ? props.dataInfo.clientId : '';
       if (item1.id == item2.fid) {
       if (item1.id == item2.fid) {
         item1.list.forEach((item3: any) => {
         item1.list.forEach((item3: any) => {
           if (item2.id == item3.id) {
           if (item2.id == item3.id) {

+ 14 - 2
src/views/home/pccomponents/pages/discover.vue

@@ -142,7 +142,7 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import { onPath } from '@/utils/siteConfig';
 import { onPath } from '@/utils/siteConfig';
 import figure from '@/assets/images/figure.png';
 import figure from '@/assets/images/figure.png';
-import { getDiyProductPage } from '@/api/home/diy';
+import { getDiyProductPage, getCustomerProductPage } from '@/api/home/diy';
 const props = defineProps<{
 const props = defineProps<{
   row?: any;
   row?: any;
   datas?: any;
   datas?: any;
@@ -161,7 +161,19 @@ onMounted(() => {
 const getDataList = () => {
 const getDataList = () => {
   dataList.value = [{}, {}, {}, {}];
   dataList.value = [{}, {}, {}, {}];
   if (componentData.goodsIds.length > 0) {
   if (componentData.goodsIds.length > 0) {
-    getDiyProductPage({ pageNum: 1, pageSize: 10, ids: componentData.goodsIds.join(',') }).then((res) => {
+    const apiFunc = componentData.clientId && componentData.clientId !== 'undefined' ? getCustomerProductPage : getDiyProductPage;
+    const queryParams = {
+      pageNum: 1,
+      pageSize: 10,
+      ids: componentData.goodsIds.join(','),
+      customerId: ''
+    };
+    if (componentData.clientId && componentData.clientId != 'undefined') {
+      queryParams.customerId = componentData.clientId;
+    } else {
+      delete queryParams.customerId;
+    }
+    apiFunc(queryParams).then((res) => {
       if (res.code == 200) {
       if (res.code == 200) {
         dataList.value = res.rows;
         dataList.value = res.rows;
       }
       }

+ 14 - 2
src/views/home/pccomponents/pages/floor.vue

@@ -70,7 +70,7 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import { onPath } from '@/utils/siteConfig';
 import { onPath } from '@/utils/siteConfig';
 import figure from '@/assets/images/figure.png';
 import figure from '@/assets/images/figure.png';
-import { getDiyProductPage } from '@/api/home/diy';
+import { getDiyProductPage, getCustomerProductPage } from '@/api/home/diy';
 interface Props {
 interface Props {
   row?: any;
   row?: any;
 }
 }
@@ -87,7 +87,19 @@ const getDataList = () => {
   dataList.value = [{}, {}, {}, {}, {}, {}, {}, {}];
   dataList.value = [{}, {}, {}, {}, {}, {}, {}, {}];
   //手动选择
   //手动选择
   if (componentData.goodsIds.length > 0) {
   if (componentData.goodsIds.length > 0) {
-    getDiyProductPage({ pageNum: 1, pageSize: 20, ids: componentData.goodsIds.join(',') }).then((res) => {
+    const apiFunc = componentData.clientId && componentData.clientId !== 'undefined' ? getCustomerProductPage : getDiyProductPage;
+    const queryParams = {
+      pageNum: 1,
+      pageSize: 10,
+      ids: componentData.goodsIds.join(','),
+      customerId: ''
+    };
+    if (componentData.clientId && componentData.clientId != 'undefined') {
+      queryParams.customerId = componentData.clientId;
+    } else {
+      delete queryParams.customerId;
+    }
+    apiFunc(queryParams).then((res) => {
       if (res.code == 200) {
       if (res.code == 200) {
         dataList.value = res.rows;
         dataList.value = res.rows;
       }
       }

+ 15 - 7
src/views/home/pccomponents/pages/goods.vue

@@ -80,8 +80,7 @@
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { onPath } from '@/utils/siteConfig';
 import { onPath } from '@/utils/siteConfig';
 import figure from '@/assets/images/figure.png';
 import figure from '@/assets/images/figure.png';
-import { getDiyProductPage } from '@/api/home/diy';
-import { el } from 'element-plus/es/locale/index.mjs';
+import { getDiyProductPage, getCustomerProductPage } from '@/api/home/diy';
 
 
 const props = defineProps<{
 const props = defineProps<{
   row?: any;
   row?: any;
@@ -99,10 +98,21 @@ onMounted(() => {
 
 
 const getDataList = () => {
 const getDataList = () => {
   original.value = [{}, {}, {}, {}, {}];
   original.value = [{}, {}, {}, {}, {}];
+  const apiFunc = componentData.clientId && componentData.clientId !== 'undefined' ? getCustomerProductPage : getDiyProductPage;
+  const queryParams = {
+    pageNum: 1,
+    pageSize: componentData.goodsType == 1 ? 20 : componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
+    customerId: ''
+  };
+  if (componentData.clientId && componentData.clientId != 'undefined') {
+    queryParams.customerId = componentData.clientId;
+  } else {
+    delete queryParams.customerId;
+  }
   //手动选择
   //手动选择
   if (componentData.goodsType == 1) {
   if (componentData.goodsType == 1) {
     if (componentData.goodsIds.length > 0) {
     if (componentData.goodsIds.length > 0) {
-      getDiyProductPage({ pageNum: 1, pageSize: 20, ids: componentData.goodsIds.join(',') }).then((res) => {
+      apiFunc({ ...queryParams, ids: componentData.goodsIds.join(',') }).then((res) => {
         if (res.code == 200) {
         if (res.code == 200) {
           original.value = res.rows;
           original.value = res.rows;
         }
         }
@@ -113,8 +123,7 @@ const getDataList = () => {
     if (componentData.categoryIds && componentData.categoryIds.length > 0) {
     if (componentData.categoryIds && componentData.categoryIds.length > 0) {
       const categoryIds = componentData.categoryIds.map((item: any) => item[2]);
       const categoryIds = componentData.categoryIds.map((item: any) => item[2]);
       getDiyProductPage({
       getDiyProductPage({
-        pageNum: 1,
-        pageSize: componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
+        ...queryParams,
         categoryIds: categoryIds.join(',')
         categoryIds: categoryIds.join(',')
       }).then((res) => {
       }).then((res) => {
         if (res.code == 200) {
         if (res.code == 200) {
@@ -128,8 +137,7 @@ const getDataList = () => {
     //品牌查询
     //品牌查询
     if (componentData.brandIds && componentData.brandIds.length > 0) {
     if (componentData.brandIds && componentData.brandIds.length > 0) {
       getDiyProductPage({
       getDiyProductPage({
-        pageNum: 1,
-        pageSize: componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
+        ...queryParams,
         brandIds: componentData.brandIds.join(',')
         brandIds: componentData.brandIds.join(',')
       }).then((res) => {
       }).then((res) => {
         if (res.code == 200) {
         if (res.code == 200) {

+ 15 - 5
src/views/home/pccomponents/pages/goodsList.vue

@@ -52,7 +52,7 @@
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { onPath } from '@/utils/siteConfig';
 import { onPath } from '@/utils/siteConfig';
 import figure from '@/assets/images/figure.png';
 import figure from '@/assets/images/figure.png';
-import { getDiyProductPage } from '@/api/home/diy';
+import { getDiyProductPage, getCustomerProductPage } from '@/api/home/diy';
 import { getRecommendedCategoryProductList } from '@/api/home/index-mro';
 import { getRecommendedCategoryProductList } from '@/api/home/index-mro';
 interface Props {
 interface Props {
   row?: any;
   row?: any;
@@ -79,12 +79,23 @@ const getDataList = () => {
     });
     });
   } else {
   } else {
     dataList.value = [{}, {}, {}, {}, {}];
     dataList.value = [{}, {}, {}, {}, {}];
+    const apiFunc = componentData.clientId && componentData.clientId !== 'undefined' ? getCustomerProductPage : getDiyProductPage;
+    const queryParams = {
+      pageNum: 1,
+      pageSize: componentData.goodsType == 1 ? 20 : componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
+      customerId: ''
+    };
+    if (componentData.clientId && componentData.clientId != 'undefined') {
+      queryParams.customerId = componentData.clientId;
+    } else {
+      delete queryParams.customerId;
+    }
     if (componentData.tabList && componentData.tabList.length > 0) {
     if (componentData.tabList && componentData.tabList.length > 0) {
       const datas = componentData.tabList[componentData.tabIndex];
       const datas = componentData.tabList[componentData.tabIndex];
       //手动选择
       //手动选择
       if (datas.goodsType == 1) {
       if (datas.goodsType == 1) {
         if (datas.goodsIds.length > 0) {
         if (datas.goodsIds.length > 0) {
-          getDiyProductPage({ pageNum: 1, pageSize: 20, ids: datas.goodsIds.join(',') }).then((res) => {
+          apiFunc({ ...queryParams, ids: datas.goodsIds.join(',') }).then((res) => {
             if (res.code == 200) {
             if (res.code == 200) {
               dataList.value = res.rows;
               dataList.value = res.rows;
             }
             }
@@ -93,9 +104,8 @@ const getDataList = () => {
       } else if (datas.goodsType == 2) {
       } else if (datas.goodsType == 2) {
         //分类查询
         //分类查询
         if (datas.categoryIds && datas.categoryIds.length > 0) {
         if (datas.categoryIds && datas.categoryIds.length > 0) {
-          getDiyProductPage({
-            pageNum: 1,
-            pageSize: componentData.goodsNumber == 0 ? 9999 : componentData.goodsNumber,
+          apiFunc({
+            ...queryParams,
             categoryIds: datas.categoryIds.join(',')
             categoryIds: datas.categoryIds.join(',')
           }).then((res) => {
           }).then((res) => {
             if (res.code == 200) {
             if (res.code == 200) {

+ 7 - 18
src/views/home/pccomponents/pages/headData.vue

@@ -239,6 +239,7 @@ import Cookies from 'js-cookie';
 import { getInfo } from '@/api/login';
 import { getInfo } from '@/api/login';
 import { cartStore } from '@/store/modules/cart';
 import { cartStore } from '@/store/modules/cart';
 import { getEnterpriseInfo } from '@/api/pc/enterprise';
 import { getEnterpriseInfo } from '@/api/pc/enterprise';
+import { customerMessageList } from '@/api/home/index-enterprise';
 const props = defineProps<{
 const props = defineProps<{
   row?: any;
   row?: any;
   datas?: any;
   datas?: any;
@@ -284,14 +285,13 @@ onMounted(() => {
           customerSalesInfoVo.value = res.data.customerSalesInfoVo;
           customerSalesInfoVo.value = res.data.customerSalesInfoVo;
         }
         }
         customerSalesInfoVo.value.deptCredit = res.data.deptCredit;
         customerSalesInfoVo.value.deptCredit = res.data.deptCredit;
-        console.log(res.data, '??????????');
       }
       }
     });
     });
   }
   }
 });
 });
 
 
 //头部分类
 //头部分类
-getProductCategoryTree({ platform: componentData.headType ? componentData.headType : 0 }).then((res) => {
+getProductCategoryTree({ platform: componentData.headType ? componentData.headType : componentData.clientId ? 4 : 0 }).then((res) => {
   if (res.code == 200) {
   if (res.code == 200) {
     classifyList.value = res.data;
     classifyList.value = res.data;
   }
   }
@@ -300,22 +300,11 @@ getProductCategoryTree({ platform: componentData.headType ? componentData.headTy
 const getDataList = () => {
 const getDataList = () => {
   realList.value = [];
   realList.value = [];
   // 默认
   // 默认
-  if (componentData.realDataType == 1) {
-    getAnnouncementPage({ pageSize: 20 }).then((res) => {
-      if (res.code == 200) {
-        realList.value = res.rows;
-      }
-    });
-  } else {
-    //手动选择
-    getAnnouncementPage({ pageSize: 20, ids: componentData.realIds.join(',') }).then((res) => {
-      if (res.code == 200) {
-        const result = res.rows.filter((item: any) => componentData.realIds.includes(item.id));
-        realList.value = result;
-        console.log('result', result);
-      }
-    });
-  }
+  customerMessageList({ pageSize: 20 }).then((res) => {
+    if (res.code == 200) {
+      realList.value = res.rows;
+    }
+  });
 };
 };
 
 
 //移入分类
 //移入分类