- 移除登录时的草稿状态跳转逻辑 - 新增API接口未登录时返回401错误处理 - 新增实名认证状态判断及提示弹窗 - 优化师傅工作台信息加载逻辑 - 完善接单、报价等操作的实名认证拦截
2430 行
63 KiB
Vue
2430 行
63 KiB
Vue
<template>
|
||
<view class="page">
|
||
<YjyfNavBar
|
||
theme="orange"
|
||
:title="order && order.is_my_order ? '工单履约详情' : '工单详情'"
|
||
/>
|
||
|
||
<!-- 加载态 -->
|
||
<view class="state-box" v-if="loading && !order">
|
||
<text class="state-txt">正在加载工单详情...</text>
|
||
</view>
|
||
|
||
<!-- 错误重试态 -->
|
||
<view class="state-box" v-else-if="loadError && !order">
|
||
<image class="empty-ico" src="/static/icons/master/empty-orders.svg" mode="aspectFit" />
|
||
<text class="state-txt">{{ loadError }}</text>
|
||
<view class="retry-btn clickable-hover" @tap="loadDetail">重新加载</view>
|
||
</view>
|
||
|
||
<template v-else-if="order">
|
||
<!-- ==================== 模式一:本人已接工单全流程履约视图 ==================== -->
|
||
<template v-if="order.is_my_order">
|
||
<!-- 顶部状态与5步履约进度卡 -->
|
||
<view class="status-hero">
|
||
<view class="sh-top">
|
||
<view class="sh-title-box">
|
||
<text class="sh-status">{{ order.status_text }}</text>
|
||
<text class="sh-tip">{{ myStatusDesc }}</text>
|
||
</view>
|
||
<view class="sh-fee-box">
|
||
<text class="sh-fee-label">{{ Number(order.settle_status) === 1 ? '已结算工费' : '预计结算' }}</text>
|
||
<text class="sh-fee-val">¥{{ Number(order.settle_amount || order.master_fee || 0).toFixed(2) }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 2小时首联考核提醒 -->
|
||
<view class="contact-alert" v-if="Number(order.status) === 3 && !order.contact_time">
|
||
<image class="ca-ico" src="/static/icons/clock-orange.svg" mode="aspectFit" />
|
||
<text class="ca-txt">
|
||
{{ contactRemainText ? '请在 ' + contactRemainText + ' 内致电客户确认上门时间' : '请立即联系客户确认上门时间,避免超时扣分' }}
|
||
</text>
|
||
<view class="ca-btn clickable-hover" @tap="markContacted">标记已联系</view>
|
||
</view>
|
||
|
||
<!-- 5步履约节点条 -->
|
||
<view class="steps-bar" v-if="Number(order.status) <= 8">
|
||
<view
|
||
class="step-node"
|
||
:class="{ done: stepIndex >= idx, current: stepIndex === idx }"
|
||
v-for="(st, idx) in stepItems"
|
||
:key="st.label"
|
||
>
|
||
<view class="sn-dot-row">
|
||
<view class="sn-line left" :class="{ hidden: idx === 0, active: stepIndex >= idx }"></view>
|
||
<view class="sn-dot">
|
||
<image
|
||
v-if="stepIndex > idx || Number(order.status) === 8"
|
||
class="sn-check"
|
||
src="/static/icons/check-white.svg"
|
||
mode="aspectFit"
|
||
/>
|
||
<text v-else class="sn-idx">{{ idx + 1 }}</text>
|
||
</view>
|
||
<view class="sn-line right" :class="{ hidden: idx === stepItems.length - 1, active: stepIndex > idx }"></view>
|
||
</view>
|
||
<text class="sn-label">{{ st.label }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 客户联系与上门地址导航卡 -->
|
||
<view class="card">
|
||
<view class="card-head">
|
||
<text class="card-title">客户与上门地址</text>
|
||
<text class="urgent-pill" v-if="Number(order.urgent) === 1">加急工单</text>
|
||
</view>
|
||
|
||
<view class="customer-box">
|
||
<image class="cust-avatar" src="/static/icons/avatar-member.svg" mode="aspectFit" />
|
||
<view class="cust-info">
|
||
<text class="cust-name">{{ order.contact }}</text>
|
||
<text class="cust-phone">{{ order.mobile }}</text>
|
||
</view>
|
||
<view class="action-pill orange clickable-hover" @tap="callCustomer">
|
||
<image class="ap-ico" src="/static/icons/phone.svg" mode="aspectFit" />
|
||
<text class="ap-txt">联系客户</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="addr-box">
|
||
<view class="addr-main">
|
||
<view class="addr-row">
|
||
<image class="loc-ico" src="/static/icons/master/order-loc.svg" mode="aspectFit" />
|
||
<text class="addr-text">{{ order.full_address }}</text>
|
||
</view>
|
||
<view class="meta-pills">
|
||
<text class="m-pill">楼层 {{ order.floor || 1 }} 层</text>
|
||
<text class="m-pill">{{ Number(order.has_elevator) ? '有电梯' : '步梯搬运' }}</text>
|
||
<text class="m-pill" v-if="order.distance_km !== null && order.distance_km !== undefined">距您 {{ order.distance_km }}km</text>
|
||
</view>
|
||
</view>
|
||
<view class="nav-btn clickable-hover" @tap="openMapNav">
|
||
<image class="nav-ico" src="/static/icons/master/nav-arrow.svg" mode="aspectFit" />
|
||
<text class="nav-txt">导航</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="kv-row top-border">
|
||
<text class="kv-k">预约上门时间</text>
|
||
<view class="kv-v-wrap" @tap="canSchedule ? openScheduleDrawer() : null">
|
||
<text class="kv-v highlight">{{ order.appoint_time_text }}</text>
|
||
<image v-if="canSchedule" class="arrow-sm" src="/static/icons/arrow-right-orange.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<!-- ==================== 模式二:抢单大厅待抢 / 竞价预览视图 ==================== -->
|
||
<template v-else>
|
||
<view class="hall-banner">
|
||
<view class="hb-top">
|
||
<view class="hb-type-row">
|
||
<text class="hb-badge">{{ order.price_type_text }}</text>
|
||
<text class="hb-urgent" v-if="Number(order.urgent) === 1">急单优先</text>
|
||
</view>
|
||
<text class="hb-countdown" v-if="countdownText">剩余有效时间 {{ countdownText }}</text>
|
||
</view>
|
||
|
||
<view class="hb-price-row">
|
||
<view class="hb-price-left">
|
||
<text class="hb-price-label">{{ order.price_type === 'quote' ? '报价模式' : '预计到手收益' }}</text>
|
||
<view class="hb-amt" v-if="order.price_type !== 'quote'">
|
||
<text class="hb-sym">¥</text>
|
||
<text class="hb-num">{{ Number(order.master_fee || order.user_price || 0).toFixed(2) }}</text>
|
||
</view>
|
||
<text class="hb-quote-tip" v-else>查看需求后自主提交报价(剩余 {{ order.remaining_quote_slots }} 个名额)</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card qualification-card" v-if="order.qual_req">
|
||
<text>资质要求:{{ order.qual_req }}</text>
|
||
<template v-if="!order.qualification_allowed">
|
||
<text class="qualification-warning">暂无有效认证证书,不能接单或报价</text>
|
||
<text class="qualification-link clickable-hover" @tap="goCerts">去上传证书</text>
|
||
</template>
|
||
</view>
|
||
|
||
<!-- 我的报价状态卡(已报价时展示) -->
|
||
<view class="card quote-state-card" v-if="order.my_quote">
|
||
<view class="card-head">
|
||
<text class="card-title">我的报价记录</text>
|
||
<text class="q-state-tag">{{ quoteStatusText(order.my_quote.status) }}</text>
|
||
</view>
|
||
<view class="kv-row">
|
||
<text class="kv-k">我的出价</text>
|
||
<text class="kv-v price">¥{{ Number(order.my_quote.amount).toFixed(2) }}</text>
|
||
</view>
|
||
<view class="kv-row" v-if="order.my_quote.description">
|
||
<text class="kv-k">报价说明</text>
|
||
<text class="kv-v">{{ order.my_quote.description }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 脱敏地址与上门要求 -->
|
||
<view class="card">
|
||
<view class="card-head">
|
||
<text class="card-title">服务地点与预约信息</text>
|
||
<text class="dist-pill" v-if="order.distance_km !== null && order.distance_km !== undefined">距您 {{ order.distance_km }}km</text>
|
||
</view>
|
||
<view class="addr-row">
|
||
<image class="loc-ico" src="/static/icons/master/order-loc.svg" mode="aspectFit" />
|
||
<text class="addr-text">{{ order.full_address }}(接单后解锁详细门牌)</text>
|
||
</view>
|
||
<view class="meta-pills">
|
||
<text class="m-pill">楼层 {{ order.floor || 1 }} 层</text>
|
||
<text class="m-pill">{{ Number(order.has_elevator) ? '有电梯' : '步梯无电梯' }}</text>
|
||
</view>
|
||
<view class="kv-row top-border">
|
||
<text class="kv-k">期望上门</text>
|
||
<text class="kv-v highlight">{{ order.appoint_time_text }}</text>
|
||
</view>
|
||
<view class="kv-row">
|
||
<text class="kv-k">业主称呼</text>
|
||
<text class="kv-v">{{ order.contact }}({{ order.mobile }})</text>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<!-- ==================== 公共区块:服务商品与现场需求 ==================== -->
|
||
<view class="card">
|
||
<view class="card-head">
|
||
<text class="card-title">服务商品与施工要求</text>
|
||
<text class="cat-tag">{{ order.cat_name }}</text>
|
||
</view>
|
||
|
||
<!-- 多商品列表 -->
|
||
<view class="goods-list" v-if="order.goods_list && order.goods_list.length">
|
||
<view class="g-item" v-for="g in order.goods_list" :key="g.id">
|
||
<image
|
||
class="g-img"
|
||
:src="g.goods_image || order.service_image || '/static/icons/service-default.svg'"
|
||
mode="aspectFill"
|
||
/>
|
||
<view class="g-main">
|
||
<view class="g-top">
|
||
<text class="g-name">{{ g.goods_name }}</text>
|
||
<text class="g-num">x{{ g.goods_num }}</text>
|
||
</view>
|
||
<text class="g-sub" v-if="g.goods_model">规格型号:{{ g.goods_model }}</text>
|
||
<text class="g-addon" v-if="g.addon_services">附加项:{{ g.addon_services }}</text>
|
||
<text class="g-sub" v-if="g.goods_remark">单组备注:{{ g.goods_remark }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 单商品回退展示 -->
|
||
<view class="goods-list" v-else>
|
||
<view class="g-item">
|
||
<image
|
||
class="g-img"
|
||
:src="order.service_image || '/static/icons/service-default.svg'"
|
||
mode="aspectFill"
|
||
/>
|
||
<view class="g-main">
|
||
<view class="g-top">
|
||
<text class="g-name">{{ order.service_name }}</text>
|
||
<text class="g-num">x{{ order.goods_num || 1 }}</text>
|
||
</view>
|
||
<text class="g-sub">规格型号:{{ order.goods_model || '标准规格' }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="remark-box" v-if="order.remark">
|
||
<text class="rk-label">客户备注:</text>
|
||
<text class="rk-txt">{{ order.remark }}</text>
|
||
</view>
|
||
|
||
<!-- 客户上传的商品照片 -->
|
||
<view class="media-sec" v-if="order.goods_images && order.goods_images.length">
|
||
<text class="media-title">商品参考/实拍图({{ order.goods_images.length }}张)</text>
|
||
<view class="media-grid">
|
||
<image
|
||
v-for="(im, idx) in order.goods_images"
|
||
:key="'mg_' + idx"
|
||
class="media-img"
|
||
:src="im"
|
||
mode="aspectFill"
|
||
@tap="previewImages(order.goods_images, idx)"
|
||
/>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 客户上传的安装环境图与安装视频 -->
|
||
<view class="media-sec" v-if="(order.env_images && order.env_images.length) || (order.goods_videos && order.goods_videos.length)">
|
||
<text class="media-title">现场环境图与视频</text>
|
||
<view class="media-grid">
|
||
<image
|
||
v-for="(eim, eidx) in (order.env_images || [])"
|
||
:key="'me_' + eidx"
|
||
class="media-img"
|
||
:src="eim"
|
||
mode="aspectFill"
|
||
@tap="previewImages(order.env_images, eidx)"
|
||
/>
|
||
<view
|
||
class="master-video-box clickable-hover"
|
||
v-for="(vid, vidx) in (order.goods_videos || [])"
|
||
:key="'mv_' + vidx"
|
||
@tap="activeVideoUrl = vid"
|
||
>
|
||
<image class="mv-play-ico" src="/static/icons/play-white.svg" mode="aspectFit" />
|
||
<text class="mv-play-txt">播放视频</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 已接单专属:增项补差记录卡 ==================== -->
|
||
<view class="card" v-if="order.is_my_order && Number(order.diff_status) > 0">
|
||
<view class="card-head">
|
||
<text class="card-title">施工增项补差</text>
|
||
<text class="diff-badge" :class="{ paid: Number(order.diff_status) === 2 }">
|
||
{{ Number(order.diff_status) === 2 ? '客户已支付' : '待客户支付' }}
|
||
</text>
|
||
</view>
|
||
<view class="kv-row">
|
||
<text class="kv-k">补差金额</text>
|
||
<text class="kv-v price">¥{{ Number(order.diff_amount || 0).toFixed(2) }}</text>
|
||
</view>
|
||
<view class="kv-row" v-if="order.diff_remark">
|
||
<text class="kv-k">增项说明</text>
|
||
<text class="kv-v">{{ order.diff_remark }}</text>
|
||
</view>
|
||
<view class="media-sec" v-if="order.diff_image">
|
||
<text class="media-title">现场增项凭证</text>
|
||
<image
|
||
class="diff-img"
|
||
:src="order.diff_image"
|
||
mode="aspectFill"
|
||
@tap="previewImages([order.diff_image], 0)"
|
||
/>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 已接单专属:完工水印照片卡 ==================== -->
|
||
<view class="card" v-if="order.is_my_order && order.finish_images && order.finish_images.length">
|
||
<view class="card-head">
|
||
<text class="card-title">完工验收凭证({{ order.finish_images.length }}张)</text>
|
||
</view>
|
||
<view class="media-grid">
|
||
<image
|
||
v-for="(fi, idx) in order.finish_images"
|
||
:key="fi.id || idx"
|
||
class="media-img"
|
||
:src="fi.url"
|
||
mode="aspectFill"
|
||
@tap="previewImages(order.finish_images.map(x => x.url), idx)"
|
||
/>
|
||
</view>
|
||
<view class="remark-box" v-if="order.damage_remark">
|
||
<text class="rk-label">施工异常/说明:</text>
|
||
<text class="rk-txt">{{ order.damage_remark }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 已接单专属:费用与结算明细卡 ==================== -->
|
||
<view class="card" v-if="order.is_my_order">
|
||
<view class="card-head">
|
||
<text class="card-title">费用与结算明细</text>
|
||
<text class="settle-tag" :class="{ ok: Number(order.settle_status) === 1 }">
|
||
{{ Number(order.settle_status) === 1 ? '已入账钱包' : '核销后即刻入账' }}
|
||
</text>
|
||
</view>
|
||
<view class="kv-row">
|
||
<text class="kv-k">工单号</text>
|
||
<view class="kv-v-wrap" @tap="copyOrderNo">
|
||
<text class="kv-v">{{ order.order_no }}</text>
|
||
<image class="copy-ico" src="/static/icons/invoice-copy.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
<view class="kv-row">
|
||
<text class="kv-k">订单实付总额</text>
|
||
<text class="kv-v">¥{{ Number(order.pay_amount || order.total_amount || 0).toFixed(2) }}</text>
|
||
</view>
|
||
<view class="kv-row" v-if="Number(order.floor_amount) > 0">
|
||
<text class="kv-k">含步梯搬运费</text>
|
||
<text class="kv-v">¥{{ Number(order.floor_amount).toFixed(2) }}</text>
|
||
</view>
|
||
<view class="kv-row" v-if="Number(order.urgent_amount) > 0">
|
||
<text class="kv-k">含加急服务费</text>
|
||
<text class="kv-v">¥{{ Number(order.urgent_amount).toFixed(2) }}</text>
|
||
</view>
|
||
<view class="kv-row">
|
||
<text class="kv-k">平台技术服务费({{ order.commission_rate !== undefined && order.commission_rate !== null ? Number(order.commission_rate) : 0 }}%)</text>
|
||
<text class="kv-v muted">-¥{{ Number(order.commission || 0).toFixed(2) }}</text>
|
||
</view>
|
||
<view class="kv-row top-border">
|
||
<text class="kv-k bold">{{ Number(order.settle_status) === 1 ? '实际结算工钱' : '预计结算工钱' }}</text>
|
||
<text class="kv-v price-lg">¥{{ Number(order.settle_amount || order.master_fee || 0).toFixed(2) }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 已接单专属:工单履约时间轴 ==================== -->
|
||
<view class="card" v-if="order.is_my_order && order.logs && order.logs.length">
|
||
<view class="card-head">
|
||
<text class="card-title">工单履约轨迹</text>
|
||
</view>
|
||
<view class="timeline">
|
||
<view class="tl-item" :class="{ latest: idx === 0 }" v-for="(lg, idx) in order.logs" :key="lg.id || idx">
|
||
<view class="tl-left">
|
||
<view class="tl-dot"></view>
|
||
<view class="tl-line" v-if="idx < order.logs.length - 1"></view>
|
||
</view>
|
||
<view class="tl-body">
|
||
<view class="tl-head">
|
||
<text class="tl-status">{{ lg.status_text }}</text>
|
||
<text class="tl-time">{{ lg.time_text }}</text>
|
||
</view>
|
||
<text class="tl-remark" v-if="lg.remark">{{ lg.remark }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 底部固定主次操作栏 ==================== -->
|
||
<view class="bottom-bar">
|
||
<!-- 已接工单阶段化操作栏 -->
|
||
<template v-if="order.is_my_order">
|
||
<view class="bar-icon-btn clickable-hover" @tap="contactPlatform">
|
||
<image class="bi-ico" src="/static/icons/customer-service-gray.svg" mode="aspectFit" />
|
||
<text class="bi-txt">平台客服</text>
|
||
</view>
|
||
|
||
<view class="bar-btns">
|
||
<!-- 状态3:已接单 -->
|
||
<template v-if="Number(order.status) === 3">
|
||
<view class="b-btn outline clickable-hover" v-if="!order.contact_time" @tap="markContacted">标记已联系</view>
|
||
<view class="b-btn outline clickable-hover" v-else @tap="callCustomer">拨打客户</view>
|
||
<view class="b-btn primary clickable-hover" @tap="openScheduleDrawer">约定上门时间</view>
|
||
</template>
|
||
|
||
<!-- 状态4:待上门 -->
|
||
<template v-else-if="Number(order.status) === 4">
|
||
<view class="b-btn outline clickable-hover" @tap="openScheduleDrawer">改约时间</view>
|
||
<view class="b-btn primary clickable-hover" :class="{ disabled: submitting }" @tap="doArrive">
|
||
{{ submitting ? '打卡中...' : '到达现场打卡' }}
|
||
</view>
|
||
</template>
|
||
|
||
<!-- 状态5:已到达 -->
|
||
<template v-else-if="Number(order.status) === 5">
|
||
<view class="b-btn outline clickable-hover" @tap="openDiffDrawer">增项补差</view>
|
||
<view class="b-btn primary clickable-hover" :class="{ disabled: submitting }" @tap="doStartJob">
|
||
{{ submitting ? '提交中...' : '开始施工服务' }}
|
||
</view>
|
||
</template>
|
||
|
||
<!-- 状态6:服务中 -->
|
||
<template v-else-if="Number(order.status) === 6">
|
||
<view class="b-btn outline clickable-hover" @tap="openDiffDrawer">增项补差</view>
|
||
<view class="b-btn primary clickable-hover" @tap="openFinishDrawer">水印拍照完工</view>
|
||
</template>
|
||
|
||
<!-- 状态7:待验收 -->
|
||
<template v-else-if="Number(order.status) === 7">
|
||
<view class="b-btn outline clickable-hover" @tap="callCustomer">联系客户</view>
|
||
<view class="b-btn primary clickable-hover" @tap="openVerifyDrawer">输入核销码结算</view>
|
||
</template>
|
||
|
||
<!-- 状态8:已完成 -->
|
||
<template v-else-if="Number(order.status) === 8">
|
||
<view class="b-btn primary clickable-hover" @tap="goWallet">查看钱包账单</view>
|
||
</template>
|
||
|
||
<!-- 其他状态(取消/售后) -->
|
||
<template v-else>
|
||
<view class="b-btn outline clickable-hover" @tap="goOrdersList">返回工单列表</view>
|
||
</template>
|
||
</view>
|
||
</template>
|
||
|
||
<!-- 抢单大厅待抢/报价操作栏 -->
|
||
<template v-else>
|
||
<view class="bar-icon-btn clickable-hover" @tap="contactPlatform">
|
||
<image class="bi-ico" src="/static/icons/customer-service-gray.svg" mode="aspectFit" />
|
||
<text class="bi-txt">客服</text>
|
||
</view>
|
||
<view class="bar-btns">
|
||
<view
|
||
v-if="order.can_grab"
|
||
class="b-btn primary clickable-hover"
|
||
:class="{ disabled: submitting }"
|
||
@tap="doGrab"
|
||
>{{ submitting ? '抢单中...' : '立即抢单' }}</view>
|
||
<view
|
||
v-else-if="order.can_quote"
|
||
class="b-btn primary clickable-hover"
|
||
@tap="openQuoteDrawer"
|
||
>立即提交报价</view>
|
||
<view v-else class="b-btn disabled-solid">
|
||
{{ order.my_quote ? '已提交报价,等待客户选标' : (!order.qualification_allowed ? '暂无有效认证证书' : '当前暂不可接单') }}
|
||
</view>
|
||
</view>
|
||
</template>
|
||
</view>
|
||
</template>
|
||
|
||
<!-- ==================== 抽屉 1:约定/修改上门时间 ==================== -->
|
||
<view class="drawer-mask" v-if="showSchedule" @tap="showSchedule = false">
|
||
<view class="drawer-panel" @tap.stop>
|
||
<view class="dp-head">
|
||
<text class="dp-title">约定上门服务时间</text>
|
||
<view class="dp-close" @tap="showSchedule = false">
|
||
<image class="close-ico" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<text class="dp-label">选择上门日期</text>
|
||
<scroll-view scroll-x class="date-scroll" :show-scrollbar="false">
|
||
<view class="date-pills">
|
||
<view
|
||
class="date-pill clickable-hover"
|
||
:class="{ on: scheduleDateIdx === idx }"
|
||
v-for="(d, idx) in dateOptions"
|
||
:key="d.dateStr"
|
||
@tap="scheduleDateIdx = idx"
|
||
>
|
||
<text class="dp-week">{{ d.label }}</text>
|
||
<text class="dp-day">{{ d.shortDate }}</text>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
|
||
<text class="dp-label">选择具体到达时间</text>
|
||
<view class="slot-grid">
|
||
<view
|
||
class="slot-pill clickable-hover"
|
||
:class="{ on: scheduleHour === h }"
|
||
v-for="h in hourOptions"
|
||
:key="h"
|
||
@tap="scheduleHour = h"
|
||
>{{ h }}</view>
|
||
</view>
|
||
|
||
<view class="dp-submit clickable-hover" :class="{ disabled: submitting }" @tap="submitSchedule">
|
||
{{ submitting ? '保存中...' : '确认约定上门时间' }}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 抽屉 2:发起施工增项补差 ==================== -->
|
||
<view class="drawer-mask" v-if="showDiff" @tap="showDiff = false">
|
||
<view class="drawer-panel" @tap.stop>
|
||
<view class="dp-head">
|
||
<text class="dp-title">发起施工增项补差</text>
|
||
<view class="dp-close" @tap="showDiff = false">
|
||
<image class="close-ico" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<view class="form-row">
|
||
<text class="fr-label">补差金额(元)</text>
|
||
<input class="fr-input" type="digit" v-model="diffForm.amount" placeholder="请与客户协商一致后输入金额" />
|
||
</view>
|
||
|
||
<view class="form-col">
|
||
<text class="fr-label">增项原因说明</text>
|
||
<textarea
|
||
class="fr-textarea"
|
||
v-model="diffForm.remark"
|
||
maxlength="200"
|
||
placeholder="请如实填写增项明细(如:远程运输、特殊墙体打孔、拆旧清运、辅材配件等)"
|
||
/>
|
||
</view>
|
||
|
||
<view class="form-col">
|
||
<text class="fr-label">现场凭证照片(选填)</text>
|
||
<view class="upload-row">
|
||
<view class="up-item" v-if="diffForm.image">
|
||
<image class="up-img" :src="diffForm.image" mode="aspectFill" />
|
||
<view class="up-del" @tap="diffForm.image = ''">
|
||
<image class="del-ico" src="/static/icons/media-del-white.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
<view class="up-add clickable-hover" v-else @tap="chooseDiffImg">
|
||
<image class="cam-ico" src="/static/icons/camera.svg" mode="aspectFit" />
|
||
<text class="cam-txt">上传凭证</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="dp-submit clickable-hover" :class="{ disabled: submitting }" @tap="submitDiff">
|
||
{{ submitting ? '提交中...' : '发送补差申请给客户' }}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 抽屉 3:水印拍照完工提交 ==================== -->
|
||
<view class="drawer-mask" v-if="showFinish" @tap="showFinish = false">
|
||
<view class="drawer-panel" @tap.stop>
|
||
<view class="dp-head">
|
||
<text class="dp-title">上传完工现场照片</text>
|
||
<view class="dp-close" @tap="showFinish = false">
|
||
<image class="close-ico" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<text class="dp-sub-tip">照片将自动合成当前时间与工单地址防伪水印,最多可上传 6 张</text>
|
||
|
||
<view class="upload-grid">
|
||
<view class="up-item" v-for="(im, idx) in finishForm.images" :key="idx">
|
||
<image class="up-img" :src="im" mode="aspectFill" @tap="previewImages(finishForm.images, idx)" />
|
||
<view class="up-del" @tap="removeFinishImg(idx)">
|
||
<image class="del-ico" src="/static/icons/media-del-white.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
<view class="up-add clickable-hover" v-if="finishForm.images.length < 6" @tap="addFinishImgs">
|
||
<image class="cam-ico" src="/static/icons/camera.svg" mode="aspectFit" />
|
||
<text class="cam-txt">拍照/上传</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="form-col">
|
||
<text class="fr-label">完工说明 / 现场异常报备(选填)</text>
|
||
<textarea
|
||
class="fr-textarea"
|
||
v-model="finishForm.damage_remark"
|
||
maxlength="200"
|
||
placeholder="若商品存在开箱破损或特殊施工情况,请在此说明留档"
|
||
/>
|
||
</view>
|
||
|
||
<view class="dp-submit clickable-hover" :class="{ disabled: submitting }" @tap="submitFinish">
|
||
{{ submitting ? '提交中...' : '确认完工并通知客户验收' }}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 抽屉 4:输入客户 6 位核销码结算 ==================== -->
|
||
<view class="drawer-mask" v-if="showVerify" @tap="showVerify = false">
|
||
<view class="drawer-panel" @tap.stop>
|
||
<view class="dp-head">
|
||
<text class="dp-title">输入验收核销码</text>
|
||
<view class="dp-close" @tap="showVerify = false">
|
||
<image class="close-ico" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<text class="dp-sub-tip">请向客户索取订单详情页中的 6 位数字验收码,核销成功后工钱即刻结算至您的钱包</text>
|
||
|
||
<input
|
||
class="verify-code-input"
|
||
type="number"
|
||
maxlength="6"
|
||
v-model="verifyCodeVal"
|
||
placeholder="请输入 6 位核销码"
|
||
/>
|
||
|
||
<view class="dp-submit clickable-hover" :class="{ disabled: submitting }" @tap="submitVerifyCode">
|
||
{{ submitting ? '核销结算中...' : '确认核销并结算工费' }}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- ==================== 抽屉 5:大厅竞价工单提交报价 ==================== -->
|
||
<view class="drawer-mask" v-if="showQuote" @tap="showQuote = false">
|
||
<view class="drawer-panel" @tap.stop>
|
||
<view class="dp-head">
|
||
<text class="dp-title">提交工单报价</text>
|
||
<view class="dp-close" @tap="showQuote = false">
|
||
<image class="close-ico" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<view class="form-row">
|
||
<text class="fr-label">报价金额(元)</text>
|
||
<input class="fr-input" type="digit" v-model="quoteForm.amount" placeholder="请输入合理全包施工报价" />
|
||
</view>
|
||
|
||
<view class="form-col">
|
||
<text class="fr-label">服务承诺与说明(选填)</text>
|
||
<textarea
|
||
class="fr-textarea"
|
||
v-model="quoteForm.description"
|
||
maxlength="200"
|
||
placeholder="例如:经验丰富自带专业工具,准时上门,包清理现场"
|
||
/>
|
||
</view>
|
||
|
||
<view class="dp-submit clickable-hover" :class="{ disabled: submitting }" @tap="submitQuote">
|
||
{{ submitting ? '提交中...' : '立即发送报价' }}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 客户安装视频预览弹窗 -->
|
||
<view class="drawer-mask" v-if="activeVideoUrl" @tap="activeVideoUrl = ''">
|
||
<view class="drawer-panel" @tap.stop>
|
||
<view class="dp-head">
|
||
<text class="dp-title">客户安装视频</text>
|
||
<view class="dp-close" @tap="activeVideoUrl = ''">
|
||
<image class="close-ico" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
<video class="master-video-player" :src="activeVideoUrl" controls autoplay />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 离屏水印合成画布 -->
|
||
<canvas
|
||
id="detailWatermarkCanvas"
|
||
canvas-id="detailWatermarkCanvas"
|
||
:style="{ width: canvasW + 'px', height: canvasH + 'px', position: 'fixed', left: '-9999px', top: '-9999px' }"
|
||
></canvas>
|
||
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, reactive, computed, onBeforeUnmount, getCurrentInstance } from 'vue';
|
||
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app';
|
||
import YjyfNavBar from '@/components/YjyfNavBar.vue';
|
||
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
|
||
import api from '@/utils/api.js';
|
||
import { isLogin, toLogin } from '@/utils/request.js';
|
||
|
||
const instance = getCurrentInstance()?.proxy;
|
||
|
||
const orderId = ref(0);
|
||
const initialAction = ref('');
|
||
const order = ref(null);
|
||
const loading = ref(false);
|
||
const loadError = ref('');
|
||
const submitting = ref(false);
|
||
|
||
const remainSec = ref(0);
|
||
const contactRemainSec = ref(0);
|
||
let timer = null;
|
||
|
||
// 抽屉显隐控制
|
||
const showSchedule = ref(false);
|
||
const showDiff = ref(false);
|
||
const showFinish = ref(false);
|
||
const showVerify = ref(false);
|
||
const showQuote = ref(false);
|
||
const activeVideoUrl = ref('');
|
||
|
||
// 预约上门表单
|
||
const scheduleDateIdx = ref(0);
|
||
const scheduleHour = ref('10:00');
|
||
const hourOptions = ['09:00', '10:00', '11:00', '14:00', '15:00', '16:00', '17:00', '19:00'];
|
||
|
||
const dateOptions = computed(() => {
|
||
const arr = [];
|
||
const weekNames = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
||
const pad = (n) => String(n).padStart(2, '0');
|
||
for (let i = 0; i < 7; i++) {
|
||
const d = new Date(Date.now() + i * 86400000);
|
||
const y = d.getFullYear();
|
||
const m = pad(d.getMonth() + 1);
|
||
const day = pad(d.getDate());
|
||
const label = i === 0 ? '今天' : (i === 1 ? '明天' : weekNames[d.getDay()]);
|
||
arr.push({
|
||
label,
|
||
shortDate: `${m}-${day}`,
|
||
dateStr: `${y}-${m}-${day}`
|
||
});
|
||
}
|
||
return arr;
|
||
});
|
||
|
||
// 增项补差表单
|
||
const diffForm = reactive({
|
||
amount: '',
|
||
remark: '',
|
||
image: ''
|
||
});
|
||
|
||
// 完工取证表单
|
||
const finishForm = reactive({
|
||
images: [],
|
||
damage_remark: ''
|
||
});
|
||
|
||
// 核销码与报价表单
|
||
const verifyCodeVal = ref('');
|
||
const quoteForm = reactive({
|
||
amount: '',
|
||
description: ''
|
||
});
|
||
|
||
// 水印画布尺寸
|
||
const canvasW = ref(750);
|
||
const canvasH = ref(1000);
|
||
|
||
const stepItems = [
|
||
{ label: '已接单' },
|
||
{ label: '待上门' },
|
||
{ label: '已到达' },
|
||
{ label: '服务中' },
|
||
{ label: '已核销' }
|
||
];
|
||
|
||
const stepIndex = computed(() => {
|
||
const st = Number(order.value && order.value.status);
|
||
if (st === 3) return 0;
|
||
if (st === 4) return 1;
|
||
if (st === 5) return 2;
|
||
if (st === 6) return 3;
|
||
if (st === 7) return 4;
|
||
if (st === 8) return 5;
|
||
return 0;
|
||
});
|
||
|
||
const canSchedule = computed(() => {
|
||
const st = Number(order.value && order.value.status);
|
||
return st === 3 || st === 4;
|
||
});
|
||
|
||
const myStatusDesc = computed(() => {
|
||
if (!order.value) return '';
|
||
const st = Number(order.value.status);
|
||
if (st === 3) return '请尽快致电客户,确认具体上门服务时间';
|
||
if (st === 4) return '请携带专业工具准时上门,到达后点击现场打卡';
|
||
if (st === 5) return '已到达服务地点,与客户确认商品无误后开始施工';
|
||
if (st === 6) return '施工完成后请拍摄现场水印照片提交验收';
|
||
if (st === 7) return '等待客户确认验收,您也可向客户索取 6 位核销码当场结算';
|
||
if (st === 8) return '工单已核销完成,服务报酬已结算至您的师傅钱包';
|
||
if (st === 9) return '该工单已取消';
|
||
return '售后跟进处理中';
|
||
});
|
||
|
||
const countdownText = computed(() => {
|
||
const s = Number(remainSec.value || 0);
|
||
if (s <= 0) return '';
|
||
const d = Math.floor(s / 86400);
|
||
const h = Math.floor((s % 86400) / 3600);
|
||
const m = Math.floor((s % 3600) / 60);
|
||
if (d > 0) return `${d}天${h}小时`;
|
||
return `${h}小时${m}分`;
|
||
});
|
||
|
||
const contactRemainText = computed(() => {
|
||
const s = Number(contactRemainSec.value || 0);
|
||
if (s <= 0) return '';
|
||
const m = Math.floor(s / 60);
|
||
const sec = s % 60;
|
||
return `${m}分${String(sec).padStart(2, '0')}秒`;
|
||
});
|
||
|
||
function quoteStatusText(st) {
|
||
const map = { wait: '等待客户选标', accept: '已中标', reject: '未中标', expired: '已过期' };
|
||
return map[st] || st;
|
||
}
|
||
|
||
function startTicker() {
|
||
if (timer) clearInterval(timer);
|
||
timer = setInterval(() => {
|
||
if (remainSec.value > 0) remainSec.value -= 1;
|
||
if (contactRemainSec.value > 0) contactRemainSec.value -= 1;
|
||
}, 1000);
|
||
}
|
||
|
||
function getUserLocationSilent() {
|
||
return new Promise((resolve) => {
|
||
uni.getLocation({
|
||
type: 'gcj02',
|
||
success: (loc) => resolve({ lat: loc.latitude, lng: loc.longitude }),
|
||
fail: () => resolve({})
|
||
});
|
||
});
|
||
}
|
||
|
||
async function loadDetail() {
|
||
if (!orderId.value) return;
|
||
loading.value = true;
|
||
loadError.value = '';
|
||
try {
|
||
const loc = await getUserLocationSilent();
|
||
const res = await api.masterOrderDetail(orderId.value, loc);
|
||
order.value = res;
|
||
remainSec.value = Number(res && res.countdown_seconds ? res.countdown_seconds : 0);
|
||
contactRemainSec.value = Number(res && res.contact_remain ? res.contact_remain : 0);
|
||
startTicker();
|
||
|
||
// 响应来自列表页快捷直达的抽屉指令
|
||
if (initialAction.value && res && res.is_my_order) {
|
||
const act = initialAction.value;
|
||
initialAction.value = '';
|
||
if (act === 'schedule' && canSchedule.value) openScheduleDrawer();
|
||
else if (act === 'diff' && (Number(res.status) === 5 || Number(res.status) === 6)) openDiffDrawer();
|
||
else if (act === 'finish' && Number(res.status) === 6) openFinishDrawer();
|
||
else if (act === 'verify' && Number(res.status) === 7) openVerifyDrawer();
|
||
}
|
||
} catch (e) {
|
||
loadError.value = (e && e.msg) ? e.msg : '获取工单详情失败';
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
|
||
const contactingCustomer = ref(false);
|
||
const uploadingMedia = ref(false);
|
||
|
||
async function callCustomer() {
|
||
if (!order.value || !order.value.mobile) return;
|
||
if (order.value.is_my_order && !order.value.contact_time && !contactingCustomer.value) {
|
||
contactingCustomer.value = true;
|
||
try {
|
||
await api.masterContact({ order_id: order.value.id });
|
||
order.value.contact_time = Math.floor(Date.now() / 1000);
|
||
contactRemainSec.value = 0;
|
||
} catch (e) {
|
||
} finally {
|
||
contactingCustomer.value = false;
|
||
}
|
||
}
|
||
uni.makePhoneCall({ phoneNumber: order.value.mobile, fail: () => {} });
|
||
}
|
||
|
||
async function markContacted() {
|
||
if (!order.value || submitting.value) return;
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterContact({ order_id: order.value.id });
|
||
uni.showToast({ title: '已记录首联时间' });
|
||
loadDetail();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
function openMapNav() {
|
||
if (!order.value) return;
|
||
const lat = Number(order.value.lat);
|
||
const lng = Number(order.value.lng);
|
||
if (lat && lng) {
|
||
uni.openLocation({
|
||
latitude: lat,
|
||
longitude: lng,
|
||
name: order.value.service_name || '客户服务地址',
|
||
address: order.value.full_address || '',
|
||
fail: () => {
|
||
uni.setClipboardData({ data: order.value.full_address || '' });
|
||
}
|
||
});
|
||
} else {
|
||
uni.setClipboardData({
|
||
data: order.value.full_address || '',
|
||
success: () => {
|
||
uni.showToast({ title: '已复制详细地址,可粘贴至导航软件', icon: 'none' });
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
function openScheduleDrawer() {
|
||
showSchedule.value = true;
|
||
}
|
||
|
||
async function submitSchedule() {
|
||
if (submitting.value || !order.value) return;
|
||
const chosenDate = dateOptions.value[scheduleDateIdx.value];
|
||
if (!chosenDate) return;
|
||
const dtStr = `${chosenDate.dateStr} ${scheduleHour.value}:00`.replace(/-/g, '/');
|
||
const ts = Math.floor(new Date(dtStr).getTime() / 1000);
|
||
if (!ts || ts <= 0) {
|
||
uni.showToast({ title: '请选择有效的预约时间', icon: 'none' });
|
||
return;
|
||
}
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterSchedule({ order_id: order.value.id, appoint_time: ts });
|
||
showSchedule.value = false;
|
||
uni.showToast({ title: '预约时间已保存' });
|
||
await loadDetail();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
async function doArrive() {
|
||
if (submitting.value || !order.value) return;
|
||
submitting.value = true;
|
||
try {
|
||
const loc = await getUserLocationSilent();
|
||
await api.masterArrive({
|
||
order_id: order.value.id,
|
||
lat: loc.lat || '',
|
||
lng: loc.lng || ''
|
||
});
|
||
uni.showToast({ title: '现场打卡成功' });
|
||
loadDetail();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
async function doStartJob() {
|
||
if (submitting.value || !order.value) return;
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterStart({ order_id: order.value.id });
|
||
uni.showToast({ title: '已开始施工服务' });
|
||
loadDetail();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
function openDiffDrawer() {
|
||
diffForm.amount = order.value && order.value.diff_amount > 0 ? String(order.value.diff_amount) : '';
|
||
diffForm.remark = order.value && order.value.diff_remark ? order.value.diff_remark : '';
|
||
diffForm.image = order.value && order.value.diff_image ? order.value.diff_image : '';
|
||
showDiff.value = true;
|
||
}
|
||
|
||
function chooseDiffImg() {
|
||
if (uploadingMedia.value || submitting.value) return;
|
||
uni.chooseImage({
|
||
count: 1,
|
||
sizeType: ['compressed'],
|
||
success: async (r) => {
|
||
if (!r.tempFilePaths || !r.tempFilePaths.length) return;
|
||
uploadingMedia.value = true;
|
||
uni.showLoading({ title: '上传中...', mask: true });
|
||
try {
|
||
const up = await api.upload(r.tempFilePaths[0], 'order');
|
||
diffForm.image = up.fullurl || up.url;
|
||
} catch (e) {
|
||
} finally {
|
||
uploadingMedia.value = false;
|
||
uni.hideLoading();
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
async function submitDiff() {
|
||
if (submitting.value || uploadingMedia.value || !order.value) {
|
||
if (uploadingMedia.value) uni.showToast({ title: '图片上传中,请稍候', icon: 'none' });
|
||
return;
|
||
}
|
||
const amt = Number(diffForm.amount);
|
||
if (!amt || amt <= 0) {
|
||
uni.showToast({ title: '请输入有效的增项补差金额', icon: 'none' });
|
||
return;
|
||
}
|
||
if (!diffForm.remark.trim()) {
|
||
uni.showToast({ title: '请填写具体的增项原因说明', icon: 'none' });
|
||
return;
|
||
}
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterRequestDiff({
|
||
order_id: order.value.id,
|
||
amount: amt,
|
||
remark: diffForm.remark.trim(),
|
||
image: diffForm.image
|
||
});
|
||
showDiff.value = false;
|
||
uni.showToast({ title: '补差申请已发送' });
|
||
loadDetail();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
function createWatermarkedTempFile(tempPath) {
|
||
return new Promise((resolve) => {
|
||
let settled = false;
|
||
const safeResolve = (val) => {
|
||
if (settled) return;
|
||
settled = true;
|
||
if (safetyTimer) clearTimeout(safetyTimer);
|
||
resolve(val || tempPath);
|
||
};
|
||
// 4秒超时安全保护:防止小程序或H5离屏Canvas未触发draw回调导致永久卡死
|
||
const safetyTimer = setTimeout(() => {
|
||
safeResolve(tempPath);
|
||
}, 4000);
|
||
|
||
uni.getImageInfo({
|
||
src: tempPath,
|
||
success: (info) => {
|
||
if (settled) return;
|
||
let w = info.width || 750;
|
||
let h = info.height || 1000;
|
||
const maxEdge = 1200;
|
||
if (w > maxEdge || h > maxEdge) {
|
||
if (w > h) {
|
||
h = Math.round((h * maxEdge) / w);
|
||
w = maxEdge;
|
||
} else {
|
||
w = Math.round((w * maxEdge) / h);
|
||
h = maxEdge;
|
||
}
|
||
}
|
||
canvasW.value = w;
|
||
canvasH.value = h;
|
||
setTimeout(() => {
|
||
if (settled) return;
|
||
try {
|
||
const ctx = uni.createCanvasContext('detailWatermarkCanvas', instance);
|
||
ctx.drawImage(info.path || tempPath, 0, 0, w, h);
|
||
const barH = Math.max(88, Math.round(h * 0.12));
|
||
ctx.setFillStyle('rgba(0, 0, 0, 0.52)');
|
||
ctx.fillRect(0, h - barH, w, barH);
|
||
const pad = (n) => String(n).padStart(2, '0');
|
||
const now = new Date();
|
||
const timeStr = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}`;
|
||
const fontSize = Math.max(16, Math.round(w * 0.028));
|
||
ctx.setFillStyle('#FFFFFF');
|
||
ctx.setFontSize(fontSize);
|
||
ctx.fillText(`优匠优服完工取证 · ${timeStr}`, 20, h - Math.round(barH * 0.56));
|
||
const addr = (order.value && order.value.full_address) ? order.value.full_address.slice(0, 26) : '';
|
||
ctx.setFontSize(Math.max(14, Math.round(fontSize * 0.85)));
|
||
ctx.fillText(`地址:${addr}`, 20, h - Math.round(barH * 0.2));
|
||
ctx.draw(false, () => {
|
||
if (settled) return;
|
||
uni.canvasToTempFilePath({
|
||
canvasId: 'detailWatermarkCanvas',
|
||
fileType: 'jpg',
|
||
quality: 0.85,
|
||
success: (res) => safeResolve(res.tempFilePath || tempPath),
|
||
fail: () => safeResolve(tempPath)
|
||
}, instance);
|
||
});
|
||
} catch (err) {
|
||
safeResolve(tempPath);
|
||
}
|
||
}, 80);
|
||
},
|
||
fail: () => safeResolve(tempPath)
|
||
});
|
||
});
|
||
}
|
||
|
||
function openFinishDrawer() {
|
||
showFinish.value = true;
|
||
}
|
||
|
||
function addFinishImgs() {
|
||
if (uploadingMedia.value || submitting.value) return;
|
||
const remain = 6 - finishForm.images.length;
|
||
if (remain <= 0) return;
|
||
uni.chooseImage({
|
||
count: remain,
|
||
sizeType: ['compressed'],
|
||
sourceType: ['camera', 'album'],
|
||
success: async (r) => {
|
||
const paths = r.tempFilePaths || [];
|
||
if (!paths.length) return;
|
||
uploadingMedia.value = true;
|
||
uni.showLoading({ title: '合成水印上传中...', mask: true });
|
||
try {
|
||
for (const p of paths) {
|
||
const wmPath = await createWatermarkedTempFile(p);
|
||
const up = await api.upload(wmPath, 'order');
|
||
finishForm.images.push(up.fullurl || up.url);
|
||
}
|
||
} catch (e) {
|
||
} finally {
|
||
uploadingMedia.value = false;
|
||
uni.hideLoading();
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
function removeFinishImg(idx) {
|
||
if (submitting.value) return;
|
||
finishForm.images.splice(idx, 1);
|
||
}
|
||
|
||
async function submitFinish() {
|
||
if (submitting.value || uploadingMedia.value || !order.value) {
|
||
if (uploadingMedia.value) uni.showToast({ title: '照片正在上传中,请稍候', icon: 'none' });
|
||
return;
|
||
}
|
||
if (!finishForm.images.length) {
|
||
uni.showToast({ title: '请至少上传 1 张完工现场照片', icon: 'none' });
|
||
return;
|
||
}
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterFinish({
|
||
order_id: order.value.id,
|
||
images: finishForm.images,
|
||
damage_remark: finishForm.damage_remark.trim()
|
||
});
|
||
showFinish.value = false;
|
||
uni.showToast({ title: '已提交完工,请请客户出示核销码' });
|
||
loadDetail();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
function openVerifyDrawer() {
|
||
verifyCodeVal.value = '';
|
||
showVerify.value = true;
|
||
}
|
||
|
||
async function submitVerifyCode() {
|
||
if (submitting.value || !order.value) return;
|
||
const code = verifyCodeVal.value.trim();
|
||
if (!/^\d{6}$/.test(code)) {
|
||
uni.showToast({ title: '请输入 6 位数字验收核销码', icon: 'none' });
|
||
return;
|
||
}
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterVerifyCode({
|
||
order_id: order.value.id,
|
||
verify_code: code
|
||
});
|
||
showVerify.value = false;
|
||
uni.showToast({ title: '核销成功,工费已入账钱包' });
|
||
loadDetail();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
function handleAuthRequiredError(e) {
|
||
if (!e || (e.code !== 2001 && e.code !== 2002 && e.code !== 2003)) {
|
||
return false;
|
||
}
|
||
const isPending = e.code === 2002;
|
||
const isReject = e.code === 2003;
|
||
uni.showModal({
|
||
title: isPending ? '实名认证审核中' : (isReject ? '实名认证未通过' : '请先完成实名认证'),
|
||
content: isPending
|
||
? '您的师傅实名认证正在审核中,审核通过后即可接单或报价。'
|
||
: (isReject ? '您的实名认证未通过,请修改资料并重新提交后方可接单或报价。' : '完成实名认证后方可接单或报价,是否立即前往认证?'),
|
||
confirmText: isPending ? '查看进度' : (isReject ? '去修改' : '去认证'),
|
||
confirmColor: '#F0710D',
|
||
success: (res) => {
|
||
if (res.confirm) {
|
||
uni.navigateTo({ url: '/pages/master/apply' });
|
||
}
|
||
}
|
||
});
|
||
return true;
|
||
}
|
||
|
||
async function doGrab() {
|
||
if (!isLogin()) {
|
||
toLogin();
|
||
return;
|
||
}
|
||
if (submitting.value || !order.value) return;
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterGrab({ order_id: order.value.id });
|
||
uni.redirectTo({
|
||
url: `/pages/master/success?order_id=${order.value.id}`,
|
||
complete: () => { submitting.value = false; }
|
||
});
|
||
} catch (e) {
|
||
submitting.value = false;
|
||
handleAuthRequiredError(e);
|
||
}
|
||
}
|
||
|
||
function openQuoteDrawer() {
|
||
if (!isLogin()) {
|
||
toLogin();
|
||
return;
|
||
}
|
||
quoteForm.amount = '';
|
||
quoteForm.description = '';
|
||
showQuote.value = true;
|
||
}
|
||
function goCerts() {
|
||
uni.navigateTo({ url: '/pages/master/certs' });
|
||
}
|
||
|
||
async function submitQuote() {
|
||
if (submitting.value || !order.value) return;
|
||
const amt = Number(quoteForm.amount);
|
||
if (!amt || amt <= 0) {
|
||
uni.showToast({ title: '请输入有效的报价金额', icon: 'none' });
|
||
return;
|
||
}
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterQuote({
|
||
order_id: order.value.id,
|
||
amount: amt,
|
||
description: quoteForm.description.trim()
|
||
});
|
||
showQuote.value = false;
|
||
uni.showToast({ title: '报价已发送,等待客户选择' });
|
||
loadDetail();
|
||
} catch (e) {
|
||
if (handleAuthRequiredError(e)) {
|
||
showQuote.value = false;
|
||
}
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
function previewImages(urls, idx) {
|
||
if (!urls || !urls.length) return;
|
||
uni.previewImage({ urls, current: urls[idx] });
|
||
}
|
||
|
||
function copyOrderNo() {
|
||
if (!order.value) return;
|
||
uni.setClipboardData({
|
||
data: order.value.order_no,
|
||
success: () => uni.showToast({ title: '工单号已复制' })
|
||
});
|
||
}
|
||
|
||
const servicePopupVisible = ref(false);
|
||
|
||
function contactPlatform() {
|
||
servicePopupVisible.value = true;
|
||
}
|
||
|
||
function goWallet() {
|
||
uni.navigateTo({ url: '/pages/master/wallet' });
|
||
}
|
||
|
||
function goOrdersList() {
|
||
uni.reLaunch({ url: '/pages/master/hall?tab=1' });
|
||
}
|
||
|
||
onLoad((opts) => {
|
||
if (opts && opts.id) {
|
||
orderId.value = Number(opts.id) || 0;
|
||
}
|
||
if (opts && opts.action) {
|
||
initialAction.value = String(opts.action);
|
||
}
|
||
});
|
||
|
||
onShow(() => {
|
||
if (orderId.value) {
|
||
loadDetail();
|
||
}
|
||
});
|
||
|
||
onPullDownRefresh(async () => {
|
||
try {
|
||
await loadDetail();
|
||
if (loadError.value && order.value) {
|
||
uni.showToast({ title: loadError.value, icon: 'none' });
|
||
}
|
||
} finally {
|
||
uni.stopPullDownRefresh();
|
||
}
|
||
});
|
||
|
||
onBeforeUnmount(() => {
|
||
if (timer) clearInterval(timer);
|
||
});
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.qualification-card { display: flex; flex-wrap: wrap; gap: 12rpx; color: $yjyf-text-regular; font-size: $yjyf-font-sub; }
|
||
.qualification-warning { color: $yjyf-danger; }
|
||
.qualification-link { color: $yjyf-primary; }
|
||
@import '@/uni.scss';
|
||
.page {
|
||
min-height: 100vh;
|
||
background: $yjyf-bg-page;
|
||
padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
|
||
}
|
||
|
||
.state-box {
|
||
padding: 160rpx 48rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.empty-ico {
|
||
width: 180rpx;
|
||
height: 180rpx;
|
||
}
|
||
|
||
.state-txt {
|
||
font-size: $yjyf-font-base;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.retry-btn {
|
||
margin-top: 12rpx;
|
||
height: 68rpx;
|
||
padding: 0 40rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-gradient-primary;
|
||
color: $yjyf-text-inverse;
|
||
font-size: $yjyf-font-sm;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
/* 履约状态头部卡 */
|
||
.status-hero {
|
||
margin: 24rpx;
|
||
padding: 32rpx 28rpx;
|
||
border-radius: $yjyf-radius-card;
|
||
background: $yjyf-bg-card;
|
||
box-shadow: $yjyf-shadow-card;
|
||
}
|
||
|
||
.sh-top {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.sh-title-box {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 8rpx;
|
||
}
|
||
|
||
.sh-status {
|
||
font-size: 36rpx;
|
||
font-weight: 800;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.sh-tip {
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-text-secondary;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.sh-fee-box {
|
||
text-align: right;
|
||
flex-shrink: 0;
|
||
padding: 12rpx 20rpx;
|
||
border-radius: $yjyf-radius-md;
|
||
background: $yjyf-primary-bg;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 4rpx;
|
||
}
|
||
|
||
.sh-fee-label {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.sh-fee-val {
|
||
font-size: $yjyf-font-lg;
|
||
font-weight: 800;
|
||
color: $yjyf-primary;
|
||
}
|
||
|
||
.contact-alert {
|
||
margin-top: 24rpx;
|
||
padding: 18rpx 20rpx;
|
||
border-radius: 14rpx;
|
||
background: $yjyf-primary-bg;
|
||
border: 1rpx solid $yjyf-primary-border;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.ca-ico {
|
||
width: 30rpx;
|
||
height: 30rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.ca-txt {
|
||
flex: 1;
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.ca-btn {
|
||
padding: 8rpx 20rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary;
|
||
color: $yjyf-text-inverse;
|
||
font-size: $yjyf-font-xs;
|
||
font-weight: 600;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
/* 5步进度条 */
|
||
.steps-bar {
|
||
margin-top: 32rpx;
|
||
padding-top: 24rpx;
|
||
border-top: 1rpx solid $yjyf-border-color;
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.step-node {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: 10rpx;
|
||
}
|
||
|
||
.sn-dot-row {
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.sn-line {
|
||
flex: 1;
|
||
height: 4rpx;
|
||
background: $yjyf-border-color;
|
||
|
||
&.active {
|
||
background: $yjyf-primary;
|
||
}
|
||
|
||
&.hidden {
|
||
background: transparent;
|
||
}
|
||
}
|
||
|
||
.sn-dot {
|
||
width: 38rpx;
|
||
height: 38rpx;
|
||
border-radius: 50%;
|
||
background: $yjyf-bg-page;
|
||
border: 2rpx solid $yjyf-text-disabled;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.sn-idx {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-muted;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.sn-check {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
}
|
||
|
||
.sn-label {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-muted;
|
||
}
|
||
|
||
.step-node.done .sn-dot {
|
||
background: $yjyf-primary;
|
||
border-color: $yjyf-primary;
|
||
}
|
||
|
||
.step-node.done .sn-idx {
|
||
color: $yjyf-text-inverse;
|
||
}
|
||
|
||
.step-node.done .sn-label {
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.step-node.current .sn-label {
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
|
||
/* 大厅待抢横幅 */
|
||
.hall-banner {
|
||
margin: 24rpx;
|
||
padding: 32rpx 28rpx;
|
||
border-radius: $yjyf-radius-card;
|
||
background: $yjyf-gradient-primary;
|
||
color: $yjyf-text-inverse;
|
||
box-shadow: $yjyf-shadow-button;
|
||
}
|
||
|
||
.hb-top {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.hb-type-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.hb-badge {
|
||
padding: 6rpx 18rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: rgba(255, 255, 255, 0.22);
|
||
font-size: $yjyf-font-xs;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.hb-urgent {
|
||
padding: 6rpx 16rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-bg-card;
|
||
color: $yjyf-danger;
|
||
font-size: $yjyf-font-xs;
|
||
font-weight: 700;
|
||
}
|
||
|
||
.hb-countdown {
|
||
font-size: $yjyf-font-xs;
|
||
opacity: 0.92;
|
||
}
|
||
|
||
.hb-price-row {
|
||
margin-top: 24rpx;
|
||
}
|
||
|
||
.hb-price-label {
|
||
font-size: $yjyf-font-sm;
|
||
opacity: 0.9;
|
||
}
|
||
|
||
.hb-amt {
|
||
margin-top: 6rpx;
|
||
display: flex;
|
||
align-items: baseline;
|
||
}
|
||
|
||
.hb-sym {
|
||
font-size: $yjyf-font-lg;
|
||
font-weight: 700;
|
||
margin-right: 4rpx;
|
||
}
|
||
|
||
.hb-num {
|
||
font-size: 52rpx;
|
||
font-weight: 800;
|
||
line-height: 1.1;
|
||
}
|
||
|
||
.hb-quote-tip {
|
||
display: block;
|
||
margin-top: 10rpx;
|
||
font-size: $yjyf-font-base;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* 标准卡片容器 */
|
||
.card {
|
||
margin: 0 24rpx 24rpx;
|
||
padding: 28rpx;
|
||
background: $yjyf-bg-card;
|
||
border-radius: $yjyf-radius-card;
|
||
box-shadow: $yjyf-shadow-card;
|
||
}
|
||
|
||
.card-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 22rpx;
|
||
}
|
||
|
||
.card-title {
|
||
font-size: $yjyf-font-md;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.urgent-pill {
|
||
padding: 4rpx 16rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: rgba(232, 51, 27, 0.1);
|
||
color: $yjyf-danger;
|
||
font-size: $yjyf-font-xs;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.dist-pill,
|
||
.cat-tag,
|
||
.q-state-tag {
|
||
padding: 4rpx 16rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
color: $yjyf-primary;
|
||
font-size: $yjyf-font-xs;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.diff-badge,
|
||
.settle-tag {
|
||
padding: 4rpx 16rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
color: $yjyf-warning;
|
||
font-size: $yjyf-font-xs;
|
||
font-weight: 600;
|
||
|
||
&.paid,
|
||
&.ok {
|
||
background: rgba(47, 168, 79, 0.1);
|
||
color: $yjyf-success;
|
||
}
|
||
}
|
||
|
||
/* 客户与地址 */
|
||
.customer-box {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 20rpx;
|
||
padding-bottom: 24rpx;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
}
|
||
|
||
.cust-avatar {
|
||
width: 80rpx;
|
||
height: 80rpx;
|
||
border-radius: 50%;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.cust-info {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 6rpx;
|
||
}
|
||
|
||
.cust-name {
|
||
font-size: $yjyf-font-base;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.cust-phone {
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.action-pill {
|
||
height: 64rpx;
|
||
padding: 0 24rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-primary-bg;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.ap-ico {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
}
|
||
|
||
.ap-txt {
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.addr-box {
|
||
padding: 24rpx 0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.addr-main {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.addr-row {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.loc-ico {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
margin-top: 4rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.addr-text {
|
||
flex: 1;
|
||
font-size: $yjyf-font-base;
|
||
color: $yjyf-text-main;
|
||
font-weight: 600;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.meta-pills {
|
||
margin-top: 14rpx;
|
||
padding-left: 44rpx;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.m-pill {
|
||
padding: 4rpx 16rpx;
|
||
border-radius: 8rpx;
|
||
background: $yjyf-bg-page;
|
||
color: $yjyf-text-regular;
|
||
font-size: $yjyf-font-xs;
|
||
}
|
||
|
||
.nav-btn {
|
||
width: 108rpx;
|
||
height: 108rpx;
|
||
border-radius: $yjyf-radius-md;
|
||
background: $yjyf-primary-bg;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 6rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.nav-ico {
|
||
width: 38rpx;
|
||
height: 38rpx;
|
||
}
|
||
|
||
.nav-txt {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* 键值行 */
|
||
.kv-row {
|
||
padding: 16rpx 0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 20rpx;
|
||
|
||
&.top-border {
|
||
margin-top: 8rpx;
|
||
padding-top: 22rpx;
|
||
border-top: 1rpx solid $yjyf-border-color;
|
||
}
|
||
}
|
||
|
||
.kv-k {
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-text-secondary;
|
||
|
||
&.bold {
|
||
color: $yjyf-text-main;
|
||
font-weight: 700;
|
||
}
|
||
}
|
||
|
||
.kv-v-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8rpx;
|
||
}
|
||
|
||
.kv-v {
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-text-main;
|
||
text-align: right;
|
||
|
||
&.highlight {
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
|
||
&.price {
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
font-size: $yjyf-font-md;
|
||
}
|
||
|
||
&.price-lg {
|
||
color: $yjyf-primary;
|
||
font-weight: 800;
|
||
font-size: 36rpx;
|
||
}
|
||
|
||
&.muted {
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
}
|
||
|
||
.arrow-sm,
|
||
.copy-ico {
|
||
width: 26rpx;
|
||
height: 26rpx;
|
||
}
|
||
|
||
/* 商品列表 */
|
||
.goods-list {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.g-item {
|
||
display: flex;
|
||
gap: 20rpx;
|
||
padding: 18rpx;
|
||
border-radius: $yjyf-radius-md;
|
||
background: $yjyf-bg-page;
|
||
}
|
||
|
||
.g-img {
|
||
width: 120rpx;
|
||
height: 120rpx;
|
||
border-radius: 12rpx;
|
||
background: $yjyf-bg-card;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.g-main {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
justify-content: center;
|
||
gap: 8rpx;
|
||
}
|
||
|
||
.g-top {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.g-name {
|
||
flex: 1;
|
||
font-size: $yjyf-font-base;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.g-num {
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
|
||
.g-sub,
|
||
.g-addon {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.remark-box {
|
||
margin-top: 20rpx;
|
||
padding: 18rpx 20rpx;
|
||
border-radius: 12rpx;
|
||
background: $yjyf-primary-bg;
|
||
font-size: $yjyf-font-sm;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.rk-label {
|
||
color: $yjyf-primary;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.rk-txt {
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.media-sec {
|
||
margin-top: 24rpx;
|
||
}
|
||
|
||
.media-title {
|
||
display: block;
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-text-secondary;
|
||
margin-bottom: 14rpx;
|
||
}
|
||
|
||
.media-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(3, 1fr);
|
||
gap: 14rpx;
|
||
}
|
||
|
||
.media-img {
|
||
width: 100%;
|
||
height: 196rpx;
|
||
border-radius: 12rpx;
|
||
background: $yjyf-bg-page;
|
||
}
|
||
|
||
.diff-img {
|
||
width: 220rpx;
|
||
height: 220rpx;
|
||
border-radius: 12rpx;
|
||
}
|
||
|
||
/* 履约时间线 */
|
||
.timeline {
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.tl-item {
|
||
display: flex;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.tl-left {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
width: 24rpx;
|
||
}
|
||
|
||
.tl-dot {
|
||
width: 16rpx;
|
||
height: 16rpx;
|
||
border-radius: 50%;
|
||
background: $yjyf-text-disabled;
|
||
margin-top: 10rpx;
|
||
}
|
||
|
||
.tl-item.latest .tl-dot {
|
||
width: 20rpx;
|
||
height: 20rpx;
|
||
background: $yjyf-primary;
|
||
}
|
||
|
||
.tl-line {
|
||
flex: 1;
|
||
width: 2rpx;
|
||
background: $yjyf-border-color;
|
||
min-height: 40rpx;
|
||
}
|
||
|
||
.tl-body {
|
||
flex: 1;
|
||
padding-bottom: 26rpx;
|
||
}
|
||
|
||
.tl-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.tl-status {
|
||
font-size: $yjyf-font-sm;
|
||
font-weight: 600;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.tl-item.latest .tl-status {
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
|
||
.tl-time {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-muted;
|
||
}
|
||
|
||
.tl-remark {
|
||
display: block;
|
||
margin-top: 6rpx;
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-secondary;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
/* 底部操作栏(box-sizing: content-box 避免全面屏安全区压缩内容高) */
|
||
.bottom-bar {
|
||
position: fixed;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
z-index: 90;
|
||
height: 112rpx;
|
||
box-sizing: content-box;
|
||
padding: 12rpx 24rpx calc(12rpx + env(safe-area-inset-bottom));
|
||
background: $yjyf-bg-card;
|
||
border-top: 1rpx solid $yjyf-border-color;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.bar-icon-btn {
|
||
width: 104rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 4rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.bi-ico {
|
||
width: 40rpx;
|
||
height: 40rpx;
|
||
}
|
||
|
||
.bi-txt {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
.bar-btns {
|
||
flex: 1;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.b-btn {
|
||
flex: 1;
|
||
height: 84rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
font-size: $yjyf-font-base;
|
||
font-weight: 700;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
&.outline {
|
||
flex: 0.72;
|
||
background: $yjyf-bg-card;
|
||
border: 2rpx solid $yjyf-border-color;
|
||
color: $yjyf-text-regular;
|
||
}
|
||
|
||
&.primary {
|
||
background: $yjyf-gradient-primary;
|
||
color: $yjyf-text-inverse;
|
||
box-shadow: $yjyf-shadow-button;
|
||
}
|
||
|
||
&.disabled {
|
||
opacity: 0.6;
|
||
}
|
||
|
||
&.disabled-solid {
|
||
background: $yjyf-bg-page;
|
||
color: $yjyf-text-muted;
|
||
font-weight: 600;
|
||
}
|
||
}
|
||
|
||
/* 半屏操作抽屉统一规范 */
|
||
.drawer-mask {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 999;
|
||
background: rgba(0, 0, 0, 0.48);
|
||
display: flex;
|
||
align-items: flex-end;
|
||
}
|
||
|
||
.drawer-panel {
|
||
width: 100%;
|
||
max-height: 84vh;
|
||
overflow-y: auto;
|
||
background: $yjyf-bg-card;
|
||
border-radius: 24rpx 24rpx 0 0;
|
||
padding: 32rpx 32rpx calc(36rpx + env(safe-area-inset-bottom));
|
||
}
|
||
|
||
.dp-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.dp-title {
|
||
font-size: $yjyf-font-lg;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.dp-close {
|
||
width: 64rpx;
|
||
height: 64rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.close-ico {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
}
|
||
|
||
.dp-sub-tip {
|
||
display: block;
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-secondary;
|
||
line-height: 1.5;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.dp-label {
|
||
display: block;
|
||
font-size: $yjyf-font-sm;
|
||
font-weight: 600;
|
||
color: $yjyf-text-main;
|
||
margin: 20rpx 0 16rpx;
|
||
}
|
||
|
||
.date-scroll {
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.date-pills {
|
||
display: inline-flex;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.date-pill {
|
||
width: 132rpx;
|
||
height: 108rpx;
|
||
border-radius: $yjyf-radius-md;
|
||
background: $yjyf-bg-page;
|
||
border: 2rpx solid transparent;
|
||
display: inline-flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 6rpx;
|
||
|
||
&.on {
|
||
background: $yjyf-primary-bg;
|
||
border-color: $yjyf-primary;
|
||
}
|
||
}
|
||
|
||
.dp-week {
|
||
font-size: $yjyf-font-sm;
|
||
font-weight: 700;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.dp-day {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.date-pill.on .dp-week,
|
||
.date-pill.on .dp-day {
|
||
color: $yjyf-primary;
|
||
}
|
||
|
||
.slot-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(4, 1fr);
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.slot-pill {
|
||
height: 72rpx;
|
||
border-radius: 12rpx;
|
||
background: $yjyf-bg-page;
|
||
border: 2rpx solid transparent;
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-text-regular;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
&.on {
|
||
background: $yjyf-primary-bg;
|
||
border-color: $yjyf-primary;
|
||
color: $yjyf-primary;
|
||
font-weight: 700;
|
||
}
|
||
}
|
||
|
||
.form-row {
|
||
height: 92rpx;
|
||
border-bottom: 1rpx solid $yjyf-border-color;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 20rpx;
|
||
}
|
||
|
||
.fr-label {
|
||
font-size: $yjyf-font-base;
|
||
font-weight: 600;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.fr-input {
|
||
flex: 1;
|
||
text-align: right;
|
||
font-size: $yjyf-font-base;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.form-col {
|
||
margin-top: 24rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 14rpx;
|
||
}
|
||
|
||
.fr-textarea {
|
||
width: 100%;
|
||
height: 160rpx;
|
||
padding: 20rpx;
|
||
box-sizing: border-box;
|
||
border-radius: $yjyf-radius-md;
|
||
background: $yjyf-bg-page;
|
||
font-size: $yjyf-font-sm;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.upload-row,
|
||
.upload-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(3, 1fr);
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.up-item {
|
||
position: relative;
|
||
height: 188rpx;
|
||
border-radius: 14rpx;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.up-img {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.up-del {
|
||
position: absolute;
|
||
top: 8rpx;
|
||
right: 8rpx;
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
border-radius: 50%;
|
||
background: rgba(0, 0, 0, 0.55);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.del-ico {
|
||
width: 24rpx;
|
||
height: 24rpx;
|
||
}
|
||
|
||
.up-add {
|
||
height: 188rpx;
|
||
border-radius: 14rpx;
|
||
background: $yjyf-bg-page;
|
||
border: 2rpx dashed $yjyf-text-disabled;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 10rpx;
|
||
}
|
||
|
||
.cam-ico {
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
}
|
||
|
||
.cam-txt {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-secondary;
|
||
}
|
||
|
||
.verify-code-input {
|
||
width: 100%;
|
||
height: 104rpx;
|
||
box-sizing: border-box;
|
||
border-radius: $yjyf-radius-md;
|
||
background: $yjyf-bg-page;
|
||
text-align: center;
|
||
font-size: 44rpx;
|
||
font-weight: 800;
|
||
letter-spacing: 16rpx;
|
||
color: $yjyf-text-main;
|
||
}
|
||
|
||
.dp-submit {
|
||
margin-top: 36rpx;
|
||
height: 88rpx;
|
||
border-radius: $yjyf-radius-pill;
|
||
background: $yjyf-gradient-primary;
|
||
color: $yjyf-text-inverse;
|
||
font-size: $yjyf-font-md;
|
||
font-weight: 700;
|
||
box-shadow: $yjyf-shadow-button;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
&.disabled {
|
||
opacity: 0.6;
|
||
}
|
||
}
|
||
|
||
.master-video-box {
|
||
height: 188rpx;
|
||
border-radius: 14rpx;
|
||
background: #2C2C2E;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 10rpx;
|
||
}
|
||
|
||
.mv-play-ico {
|
||
width: 48rpx;
|
||
height: 48rpx;
|
||
}
|
||
|
||
.mv-play-txt {
|
||
font-size: $yjyf-font-xs;
|
||
color: $yjyf-text-inverse;
|
||
}
|
||
|
||
.master-video-player {
|
||
width: 100%;
|
||
height: 440rpx;
|
||
border-radius: $yjyf-radius-md;
|
||
background: #000000;
|
||
}
|
||
</style>
|