Skip to content

Commit

Permalink
Merge pull request #262 from samtuap/feat/260
Browse files Browse the repository at this point in the history
feat: ์ž์ž˜ํ•œ ๋””์ž์ธ ์ˆ˜์ • ๋ฐ ๊ธฐ๋Šฅ ์ถ”๊ฐ€
  • Loading branch information
cogns authored Nov 1, 2024
2 parents c08ea59 + a9544e0 commit 09bfb8e
Show file tree
Hide file tree
Showing 14 changed files with 163 additions and 36 deletions.
Binary file added public/all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 38 additions & 14 deletions src/views/member/login/MemberSignUp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
<v-card class="modal" style="align-items: center; text-align: center; height: 130px; padding-bottom: 20px;
overflow-y: hidden;">
<v-card-text style="margin-top:10px;">ํšŒ์›๊ฐ€์ž…์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.</v-card-text>
<v-btn @click="handleCloseModal(true)" class="submit-btn" style="border-radius: 50px; width: 100px; margin-bottom:8px">๋‹ซ๊ธฐ</v-btn>
<v-btn @click="handleCloseModal(true)" class="submit-btn"
style="border-radius: 50px; width: 100px; margin-bottom:8px; margin-top:-30px;">๋‹ซ๊ธฐ</v-btn>
</v-card>
</v-dialog>

<v-dialog v-model="errorModal" max-width="300px">
<v-card class="modal" style="align-items: center; text-align: center;">
<v-card-text>ํšŒ์›๊ฐ€์ž… ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. <br /> ๋‹ค์‹œ ์‹œ๋„ํ•ด์ฃผ์„ธ์š”.</v-card-text>
<v-btn @click="handleCloseModal(false)" class="submit-btn" width="100px" style="border-radius: 50px; margin-bottom: 20px;">๋‹ซ๊ธฐ</v-btn>
<v-btn @click="handleCloseModal(false)" class="submit-btn" width="100px"
style="border-radius: 50px; margin-bottom: 20px;">๋‹ซ๊ธฐ</v-btn>
</v-card>
</v-dialog>

