|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <template>
- <transition name="slide-up">
- <div v-if="visible" class="remark-panel">
- <div class="remark-mask" @click="$emit('close')" />
- <div class="remark-content">
- <div class="remark-header">
- <div class="remark-title">{{ title }}</div>
- <div class="remark-close" @click="$emit('close')">×</div>
- </div>
- <div class="remark-body">
- <div class="remark-input">
- <textarea
- :value="remark"
- @input="$emit('update:remark', $event.target.value)"
- placeholder="请输入备注信息(选填)"
- maxlength="200"
- rows="4"
- />
- <div class="remark-count">{{ remark.length }}/200</div>
- </div>
- </div>
- <div class="remark-footer">
- <button class="remark-submit" @click="$emit('submit')">
- 确认打卡
- </button>
- </div>
- </div>
- </div>
- </transition>
- </template>
-
- <script>
- export default {
- name: 'RemarkDialog',
- props: {
- visible: {
- type: Boolean,
- default: false
- },
- title: {
- type: String,
- default: ''
- },
- remark: {
- type: String,
- default: ''
- }
- },
- emits: ['close', 'submit', 'update:remark']
- }
- </script>
-
- <style lang="scss" scoped>
- .remark-panel {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 1000;
-
- .remark-mask {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.5);
- }
-
- .remark-content {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- background: #fff;
- border-radius: 16px 16px 0 0;
- transform: translateY(0);
- transition: transform 0.3s ease-out;
- }
-
- .remark-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 16px 20px;
- border-bottom: 1px solid #eee;
- }
-
- .remark-title {
- font-size: 16px;
- font-weight: 500;
- color: #333;
- }
-
- .remark-close {
- font-size: 24px;
- color: #999;
- padding: 4px;
- cursor: pointer;
- }
-
- .remark-body {
- padding: 20px;
- }
-
- .remark-input {
- position: relative;
-
- textarea {
- width: 100%;
- border: 1px solid #eee;
- border-radius: 8px;
- padding: 12px;
- font-size: 14px;
- line-height: 1.5;
- resize: none;
- outline: none;
-
- &:focus {
- border-color: #2196f3;
- }
- }
-
- .remark-count {
- position: absolute;
- right: 12px;
- bottom: 12px;
- font-size: 12px;
- color: #999;
- }
- }
-
- .remark-footer {
- padding: 12px 20px 20px;
-
- .remark-submit {
- width: 100%;
- height: 44px;
- background: #2196f3;
- border: none;
- border-radius: 22px;
- color: #fff;
- font-size: 16px;
- font-weight: 500;
-
- &:active {
- opacity: 0.9;
- }
- }
- }
- }
-
- .slide-up-enter-active,
- .slide-up-leave-active {
- transition: all 0.3s ease-out;
- }
-
- .slide-up-enter-from,
- .slide-up-leave-to {
- .remark-mask {
- opacity: 0;
- }
-
- .remark-content {
- transform: translateY(100%);
- }
- }
- </style>
|