Skip to content

Commit

Permalink
Merge pull request #272 from samtuap/chore/267
Browse files Browse the repository at this point in the history
๊ณต์ง€ ์ƒ์„ฑ ์˜ค๋ฅ˜ ์ˆ˜์ • ๋ฐ ๋ฆฌ๋ทฐ ์ด๋ฏธ์ง€ ์˜ค๋ฅ˜ ์ˆ˜์ •
  • Loading branch information
cogns authored Nov 4, 2024
2 parents 0628c68 + 25a8547 commit 1f0d80a
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 80 deletions.
2 changes: 0 additions & 2 deletions src/views/product/farm/FarmPackageDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,8 @@ export default {
handleSubscriptionClick() {
if (this.role === 'MEMBER') {
this.subscribe();
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>", this.role);
} else {
this.sellerRestrictionModal = true;
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>", this.role);
}
},
closeSellerRestrictionModal() {
Expand Down
126 changes: 63 additions & 63 deletions src/views/product/farmNotice/FarmNoticeCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,17 @@
<v-card-text style="font-size: 15px;">
<form @submit.prevent="createNotice">
<div>
<input
type="text"
v-model="notice.title"
id="title"
placeholder="์ œ๋ชฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”"
required
<input type="text" v-model="notice.title" id="title" placeholder="์ œ๋ชฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”" required
class="custom-input" />
</div>
<div>
<textarea
v-model="notice.content"
id="content"
placeholder="๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”"
required
<textarea v-model="notice.content" id="content" placeholder="๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”" required
class="custom-input"></textarea>
</div>
<div>
<div>
<!-- ํŒŒ์ผ ์—…๋กœ๋“œ -->
<input
type="file"
@change="handleFileSelection"
class="custom-input"
ref="fileInput"
multiple /> <!-- ๋‹ค์ค‘ ํŒŒ์ผ ์—…๋กœ๋“œ -->
<input type="file" @change="handleFileSelection" class="custom-input" ref="fileInput" multiple />
<!-- ๋‹ค์ค‘ ํŒŒ์ผ ์—…๋กœ๋“œ -->
</div>
<!-- ์„ ํƒ๋œ ํŒŒ์ผ๋“ค ํ‘œ์‹œ -->
<div v-if="filePreviews.length">
Expand All @@ -52,22 +39,13 @@
</div>
</form>
</v-card-text>

<v-card-actions class="action-buttons">
<v-spacer />
<v-btn
color="light_green"
class="custom-button"
@click="createNotice"
>
<v-btn color="light_green" class="custom-button" @click="createNotice">
๋“ฑ๋ก
</v-btn>
<v-btn
@click="showConfirmCloseModal"
color="light_green"
class="custom-close-button"
text
>
<v-btn @click="showConfirmCloseModal" color="light_green" class="custom-close-button" text>
๋‹ซ๊ธฐ
</v-btn>
</v-card-actions>
Expand All @@ -76,20 +54,20 @@

<!-- ๋‹ซ๊ธฐ ํ™•์ธ ๋ชจ๋‹ฌ -->
<v-dialog v-model="confirmCloseModal" max-width="300px">
<v-card class="modal" style="text-align: center;">
<v-card-text style="margin-top: 3px;">์ •๋ง ๋‹ซ์œผ์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ?</v-card-text>
<span style="color: gray; font-size: 13px; margin-top: -10px">ํ˜„์žฌ ์ž‘์„ฑ์ค‘์ธ ๋‚ด์šฉ์€ ์ €์žฅ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.</span><br>
<v-card-actions class="action-buttons" style="justify-content: center; margin-left: 2%; margin-top: -6%;">
<v-btn @click="closeDialog" class="custom-button">๋‹ซ๊ธฐ</v-btn>
<v-btn @click="confirmCloseModal = false" class="custom-close-button">์ทจ์†Œ</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card class="modal" style="text-align: center;">
<v-card-text style="margin-top: 3px;">์ •๋ง ๋‹ซ์œผ์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ?</v-card-text>
<span style="color: gray; font-size: 13px; margin-top: -10px">ํ˜„์žฌ ์ž‘์„ฑ์ค‘์ธ ๋‚ด์šฉ์€ ์ €์žฅ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.</span><br>
<v-card-actions class="action-buttons" style="justify-content: center; margin-left: 2%; margin-top: -6%;">
<v-btn @click="closeDialog" class="custom-button">๋‹ซ๊ธฐ</v-btn>
<v-btn @click="confirmCloseModal = false" class="custom-close-button">์ทจ์†Œ</v-btn>
</v-card-actions>
</v-card>
</v-dialog>

<!-- ์™„๋ฃŒ ๋ฉ”์‹œ์ง€ ๋ชจ๋‹ฌ -->
<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-card-text style="white-space: pre-line;">{{ alertMessage }}</v-card-text>
<v-btn @click="closeAlertModal" class="submit-btn">๋‹ซ๊ธฐ</v-btn>
</v-card>
</v-dialog>
Expand Down Expand Up @@ -125,7 +103,7 @@ export default {
});
this.$refs.fileInput.value = null; // ํŒŒ์ผ ์ž…๋ ฅ ํ•„๋“œ ์ดˆ๊ธฐํ™”
},
// ์„ ํƒํ•œ ํŒŒ์ผ์„ ๋ฐฐ์—ด์—์„œ ์‚ญ์ œํ•˜๋Š” ๋ฉ”์„œ๋“œ
removeFile(index) {
this.selectedFiles.splice(index, 1); // ํ•ด๋‹น ์ธ๋ฑ์Šค์˜ ํŒŒ์ผ์„ ๋ฐฐ์—ด์—์„œ ์‚ญ์ œ
Expand Down Expand Up @@ -185,7 +163,7 @@ export default {
async createNotice() {
// ๊ฐ’ ๊ฒ€์ฆ: title๊ณผ content๊ฐ€ ๋น„์–ด ์žˆ๋Š”์ง€ ํ™•์ธ
if (!this.notice.title || !this.notice.content) {
this.alertMessage = '์ œ๋ชฉ๊ณผ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”.';
this.alertMessage = '์ œ๋ชฉ๊ณผ ๋‚ด์šฉ์„\n ์ž…๋ ฅํ•˜์„ธ์š”.';
this.alertModal = true;
return;
}
Expand Down Expand Up @@ -246,7 +224,9 @@ export default {
// ์™„๋ฃŒ ๋ฉ”์‹œ์ง€ ๋ชจ๋‹ฌ์„ ๋‹ซ๊ณ  ํŽ˜์ด์ง€๋ฅผ ์ƒˆ๋กœ๊ณ ์นจํ•˜๋Š” ๋ฉ”์„œ๋“œ
closeAlertModal() {
this.alertModal = false;
window.location.reload(); // ํŽ˜์ด์ง€ ์ƒˆ๋กœ๊ณ ์นจ
if (this.alertMessage === '๊ณต์ง€์‚ฌํ•ญ์ด ์„ฑ๊ณต์ ์œผ๋กœ ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.') {
window.location.reload(); // ๊ณต์ง€์‚ฌํ•ญ ์ƒ์„ฑ ์„ฑ๊ณต ์‹œ์—๋งŒ ์ƒˆ๋กœ๊ณ ์นจ
}
},
// ๊ณต์ง€ ์ƒ์„ฑ ๋ชจ๋‹ฌ์„ ์—ด ๋•Œ, ์ž…๋ ฅ๊ฐ’์„ ์ดˆ๊ธฐํ™”
Expand All @@ -273,28 +253,37 @@ button {
.custom-input {
width: 100%;
padding: 0.5em;
border: 1px solid #ccc; /* ํ…Œ๋‘๋ฆฌ ์ถ”๊ฐ€ */
border-radius: 4px; /* ๋ชจ์„œ๋ฆฌ ๋‘ฅ๊ธ€๊ฒŒ */
border: 1px solid #ccc;
/* ํ…Œ๋‘๋ฆฌ ์ถ”๊ฐ€ */
border-radius: 4px;
/* ๋ชจ์„œ๋ฆฌ ๋‘ฅ๊ธ€๊ฒŒ */
box-sizing: border-box;
font-size: 1em;
}
textarea.custom-input {
resize: vertical; /* ํ…์ŠคํŠธ ์˜์—ญ ํฌ๊ธฐ ์กฐ์ • ๊ฐ€๋Šฅ */
min-height: 300px; /* ํ…์ŠคํŠธ ์˜์—ญ ์ตœ์†Œ ๋†’์ด ์„ค์ • */
resize: vertical;
/* ํ…์ŠคํŠธ ์˜์—ญ ํฌ๊ธฐ ์กฐ์ • ๊ฐ€๋Šฅ */
min-height: 300px;
/* ํ…์ŠคํŠธ ์˜์—ญ ์ตœ์†Œ ๋†’์ด ์„ค์ • */
}
/* ์„ ํƒ๋œ ํŒŒ์ผ ๋ชฉ๋ก */
.preview-list {
display: flex; /* ๊ฐ€๋กœ๋กœ ๋‚˜์—ด */
gap: 10px; /* ๊ฐ ์ด๋ฏธ์ง€ ์‚ฌ์ด ๊ฐ„๊ฒฉ */
list-style-type: none; /* ๋ฆฌ์ŠคํŠธ ๊ธฐ๋ณธ ์Šคํƒ€์ผ ์ œ๊ฑฐ */
display: flex;
/* ๊ฐ€๋กœ๋กœ ๋‚˜์—ด */
gap: 10px;
/* ๊ฐ ์ด๋ฏธ์ง€ ์‚ฌ์ด ๊ฐ„๊ฒฉ */
list-style-type: none;
/* ๋ฆฌ์ŠคํŠธ ๊ธฐ๋ณธ ์Šคํƒ€์ผ ์ œ๊ฑฐ */
padding: 0;
margin-bottom: 10px; /* ํŒŒ์ผ ๋ชฉ๋ก๊ณผ ๋ฒ„ํŠผ ๊ฐ„ ๊ฐ„๊ฒฉ ์ขํž˜ */
margin-bottom: 10px;
/* ํŒŒ์ผ ๋ชฉ๋ก๊ณผ ๋ฒ„ํŠผ ๊ฐ„ ๊ฐ„๊ฒฉ ์ขํž˜ */
}
.preview-container {
position: relative; /* ์ด๋ฏธ์ง€์— ์ƒ๋Œ€์ ์ธ ์œ„์น˜๋กœ ๋ฒ„ํŠผ ๋ฐฐ์น˜ */
position: relative;
/* ์ด๋ฏธ์ง€์— ์ƒ๋Œ€์ ์ธ ์œ„์น˜๋กœ ๋ฒ„ํŠผ ๋ฐฐ์น˜ */
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -316,7 +305,8 @@ textarea.custom-input {
position: absolute;
top: -5px;
right: -5px;
background-color: black; /* ๋ฒ„ํŠผ ๋ฐฐ๊ฒฝ์ƒ‰ ์ˆ˜์ • */
background-color: black;
/* ๋ฒ„ํŠผ ๋ฐฐ๊ฒฝ์ƒ‰ ์ˆ˜์ • */
border-radius: 50%;
width: 20px;
height: 20px;
Expand All @@ -328,27 +318,35 @@ textarea.custom-input {
/* ๋ชจ๋‹ฌ ์ปค์Šคํ…€ ์Šคํƒ€์ผ */
.custom-dialog {
padding: 20px; /* ๋ชจ๋‹ฌ ๋‚ด๋ถ€ ํŒจ๋”ฉ */
padding: 20px;
/* ๋ชจ๋‹ฌ ๋‚ด๋ถ€ ํŒจ๋”ฉ */
}
.custom-card {
border-radius: 30px; /* ๋ชจ๋‹ฌ ํ…Œ๋‘๋ฆฌ ๋‘ฅ๊ธ€๊ธฐ ๋” ๋‘ฅ๊ธ€๊ฒŒ ์ˆ˜์ • */
padding: 10px; /* ๋ชจ๋‹ฌ ๋‚ด๋ถ€ ํŒจ๋”ฉ */
border-radius: 30px;
/* ๋ชจ๋‹ฌ ํ…Œ๋‘๋ฆฌ ๋‘ฅ๊ธ€๊ธฐ ๋” ๋‘ฅ๊ธ€๊ฒŒ ์ˆ˜์ • */
padding: 10px;
/* ๋ชจ๋‹ฌ ๋‚ด๋ถ€ ํŒจ๋”ฉ */
}
.custom-title {
background-color: #BCC07B;
border-radius: 10px; /* ์ƒ๋‹จ๊ณผ ํ•˜๋‹จ ๋ชจ๋‘ ๋‘ฅ๊ธ€๊ฒŒ */
border-radius: 10px;
/* ์ƒ๋‹จ๊ณผ ํ•˜๋‹จ ๋ชจ๋‘ ๋‘ฅ๊ธ€๊ฒŒ */
text-align: center;
width: calc(97% - 30px); /* ์ขŒ์šฐ ์—ฌ๋ฐฑ ๋งž์ถ”๊ธฐ */
margin: 0 auto; /* ๊ฐ€์šด๋ฐ ์ •๋ ฌ */
width: calc(97% - 30px);
/* ์ขŒ์šฐ ์—ฌ๋ฐฑ ๋งž์ถ”๊ธฐ */
margin: 0 auto;
/* ๊ฐ€์šด๋ฐ ์ •๋ ฌ */
padding: 7px;
font-size: 17px;
}
.action-buttons {
margin-bottom: 10px; /* ๋ฒ„ํŠผ๋“ค ์•„๋ž˜์ชฝ ์—ฌ๋ฐฑ์„ ์ค„์ž„ */
gap: 5px; /* ๋ฒ„ํŠผ ๊ฐ„๊ฒฉ์„ ์ข๊ฒŒ ์กฐ์ • */
margin-bottom: 10px;
/* ๋ฒ„ํŠผ๋“ค ์•„๋ž˜์ชฝ ์—ฌ๋ฐฑ์„ ์ค„์ž„ */
gap: 5px;
/* ๋ฒ„ํŠผ ๊ฐ„๊ฒฉ์„ ์ข๊ฒŒ ์กฐ์ • */
margin-right: 3%;
margin-top: -5px;
}
Expand All @@ -363,7 +361,8 @@ textarea.custom-input {
}
.custom-button {
background-color: #BCC07B; /* ๋งˆ์šฐ์Šค ํ˜ธ๋ฒ„ ์‹œ ๋ฐฐ๊ฒฝ์ƒ‰ ๋ณ€๊ฒฝ */
background-color: #BCC07B;
/* ๋งˆ์šฐ์Šค ํ˜ธ๋ฒ„ ์‹œ ๋ฐฐ๊ฒฝ์ƒ‰ ๋ณ€๊ฒฝ */
}
.custom-close-button {
Expand All @@ -376,7 +375,8 @@ textarea.custom-input {
}
.custom-close-button {
background-color: #e0e0e0; /* ๋งˆ์šฐ์Šค ํ˜ธ๋ฒ„ ์‹œ ๋ฐฐ๊ฒฝ์ƒ‰ ๋ณ€๊ฒฝ */
background-color: #e0e0e0;
/* ๋งˆ์šฐ์Šค ํ˜ธ๋ฒ„ ์‹œ ๋ฐฐ๊ฒฝ์ƒ‰ ๋ณ€๊ฒฝ */
}
/* ์™„๋ฃŒ ๋ฉ”์‹œ์ง€ ๋ชจ๋‹ฌ */
Expand Down
8 changes: 8 additions & 0 deletions src/views/product/farmNotice/FarmNoticeUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ textarea.custom-input {
}
.custom-button {
background-color: #BCC07B;
color: black !important;
transition: background-color 0.3s ease;
border-radius: 50px;
}
.custom-close-button{
background-color: #e0e0e0e0;
color: black !important;
transition: background-color 0.3s ease;
border-radius: 50px;
Expand Down
25 changes: 10 additions & 15 deletions src/views/product/review/ReviewUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<input type="file" ref="fileInput" class="hidden" @change="handleFileSelection" multiple />
</div>

<!-- ์„ ํƒ๋œ ํŒŒ์ผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ -->
<!-- ํŒŒ์ผ ๋ฏธ๋ฆฌ๋ณด๊ธฐ -->
<div v-if="filePreviews.length">
<h3>์„ ํƒ๋œ ํŒŒ์ผ:</h3>
<p style="font-weight: 400;">์„ ํƒ๋œ ํŒŒ์ผ:</p>
<ul class="preview-list">
<li v-for="(preview, index) in filePreviews" :key="index" class="preview-container">
<div class="image-wrapper">
Expand Down Expand Up @@ -124,14 +124,13 @@ export default {
methods: {
handleFileSelection(event) {
const files = Array.from(event.target.files);
files.forEach(file => {
for (const file of files) {
this.selectedFiles.push(file);
const previewUrl = URL.createObjectURL(file);
this.filePreviews.push({ url: previewUrl, file });
});
this.$refs.fileInput.value = null;
}
,
}
this.$refs.fileInput.value = null; // ํŒŒ์ผ ์„ ํƒ ํ›„ input ์ดˆ๊ธฐํ™”
},
removeFile(index) {
this.selectedFiles.splice(index, 1);
this.filePreviews.splice(index, 1);
Expand All @@ -142,14 +141,10 @@ export default {
async uploadFiles() {
const uploadedImageUrls = [];
for (let file of this.selectedFiles) {
if (file instanceof File) {
const imageUrl = await this.uploadImage(file);
uploadedImageUrls.push(imageUrl);
} else {
uploadedImageUrls.push(file.url);
}
const imageUrl = await this.uploadImage(file);
uploadedImageUrls.push(imageUrl);
}
this.review.imageUrls = [...uploadedImageUrls];
this.review.imageUrls = [...this.review.imageUrls, ...uploadedImageUrls];
},
async uploadImage(blob) {
const accessToken = localStorage.getItem('accessToken');
Expand Down Expand Up @@ -399,5 +394,5 @@ textarea.custom-input {
/* ๋ณ„์˜ ๋„ˆ๋น„ ์„ค์ • */
height: 40px !important;
/* ๋ณ„์˜ ๋†’์ด ์„ค์ • */
}
}
</style>

0 comments on commit 1f0d80a

Please sign in to comment.