Expand All @@ -25,26 +27,29 @@
</div>
<div class="form-group">
<label for="phone">์ „ํ™”๋ฒˆํ˜ธ</label>
<input type="tel" id="phone" v-model="phone" placeholder="์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”" required />
<input type="text" id="phone" v-model="phone" @input="formatPhone" placeholder="์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”" required />
</div>
<div class="form-group">
<label for="email">์ด๋ฉ”์ผ</label>
<span style="text-align: left;">{{ email }}</span>
</div>
<div class="form-group">
<label for="zipcode">์šฐํŽธ๋ฒˆํ˜ธ</label>
<input type="text" readonly id="zipcode" v-model="zipcode" placeholder="์šฐํŽธ๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” (ex. 03045)" required />
<input type="text" readonly id="zipcode" v-model="zipcode" placeholder="์šฐํŽธ๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” (ex. 03045)"
required />
</div>
<div class="form-group">
<input type="button" class="find-postal" @click="execDaumPostcode" value="์šฐํŽธ๋ฒˆํ˜ธ ์ฐพ๊ธฐ" />
</div>
<div class="form-group">
<label for="address">์ฃผ์†Œ</label>
<input type="text" readonly id="address" v-model="address" placeholder="๋„๋กœ๋ช… ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” (ex. ์„œ์šธ ๋™์ž‘๊ตฌ ๋ณด๋ผ๋งค๋กœ)" required />
<input type="text" readonly id="address" v-model="address"
placeholder="๋„๋กœ๋ช… ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” (ex. ์„œ์šธ ๋™์ž‘๊ตฌ ๋ณด๋ผ๋งค๋กœ)" required />
</div>
<div class="form-group">
<label for="address-detail">์ƒ์„ธ ์ฃผ์†Œ</label>
<input type="text" id="address-detail" v-model="addressDetail" placeholder="์ƒ์„ธ ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” (ex. 401ํ˜ธ)" required ref="addressDetail" />
<input type="text" id="address-detail" v-model="addressDetail" placeholder="์ƒ์„ธ ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š” (ex. 401ํ˜ธ)"
required ref="addressDetail" />
</div>
<button type="submit" class="submit-btn">ํšŒ์› ๊ฐ€์ž… ํ•˜๊ธฐ</button>
</form>
Expand Down Expand Up @@ -80,7 +85,7 @@ export default {
email: this.email,
socialType: this.socialType // ์†Œ์…œ ํƒ€์ž… ์ถ”๊ฐ€
};
try {
const token = localStorage.getItem("token"); // ์ €์žฅ๋œ ์•ก์„ธ์Šค ํ† ํฐ ๊ฐ€์ ธ์˜ค๊ธฐ
const response = await axios.post(`${process.env.VUE_APP_API_BASE_URL}/member-service/member/sign-up`, memberData, {
Expand All @@ -99,6 +104,19 @@ export default {
this.errorModal = true;
}
},
formatPhone() {
// ์ˆซ์ž๋งŒ ๋‚จ๊ธฐ๊ธฐ
let cleaned = ('' + this.phone).replace(/\D/g, '');
// ํฌ๋งท ์ ์šฉ
if (cleaned.length <= 3) {
this.phone = cleaned;
} else if (cleaned.length <= 7) {
this.phone = `${cleaned.slice(0, 3)}-${cleaned.slice(3)}`;
} else {
this.phone = `${cleaned.slice(0, 3)}-${cleaned.slice(3, 7)}-${cleaned.slice(7, 11)}`;
}
},
handleCloseModal(isSuccessful) {
if (isSuccessful) {
window.location.href = '/'; // ํšŒ์›๊ฐ€์ž… ์„ฑ๊ณต ์‹œ ํ™ˆ์œผ๋กœ ์ด๋™
Expand Down Expand Up @@ -140,6 +158,7 @@ export default {
box-shadow: none;
border-radius: 10px;
}
.submit-btn {
margin-left: 10px;
margin-top: 8px;
Expand Down Expand Up @@ -170,19 +189,23 @@ hr {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
align-items: center; /* ๋ผ๋ฒจ๊ณผ ์ž…๋ ฅํ•„๋“œ๋ฅผ ์„ธ๋กœ ๊ฐ€์šด๋ฐ ์ •๋ ฌ */
align-items: center;
/* ๋ผ๋ฒจ๊ณผ ์ž…๋ ฅํ•„๋“œ๋ฅผ ์„ธ๋กœ ๊ฐ€์šด๋ฐ ์ •๋ ฌ */
}
/* ๋ผ๋ฒจ์„ ์™ผ์ชฝ์— ๋ฐฐ์น˜ํ•˜๊ณ  ๋„“์ด๋ฅผ ์ง€์ • */
label {
width: 30%;
text-align: left; /* ์™ผ์ชฝ ์ •๋ ฌ */
text-align: left;
/* ์™ผ์ชฝ ์ •๋ ฌ */
margin-right: 10px;
}
/* ์ž…๋ ฅ ํ•„๋“œ๋ฅผ ์˜ค๋ฅธ์ชฝ์— ๋ฐฐ์น˜ํ•˜๊ณ  ๋„“์ด๋ฅผ ์ง€์ • */
input, span {
width: 65%; /* ์ž…๋ ฅ ํ•„๋“œ์˜ ๋„“์ด๋ฅผ ์กฐ์ ˆ */
input,
span {
width: 65%;
/* ์ž…๋ ฅ ํ•„๋“œ์˜ ๋„“์ด๋ฅผ ์กฐ์ ˆ */
padding: 10px;
font-size: 16px;
border: 1px solid #ddd;
Expand All @@ -191,8 +214,10 @@ input, span {
/* ์šฐํŽธ๋ฒˆํ˜ธ ์ฐพ๊ธฐ ๋ฒ„ํŠผ์˜ ์Šคํƒ€์ผ */
input[type="button"].find-postal {
width: 100%; /* ํ•„์š”ํ•œ ๋งŒํผ์˜ ๋„“์ด๋งŒ ์ฐจ์ง€ํ•˜๋„๋ก ์„ค์ • */
margin-left: 10px; /* ์šฐํŽธ๋ฒˆํ˜ธ ์ž…๋ ฅ ํ•„๋“œ์™€ ๊ฐ„๊ฒฉ์„ ์คŒ */
width: 100%;
/* ํ•„์š”ํ•œ ๋งŒํผ์˜ ๋„“์ด๋งŒ ์ฐจ์ง€ํ•˜๋„๋ก ์„ค์ • */
margin-left: 10px;
/* ์šฐํŽธ๋ฒˆํ˜ธ ์ž…๋ ฅ ํ•„๋“œ์™€ ๊ฐ„๊ฒฉ์„ ์คŒ */
padding: 10px;
background-color: #FFE2A6;
font-size: 18px;
Expand Down Expand Up @@ -221,4 +246,3 @@ button.submit-btn:hover {
background-color: #a3a66a;
}
</style>

27 changes: 24 additions & 3 deletions src/views/member/myPage/MemberPhoneUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
<div class="label" style="padding-bottom: 20px;">
<div class="form-group">
<label style="font-size: 16px; font-weight: 400; margin-left: 10%;">ํ˜„์žฌ ์ „ํ™”๋ฒˆํ˜ธ&nbsp;&nbsp;&nbsp;</label>
<input type="password" v-model="currentPhone" placeholder="ํ˜„์žฌ ์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”." />
<input type="text" v-model="currentPhone" placeholder="ํ˜„์žฌ ์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”."
@input="formatPhoneNumber('currentPhone')" maxlength="13" />
</div>
<div class="form-group">
<label style="font-size: 16px; font-weight: 400; margin-left: 10%;">&nbsp;&nbsp;&nbsp;์ƒˆ ์ „ํ™”๋ฒˆํ˜ธ&nbsp;&nbsp;&nbsp;</label>
<input type="password" v-model="newPhone" placeholder="์ƒˆ ์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”."/>
<input type="text" v-model="newPhone" placeholder="์ƒˆ ์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”."
@input="formatPhoneNumber('newPhone')" maxlength="13" />
</div>

</div>
<div class="footer">
<div class="update-container">
Expand Down Expand Up @@ -136,6 +139,24 @@ export default {
};
},
methods: {
formatPhoneNumber(field) {
// ์ „ํ™”๋ฒˆํ˜ธ์—์„œ ์ˆซ์ž๋งŒ ์ถ”์ถœ
let phone = this[field].replace(/\D/g, '');
// 11์ž ์ดˆ๊ณผ ์‹œ ์ž๋ฅด๊ธฐ
if (phone.length > 11) {
phone = phone.slice(0, 11);
}
// ํฌ๋งทํŒ… (000-0000-0000 ํ˜•ํƒœ๋กœ)
if (phone.length < 4) {
this[field] = phone;
} else if (phone.length < 8) {
this[field] = `${phone.slice(0, 3)}-${phone.slice(3)}`;
} else {
this[field] = `${phone.slice(0, 3)}-${phone.slice(3, 7)}-${phone.slice(7)}`;
}
},
// ์ „ํ™”๋ฒˆํ˜ธ ๋ณ€๊ฒฝ
async fetchMemberInfo() {
this.loading = true;
Expand All @@ -155,7 +176,7 @@ export default {
}
},
async handleUpdatePhone() {
if (this.currentPhone !== this.memberInfo.phone) {
if (this.currentPhone.replace(/\D/g, '') !== this.memberInfo.phone.replace(/\D/g, '')) {
this.modalMessage = "์ „ํ™”๋ฒˆํ˜ธ๊ฐ€ ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.";
} else if (!this.newPhone) {
this.modalMessage = "๋ณ€๊ฒฝํ•˜์‹ค ์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.";
Expand Down
2 changes: 1 addition & 1 deletion src/views/member/myPage/MemberSubscribeManage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<v-dialog v-model="failModal" max-width="300px">
<v-card class="modal" style="align-items: center; text-align: center; height: 160px; padding-bottom: 20px;
overflow-y: hidden;">
<v-card-text style="margin-top: 10%;">โš ๏ธ ๊ฒฐ์ œ ์ˆ˜๋‹จ ๋“ฑ๋ก์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.</v-card-text>
<v-card-text style="margin-top: 5%;">โš ๏ธ ๊ฒฐ์ œ ์ˆ˜๋‹จ ๋“ฑ๋ก์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.</v-card-text>
<v-btn @click="closeWarningAndReload" class="submit-btn">๋‹ซ๊ธฐ</v-btn>
</v-card>
</v-dialog>
Expand Down
5 changes: 3 additions & 2 deletions src/views/order/coupon/MemberCouponList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
// ์œ ํšจ๊ธฐ๊ฐ„์ด ์ง€๋‚œ ์ฟ ํฐ์„ ํ•„ํ„ฐ๋งํ•˜๊ณ  ์œ ํšจ๊ธฐ๊ฐ„์ด ์ž„๋ฐ•ํ•œ ์ˆœ์„œ๋Œ€๋กœ ์ •๋ ฌ
const currentDateTime = new Date();
this.couponList = response.data
.filter(coupon => new Date(coupon.expiration) > currentDateTime)
.filter(coupon => new Date(coupon.expiration) > currentDateTime && coupon.useYn === 'N')
.sort((a, b) => new Date(a.expiration) - new Date(b.expiration));
this.checkIfLastPage();
} catch (error) {
Expand Down Expand Up @@ -194,7 +194,8 @@ export default {
.coupon-name {
font-size: 12px;
margin-bottom: 10px;
margin-bottom: 20px;
margin-top: -15px;
white-space: pre-wrap;
word-wrap: break-word;
overflow-wrap: break-word;
Expand Down
6 changes: 5 additions & 1 deletion src/views/order/payment/PaymentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ export default {
// ํ• ์ธ ๊ฐ€๊ฒฉ
console.log(this.packageProduct);
this.discountedPrice = this.packageProduct.discount == undefined ? 0 : this.packageProduct.discount;
if (this.packageProduct.discountActive) {
this.discountedPrice = this.packageProduct.discount != undefined ? this.packageProduct.discount : 0;
} else {
this.discountedPrice = 0;
}
// totalAmount ๊ณ„์‚ฐ
this.totalAmount = this.packageProduct.price - this.discountedPrice;
Expand Down
10 changes: 9 additions & 1 deletion src/views/product/farm/FarmCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
<!-- ๋†์žฅ ์„ค๋ช… -->
<div class="farm-intro">
<h4 class="left-align">๋†์žฅ ์„ค๋ช…์„ ์ ์–ด์ฃผ์„ธ์š”.</h4><br />
<textarea v-model="farmIntro" class="intro-textarea"></textarea>
<textarea v-model="farmIntro" class="intro-textarea" maxlength="50"></textarea>
<div class="char-count">{{ farmIntro.length }}/50</div>
</div>

<!-- ์ œ์ถœ ๋ฒ„ํŠผ -->
Expand Down Expand Up @@ -628,4 +629,11 @@ export default {
font-size: 14px;
color: #666;
}
.char-count {
font-size: 12px;
color: #666;
text-align: right;
margin-top: 5px;
}
</style>
10 changes: 9 additions & 1 deletion src/views/product/farm/FarmInfoUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
<div class="farm-intro">
<h4 class="left-align" v-if="isEditing">๋†์žฅ ์„ค๋ช…์„ ์ ์–ด์ฃผ์„ธ์š”.</h4><br />
<!-- ์ˆ˜์ •ํ•˜๊ธฐ ๋ฒ„ํŠผ์„ ๋ˆŒ๋ €์„ ๋•Œ๋งŒ textarea ๋ณด์ด๊ธฐ -->
<textarea v-model="farmIntro" class="intro-textarea" v-if="isEditing"></textarea>
<textarea v-model="farmIntro" class="intro-textarea" v-if="isEditing" maxlength="50"></textarea>
<div class="char-count" v-if="isEditing">{{ farmIntro.length }}/50</div>
<h4 v-if="!isEditing" class="left-align">๋†์žฅ ํ•œ ์ค„ ์†Œ๊ฐœ</h4>
<div class="intro-area" v-if="!isEditing">
<p v-if="!isEditing">{{ farmIntro }}</p>
Expand Down Expand Up @@ -708,4 +709,11 @@ export default {
.cancel-btn:hover {
background-color: #c0c0c0;
}
.char-count {
font-size: 12px;
color: #666;
text-align: right;
margin-top: 5px;
}
</style>
18 changes: 17 additions & 1 deletion src/views/product/farm/FarmPackageList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<v-card
elevation="0"
class="v-card"
style="width: 100%; height: 470px; padding: 0px;"
style="width: 100%; height: 100%; padding: 0px;"
@click="goToPackageDetail(packageProduct.packageId)"
>
<v-img
Expand Down Expand Up @@ -135,6 +135,7 @@ export default {
};
},
mounted() {
this.fetchWishlistItems();
this.farmId = this.$route.params.farmId;
// ์Šคํฌ๋กค ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ์ถ”๊ฐ€ (debounce ์ ์šฉ)
Expand All @@ -148,6 +149,21 @@ export default {
window.removeEventListener('scroll', this.scrollPagination);
},
methods: {
async fetchWishlistItems() {
try {
const memberId = localStorage.getItem('memberId');
if (memberId) {
const response = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/member-service/wishlist`);
const wishlistProductIds = response.data.map(product => product.id);
wishlistProductIds.forEach(id => {
this.wishlistItems[id] = true;
});
}
} catch (error) {
console.error('์œ„์‹œ๋ฆฌ์ŠคํŠธ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ค๋Š”๋ฐ ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค:', error);
}
},
async loadMorePackages() {
if (this.isLoading || this.isLastPage) return;
Expand Down
40 changes: 39 additions & 1 deletion src/views/product/farm/farmListSample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@

<!-- ์นดํ…Œ๊ณ ๋ฆฌ -->
<v-row class="category-buttons" justify="center">
<v-btn class="cat-btn" :class="{ 'active-cat-btn': category === '์ „์ฒด' }" @click="setCategory('์ „์ฒด')">
<div class="icon-text-wrapper">
<img src="all.png" width="50" height="50"
style="margin-bottom: -18px; transform: scale(0.8);"><br />
<span style="font-size: 14px;">์ „์ฒด</span>
</div>
</v-btn>
<v-btn class="cat-btn" :class="{ 'active-cat-btn': category === '๊ณผ์ผ' }" @click="setCategory('๊ณผ์ผ')">
<div class="icon-text-wrapper">
<img src="https://simg.ssgcdn.com/trans.ssg?src=/cmpt/banner/202403/2024031818080361517067449706_661.png&amp;w=84&amp;h=84&amp;edit=c&amp;t=bd90620ede2db29ee3ac2b9a4faee217e215ee4b"
Expand Down Expand Up @@ -296,7 +303,38 @@ export default {
this.currentPage = 0;
this.isLastPage = false;
this.farmList = [];
this.onSearch();
if (cat === '์ „์ฒด') {
this.loadAllFarms();
} else {
this.onSearch();
}
},
async loadAllFarms() {
try {
this.isLoading = true;
const params = {
page: this.currentPage,
size: this.pageSize,
sort: this.sortOptionMap.get(this.sortOption),
};
const response = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/product-service/farm/no-auth`, { params });
this.farmList = response.data.content;
this.isLastPage = response.data.last;
for (let i = 0; i < this.farmList.length; ++i) {
this.likes.set(this.farmList[i].id, this.farmList[i].isLiked ? 1 : 0);
this.likeCount.set(this.farmList[i].id, this.farmList[i].favoriteCount);
const packageResponse = await axios.get(`${process.env.VUE_APP_API_BASE_URL}/product-service/product/no-auth/for-sale/${this.farmList[i].id}`);
this.farmList[i] = { ...this.farmList[i], packages: packageResponse.data.content.slice(0, 10) };
}
this.isLoading = false;
} catch (error) {
console.error(error);
this.isLoading = false;
}
},
goToPackage(farmId) {
console.log(`Navigating to package for farm ID: ${farmId}`);
Expand Down
2 changes: 1 addition & 1 deletion src/views/product/farmNotice/FarmNoticeCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<v-dialog v-model="alertModal" max-width="260px">
<v-card class="modal" style="padding: 10px; padding-right: 20px; text-align: center;">
<v-card-text>{{ alertMessage }}</v-card-text>
<v-btn @click="closeAlertModal" class="submit-btn">close</v-btn>
<v-btn @click="closeAlertModal" class="submit-btn">๋‹ซ๊ธฐ</v-btn>
</v-card>
</v-dialog>
</div>
Expand Down
Loading

0 comments on commit 09bfb8e

Please sign in to comment.