文件
yjyf/yjyf-app/components/MasterDemandDrawer.vue
MiAn fafddceaf2 feat: 新增发票抬头、晒单、钱包日志等模型及后台管理功能
- 新增 invoice_title、showcase、wallet_log 模型及对应语言包
- 新增后台控制器、视图及搜索字段配置
- 修复服务类目删除保护逻辑
- 优化后台登录页面文案及样式
- 新增前端角色切换逻辑及页面拦截
- 新增 SVG 图标及样式变量
- 修复接口权限及下拉框默认值问题
2026-11-11 17:02:35 +08:00

284 行
6.0 KiB
Vue

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

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

<template>
<view class="drawer-mask" v-if="visible" @tap="close">
<view class="drawer-sheet" @tap.stop>
<!-- 标题栏(1:1 复刻 frame_022 & frame_023) -->
<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>
<!-- 选项内容(1:1 复刻 frame_022 & frame_023:左侧方形勾选框 + 右侧文字) -->
<view class="drawer-body">
<!-- 选项 1:完工过相同的商品 -->
<view class="demand-row clickable-hover" @tap="toggleSameGoods">
<view class="custom-checkbox" :class="{ on: reqSameGoods }">
<image class="check-img" v-if="reqSameGoods" src="/static/icons/check-white.svg" mode="aspectFit" />
</view>
<text class="demand-label">完工过相同的商品</text>
</view>
<!-- 选项 2:师傅评分不低于4.5分 -->
<view class="demand-row clickable-hover" @tap="reqHighRating = !reqHighRating">
<view class="custom-checkbox" :class="{ on: reqHighRating }">
<image class="check-img" v-if="reqHighRating" src="/static/icons/check-white.svg" mode="aspectFit" />
</view>
<text class="demand-label">师傅评分不低于4.5分</text>
</view>
<!-- 联动展开:自动匹配时长(1:1 复刻 frame_023) -->
<view class="expand-box" v-if="reqSameGoods || reqHighRating">
<view class="expand-title-line">
<text class="et-normal">超过</text>
<text class="et-highlight">{{ selectedTimeout }}小时</text>
<text class="et-normal">没有师傅接单时,自动匹配更多师傅</text>
</view>
<view class="timeout-grid">
<view
class="timeout-pill clickable-hover"
v-for="t in timeoutOptions"
:key="t"
:class="{ active: selectedTimeout === t }"
@tap="selectedTimeout = t"
>
<text class="tp-txt">{{ t }}小时</text>
</view>
</view>
</view>
</view>
<!-- 底部确定按钮 -->
<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, watch } from 'vue';
const props = defineProps({
visible: { type: Boolean, default: false },
sameGoods: { type: Boolean, default: false },
highRating: { type: Boolean, default: false },
timeoutHours: { type: [Number, String], default: 1 }
});
const emit = defineEmits(['update:visible', 'confirm']);
const reqSameGoods = ref(false);
const reqHighRating = ref(false);
const selectedTimeout = ref(1);
const timeoutOptions = [1, 3, 6, 12, 24, 48];
watch(() => props.visible, (v) => {
if (v) {
reqSameGoods.value = props.sameGoods;
reqHighRating.value = props.highRating;
selectedTimeout.value = Number(props.timeoutHours) || 1;
}
}, { immediate: true });
function toggleSameGoods() {
reqSameGoods.value = !reqSameGoods.value;
}
function close() {
emit('update:visible', false);
}
function handleConfirm() {
emit('confirm', {
sameGoods: reqSameGoods.value,
highRating: reqHighRating.value,
timeoutHours: selectedTimeout.value
});
close();
}
</script>
<style scoped>
.drawer-mask {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.55);
z-index: 999;
display: flex;
flex-direction: column;
justify-content: flex-end;
animation: drawerFadeIn 0.2s ease-out;
}
@keyframes drawerFadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.drawer-sheet {
background: #FFFFFF;
border-radius: 28rpx 28rpx 0 0;
overflow: hidden;
padding: 0 0 calc(28rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
animation: drawerSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drawerSlideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.drawer-head {
display: flex;
align-items: center;
justify-content: space-between;
height: 96rpx;
padding: 0 28rpx;
border-bottom: 1rpx solid #F0F0F2;
}
.dh-title {
font-size: 30rpx;
font-weight: 500;
color: #1F1F1F;
}
.dh-close {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.dh-close-img {
width: 34rpx;
height: 34rpx;
opacity: 0.85;
}
.drawer-body {
padding: 0 32rpx;
display: flex;
flex-direction: column;
}
.demand-row {
display: flex;
align-items: center;
gap: 20rpx;
height: 112rpx;
border-bottom: 1rpx solid #F2F2F2;
}
.custom-checkbox {
width: 40rpx;
height: 40rpx;
border-radius: 6rpx;
border: 2rpx solid #CCCCCC;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
}
.custom-checkbox.on {
background: #F0710D;
border-color: #F0710D;
}
.check-img {
width: 24rpx;
height: 24rpx;
}
.demand-label {
font-size: 30rpx;
color: #1F1F1F;
}
.expand-box {
padding: 28rpx 0 12rpx;
}
.expand-title-line {
display: flex;
align-items: center;
margin-bottom: 24rpx;
}
.et-normal {
font-size: 26rpx;
color: #1F1F1F;
}
.et-highlight {
font-size: 26rpx;
color: #F0710D;
margin: 0 4rpx;
}
.timeout-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 16rpx;
}
.timeout-pill {
height: 60rpx;
border-radius: 6rpx;
background: #F7F7F7;
border: 2rpx solid transparent;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
.timeout-pill.active {
background: #FFF7F0;
border-color: #F0710D;
}
.tp-txt {
font-size: 26rpx;
color: #1F1F1F;
line-height: 1;
}
.timeout-pill.active .tp-txt {
color: #F0710D;
}
.drawer-foot {
padding: 36rpx 24rpx 0;
}
.confirm-btn {
height: 84rpx;
background: #F0710D;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.cb-txt {
font-size: 30rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 1;
}
.clickable-hover:active {
opacity: 0.85;
}
</style>