登录与角色: - Auth::wxlogin 微信 code → jscode2session → 落库发 token(appid/secret 走 .env) - 新增 fa_user_wechat 表,openid 幂等建号(CLI 已验证 is_new 1→0 不重复建号) - Auth::switchRole 角色切换(未入驻 2001 / 审核中 2002 / 未通过 2003) - pages/login 改为微信一键授权;pages/mine 我的中心(师傅入口 + 切换师傅端) 师傅工作台(对齐需求文档): - pages/master/workbench 工作台:接单开关 / 待处理待验收 / 可提现 / 六宫格入口 / 信用四指标 / 技能标签 - pages/master/hall 订单大厅:类型筛选(一口价/报价) + 4 种排序 + 抢单倒计时 + 报价入口 - pages/master/quote 报价竞标:金额/说明/有效期 + 报价记录 - pages/master/wallet 钱包:可提现/今日/累计 + 账单明细 + 提现校验 - pages/master/credit 信用与申诉:五项指标 + 规则 + 申诉提交/记录 - 新增 fa_appeal 表 视觉: - 15 个类目图标重画为双色扁平 SVG,用无头 Chrome 渲染为 192px 透明 PNG - 首页改用 <image src=static/icons/*.png>,移除 200 行 CSS 图标数据 验证:page_flow 47 + e2e_flow 65 + phase2_verify 27 = 139 项断言全通过
122 行
5.6 KiB
Vue
122 行
5.6 KiB
Vue
<template>
|
||
<view class="page">
|
||
<view class="card" v-if="credit">
|
||
<view class="card-title">信用指标</view>
|
||
<view class="grid">
|
||
<view class="g"><text class="g-num">{{ credit.score }}</text><text class="g-lab">综合评分</text></view>
|
||
<view class="g"><text class="g-num">{{ credit.accept_rate }}%</text><text class="g-lab">接单率</text></view>
|
||
<view class="g"><text class="g-num">{{ credit.ontime_rate }}%</text><text class="g-lab">准时率</text></view>
|
||
<view class="g"><text class="g-num">{{ credit.good_rate }}%</text><text class="g-lab">好评率</text></view>
|
||
<view class="g"><text class="g-num">{{ credit.complaint_rate }}%</text><text class="g-lab">投诉率</text></view>
|
||
<view class="g"><text class="g-num">Lv{{ credit.level }}</text><text class="g-lab">服务等级</text></view>
|
||
</view>
|
||
<view class="rules">
|
||
<text class="rule" v-for="(r, i) in credit.rules" :key="i">· {{ r }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="card-title">提交申诉</view>
|
||
<view class="types">
|
||
<view v-for="t in types" :key="t.key" class="type" :class="{ on: form.type === t.key }" @tap="form.type = t.key">{{ t.name }}</view>
|
||
</view>
|
||
<textarea class="ta" v-model="form.content" maxlength="300" placeholder="请描述申诉情况(如:客户恶意差评、订单误判扣款等)" />
|
||
<view class="btn" :class="{ disabled: submitting }" @tap="submit">{{ submitting ? '提交中...' : '提交申诉' }}</view>
|
||
</view>
|
||
|
||
<view class="card">
|
||
<view class="card-head">
|
||
<text class="card-title">申诉记录</text>
|
||
<text class="card-more">{{ list.length }} 条</text>
|
||
</view>
|
||
<view class="ap" v-for="a in list" :key="a.id">
|
||
<view class="ap-top">
|
||
<text class="ap-type">{{ a.type_text }}</text>
|
||
<text class="ap-status" :class="'st-' + a.status">{{ a.status_text }}</text>
|
||
</view>
|
||
<text class="ap-content">{{ a.content }}</text>
|
||
<text class="ap-time">{{ a.time_text }}</text>
|
||
<text class="ap-reply" v-if="a.reply">平台回复:{{ a.reply }}</text>
|
||
</view>
|
||
<view class="empty" v-if="!list.length">暂无申诉记录</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref, reactive } from 'vue';
|
||
import { onShow } from '@dcloudio/uni-app';
|
||
import api from '@/utils/api.js';
|
||
|
||
const credit = ref(null);
|
||
const list = ref([]);
|
||
const submitting = ref(false);
|
||
const form = reactive({ type: 'misjudge', content: '' });
|
||
|
||
const types = [
|
||
{ key: 'misjudge', name: '误判申诉' },
|
||
{ key: 'review', name: '恶意评价' },
|
||
{ key: 'deduct', name: '扣款申诉' },
|
||
{ key: 'other', name: '其他问题' }
|
||
];
|
||
|
||
async function load() {
|
||
try { credit.value = await api.masterCredit(); } catch (e) {}
|
||
try {
|
||
const res = await api.masterAppeals();
|
||
list.value = res.list || [];
|
||
} catch (e) {}
|
||
}
|
||
|
||
async function submit() {
|
||
if (submitting.value) return;
|
||
if (form.content.trim().length < 5) {
|
||
uni.showToast({ title: '请至少填写 5 个字', icon: 'none' });
|
||
return;
|
||
}
|
||
submitting.value = true;
|
||
try {
|
||
await api.masterAppeal({ type: form.type, content: form.content });
|
||
uni.showToast({ title: '申诉已提交' });
|
||
form.content = '';
|
||
load();
|
||
} catch (e) {
|
||
} finally {
|
||
submitting.value = false;
|
||
}
|
||
}
|
||
|
||
onShow(() => load());
|
||
</script>
|
||
|
||
<style scoped>
|
||
.page { min-height: 100vh; background: #F5F6F8; padding: 22rpx 28rpx 60rpx; }
|
||
.card { padding: 24rpx; background: #fff; border-radius: 20rpx; margin-bottom: 20rpx; box-shadow: 0 6rpx 20rpx rgba(240,129,31,.06); }
|
||
.card-head { display: flex; align-items: center; justify-content: space-between; }
|
||
.card-title { font-size: 28rpx; font-weight: 700; color: #1F1F1F; }
|
||
.card-more { font-size: 22rpx; color: #9A9A9A; }
|
||
.grid { display: flex; flex-wrap: wrap; margin-top: 16rpx; }
|
||
.g { width: 33.33%; display: flex; flex-direction: column; align-items: center; padding: 14rpx 0; }
|
||
.g-num { font-size: 32rpx; font-weight: 700; color: #F0710D; }
|
||
.g-lab { margin-top: 4rpx; font-size: 20rpx; color: #9A9A9A; }
|
||
.rules { margin-top: 14rpx; padding-top: 16rpx; border-top: 1rpx solid #F4F4F4; display: flex; flex-direction: column; }
|
||
.rule { font-size: 20rpx; color: #9A9A9A; line-height: 34rpx; }
|
||
.types { display: flex; flex-wrap: wrap; padding: 14rpx 0 6rpx; }
|
||
.type { padding: 0 22rpx; line-height: 56rpx; margin: 0 12rpx 12rpx 0; border-radius: 28rpx; background: #F5F5F5; font-size: 24rpx; color: #666; }
|
||
.type.on { background: #FFF3E6; color: #E36B0C; font-weight: 600; }
|
||
.ta { width: 100%; height: 160rpx; margin-top: 10rpx; font-size: 26rpx; color: #333; line-height: 38rpx; }
|
||
.btn { height: 88rpx; margin-top: 12rpx; display: flex; align-items: center; justify-content: center; border-radius: 44rpx; color: #fff; font-size: 30rpx; font-weight: 600; background: linear-gradient(135deg,#FFA93F 0%,#F0710D 100%); }
|
||
.btn.disabled { opacity: .7; }
|
||
.ap { padding: 18rpx 0; border-bottom: 1rpx solid #F4F4F4; display: flex; flex-direction: column; }
|
||
.ap:last-of-type { border-bottom: none; }
|
||
.ap-top { display: flex; align-items: center; justify-content: space-between; }
|
||
.ap-type { font-size: 26rpx; font-weight: 600; color: #333; }
|
||
.ap-status { font-size: 22rpx; color: #F0710D; }
|
||
.ap-status.st-done { color: #2FA84F; }
|
||
.ap-status.st-reject { color: #9A9A9A; }
|
||
.ap-content { margin-top: 8rpx; font-size: 24rpx; color: #666; line-height: 34rpx; }
|
||
.ap-time { margin-top: 6rpx; font-size: 20rpx; color: #C4C4C4; }
|
||
.ap-reply { margin-top: 8rpx; padding: 12rpx 16rpx; background: #F7F7F7; border-radius: 10rpx; font-size: 22rpx; color: #666; }
|
||
.empty { padding: 60rpx 0; text-align: center; font-size: 24rpx; color: #9A9A9A; }
|
||
</style>
|