前端不再写死运营数据: - 首页 Banner/保障条/教程卡 改由 /api/home/index 下发(fa_banner + fa_config), 数据缺失或停用自动回落内置兜底文案 - 订单状态提示改由后端 OrderStatus::tip() 下发 status_tip,前后端一套口径 后台可管(FastAdmin 生成器): - 新增 13 个业务后台模块:运营位/订单/师傅/商家/优惠券/评价/消息/服务/服务类目/申诉/开票/提现/结算单 (controller + model + view + fa_auth_rule 菜单 78 条) 修复: - nginx /admin/* 改为 301 到 /admin.php/*,否则后台菜单点开全部 404 验证:tests/phase5_data_sync.js 新增 16 项联动断言;全量回归 202 项断言 0 失败
163 行
7.8 KiB
Vue
163 行
7.8 KiB
Vue
<template>
|
||
<view class="page" v-if="order">
|
||
<view class="hero">
|
||
<text class="hero-status">{{ order.status_text }}</text>
|
||
<text class="hero-tip">{{ statusTip }}</text>
|
||
</view>
|
||
|
||
<view class="card" v-if="master">
|
||
<view class="card-title">服务师傅</view>
|
||
<view class="master">
|
||
<view class="avatar"><text class="avatar-txt">{{ (master.realname || '师').slice(0, 1) }}</text></view>
|
||
<view class="m-info">
|
||
<text class="m-name">{{ master.realname }}</text>
|
||
<text class="m-sub">评分 {{ master.score }} · 完成 {{ master.order_count }} 单</text>
|
||
</view>
|
||
<text class="m-mobile">{{ master.mobile }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="card-title">服务信息</view>
|
||
<view class="li"><text class="k">服务项目</text><text class="v">{{ order.service_name }}</text></view>
|
||
<view class="li"><text class="k">订单号</text><text class="v">{{ order.order_no }}</text></view>
|
||
<view class="li"><text class="k">联系人</text><text class="v">{{ order.contact }} {{ order.mobile }}</text></view>
|
||
<view class="li"><text class="k">服务地址</text><text class="v">{{ order.province }}{{ order.city }}{{ order.district }}{{ order.address }}</text></view>
|
||
<view class="li"><text class="k">楼层</text><text class="v">{{ order.floor }} 层 · {{ Number(order.has_elevator) ? '有电梯' : '无电梯' }}</text></view>
|
||
<view class="li"><text class="k">预约时间</text><text class="v">{{ order.appoint_text }}</text></view>
|
||
<view class="li" v-if="order.goods_model"><text class="k">商品型号</text><text class="v">{{ order.goods_model }}</text></view>
|
||
<view class="li" v-if="order.remark"><text class="k">备注</text><text class="v">{{ order.remark }}</text></view>
|
||
<view class="li" v-if="Number(order.urgent)"><text class="k">加急</text><text class="v">是(+20%)</text></view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="card-title">费用明细</view>
|
||
<view class="li"><text class="k">基础价</text><text class="v">¥{{ order.base_amount }}</text></view>
|
||
<view class="li"><text class="k">楼层费</text><text class="v">¥{{ order.floor_amount }}</text></view>
|
||
<view class="li" v-if="Number(order.urgent_amount) > 0"><text class="k">加急费</text><text class="v">¥{{ order.urgent_amount }}</text></view>
|
||
<view class="li"><text class="k">实付</text><text class="v big">¥{{ order.pay_amount }}</text></view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="card-title">订单轨迹</view>
|
||
<view class="tl" v-for="(l, i) in logs" :key="i">
|
||
<view class="dot" :class="{ on: i === logs.length - 1 }"></view>
|
||
<view class="tl-body">
|
||
<text class="tl-s">{{ l.status_text }}</text>
|
||
<text class="tl-r">{{ l.remark }}</text>
|
||
<text class="tl-t">{{ l.time_text }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card" v-if="media.length">
|
||
<view class="card-title">现场取证</view>
|
||
<view class="media">
|
||
<view class="media-i" v-for="(m, i) in media" :key="i">
|
||
<text class="media-txt">{{ m.stage === 'damage' ? '损坏申报' : '完工照片' }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="bar">
|
||
<view class="op" v-if="order.can_cancel" @tap="cancel">取消订单</view>
|
||
<view class="op primary" v-if="order.can_pay" @tap="pay">去支付</view>
|
||
<view class="op primary" v-if="order.can_verify" @tap="verify">确认验收</view>
|
||
<view class="op primary" v-if="order.can_review" @tap="review">去评价</view>
|
||
<view class="op" @tap="backHome">返回首页</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, computed } from 'vue';
|
||
import { onShow, onLoad } from '@dcloudio/uni-app';
|
||
import api from '@/utils/api.js';
|
||
|
||
const order = ref(null);
|
||
const master = ref(null);
|
||
const logs = ref([]);
|
||
const media = ref([]);
|
||
let orderId = 0;
|
||
|
||
const statusTip = computed(() => {
|
||
if (!order.value) return '';
|
||
return order.value.status_tip || '';
|
||
});
|
||
|
||
async function load() {
|
||
const res = await api.orderDetail(orderId);
|
||
order.value = res.order;
|
||
master.value = res.master;
|
||
logs.value = res.logs || [];
|
||
media.value = res.media || [];
|
||
}
|
||
|
||
function toast(t) { uni.showToast({ title: t, icon: 'none' }); }
|
||
function backHome() { uni.reLaunch({ url: '/YJYF/YJYF' }); }
|
||
|
||
function cancel() {
|
||
uni.showModal({
|
||
title: '取消订单', content: '确认取消该订单?',
|
||
success: async (r) => {
|
||
if (!r.confirm) return;
|
||
try { await api.orderCancel({ order_id: orderId, reason: '用户取消' }); toast('已取消'); load(); } catch (e) {}
|
||
}
|
||
});
|
||
}
|
||
async function pay() {
|
||
try { await api.orderPay({ order_id: orderId, pay_type: 'mock' }); toast('支付成功'); load(); } catch (e) {}
|
||
}
|
||
function verify() {
|
||
uni.showModal({
|
||
title: '确认验收', content: '验收后平台将向师傅结算,确认服务已完成?',
|
||
success: async (r) => {
|
||
if (!r.confirm) return;
|
||
try { await api.orderVerify({ order_id: orderId }); toast('验收成功'); load(); } catch (e) {}
|
||
}
|
||
});
|
||
}
|
||
function review() { uni.navigateTo({ url: '/pages/order/review?id=' + orderId }); }
|
||
|
||
onLoad((o) => { orderId = Number(o.id || 0); });
|
||
onShow(() => { if (orderId) load(); });
|
||
</script>
|
||
<style scoped>
|
||
.page { min-height: 100vh; background: #F5F6F8; padding-bottom: 160rpx; }
|
||
.hero { padding: 40rpx 36rpx; background: linear-gradient(160deg, #FFB85C 0%, #F98D25 60%, #ED6F0E 100%); }
|
||
.hero-status { display: block; font-size: 40rpx; font-weight: 700; color: #fff; letter-spacing: 2rpx; }
|
||
.hero-tip { display: block; margin-top: 10rpx; font-size: 24rpx; color: rgba(255,255,255,0.9); }
|
||
.card { margin: 22rpx 28rpx 0; padding: 24rpx; background: #fff; border-radius: 20rpx; box-shadow: 0 6rpx 20rpx rgba(240,129,31,0.06); }
|
||
.card-title { font-size: 28rpx; font-weight: 700; color: #1F1F1F; margin-bottom: 12rpx; }
|
||
.li { display: flex; justify-content: space-between; padding: 12rpx 0; border-bottom: 1rpx solid #F4F4F4; }
|
||
.k { flex-shrink: 0; width: 150rpx; font-size: 26rpx; color: #666; }
|
||
.v { flex: 1; text-align: right; font-size: 26rpx; color: #333; line-height: 36rpx; }
|
||
.v.big { font-size: 34rpx; font-weight: 700; color: #F0710D; }
|
||
.master { display: flex; align-items: center; }
|
||
.avatar { width: 76rpx; height: 76rpx; border-radius: 50%; background: #FFF1E3; display: flex; align-items: center; justify-content: center; }
|
||
.avatar-txt { font-size: 30rpx; font-weight: 700; color: #E88A2C; }
|
||
.m-info { flex: 1; margin-left: 16rpx; display: flex; flex-direction: column; }
|
||
.m-name { font-size: 28rpx; font-weight: 600; color: #222; }
|
||
.m-sub { margin-top: 4rpx; font-size: 22rpx; color: #9A9A9A; }
|
||
.m-mobile { font-size: 24rpx; color: #666; }
|
||
.tl { display: flex; padding: 10rpx 0; }
|
||
.dot { width: 14rpx; height: 14rpx; margin: 8rpx 16rpx 0 0; border-radius: 50%; background: #E0E0E0; flex-shrink: 0; }
|
||
.dot.on { background: #F0710D; box-shadow: 0 0 0 6rpx rgba(240,113,13,0.15); }
|
||
.tl-body { flex: 1; display: flex; flex-direction: column; }
|
||
.tl-s { font-size: 26rpx; font-weight: 600; color: #333; }
|
||
.tl-r { margin-top: 2rpx; font-size: 22rpx; color: #9A9A9A; }
|
||
.tl-t { margin-top: 2rpx; font-size: 20rpx; color: #C4C4C4; }
|
||
.media { display: flex; flex-wrap: wrap; }
|
||
.media-i { width: 150rpx; height: 110rpx; margin: 0 12rpx 12rpx 0; border-radius: 12rpx; background: linear-gradient(160deg,#FFF7F0,#FCE9D6); display: flex; align-items: center; justify-content: center; }
|
||
.media-txt { font-size: 20rpx; color: #B85E2A; }
|
||
.bar {
|
||
position: fixed; left: 0; right: 0; bottom: 0; height: 118rpx;
|
||
padding: 0 24rpx; padding-bottom: env(safe-area-inset-bottom);
|
||
display: flex; align-items: center; justify-content: flex-end;
|
||
background: #fff; box-shadow: 0 -6rpx 24rpx rgba(0,0,0,0.07);
|
||
}
|
||
.op { margin-left: 16rpx; padding: 0 28rpx; line-height: 68rpx; border-radius: 34rpx; border: 2rpx solid #DDD; font-size: 26rpx; color: #666; }
|
||
.op.primary { border-color: #F0710D; color: #fff; background: linear-gradient(135deg,#FFA93F 0%,#F0710D 100%); }
|
||
</style>
|
||
|