Skip to content

Commit

Permalink
Merge pull request #400 from beezSSG/dev
Browse files Browse the repository at this point in the history
배포
  • Loading branch information
rog-won authored Apr 20, 2024
2 parents b4d13e8 + b662734 commit c63177c
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import ScrollToTop from './ScrollToTop';
function App() {

// 기본 axios url 설정
//axios.defaults.baseURL = 'http://localhost:8080/api/v1';
axios.defaults.baseURL = 'https://backend.pickme-ssg.com/api/v1/';
axios.defaults.baseURL = 'http://localhost:8080/api/v1';
// axios.defaults.baseURL = 'https://backend.pickme-ssg.com/api/v1/';

// 토큰값을 인터셉터를 통해 모든 axios에 자동으로 넘겨주기
axios.interceptors.request.use(
Expand Down
21 changes: 16 additions & 5 deletions src/pages/ceo/Inventory.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import axios from "axios";
import React, { useEffect, useState } from "react";
import Pagination from "react-js-pagination";
import { FaArrowDown91 } from "react-icons/fa6";

export default function Inventory() {
const [inventory, setInventory] = useState([]);
const [search, setSearch] = useState("");
const [switching, setSwitching] = useState(true);
const [exp, setExp] = useState("");

// 페이징
const [page, setPage] = useState(1);
Expand All @@ -14,9 +17,9 @@ export default function Inventory() {
getInventory("", 0);
}, []);

const getInventory = async (s, pn) => {
const getInventory = async (s, pn, sw, expday) => {
await axios
.get("/ceo/inventory", { params: { search: s, pageNumber: pn } })
.get("/ceo/inventory", { params: { search: s, pageNumber: pn, switching:sw, exp:expday } })
.then((response) => {
console.log(response.data);
setInventory(response.data.invenlist);
Expand All @@ -28,10 +31,18 @@ export default function Inventory() {
};
function handlePageChange(page) {
setPage(page);
getInventory(search, page - 1);
console.log(switching);
getInventory(search, page - 1, switching, exp);
}
function searchBtn() {
getInventory(search, 0);
console.log(switching);
getInventory(search, 0, switching, exp);
}

function expBtn() {
setSwitching(!switching);
setExp(1);
getInventory(search, 0, !switching, 1);
}

return (
Expand Down Expand Up @@ -62,7 +73,7 @@ export default function Inventory() {
<th className="w-1/2 py-1">상품 이름</th>
<th className="w-1/5 py-2">가격</th>
<th className="w-1/4 py-2">수량</th>
<th className="w-1/4 py-2">소비기한</th>
<th className="w-1/4 py-2">소비기한 &nbsp;<button onClick={expBtn}><FaArrowDown91 /></button></th>
</tr>
</thead>
<tbody>
Expand Down
1 change: 0 additions & 1 deletion src/pages/customerservice/ContactUs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { RiCustomerService2Fill } from "react-icons/ri";

function ContactUs() {
let navigate = useNavigate();

let adminName = localStorage.getItem("name");

const [id, setId] = useState("");
Expand Down
33 changes: 28 additions & 5 deletions src/pages/main/AdProductSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const tags = [
},
{
id: 3,
name: "신상품",
name: "HOT",
},
];

Expand Down Expand Up @@ -91,9 +91,9 @@ const AdProductSet = (prop) => {
/>
<label
htmlFor={tag.name}
className="inline-flex items-center justify-between p-3 text-xl font-extrabold text-center text-slate-600 border-2
className="inline-flex items-center justify-between p-3 text-xl font-extrabold text-center text-slate-800 border-2
border-slate-300 rounded-full cursor-pointer transition duration-300 ease-in-out
hover:bg-main-orange hover:border-sub-orange hover:text-slate-900 peer-checked:text-slate-900
hover:bg-main-orange hover:border-sub-orange hover:text-white peer-checked:text-white
peer-checked:bg-main-orange peer-checked:border-sub-orange"
>
<div className="w-full text-xl font-extrabold text-center">
Expand Down Expand Up @@ -129,8 +129,31 @@ const AdProductSet = (prop) => {
products &&
products.map((product) => (
<SwiperSlide key={product.id} className="flex flex-col py-[5%]">
<img src={product.url} alt={`이벤트상품 ${product.id}`} />
<h1 className="py-[3%] font-bold text-center text-slate-800 lg:text-xl md:text-lg sm:text-sm">{product.name}</h1>
<Link to={`/productdetail/${product.id}`} className="relative">
{product.promotionType === 1 && (
<p className="absolute top-[1%] right-[1%] bg-main-orange bg-opacity-70 rounded-full text-white
select-none text-3xl font-bold lg:text-2xl md:text-xl sm:text-sm
lg:w-1/4 md:w-1/3 sm:w-1/3">
1+1
</p>
)}
{product.promotionType === 2 && (
<p className="absolute top-[1%] right-[1%] bg-[#fd1d1d] bg-opacity-70 rounded-full text-white
select-none text-3xl font-bold lg:text-2xl md:text-xl sm:text-sm
lg:w-1/4 md:w-1/3 sm:w-1/3">
2+1
</p>
)}
{product.promotionType === 3 && (
<p className="absolute top-[1%] right-[1%] bg-[#833ab4] bg-opacity-70 rounded-full text-white
select-none text-3xl font-bold lg:text-2xl md:text-xl sm:text-sm
lg:w-1/4 md:w-[35%] sm:w-[40%]">
HOT
</p>
)}
<img src={product.url} alt={`이벤트상품 ${product.id}`} />
<h1 className="py-[3%] font-bold text-center text-slate-800 lg:text-xl md:text-lg sm:text-sm">{product.name}</h1>
</Link>
</SwiperSlide>
))
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/main/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function Footer() {
<div className="flex flex-col items-center justify-between gap-6 sm:flex-row">
<div className="flex flex-wrap items-center justify-center gap-x-6 gap-y-1 text-xl font-medium text-slate-800">
<img src={teamLogo} alt="team logo" className='lg:w-[8%] md:w-[8%] sm:w-[15%]' />
<Link to="/about">About</Link>
<Link to="/about" className='hover:text-main-orange transition duration-100'>About</Link>
<Link to="https://github.com/beezSSG" className="hover:text-main-orange transition duration-100">
Team Beez의 깃허브
<FaGithubAlt className="inline text-lg ml-0.5 mb-0.5" />
Expand Down
7 changes: 3 additions & 4 deletions src/pages/main/MainPickBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ const MainPickBox = () => {
{(dDay(product.expDate) === "-0" || dDay(product.expDate) === "0") &&
(
<div className="absolute top-[0.5%] lg:right-0 md:right-0 sm:-right-1 bg-[#EB3349] text-white font-bold lg:text-lg md:text-base sm:text-[8px] p-1 lg:px-2 md:px-2 sm:px-1.5 m-2 rounded-full animate-bounce">
<span className="font-black text-white">
<span className="font-bold text-white">
D-Day
</span>
</div>
)
}
{dDay(product.expDate) >= 1 && (
<div className="absolute top-[1%] lg:right-0 md:right-0 sm:-right-1 bg-main-orange text-white font-bold lg:text-lg md:text-base sm:text-[8px] p-1 lg:px-2 md:px-2 sm:px-1.5 m-2 rounded-full">
<span className="font-black text-white">
<span className="font-bold text-white">
D-{dDay(product.expDate)}
</span>
</div>
Expand All @@ -137,7 +137,7 @@ const MainPickBox = () => {
{(dDay(product.expDate).substring(0, 1) === "-" && dDay(product.expDate).substring(1) >= 1)
&& (
<div className="absolute top-[1%] lg:right-0 md:right-0 sm:-right-1 bg-slate-400 text-white font-bold lg:text-lg md:text-base sm:text-[8px] p-1 lg:px-2 md:px-2 sm:px-1.5 m-2 rounded-full">
<span className="font-black text-white">
<span className="font-bold text-white">
D{day}
</span>
</div>
Expand Down Expand Up @@ -179,4 +179,3 @@ const MainPickBox = () => {
}
}
export default MainPickBox;

6 changes: 3 additions & 3 deletions src/pages/main/MyStoreProducts.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ const MyStoreProducts = () => {
</Link>
</div>
<br />
<div className="flex gap-5">
<div className="flex gap-5 sm:flex-col sm:items-center">
{/* 매장 이미지 */}
<div className="w-3/5 relative">
<img src={shortlogo} alt="short logo" className="absolute w-[10%] top-[8%] left-[45%] animate-bounce"/>
<img src={storeicon1} alt="가까운 매장 이미지" className="" />
<img src={shortlogo} alt="short logo" className="absolute w-[15%] top-[3%] left-[45%] animate-bounce"/>
<img src={storeicon1} alt="가까운 매장 이미지" className="store img" />
</div>
{/* 매장 설명 */}
<div className="flex items-center justify-center">
Expand Down
8 changes: 4 additions & 4 deletions src/pages/main/SearchProduct.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const SearchProduct = ({newsearch, searchHandle, categoryHandle}) => {
className="absolute sm:p-1.5 sm:top-[50%] sm:left-[27%] sm:text-sm md:p-2.5 md:top-[55%] md:left-[35%] md:text-xl
lg:p-3 lg:top-[56%] lg:left-[28%] lg:text-5xl
text-center font-semibold bg-transparent text-transparent rounded-full
group-hover:bg-[#f8a100] group-hover:text-white transition duration-300"
group-hover:bg-[#FF8008] group-hover:text-white transition duration-300"
>
간편식사
</p>
Expand Down Expand Up @@ -211,7 +211,7 @@ const SearchProduct = ({newsearch, searchHandle, categoryHandle}) => {
<p
className="absolute z-10 sm:p-0 sm:text-xs md:text-xl sm:left-[24%] top-[48%] md:left-[27%] lg:left-[25%] lg:text-4xl
text-center font-semibold bg-transparent text-transparent rounded-full
group-hover:text-[#E091BB] transition duration-300"
group-hover:text-[#B06AB3] transition duration-300"
>
아이스크림
</p>
Expand Down Expand Up @@ -240,7 +240,7 @@ const SearchProduct = ({newsearch, searchHandle, categoryHandle}) => {
className="absolute sm:p-[0.2rem] sm:text-xs sm:top-[10%] sm:left-[19%] md:p-1.5 md:top-[16%] md:left-[23%]
lg:p-2 lg:top-[15%] lg:left-[23%]
text-center lg:text-3xl font-semibold bg-transparent text-transparent rounded-full
group-hover:bg-[#FDC830] group-hover:text-white transition duration-300"
group-hover:bg-[#f5af19] group-hover:text-white transition duration-300"
>
식품
</p>
Expand All @@ -264,7 +264,7 @@ const SearchProduct = ({newsearch, searchHandle, categoryHandle}) => {
{/* 생활용품 */}
<div className="group relative">
<p
className="sm:text-xs md:text-xl lg:text-3xl top-[60%] right-[35%]
className="sm:text-xs md:text-xl lg:text-4xl top-[60%] right-[35%]
absolute z-10 text-center font-semibold bg-transparent text-transparent rounded-full
group-hover:text-white transition duration-300"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/manager/ManagerMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ function ManagerMain({ height }) {
{ title: "발주 목록", path: "/manager/managerpurchaseorder" },
{ title: "신제품", path: "/manager/newproductinsert" },
{ title: "쿠폰생성", path: "/manager/coupon" },
{ title: "사업자 등록", path: "/manager/ocrlist" },
{ title: "자주묻는질문", path: "/manager/faq" },
{ title: "1:1 문의", path: "/manager/contactus" },
{ title: "사업자 등록", path: "/manager/ocrlist" },
];

const iconComponents = [
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/MyCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default function MyCart(prop) {
<td colSpan="2">
<input type="checkbox" onChange={(e) => allCheckHandler(e.target.checked)} checked={checkItems.length === cart.length ? true : false } />
<span>&nbsp;전체선택</span>
<button onClick={test}>test</button>
{/* <button onClick={test}>test</button> */}
</td>
<td colSpan="3"></td>
<td colSpan="2" className="group text-right">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mypage/MyPayinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function MyPayinfo({whereHandle}) {
});
return;
} else {
await axios.post("mypage/MyOrdersList", null, {params:{"date":date}})
await axios.post("mypage/cancelMyOrder", null, {params:{"date":date}})
.then(()=>{
Toast.fire({
icon: 'success',
Expand Down
8 changes: 4 additions & 4 deletions src/pages/mypage/MyPickBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ export default function MyPickBox({whereHandle}) {
{(dDay(product.expDate) === "-0" || dDay(product.expDate) === "0") &&
(
<div className="absolute top-[0.5%] lg:right-0 md:right-0 sm:-right-1 bg-[#EB3349] text-white font-bold lg:text-lg md:text-base sm:text-[8px] p-1 lg:px-2 md:px-2 sm:px-1.5 m-2 rounded-full animate-bounce">
<span className="font-black text-white">
<span className="font-bold text-white">
D-Day
</span>
</div>
)
}
{dDay(product.expDate) >= 1 && (
<div className="absolute top-[1%] lg:right-0 md:right-0 sm:-right-1 bg-main-orange text-white font-bold lg:text-lg md:text-base sm:text-[8px] p-1 lg:px-2 md:px-2 sm:px-1.5 m-2 rounded-full">
<span className="font-black text-white">
<span className="font-bold text-white">
D-{dDay(product.expDate)}
</span>
</div>
Expand All @@ -96,7 +96,7 @@ export default function MyPickBox({whereHandle}) {
{(dDay(product.expDate).substring(0, 1) === "-" && dDay(product.expDate).substring(1) >= 1)
&& (
<div className="absolute top-[1%] lg:right-0 md:right-0 sm:-right-1 bg-slate-400 text-white font-bold lg:text-lg md:text-base sm:text-[8px] p-1 lg:px-2 md:px-2 sm:px-1.5 m-2 rounded-full">
<span className="font-black text-white">
<span className="font-bold text-white">
D{day}
</span>
</div>
Expand All @@ -109,7 +109,7 @@ export default function MyPickBox({whereHandle}) {
<h1 className="lg:text-lg md:text-sm sm:text-xs font-medium">
{product.pname}
</h1>
<p>{product.quantity}</p>
<span className="font-medium bg-slate-600 text-white rounded-xl p-1.5">{product.quantity}</span><br />
<p className="lg:text-lg md:text-sm sm:text-xs font-medium">{product.date.substring(0, 10)} / {product.sname}</p>
<p className="lg:text-lg md:text-sm sm:text-xs font-medium">소비기한 : <b>{product.expDate.substring(0, 10)}</b></p>

Expand Down
6 changes: 3 additions & 3 deletions src/pages/store/Categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function Categories({storeInfo}) {
{/* <input type="checkbox" className="hidden peer" id={`category-${idx}`} /> */}
<label
// htmlFor={`category-${idx}`}
className="inline-flex items-center justify-between p-1 text-gray-500 border-2
className="inline-flex items-center justify-between p-1 text-black border-2
rounded-xl transition duration-300 ease-in-out bg-sub-yellow border-main-yellow"
>
<category.icon className="size-8 ml-1 mr-0.5"/>
Expand All @@ -83,8 +83,8 @@ export default function Categories({storeInfo}) {
{/* <input type="checkbox" className="hidden peer" id={`category-${idx}`} /> */}
<label
// htmlFor={`category-${idx}`}
className="inline-flex items-center justify-between p-1 text-gray-500 border-2
border-gray-200 rounded-xl transition duration-300 ease-in-out"
className="inline-flex items-center justify-between p-1 text-slate-600 border-2
border-slate-300 rounded-xl transition duration-300 ease-in-out"
>
<category.icon className="size-8 ml-1 mr-0.5"/>
<div className="w-full text-sm font-bold text-center">{ category.name }</div>
Expand Down
23 changes: 13 additions & 10 deletions src/pages/store/LeftMenu/LeftMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,37 @@ export default function LeftMenu({ storelist }) {


function setStorelist(data) {
// console.log("부모에게 도달!");
// console.log(data);
console.log("부모에게 도달!");
console.log(data);
setStores(data);
setInitialStores(data);
}

function setOneState(data) {
// console.log("부모에게 도달!");
setState(data);
// console.log(state);
setState(data);
}

function setOneDistrict(data) {
// console.log("부모에게 도달!");
setDistrict(data);
// console.log(district);
setDistrict(data);
}

function setChosenCategories(data) {
console.log("부모에게 도달!");
setFilter(data);
// console.log("부모에게 도달!");
// console.log("filter: " + filter);
setFilter(data);
}

useEffect(() => {
// setStores(storelist); // 보여져야 할 부분
setInitialStores(storelist);
if (filter === undefined || filter.length === 0) {
setInitialStores(storelist);
}
console.log(initialStores);
console.log(storelist);

if (initialStores !== undefined) {
setLoading(true);
Expand All @@ -76,9 +81,7 @@ export default function LeftMenu({ storelist }) {
);
});
// console.log(filteredStores);
setStorelist(filteredStores);

// console.log(storelist);
setStores(filteredStores);
}
}, [storelist, filter]);

Expand Down
9 changes: 8 additions & 1 deletion src/pages/store/StoreMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,15 @@ export default function StoreMap() {
getBoundsCorners(map);

// 지도의 바운드가 변경될 때마다 꼭지점의 위치 업데이트
// window.naver.maps.Event.addListener(map, "bounds_changed", () => {
// getBoundsCorners(map);
// });
let timer; // 타이머 변수
window.naver.maps.Event.addListener(map, "bounds_changed", () => {
getBoundsCorners(map);
clearTimeout(timer);
timer = setTimeout(() => {
getBoundsCorners(map);
}, 500);
});
}
}, [myLocation]);
Expand Down

0 comments on commit c63177c

Please sign in to comment.