Commit 435ab5f1 authored by 武广's avatar 武广

Merge branch 'feature-20240520-jishi' into 'master'

小咩POP店上线

See merge request !110
parents 02e874cc 01765fe4
......@@ -268,8 +268,9 @@ const CustomTree = forwardRef(props => {
));
// 隐藏所有子树
const handleMouseUp = e => {
const isCur = e?.path?.some(
const handleMouseUp = event => {
const path = event.path || (event.composedPath && event.composedPath());
const isCur = path?.some(
item =>
item.className &&
typeof item.className === 'string' &&
......
......@@ -35,8 +35,15 @@ class AvatarDropdown extends React.Component {
avatar: '',
name: '',
},
businessInfo = {},
menu,
} = this.props;
const platform = {
560761: '咩咩自营',
1000020: '吉集优品',
};
const menuHeaderDropdown = (
<Menu className={styles.menu} selectedKeys={[]} onClick={this.onMenuClick}>
{menu && (
......@@ -64,13 +71,18 @@ class AvatarDropdown extends React.Component {
);
return currentUser && currentUser.name ? (
<HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}>
<div className={`${styles.action} ${styles.account}`}>
<Avatar
icon={<UserOutlined />}
style={{ backgroundColor: '#388bd8', marginRight: '10px' }}
/>
<span className={styles.name}>{currentUser.name}</span>
</span>
<div className={styles.nameBox}>
<div className={styles.name}>{currentUser.name}</div>
{businessInfo.channelId && (
<div className={styles.subName}>{platform[businessInfo.channelId]}</div>
)}
</div>
</div>
</HeaderDropdown>
) : (
<Spin
......@@ -86,4 +98,5 @@ class AvatarDropdown extends React.Component {
export default connect(({ user }) => ({
currentUser: user.currentUser,
businessInfo: user.businessInfo,
}))(AvatarDropdown);
......@@ -37,6 +37,8 @@
}
.right {
display: flex;
align-items: center;
float: right;
height: 100%;
margin-left: auto;
......@@ -65,6 +67,9 @@
}
}
.account {
display: flex;
align-items: center;
justify-content: center;
.avatar {
margin: ~'calc((@{layout-header-height} - 24px) / 2)' 0;
margin-right: 8px;
......@@ -75,6 +80,20 @@
}
}
.nameBox {
text-align: center;
}
.name {
line-height: 20px;
text-align: center;
}
.subName {
color: #666;
font-size: 12px;
line-height: 20px;
text-align: center;
}
.dark {
height: @layout-header-height;
.action {
......
......@@ -17,6 +17,9 @@ class SecurityLayout extends React.Component {
dispatch({
type: 'user/fetchCurrent',
});
dispatch({
type: 'user/fetchBusinessInfo',
});
}
const delaySet = () => this.setState({ isReady: true });
setTimeout(() => {
......
// queryUsers
import { queryCurrent, homeInfo } from '@/services/user';
import { queryCurrent, homeInfo, apiBusinessDetail } from '@/services/user';
import localStorage from '@/utils/localStorage';
import sessionStorage from '@/utils/sessionStorage';
......@@ -31,6 +31,16 @@ const UserModel = {
payload: response.data,
});
},
*fetchBusinessInfo(_, { call, put }) {
const response = yield call(apiBusinessDetail);
if (response.code === 2000) {
localStorage.set('business-info', JSON.stringify(response.data));
}
yield put({
type: 'saveCurrentBusiness',
payload: response.data,
});
},
*homeInfo(_, { call, put }) {
const response = yield call(homeInfo);
yield put({
......@@ -45,6 +55,9 @@ const UserModel = {
saveCurrentUser(state, action) {
return { ...state, currentUser: action.payload || {} };
},
saveCurrentBusiness(state, action) {
return { ...state, businessInfo: action.payload || {} };
},
saveData(state, action) {
const data = action.payload;
return { ...state, ...data };
......@@ -53,6 +66,7 @@ const UserModel = {
changeNotifyCount(
state = {
currentUser: {},
businessInfo: {},
},
action,
) {
......
......@@ -37,13 +37,10 @@ import {
} from './data';
import { validatePhone, validateEMail, validNumber } from '@/utils/validator';
import { getErrorMessage } from '@/utils/utils';
import MapModal from '@/components/BaiduMap';
import { apiCategoryList, apiEditStoreInfo, apiRecognize } from '../service';
const { Option } = Select;
const { Item: FormItem } = Form;
const { RangePicker } = DatePicker;
const { TabPane } = Tabs;
const carID = 301008; // 汽车类商家
const fileterBrandOptions = (input, options) => options.children.includes(input);
class BusinessInfo extends Component {
......
......@@ -53,5 +53,5 @@ export const apiEditStoreInfo = params =>
request.post('/api/merchants/suppliers/info/edit', { prefix: kdspApi, data: params });
// 查询商户详情
export const apiBusinessDetail = businessId =>
export const apiBusinessDetail = () =>
request.get('/api/merchants/suppliers/pops/detail', { prefix: kdspApi });
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Modal, Input, Select, Cascader, Tag, notification, Tree, Col, Row } from 'antd';
import { Modal, Input, notification } from 'antd';
import React, { useState, useEffect } from 'react';
import { el } from 'date-fns/locale';
import { areaList, getAddTemplate, forbiddenAddress } from '../services';
import CustomTree from '@/components/CustomTree';
......
import { APP_CODE } from '@/utils/constants';
import request from '@/utils/request';
import config from '../../config/env.config';
const { kdspApi } = config;
export async function queryCurrent() {
// 查询用户信息
return request.post('/v2/oauth/currentuserinfo');
}
// 查询商户信息
export const apiBusinessDetail = () =>
request.get('/api/merchants/suppliers/pops/detail', { prefix: kdspApi });
export async function homeInfo() {
// 查询主页信息
return request.post('/home/info');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment