chore: 新增epay和cos插件相关类库及配置文件
- 新增epay v2、v3、v3new版本的支付类库及证书文件 - 新增cos云存储类库文件 - 调整文件上传保存格式为按分类存储 - 修复会员、规则、类目等语言翻译键名 - 新增小程序图标等静态资源文件
这个提交包含在:
@@ -0,0 +1,277 @@
|
||||
<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="addon-card" v-for="(item, idx) in localList" :key="item.key || idx">
|
||||
<text class="ac-name">{{ item.name }}</text>
|
||||
<view class="ac-stepper">
|
||||
<view
|
||||
class="step-btn step-btn-minus clickable-hover"
|
||||
:class="{ disabled: (item.num || 0) <= 0 }"
|
||||
@tap="stepNum(idx, -1)"
|
||||
>-</view>
|
||||
<view class="step-num">{{ item.num || 0 }}</view>
|
||||
<view
|
||||
class="step-btn step-btn-plus clickable-hover"
|
||||
@tap="stepNum(idx, 1)"
|
||||
>+</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty-tip" v-if="!localList || localList.length === 0">
|
||||
<text class="empty-txt">暂无可配置的增项服务</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 价格在汇总处显示(满足用户指令) -->
|
||||
<view class="drawer-summary-line" v-if="totalAddonFee > 0">
|
||||
<text class="dsl-label">增项费用合计:</text>
|
||||
<text class="dsl-price">¥{{ totalAddonFee }}</text>
|
||||
</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, computed, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
visible: { type: Boolean, default: false },
|
||||
list: { type: Array, default: () => [] }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible', 'confirm']);
|
||||
|
||||
const localList = ref([]);
|
||||
|
||||
watch(() => props.visible, (v) => {
|
||||
if (v) {
|
||||
localList.value = JSON.parse(JSON.stringify(props.list || []));
|
||||
}
|
||||
});
|
||||
|
||||
const totalAddonFee = computed(() => {
|
||||
if (!localList.value || !localList.value.length) return '0.00';
|
||||
const sum = localList.value.reduce((acc, cur) => acc + (Number(cur.price) || 0) * (Number(cur.num) || 0), 0);
|
||||
return sum.toFixed(2);
|
||||
});
|
||||
|
||||
function stepNum(idx, d) {
|
||||
const target = localList.value[idx];
|
||||
if (!target) return;
|
||||
const next = Math.max(0, (target.num || 0) + d);
|
||||
target.num = next;
|
||||
}
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
|
||||
function handleConfirm() {
|
||||
emit('confirm', localList.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.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: 36rpx 36rpx calc(30rpx + env(safe-area-inset-bottom));
|
||||
max-height: 75vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
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: 24rpx;
|
||||
}
|
||||
|
||||
.dh-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.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: 540rpx;
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
|
||||
.addon-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 110rpx;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 14rpx;
|
||||
background: #F8F9FA;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.addon-card:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.ac-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.ac-stepper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1rpx solid #D5D5D5;
|
||||
border-radius: 8rpx;
|
||||
background: #FFFFFF;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.step-btn {
|
||||
width: 68rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 34rpx;
|
||||
color: #333333;
|
||||
background: #FFFFFF;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.step-btn.disabled {
|
||||
color: #CCCCCC;
|
||||
background: #FAFAFA;
|
||||
}
|
||||
|
||||
.step-num {
|
||||
width: 80rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #1A1A1A;
|
||||
border-left: 1rpx solid #EAEAEA;
|
||||
border-right: 1rpx solid #EAEAEA;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
padding: 60rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.empty-txt {
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.drawer-summary-line {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: flex-end;
|
||||
padding: 24rpx 8rpx 0;
|
||||
}
|
||||
|
||||
.dsl-label {
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.dsl-price {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.drawer-foot {
|
||||
padding-top: 28rpx;
|
||||
}
|
||||
|
||||
.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>
|
||||
@@ -0,0 +1,298 @@
|
||||
<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>
|
||||
|
||||
<!-- 上门日期滚动条 -->
|
||||
<view class="section-box">
|
||||
<text class="section-title">上门日期</text>
|
||||
<scroll-view class="date-scroll" scroll-x="true" show-scrollbar="false">
|
||||
<view class="date-list">
|
||||
<view
|
||||
class="date-card clickable-hover"
|
||||
v-for="d in dateList"
|
||||
:key="d.fullDate"
|
||||
:class="{ active: selectedDate === d.fullDate }"
|
||||
@tap="selectedDate = d.fullDate"
|
||||
>
|
||||
<text class="dc-tag">{{ d.tag }}</text>
|
||||
<text class="dc-date">{{ d.dateStr }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 上门时段纯净卡片 -->
|
||||
<view class="section-box">
|
||||
<text class="section-title">上门时段</text>
|
||||
<view class="slot-grid">
|
||||
<view
|
||||
class="slot-card clickable-hover"
|
||||
v-for="name in slotList"
|
||||
:key="name"
|
||||
:class="{ active: selectedSlot === name }"
|
||||
@tap="selectedSlot = name"
|
||||
>
|
||||
<text class="slot-txt">{{ name }}</text>
|
||||
</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, computed, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
visible: { type: Boolean, default: false },
|
||||
date: { type: String, default: '' },
|
||||
slot: { type: String, default: '' }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible', 'confirm']);
|
||||
|
||||
const slotList = ['上午', '下午', '晚上', '全天'];
|
||||
|
||||
// 生成未来 7 天日期
|
||||
const dateList = computed(() => {
|
||||
const list = [];
|
||||
const weekNames = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||||
const now = new Date();
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const target = new Date(now.getTime() + i * 24 * 3600 * 1000);
|
||||
const year = target.getFullYear();
|
||||
const month = String(target.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(target.getDate()).padStart(2, '0');
|
||||
const fullDate = `${year}-${month}-${day}`;
|
||||
const dateStr = `${month}-${day}`;
|
||||
let tag = weekNames[target.getDay()];
|
||||
if (i === 0) tag = '今天';
|
||||
else if (i === 1) tag = '明天';
|
||||
else if (i === 2) tag = '后天';
|
||||
list.push({ fullDate, dateStr, tag });
|
||||
}
|
||||
return list;
|
||||
});
|
||||
|
||||
const selectedDate = ref('');
|
||||
const selectedSlot = ref('晚上');
|
||||
|
||||
watch(() => props.visible, (v) => {
|
||||
if (v) {
|
||||
selectedDate.value = props.date || (dateList.value[0] ? dateList.value[0].fullDate : '');
|
||||
selectedSlot.value = props.slot || '晚上';
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
|
||||
function handleConfirm() {
|
||||
emit('confirm', {
|
||||
date: selectedDate.value,
|
||||
slot: selectedSlot.value,
|
||||
display: `${selectedDate.value} ${selectedSlot.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.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: 36rpx 36rpx calc(30rpx + 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: 24rpx;
|
||||
}
|
||||
|
||||
.dh-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.section-box {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.date-scroll {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.date-list {
|
||||
display: inline-flex;
|
||||
gap: 16rpx;
|
||||
padding: 4rpx 0;
|
||||
}
|
||||
|
||||
.date-card {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 136rpx;
|
||||
height: 124rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #F8F9FA;
|
||||
border: 2rpx solid transparent;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.date-card.active {
|
||||
background: #FFF9F5;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.dc-tag {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
margin-bottom: 4rpx;
|
||||
}
|
||||
|
||||
.date-card.active .dc-tag {
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.dc-date {
|
||||
font-size: 24rpx;
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
.date-card.active .dc-date {
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.slot-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.slot-card {
|
||||
height: 84rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #F8F9FA;
|
||||
border: 2rpx solid transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.slot-card.active {
|
||||
background: #FFF9F5;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.slot-txt {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.slot-card.active .slot-txt {
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.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>
|
||||
@@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<view class="drawer-mask" v-if="visible" @tap="close">
|
||||
<view class="drawer-sheet" @tap.stop>
|
||||
<!-- 标题栏(参考 frame_006:左对齐大字加粗,右侧细线条关闭叉) -->
|
||||
<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>
|
||||
|
||||
<!-- 费用明细列表(参考 frame_006 1:1 视觉排版) -->
|
||||
<view class="drawer-body">
|
||||
<!-- 商品总价 -->
|
||||
<view class="fee-row">
|
||||
<text class="fee-label">商品总价</text>
|
||||
<text class="fee-value">¥{{ baseAmount }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 增项服务 -->
|
||||
<view class="fee-row" v-if="Number(addonAmount) > 0">
|
||||
<text class="fee-label">增项工序费</text>
|
||||
<text class="fee-value">¥{{ addonAmount }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 楼层上楼费 -->
|
||||
<view class="fee-row" v-if="Number(floorAmount) > 0">
|
||||
<text class="fee-label">步梯搬运费</text>
|
||||
<text class="fee-value">¥{{ floorAmount }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 加急费 -->
|
||||
<view class="fee-row" v-if="Number(urgentAmount) > 0">
|
||||
<text class="fee-label">加急服务费</text>
|
||||
<text class="fee-value">¥{{ urgentAmount }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券抵扣(带圆形红包图标与红色加粗负值) -->
|
||||
<view class="fee-row">
|
||||
<view class="coupon-label-wrap">
|
||||
<image class="coupon-red-icon" src="/static/icons/coupon-tag.svg" mode="aspectFit" />
|
||||
<text class="fee-label">优惠券</text>
|
||||
</view>
|
||||
<text class="fee-value discount">- ¥{{ discountAmount || '0.00' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 实付合计 -->
|
||||
<view class="fee-row total-divider">
|
||||
<text class="total-label">预计实付</text>
|
||||
<text class="total-val">¥{{ payAmount }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({
|
||||
visible: { type: Boolean, default: false },
|
||||
baseAmount: { type: [Number, String], default: '0.00' },
|
||||
addonAmount: { type: [Number, String], default: '0.00' },
|
||||
floorAmount: { type: [Number, String], default: '0.00' },
|
||||
urgentAmount: { type: [Number, String], default: '0.00' },
|
||||
discountAmount: { type: [Number, String], default: '0.00' },
|
||||
payAmount: { type: [Number, String], default: '0.00' }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible']);
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
</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(40rpx + env(safe-area-inset-bottom));
|
||||
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: 30rpx;
|
||||
}
|
||||
|
||||
.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 {
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
|
||||
.fee-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 24rpx 0;
|
||||
}
|
||||
|
||||
.fee-label {
|
||||
font-size: 32rpx;
|
||||
color: #222222;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.fee-value {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.coupon-label-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14rpx;
|
||||
}
|
||||
|
||||
.coupon-red-icon {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
}
|
||||
|
||||
.fee-value.discount {
|
||||
color: #E02020;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.total-divider {
|
||||
border-top: 1rpx solid #F2F2F2;
|
||||
margin-top: 16rpx;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
|
||||
.total-label {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.total-val {
|
||||
font-size: 44rpx;
|
||||
font-weight: 800;
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.clickable-hover:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
</style>
|
||||
@@ -1,22 +1,22 @@
|
||||
<template>
|
||||
<view class="drawer-mask" v-if="visible" @tap="close">
|
||||
<view class="drawer-sheet" @tap.stop>
|
||||
<!-- 抽屉头部:「选择服务项目」+ 简练关闭图标 -->
|
||||
<!-- 抽屉头部:「选择商品」+ 简练关闭图标(参考 frame_008 1:1) -->
|
||||
<view class="drawer-head">
|
||||
<text class="dh-title">选择服务项目</text>
|
||||
<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>
|
||||
|
||||
<!-- 搜索栏:快速检索服务项目 -->
|
||||
<!-- 搜索栏:快速检索商品名称(参考 frame_008 1:1) -->
|
||||
<view class="drawer-search">
|
||||
<view class="ds-box">
|
||||
<image class="ds-icon-img" src="/static/icons/search-gray.svg" mode="aspectFit" />
|
||||
<input
|
||||
class="ds-input"
|
||||
v-model="keyword"
|
||||
placeholder="请输入项目或规格搜索"
|
||||
placeholder="请输入商品名称搜索"
|
||||
confirm-type="search"
|
||||
@confirm="onSearchConfirm"
|
||||
@input="onSearchInput"
|
||||
@@ -263,20 +263,34 @@
|
||||
.drawer-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
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-radius: 28rpx 28rpx 0 0;
|
||||
height: 75vh;
|
||||
height: 78vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 -8rpx 32rpx rgba(0, 0, 0, 0.08);
|
||||
animation: drawerSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
@keyframes drawerSlideUp {
|
||||
from { transform: translateY(100%); }
|
||||
to { transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* 抽屉头部 */
|
||||
@@ -284,13 +298,14 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 32rpx 32rpx 20rpx;
|
||||
padding: 34rpx 36rpx 20rpx;
|
||||
}
|
||||
|
||||
.dh-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #1F1F1F;
|
||||
color: #1A1A1A;
|
||||
letter-spacing: 0.5rpx;
|
||||
}
|
||||
|
||||
.dh-close {
|
||||
@@ -298,27 +313,27 @@
|
||||
height: 56rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.dh-close-img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
opacity: 0.45;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
/* 搜索栏 */
|
||||
.drawer-search {
|
||||
padding: 0 32rpx 22rpx;
|
||||
padding: 0 36rpx 24rpx;
|
||||
}
|
||||
|
||||
.ds-box {
|
||||
background: #F4F5F7;
|
||||
background: #F4F4F4;
|
||||
border-radius: 36rpx;
|
||||
height: 72rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 24rpx;
|
||||
padding: 0 26rpx;
|
||||
}
|
||||
|
||||
.ds-icon-img {
|
||||
@@ -331,7 +346,7 @@
|
||||
.ds-input {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #1F1F1F;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.ds-clear {
|
||||
@@ -353,13 +368,13 @@
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
border-top: 1rpx solid #F0F2F5;
|
||||
border-top: 1rpx solid #F0F0F0;
|
||||
}
|
||||
|
||||
/* 左侧:对应类目下的商品列表(浅灰底) */
|
||||
/* 左侧:对应类目下的商品列表(浅灰底,参考 frame_008) */
|
||||
.left-col {
|
||||
width: 220rpx;
|
||||
background: #F5F6F8;
|
||||
background: #F7F7F7;
|
||||
height: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -367,10 +382,12 @@
|
||||
.goods-item {
|
||||
padding: 32rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
color: #4A4A4A;
|
||||
text-align: left;
|
||||
background: transparent;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.goods-item.on {
|
||||
@@ -395,12 +412,12 @@
|
||||
color: #9CA3AF;
|
||||
}
|
||||
|
||||
/* 右侧:纯文本规格列表(纯白底) */
|
||||
/* 右侧:纯文本规格列表(纯白底,参考 frame_008) */
|
||||
.right-col {
|
||||
flex: 1;
|
||||
background: #FFFFFF;
|
||||
height: 100%;
|
||||
padding: 0 16rpx 0 32rpx;
|
||||
padding: 0 20rpx 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -437,20 +454,21 @@
|
||||
}
|
||||
|
||||
.spec-row {
|
||||
padding: 30rpx 16rpx;
|
||||
border-bottom: 1rpx solid #F8F9FA;
|
||||
padding: 32rpx 12rpx;
|
||||
border-bottom: 1rpx solid #F5F5F5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
transition: background 0.1s ease;
|
||||
}
|
||||
|
||||
.spec-row:active {
|
||||
background: #F9FAFB;
|
||||
background: #FAFAFA;
|
||||
}
|
||||
|
||||
.spec-text {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
line-height: 1.4;
|
||||
color: #222222;
|
||||
line-height: 1.45;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
<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="logistics-grid">
|
||||
<view
|
||||
class="logistics-card clickable-hover"
|
||||
v-for="name in companyList"
|
||||
:key="name"
|
||||
:class="{ active: currentName === name }"
|
||||
@tap="selectCompany(name)"
|
||||
>
|
||||
<text class="lc-name">{{ name }}</text>
|
||||
<view class="lc-dot-active" v-if="currentName === name">
|
||||
<image class="lc-check-icon" src="/static/icons/check-white.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({
|
||||
visible: { type: Boolean, default: false },
|
||||
currentName: { type: String, default: '' }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible', 'select']);
|
||||
|
||||
const companyList = [
|
||||
'顺丰速运',
|
||||
'德邦快递',
|
||||
'京东物流',
|
||||
'中通快递',
|
||||
'圆通速递',
|
||||
'申通快递',
|
||||
'韵达快递',
|
||||
'极兔速递',
|
||||
'跨越速运',
|
||||
'安能物流',
|
||||
'壹米滴答',
|
||||
'同城专线物流',
|
||||
'厂家专车配送',
|
||||
'送货上门无需物流'
|
||||
];
|
||||
|
||||
function selectCompany(name) {
|
||||
emit('select', name);
|
||||
close();
|
||||
}
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
</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: 580rpx;
|
||||
padding: 16rpx 0;
|
||||
}
|
||||
|
||||
.logistics-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.logistics-card {
|
||||
padding: 24rpx 16rpx;
|
||||
background: #F8F8F8;
|
||||
border: 2rpx solid transparent;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.logistics-card.active {
|
||||
background: #FFF8F2;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.lc-name {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.logistics-card.active .lc-name {
|
||||
color: #F0710D;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.lc-dot-active {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 32rpx;
|
||||
height: 28rpx;
|
||||
background: #F0710D;
|
||||
border-top-left-radius: 12rpx;
|
||||
border-bottom-right-radius: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.lc-check-icon {
|
||||
width: 18rpx;
|
||||
height: 18rpx;
|
||||
}
|
||||
|
||||
.clickable-hover:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,293 @@
|
||||
<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>
|
||||
|
||||
<!-- 选项内容(纯净精致卡片,无冗余文字说明) -->
|
||||
<view class="drawer-body">
|
||||
<!-- 选项 1:完工过相同的商品 -->
|
||||
<view class="demand-card clickable-hover" :class="{ active: reqSameGoods }" @tap="toggleSameGoods">
|
||||
<text class="demand-label">完工过相同的商品</text>
|
||||
<view class="custom-checkbox" :class="{ on: reqSameGoods }">
|
||||
<image class="check-img" v-if="reqSameGoods" src="/static/icons/check-white.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 选项 2:师傅评分不低于4.5分 -->
|
||||
<view class="demand-card clickable-hover" :class="{ active: reqHighRating }" @tap="reqHighRating = !reqHighRating">
|
||||
<text class="demand-label">师傅评分不低于4.5分</text>
|
||||
<view class="custom-checkbox" :class="{ on: reqHighRating }">
|
||||
<image class="check-img" v-if="reqHighRating" src="/static/icons/check-white.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 联动展开:自动匹配时长药丸 -->
|
||||
<view class="expand-box" v-if="reqSameGoods">
|
||||
<text class="expand-title">超时自动匹配时长</text>
|
||||
<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.6);
|
||||
backdrop-filter: blur(2px);
|
||||
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: 36rpx 36rpx calc(30rpx + 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: 24rpx;
|
||||
}
|
||||
|
||||
.dh-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.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 {
|
||||
padding: 10rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.demand-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 110rpx;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #F8F9FA;
|
||||
border: 2rpx solid transparent;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.demand-card.active {
|
||||
background: #FFF9F5;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.demand-label {
|
||||
font-size: 30rpx;
|
||||
color: #222222;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.demand-card.active .demand-label {
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.custom-checkbox {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #D1D5DB;
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.18s ease;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.custom-checkbox.on {
|
||||
background: #F0710D;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.check-img {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.expand-box {
|
||||
margin-top: 10rpx;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
.expand-title {
|
||||
display: block;
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #666666;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.timeout-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.timeout-pill {
|
||||
height: 76rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #F8F9FA;
|
||||
border: 2rpx solid transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.timeout-pill.active {
|
||||
background: #FFF9F5;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.tp-txt {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.timeout-pill.active .tp-txt {
|
||||
color: #F0710D;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.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>
|
||||
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view class="drawer-mask" v-if="visible" @tap="close">
|
||||
<view class="drawer-sheet" @tap.stop>
|
||||
<view class="sheet-menu">
|
||||
<view class="menu-item clickable-hover" @tap="chooseAction('album')">
|
||||
<text class="menu-txt">从相册中选择</text>
|
||||
</view>
|
||||
<view class="menu-item clickable-hover" @tap="chooseAction('camera')">
|
||||
<text class="menu-txt">拍照</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="menu-cancel clickable-hover" @tap="close">
|
||||
<text class="cancel-txt">取消</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({
|
||||
visible: { type: Boolean, default: false }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible', 'select']);
|
||||
|
||||
function chooseAction(type) {
|
||||
emit('select', type);
|
||||
close();
|
||||
}
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
animation: fadeIn 0.2s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.drawer-sheet {
|
||||
background: transparent;
|
||||
padding: 0 24rpx calc(24rpx + env(safe-area-inset-bottom));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
animation: slideUp 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from { transform: translateY(100%); }
|
||||
to { transform: translateY(0); }
|
||||
}
|
||||
|
||||
.sheet-menu {
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
height: 110rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-bottom: 1rpx solid #F3F4F6;
|
||||
}
|
||||
|
||||
.menu-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.menu-txt {
|
||||
font-size: 32rpx;
|
||||
color: #1F2937;
|
||||
}
|
||||
|
||||
.menu-cancel {
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
height: 104rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.cancel-txt {
|
||||
font-size: 32rpx;
|
||||
color: #6B7280;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.clickable-hover:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,248 @@
|
||||
<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>
|
||||
|
||||
<!-- 精致模式卡片(纯净无多余文字说明) -->
|
||||
<view class="drawer-body">
|
||||
<!-- 一口价下单 -->
|
||||
<view class="mode-card clickable-hover" :class="{ active: currentMode === 'fixed' }" @tap="select('fixed')">
|
||||
<view class="mc-left">
|
||||
<view class="mc-icon-wrap">
|
||||
<image class="mc-icon" src="/static/icons/mode-coin.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="mc-title">一口价下单</text>
|
||||
</view>
|
||||
<view class="mc-radio" :class="{ on: currentMode === 'fixed' }">
|
||||
<image class="check-icon" v-if="currentMode === 'fixed'" src="/static/icons/check-white.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 报价下单 -->
|
||||
<view class="mode-card clickable-hover" :class="{ active: currentMode === 'quote' }" @tap="select('quote')">
|
||||
<view class="mc-left">
|
||||
<view class="mc-icon-wrap">
|
||||
<image class="mc-icon" src="/static/icons/order-active.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="mc-title">师傅报价下单</text>
|
||||
</view>
|
||||
<view class="mc-radio" :class="{ on: currentMode === 'quote' }">
|
||||
<image class="check-icon" v-if="currentMode === 'quote'" src="/static/icons/check-white.svg" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 自己定价 -->
|
||||
<view class="mode-card clickable-hover" :class="{ active: currentMode === 'custom' }" @tap="select('custom')">
|
||||
<view class="mc-left">
|
||||
<view class="mc-icon-wrap">
|
||||
<image class="mc-icon" src="/static/icons/role-switch.svg" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="mc-title">自己定价下单</text>
|
||||
</view>
|
||||
<view class="mc-radio" :class="{ on: currentMode === 'custom' }">
|
||||
<image class="check-icon" v-if="currentMode === 'custom'" src="/static/icons/check-white.svg" mode="aspectFit" />
|
||||
</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.6);
|
||||
backdrop-filter: blur(2px);
|
||||
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: 36rpx 36rpx calc(30rpx + 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: 24rpx;
|
||||
}
|
||||
|
||||
.dh-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.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 {
|
||||
padding: 10rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.mode-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 110rpx;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #F8F9FA;
|
||||
border: 2rpx solid transparent;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.mode-card.active {
|
||||
background: #FFF9F5;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.mc-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.mc-icon-wrap {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.mc-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.mc-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.mode-card.active .mc-title {
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.mc-radio {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #D1D5DB;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #FFFFFF;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.mc-radio.on {
|
||||
background: #F0710D;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.check-icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
.drawer-foot {
|
||||
padding-top: 36rpx;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
height: 88rpx;
|
||||
background: #F4F5F7;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.15s ease, transform 0.1s ease;
|
||||
}
|
||||
|
||||
.cancel-btn:active {
|
||||
background: #E5E7EB;
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
.cancel-txt {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #4B5563;
|
||||
}
|
||||
|
||||
.clickable-hover:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,246 @@
|
||||
<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>
|
||||
@@ -0,0 +1,262 @@
|
||||
<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>
|
||||
|
||||
<!-- 精致选项卡片列表(纯净无多余文字说明) -->
|
||||
<view class="drawer-body">
|
||||
<view
|
||||
class="type-card clickable-hover"
|
||||
v-for="item in displayList"
|
||||
:key="item.code"
|
||||
:class="{ active: selectedCode === item.code }"
|
||||
@tap="selectItem(item)"
|
||||
>
|
||||
<view class="tc-left">
|
||||
<view class="tc-icon-wrap">
|
||||
<image class="tc-icon" :src="getServiceIcon(item.code)" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="tc-name">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="tc-radio" :class="{ on: selectedCode === item.code }">
|
||||
<image class="check-icon" v-if="selectedCode === item.code" src="/static/icons/check-white.svg" mode="aspectFit" />
|
||||
</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, computed, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
visible: { type: Boolean, default: false },
|
||||
list: { type: Array, default: () => [] },
|
||||
currentCode: { type: String, default: 'install' }
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:visible', 'confirm']);
|
||||
|
||||
const defaultTypes = [
|
||||
{ code: 'install', name: '安装', price: 60, unit: '件' },
|
||||
{ code: 'repair', name: '维修', price: 40, unit: '次' },
|
||||
{ code: 'remove', name: '拆旧', price: 30, unit: '件' }
|
||||
];
|
||||
|
||||
const displayList = computed(() => {
|
||||
return props.list && props.list.length ? props.list : defaultTypes;
|
||||
});
|
||||
|
||||
const selectedCode = ref(props.currentCode);
|
||||
|
||||
watch(() => props.currentCode, (v) => {
|
||||
selectedCode.value = v;
|
||||
});
|
||||
|
||||
watch(() => props.visible, (v) => {
|
||||
if (v) selectedCode.value = props.currentCode;
|
||||
});
|
||||
|
||||
function getServiceIcon(code) {
|
||||
if (code === 'repair') return '/static/icons/scene-repair.svg';
|
||||
if (code === 'remove' || code === 'tear') return '/static/icons/scene-tear.svg';
|
||||
return '/static/icons/scene-install.svg';
|
||||
}
|
||||
|
||||
function selectItem(item) {
|
||||
selectedCode.value = item.code;
|
||||
}
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
|
||||
function handleConfirm() {
|
||||
const hit = displayList.value.find(item => item.code === selectedCode.value) || displayList.value[0];
|
||||
emit('confirm', hit);
|
||||
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.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: 36rpx 36rpx calc(30rpx + 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: 24rpx;
|
||||
}
|
||||
|
||||
.dh-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
}
|
||||
|
||||
.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 {
|
||||
padding: 10rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.type-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 110rpx;
|
||||
padding: 0 28rpx;
|
||||
border-radius: 16rpx;
|
||||
background: #F8F9FA;
|
||||
border: 2rpx solid transparent;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.type-card.active {
|
||||
background: #FFF9F5;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.tc-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.tc-icon-wrap {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: 12rpx;
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.tc-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.tc-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
.type-card.active .tc-name {
|
||||
color: #F0710D;
|
||||
}
|
||||
|
||||
.tc-radio {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #D1D5DB;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #FFFFFF;
|
||||
transition: all 0.18s ease;
|
||||
}
|
||||
|
||||
.tc-radio.on {
|
||||
background: #F0710D;
|
||||
border-color: #F0710D;
|
||||
}
|
||||
|
||||
.check-icon {
|
||||
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>
|
||||
在新工单中引用
屏蔽一个用户