文件
yjyf/yjyf-app/components/ModePickerDrawer.vue
MiAn 3ebd795cbb feat(ui): 新增/优化界面样式、图标及交互组件
- 新增多个功能图标(箭头、盾牌、位置等)
- 优化全局按钮、标签、输入框等组件样式
- 修复导航栏高度计算逻辑,适配微信小程序
- 优化消息页、订单页、个人中心等页面布局
- 修复微信支付配置及通知接口问题
2026-11-09 09:57:22 +08:00

268 行
6.0 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">
<view class="dh-side"></view>
<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 复刻图一:白底细橙框 + 左上角渐变福利角标 + 左主副标题 + 右实心橙色胶囊按钮) -->
<view class="drawer-body">
<!-- 1. 一口价下单 -->
<view class="mode-card clickable-hover" :class="{ active: currentMode === 'fixed' }" @tap="select('fixed')">
<view class="mc-corner-badge">
<text class="mcb-txt">下单送券·慢必赔 &gt;</text>
</view>
<view class="mc-content">
<view class="mc-info">
<text class="mc-main-title">全国统一参考价,成本可控</text>
<text class="mc-sub-desc">支付后,师傅立即接单预约客户上门服务</text>
</view>
<view class="mc-action-btn">
<text class="mab-txt">一口价下单</text>
</view>
</view>
</view>
<!-- 2. 报价下单 -->
<view class="mode-card clickable-hover" :class="{ active: currentMode === 'quote' }" @tap="select('quote')">
<view class="mc-corner-badge">
<text class="mcb-txt">下单送券·慢必赔 &gt;</text>
</view>
<view class="mc-content">
<view class="mc-info">
<text class="mc-main-title">多个师傅报价,择优选择</text>
<text class="mc-sub-desc">免费发布,选定师傅支付,师傅上门服务</text>
</view>
<view class="mc-action-btn">
<text class="mab-txt">报价下单</text>
</view>
</view>
</view>
<!-- 3. 自己定价 -->
<view class="mode-card clickable-hover" :class="{ active: currentMode === 'custom' }" @tap="select('custom')">
<view class="mc-corner-badge">
<text class="mcb-txt">下单送券·慢必赔 &gt;</text>
</view>
<view class="mc-content">
<view class="mc-info">
<text class="mc-main-title">价格自己定,更省钱</text>
<text class="mc-sub-desc">支付后,师傅立即接单预约客户上门服务</text>
</view>
<view class="mc-action-btn">
<text class="mab-txt">自己定价</text>
</view>
</view>
</view>
</view>
<!-- 底部通栏橙色取消大按钮(对标图一) -->
<view class="drawer-foot">
<view class="cancel-btn clickable-hover" @tap="close">
<text class="cancel-txt">取消</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
defineProps({
visible: { type: Boolean, default: false },
currentMode: { type: String, default: 'fixed' }
});
const emit = defineEmits(['update:visible', 'select']);
function select(mode) {
emit('select', mode);
close();
}
function close() {
emit('update:visible', false);
}
</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-top-left-radius: 28rpx;
border-top-right-radius: 28rpx;
padding: 32rpx 28rpx calc(32rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
animation: drawerSlideUp 0.24s 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: 28rpx;
}
.dh-side {
width: 56rpx;
height: 56rpx;
}
.dh-title {
font-size: 32rpx;
font-weight: 700;
color: #1F1F1F;
text-align: center;
}
.dh-close {
width: 56rpx;
height: 56rpx;
display: flex;
align-items: center;
justify-content: flex-end;
}
.dh-close-img {
width: 34rpx;
height: 34rpx;
opacity: 0.7;
}
.drawer-body {
display: flex;
flex-direction: column;
gap: 24rpx;
}
.mode-card {
position: relative;
border-radius: 16rpx;
background: #FFFFFF;
border: 2rpx solid #F3A661;
overflow: hidden;
transition: all 0.18s ease;
}
.mode-card.active {
border-color: #F0710D;
box-shadow: 0 4rpx 16rpx rgba(240, 113, 13, 0.08);
}
.mc-corner-badge {
position: absolute;
top: 0;
left: 0;
height: 40rpx;
padding: 0 20rpx;
background: linear-gradient(90deg, #FFA33E 0%, #F0710D 100%);
border-bottom-right-radius: 16rpx;
display: inline-flex;
align-items: center;
justify-content: center;
}
.mcb-txt {
font-size: 22rpx;
color: #FFFFFF;
font-weight: 600;
line-height: 1;
}
.mc-content {
display: flex;
align-items: center;
justify-content: space-between;
padding: 58rpx 26rpx 36rpx 28rpx;
gap: 20rpx;
}
.mc-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 10rpx;
}
.mc-main-title {
font-size: 30rpx;
font-weight: 700;
color: #1F1F1F;
line-height: 1.25;
}
.mc-sub-desc {
font-size: 24rpx;
color: #777777;
line-height: 1.35;
}
.mc-action-btn {
flex-shrink: 0;
width: 196rpx;
height: 68rpx;
border-radius: 34rpx;
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
display: flex;
align-items: center;
justify-content: center;
}
.mab-txt {
font-size: 28rpx;
font-weight: 600;
color: #FFFFFF;
line-height: 1;
}
.drawer-foot {
padding-top: 32rpx;
}
.cancel-btn {
height: 88rpx;
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
}
.cancel-txt {
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
line-height: 1;
}
.clickable-hover:active {
opacity: 0.85;
}
</style>