Skip to content

Commit 7d781eb

Browse files
authored
Merge pull request #11 from serverdevcamp/donggeun
20.02.17 로그인 회원가입, 상품 등록 및 수정 axios 연동
2 parents 4688975 + fd3a749 commit 7d781eb

15 files changed

Lines changed: 467 additions & 236 deletions

File tree

laundry_owner/frontend/src/src/components/Common/Background.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
overflow: auto;
88
}
99

10+
.defaultSpaceBetween{
11+
display: flex;
12+
flex-direction : row;
13+
justify-content: space-between;
14+
}

laundry_owner/frontend/src/src/components/Common/CustomButton.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ const CustomButton = ({type, onClick, className, value}) => {
1313
_type = 'button';
1414

1515
return (
16-
<input type={_type} onClick={onClick} value={value} className={cx('customButtonDefault', className)}/>
16+
<input type={_type}
17+
onClick={onClick}
18+
value={value}
19+
className={cx('customButtonDefault', className)}
20+
/>
1721
)
1822
};
1923

laundry_owner/frontend/src/src/components/ProductRegistrationView/RegisterItemForm.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,27 @@ import CustomButton from "../Common/CustomButton";
88

99
const cx = className.bind(style);
1010

11-
const RegisterItemForm = ({}) => {
11+
const RegisterItemForm = ({
12+
price, material, name, information, mode,
13+
setPrice, setMaterial, setName, setInformation,
14+
registerItem, openRegistrationForm
15+
}) => {
16+
17+
1218
return (
13-
<form className={cx('registerItemForm-form')}>
19+
<form
20+
className={cx('registerItemForm-form')}
21+
action={"#"}
22+
onSubmit={() => registerItem(mode, name, material, price, information)}
23+
>
1424
<div className={cx('registerItemForm-leftPage')}>
1525
<div className={cx('registerItemForm-registerRow')}>
1626
<Typography variant={"h6"}> 제품 이름 </Typography>
1727
<Select
1828
style={{width: "50%"}}
19-
value={'와이셔츠'}
29+
value={name}
2030
defaultValue={'와이셔츠'}
31+
onChange={(e) => setName(e.target.value)}
2132
>
2233
<MenuItem value={'와이셔츠'}> 와이셔츠</MenuItem>
2334
<MenuItem value={'청바지'}> 청바지</MenuItem>
@@ -27,23 +38,34 @@ const RegisterItemForm = ({}) => {
2738
<Typography variant={"h6"}> 제품 소재 </Typography>
2839
<Select
2940
style={{width: "50%"}}
30-
value={'와이셔츠'}
41+
value={material}
3142
defaultValue={'와이셔츠'}
43+
onChange={(e) => setMaterial(e.target.value)}
3244
>
3345
<MenuItem value={'와이셔츠'}> 와이셔츠</MenuItem>
3446
<MenuItem value={'청바지'}> 청바지</MenuItem>
3547
</Select>
3648
</div>
3749
<div className={cx('registerItemForm-registerRow')}>
3850
<Typography variant={"h6"}> 제품 가격 </Typography>
39-
<CustomInput className={cx('registerItemForm-priceInput')}/>
51+
<CustomInput
52+
className={cx('registerItemForm-priceInput')}
53+
value={price}
54+
onChangeEvent={setPrice}
55+
required={true}
56+
/>
4057
</div>
4158
</div>
4259
<div className={cx('registerItemForm-rightPage')}>
4360
<Typography variant={"h6"}> 제품 특이사항 </Typography>
44-
<textarea className={cx('registerItemForm-etcText')}/>
61+
<textarea
62+
className={cx('registerItemForm-etcText')}
63+
value={information}
64+
onChange={(e) => setInformation(e.target.value)}
65+
required={true}
66+
/>
4567
<CustomButton
46-
type={'submmit'}
68+
type={'submit'}
4769
value={'제출하기'}
4870
className={cx('registerItemForm-submitBtn')}
4971
/>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
import HorizontalScrollView from "./HorizontalScrollView";
3+
import RegisteredItemView from "./RegisteredItemView";
4+
import DefaultMainBody from "../Common/DefaultMainBody";
5+
6+
const RegisteredItemList = ({items,openRegistrationForm}) => {
7+
8+
let index = 0;
9+
10+
return(
11+
<HorizontalScrollView>
12+
{
13+
items.map(item => (
14+
<RegisteredItemView
15+
key={index++}
16+
name={item.category}
17+
material={item.material}
18+
price={item.price}
19+
openRegistrationForm = {openRegistrationForm}
20+
/>
21+
))
22+
}
23+
</HorizontalScrollView>
24+
)
25+
};
26+
27+
export default RegisteredItemList;

laundry_owner/frontend/src/src/components/ProductRegistrationView/RegisteredItemView.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import style from './RegisterdItemView.scss';
44
import className from 'classnames';
55
import {makeStyles} from "@material-ui/core/styles";
66
import {Typography} from "@material-ui/core";
7+
import {MODE} from "../../pages/ProductRegistrationView";
78

89
const customStyle = makeStyles({
910
card: {
@@ -28,21 +29,26 @@ const customStyle = makeStyles({
2829

2930
const cx = className.bind(style);
3031

31-
const RegisteredItemView = ({}) => {
32+
const RegisteredItemView = ({name,material,price,id,openRegistrationForm}) => {
3233
const customClasses = customStyle();
3334

3435
return (
3536
<GridListTile style={{height: '275px'}}>
3637
<Card variant={"outlined"} className={customClasses.card}>
3738
<CardContent className={customClasses.cardContent}>
3839
<div className={cx('registeredItemView-img')}/>
39-
<Typography>상품명</Typography>
40+
<Typography>{name}</Typography>
4041
<div className={cx('registeredItemView-data')}>
41-
<Typography>소재명 : XXXX </Typography>
42-
<Typography>가격 : 3,000</Typography>
42+
<Typography>소재명 : {material} </Typography>
43+
<Typography>가격 : {price}</Typography>
4344
</div>
4445
<div className={cx('registeredItemView-dataModify')}>
45-
<Typography variant={"button"} className={customClasses.cardButton}>수정하기</Typography>
46+
<Typography
47+
variant={"button"}
48+
className={customClasses.cardButton}
49+
onClick={()=>openRegistrationForm(MODE.MODIFY)}
50+
>
51+
수정하기</Typography>
4652
<Typography variant={"button"} className={customClasses.cardButton}>삭제하기</Typography>
4753
</div>
4854
</CardContent>

laundry_owner/frontend/src/src/components/ShopMenu/ShopMenu.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ const ShopMenu = ({menuIndex}) => {
1818
세탁소 관리
1919
</div>
2020
<List className={cx('shopMenuList')}>
21+
<ListItem
22+
alignItems={"center"}
23+
button
24+
selected={menuIndex === 0}
25+
onClick={() => navigatePage("orderManagement")}
26+
>
27+
주문 관리
28+
</ListItem>
2129
<ListItem
2230
alignItems={"center"}
2331
button
@@ -41,33 +49,40 @@ const ShopMenu = ({menuIndex}) => {
4149
>
4250
리뷰 관리
4351
</ListItem>
52+
<ListItem
53+
button
54+
selected={menuIndex === 4}
55+
onClick={() => navigatePage('chatList')}
56+
>
57+
채팅방 목록
58+
</ListItem>
4459
</List>
4560
<div className={cx('shopMenuTitle')}>
4661
통계
4762
</div>
4863
<List>
4964
<ListItem
5065
button
51-
selected={menuIndex === 4}
66+
selected={menuIndex === 5}
5267
onClick={() => navigatePage('hourlySales')}
5368
>
5469
시간별 매출
5570
</ListItem>
5671
<ListItem
5772
button
58-
selected={menuIndex === 5}
73+
selected={menuIndex === 6}
5974
>
6075
시간별 주문량
6176
</ListItem>
6277
<ListItem
6378
button
64-
selected={menuIndex === 6}
79+
selected={menuIndex === 7}
6580
>
6681
위치별 매출
6782
</ListItem>
6883
<ListItem
6984
button
70-
selected={menuIndex === 7}
85+
selected={menuIndex === 8}
7186
>
7287
위치별 주문량
7388
</ListItem>

laundry_owner/frontend/src/src/components/SignUpView/SignUpInputForm.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const SignUpInputForm = ({
1919
onChangePassword, onChangePasswordConfirm, onChangeName, onChangeEmail, onChangeImage,
2020
onChangeAddress, onChangeDetailAddress, onChangeTel,
2121
onChangeInformation, addOperationTime, detailAddressRef,
22-
handleSignUp
22+
handleSignUp, checkDuplicate
2323
}) => {
2424

2525
const [isOpenedModal, setOpenModal] = useState(false);
@@ -183,7 +183,9 @@ const SignUpInputForm = ({
183183
<CustomButton
184184
className={cx('signUpIdCheckButton')}
185185
type={'button'}
186-
value='중복검사'/>
186+
value='중복검사'
187+
onClick={()=>checkDuplicate(userName)}
188+
/>
187189
</span>
188190
</span>
189191

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { combineReducers} from "redux";
22
import temp from './temp';
3+
import profile from "./profile";
34

45
const rootReducer = combineReducers({
5-
temp
6+
temp,profile
67
});
78

89
export default rootReducer;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const SETUSERNAME = 'Profile/SETUSERNAME';
2+
const SETSHOPID = 'Profile/SETSHOPID';
3+
4+
export const setUserName = (userName) => ({type: SETUSERNAME, userName : userName});
5+
export const setShopId = (shopId) => ({type: SETSHOPID, shopId : shopId});
6+
7+
const initialProfile = {
8+
userName : 'a12',
9+
shopId : '5',
10+
};
11+
12+
const profile = (profile = initialProfile, action) =>{
13+
switch(action.type){
14+
case SETUSERNAME:
15+
return Object.assign({},profile,{
16+
userName: action.userName
17+
});
18+
case SETSHOPID:
19+
return Object.assign({},profile,{
20+
shopId : action.shopId
21+
});
22+
default:
23+
return initialProfile;
24+
}
25+
};
26+
27+
export default profile;

laundry_owner/frontend/src/src/pages/ChatListView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class ChatListView extends React.Component {
129129
return (
130130
<div className={cx('defaultBackground')}>
131131
<DefaultHeader title={'채팅방 목록'}/>
132-
<DefaultMainBody>
132+
<DefaultMainBody menuIndex={4}>
133133
<ChatListTable
134134
chatRoomList={chatRoomList}
135135
setModalOpen={this.setModalOpen}

0 commit comments

Comments
 (0)