文件
yjyf/pages/service/detail.vue
linda 78722b3912 feat(ui): 登录起全链路页面接通 + 逐页面验证(47 项)+ 修复订单列表越权泄漏
前端:
- utils/request.js 统一请求层(token/错误码/401 引导登录)
- utils/api.js 接口清单(与后端控制器一一对应)
- pages/login 登录(手机号+验证码+角色选择)
- pages/service/list|detail 服务列表/详情
- pages/order/create 下单(地址/预约/急单/费用试算/自动支付)
- pages/order/list|detail|review 订单列表/详情轨迹/评价
- pages/master/apply|hall|orders 师傅入驻/订单大厅/接单履约
- YJYF/YJYF 首页接 home/index 真实类目 + 路由跳转

后端 Bug 修复(严重):
- TP5 中 count() 会重置查询条件,导致 Order::index / Master::hall / Master::orders
  在 select 时丢失 where 条件 → 泄漏全部用户订单/跨用户数据
- 改为闭包重建查询,已验证修复
2026-10-28 15:52:39 +08:00

104 行
4.3 KiB
Vue

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<template>
<view class="page" v-if="detail">
<view class="hero">
<view class="hero-thumb"><text class="hero-txt">{{ detail.name.slice(0, 2) }}</text></view>
<view class="hero-info">
<text class="name">{{ detail.name }}</text>
<view class="tags">
<text class="tag">{{ detail.price_type_text }}</text>
<text class="tag">{{ detail.cat_name }}</text>
</view>
<text class="price">{{ detail.price_text }}</text>
</view>
</view>
<view class="card">
<view class="card-title">费用说明</view>
<view class="li"><text class="k">基础价</text><text class="v">¥{{ detail.base_price }} / {{ detail.unit }}</text></view>
<view class="li"><text class="k">楼层费</text><text class="v">{{ detail.floor_fee }} 元/层({{ detail.free_floor }} 层内免)</text></view>
<view class="li"><text class="k">加急费</text><text class="v">基础价 20%</text></view>
<view class="li"><text class="k">无电梯</text><text class="v">超免楼层按楼层费计</text></view>
</view>
<view class="card">
<view class="card-title">服务保障</view>
<view class="li"><text class="k">平台认证</text><text class="v">实名 + 技能审核</text></view>
<view class="li"><text class="k">验收付款</text><text class="v">客户验收后平台结算</text></view>
<view class="li"><text class="k">现场取证</text><text class="v">施工拍照留痕</text></view>
<text class="desc" v-if="detail.description">{{ detail.description }}</text>
</view>
<view class="bar">
<view class="bar-left">
<text class="bar-price">{{ detail.price_text }}</text>
<text class="bar-tip">无隐藏费用</text>
</view>
<view class="bar-btn" @tap="goCreate">立即下单</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import api from '@/utils/api.js';
const detail = ref(null);
let serviceId = 0;
function goCreate() {
uni.navigateTo({ url: '/pages/order/create?service_id=' + serviceId });
}
onLoad(async (options) => {
serviceId = Number(options.id || 0);
const res = await api.serviceDetail(serviceId);
detail.value = res.detail;
});
</script>
<style scoped>
.page { min-height: 100vh; background: #F5F6F8; padding-bottom: 160rpx; }
.hero {
display: flex; align-items: center; padding: 34rpx 28rpx;
background: linear-gradient(160deg, #FFB85C 0%, #F98D25 60%, #ED6F0E 100%);
}
.hero-thumb {
width: 130rpx; height: 130rpx; border-radius: 22rpx; flex-shrink: 0;
background: rgba(255,255,255,0.92); display: flex; align-items: center; justify-content: center;
}
.hero-txt { font-size: 36rpx; font-weight: 700; color: #B85E2A; }
.hero-info { flex: 1; min-width: 0; margin-left: 22rpx; display: flex; flex-direction: column; }
.name { font-size: 38rpx; font-weight: 700; color: #fff; letter-spacing: 1rpx; }
.tags { display: flex; margin-top: 12rpx; }
.tag {
padding: 0 14rpx; line-height: 34rpx; margin-right: 10rpx; border-radius: 17rpx;
background: rgba(255,255,255,0.22); color: #fff; font-size: 20rpx;
}
.price { margin-top: 14rpx; font-size: 34rpx; font-weight: 700; color: #FFF3DF; }
.card {
margin: 22rpx 28rpx 0; padding: 26rpx 24rpx; background: #fff;
border-radius: 20rpx; box-shadow: 0 6rpx 20rpx rgba(240,129,31,0.06);
}
.card-title { font-size: 30rpx; font-weight: 700; color: #1F1F1F; margin-bottom: 14rpx; }
.li { display: flex; justify-content: space-between; padding: 12rpx 0; border-bottom: 1rpx solid #F4F4F4; }
.k { font-size: 26rpx; color: #666; }
.v { font-size: 26rpx; color: #333; }
.desc { display: block; margin-top: 16rpx; font-size: 24rpx; color: #9A9A9A; line-height: 36rpx; }
.bar {
position: fixed; left: 0; right: 0; bottom: 0; height: 120rpx;
padding: 0 28rpx; padding-bottom: env(safe-area-inset-bottom);
display: flex; align-items: center; justify-content: space-between;
background: #fff; box-shadow: 0 -6rpx 24rpx rgba(0,0,0,0.07);
}
.bar-left { display: flex; flex-direction: column; }
.bar-price { font-size: 34rpx; font-weight: 700; color: #F0710D; }
.bar-tip { font-size: 20rpx; color: #B5B5B5; }
.bar-btn {
height: 84rpx; padding: 0 56rpx; display: flex; align-items: center;
border-radius: 42rpx; color: #fff; font-size: 30rpx; font-weight: 600;
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
box-shadow: 0 8rpx 20rpx rgba(240,113,13,0.3);
}
</style>