文件
yjyf/yjyf-master-app/components/YjyfPrivacyPopup.vue
MiAn 14533eadb7 feat: 用户端与师傅端双小程序架构解耦,新增师傅独立认证及超时自动关单机制
1. 账号体系与数据库解耦:
   - 师傅表 fa_master 解除对 fa_user.id 的外键依赖,升级为独立认证账号主表;
   - 新增师傅端独立支撑表:fa_master_security、fa_master_token、fa_master_wechat、fa_master_agreement_read;
   - 新增工单超时未接单自动关闭与原路退款配置(order_unaccepted_close_days)。

2. 服务端(Server):
   - 新增师傅端独立 API 控制器与认证库(MasterAuth, MasterBase, MasterMessage, MasterSecurity, MasterToken);
   - WxLogin 支持双小程序端(user/master)独立换取 session_key、openid 与 access_token;
   - 新增控制台调度命令 php think order:autoclose,支持订单超时自动关闭与售后退款闭环;
   - 修复 PHP 8.5 兼容性问题(Request.php 的 (bool) 强制转换);
   - 系统业务配置全面收敛至数据库 fa_config 及 site.php。

3. 小程序端:
   - yjyf-app(用户端):彻底剥离师傅端路由、组件及静态资源,增加隐私授权弹窗与评价模块;
   - yjyf-master-app(师傅端):全新独立微信小程序工程(wx140d90ceda786107),实现工作台、接单大厅、资质认证、工单协同与钱包提现完整闭环。
2026-11-23 15:10:30 +08:00

170 行
3.7 KiB
Vue

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

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

<template>
<view class="privacy-mask" v-if="visible" @tap.stop>
<view class="privacy-dialog">
<text class="privacy-title">用户隐私保护指引</text>
<text class="privacy-desc">
感谢您信任并使用优匠优服师傅端!在您使用接单定位、证件上传或账号登录等服务时,我们将依据《用户隐私保护指引》仅在必要范围内申请和使用相关系统权限。
</text>
<view class="privacy-link-row" @tap="openPrivacy">
<text class="privacy-link-txt">查看完整《隐私保护指引》</text>
</view>
<view class="privacy-actions">
<view class="privacy-btn reject clickable-hover" @tap="handleDisagree">
<text class="privacy-btn-txt reject">不同意</text>
</view>
<!-- 微信官方隐私合规要求使用 open-type="agreePrivacyAuthorization" 按钮 -->
<button
id="agree-privacy-btn"
class="privacy-btn agree clickable-hover"
open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgree"
>
<text class="privacy-btn-txt agree">同意并继续</text>
</button>
</view>
</view>
</view>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from 'vue';
const visible = ref(false);
let pendingResolve = null;
function onPrivacyRequired(payload) {
if (payload && typeof payload.resolve === 'function') {
pendingResolve = payload.resolve;
visible.value = true;
}
}
function handleAgree() {
visible.value = false;
if (typeof pendingResolve === 'function') {
try {
pendingResolve({ buttonId: 'agree-privacy-btn', event: 'agree' });
} catch (e) {}
pendingResolve = null;
}
}
function handleDisagree() {
visible.value = false;
if (typeof pendingResolve === 'function') {
try {
pendingResolve({ event: 'disagree' });
} catch (e) {}
pendingResolve = null;
}
uni.showToast({ title: '您已拒绝隐私授权,部分权限功能将受限', icon: 'none' });
}
function openPrivacy() {
uni.navigateTo({
url: `/pages/agreement/detail?type=privacy&title=${encodeURIComponent('隐私保护指引')}`
});
}
onMounted(() => {
uni.$on('yjyf:needPrivacyAuthorization', onPrivacyRequired);
});
onBeforeUnmount(() => {
uni.$off('yjyf:needPrivacyAuthorization', onPrivacyRequired);
});
</script>
<style lang="scss" scoped>
.privacy-mask {
position: fixed;
inset: 0;
z-index: 9999;
background: rgba(15, 23, 42, 0.58);
display: flex;
align-items: center;
justify-content: center;
padding: 48rpx;
}
.privacy-dialog {
width: 100%;
max-width: 620rpx;
background: #FFFFFF;
border-radius: 28rpx;
padding: 40rpx 36rpx 36rpx;
display: flex;
flex-direction: column;
box-sizing: border-box;
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.22);
}
.privacy-title {
font-size: 34rpx;
font-weight: 700;
color: #1F1F1F;
text-align: center;
margin-bottom: 20rpx;
}
.privacy-desc {
font-size: 27rpx;
line-height: 1.65;
color: #444444;
}
.privacy-link-row {
margin-top: 16rpx;
margin-bottom: 32rpx;
}
.privacy-link-txt {
font-size: 26rpx;
color: #4A7CFF;
font-weight: 500;
}
.privacy-actions {
display: flex;
align-items: center;
gap: 20rpx;
}
.privacy-btn {
flex: 1;
height: 84rpx;
border-radius: 42rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0;
padding: 0;
line-height: normal;
&::after {
border: none;
}
}
.privacy-btn.reject {
background: #F5F6F8;
}
.privacy-btn.agree {
background: linear-gradient(135deg, #FFA93F 0%, #F0710D 100%);
}
.privacy-btn-txt {
font-size: 28rpx;
font-weight: 600;
}
.privacy-btn-txt.reject {
color: #444444;
}
.privacy-btn-txt.agree {
color: #FFFFFF;
}
</style>