周玉环 3 дней назад
Родитель
Сommit
6e5582ca70

+ 52 - 0
xinkeaboard-seller/src/components/BusinessStateSelector/index.js

@@ -0,0 +1,52 @@
+import { Select } from "antd";
+import { connect } from "dva/index";
+import { Component } from "react";
+import { businessStateEnum } from "@/utils/utils";
+import styles from "./index.less";
+
+@connect(({ store }) => ({
+  store,
+}))
+export default class BusinessStateSelector extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      stateList: Object.keys(businessStateEnum).map((key) => ({
+        name: businessStateEnum[key],
+        value: key,
+      })),
+      currentBusinessState: "",
+    };
+  }
+
+  handleChange = (value) => {
+    this.setState({ currentBusinessState: value });
+  };
+
+  componentDidMount() {
+    // dispatch({
+    //   type: "store/get_business_state",
+    //   callback: (res) => {},
+    // });
+  }
+
+  render() {
+    const { stateList, currentBusinessState } = this.state;
+    return stateList.length ? (
+      <div className={`${styles.state_warp}`}>
+        <span className={`${styles.label}`}>经营状态</span>
+        <Select
+          value={currentBusinessState}
+          style={{ width: 150 }}
+          onChange={this.handleChange}
+        >
+          {stateList.map((state) => (
+            <Select.Option key={state.name} value={state.value}>
+              {state.name}
+            </Select.Option>
+          ))}
+        </Select>
+      </div>
+    ) : null;
+  }
+}

+ 24 - 0
xinkeaboard-seller/src/components/BusinessStateSelector/index.less

@@ -0,0 +1,24 @@
+@import "../../themeColor.less";
+
+.state_warp {
+  :global {
+    .ant-select {
+      width: 120px !important;
+    }
+    .ant-select-selection {
+      border-color: @theme-color !important;
+      width: 120px;
+    }
+
+    .anticon {
+      color: @theme-color !important;
+    }
+  }
+}
+
+.label {
+  margin-right: 10px;
+  color: #101010;
+  font-size: 14px;
+  font-weight: 700;
+}

+ 4 - 1
xinkeaboard-seller/src/pages/basic/simple_stat.js

@@ -7,6 +7,7 @@ import {
   formatNum,
   noDataPlaceholder,
   sldtbaleOpeBtnText,
+  businessStateEnum
 } from '@/utils/utils';
 import { statDateSearchParams, simpleStatTodayData, simpleStatWaitEventData } from '@/utils/util_data';
 import global from '@/global.less';
@@ -360,7 +361,9 @@ export default class Basic extends Component {
                     </div>
                     <div className={`${stat.base_info}`}>
                       <div className={`${stat.title}`}>{store_info.storeName}</div>
-                      <div className={`${stat.username}`}>{sldComLanguage('登录账号')}:<span>{store_info.vendorName}</span>
+                      <div style={{display: 'flex'}}>
+                          <div className={`${stat.username}`}>{sldComLanguage('登录账号')}:<span>{store_info.vendorName}</span></div>
+                          <div style={{ marginLeft: '66px' }} className={`${stat.username}`}>{sldComLanguage('经营状态')}:<span>{businessStateEnum[store_info.businessState]}</span></div>
                       </div>
                       <div className={`${stat.up_store_info}`}>
                         <span>{sldComLanguage('店铺类型')}:{store_info.isOwnStoreValue}</span>

+ 12 - 0
xinkeaboard-seller/src/pages/store/models/store.js

@@ -11,6 +11,18 @@ export default {
 	},
 
 	effects: {
+    // 获取当前店铺经营状态值
+    * get_business_state({ payload, callback }, { call }) {
+			// const response = yield call(sldCommonService, payload, 'post', 'v3/seller/seller/store/updateSetting');
+			// if (callback) callback(response);
+		},
+
+    // 保存当前店铺经营状态值
+    * save_business_state({ payload, callback }, { call }) {
+			// const response = yield call(sldCommonService, payload, 'post', 'v3/seller/seller/store/updateSetting');
+			// if (callback) callback(response);
+		},
+
 		//slodon_编辑店铺基本信息
 		* save_vendor_base_info({ payload, callback }, { call }) {
 			const response = yield call(sldCommonService, payload, 'post', 'v3/seller/seller/store/updateSetting');

+ 5 - 1
xinkeaboard-seller/src/pages/store/pc_diy/index.js

@@ -5,6 +5,7 @@ import { sldLlineRtextAddGoodsAddMargin,sldComLanguage } from '@/utils/utils';
 import global from '@/global.less';
 import DiyLists from './diy_lists';
 import InstanceTemplateLists from './instance_template_lists';
+import BusinessStateSelector from "@/components/BusinessStateSelector"
 
 const TabPane = Tabs.TabPane;
 @connect(({ product }) => ({
@@ -32,7 +33,10 @@ export default class StorePCDiyIndex extends Component {
     const {activeKey} = this.state;
     return (
       <div className={global.common_page} style={{ flex: 1 }}>
-        {sldLlineRtextAddGoodsAddMargin('#69A2F2', `${sldComLanguage('店铺装修')}`, 0, 0, 10)}
+        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
+            {sldLlineRtextAddGoodsAddMargin('#69A2F2', `${sldComLanguage('店铺装修')}`, 0, 0, 10)}
+            <BusinessStateSelector />
+        </div>
         <Tabs type="card" activeKey={activeKey} animated={false} onTabClick={this.onHandleTabClick}>
           <TabPane tab={`${sldComLanguage('实例化模板')}`} key="1">
             <InstanceTemplateLists/>

+ 6 - 1
xinkeaboard-seller/src/pages/store/setting.js

@@ -35,6 +35,7 @@ import SldModal from "@/components/SldModal/SldModal";
 import SldPreviewImg from "@/components/SldPreviewImg/SldPreviewImg";
 import SldUEditor from '@/components/SldUEditor';
 import product from "@/pages/goods/models/product";
+import BusinessStateSelector from "@/components/BusinessStateSelector"
 
 const TabPane = Tabs.TabPane;
 let sthis = '';
@@ -884,7 +885,11 @@ export default class Setting extends Component {
     return (
       <Spin spinning={initLoading}>
         <div className={global.common_page_20}>
-          {sldLlineRtextAddGoods('#69A2F2', `${sldComLanguage('店铺设置')}`)}{/*店铺设置*/}
+          {/*店铺设置*/}
+          <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '10px' }}>
+              {sldLlineRtextAddGoods('#69A2F2', `${sldComLanguage('店铺设置')}`)}
+              <BusinessStateSelector />
+          </div>
           <Tabs type="card" activeKey={activeKey} animated={false} onTabClick={this.onHandleTabClick}>
             <TabPane tab={`${sldComLanguage('基础设置')}`} key="1">
               <div className={`${global.flex_com_column} ${global.comm_line_sperator}`}>

+ 7 - 0
xinkeaboard-seller/src/utils/utils.js

@@ -1870,3 +1870,10 @@ export const webSiteContactRelation = {
   '1': 'email', // 海外用户
   '2': 'mobile' // 国内分销商
 }
+
+export const businessStateEnum = {
+  1: '资质审核',
+  2: '装修筹备',
+  3: '经营中',
+  4: '暂停经营',
+}