Ver código fonte

feat: 店铺管理端增加多站点逻辑

周玉环 3 dias atrás
pai
commit
dffbcc8ed4

+ 15 - 15
xinkeaboard-seller/config/config.js

@@ -78,21 +78,21 @@ export default {
       changeOrigin: true,
       pathRewrite: { "^/api": "" },
     },
-    // '/api/v3/system/seller/setting/getSiteSettingList': {
-    //   target: 'http://192.168.0.158:8001/',
-    //   changeOrigin: true,
-    //   pathRewrite: { "^/api": "" },
-    // },
-    // '/api/v3/statistics/seller/overview/analysis/source/presentData': {
-    //   target: 'http://192.168.0.158:8001/',
-    //   changeOrigin: true,
-    //   pathRewrite: { "^/api": "" },
-    // },
-    // '/api/v3/goods/seller/goods/list': {
-    //   target: 'http://192.168.0.158:8001/',
-    //   changeOrigin: true,
-    //   pathRewrite: { "^/api": "" },
-    // }
+    '/api/v3/seller/seller/apply/saveApply': {
+      target: 'http://192.168.0.158:8001/',
+      changeOrigin: true,
+      pathRewrite: { "^/api": "" },
+    },
+    '/api/v3/seller/seller/apply/applyDetail': {
+      target: 'http://192.168.0.158:8001/',
+      changeOrigin: true,
+      pathRewrite: { "^/api": "" },
+    },
+    '/api/v3/seller/seller/apply/process': {
+      target: 'http://192.168.0.158:8001/',
+      changeOrigin: true,
+      pathRewrite: { "^/api": "" },
+    }
   },
   ignoreMomentLocale: true,
   lessLoaderOptions: {

+ 2 - 2
xinkeaboard-seller/config/router.config.js

@@ -31,7 +31,7 @@ export default [
   // 商户入驻路由
   {
     path: '/apply',
-    component: '../layouts/BasicLayout',
+    component: '../layouts/index',
     Routes: ['src/pages/CheckSettle'],
     routes: [
       // { path: '/apply', redirect: '/user/login' },
@@ -102,7 +102,7 @@ export default [
   // app
   {
     path: '/',
-    component: '../layouts/BasicLayout',
+    component: '../layouts/index',
     Routes: ['src/pages/CheckLogin'],
     routes: [
       { path: '/', redirect: '/basic/simple_stat' },

+ 6 - 2
xinkeaboard-seller/src/components/GlobalHeader/RightContent.js

@@ -4,12 +4,16 @@ import { Tag, Menu, Icon } from 'antd';
 import moment from 'moment';
 import groupBy from 'lodash/groupBy';
 import HeaderDropdown from '../HeaderDropdown';
-// import SiteSelector from '../SiteSelector';
+import SiteSelector from '../SiteSelector';
 import styles from './index.less';
 import { sldComLanguage } from '@/utils/utils';
 import { specialFlag } from '@/utils/sldconfig';
 
 export default class GlobalHeaderRight extends PureComponent {
+	constructor(props) {
+		super(props);
+		this.isApplyPage = props.location.pathname.includes('/apply');
+	}
 
 	getNoticeData() {
 		const { notices = [] } = this.props;
@@ -94,7 +98,7 @@ export default class GlobalHeaderRight extends PureComponent {
 		}
 		return (
 			<div className={className}>
-				{/* <SiteSelector></SiteSelector> */}
+				{ !this.isApplyPage && <SiteSelector></SiteSelector> }
 				<HeaderDropdown overlay={menu}>
 					<span className={`${styles.action} ${styles.account}`}>
 						<span className={styles.name} style={{color:'#fff'}}>

+ 2 - 3
xinkeaboard-seller/src/components/SiteSelector/index.js

@@ -5,10 +5,9 @@ import router from 'umi/router';
 const SiteSelector = ({ siteList, currentSite, dispatch }) => {
   const handleChange = (value) => {
     dispatch({ type: "global/setCurrentSite", payload: value });
-    // window.location.reload(); // 页面刷新
   };
   return (
-    siteList.length && (
+    siteList.length ?  (
       <Select
         value={currentSite}
         style={{ width: 150 }}
@@ -20,7 +19,7 @@ const SiteSelector = ({ siteList, currentSite, dispatch }) => {
           </Select.Option>
         ))}
       </Select>
-    )
+    ) : null
   );
 };
 

+ 4 - 17
xinkeaboard-seller/src/layouts/BasicLayout.js

@@ -3,11 +3,9 @@ import { Layout } from 'antd';
 import DocumentTitle from 'react-document-title';
 import isEqual from 'lodash/isEqual';
 import memoizeOne from 'memoize-one';
-import { connect } from 'dva';
 import { ContainerQuery } from 'react-container-query';
 import classNames from 'classnames';
 import pathToRegexp from 'path-to-regexp';
-import Media from 'react-media';
 import { formatMessage } from 'umi/locale';
 import Authorized from '@/utils/Authorized';
 import Footer from './Footer';
@@ -55,6 +53,7 @@ class BasicLayout extends React.PureComponent {
     super(props);
     this.getPageTitle = memoizeOne(this.getPageTitle);
     this.matchParamsPath = memoizeOne(this.matchParamsPath, isEqual);
+    this.isApplyPage = props.location.pathname.includes("/apply");
   }
 
   componentDidMount() {
@@ -62,7 +61,6 @@ class BasicLayout extends React.PureComponent {
       dispatch,
       route: { routes, authority },
     } = this.props;
-    // dispatch({ type: 'global/get_site_list_data' });
     dispatch({
       type: 'menu/getMenuData',
       payload: { routes, authority },
@@ -70,8 +68,8 @@ class BasicLayout extends React.PureComponent {
   }
 
   componentDidUpdate(preProps) {
-
-	  // After changing to phone mode,
+  
+    // After changing to phone mode,
     // if collapsed is true, you need to click twice to display
     const { collapsed, isMobile } = this.props;
     if (isMobile && !preProps.isMobile && !collapsed) {
@@ -212,15 +210,4 @@ class BasicLayout extends React.PureComponent {
   }
 }
 
-export default connect(({ global, setting, menu }) => ({
-  collapsed: global.collapsed,
-  // currentSite: global.currentSite,
-  layout: setting.layout,
-  menuData: menu.menuData,
-  breadcrumbNameMap: menu.breadcrumbNameMap,
-  ...setting,
-}))(props => (
-   <Media query="(max-width: 599px)">
-    {isMobile => <BasicLayout  {...props} isMobile={isMobile} />}
-  </Media> 
-));
+export default BasicLayout;

+ 62 - 0
xinkeaboard-seller/src/layouts/index.js

@@ -0,0 +1,62 @@
+import React from 'react';
+import Media from 'react-media';
+import { connect } from 'dva';
+import PageLoading from '@/components/PageLoading';
+import BasicLayout from './BasicLayout';
+
+class LayoutWrapper extends React.PureComponent {
+  componentDidMount() {
+    const { dispatch, currentSite, location } = this.props;
+    const isApplyPage = location.pathname.includes('/apply');
+
+    // 非 apply 页 & currentSite 为空,初始化请求
+    if (!isApplyPage) {
+      dispatch({ type: 'global/get_site_list_data' });
+    }
+  }
+
+  render() {
+    const { currentSite, location } = this.props;
+    const isApplyPage = location.pathname.includes('/apply');
+
+    if (isApplyPage) {
+      // apply 页直接加载 BasicLayout
+      return (
+        <Media query="(max-width: 599px)">
+          {isMobile => <BasicLayout {...this.props} isMobile={isMobile} />}
+        </Media>
+      );
+    }
+
+    if (!currentSite) {
+      // 非 apply 页且未初始化完成 → Loading
+      return (
+        <div style={{ height: '100vh', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
+          <PageLoading />
+        </div>
+      );
+    }
+
+    // 非 apply 页 & currentSite 已有值 → 渲染 BasicLayout(key 确保切换站点强制刷新)
+    return (
+      <Media query="(max-width: 599px)">
+        {isMobile => (
+          <BasicLayout
+            key={currentSite}
+            {...this.props}
+            isMobile={isMobile}
+          />
+        )}
+      </Media>
+    );
+  }
+}
+
+export default connect(({ global, setting, menu }) => ({
+  collapsed: global.collapsed,
+  currentSite: global.currentSite,
+  layout: setting.layout,
+  menuData: menu.menuData,
+  breadcrumbNameMap: menu.breadcrumbNameMap,
+  ...setting,
+}))(LayoutWrapper);

+ 3 - 3
xinkeaboard-seller/src/models/global.js

@@ -7,7 +7,7 @@ export default {
     collapsed: false,
     notices: [],
     siteList: [],
-    currentSite: localStorage.getItem('CURRENT_SITE') || null,
+    currentSite: '',
   },
 
   effects: {
@@ -79,7 +79,8 @@ export default {
       const response = siteList.length ? {data: siteList, state: 200} : yield call(sldCommonService, payload, 'get', 'v3/system/seller/setting/getSiteSettingList');
       if (callback) callback(response);
       yield put({ type: 'saveSiteList', payload: response.data });
-      if (!localStorage.getItem('CURRENT_SITE')) {
+      const currentSite = yield select(state => state.global.currentSite);
+      if (!currentSite) {
         yield put({type: 'setCurrentSite', payload: response.data[0]?.value})
       }
     },
@@ -93,7 +94,6 @@ export default {
       };
     },
     setCurrentSite(state, { payload }) {
-      localStorage.setItem('CURRENT_SITE', payload);
       return {
         ...state,
         currentSite: payload,

+ 268 - 139
xinkeaboard-seller/src/pages/settledManage/businessInfo/index.js

@@ -3,7 +3,7 @@
 * */
 import { connect } from 'dva/index';
 import React, { Component, Fragment } from 'react';
-import { Form, Button, message } from 'antd';
+import { Form, Button, message, Spin} from 'antd';
 import {
   sldComLanguage,
   sldLlineRtextAddGoodsAddMargin,
@@ -28,7 +28,7 @@ export default class BusinessInfo extends Component {
     super(props);
     this.state = {
       //经营信息
-      base_info: [
+      site_base_info: [
         {
           type: 'input',
           label: `${sldComLanguage('店铺名称')}`,
@@ -81,11 +81,14 @@ export default class BusinessInfo extends Component {
         placeholder: ``,
         tree_data: [],
         selected_keys:[],//选择的key数组
-        onCheck:this.handleCatCheck,
+        select_cat_id: [],
         required: true,
       }],//选择经营类目
       company_qualification: {},
-      loading: false
+      loading: false,
+      siteList: [],
+      siteListLoading: false, // 站点tab列表loading
+      selectCatLoading: false,
     };
   }
 
@@ -126,27 +129,124 @@ export default class BusinessInfo extends Component {
   selectedRows = [];
   selectedRowKeys = [];
 
-  async componentDidMount () {
+  componentDidMount () {
     // this.getStoreGrade();
     // this.getStoreOpenTime();
-    await this.getSystemCat()
-    this.initData();
+    this.getSiteList();
   }
 
+  //获取平台分类
+  getSystemCat = (webSite) => {
+    const { dispatch } = this.props;
+    return new Promise((resolve) => {
+      dispatch({
+      type: 'project/get_system_cat_tree_grade3',
+      payload: { webSite },
+      callback: (res) => {
+        if(res.state == 200){
+          if (res.data.length > 0) {
+            res.data.map(item => {
+              item.key = item.categoryId;
+              item.title = item.categoryName;
+              if (item.children != null&&item.children.length>0) {
+                item.children.map(second => {
+                  second.key = second.categoryId;
+                  second.title = second.categoryName;
+                  if (second.children != null&&second.children.length>0) {
+                    second.children.map(third => {
+                      third.key = third.categoryId;
+                      third.title = third.categoryName;
+                    });
+                  }else{
+                    second.disableCheckbox = true;
+                  }
+                });
+              }else{
+                item.disableCheckbox = true;
+              }
+            });
+            resolve({
+              webSite,
+              data: res.data
+            });
+          }
+        }
+      },
+    });
+    })
+    
+  }
+
+  // 获取站点列表
+  getSiteList = () => {
+    this.setState({ siteListLoading: true });
+    const { dispatch } = this.props;
+    const { select_cat, site_base_info } = this.state;
+    dispatch({
+      type: "global/get_site_list_data",
+      callback: async (res) => {
+        if (res.state == 200) {
+          const siteListData = res.data;
+          const promiseList = siteListData.map(item => this.getSystemCat(item.value))
+          const result = await Promise.all(promiseList);
+          result.forEach(r => {
+              siteListData.forEach(siteInfo => {
+                if (siteInfo.value === r.webSite) {
+                  siteInfo.site_select_cat = [
+                    {
+                      ...select_cat[0],
+                      tree_data: r.data,
+                      onCheck: (checkedKeys, e) => this.handleCatCheck(checkedKeys, e, siteInfo.value)
+                    }
+                  ]
+                  siteInfo.site_base_info = [
+                    {
+                      ...site_base_info[0],
+                      name: `${siteInfo.value}_${site_base_info[0].name}` // ✅ 添加前缀
+                    }
+                  ]
+                }
+            })
+          })
+          this.setState({
+            siteList: siteListData,
+            siteListLoading: false,
+          });
+          this.initData(siteListData);
+        }
+      },
+    });
+  };
+
+
   //选择分类事件
-  handleCatCheck = (checkedKeys, e) => {
-    let {select_cat} = this.state;
-    this.select_cat_id = [];
-    if(e.checkedNodes.length>0){
+  handleCatCheck = (checkedKeys, e, webSite) => {
+    const select_cat_id = [];
+    const { siteList } = this.state;
       e.checkedNodes.map(item_one=>{
         if(item_one.props.grade == 3){
           let tmp_data = item_one.props.path.split('/');
-          this.select_cat_id.push(`${tmp_data[1]}-${tmp_data[2]}-${item_one.props.categoryId}`);
+          select_cat_id.push(`${tmp_data[1]}-${tmp_data[2]}-${item_one.props.categoryId}`);
         }
       })
-    }
-    select_cat[0].selected_keys = checkedKeys;
-    this.setState({select_cat})
+      const newSiteList = siteList.map(site_info => {
+        if (site_info.value === webSite) {
+          const siteSelectCat = site_info.site_select_cat[0];
+          const newSelectCat = [
+            {
+              ...siteSelectCat,
+              selected_keys: checkedKeys,
+              select_cat_id,
+            }
+          ]
+          return {
+            ...site_info,
+            site_select_cat: newSelectCat
+          };
+        }
+        return site_info;
+      })
+      this.setState({siteList: newSiteList})
   };
 
   //店铺等级选择
@@ -200,51 +300,34 @@ export default class BusinessInfo extends Component {
   //   });
   // }
 
-  //获取平台分类
-  getSystemCat = async() => {
-    let {select_cat} = this.state;
-    const { dispatch } = this.props;
-    await dispatch({
-      type: 'project/get_system_cat_tree_grade3',
-      callback: (res) => {
-        if(res.state == 200){
-          if (res.data.length > 0) {
-            res.data.map(item => {
-              item.key = item.categoryId;
-              item.title = item.categoryName;
-              if (item.children != null&&item.children.length>0) {
-                item.children.map(second => {
-                  second.key = second.categoryId;
-                  second.title = second.categoryName;
-                  if (second.children != null&&second.children.length>0) {
-                    second.children.map(third => {
-                      third.key = third.categoryId;
-                      third.title = third.categoryName;
-                    });
-                  }else{
-                    second.disableCheckbox = true;
-                  }
-                });
-              }else{
-                item.disableCheckbox = true;
-              }
-            });
-          }
-          select_cat[0].tree_data = res.data
-        }
-        this.setState({select_cat})
-      },
-    });
-  }
+  
 
   //初始化页面数据
-  initData = () => {
+  initData = (siteList) => {
     let tmp_data = getSettleData('bussinessInfo');
-    let { base_info,/* store_grade_data,*//* open_time_data,*/select_cat } = this.state;
+    const { siteInfoList } = tmp_data;
     if (tmp_data) {
-      base_info.map(item=>{
-        item.initialValue = tmp_data[item.name];
-      });
+      const newSiteList = siteList.map(site => {
+        const tempSiteData = siteInfoList.find(i => i.webSite === site.value);
+        const siteBaseInfo = site.site_base_info[0];
+        const siteSelectCat = site.site_select_cat[0];
+        site.site_base_info = [
+          {
+            ...siteBaseInfo,
+            initialValue: tempSiteData.storeName,
+          }
+        ];
+        site.site_select_cat  = [
+          {
+            ...siteSelectCat,
+            select_cat_id: tempSiteData.goodsCategoryIds,
+            selected_keys: tempSiteData.selected_keys
+          }
+        ]
+        site.id = tempSiteData.id;
+
+        return site;
+      })
 
       // store_grade_data[0].selectedRowKeys = [tmp_data.storeGradeId];
       // store_grade_data[0].selectedRows =  store_grade_data[0].data.filter(item=>item.gradeId == tmp_data.storeGradeId);
@@ -252,114 +335,160 @@ export default class BusinessInfo extends Component {
       //   item.initialValue = tmp_data[item.name];
       // });
 
-      select_cat[0].selected_keys = tmp_data.sel_cat_id_array;
-      this.select_cat_id = tmp_data.goodsCategoryIds.split(',');
 
       this.setState({
-        base_info,
+        siteList: newSiteList
         // store_grade_data,
         // open_time_data,
-        select_cat,
       });
     }
   };
 
-  //下一步
-  handleNextStep = (e) => {
-    e.preventDefault();
-    let {/*store_grade_data,*/select_cat} = this.state;
+// 判断经营类型是否已选
+ isHaveCatNotChecked = () => {
+  const { siteList } = this.state;
+  let err = {
+    validate: true,
+    webSite: '',
+    msg: `${sldComLanguage('请选择经营类型~')}`
+  }
+  let breakFlag = false;
+
+  for(let i in siteList){
+     const site_info = siteList[i];
+     const { site_select_cat } = site_info;
+     const { select_cat_id } = site_select_cat[0]
+     if (!select_cat_id.length) {
+        err.webSite = site_info.title;
+        err.validate = false;
+        breakFlag = true;
+        break; // 跳出内层
+     }
+  }
+  return err;
+ }
+
+ handleNextStep = (e) => {
+    const { siteList } = this.state;
     const { dispatch } = this.props;
     this.props.form.validateFieldsAndScroll((err, values) => {
-      if (!err) {
-        let params = { ...values };
-
-        // if(store_grade_data[0].selectedRowKeys.length == 0){
-        //   failTip(`${sldComLanguage('请选择店铺等级~')}`);
-        //   return false;
-        // }
-        if(this.select_cat_id.length == 0){
-          failTip(`${sldComLanguage('请选择经营类型~')}`);
-          return false;
-        }
-        params.goodsCategoryIds = this.select_cat_id.join(',');//申请分类id字符串,例1级-2级-3级;1级-2级-3级
-      /*  params.storeGradeId = 1*//*store_grade_data[0].selectedRowKeys[0];//店铺等级*/
-        let base_info = JSON.parse(localStorage.getItem('baseInfo').replace(/&quot;/g,"\""));
-        saveSettleData('bussinessInfo', JSON.stringify({...params,sel_cat_id_array:select_cat[0].selected_keys}));//经营信息存缓存
-        let tar_params = {...params};
-        tar_params.companyAddress = base_info.companyAddress;//公司详细地址
-        tar_params.companyProvinceCode = base_info.companyProvinceCode;//企业注册省编码
-        tar_params.companyCityCode = base_info.companyCityCode;//	企业注册市编码
-        tar_params.companyAreaCode = base_info.companyAreaCode;//企业注册区编码
-        tar_params.areaInfo = base_info.areaInfo;//省市区名称
-        tar_params.contactName = base_info.contactName;//联系人姓名
-        tar_params.contactPhone = base_info.contactPhone;//联系人电话
-        tar_params.enterType = base_info.enterType;//入驻类型:0-个人入驻,1-企业入驻
-        tar_params.personCardDown = base_info.personCardDown;//身份证背面扫描件
-        tar_params.personCardUp = base_info.personCardUp;//身份证正面扫描件
-        if(tar_params.enterType == 1){
-          //企业入驻
-          tar_params.companyName = base_info.companyName;//公司名称
-          tar_params.businessLicenseImage = base_info.businessLicenseImage;//营业执照扫描件,企业入驻时必传
-          tar_params.moreQualification1 = base_info.moreQualification1?base_info.moreQualification1:'';//补充认证一
-          tar_params.moreQualification2 = base_info.moreQualification2?base_info.moreQualification2:'';//补充认证二
-          tar_params.moreQualification3 = base_info.moreQualification3?base_info.moreQualification3:'';//补充认证三
-        }
-        //只有小于当前的才需要更新
-        if(getSettleData('cur_step')*1 < 3){
-          saveSettleData('cur_step', 3);
-        }
-        this.setState({loading: true});
-        dispatch({
-          type: 'settled/save_apply',
-          payload: tar_params,
-          callback: res => {
-            if (res.state == 200) {
-              saveSettleData('cur_step', 3);
-              message.success(res.msg);
-              setTimeout(() => {
-                this.props.history.push('/apply/open_up');
-              }, 1500);
-            } else {
-              message.error(res.msg);
-            }
-            this.setState({loading: false});
-          },
-        });
-      }
-    });
-  };
+        if (!err) {
+          const { validate, msg, webSite } = this.isHaveCatNotChecked();
+          if(!validate){
+            failTip(`${webSite}${sldComLanguage('请选择经营类型~')}`);
+            return false;
+          }
+          let params = { };
+          params.siteInfoList = siteList.map(site => ({
+            webSite: site.value,
+            storeName: values[`${site.value}_storeName`],
+            goodsCategoryIds: site.site_select_cat[0].select_cat_id.join(','),
+            selected_keys: site.site_select_cat[0].selected_keys,
+            id: site.id
+          }))
+          let base_info = JSON.parse(localStorage.getItem('baseInfo').replace(/&quot;/g,"\""));
+          saveSettleData('bussinessInfo', JSON.stringify(params));//经营信息存缓存
+          let tar_params = {...params};
+          tar_params.siteInfoList = tar_params.siteInfoList.map(item => ({
+            webSite: item.webSite,
+            storeName: item.storeName,
+            goodsCategoryIds: item.goodsCategoryIds,
+            id: item.id
+          }));
+          tar_params.companyAddress = base_info.companyAddress;//公司详细地址
+          tar_params.companyProvinceCode = base_info.companyProvinceCode;//企业注册省编码
+          tar_params.companyCityCode = base_info.companyCityCode;//	企业注册市编码
+          tar_params.companyAreaCode = base_info.companyAreaCode;//企业注册区编码
+          tar_params.areaInfo = base_info.areaInfo;//省市区名称
+          tar_params.contactName = base_info.contactName;//联系人姓名
+          tar_params.contactPhone = base_info.contactPhone;//联系人电话
+          tar_params.enterType = base_info.enterType;//入驻类型:0-个人入驻,1-企业入驻
+          tar_params.personCardDown = base_info.personCardDown;//身份证背面扫描件
+          tar_params.personCardUp = base_info.personCardUp;//身份证正面扫描件
+          if(tar_params.enterType == 1){
+            //企业入驻
+            tar_params.companyName = base_info.companyName;//公司名称
+            tar_params.businessLicenseImage = base_info.businessLicenseImage;//营业执照扫描件,企业入驻时必传
+            tar_params.moreQualification1 = base_info.moreQualification1?base_info.moreQualification1:'';//补充认证一
+            tar_params.moreQualification2 = base_info.moreQualification2?base_info.moreQualification2:'';//补充认证二
+            tar_params.moreQualification3 = base_info.moreQualification3?base_info.moreQualification3:'';//补充认证三
+          }
+          //只有小于当前的才需要更新
+          if(getSettleData('cur_step')*1 < 3){
+            saveSettleData('cur_step', 3);
+          }
+          this.setState({loading: true});
+          dispatch({
+            type: 'settled/save_apply',
+            payload: tar_params,
+            callback: res => {
+              if (res.state == 200) {
+                saveSettleData('cur_step', 3);
+                message.success(res.msg);
+                setTimeout(() => {
+                  this.props.history.push('/apply/open_up');
+                }, 1500);
+              } else {
+                message.error(res.msg);
+              }
+              this.setState({loading: false});
+            },
+          });
+          }
+    })
+ }
 
   render() {
+    
     const {
-      base_info,
       // open_time_data,
       // store_grade_data,
       select_cat,
-      loading
+      loading,
+      siteList,
+      siteListLoading,
+      selectCatLoading
     } = this.state;
+    
     return (
       <div style={{ flex: 1 }}>
         <div className={styles.title}>
           {sldLlineRtextAddGoodsAddMargin('#69A2F2', `${sldComLanguage('经营信息')}`, 0, 0, 5)}
         </div>
-        {getSldEmptyH(10)}
-        <Scrollbars
-          autoHeight
-          autoHeightMin={100}
-          autoHeightMax={document.body.clientHeight - 130}>
-          <div className={styles.commen_wrap}>
-            <SldTableRowThree form={this.props.form} data={base_info}/>
-            {/*<SldTableRowThree form={this.props.form} data={store_grade_data}/>*/}
-            {/*<SldTableRowThree form={this.props.form} data={open_time_data}/>*/}
-            <SldTableRowThree form={this.props.form} data={select_cat}/>
-            {((getSettleData('state')&&getSettleData('state')==3)||!getSettleData('state'))&&
+        {/* 站点tab列表 */}
+        <Spin spinning={siteListLoading}>
+          <div className={styles.site_list} style={{ paddingLeft: "85px" }}>
+            {siteList.length ? siteList.map((site) => (
+              <div className={ styles.site_item } key={site.name}>
+                <div className={ styles.site_item_title }>{ site.title }</div>
+                {getSldEmptyH(10)}
+                <Scrollbars
+                  autoHeight
+                  autoHeightMin={100}
+                  autoHeightMax={document.body.clientHeight - 130}
+                >
+                  <div className={styles.commen_wrap}>
+                    <SldTableRowThree form={this.props.form} data={site.site_base_info} />
+                    {/*<SldTableRowThree form={this.props.form} data={store_grade_data}/>*/}
+                    {/*<SldTableRowThree form={this.props.form} data={open_time_data}/>*/}
+                    <Spin spinning={selectCatLoading}>
+                      <SldTableRowThree
+                        form={this.props.form}
+                        data={site.site_select_cat}
+                      />
+                    </Spin>
+                  </div>
+                  {getSldEmptyH(10)}
+                </Scrollbars>
+              </div>
+            )) : null}
+          </div>
+          {((getSettleData('state')&&getSettleData('state')==3)||!getSettleData('state'))&&
               <div className={styles.commen_wrap} style={{borderTopRightRadius:0,borderTopLeftRadius:0,marginTop:-30,paddingBottom:20,textAlign:'center'}}>
                 <Button loading={loading} type='primary' onClick={this.handleNextStep} className={styles.next_step}>提交</Button>
               </div>
-            }
-          </div>
-          {getSldEmptyH(10)}
-        </Scrollbars>
+          }
+        </Spin>        
       </div>
     );
   }

+ 1 - 0
xinkeaboard-seller/src/pages/settledManage/businessInfo/index.less

@@ -40,6 +40,7 @@
 
 .site_list {
   display: flex;
+  min-height: 400px;
 
   .site_item {
     display: flex;

+ 1 - 1
xinkeaboard-seller/src/pages/settledManage/models/settled.js

@@ -28,7 +28,7 @@ export default {
     },
     //保存入驻信息
     *save_apply({ payload, callback }, { call }) {
-      const response = yield call(sldCommonService, payload, 'post', 'v3/seller/seller/apply/saveApply');
+      const response = yield call(sldCommonService, payload, 'post', 'v3/seller/seller/apply/saveApply', 'json');
       if (callback) callback(response);
     },
     //slodon_获取入驻信息

+ 58 - 14
xinkeaboard-seller/src/pages/settledManage/openUp/open_up.js

@@ -35,7 +35,8 @@ export default class openUp extends Component {
       detail: {},//入驻详情
       pay_method: 'alipay',//支付方式
       apply_progress: {},//入驻进度
-
+      siteList: [],
+      currentSite: {}, // 当前站点
 
       store_pay_data: [{
         type: 'show_text',
@@ -90,7 +91,22 @@ export default class openUp extends Component {
           if (res.data.applyStep != 2) {
             modalVisible = false;
           }
-          saveSettleData('state', res.data.applyStep);//1 待审核  2 待付款 3 已拒绝 4已开通
+          const { storeGoodsCateVOList, applyStep } =  res.data;
+          const siteListData = [];
+          storeGoodsCateVOList?.forEach(item => {
+            if (!siteListData.find(site => site.webSite === item.webSite)) {
+              siteListData.push({
+                webSite: item.webSite,
+                webSiteName: item.webSiteName
+              })
+            }
+          });
+          if (siteListData.length) {
+            const sortSiteList = siteListData.sort((a, b) => Number(a.webSite) - Number(b.webSite));
+            this.setState({siteList: sortSiteList});
+            this.setState({currentSite: siteListData[0]})
+          }
+          saveSettleData('state', applyStep);//1 待审核  2 待付款 3 已拒绝 4已开通
           this.setState({ apply_progress: res.data, store_pay_data, modalVisible });
         }
       },
@@ -151,17 +167,28 @@ export default class openUp extends Component {
           //经营信息
           let business_info = {};
           business_info.applyYear = result.applyYear;
-          business_info.storeName = result.storeName;//店铺名称
+          // business_info.storeName = result.storeName;//店铺名称
           business_info.storeGradeId = result.storeGradeId;//店铺等级
-          //经营类目信息
-          let sel_cat_id_array = [];//选择的分类id
-          let select_cat_id_three = [];//选择的分类id,eg:1级-2级-3级
-          result.storeGoodsCateVOList.map(item => {
-            sel_cat_id_array.push(item.goodsCategoryId3);
-            select_cat_id_three.push(`${item.goodsCategoryId1}-${item.goodsCategoryId2}-${item.goodsCategoryId3}`);
-          });
-          business_info.goodsCategoryIds = select_cat_id_three.join(',');//申请分类id字符串,例1级-2级-3级;1级-2级-3级
-          business_info.sel_cat_id_array = sel_cat_id_array;//选择的分类id数组,用于选中分类tree
+          //经营类目信息 
+          const siteInfoList = [];     
+          result.storeGoodsCateVOList.forEach(item => {
+            const matchIndex = siteInfoList.findIndex(site => site.webSite === item.webSite)
+            const goodsCategoryId = `${item.goodsCategoryId1}-${item.goodsCategoryId2}-${item.goodsCategoryId3}`;
+            const selected_key = item.goodsCategoryId3;
+            if (matchIndex === -1) {
+              siteInfoList.push({
+                webSite: item.webSite,
+                storeName: item.storeName,
+                goodsCategoryIds: [goodsCategoryId],
+                selected_keys: [selected_key],
+                id: item.id
+              })
+            } else {
+              siteInfoList[matchIndex].goodsCategoryIds.push(goodsCategoryId);
+              siteInfoList[matchIndex].selected_keys.push(selected_key);
+            }
+          })
+          business_info.siteInfoList = siteInfoList;
           saveSettleData('bussinessInfo', JSON.stringify(business_info));//经营信息存缓存
           this.setState({
             detail: result,
@@ -262,8 +289,13 @@ export default class openUp extends Component {
     this.setState({ modalVisible: false });
   };
 
+  // 切换站点
+  setCurrentSite = (site) => {
+    this.setState({ currentSite: site })
+  }
+
   render() {
-    const { detail, store_pay_data, pay_method, modalVisible, submiting, wx_pay_qrcode, apply_progress } = this.state;
+    const { siteList,currentSite, detail, store_pay_data, pay_method, modalVisible, submiting, wx_pay_qrcode, apply_progress } = this.state;
     return (
       <div style={{ flex: 1, background: '#FFF' }}>
         <div className={`${global.flex_column_star_start} ${styles.title}`}>
@@ -328,10 +360,22 @@ export default class openUp extends Component {
               </div>*/}
               <div>
                 <p className={`${global.flex_row_start_center} ${styles.table_title}`}>{sldComLanguage('经营类目列表')}</p>
+                {/* 站点tab列表 */}
+                <div className={global.site_list}>
+                  {siteList.map((site) => (
+                    <div
+                      key={site.webSite}
+                      onClick={() => this.setCurrentSite(site)}
+                      className={`${global.site_item} ${site.webSite === currentSite.webSite ? global.site_active : ''}`}
+                    >
+                      {site.webSiteName}
+                    </div>
+                  ))}
+                </div>
                 <div className={`${global.flex_row_center_center}`}>
                   <Table bordered style={{ width: '100%' }} rowKey={'goodsCategoryId3'} pagination={false}
                          columns={this.columns_apply_cat}
-                         dataSource={apply_progress.storeGoodsCateVOList} size={'small'}/>
+                         dataSource={apply_progress.storeGoodsCateVOList?.filter(item => item.webSite === currentSite.webSite)} size={'small'}/>
                 </div>
               </div>
             </div>

+ 10 - 3
xinkeaboard-seller/src/utils/utils.js

@@ -1377,11 +1377,18 @@ export function getSldStatYTitle() {
  * params 参数
  * data_type json json格式 默认是表单提交
  * */
-export function sldComRequest(method, url, params = {}, data_type = '') {
-  params = Object.assign({}, params, { distributionChannel: localStorage.getItem("CURRENT_SITE"), source: localStorage.getItem("CURRENT_SITE"), channel: localStorage.getItem("CURRENT_SITE")})
+export function sldComRequest(method, url, params, data_type = '') {
+  const state = window.g_app._store.getState();
+  const currentSite = state.global.currentSite;
+  const currentPath = state.routing.location.pathname;
+  if (!currentPath.includes('/apply') && !currentPath.includes('/user/login')) {
+    params = Object.assign({}, params ?? {}, { webSite: currentSite })
+  }
   if (method == 'get') {
     let tmp_url = apiUrl + `${url}`;
-    tmp_url += `?${stringify(params)}`;
+    if (params != undefined) {
+      tmp_url += `?${stringify(params)}`;
+    }
     return request(tmp_url);
   } else if (method == 'post') {
     if (data_type == 'json') {