- 新增后台人工充值模块,支持上传支付凭证 - 新增支付结果查询接口及页面 - 新增订单支付成功跳转结果页逻辑 - 更新钱包流水类型标签区分充值方式 - 新增插件路由 PHP 8 兼容错误报告设置
1321 行
30 KiB
Vue
1321 行
30 KiB
Vue
<template>
|
||
<view class="user-orders-view">
|
||
<!-- 1. 顶部统一橙色导航栏 + 一体化搜索栏 -->
|
||
<YjyfNavBar theme="orange" title="订单管理" :showBack="false">
|
||
<template #left>
|
||
<view class="service-btn clickable-hover" @tap="contactService">
|
||
<image class="service-icon" src="/static/icons/customer-service-white.svg" mode="aspectFit" />
|
||
<text class="service-txt">客服</text>
|
||
</view>
|
||
</template>
|
||
</YjyfNavBar>
|
||
<view class="top-header" :style="{ backgroundPosition: '0 -' + stickyTop + 'px' }">
|
||
<!-- 搜索栏 -->
|
||
<view class="search-bar-row">
|
||
<view class="search-input-wrap">
|
||
<image class="search-icon" src="/static/icons/search-gray.svg" mode="aspectFit" />
|
||
<input
|
||
class="search-input"
|
||
type="text"
|
||
v-model="keyword"
|
||
placeholder="客户名字/手机号/订单编号/产品名称/备注"
|
||
placeholder-class="search-placeholder"
|
||
confirm-type="search"
|
||
@confirm="onSearch"
|
||
/>
|
||
<view class="clear-btn clickable-hover" v-if="keyword" @tap="clearSearch">
|
||
<image class="clear-icon" src="/static/icons/input-clear.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
<view class="search-action-btn clickable-hover" @tap="onSearch">
|
||
<text class="search-action-txt">搜索</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 2. 状态分类 Tabs 横向滚动条 (右侧带漏斗筛选按钮) -->
|
||
<view class="tabs-wrapper">
|
||
<scroll-view class="tabs-scroll" scroll-x :show-scrollbar="false" :scroll-into-view="'tab-' + curTab">
|
||
<view class="tabs-content">
|
||
<view
|
||
v-for="t in statusTabs"
|
||
:key="t.key"
|
||
:id="'tab-' + t.key"
|
||
class="tab-item clickable-hover"
|
||
:class="{ active: curTab === t.key }"
|
||
@tap="switchTab(t.key)"
|
||
>
|
||
<text class="tab-label">{{ t.name }}</text>
|
||
<view class="tab-line" v-if="curTab === t.key"></view>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
<view class="filter-btn clickable-hover" @tap="openFilterDrawer">
|
||
<image class="filter-icon" src="/static/icons/filter-funnel.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 3. 订单列表主体(独立局部下拉刷新) -->
|
||
<YjyfRefreshScroll
|
||
class="orders-scroll"
|
||
theme="light"
|
||
:refresh-task="load"
|
||
@scrolltolower="loadMore"
|
||
>
|
||
<view class="list-container">
|
||
<!-- 骨架屏加载态 -->
|
||
<view class="skeleton-list" v-if="loading && !list.length">
|
||
<view class="sk-card yjyf-shimmer" v-for="i in 3" :key="i"></view>
|
||
</view>
|
||
|
||
<!-- 订单卡片列表 -->
|
||
<view class="order-list" v-else-if="list.length">
|
||
<view class="order-card" v-for="o in list" :key="o.id" @tap="goDetail(o.id)">
|
||
<!-- 卡片头部:状态大字 + 标签组 + 订单标记旗子 -->
|
||
<view class="card-hd">
|
||
<text class="status-name" :class="'s-' + o.status">{{ o.status_text }}</text>
|
||
<view class="hd-tags">
|
||
<text class="tag quote-tag" v-if="o.price_type === 'quote' || o.price_type_tag === '报价'">报价</text>
|
||
<text class="tag urgent-tag" v-if="Number(o.urgent)">加急</text>
|
||
<view class="flag-wrap clickable-hover" @tap.stop="openOrderTag(o)">
|
||
<image class="flag-icon" src="/static/icons/flag-gray.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 客户信息行:定位图钉 + 姓名/脱敏手机号(支持切换) + 完整地址 -->
|
||
<view class="customer-info-box">
|
||
<image class="loc-pin" src="/static/icons/location-pin.svg" mode="aspectFit" />
|
||
<view class="cust-detail">
|
||
<view class="cust-title-row">
|
||
<text class="cust-name-phone">{{ o.contact }},{{ o.showRealMobile ? o.mobile : (o.mobile_mask || o.mobile) }}</text>
|
||
<view class="eye-toggle-btn clickable-hover" @tap.stop="toggleMobileMask(o)">
|
||
<image
|
||
class="eye-icon"
|
||
:src="o.showRealMobile ? '/static/icons/login-eye-open.svg' : '/static/icons/login-eye-close.svg'"
|
||
mode="aspectFit"
|
||
/>
|
||
</view>
|
||
</view>
|
||
<text class="cust-addr-txt">{{ o.full_address || o.address }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 商品与服务区:商品图 + 品名规格数量 + 服务项目明细 -->
|
||
<view class="goods-service-box">
|
||
<image class="goods-thumb" :src="o.goods_image_url || o.service_image || '/static/icons/service-default.svg'" mode="aspectFill" />
|
||
<view class="goods-info">
|
||
<text class="goods-title">{{ o.goods_title || (o.service_name + ' x ' + (o.goods_num || 1) + '套') }}</text>
|
||
<text class="service-desc" v-if="formatOrderServiceItems(o)">{{ formatOrderServiceItems(o) }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 状态/进度提示横条 (带橙色时钟与右箭头) -->
|
||
<view class="status-tip-bar clickable-hover" @tap.stop="goDetail(o.id)">
|
||
<image class="clock-icon" src="/static/icons/clock-orange.svg" mode="aspectFit" />
|
||
<view class="tip-content">
|
||
<text class="tip-title">{{ o.status_timeline_text || o.status_tip || o.status_text }}</text>
|
||
<text class="tip-time">{{ o.status_time_text || o.create_text }}</text>
|
||
</view>
|
||
<image class="arrow-icon" src="/static/icons/arrow-right.svg" mode="aspectFit" />
|
||
</view>
|
||
|
||
<!-- 卡片底部操作栏:左侧更多,右侧按钮组 -->
|
||
<view class="card-ft">
|
||
<view class="ft-left-more clickable-hover" @tap.stop="showMoreMenu(o)">
|
||
<text class="more-txt">更多</text>
|
||
</view>
|
||
<view class="ft-actions">
|
||
<!-- 已取消/已关闭订单 -->
|
||
<template v-if="o.status === 9">
|
||
<view class="action-btn clickable-hover" @tap.stop="reOrder(o)">重下订单</view>
|
||
<view class="action-btn primary clickable-hover" @tap.stop="orderAgain(o)">再次下单</view>
|
||
</template>
|
||
|
||
<!-- 待支付 -->
|
||
<template v-else-if="o.status === 0 || o.can_pay">
|
||
<view class="action-btn clickable-hover" @tap.stop="cancelOrder(o)">取消订单</view>
|
||
<view class="action-btn primary clickable-hover" @tap.stop="payOrder(o)">去支付</view>
|
||
</template>
|
||
|
||
<!-- 报价中 / 待接单 -->
|
||
<template v-else-if="o.status === 1 || o.status === 2">
|
||
<view class="action-btn clickable-hover" @tap.stop="cancelOrder(o)">取消订单</view>
|
||
<view class="action-btn primary clickable-hover" v-if="o.status === 2" @tap.stop="goDetail(o.id)">选师傅</view>
|
||
<view class="action-btn clickable-hover" v-else @tap.stop="goDetail(o.id)">查看进度</view>
|
||
</template>
|
||
|
||
<!-- 待验收 -->
|
||
<template v-else-if="o.status === 7 || o.can_verify">
|
||
<view class="action-btn clickable-hover" @tap.stop="goDetail(o.id)">核验完工</view>
|
||
<view class="action-btn primary clickable-hover" @tap.stop="verifyOrder(o)">确认验收</view>
|
||
</template>
|
||
|
||
<!-- 已完成 -->
|
||
<template v-else-if="o.status === 8">
|
||
<view class="action-btn clickable-hover" v-if="o.can_review" @tap.stop="goReview(o)">去评价</view>
|
||
<view class="action-btn clickable-hover" v-else @tap.stop="orderAgain(o)">再次下单</view>
|
||
<view class="action-btn clickable-hover" v-if="o.is_showcase" @tap.stop="toggleShowcase(o, 0)">取消晒单</view>
|
||
<view class="action-btn primary clickable-hover" v-else @tap.stop="toggleShowcase(o, 1)">一键晒单</view>
|
||
</template>
|
||
|
||
<!-- 服务中/已接单等通用 -->
|
||
<template v-else>
|
||
<view class="action-btn clickable-hover" @tap.stop="contactMaster(o)">联系师傅</view>
|
||
<view class="action-btn primary clickable-hover" @tap.stop="goDetail(o.id)">查看详情</view>
|
||
</template>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 列表底部触底提示 -->
|
||
<view class="load-finish-tip">
|
||
<text class="finish-txt">{{ loadingMore ? '加载更多中...' : (hasMore ? '上滑加载更多' : '没有更多订单了') }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 4. 空状态 -->
|
||
<view class="empty-state" v-else>
|
||
<image class="empty-illu" src="/static/icons/empty-orders.svg" mode="aspectFit" />
|
||
<text class="empty-title">暂无相关订单</text>
|
||
<view class="empty-btn clickable-hover" @tap="orderAgain">立即下单</view>
|
||
</view>
|
||
</view>
|
||
</YjyfRefreshScroll>
|
||
|
||
<!-- 5. 高级筛选抽屉 -->
|
||
<view class="filter-drawer-mask" v-if="showFilterDrawer" @tap="closeFilterDrawer">
|
||
<view class="filter-drawer-content" :style="{ paddingTop: stickyTop + 'px' }" @tap.stop>
|
||
<view class="drawer-header">
|
||
<text class="drawer-title">高级筛选</text>
|
||
<view class="drawer-close clickable-hover" @tap="closeFilterDrawer">
|
||
<image class="close-icon" src="/static/icons/close.svg" mode="aspectFit" />
|
||
</view>
|
||
</view>
|
||
|
||
<scroll-view class="drawer-body" scroll-y>
|
||
<view class="filter-group">
|
||
<text class="group-title">计价方式</text>
|
||
<view class="tag-row">
|
||
<view
|
||
class="filter-tag clickable-hover"
|
||
:class="{ on: filterPriceType === 'all' }"
|
||
@tap="filterPriceType = 'all'"
|
||
>全部</view>
|
||
<view
|
||
class="filter-tag clickable-hover"
|
||
:class="{ on: filterPriceType === 'fixed' }"
|
||
@tap="filterPriceType = 'fixed'"
|
||
>一口价</view>
|
||
<view
|
||
class="filter-tag clickable-hover"
|
||
:class="{ on: filterPriceType === 'quote' }"
|
||
@tap="filterPriceType = 'quote'"
|
||
>师傅报价</view>
|
||
<view
|
||
class="filter-tag clickable-hover"
|
||
:class="{ on: filterPriceType === 'custom' }"
|
||
@tap="filterPriceType = 'custom'"
|
||
>自主定价</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="filter-group">
|
||
<text class="group-title">加急选项</text>
|
||
<view class="tag-row">
|
||
<view
|
||
class="filter-tag clickable-hover"
|
||
:class="{ on: filterUrgent === 'all' }"
|
||
@tap="filterUrgent = 'all'"
|
||
>全部</view>
|
||
<view
|
||
class="filter-tag clickable-hover"
|
||
:class="{ on: filterUrgent === '1' }"
|
||
@tap="filterUrgent = '1'"
|
||
>仅看加急</view>
|
||
</view>
|
||
</view>
|
||
</scroll-view>
|
||
|
||
<view class="drawer-footer">
|
||
<view class="drawer-btn reset-btn clickable-hover" @tap="resetFilter">重置</view>
|
||
<view class="drawer-btn confirm-btn clickable-hover" @tap="applyFilter">确定</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 6. 订单标记备注弹窗 -->
|
||
<view class="modal-mask" v-if="showTagModal" @tap="showTagModal = false">
|
||
<view class="modal-box" @tap.stop>
|
||
<text class="modal-title">订单标记</text>
|
||
<text class="modal-sub">订单号:{{ activeOrder ? activeOrder.order_no : '' }}</text>
|
||
<textarea
|
||
class="tag-input"
|
||
v-model="orderTagNote"
|
||
placeholder="可输入内部标记或备注信息,方便快速查找"
|
||
maxlength="100"
|
||
/>
|
||
<view class="modal-btns">
|
||
<view class="m-btn cancel clickable-hover" @tap="showTagModal = false">取消</view>
|
||
<view class="m-btn confirm clickable-hover" @tap="saveOrderTag">保存标记</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<YjyfServicePopup :visible="servicePopupVisible" @update:visible="servicePopupVisible = $event" />
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, onMounted } from 'vue';
|
||
import { formatOrderServiceItems } from '@/utils/order-service-items.mjs';
|
||
import api from '@/utils/api.js';
|
||
import { executeOrderWxPay, openOrderPaymentResult } from '@/utils/pay.js';
|
||
import { isLogin, toLogin } from '@/utils/request.js';
|
||
import { getNavBarMetrics } from '@/utils/system.js';
|
||
import YjyfNavBar from '@/components/YjyfNavBar.vue';
|
||
import YjyfRefreshScroll from '@/components/YjyfRefreshScroll.vue';
|
||
import YjyfServicePopup from '@/components/YjyfServicePopup.vue';
|
||
|
||
const stickyTop = ref(64);
|
||
function updateStickyTop() {
|
||
const m = getNavBarMetrics();
|
||
stickyTop.value = m.totalNavHeight;
|
||
}
|
||
updateStickyTop();
|
||
|
||
// 顶部横向滚动 Tabs
|
||
const statusTabs = [
|
||
{ key: 'all', name: '全部' },
|
||
{ key: 'pending_pay', name: '待付款' },
|
||
{ key: 'quoting', name: '待报价' },
|
||
{ key: 'select_master', name: '选师傅' },
|
||
{ key: 'pending_accept', name: '待接单' },
|
||
{ key: 'scheduled', name: '待预约' },
|
||
{ key: 'serving', name: '待服务' },
|
||
{ key: 'pending_verify', name: '待验收' },
|
||
{ key: 'completed', name: '已完成' },
|
||
{ key: 'cancelled', name: '已关闭' }
|
||
];
|
||
|
||
const props = defineProps({
|
||
initialStatus: { type: String, default: 'all' }
|
||
});
|
||
|
||
const curTab = ref(props.initialStatus || 'all');
|
||
const keyword = ref('');
|
||
const list = ref([]);
|
||
const loading = ref(false);
|
||
const loadingMore = ref(false);
|
||
const page = ref(1);
|
||
const pageLimit = 15;
|
||
const hasMore = ref(false);
|
||
|
||
// 高级筛选抽屉状态
|
||
const showFilterDrawer = ref(false);
|
||
const filterPriceType = ref('all');
|
||
const filterUrgent = ref('all');
|
||
|
||
// 标记弹窗
|
||
const showTagModal = ref(false);
|
||
const activeOrder = ref(null);
|
||
const orderTagNote = ref('');
|
||
const savingTag = ref(false);
|
||
|
||
// 加载订单列表
|
||
async function fetchPage(reset = true) {
|
||
if (!isLogin()) {
|
||
toLogin();
|
||
return;
|
||
}
|
||
if (reset) {
|
||
page.value = 1;
|
||
loading.value = true;
|
||
} else {
|
||
if (loading.value || loadingMore.value || !hasMore.value) return;
|
||
loadingMore.value = true;
|
||
}
|
||
try {
|
||
const params = {
|
||
status: curTab.value === 'select_master' ? 'quoting' : curTab.value,
|
||
keyword: keyword.value.trim(),
|
||
page: page.value,
|
||
limit: pageLimit
|
||
};
|
||
if (filterPriceType.value !== 'all') {
|
||
params.price_type = filterPriceType.value;
|
||
}
|
||
if (filterUrgent.value !== 'all') {
|
||
params.urgent = filterUrgent.value;
|
||
}
|
||
|
||
const res = await api.orderList(params);
|
||
const rawList = (res.list || []).map(item => ({
|
||
...item,
|
||
showRealMobile: false
|
||
}));
|
||
list.value = reset ? rawList : [...list.value, ...rawList];
|
||
const total = Number(res.total || 0);
|
||
hasMore.value = res.has_more !== undefined ? Boolean(res.has_more) : (total > list.value.length && rawList.length >= pageLimit);
|
||
} catch (e) {
|
||
} finally {
|
||
loading.value = false;
|
||
loadingMore.value = false;
|
||
}
|
||
}
|
||
|
||
async function load() {
|
||
return fetchPage(true);
|
||
}
|
||
|
||
function loadMore() {
|
||
if (loading.value || loadingMore.value || !hasMore.value) return;
|
||
page.value += 1;
|
||
fetchPage(false);
|
||
}
|
||
|
||
function switchTab(k) {
|
||
curTab.value = k;
|
||
load();
|
||
}
|
||
|
||
function onSearch() {
|
||
load();
|
||
}
|
||
|
||
function clearSearch() {
|
||
keyword.value = '';
|
||
load();
|
||
}
|
||
|
||
function toggleMobileMask(item) {
|
||
item.showRealMobile = !item.showRealMobile;
|
||
}
|
||
|
||
function goDetail(id) {
|
||
uni.navigateTo({
|
||
url: '/pages/order/detail?id=' + id
|
||
});
|
||
}
|
||
|
||
const servicePopupVisible = ref(false);
|
||
|
||
function contactService() {
|
||
servicePopupVisible.value = true;
|
||
}
|
||
|
||
function contactMaster(o) {
|
||
if (o.master_mobile) {
|
||
uni.makePhoneCall({ phoneNumber: o.master_mobile });
|
||
} else {
|
||
goDetail(o.id);
|
||
}
|
||
}
|
||
|
||
function openFilterDrawer() {
|
||
showFilterDrawer.value = true;
|
||
}
|
||
|
||
function closeFilterDrawer() {
|
||
showFilterDrawer.value = false;
|
||
}
|
||
|
||
function resetFilter() {
|
||
filterPriceType.value = 'all';
|
||
filterUrgent.value = 'all';
|
||
showFilterDrawer.value = false;
|
||
load();
|
||
}
|
||
|
||
function applyFilter() {
|
||
showFilterDrawer.value = false;
|
||
load();
|
||
}
|
||
|
||
function openOrderTag(o) {
|
||
activeOrder.value = o;
|
||
orderTagNote.value = o.remark || '';
|
||
showTagModal.value = true;
|
||
}
|
||
|
||
async function saveOrderTag() {
|
||
if (!activeOrder.value || savingTag.value) return;
|
||
savingTag.value = true;
|
||
try {
|
||
await api.orderUpdateNote({
|
||
order_id: activeOrder.value.id,
|
||
remark: orderTagNote.value.trim()
|
||
});
|
||
activeOrder.value.remark = orderTagNote.value.trim();
|
||
showTagModal.value = false;
|
||
uni.showToast({ title: '标记已保存', icon: 'success' });
|
||
} catch (e) {
|
||
} finally {
|
||
savingTag.value = false;
|
||
}
|
||
}
|
||
|
||
function showMoreMenu(o) {
|
||
const items = ['查看详情', '联系平台客服'];
|
||
if (o.can_cancel) items.push('取消订单');
|
||
if (o.can_delete) items.push('删除订单');
|
||
|
||
uni.showActionSheet({
|
||
itemList: items,
|
||
success: (res) => {
|
||
const picked = items[res.tapIndex];
|
||
if (picked === '查看详情') goDetail(o.id);
|
||
else if (picked === '联系平台客服') contactService();
|
||
else if (picked === '取消订单') cancelOrder(o);
|
||
else if (picked === '删除订单') deleteOrder(o);
|
||
}
|
||
});
|
||
}
|
||
|
||
const actingOrderId = ref(0);
|
||
|
||
function deleteOrder(o) {
|
||
if (actingOrderId.value) return;
|
||
uni.showModal({
|
||
title: '删除订单',
|
||
content: '确定要删除该订单记录吗?删除后将不再在列表中展示。',
|
||
success: async (r) => {
|
||
if (!r.confirm || actingOrderId.value) return;
|
||
actingOrderId.value = o.id;
|
||
try {
|
||
await api.orderDelete({ order_id: o.id });
|
||
uni.showToast({ title: '已删除', icon: 'success' });
|
||
await load();
|
||
} catch (e) {
|
||
uni.showToast({ title: e.message || '删除失败', icon: 'none' });
|
||
} finally {
|
||
actingOrderId.value = 0;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
function cancelOrder(o) {
|
||
if (actingOrderId.value) return;
|
||
uni.showModal({
|
||
title: '取消订单',
|
||
content: '确认取消该订单?取消后若已付款将原路退回。',
|
||
success: async (r) => {
|
||
if (!r.confirm || actingOrderId.value) return;
|
||
actingOrderId.value = o.id;
|
||
try {
|
||
await api.orderCancel({ order_id: o.id, reason: '用户取消' });
|
||
uni.showToast({ title: '已取消', icon: 'none' });
|
||
await load();
|
||
} catch (e) {
|
||
} finally {
|
||
actingOrderId.value = 0;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
async function payOrder(o) {
|
||
if (!o || actingOrderId.value) return;
|
||
actingOrderId.value = o.id;
|
||
try {
|
||
const payment = await executeOrderWxPay(api.orderPay, { order_id: o.id });
|
||
openOrderPaymentResult(o.id, payment);
|
||
} catch (e) {
|
||
if (e && e.code === undefined && !e.handledToast && !e.unsupportedEnv && e.message) {
|
||
uni.showToast({ title: e.message, icon: 'none' });
|
||
}
|
||
} finally {
|
||
actingOrderId.value = 0;
|
||
}
|
||
}
|
||
|
||
function verifyOrder(o) {
|
||
if (actingOrderId.value) return;
|
||
uni.showModal({
|
||
title: '确认验收',
|
||
content: '请确认师傅已完全按照要求施工完毕。确认验收后将自动为师傅结算。',
|
||
success: async (r) => {
|
||
if (!r.confirm || actingOrderId.value) return;
|
||
actingOrderId.value = o.id;
|
||
try {
|
||
await api.orderVerify({ order_id: o.id });
|
||
uni.showToast({ title: '验收成功', icon: 'success' });
|
||
await load();
|
||
} catch (e) {
|
||
} finally {
|
||
actingOrderId.value = 0;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
function reOrder(o) {
|
||
// 重下订单:带上原单参数唤起下单页
|
||
uni.navigateTo({
|
||
url: `/pages/order/quick?service_id=${o.service_id || ''}&goods_num=${o.goods_num || 1}`
|
||
});
|
||
}
|
||
|
||
function orderAgain(o) {
|
||
uni.navigateTo({
|
||
url: '/pages/order/quick'
|
||
});
|
||
}
|
||
|
||
function goReview(o) {
|
||
uni.navigateTo({
|
||
url: '/pages/order/review?id=' + o.id
|
||
});
|
||
}
|
||
|
||
async function toggleShowcase(o, targetVal) {
|
||
if (actingOrderId.value) return;
|
||
const isShow = Number(targetVal) ? 1 : 0;
|
||
if (isShow === 0) {
|
||
uni.showModal({
|
||
title: '取消公开晒单',
|
||
content: '确认取消公开晒单?取消后将不再在首页服务动态中展示。',
|
||
confirmColor: '#F0710D',
|
||
success: async (r) => {
|
||
if (!r.confirm || actingOrderId.value) return;
|
||
actingOrderId.value = o.id;
|
||
try {
|
||
await api.orderShowcase({ order_id: o.id, is_showcase: 0 });
|
||
uni.showToast({ title: '已取消晒单', icon: 'none' });
|
||
await load();
|
||
} catch (e) {
|
||
} finally {
|
||
actingOrderId.value = 0;
|
||
}
|
||
}
|
||
});
|
||
return;
|
||
}
|
||
actingOrderId.value = o.id;
|
||
try {
|
||
await api.orderShowcase({ order_id: o.id, is_showcase: 1 });
|
||
uni.showToast({ title: '已公开晒单', icon: 'success' });
|
||
await load();
|
||
} catch (e) {
|
||
} finally {
|
||
actingOrderId.value = 0;
|
||
}
|
||
}
|
||
|
||
onMounted(() => {
|
||
updateStickyTop();
|
||
load();
|
||
});
|
||
|
||
defineExpose({
|
||
load,
|
||
switchTab
|
||
});
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.user-orders-view {
|
||
height: calc(100vh - 112rpx - constant(safe-area-inset-bottom));
|
||
height: calc(100vh - 112rpx - env(safe-area-inset-bottom));
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
background-color: #F5F6F8;
|
||
}
|
||
|
||
.orders-scroll {
|
||
flex: 1;
|
||
height: 0;
|
||
width: 100%;
|
||
}
|
||
|
||
/* 1. 顶部橙色一体化 Header */
|
||
.top-header {
|
||
flex-shrink: 0;
|
||
background-color: #F0710D;
|
||
background-image: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
background-size: 100% 600rpx;
|
||
background-position: 0 0;
|
||
background-repeat: no-repeat;
|
||
padding: 8rpx 24rpx 24rpx;
|
||
}
|
||
|
||
.service-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 52rpx;
|
||
background: rgba(255, 255, 255, 0.22);
|
||
border: 1rpx solid rgba(255, 255, 255, 0.35);
|
||
border-radius: 26rpx;
|
||
padding: 0 20rpx;
|
||
margin-left: 12rpx;
|
||
line-height: 1;
|
||
}
|
||
|
||
.service-icon {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
margin-right: 8rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.service-txt {
|
||
font-size: 24rpx;
|
||
color: #FFFFFF;
|
||
font-weight: 600;
|
||
line-height: 1;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* 搜索栏 */
|
||
.search-bar-row {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.search-input-wrap {
|
||
flex: 1;
|
||
min-width: 0;
|
||
height: 72rpx;
|
||
background: #FFFFFF;
|
||
border-radius: 36rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 0 24rpx;
|
||
}
|
||
|
||
.search-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
flex-shrink: 0;
|
||
margin-right: 14rpx;
|
||
}
|
||
|
||
.search-input {
|
||
flex: 1;
|
||
min-width: 0;
|
||
font-size: 26rpx;
|
||
color: #1F1F1F;
|
||
}
|
||
|
||
.search-placeholder {
|
||
font-size: 24rpx;
|
||
color: #AAAAAA;
|
||
}
|
||
|
||
.clear-btn {
|
||
padding: 6rpx;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.clear-icon {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
}
|
||
|
||
.search-action-btn {
|
||
padding-left: 24rpx;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 72rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.search-action-txt {
|
||
font-size: 28rpx;
|
||
font-weight: 600;
|
||
color: #FFFFFF;
|
||
line-height: 1;
|
||
}
|
||
|
||
/* 2. 状态 Tabs 横向滚动条 */
|
||
.tabs-wrapper {
|
||
flex-shrink: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
background: #FFFFFF;
|
||
border-bottom: 1rpx solid #F0F0F2;
|
||
position: relative;
|
||
z-index: 10;
|
||
width: 100%;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.tabs-scroll {
|
||
flex: 1;
|
||
min-width: 0;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.tabs-content {
|
||
display: inline-flex;
|
||
flex-wrap: nowrap;
|
||
align-items: center;
|
||
padding: 0 12rpx;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.tab-item {
|
||
display: inline-flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
white-space: nowrap;
|
||
height: 84rpx;
|
||
padding: 0 22rpx;
|
||
position: relative;
|
||
}
|
||
|
||
.tab-label {
|
||
font-size: 28rpx;
|
||
color: #444444;
|
||
font-weight: 500;
|
||
white-space: nowrap;
|
||
line-height: 1.2;
|
||
transition: all 0.2s ease;
|
||
}
|
||
|
||
.tab-item.active .tab-label {
|
||
color: #F0710D;
|
||
font-weight: 700;
|
||
font-size: 30rpx;
|
||
}
|
||
|
||
.tab-line {
|
||
position: absolute;
|
||
bottom: 8rpx;
|
||
width: 36rpx;
|
||
height: 6rpx;
|
||
background: #F0710D;
|
||
border-radius: 3rpx;
|
||
}
|
||
|
||
.filter-btn {
|
||
width: 84rpx;
|
||
height: 84rpx;
|
||
flex-shrink: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
box-shadow: -8rpx 0 12rpx rgba(0, 0, 0, 0.03);
|
||
background: #FFFFFF;
|
||
position: relative;
|
||
z-index: 2;
|
||
}
|
||
|
||
.filter-icon {
|
||
width: 34rpx;
|
||
height: 34rpx;
|
||
}
|
||
|
||
/* 3. 订单列表主体 */
|
||
.list-container {
|
||
padding: 20rpx 24rpx 120rpx;
|
||
}
|
||
|
||
.sk-card {
|
||
height: 340rpx;
|
||
background: #FFFFFF;
|
||
border-radius: 20rpx;
|
||
margin-bottom: 20rpx;
|
||
}
|
||
|
||
.order-card {
|
||
background: #FFFFFF;
|
||
border-radius: 20rpx;
|
||
padding: 24rpx 24rpx 20rpx 24rpx;
|
||
margin-bottom: 20rpx;
|
||
box-shadow: 0 6rpx 20rpx rgba(240, 113, 13, 0.06);
|
||
}
|
||
|
||
/* 卡片头部 */
|
||
.card-hd {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding-bottom: 18rpx;
|
||
}
|
||
|
||
.status-name {
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
color: #1F1F1F;
|
||
}
|
||
|
||
.status-name.s-0 { color: #F0710D; }
|
||
.status-name.s-1 { color: #F98D25; }
|
||
.status-name.s-2 { color: #F0710D; }
|
||
.status-name.s-7 { color: #E8331B; }
|
||
.status-name.s-8 { color: #2FA84F; }
|
||
.status-name.s-9 { color: #666666; }
|
||
|
||
.hd-tags {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.tag {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 40rpx;
|
||
line-height: 40rpx;
|
||
text-align: center;
|
||
font-size: 22rpx;
|
||
padding: 0 14rpx;
|
||
border-radius: 8rpx;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.quote-tag {
|
||
background: #FFF2E8;
|
||
color: #F0710D;
|
||
}
|
||
|
||
.urgent-tag {
|
||
background: #FFF1F0;
|
||
color: #F5222D;
|
||
}
|
||
|
||
.acc-tag {
|
||
background: #F5F6F8;
|
||
color: #888888;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.acc-tag.owner {
|
||
background: #FFF7F0;
|
||
color: #F0710D;
|
||
}
|
||
|
||
.flag-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 4rpx 6rpx;
|
||
}
|
||
|
||
.flag-icon {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
}
|
||
|
||
/* 客户信息行 */
|
||
.customer-info-box {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
padding-bottom: 18rpx;
|
||
}
|
||
|
||
.loc-pin {
|
||
width: 28rpx;
|
||
height: 28rpx;
|
||
flex-shrink: 0;
|
||
margin-top: 6rpx;
|
||
margin-right: 12rpx;
|
||
}
|
||
|
||
.cust-detail {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.cust-title-row {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.cust-name-phone {
|
||
font-size: 28rpx;
|
||
font-weight: 700;
|
||
color: #1F1F1F;
|
||
}
|
||
|
||
.eye-toggle-btn {
|
||
padding: 4rpx 10rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.eye-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
}
|
||
|
||
.cust-addr-txt {
|
||
display: block;
|
||
margin-top: 6rpx;
|
||
font-size: 24rpx;
|
||
color: #666666;
|
||
line-height: 1.45;
|
||
}
|
||
|
||
/* 商品与服务区 */
|
||
.goods-service-box {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
padding: 16rpx 0;
|
||
}
|
||
|
||
.goods-thumb {
|
||
width: 140rpx;
|
||
height: 140rpx;
|
||
border-radius: 12rpx;
|
||
background: #F8F9FA;
|
||
flex-shrink: 0;
|
||
margin-right: 20rpx;
|
||
}
|
||
|
||
.goods-info {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.goods-title {
|
||
font-size: 28rpx;
|
||
font-weight: 700;
|
||
color: #1F1F1F;
|
||
line-height: 1.4;
|
||
display: -webkit-box;
|
||
-webkit-line-clamp: 2;
|
||
-webkit-box-orient: vertical;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.service-desc {
|
||
display: block;
|
||
margin-top: 10rpx;
|
||
font-size: 24rpx;
|
||
color: #888888;
|
||
line-height: 1.45;
|
||
}
|
||
|
||
/* 状态提示横条 */
|
||
.status-tip-bar {
|
||
background: #F7F8FA;
|
||
border-radius: 12rpx;
|
||
padding: 16rpx 20rpx;
|
||
margin-top: 12rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.clock-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
flex-shrink: 0;
|
||
margin-right: 14rpx;
|
||
}
|
||
|
||
.tip-content {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.tip-title {
|
||
font-size: 24rpx;
|
||
color: #444444;
|
||
font-weight: 500;
|
||
line-height: 1.35;
|
||
}
|
||
|
||
.tip-time {
|
||
font-size: 22rpx;
|
||
color: #999999;
|
||
margin-top: 4rpx;
|
||
}
|
||
|
||
.arrow-icon {
|
||
width: 22rpx;
|
||
height: 22rpx;
|
||
flex-shrink: 0;
|
||
opacity: 0.5;
|
||
}
|
||
|
||
/* 卡片底部操作栏 */
|
||
.card-ft {
|
||
margin-top: 20rpx;
|
||
padding-top: 20rpx;
|
||
border-top: 1rpx solid #F0F0F2;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.ft-left-more {
|
||
padding: 8rpx 0;
|
||
}
|
||
|
||
.more-txt {
|
||
font-size: 26rpx;
|
||
color: #888888;
|
||
}
|
||
|
||
.ft-actions {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.action-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 60rpx;
|
||
padding: 0 28rpx;
|
||
border-radius: 30rpx;
|
||
font-size: 26rpx;
|
||
color: #444444;
|
||
border: 1rpx solid #DCDFE6;
|
||
background: #FFFFFF;
|
||
font-weight: 500;
|
||
line-height: 1;
|
||
}
|
||
|
||
.action-btn.primary {
|
||
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
border-color: transparent;
|
||
color: #FFFFFF;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* 加载完成提示 */
|
||
.load-finish-tip {
|
||
text-align: center;
|
||
padding: 30rpx 0 20rpx 0;
|
||
}
|
||
|
||
.finish-txt {
|
||
font-size: 24rpx;
|
||
color: #AAAAAA;
|
||
}
|
||
|
||
/* 4. 空状态 */
|
||
.empty-state {
|
||
padding: 100rpx 40rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
text-align: center;
|
||
}
|
||
|
||
.empty-illu {
|
||
width: 160rpx;
|
||
height: 160rpx;
|
||
margin-bottom: 24rpx;
|
||
}
|
||
|
||
.empty-title {
|
||
font-size: 30rpx;
|
||
font-weight: 700;
|
||
color: #1F1F1F;
|
||
margin-bottom: 36rpx;
|
||
}
|
||
|
||
.empty-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 76rpx;
|
||
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
color: #FFFFFF;
|
||
font-size: 28rpx;
|
||
font-weight: 600;
|
||
border-radius: 38rpx;
|
||
padding: 0 56rpx;
|
||
line-height: 1;
|
||
}
|
||
|
||
/* 5. 筛选抽屉 */
|
||
.filter-drawer-mask {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, 0.5);
|
||
z-index: 99;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
}
|
||
|
||
.filter-drawer-content {
|
||
width: 600rpx;
|
||
height: 100%;
|
||
background: #FFFFFF;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.drawer-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 20rpx 30rpx;
|
||
border-bottom: 1rpx solid #F0F0F2;
|
||
}
|
||
|
||
.drawer-title {
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
color: #1F1F1F;
|
||
}
|
||
|
||
.close-icon {
|
||
width: 32rpx;
|
||
height: 32rpx;
|
||
}
|
||
|
||
.drawer-body {
|
||
flex: 1;
|
||
padding: 30rpx;
|
||
}
|
||
|
||
.filter-group {
|
||
margin-bottom: 40rpx;
|
||
}
|
||
|
||
.group-title {
|
||
font-size: 28rpx;
|
||
font-weight: 600;
|
||
color: #333333;
|
||
margin-bottom: 20rpx;
|
||
display: block;
|
||
}
|
||
|
||
.tag-row {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.filter-tag {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 60rpx;
|
||
padding: 0 28rpx;
|
||
background: #F5F6F8;
|
||
border-radius: 12rpx;
|
||
font-size: 26rpx;
|
||
color: #444444;
|
||
line-height: 1;
|
||
border: 1rpx solid transparent;
|
||
}
|
||
|
||
.filter-tag.on {
|
||
background: #FFF7F0;
|
||
color: #F0710D;
|
||
font-weight: 600;
|
||
border: 1rpx solid #F0710D;
|
||
}
|
||
|
||
.drawer-footer {
|
||
display: flex;
|
||
padding: 24rpx 30rpx 60rpx 30rpx;
|
||
gap: 20rpx;
|
||
border-top: 1rpx solid #F0F0F2;
|
||
}
|
||
|
||
.drawer-btn {
|
||
flex: 1;
|
||
height: 80rpx;
|
||
border-radius: 40rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 28rpx;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.reset-btn {
|
||
background: #F5F6F8;
|
||
color: #666666;
|
||
}
|
||
|
||
.confirm-btn {
|
||
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
|
||
color: #FFFFFF;
|
||
}
|
||
|
||
/* 6. 订单标记备注弹窗 */
|
||
.modal-mask {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, 0.5);
|
||
z-index: 100;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 40rpx;
|
||
}
|
||
|
||
.modal-box {
|
||
width: 100%;
|
||
background: #FFFFFF;
|
||
border-radius: 24rpx;
|
||
padding: 36rpx;
|
||
}
|
||
|
||
.modal-title {
|
||
font-size: 32rpx;
|
||
font-weight: 700;
|
||
color: #1F1F1F;
|
||
display: block;
|
||
}
|
||
|
||
.modal-sub {
|
||
font-size: 22rpx;
|
||
color: #999999;
|
||
margin-top: 8rpx;
|
||
display: block;
|
||
}
|
||
|
||
.tag-input {
|
||
width: 100%;
|
||
height: 180rpx;
|
||
background: #F5F6F8;
|
||
border-radius: 12rpx;
|
||
margin-top: 24rpx;
|
||
padding: 20rpx;
|
||
font-size: 26rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.modal-btns {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 20rpx;
|
||
margin-top: 30rpx;
|
||
}
|
||
|
||
.m-btn {
|
||
padding: 14rpx 36rpx;
|
||
border-radius: 30rpx;
|
||
font-size: 26rpx;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.m-btn.cancel {
|
||
background: #F5F6F8;
|
||
color: #666666;
|
||
}
|
||
|
||
.m-btn.confirm {
|
||
background: #F0710D;
|
||
color: #FFFFFF;
|
||
}
|
||
</style>
|