文件
yjyf/yjyf-app/components/RemarkTemplateDrawer.vue
YuanWen 78d45eea74 chore: 新增epay和cos插件相关类库及配置文件
- 新增epay v2、v3、v3new版本的支付类库及证书文件
- 新增cos云存储类库文件
- 调整文件上传保存格式为按分类存储
- 修复会员、规则、类目等语言翻译键名
- 新增小程序图标等静态资源文件
2026-11-04 09:33:57 +08:00

247 行
5.2 KiB
Vue

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<template>
<view class="drawer-mask" v-if="visible" @tap="close">
<view class="drawer-sheet" @tap.stop>
<!-- 标题栏(左对齐大字加粗,右侧关闭叉) -->
<view class="drawer-head">
<text class="dh-title">选择常用备注模板</text>
<view class="dh-close clickable-hover" @tap="close">
<image class="dh-close-img" src="/static/icons/close.svg" mode="aspectFit" />
</view>
</view>
<!-- 模板列表 -->
<scroll-view class="drawer-body" scroll-y="true">
<view class="template-list">
<view
class="tpl-item clickable-hover"
v-for="(tpl, idx) in templateList"
:key="idx"
:class="{ active: selectedIndexes.includes(idx) }"
@tap="toggleTpl(idx)"
>
<view class="tpl-content">
<text class="tpl-txt">{{ tpl }}</text>
</view>
<view class="tpl-check">
<view class="check-box" :class="{ on: selectedIndexes.includes(idx) }">
<image class="check-img" v-if="selectedIndexes.includes(idx)" src="/static/icons/check-white.svg" mode="aspectFit" />
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 底部确定按钮(微圆角 12rpx 橙色实心长条) -->
<view class="drawer-foot">
<view class="confirm-btn clickable-hover" @tap="handleConfirm">
<text class="cb-txt">确定填入备注</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
const props = defineProps({
visible: { type: Boolean, default: false }
});
const emit = defineEmits(['update:visible', 'select']);
const templateList = [
'师傅请自备人字梯及电钻等专业工具',
'客户白天上班不在家,请提前电话预约晚上或周末上门',
'新房已精装修入住,请务必穿戴防尘鞋套并做好地面防护',
'现场施工空间较狭窄,搬运时请轻拿轻放防止碰撞',
'货物已全部送达现场,请直接联系客户上门安装',
'需拆除旧品并清理现场施工垃圾',
'请师傅按时上门,如遇特殊情况请提前2小时告知'
];
const selectedIndexes = ref([]);
function toggleTpl(idx) {
const pos = selectedIndexes.value.indexOf(idx);
if (pos > -1) {
selectedIndexes.value.splice(pos, 1);
} else {
selectedIndexes.value.push(idx);
}
}
function close() {
emit('update:visible', false);
}
function handleConfirm() {
const hits = selectedIndexes.value.map(i => templateList[i]);
if (hits.length > 0) {
emit('select', hits.join(';'));
}
selectedIndexes.value = [];
close();
}
</script>
<style scoped>
.drawer-mask {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(2px);
z-index: 999;
display: flex;
flex-direction: column;
justify-content: flex-end;
animation: drawerFadeIn 0.22s ease-out;
}
@keyframes drawerFadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.drawer-sheet {
background: #FFFFFF;
border-top-left-radius: 28rpx;
border-top-right-radius: 28rpx;
padding: 36rpx 36rpx calc(30rpx + env(safe-area-inset-bottom));
max-height: 75vh;
display: flex;
flex-direction: column;
box-sizing: border-box;
animation: drawerSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
box-shadow: 0 -8rpx 32rpx rgba(0, 0, 0, 0.08);
}
@keyframes drawerSlideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.drawer-head {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 24rpx;
}
.dh-title {
font-size: 34rpx;
font-weight: 700;
color: #1A1A1A;
letter-spacing: 0.5rpx;
}
.dh-close {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.dh-close-img {
width: 32rpx;
height: 32rpx;
opacity: 0.75;
}
.drawer-body {
max-height: 520rpx;
padding: 10rpx 0;
}
.template-list {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.tpl-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 26rpx 22rpx;
border-radius: 12rpx;
background: #F8F8F8;
border: 2rpx solid transparent;
transition: all 0.18s ease;
}
.tpl-item.active {
background: #FFF8F2;
border-color: #F0710D;
}
.tpl-content {
flex: 1;
padding-right: 20rpx;
}
.tpl-txt {
font-size: 28rpx;
color: #333333;
line-height: 1.45;
}
.tpl-item.active .tpl-txt {
color: #F0710D;
font-weight: 500;
}
.check-box {
width: 38rpx;
height: 38rpx;
border-radius: 8rpx;
border: 2rpx solid #CCCCCC;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.18s ease;
}
.check-box.on {
background: #F0710D;
border-color: #F0710D;
}
.check-img {
width: 24rpx;
height: 24rpx;
}
.drawer-foot {
padding-top: 36rpx;
}
.confirm-btn {
height: 88rpx;
background: #F0710D;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s ease, transform 0.1s ease;
}
.confirm-btn:active {
background: #E06305;
transform: scale(0.99);
}
.cb-txt {
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
letter-spacing: 2rpx;
}
.clickable-hover:active {
opacity: 0.85;
}
</style>