|
|
@@ -8,7 +8,12 @@
|
|
|
@closed="handleClosed"
|
|
|
>
|
|
|
<div class="album-upload-popup__content">
|
|
|
- <div class="album-upload-popup__title">上传照片</div>
|
|
|
+ <div class="album-upload-popup__header">
|
|
|
+ <div class="album-upload-popup__title">上传照片</div>
|
|
|
+ <div class="album-upload-popup__close" @click="handleCancel">
|
|
|
+ <el-icon :size="14"><Close /></el-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
<uploader
|
|
|
class="album-upload-popup__uploader"
|
|
|
@@ -19,35 +24,49 @@
|
|
|
@delete="onDelete"
|
|
|
>
|
|
|
<div class="album-upload-popup__add">
|
|
|
- <el-icon size="22" color="rgba(0, 0, 0, 0.6)"><Plus /></el-icon>
|
|
|
- <!-- <span class="album-upload-popup__add-icon">+</span> -->
|
|
|
+ <el-icon size="28" color="rgba(255, 255, 255, 0.45)"><Plus /></el-icon>
|
|
|
</div>
|
|
|
</uploader>
|
|
|
|
|
|
<div class="album-upload-popup__date">
|
|
|
- <div class="album-upload-popup__date-label">上传日期</div>
|
|
|
- <el-date-picker
|
|
|
- v-model="uploadDate"
|
|
|
- type="date"
|
|
|
- format="YYYY-MM-DD"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- placeholder="请选择上传日期"
|
|
|
- :editable="false"
|
|
|
- :disabled-date="disableAfterToday"
|
|
|
- style="width: 100%"
|
|
|
- size="large"
|
|
|
+ <div class="album-upload-popup__label">上传日期</div>
|
|
|
+ <div class="album-upload-popup__date-field">
|
|
|
+ <el-icon class="date-icon" :size="16"><Clock /></el-icon>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="uploadDate"
|
|
|
+ type="date"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ placeholder="选择时间"
|
|
|
+ :editable="false"
|
|
|
+ :clearable="false"
|
|
|
+ :disabled-date="disableAfterToday"
|
|
|
+ teleported
|
|
|
+ popper-class="album-upload-date-popper"
|
|
|
+ :popper-options="{ strategy: 'fixed' }"
|
|
|
+ style="width: 100%"
|
|
|
+ size="large"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="album-upload-popup__desc-wrap">
|
|
|
+ <div class="album-upload-popup__label">照片描述</div>
|
|
|
+ <el-input
|
|
|
+ v-model="description"
|
|
|
+ class="album-upload-popup__desc"
|
|
|
+ type="textarea"
|
|
|
+ :rows="4"
|
|
|
+ resize="none"
|
|
|
+ placeholder="为您的照片添加描述吧~"
|
|
|
+ maxlength="200"
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- <el-input
|
|
|
- v-model="description"
|
|
|
- class="album-upload-popup__desc"
|
|
|
- type="textarea"
|
|
|
- :rows="4"
|
|
|
- resize="none"
|
|
|
- placeholder="为您的照片添加描述吧~"
|
|
|
- maxlength="200"
|
|
|
- />
|
|
|
+ <div class="album-upload-popup__tip">
|
|
|
+ <span class="tip-star">✧</span>
|
|
|
+ 上传后将自动生成本次诊断报告
|
|
|
+ </div>
|
|
|
|
|
|
<div class="album-upload-popup__actions">
|
|
|
<div class="album-upload-popup__btn album-upload-popup__btn--cancel" @click="handleCancel">
|
|
|
@@ -58,7 +77,7 @@
|
|
|
:class="{ disabled: confirming }"
|
|
|
@click="handleConfirm"
|
|
|
>
|
|
|
- {{ confirming ? "上传中..." : "确认上传" }}
|
|
|
+ {{ confirming ? "上传中..." : "确认信息" }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -66,9 +85,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, watch } from "vue";
|
|
|
+import { nextTick, ref, watch } from "vue";
|
|
|
import { Popup, Uploader } from "vant";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
+import { ArrowDown, Clock, Close, Plus } from "@element-plus/icons-vue";
|
|
|
import { getFileExt } from "@/utils/util";
|
|
|
import UploadFile from "@/utils/upliadFile";
|
|
|
import { useStore } from "vuex";
|
|
|
@@ -91,6 +111,24 @@ const store = useStore();
|
|
|
const miniUserId = store.state.home.miniUserId || localStorage.getItem("MINI_USER_ID");
|
|
|
const uploadFileObj = new UploadFile();
|
|
|
|
|
|
+/** 需高于 vant popup(20000),否则 Message 会被盖住 */
|
|
|
+const LAYER_Z = 30050;
|
|
|
+
|
|
|
+function toast(type, message) {
|
|
|
+ ElMessage({
|
|
|
+ type,
|
|
|
+ message,
|
|
|
+ customClass: "album-upload-el-message",
|
|
|
+ duration: 2500,
|
|
|
+ });
|
|
|
+ // EP 内联 z-index 默认约 2000+,强制抬到弹窗之上
|
|
|
+ nextTick(() => {
|
|
|
+ document.querySelectorAll(".album-upload-el-message").forEach((el) => {
|
|
|
+ el.style.setProperty("z-index", String(LAYER_Z), "important");
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
const showValue = ref(false);
|
|
|
const fileList = ref([]);
|
|
|
const uploadedKeys = ref([]);
|
|
|
@@ -156,7 +194,7 @@ const afterRead = (file) => {
|
|
|
.catch(() => {
|
|
|
item.status = "failed";
|
|
|
item.message = "上传失败";
|
|
|
- ElMessage.error("图片上传失败,请稍后再试!");
|
|
|
+ toast("error", "图片上传失败,请稍后再试!");
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
@@ -176,16 +214,16 @@ const handleConfirm = () => {
|
|
|
if (confirming.value) return;
|
|
|
const uploading = fileList.value.some((item) => item.status === "uploading");
|
|
|
if (uploading) {
|
|
|
- ElMessage.warning("图片上传中,请稍候");
|
|
|
+ toast("warning", "图片上传中,请稍候");
|
|
|
return;
|
|
|
}
|
|
|
const failed = fileList.value.some((item) => item.status === "failed");
|
|
|
if (failed) {
|
|
|
- ElMessage.warning("存在上传失败的图片,请删除后重试");
|
|
|
+ toast("warning", "存在上传失败的图片,请删除后重试");
|
|
|
return;
|
|
|
}
|
|
|
if (!uploadedKeys.value.length) {
|
|
|
- ElMessage.warning("请先上传照片");
|
|
|
+ toast("warning", "请先上传照片");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -208,26 +246,50 @@ const handleClosed = () => {
|
|
|
.album-upload-popup {
|
|
|
width: 90%;
|
|
|
max-width: 420px;
|
|
|
- border-radius: 12px;
|
|
|
- background: #fff;
|
|
|
+ border-radius: 16px;
|
|
|
+ padding: 1px;
|
|
|
+ background: linear-gradient(0deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.32)),
|
|
|
+linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 12%);
|
|
|
overflow: hidden;
|
|
|
+ backdrop-filter: blur(4px);
|
|
|
+
|
|
|
|
|
|
&__content {
|
|
|
- padding: 20px 16px 16px;
|
|
|
+ background: linear-gradient(180deg, #1A191D 0%, #121216 100%);
|
|
|
+ border-radius: 16px;
|
|
|
+ padding: 18px 16px 16px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
+ &__header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
&__title {
|
|
|
- margin-bottom: 14px;
|
|
|
font-size: 16px;
|
|
|
line-height: 22px;
|
|
|
font-weight: 500;
|
|
|
- color: #111;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__close {
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: rgba(255, 255, 255, 0.12);
|
|
|
+ color: rgba(255, 255, 255, 0.85);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
|
|
|
&__uploader {
|
|
|
width: 100%;
|
|
|
- margin-bottom: 12px;
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
|
:deep(.van-uploader__wrapper) {
|
|
|
gap: 8px;
|
|
|
@@ -239,7 +301,7 @@ const handleClosed = () => {
|
|
|
width: calc((100vw * 0.9 - 32px - 24px) / 4);
|
|
|
height: calc((100vw * 0.9 - 32px - 24px) / 4);
|
|
|
margin: 0;
|
|
|
- border-radius: 6px;
|
|
|
+ border-radius: 8px;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|
|
|
@@ -252,6 +314,7 @@ const handleClosed = () => {
|
|
|
right: 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
:deep(.van-uploader__input-wrapper) {
|
|
|
width: calc(25% - 8px);
|
|
|
min-height: 66px;
|
|
|
@@ -263,77 +326,145 @@ const handleClosed = () => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- background: #F6F6F6;
|
|
|
- border: 1px dashed #DDDDDD;
|
|
|
- border-radius: 6px;
|
|
|
+ background: transparent;
|
|
|
+ border: 1px dashed rgba(255, 255, 255, 0.28);
|
|
|
+ border-radius: 8px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
|
|
|
- &__add-icon {
|
|
|
- font-size: 28px;
|
|
|
- line-height: 1;
|
|
|
- color: #999;
|
|
|
- font-weight: 300;
|
|
|
+ &__label {
|
|
|
+ margin-bottom: 8px;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
|
|
|
&__date {
|
|
|
- margin-bottom: 12px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__date-field {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 44px;
|
|
|
+ padding: 0 12px;
|
|
|
+ border-radius: 10px;
|
|
|
+ background: rgba(255, 255, 255, 0.06);
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .date-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 8px;
|
|
|
+ color: rgba(255, 255, 255, 0.75);
|
|
|
+ }
|
|
|
+
|
|
|
+ .date-arrow {
|
|
|
+ position: absolute;
|
|
|
+ right: 12px;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ color: rgba(255, 255, 255, 0.45);
|
|
|
+ pointer-events: none;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
|
|
|
- &-label {
|
|
|
- margin-bottom: 8px;
|
|
|
+ :deep(.el-date-editor) {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+ height: 100%;
|
|
|
+ box-shadow: none !important;
|
|
|
+ background: transparent;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-input__wrapper) {
|
|
|
+ padding: 0 24px 0 0;
|
|
|
+ box-shadow: none !important;
|
|
|
+ background: transparent;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-input__inner) {
|
|
|
+ height: 42px;
|
|
|
+ color: #fff;
|
|
|
font-size: 14px;
|
|
|
- line-height: 20px;
|
|
|
- color: #333;
|
|
|
+
|
|
|
+ &::placeholder {
|
|
|
+ color: rgba(255, 255, 255, 0.35);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.el-input__prefix),
|
|
|
+ :deep(.el-input__suffix) {
|
|
|
+ display: none;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- &__desc {
|
|
|
- border: 1px solid rgba(220, 220, 220, 1);
|
|
|
- margin-bottom: 16px;
|
|
|
- border-radius: 3px;
|
|
|
+ &__desc-wrap {
|
|
|
+ margin-bottom: 12px;
|
|
|
+ }
|
|
|
|
|
|
+ &__desc {
|
|
|
:deep(.el-textarea__inner) {
|
|
|
min-height: 96px;
|
|
|
- padding: 10px 12px;
|
|
|
- border-radius: 6px;
|
|
|
- border-color: #e5e5e5;
|
|
|
+ padding: 12px;
|
|
|
+ border-radius: 10px;
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
+ background: rgba(255, 255, 255, 0.06);
|
|
|
box-shadow: none;
|
|
|
font-size: 14px;
|
|
|
line-height: 20px;
|
|
|
- color: #333;
|
|
|
+ color: #fff;
|
|
|
|
|
|
&::placeholder {
|
|
|
- color: rgba(0, 0, 0, 0.3);
|
|
|
+ color: rgba(255, 255, 255, 0.35);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ &__tip {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 4px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 18px;
|
|
|
+ color: #ffd489;
|
|
|
+
|
|
|
+ .tip-star {
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
&__actions {
|
|
|
display: flex;
|
|
|
gap: 10px;
|
|
|
}
|
|
|
|
|
|
&__btn {
|
|
|
- height: 40px;
|
|
|
- line-height: 40px;
|
|
|
- border-radius: 4px;
|
|
|
+ height: 44px;
|
|
|
+ line-height: 44px;
|
|
|
+ border-radius: 8px;
|
|
|
text-align: center;
|
|
|
- font-size: 15px;
|
|
|
+ font-size: 16px;
|
|
|
box-sizing: border-box;
|
|
|
cursor: pointer;
|
|
|
|
|
|
&--cancel {
|
|
|
- width: 96px;
|
|
|
+ width: 128px;
|
|
|
flex-shrink: 0;
|
|
|
- color: #666;
|
|
|
- background: #fff;
|
|
|
- border: 1px solid #dcdfe6;
|
|
|
+ color: rgba(255, 255, 255, 0.85);
|
|
|
+ background: rgba(255, 255, 255, 0.05);
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.12);
|
|
|
}
|
|
|
|
|
|
&--confirm {
|
|
|
flex: 1;
|
|
|
- color: #fff;
|
|
|
- background: #2199f8;
|
|
|
+ color: #1a1408;
|
|
|
+ font-weight: 500;
|
|
|
+ background: linear-gradient(135deg, #FFEBC9 0%, #FFCA6D 100%);
|
|
|
|
|
|
&.disabled {
|
|
|
opacity: 0.6;
|
|
|
@@ -343,3 +474,136 @@ const handleClosed = () => {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+/* teleported 到 body,需高于 vant popup(20000) */
|
|
|
+.album-upload-date-popper {
|
|
|
+ z-index: 30050 !important;
|
|
|
+ background: #1c1c1e !important;
|
|
|
+ border: 1px solid rgba(255, 216, 145, 0.5) !important;
|
|
|
+ border-radius: 12px !important;
|
|
|
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
|
|
|
+ // overflow: hidden;
|
|
|
+
|
|
|
+ .el-popper__arrow::before {
|
|
|
+ background: #1c1c1e !important;
|
|
|
+ border: 1px solid #ffd891 !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-picker-panel,
|
|
|
+ .el-date-picker,
|
|
|
+ .el-picker__popper {
|
|
|
+ background: transparent !important;
|
|
|
+ border: none !important;
|
|
|
+ color: #fff !important;
|
|
|
+ box-shadow: none !important;
|
|
|
+ }
|
|
|
+ .el-date-table td.disabled .el-date-table-cell {
|
|
|
+ background: rgba(217, 217, 217, 0.07);
|
|
|
+ }
|
|
|
+ // &.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before {
|
|
|
+ // border-top-color: rgba(255, 216, 145, 0.5) !important;
|
|
|
+ // border-left-color: rgba(255, 216, 145, 0.5) !important;
|
|
|
+ // }
|
|
|
+
|
|
|
+ .el-date-picker__header {
|
|
|
+ margin: 8px 12px 4px;
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ .el-picker-panel__icon-btn,
|
|
|
+ .el-date-picker__header-label {
|
|
|
+ color: rgba(255, 255, 255, 0.85) !important;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ color: #ffd891 !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-date-table {
|
|
|
+ th {
|
|
|
+ color: rgba(255, 255, 255, 0.45);
|
|
|
+ border-bottom-color: rgba(255, 255, 255, 0.08);
|
|
|
+ font-weight: 400;
|
|
|
+ }
|
|
|
+
|
|
|
+ td {
|
|
|
+ &.prev-month,
|
|
|
+ &.next-month {
|
|
|
+ color: rgba(255, 255, 255, 0.25);
|
|
|
+
|
|
|
+ .el-date-table-cell__text,
|
|
|
+ span {
|
|
|
+ color: rgba(255, 255, 255, 0.25);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.available,
|
|
|
+ &.today {
|
|
|
+ .el-date-table-cell__text,
|
|
|
+ span {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.today {
|
|
|
+ .el-date-table-cell__text,
|
|
|
+ span {
|
|
|
+ color: #ffd891;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.available:hover {
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ .el-date-table-cell {
|
|
|
+ background: rgba(255, 255, 255, 0.08);
|
|
|
+ border-radius: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-date-table-cell__text,
|
|
|
+ span {
|
|
|
+ background: transparent !important;
|
|
|
+ color: #fff !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 选中:金色圆底 + 深色字 */
|
|
|
+ &.current:not(.disabled) {
|
|
|
+ .el-date-table-cell__text,
|
|
|
+ span {
|
|
|
+ background: #ffd891 !important;
|
|
|
+ color: #1a1408 !important;
|
|
|
+ border-radius: 50% !important;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.disabled {
|
|
|
+ .el-date-table-cell__text,
|
|
|
+ span {
|
|
|
+ color: rgba(255, 255, 255, 0.2) !important;
|
|
|
+ background: transparent !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ td .el-date-table-cell__text,
|
|
|
+ td span {
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ line-height: 28px;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-picker-panel__content {
|
|
|
+ margin: 8px 10px 12px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.el-message.album-upload-el-message {
|
|
|
+ z-index: 30050 !important;
|
|
|
+}
|
|
|
+</style>
|