- 新增师傅端路由和页面配置,切换登录后默认跳转到师傅大厅 - 新增服务分类图标上传功能和增项服务管理模块 - 新增订单、申诉、结算等模型关联关系及后台控制器 - 新增师傅端TabBar组件和消息页面跳转逻辑 - 新增文件上传接口和服务计算逻辑 - 新增各类SVG图标和空状态提示
1725 行
46 KiB
Vue
1725 行
46 KiB
Vue
<template>
|
||
<view class="page">
|
||
<!-- 自定义顶部导航栏 -->
|
||
<view class="nav-header" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||
<view class="nav-bar" :style="{ height: navBarHeight + 'px' }">
|
||
<view class="nav-back clickable-hover" @tap="handleBack">
|
||
<image class="back-icon" src="/static/icons/arrow-right.svg" mode="aspectFit" style="transform: rotate(180deg);" />
|
||
</view>
|
||
<view class="nav-title">
|
||
<text class="title-txt">快速下单</text>
|
||
</view>
|
||
<view class="nav-right"></view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="main-body">
|
||
<!-- ==================== 顶部常驻双行卡片(参考图 1 1:1 精致还原,去除营销牛皮癣) ==================== -->
|
||
<view class="top-service-card">
|
||
<!-- 第 1 行:当前服务类目 -->
|
||
<view class="tsc-row">
|
||
<view class="tsc-left">
|
||
<view class="tsc-icon-wrap">
|
||
<image class="tsc-img" :src="currentCatIconUrl || ('/static/icons/' + (currentCatIcon || 'bath') + '.png')" mode="aspectFit" />
|
||
</view>
|
||
<text class="tsc-title">{{ drawerCatName || '卫浴' }}</text>
|
||
</view>
|
||
<view class="tsc-btn clickable-hover" @tap="goToSelectCategory">
|
||
<text class="tsc-btn-txt">重新选择类目</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 第 2 行:当前下单模式 -->
|
||
<view class="tsc-row no-border">
|
||
<view class="tsc-left">
|
||
<view class="tsc-icon-wrap">
|
||
<image class="tsc-img" src="/static/icons/mode-coin.svg" mode="aspectFit" />
|
||
</view>
|
||
<text class="tsc-title">{{ currentModeName }}</text>
|
||
</view>
|
||
<view class="tsc-btn clickable-hover" @tap="showModePickerModal = true">
|
||
<text class="tsc-btn-txt">重新选择下单模式</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 自主定价时的快捷出价输入框 -->
|
||
<view class="custom-price-bar" v-if="priceType === 'custom'">
|
||
<text class="cpb-label">我的意向出价:</text>
|
||
<view class="cpb-input-wrap">
|
||
<text class="cpb-currency">¥</text>
|
||
<input class="cpb-input" type="digit" v-model="userPrice" placeholder="请输入您的出价金额" @input="scheduleCalc" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 商品信息列表(支持多组,大行高、大字阶) ==================== -->
|
||
<view class="group-list">
|
||
<view class="group-card" v-for="(g, idx) in goodsList" :key="idx">
|
||
<!-- 组头部 -->
|
||
<view class="gc-head">
|
||
<text class="gc-title">商品信息</text>
|
||
<view class="gc-meta">
|
||
<text class="gc-group-num">第 {{ idx + 1 }} 组</text>
|
||
<view class="gc-del-btn clickable-hover" v-if="goodsList.length > 1" @tap="removeGroup(idx)">
|
||
<image class="gc-trash-img" src="/static/icons/trash.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 并排 3 个宽阔虚线框(图片、视频、环境图) -->
|
||
<view class="media-upload-row">
|
||
<!-- 1. 添加图片 -->
|
||
<view class="dash-card pic-dash clickable-hover" @tap="pickImgSource(idx)">
|
||
<image class="dc-icon" src="/static/icons/add-img.svg" mode="aspectFit" />
|
||
<text class="dc-txt orange">*添加图片</text>
|
||
</view>
|
||
|
||
<!-- 2. 安装视频 -->
|
||
<view class="dash-card video-dash clickable-hover" @tap="pickVideo(idx)">
|
||
<image class="dc-icon" src="/static/icons/add-video.svg" mode="aspectFit" />
|
||
<text class="dc-txt gray">安装视频</text>
|
||
<text class="dc-sub gray">(选填)</text>
|
||
</view>
|
||
|
||
<!-- 3. 安装环境图 -->
|
||
<view class="dash-card env-dash clickable-hover" @tap="pickEnvImage(idx)">
|
||
<image class="dc-icon" src="/static/icons/add-env.svg" mode="aspectFit" />
|
||
<text class="dc-txt gray">安装环境图</text>
|
||
<text class="dc-sub gray">(选填)</text>
|
||
</view>
|
||
|
||
<!-- 4. 说明问号 -->
|
||
<view class="env-help-box clickable-hover" @tap="showEnvHelp">
|
||
<image class="eh-icon" src="/static/icons/info-orange.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 已上传媒体回显 -->
|
||
<view class="media-preview-area" v-if="(g.images && g.images.length) || (g.videos && g.videos.length) || (g.envImages && g.envImages.length)">
|
||
<view class="mp-section" v-if="g.images && g.images.length">
|
||
<text class="mp-tag">商品照片 ({{ g.images.length }}):</text>
|
||
<view class="mp-thumbs">
|
||
<view class="mp-thumb-item" v-for="(img, iIdx) in g.images" :key="'img-' + iIdx">
|
||
<image class="mp-img" :src="img" mode="aspectFill" @tap="previewImg(g.images, iIdx)" />
|
||
<view class="mp-del-btn" @tap.stop="removeGroupImg(idx, iIdx)">×</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="mp-section" v-if="g.videos && g.videos.length">
|
||
<text class="mp-tag">安装视频 ({{ g.videos.length }}):</text>
|
||
<view class="mp-thumbs">
|
||
<view class="mp-thumb-item video-item" v-for="(v, vIdx) in g.videos" :key="'v-' + vIdx">
|
||
<image class="mp-img" :src="v.thumbTempFilePath || '/static/icons/add-video.svg'" mode="aspectFill" />
|
||
<view class="mp-play-badge">
|
||
<image class="mp-play-icon" src="/static/icons/play-white.svg" mode="aspectFit" />
|
||
</view>
|
||
<view class="mp-del-btn" @tap.stop="removeGroupVideo(idx, vIdx)">×</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="mp-section" v-if="g.envImages && g.envImages.length">
|
||
<text class="mp-tag">环境照片 ({{ g.envImages.length }}):</text>
|
||
<view class="mp-thumbs">
|
||
<view class="mp-thumb-item" v-for="(eimg, eIdx) in g.envImages" :key="'env-' + eIdx">
|
||
<image class="mp-img" :src="eimg" mode="aspectFill" @tap="previewImg(g.envImages, eIdx)" />
|
||
<view class="mp-del-btn" @tap.stop="removeGroupEnvImg(idx, eIdx)">×</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 核心舒展大表单项列表(行高 108rpx,字号 30rpx) -->
|
||
<view class="form-item-list">
|
||
<!-- ① 选择商品 -->
|
||
<view class="form-row clickable-hover" @tap="openDrawerForGroup(idx)">
|
||
<view class="fr-label">
|
||
<text class="req-star">*</text>
|
||
<text class="label-txt">选择商品</text>
|
||
</view>
|
||
<view class="fr-value-box">
|
||
<text class="val-txt" :class="{ placeholder: !g.item_name }">
|
||
{{ g.item_name ? (g.item_name + (g.spec_name ? '(' + g.spec_name + ')' : '')) : '点击选择品类规格' }}
|
||
</text>
|
||
<image class="fr-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ② 工项类型 -->
|
||
<view class="form-row">
|
||
<view class="fr-label">
|
||
<text class="req-star">*</text>
|
||
<text class="label-txt">工项类型</text>
|
||
</view>
|
||
<view class="fr-type-tabs">
|
||
<view
|
||
v-for="st in (g.service_types && g.service_types.length ? g.service_types : defaultServiceTypes)"
|
||
:key="st.code"
|
||
class="type-tab-item clickable-hover"
|
||
:class="{ on: g.service_type === st.code }"
|
||
@tap="selectServiceType(g, st)"
|
||
>{{ st.name }}</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ③ 商品数量 -->
|
||
<view class="form-row">
|
||
<view class="fr-label">
|
||
<text class="req-star">*</text>
|
||
<text class="label-txt">商品数量</text>
|
||
</view>
|
||
<view class="fr-stepper">
|
||
<view class="step-btn step-minus clickable-hover" @tap="stepGroupNum(idx, -1)">-</view>
|
||
<view class="step-num-box">{{ g.num }}</view>
|
||
<view class="step-btn step-plus clickable-hover" @tap="stepGroupNum(idx, 1)">+</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ④ 增项工序(拆旧/切割等) -->
|
||
<view class="form-row clickable-hover" @tap="openAddonPopup(idx)">
|
||
<view class="fr-label">
|
||
<text class="label-txt no-star">增项工序</text>
|
||
</view>
|
||
<view class="fr-value-box">
|
||
<text class="val-txt" :class="{ highlight: hasAddons(g) }">
|
||
{{ addonSummary(g) }}
|
||
</text>
|
||
<image class="fr-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ⑤ 备注说明 -->
|
||
<view class="form-row no-border">
|
||
<view class="fr-label">
|
||
<text class="label-txt no-star">备注说明</text>
|
||
</view>
|
||
<view class="fr-value-box">
|
||
<input class="fr-input" v-model="g.remark" placeholder="如有特殊要求请在此备注(选填)" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 继续添加更多组按钮 -->
|
||
<view class="add-group-btn clickable-hover" @tap="openDrawer(false)">
|
||
<text class="agb-txt">+ 添加服务项 / 组合商品</text>
|
||
</view>
|
||
|
||
<!-- ==================== 服务地址与预约时间(一站式自然下划) ==================== -->
|
||
<view class="addr-box-card">
|
||
<view class="abc-head">
|
||
<text class="abc-title">服务地址</text>
|
||
<view class="abc-actions">
|
||
<text class="abc-action-btn clickable-hover" @tap="importWxAddress">导入微信地址</text>
|
||
<text class="abc-action-divider">|</text>
|
||
<text class="abc-action-btn clickable-hover" @tap="openAddressBook">地址簿</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 智能地址粘贴快速解析 -->
|
||
<view class="paste-parse-bar clickable-hover" @tap="showParsePopup = true">
|
||
<image class="ppb-icon" src="/static/icons/scan-paste.svg" mode="aspectFit" />
|
||
<text class="ppb-txt">智能粘贴识别姓名、电话与地址</text>
|
||
<text class="ppb-badge">快速粘贴</text>
|
||
</view>
|
||
|
||
<view class="form-inputs-group">
|
||
<view class="fi-row">
|
||
<text class="fi-label">联系姓名</text>
|
||
<input class="fi-input" v-model="form.contact" placeholder="联系人姓名" />
|
||
</view>
|
||
<view class="fi-row">
|
||
<text class="fi-label">手机号码</text>
|
||
<input class="fi-input" type="number" maxlength="11" v-model="form.mobile" placeholder="联系手机号" />
|
||
</view>
|
||
<view class="fi-row">
|
||
<text class="fi-label">详细地址</text>
|
||
<input class="fi-input" v-model="form.address" placeholder="详细门牌号、楼栋房号" />
|
||
</view>
|
||
<view class="fi-row no-border">
|
||
<text class="fi-label">楼层电梯</text>
|
||
<view class="fi-radio-group">
|
||
<view class="fi-radio clickable-hover" :class="{ on: form.has_elevator === 1 }" @tap="form.has_elevator = 1">
|
||
<view class="rd-dot" v-if="form.has_elevator === 1"></view>
|
||
<text class="rd-txt">有电梯</text>
|
||
</view>
|
||
<view class="fi-radio clickable-hover" :class="{ on: form.has_elevator === 0 }" @tap="form.has_elevator = 0">
|
||
<view class="rd-dot" v-if="form.has_elevator === 0"></view>
|
||
<text class="rd-txt">无电梯(步梯)</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 期望上门时间卡片 -->
|
||
<view class="appoint-card">
|
||
<view class="ac-head">
|
||
<text class="ac-title">期望上门时间</text>
|
||
</view>
|
||
<view class="ac-row">
|
||
<picker mode="date" :value="appointDate" :start="today" @change="onDateChange">
|
||
<view class="ac-picker-btn clickable-hover">
|
||
<text class="ap-txt">{{ appointDate }}</text>
|
||
<image class="ap-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||
</view>
|
||
</picker>
|
||
<picker mode="selector" :range="timeSlots" @change="onTimeSlotChange">
|
||
<view class="ac-picker-btn clickable-hover">
|
||
<text class="ap-txt">{{ appointSlot }}</text>
|
||
<image class="ap-arrow" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||
</view>
|
||
</picker>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 吸底结算栏(一站式直接下单) ==================== -->
|
||
<view class="bottom-action-bar">
|
||
<view class="bab-info">
|
||
<text class="bab-label">{{ priceType === 'quote' ? '参考基准:' : (priceType === 'custom' ? '意向出价:' : '合计金额:') }}</text>
|
||
<text class="bab-price">¥{{ priceType === 'custom' ? (userPrice || '0') : (amount ? amount.pay_amount : '90') }}</text>
|
||
<text class="bab-sub-hint" v-if="priceType === 'quote'"> (以师傅竞价为准)</text>
|
||
</view>
|
||
<view class="bab-btn-main clickable-hover" :class="{ disabled: submitting, quote: priceType === 'quote', custom: priceType === 'custom' }" @tap="confirmSubmitAndPay">
|
||
<text class="bbm-txt">{{ submitting ? '提交中...' : (priceType === 'quote' ? '发布竞价单' : (priceType === 'custom' ? '按出价下单' : '立即下单')) }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 参考图 2 1:1 精确复刻:“请选择下单模式”半屏弹窗 ==================== -->
|
||
<view class="mode-modal-mask" v-if="showModePickerModal" @tap="showModePickerModal = false">
|
||
<view class="mode-modal-card" @tap.stop>
|
||
<view class="mm-header">
|
||
<text class="mm-title">请选择下单模式</text>
|
||
<view class="mm-close-btn clickable-hover" @tap="showModePickerModal = false">
|
||
<image class="mm-close-icon" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 3 大模式卡片(白底、橙色圆角边框、左右布局) -->
|
||
<view class="mm-card-list">
|
||
<!-- 模式 1:一口价下单 -->
|
||
<view class="mm-item-card clickable-hover" :class="{ active: priceType === 'fixed' }" @tap="selectMode('fixed')">
|
||
<view class="mm-content-row">
|
||
<view class="mm-info">
|
||
<text class="mm-item-title">全国统一参考价,成本可控</text>
|
||
<text class="mm-item-desc">支付后,师傅立即接单预约客户上门服务</text>
|
||
</view>
|
||
<view class="mm-action-btn">
|
||
<text class="mab-txt">一口价下单</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 模式 2:报价下单 -->
|
||
<view class="mm-item-card clickable-hover" :class="{ active: priceType === 'quote' }" @tap="selectMode('quote')">
|
||
<view class="mm-content-row">
|
||
<view class="mm-info">
|
||
<text class="mm-item-title">多个师傅报价,择优选择</text>
|
||
<text class="mm-item-desc">免费发布,选定师傅支付,师傅上门服务</text>
|
||
</view>
|
||
<view class="mm-action-btn">
|
||
<text class="mab-txt">报价下单</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 模式 3:自己定价 -->
|
||
<view class="mm-item-card clickable-hover" :class="{ active: priceType === 'custom' }" @tap="selectMode('custom')">
|
||
<view class="mm-content-row">
|
||
<view class="mm-info">
|
||
<text class="mm-item-title">价格自己定,更省钱</text>
|
||
<text class="mm-item-desc">支付后,师傅立即接单预约客户上门服务</text>
|
||
</view>
|
||
<view class="mm-action-btn">
|
||
<text class="mab-txt">自己定价</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 底部大取消按钮(橙色实心药丸) -->
|
||
<view class="mm-cancel-btn clickable-hover" @tap="showModePickerModal = false">
|
||
<text class="mcb-txt">取消</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 智能地址剪贴板解析弹窗 -->
|
||
<view class="mode-modal-mask" v-if="showParsePopup" @tap="showParsePopup = false">
|
||
<view class="parse-popup-card" @tap.stop>
|
||
<view class="pp-title">智能地址快速解析</view>
|
||
<textarea class="pp-textarea" v-model="rawAddressText" placeholder="粘贴整段地址,例如:李四,13900139000,贵州省贵阳市南明区花果园1期1栋" />
|
||
<view class="pp-btns">
|
||
<view class="pp-btn paste-btn clickable-hover" @tap="pasteFromClipboard">读取剪贴板</view>
|
||
<view class="pp-btn parse-btn clickable-hover" @tap="executeParseAddress">确定识别</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 增项服务弹窗 -->
|
||
<view class="mode-modal-mask" v-if="showAddonModal" @tap="showAddonModal = false">
|
||
<view class="addon-modal-card" @tap.stop>
|
||
<view class="am-title">选择增项服务</view>
|
||
<view class="am-list">
|
||
<view class="am-item" v-for="(ex, exIdx) in currentEditingAddons" :key="ex.key">
|
||
<view class="am-info">
|
||
<text class="am-name">{{ ex.name }}</text>
|
||
<text class="am-price">¥{{ ex.price }} / {{ ex.unit || '项' }}</text>
|
||
</view>
|
||
<view class="am-stepper">
|
||
<view class="step-btn" @tap="ex.num = Math.max(0, ex.num - 1)">-</view>
|
||
<text class="step-num-box">{{ ex.num }}</text>
|
||
<view class="step-btn" @tap="ex.num = ex.num + 1">+</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="am-confirm-btn clickable-hover" @tap="saveAddonModal">确定</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 商品规格选择抽屉 -->
|
||
<GoodsPickerDrawer
|
||
:visible="showDrawer"
|
||
:cat-id="drawerCatId"
|
||
:cat-name="drawerCatName"
|
||
@update:visible="showDrawer = $event"
|
||
@select="handleDrawerSelect"
|
||
@custom="showDrawer = false"
|
||
/>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, reactive, computed } from 'vue';
|
||
import GoodsPickerDrawer from '@/components/GoodsPickerDrawer.vue';
|
||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||
import api from '@/utils/api.js';
|
||
import { isLogin, toLogin } from '@/utils/request.js';
|
||
|
||
// 状态栏与导航栏高度
|
||
const statusBarHeight = ref(20);
|
||
const navBarHeight = ref(44);
|
||
|
||
try {
|
||
const info = uni.getSystemInfoSync();
|
||
if (info && info.statusBarHeight) statusBarHeight.value = info.statusBarHeight;
|
||
if (typeof uni.getMenuButtonBoundingClientRect === 'function') {
|
||
const menu = uni.getMenuButtonBoundingClientRect();
|
||
if (menu && menu.height) navBarHeight.value = (menu.top - statusBarHeight.value) * 2 + menu.height;
|
||
}
|
||
} catch (e) {}
|
||
|
||
function handleBack() {
|
||
uni.navigateBack();
|
||
}
|
||
|
||
// 计价模式
|
||
const priceType = ref('fixed');
|
||
const userPrice = ref('');
|
||
const showModePickerModal = ref(false);
|
||
|
||
const currentModeName = computed(() => {
|
||
if (priceType.value === 'quote') return '师傅报价下单';
|
||
if (priceType.value === 'custom') return '自己定价下单';
|
||
return '一口价下单';
|
||
});
|
||
|
||
function selectMode(key) {
|
||
priceType.value = key;
|
||
showModePickerModal.value = false;
|
||
scheduleCalc();
|
||
}
|
||
|
||
// 当前类目
|
||
const drawerCatId = ref(0);
|
||
const drawerCatName = ref('');
|
||
const currentCatIcon = ref('bath');
|
||
const currentCatIconUrl = ref('');
|
||
const defaultServiceTypes = [
|
||
{ code: 'install', name: '安装', price: 60 },
|
||
{ code: 'repair', name: '维修', price: 40 },
|
||
{ code: 'remove', name: '拆旧', price: 30 }
|
||
];
|
||
|
||
function selectServiceType(group, type) {
|
||
group.service_type = type.code;
|
||
group.service_type_name = type.name;
|
||
if (type.price > 0) {
|
||
group.base_price = Number(type.price);
|
||
}
|
||
scheduleCalc();
|
||
}
|
||
|
||
function goToSelectCategory() {
|
||
uni.navigateTo({ url: '/pages/category/category' });
|
||
}
|
||
|
||
// 核心多商品组合数据结构(完全由后端真实服务数据填充)
|
||
const goodsList = ref([
|
||
{
|
||
service_id: 0,
|
||
item_name: '',
|
||
spec_name: '',
|
||
cat_id: 0,
|
||
cat_name: '',
|
||
unit: '件',
|
||
base_price: 0,
|
||
num: 1,
|
||
service_type: 'install',
|
||
remark: '',
|
||
images: [],
|
||
videos: [],
|
||
envImages: [],
|
||
extras: [
|
||
{ key: 'tear', name: '拆旧拆卸', price: 50, num: 0 },
|
||
{ key: 'cut', name: '管路开孔打孔', price: 20, num: 0 }
|
||
]
|
||
}
|
||
]);
|
||
|
||
function stepGroupNum(idx, d) {
|
||
goodsList.value[idx].num = Math.max(1, goodsList.value[idx].num + d);
|
||
scheduleCalc();
|
||
}
|
||
|
||
function removeGroup(idx) {
|
||
if (goodsList.value.length <= 1) return;
|
||
goodsList.value.splice(idx, 1);
|
||
scheduleCalc();
|
||
}
|
||
|
||
// 抽屉选择
|
||
const showDrawer = ref(false);
|
||
const editingGroupIndex = ref(0);
|
||
const isEditingGroup = ref(false);
|
||
|
||
function openDrawer(isEdit = false) {
|
||
isEditingGroup.value = isEdit;
|
||
showDrawer.value = true;
|
||
}
|
||
|
||
function openDrawerForGroup(idx) {
|
||
editingGroupIndex.value = idx;
|
||
drawerCatId.value = goodsList.value[idx]?.cat_id || drawerCatId.value;
|
||
drawerCatName.value = goodsList.value[idx]?.cat_name || drawerCatName.value;
|
||
openDrawer(true);
|
||
}
|
||
|
||
function handleDrawerSelect(spec) {
|
||
const rawAddons = spec.addons && spec.addons.length ? spec.addons : [];
|
||
const extras = rawAddons.map(ad => ({
|
||
id: ad.id,
|
||
key: 'addon_' + ad.id,
|
||
name: ad.name,
|
||
unit: ad.unit || '个',
|
||
price: Number(ad.price) || 0,
|
||
num: 0
|
||
}));
|
||
|
||
const serviceTypes = spec.service_types && spec.service_types.length ? spec.service_types : [
|
||
{ code: 'install', name: '安装', price: Number(spec.base_price) || 0, is_default: 1 },
|
||
{ code: 'repair', name: '维修', price: Math.round((Number(spec.base_price) || 0) * 0.7), is_default: 0 },
|
||
{ code: 'remove', name: '拆旧', price: Math.round((Number(spec.base_price) || 0) * 0.5), is_default: 0 }
|
||
];
|
||
const defType = serviceTypes.find(st => st.is_default) || serviceTypes[0];
|
||
|
||
const newGroup = {
|
||
service_id: spec.service_id,
|
||
item_name: spec.item_name,
|
||
spec_name: spec.spec_name,
|
||
cat_id: spec.cat_id || drawerCatId.value,
|
||
cat_name: spec.cat_name || drawerCatName.value,
|
||
unit: spec.unit || '件',
|
||
base_price: Number(spec.base_price) || Number(defType.price) || 0,
|
||
num: 1,
|
||
service_type: defType.code,
|
||
service_type_name: defType.name,
|
||
service_types: serviceTypes,
|
||
remark: '',
|
||
images: [],
|
||
videos: [],
|
||
envImages: [],
|
||
extras: extras
|
||
};
|
||
|
||
if (isEditingGroup.value) {
|
||
goodsList.value[editingGroupIndex.value] = { ...goodsList.value[editingGroupIndex.value], ...newGroup };
|
||
} else {
|
||
goodsList.value.push(newGroup);
|
||
}
|
||
if (spec.cat_id) drawerCatId.value = spec.cat_id;
|
||
if (spec.cat_name) drawerCatName.value = spec.cat_name;
|
||
scheduleCalc();
|
||
}
|
||
|
||
// 增项服务弹窗
|
||
const showAddonModal = ref(false);
|
||
const currentEditingAddons = ref([]);
|
||
|
||
function openAddonPopup(idx) {
|
||
editingGroupIndex.value = idx;
|
||
currentEditingAddons.value = JSON.parse(JSON.stringify(goodsList.value[idx].extras || []));
|
||
showAddonModal.value = true;
|
||
}
|
||
|
||
function saveAddonModal() {
|
||
goodsList.value[editingGroupIndex.value].extras = currentEditingAddons.value;
|
||
showAddonModal.value = false;
|
||
scheduleCalc();
|
||
}
|
||
|
||
function hasAddons(g) {
|
||
return g.extras && g.extras.some(ex => ex.num > 0);
|
||
}
|
||
|
||
function addonSummary(g) {
|
||
if (!g.extras) return '点击选择增项';
|
||
const hits = g.extras.filter(ex => ex.num > 0).map(ex => `${ex.name}x${ex.num}`);
|
||
return hits.length ? hits.join(';') : '点击选择拆旧/打孔';
|
||
}
|
||
|
||
// 媒体上传
|
||
function pickImgSource(groupIdx) {
|
||
uni.chooseImage({
|
||
count: 4,
|
||
success: (res) => { goodsList.value[groupIdx].images.push(...res.tempFilePaths); }
|
||
});
|
||
}
|
||
|
||
function removeGroupImg(gIdx, iIdx) {
|
||
goodsList.value[gIdx].images.splice(iIdx, 1);
|
||
}
|
||
|
||
function previewImg(list, idx) {
|
||
uni.previewImage({ urls: list, current: list[idx] });
|
||
}
|
||
|
||
function pickVideo(idx) {
|
||
uni.chooseVideo({
|
||
sourceType: ['album', 'camera'],
|
||
maxDuration: 60,
|
||
camera: 'back',
|
||
success: (res) => {
|
||
if (!goodsList.value[idx].videos) goodsList.value[idx].videos = [];
|
||
goodsList.value[idx].videos.push({
|
||
tempFilePath: res.tempFilePath,
|
||
thumbTempFilePath: res.thumbTempFilePath || ''
|
||
});
|
||
}
|
||
});
|
||
}
|
||
|
||
function removeGroupVideo(gIdx, vIdx) {
|
||
goodsList.value[gIdx].videos.splice(vIdx, 1);
|
||
}
|
||
|
||
function pickEnvImage(idx) {
|
||
uni.chooseImage({
|
||
count: 3,
|
||
success: (res) => {
|
||
if (!goodsList.value[idx].envImages) goodsList.value[idx].envImages = [];
|
||
goodsList.value[idx].envImages.push(...res.tempFilePaths);
|
||
}
|
||
});
|
||
}
|
||
|
||
function removeGroupEnvImg(gIdx, eIdx) {
|
||
goodsList.value[gIdx].envImages.splice(eIdx, 1);
|
||
}
|
||
|
||
function showEnvHelp() {
|
||
uni.showModal({
|
||
title: '安装环境图说明',
|
||
content: '请拍摄安装位置周围环境、墙体材质及水电管路,以便师傅提前备齐辅料配件。',
|
||
showCancel: false,
|
||
confirmText: '我知道了',
|
||
confirmColor: '#F0710D'
|
||
});
|
||
}
|
||
|
||
// 地址与预约时间
|
||
const form = reactive({
|
||
contact: '',
|
||
mobile: '',
|
||
province: '贵州省',
|
||
city: '贵阳市',
|
||
district: '南明区',
|
||
address: '',
|
||
floor: 1,
|
||
has_elevator: 1
|
||
});
|
||
|
||
const today = new Date().toISOString().slice(0, 10);
|
||
const appointDate = ref(today);
|
||
const timeSlots = ['上午 (09:00 - 12:00)', '下午 (13:00 - 18:00)', '晚上 (18:00 - 21:00)', '全天随时上门'];
|
||
const appointSlot = ref(timeSlots[1]);
|
||
|
||
function onDateChange(e) { appointDate.value = e.detail.value; }
|
||
function onTimeSlotChange(e) { appointSlot.value = timeSlots[e.detail.value]; }
|
||
|
||
const amount = ref(null);
|
||
let calcTimer = null;
|
||
|
||
async function calc() {
|
||
try {
|
||
const res = await api.calc({
|
||
price_type: priceType.value,
|
||
user_price: Number(userPrice.value) || 0,
|
||
floor: form.floor,
|
||
has_elevator: form.has_elevator,
|
||
goods_list: JSON.stringify(goodsList.value)
|
||
});
|
||
amount.value = res;
|
||
} catch (e) {}
|
||
}
|
||
|
||
function scheduleCalc() {
|
||
clearTimeout(calcTimer);
|
||
calcTimer = setTimeout(calc, 250);
|
||
}
|
||
|
||
// 地址导入
|
||
function importWxAddress() {
|
||
// #ifdef MP-WEIXIN
|
||
uni.chooseAddress({
|
||
success: (res) => {
|
||
form.contact = res.userName;
|
||
form.mobile = res.telNumber;
|
||
form.province = res.provinceName;
|
||
form.city = res.cityName;
|
||
form.district = res.countyName;
|
||
form.address = res.detailInfo;
|
||
uni.showToast({ title: '地址已导入' });
|
||
scheduleCalc();
|
||
}
|
||
});
|
||
// #endif
|
||
}
|
||
|
||
async function openAddressBook() {
|
||
try {
|
||
const res = await api.addressList();
|
||
const list = res.list || [];
|
||
if (!list.length) {
|
||
uni.showToast({ title: '暂无保存的地址', icon: 'none' });
|
||
return;
|
||
}
|
||
uni.showActionSheet({
|
||
itemList: list.map(a => `${a.contact} (${a.city}${a.district}${a.address})`.slice(0, 20)),
|
||
success: (r) => {
|
||
const hit = list[r.tapIndex];
|
||
if (hit) {
|
||
form.contact = hit.contact;
|
||
form.mobile = hit.mobile;
|
||
form.province = hit.province;
|
||
form.city = hit.city;
|
||
form.district = hit.district;
|
||
form.address = hit.address;
|
||
form.floor = Number(hit.floor) || 1;
|
||
form.has_elevator = Number(hit.has_elevator) || 1;
|
||
scheduleCalc();
|
||
}
|
||
}
|
||
});
|
||
} catch (e) {}
|
||
}
|
||
|
||
// 智能解析
|
||
const showParsePopup = ref(false);
|
||
const rawAddressText = ref('');
|
||
|
||
function pasteFromClipboard() {
|
||
uni.getClipboardData({
|
||
success: (res) => { rawAddressText.value = res.data || ''; }
|
||
});
|
||
}
|
||
|
||
function executeParseAddress() {
|
||
const raw = rawAddressText.value.trim();
|
||
if (!raw) return;
|
||
const mobileHit = raw.match(/(1[3-9]\d{9})/);
|
||
if (mobileHit) form.mobile = mobileHit[1];
|
||
let textLeft = raw.replace(form.mobile, ' ').trim();
|
||
const nameHit = textLeft.match(/^([^,,\s]{2,4})[,,\s]/);
|
||
if (nameHit) {
|
||
form.contact = nameHit[1];
|
||
textLeft = textLeft.replace(nameHit[0], ' ').trim();
|
||
}
|
||
const regHit = textLeft.match(/(.*?[省|市|自治区])\s*(.*?[市|州|地区])?\s*(.*?[区|县|市|旗])?\s*(.*)/);
|
||
if (regHit) {
|
||
if (regHit[1]) form.province = regHit[1].trim();
|
||
if (regHit[2]) form.city = regHit[2].trim();
|
||
if (regHit[3]) form.district = regHit[3].trim();
|
||
if (regHit[4]) form.address = regHit[4].trim();
|
||
} else {
|
||
form.address = textLeft;
|
||
}
|
||
showParsePopup.value = false;
|
||
uni.showToast({ title: '识别完成' });
|
||
}
|
||
|
||
// 下单支付
|
||
const submitting = ref(false);
|
||
async function confirmSubmitAndPay() {
|
||
if (!isLogin()) { toLogin(); return; }
|
||
if (!form.contact || !form.mobile || !form.address) {
|
||
uni.showToast({ title: '请填写完整服务地址与电话', icon: 'none' });
|
||
return;
|
||
}
|
||
if (submitting.value) return;
|
||
submitting.value = true;
|
||
try {
|
||
let appointTimeStr = '14:30:00';
|
||
if (appointSlot.value && appointSlot.value.indexOf('上午') > -1) appointTimeStr = '10:00:00';
|
||
else if (appointSlot.value && appointSlot.value.indexOf('下午') > -1) appointTimeStr = '14:30:00';
|
||
else if (appointSlot.value && appointSlot.value.indexOf('晚上') > -1) appointTimeStr = '19:00:00';
|
||
else appointTimeStr = '10:00:00';
|
||
|
||
let targetTime = Math.floor(new Date(`${appointDate.value} ${appointTimeStr}`).getTime() / 1000);
|
||
const now = Math.floor(Date.now() / 1000);
|
||
if (targetTime <= now) {
|
||
targetTime = now + 3600;
|
||
}
|
||
const appointTimestamp = targetTime;
|
||
const createRes = await api.orderCreate({
|
||
service_id: goodsList.value[0]?.service_id || 1,
|
||
price_type: priceType.value,
|
||
user_price: priceType.value === 'custom' ? Number(userPrice.value) : 0,
|
||
contact: form.contact,
|
||
mobile: form.mobile,
|
||
province: form.province,
|
||
city: form.city,
|
||
district: form.district,
|
||
address: form.address,
|
||
floor: form.floor,
|
||
has_elevator: form.has_elevator,
|
||
appoint_time: appointTimestamp,
|
||
goods_list: JSON.stringify(goodsList.value)
|
||
});
|
||
|
||
await api.orderPay({
|
||
order_id: createRes.order_id,
|
||
pay_type: 'wxpay'
|
||
});
|
||
|
||
uni.showToast({ title: '下单成功,正在匹配师傅' });
|
||
setTimeout(() => {
|
||
uni.redirectTo({ url: `/pages/order/detail?id=${createRes.order_id}` });
|
||
}, 600);
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
async function loadRealCategoryAndServices(options) {
|
||
const firstGoods = uni.getStorageSync('yjyf_first_goods');
|
||
if (firstGoods) {
|
||
goodsList.value = [firstGoods];
|
||
uni.removeStorageSync('yjyf_first_goods');
|
||
if (firstGoods.cat_id) drawerCatId.value = firstGoods.cat_id;
|
||
if (firstGoods.cat_name) drawerCatName.value = firstGoods.cat_name;
|
||
if (firstGoods.cat_icon) currentCatIcon.value = firstGoods.cat_icon;
|
||
if (firstGoods.cat_icon_url) currentCatIconUrl.value = firstGoods.cat_icon_url;
|
||
calc();
|
||
return;
|
||
}
|
||
|
||
let targetCatId = options && options.cat_id ? Number(options.cat_id) : 0;
|
||
let targetCatName = options && options.cat_name ? decodeURIComponent(options.cat_name) : '';
|
||
if (options && options.mode === 'custom') priceType.value = 'custom';
|
||
|
||
try {
|
||
const resCats = await api.cats();
|
||
const cats = resCats && resCats.list ? resCats.list : [];
|
||
if (cats.length > 0) {
|
||
let matchedCat = null;
|
||
if (targetCatId) {
|
||
matchedCat = cats.find(c => c.id === targetCatId);
|
||
}
|
||
if (!matchedCat && targetCatName) {
|
||
matchedCat = cats.find(c => c.name === targetCatName || targetCatName.includes(c.name));
|
||
}
|
||
if (!matchedCat) {
|
||
matchedCat = cats[0];
|
||
}
|
||
|
||
drawerCatId.value = matchedCat.id;
|
||
drawerCatName.value = matchedCat.name;
|
||
currentCatIcon.value = matchedCat.icon || 'bath';
|
||
currentCatIconUrl.value = matchedCat.icon_url || '';
|
||
|
||
const sRes = await api.services({ cat_id: matchedCat.id });
|
||
const services = sRes && sRes.list ? sRes.list : [];
|
||
if (services.length > 0) {
|
||
const firstS = services[0];
|
||
const rawAddons = firstS.addons && firstS.addons.length ? firstS.addons : [];
|
||
const extras = rawAddons.map(ad => ({
|
||
id: ad.id,
|
||
key: 'addon_' + ad.id,
|
||
name: ad.name,
|
||
unit: ad.unit || '个',
|
||
price: Number(ad.price) || 0,
|
||
num: 0
|
||
}));
|
||
const serviceTypes = firstS.service_types && firstS.service_types.length ? firstS.service_types : [
|
||
{ code: 'install', name: '安装', price: Number(firstS.base_price) || 0, is_default: 1 },
|
||
{ code: 'repair', name: '维修', price: Math.round((Number(firstS.base_price) || 0) * 0.7), is_default: 0 },
|
||
{ code: 'remove', name: '拆旧', price: Math.round((Number(firstS.base_price) || 0) * 0.5), is_default: 0 }
|
||
];
|
||
const defType = serviceTypes.find(st => st.is_default) || serviceTypes[0];
|
||
|
||
goodsList.value = [
|
||
{
|
||
service_id: firstS.id,
|
||
item_name: firstS.name,
|
||
spec_name: firstS.name,
|
||
cat_id: matchedCat.id,
|
||
cat_name: matchedCat.name,
|
||
unit: firstS.unit || '件',
|
||
base_price: Number(firstS.base_price) || Number(defType.price) || 0,
|
||
num: 1,
|
||
service_type: defType.code,
|
||
service_type_name: defType.name,
|
||
service_types: serviceTypes,
|
||
remark: '',
|
||
images: [],
|
||
videos: [],
|
||
envImages: [],
|
||
extras: extras
|
||
}
|
||
];
|
||
}
|
||
}
|
||
} catch (e) {
|
||
}
|
||
calc();
|
||
}
|
||
|
||
onLoad((options) => {
|
||
loadRealCategoryAndServices(options);
|
||
});
|
||
|
||
onShow(() => {
|
||
const firstGoods = uni.getStorageSync('yjyf_first_goods');
|
||
if (firstGoods) {
|
||
goodsList.value = [firstGoods];
|
||
uni.removeStorageSync('yjyf_first_goods');
|
||
if (firstGoods.cat_id) drawerCatId.value = firstGoods.cat_id;
|
||
if (firstGoods.cat_name) drawerCatName.value = firstGoods.cat_name;
|
||
if (firstGoods.cat_icon) currentCatIcon.value = firstGoods.cat_icon;
|
||
if (firstGoods.cat_icon_url) currentCatIconUrl.value = firstGoods.cat_icon_url;
|
||
calc();
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<style scoped>
|
||
.page {
|
||
min-height: 100vh;
|
||
background: #F4F5F7;
|
||
padding-bottom: 220rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* ---------- 导航栏 ---------- */
|
||
.nav-header {
|
||
background: linear-gradient(135deg, #FF9436 0%, #F0710D 100%);
|
||
position: sticky;
|
||
top: 0;
|
||
z-index: 99;
|
||
}
|
||
|
||
.nav-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 0 20rpx;
|
||
position: relative;
|
||
}
|
||
|
||
.nav-back {
|
||
width: 72rpx;
|
||
height: 72rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.back-icon {
|
||
width: 38rpx;
|
||
height: 38rpx;
|
||
filter: brightness(10);
|
||
}
|
||
|
||
.nav-title {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
text-align: center;
|
||
pointer-events: none;
|
||
}
|
||
|
||
.title-txt {
|
||
font-size: 34rpx;
|
||
font-weight: 700;
|
||
color: #FFFFFF;
|
||
letter-spacing: 1rpx;
|
||
}
|
||
|
||
.nav-right { width: 72rpx; }
|
||
|
||
/* ---------- 主体容器 ---------- */
|
||
.main-body {
|
||
padding: 24rpx;
|
||
}
|
||
|
||
/* ---------- 顶部常驻双行卡片(参考图 1 1:1,白底双行大行高) ---------- */
|
||
.top-service-card {
|
||
background: #FFFFFF;
|
||
border-radius: 20rpx;
|
||
padding: 0 28rpx;
|
||
margin-bottom: 24rpx;
|
||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||
}
|
||
|
||
.tsc-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
height: 128rpx;
|
||
border-bottom: 1rpx solid #F1F5F9;
|
||
}
|
||
|
||
.tsc-row.no-border {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.tsc-left {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.tsc-icon-wrap {
|
||
width: 84rpx;
|
||
height: 84rpx;
|
||
border-radius: 50%;
|
||
background: #FFF7F0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-right: 20rpx;
|
||
}
|
||
|
||
.tsc-img {
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
}
|
||
|
||
.tsc-title {
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
color: #1E293B;
|
||
}
|
||
|
||
.tsc-btn {
|
||
border: 1rpx solid #D1D5DB;
|
||
background: #FFFFFF;
|
||
border-radius: 8rpx;
|
||
padding: 14rpx 22rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.tsc-btn-txt {
|
||
font-size: 26rpx;
|
||
color: #374151;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.custom-price-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 16rpx 0 24rpx;
|
||
border-top: 1rpx solid #F1F5F9;
|
||
}
|
||
|
||
.cpb-label {
|
||
font-size: 28rpx;
|
||
color: #1E293B;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.cpb-input-wrap {
|
||
flex: 1;
|
||
display: flex;
|
||
align-items: center;
|
||
background: #F8FAFC;
|
||
border: 1rpx solid #E2E8F0;
|
||
border-radius: 12rpx;
|
||
height: 76rpx;
|
||
padding: 0 20rpx;
|
||
margin-left: 16rpx;
|
||
}
|
||
|
||
.cpb-currency {
|
||
font-size: 30rpx;
|
||
color: #F0710D;
|
||
font-weight: 700;
|
||
margin-right: 8rpx;
|
||
}
|
||
|
||
.cpb-input {
|
||
flex: 1;
|
||
font-size: 28rpx;
|
||
color: #1E293B;
|
||
font-weight: 700;
|
||
}
|
||
|
||
/* ---------- 商品卡片列表 ---------- */
|
||
.group-list { margin-bottom: 24rpx; }
|
||
|
||
.group-card {
|
||
background: #FFFFFF;
|
||
border-radius: 20rpx;
|
||
padding: 32rpx 28rpx;
|
||
margin-bottom: 24rpx;
|
||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||
}
|
||
|
||
.gc-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 28rpx;
|
||
}
|
||
|
||
.gc-title {
|
||
font-size: 34rpx;
|
||
font-weight: 700;
|
||
color: #1E293B;
|
||
}
|
||
|
||
.gc-meta {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.gc-group-num {
|
||
font-size: 28rpx;
|
||
color: #475569;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.gc-del-btn {
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.gc-trash-img {
|
||
width: 36rpx;
|
||
height: 36rpx;
|
||
opacity: 0.7;
|
||
}
|
||
|
||
/* 3 个宽阔虚线框 */
|
||
.media-upload-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.dash-card {
|
||
flex: 1;
|
||
height: 172rpx;
|
||
border-radius: 16rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.pic-dash {
|
||
border: 2rpx dashed #F0710D;
|
||
background: #FFFDFB;
|
||
}
|
||
|
||
.video-dash, .env-dash {
|
||
border: 2rpx dashed #D1D5DB;
|
||
background: #FAFAFA;
|
||
}
|
||
|
||
.dc-icon {
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
margin-bottom: 10rpx;
|
||
}
|
||
|
||
.dc-txt { font-size: 24rpx; font-weight: 500; }
|
||
.dc-txt.orange { color: #F0710D; font-weight: 600; }
|
||
.dc-txt.gray { color: #6B7280; }
|
||
.dc-sub.gray { font-size: 20rpx; color: #9CA3AF; margin-top: 4rpx; }
|
||
|
||
.env-help-box {
|
||
width: 44rpx;
|
||
height: 44rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.eh-icon { width: 38rpx; height: 38rpx; }
|
||
|
||
/* 回显 */
|
||
.media-preview-area {
|
||
margin-bottom: 24rpx;
|
||
padding: 16rpx 0;
|
||
border-bottom: 1rpx solid #F1F5F9;
|
||
}
|
||
|
||
.mp-section { margin-bottom: 16rpx; }
|
||
.mp-tag { font-size: 22rpx; color: #64748B; margin-bottom: 10rpx; display: block; }
|
||
.mp-thumbs { display: flex; flex-wrap: wrap; gap: 16rpx; }
|
||
|
||
.mp-thumb-item {
|
||
position: relative;
|
||
width: 130rpx;
|
||
height: 130rpx;
|
||
border-radius: 12rpx;
|
||
overflow: hidden;
|
||
background: #F1F5F9;
|
||
}
|
||
|
||
.mp-img { width: 100%; height: 100%; }
|
||
|
||
.mp-del-btn {
|
||
position: absolute;
|
||
top: 4rpx;
|
||
right: 4rpx;
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
border-radius: 50%;
|
||
background: rgba(0, 0, 0, 0.65);
|
||
color: #FFFFFF;
|
||
font-size: 24rpx;
|
||
line-height: 30rpx;
|
||
text-align: center;
|
||
}
|
||
|
||
.video-item { background: #000; }
|
||
|
||
.mp-play-badge {
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
transform: translate(-50%, -50%);
|
||
width: 44rpx;
|
||
height: 44rpx;
|
||
border-radius: 50%;
|
||
background: rgba(240, 113, 13, 0.85);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.mp-play-icon { width: 22rpx; height: 22rpx; margin-left: 4rpx; }
|
||
|
||
/* ---------- 舒展大表单项(行高 108rpx,字号 30rpx) ---------- */
|
||
.form-item-list { display: flex; flex-direction: column; }
|
||
|
||
.form-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
height: 108rpx;
|
||
border-bottom: 1rpx solid #F1F5F9;
|
||
}
|
||
|
||
.form-row.no-border { border-bottom: none; }
|
||
|
||
.fr-label { display: flex; align-items: center; flex-shrink: 0; }
|
||
.req-star { color: #EF4444; font-size: 30rpx; margin-right: 4rpx; font-weight: 700; }
|
||
.label-txt { font-size: 30rpx; font-weight: 500; color: #1E293B; }
|
||
.label-txt.no-star { margin-left: 12rpx; }
|
||
|
||
.fr-value-box {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: flex-end;
|
||
flex: 1;
|
||
margin-left: 20rpx;
|
||
}
|
||
|
||
.val-txt {
|
||
font-size: 28rpx;
|
||
color: #334155;
|
||
max-width: 420rpx;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
|
||
.val-txt.placeholder { color: #9CA3AF; }
|
||
.val-txt.highlight { color: #F0710D; font-weight: 600; }
|
||
|
||
.fr-arrow { width: 32rpx; height: 32rpx; margin-left: 8rpx; opacity: 0.6; }
|
||
|
||
.fr-input {
|
||
font-size: 28rpx;
|
||
color: #1E293B;
|
||
text-align: right;
|
||
width: 100%;
|
||
}
|
||
|
||
/* 工项切换 Tab */
|
||
.fr-type-tabs {
|
||
display: flex;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.type-tab-item {
|
||
padding: 10rpx 24rpx;
|
||
border-radius: 8rpx;
|
||
border: 1rpx solid #D1D5DB;
|
||
font-size: 26rpx;
|
||
color: #475569;
|
||
background: #FAFAFA;
|
||
}
|
||
|
||
.type-tab-item.on {
|
||
border-color: #F0710D;
|
||
background: #FFF7F0;
|
||
color: #F0710D;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* 步进器 */
|
||
.fr-stepper {
|
||
display: flex;
|
||
align-items: center;
|
||
border: 1rpx solid #D1D5DB;
|
||
border-radius: 8rpx;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.step-btn {
|
||
width: 68rpx;
|
||
height: 56rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 32rpx;
|
||
color: #6B7280;
|
||
background: #FAFAFA;
|
||
}
|
||
|
||
.step-num-box {
|
||
width: 90rpx;
|
||
height: 56rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 28rpx;
|
||
font-weight: 600;
|
||
color: #1E293B;
|
||
border-left: 1rpx solid #D1D5DB;
|
||
border-right: 1rpx solid #D1D5DB;
|
||
background: #FFFFFF;
|
||
}
|
||
|
||
/* 继续添加商品大按钮 */
|
||
.add-group-btn {
|
||
background: #FFFFFF;
|
||
border: 2rpx dashed #F0710D;
|
||
border-radius: 16rpx;
|
||
height: 92rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.agb-txt {
|
||
font-size: 30rpx;
|
||
font-weight: 600;
|
||
color: #F0710D;
|
||
}
|
||
|
||
/* ---------- 服务地址卡片 ---------- */
|
||
.addr-box-card, .appoint-card {
|
||
background: #FFFFFF;
|
||
border-radius: 20rpx;
|
||
padding: 32rpx 28rpx;
|
||
margin-bottom: 24rpx;
|
||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.04);
|
||
}
|
||
|
||
.abc-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.abc-title, .ac-title {
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
color: #1E293B;
|
||
}
|
||
|
||
.abc-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.abc-action-btn {
|
||
font-size: 24rpx;
|
||
color: #F0710D;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.abc-action-divider {
|
||
color: #CBD5E1;
|
||
font-size: 22rpx;
|
||
}
|
||
|
||
.paste-parse-bar {
|
||
background: #FFF7F0;
|
||
border: 1rpx dashed #F0710D;
|
||
border-radius: 12rpx;
|
||
padding: 18rpx 20rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.ppb-icon { width: 32rpx; height: 32rpx; }
|
||
.ppb-txt { font-size: 24rpx; color: #F0710D; flex: 1; margin-left: 12rpx; }
|
||
.ppb-badge {
|
||
background: #F0710D;
|
||
color: #FFFFFF;
|
||
font-size: 20rpx;
|
||
padding: 4rpx 14rpx;
|
||
border-radius: 20rpx;
|
||
}
|
||
|
||
.fi-row {
|
||
display: flex;
|
||
align-items: center;
|
||
height: 104rpx;
|
||
border-bottom: 1rpx solid #F1F5F9;
|
||
}
|
||
|
||
.fi-row.no-border { border-bottom: none; }
|
||
|
||
.fi-label {
|
||
width: 170rpx;
|
||
font-size: 28rpx;
|
||
color: #475569;
|
||
}
|
||
|
||
.fi-input {
|
||
flex: 1;
|
||
font-size: 28rpx;
|
||
color: #1E293B;
|
||
}
|
||
|
||
.fi-radio-group { display: flex; gap: 32rpx; }
|
||
.fi-radio { display: flex; align-items: center; gap: 10rpx; }
|
||
.rd-dot {
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
border-radius: 50%;
|
||
border: 6rpx solid #F0710D;
|
||
box-sizing: border-box;
|
||
}
|
||
.rd-txt { font-size: 26rpx; color: #334155; }
|
||
|
||
.ac-head { margin-bottom: 20rpx; }
|
||
.ac-row { display: flex; gap: 16rpx; }
|
||
|
||
.ac-picker-btn {
|
||
flex: 1;
|
||
height: 88rpx;
|
||
border: 1rpx solid #E2E8F0;
|
||
border-radius: 12rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 0 20rpx;
|
||
background: #FAFAFA;
|
||
}
|
||
|
||
.ap-txt { font-size: 26rpx; color: #1E293B; }
|
||
.ap-arrow { width: 28rpx; height: 28rpx; opacity: 0.5; }
|
||
|
||
/* ---------- 一站式吸底结算栏 ---------- */
|
||
.bottom-action-bar {
|
||
position: fixed;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
background: #FFFFFF;
|
||
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||
padding: 20rpx 28rpx;
|
||
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
z-index: 90;
|
||
}
|
||
|
||
.bab-info {
|
||
display: flex;
|
||
align-items: baseline;
|
||
}
|
||
|
||
.bab-label {
|
||
font-size: 28rpx;
|
||
color: #64748B;
|
||
}
|
||
|
||
.bab-price {
|
||
font-size: 42rpx;
|
||
font-weight: 800;
|
||
color: #F0710D;
|
||
margin-left: 6rpx;
|
||
}
|
||
|
||
.bab-sub-hint {
|
||
font-size: 20rpx;
|
||
color: #94A3B8;
|
||
margin-left: 6rpx;
|
||
}
|
||
|
||
.bab-btn-main {
|
||
background: linear-gradient(135deg, #FF9436 0%, #F0710D 100%);
|
||
height: 88rpx;
|
||
padding: 0 56rpx;
|
||
border-radius: 44rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.bbm-txt {
|
||
color: #FFFFFF;
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
letter-spacing: 2rpx;
|
||
}
|
||
|
||
/* ---------- 参考图 2 1:1 复刻:“请选择下单模式”半屏弹窗 ---------- */
|
||
.mode-modal-mask {
|
||
position: fixed;
|
||
inset: 0;
|
||
background: rgba(0, 0, 0, 0.6);
|
||
z-index: 999;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: flex-end;
|
||
}
|
||
|
||
.mode-modal-card {
|
||
background: #FFFFFF;
|
||
border-radius: 36rpx 36rpx 0 0;
|
||
padding: 36rpx 28rpx 40rpx;
|
||
padding-bottom: calc(36rpx + env(safe-area-inset-bottom));
|
||
}
|
||
|
||
.mm-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
position: relative;
|
||
margin-bottom: 32rpx;
|
||
}
|
||
|
||
.mm-title {
|
||
font-size: 34rpx;
|
||
font-weight: 700;
|
||
color: #1E293B;
|
||
}
|
||
|
||
.mm-close-btn {
|
||
position: absolute;
|
||
right: 0;
|
||
top: 50%;
|
||
transform: translateY(-50%);
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.mm-close-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
}
|
||
|
||
.mm-card-list {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 24rpx;
|
||
margin-bottom: 36rpx;
|
||
}
|
||
|
||
.mm-item-card {
|
||
border: 2rpx solid #F0710D;
|
||
border-radius: 16rpx;
|
||
padding: 24rpx 28rpx;
|
||
background: #FFFFFF;
|
||
transition: background 0.15s ease;
|
||
}
|
||
|
||
.mm-item-card.active {
|
||
background: #FFFDFB;
|
||
}
|
||
|
||
.mm-content-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.mm-info {
|
||
flex: 1;
|
||
margin-right: 20rpx;
|
||
}
|
||
|
||
.mm-item-title {
|
||
font-size: 30rpx;
|
||
font-weight: 700;
|
||
color: #1E293B;
|
||
display: block;
|
||
margin-bottom: 8rpx;
|
||
}
|
||
|
||
.mm-item-desc {
|
||
font-size: 24rpx;
|
||
color: #64748B;
|
||
display: block;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.mm-action-btn {
|
||
background: linear-gradient(135deg, #FF9436 0%, #F0710D 100%);
|
||
height: 68rpx;
|
||
padding: 0 28rpx;
|
||
border-radius: 34rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.mab-txt {
|
||
font-size: 26rpx;
|
||
font-weight: 600;
|
||
color: #FFFFFF;
|
||
}
|
||
|
||
.mm-cancel-btn {
|
||
background: #F0710D;
|
||
height: 88rpx;
|
||
border-radius: 44rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.mcb-txt {
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
color: #FFFFFF;
|
||
}
|
||
|
||
/* 弹窗通用 */
|
||
.parse-popup-card, .addon-modal-card {
|
||
background: #FFFFFF;
|
||
border-radius: 36rpx 36rpx 0 0;
|
||
padding: 36rpx 28rpx;
|
||
padding-bottom: calc(36rpx + env(safe-area-inset-bottom));
|
||
}
|
||
|
||
.pp-title, .am-title {
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
text-align: center;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.pp-textarea {
|
||
width: 100%;
|
||
height: 180rpx;
|
||
background: #F8FAFC;
|
||
border: 1rpx solid #E2E8F0;
|
||
border-radius: 12rpx;
|
||
padding: 16rpx;
|
||
font-size: 26rpx;
|
||
box-sizing: border-box;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.pp-btns { display: flex; gap: 20rpx; }
|
||
.pp-btn {
|
||
flex: 1;
|
||
height: 80rpx;
|
||
border-radius: 40rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 28rpx;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.paste-btn { border: 1rpx solid #D1D5DB; color: #475569; }
|
||
.parse-btn { background: #F0710D; color: #FFFFFF; }
|
||
|
||
.am-list { margin-bottom: 32rpx; }
|
||
.am-item {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 20rpx 0;
|
||
border-bottom: 1rpx solid #F1F5F9;
|
||
}
|
||
.am-name { font-size: 28rpx; font-weight: 600; color: #1E293B; display: block; }
|
||
.am-price { font-size: 24rpx; color: #F0710D; margin-top: 4rpx; display: block; }
|
||
.am-stepper {
|
||
display: flex;
|
||
align-items: center;
|
||
border: 1rpx solid #D1D5DB;
|
||
border-radius: 8rpx;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.am-confirm-btn {
|
||
background: #F0710D;
|
||
height: 84rpx;
|
||
border-radius: 42rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #FFFFFF;
|
||
font-size: 30rpx;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.clickable-hover:active { opacity: 0.82; }
|
||
</style>
|