Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week2/assign 2 #3

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Week2/assign 2 #3

wants to merge 13 commits into from

Conversation

ingong
Copy link
Collaborator

@ingong ingong commented Apr 22, 2022

✨ 구현 기능 명세

  1. 햄버거 카드를 **클릭**하면 장바구니에 해당 버거이름의 장바구니 요소가 추가돼요.
    1. click 이벤트를 사용해요.
    2. 각 장바구니의 요소는 다음의 구성을 가져야해요.
      1. **버거이름 수량 가격 삭제버튼**
  2. 이미 장바구니에 있는 버거를 클릭하면 새로운 요소가 추가되는게 아니라 **수량**이 늘어나야해요.
  3. **삭제 버튼**을 누르면 해당 요소가 삭제돼요.
  4. 장바구니의 요소가 추가/삭제 될 때마다 누적금액도 변동되어야해요.
    1. string과 number의 + * 연산에 주의하세요.
  5. 장바구니의 **취소하기 버튼**을 누르면 모든 장바구니를 비워주세요.
  6. **주문하기 버튼** 을 누르면 정말 주문하시겠어요? 모달을 띄워주세요.
    1. **예**를 누르면 **a** 태그를 사용해서 완료 페이지로 이동해주세요.
    2. **아니오**를 누르면 모달을 다시 닫아주세요.

🎁 PR Point

  • 기존에 객체 형태로 Item과 Bucket을 작성했는데, 클래스로 리팩토링했습니다.
  • 로직을 최대한 함수로 분리해서 작성하려고 했습니다!!
  • 12시전에 과제는 완료했는데 리팩토링 좀 더 해볼게요!

😭 어려웠던 점

  • 디자인보다는 최대한 코드를 깔끔하게 작성하기 위해서 노력해봤어요. 그런데 스타일은 거의 못만졌어요ㅠ

😎 구현 결과물

화면 기록 2022-04-22 23 56 12

@github-actions
Copy link

오늘도 할할놀놀을 몸소 실천 중인 웹파트원 ! 화이팅 :)
과제 레퍼런스 참고해서 빠트린 부분은 없는 지 체크해볼까요?

@github-actions
Copy link

오늘도 할할놀놀을 몸소 실천 중인 웹파트원 ! 화이팅 :)
과제 레퍼런스 참고해서 빠트린 부분은 없는 지 체크해볼까요?

@ingong ingong requested review from henization and NYeonK April 22, 2022 15:23
@ingong ingong self-assigned this Apr 22, 2022
Comment on lines +38 to +46
switch (type) {
case 'cancel':
return $('.modal').classList.add('hide');
case 'submit':
$('.content').replaceChildren();
$('.content').textContent = '햄식이를 도와줘서 고마워요';
return;
default:
return;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우아,.,, 여기서 스위치문 생각은 안해밧는데,,,, 좋다좋다!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants