文件
yjyf/yjyf-master-app/App.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

119 行
2.8 KiB
Vue

<script>
let lastNavUrl = '';
let lastNavAt = 0;
export default {
onLaunch: function() {
// #ifdef MP-WEIXIN
if (typeof wx !== 'undefined' && typeof wx.onNeedPrivacyAuthorization === 'function') {
wx.onNeedPrivacyAuthorization((resolve) => {
uni.$emit('yjyf:needPrivacyAuthorization', { resolve });
});
}
// #endif
if (typeof uni !== 'undefined' && typeof uni.addInterceptor === 'function') {
uni.addInterceptor('navigateTo', {
invoke(args) {
const url = (args && args.url) ? String(args.url) : '';
const now = Date.now();
if (url && url === lastNavUrl && now - lastNavAt < 450) {
return false;
}
lastNavUrl = url;
lastNavAt = now;
return true;
}
});
}
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/* ============================================================
优匠优服 · 全局通用样式与基准工具类
============================================================ */
page {
background-color: $yjyf-bg-page;
font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Hiragino Sans GB', Arial, sans-serif;
color: $yjyf-text-main;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
}
view, text, image, input, textarea, scroll-view, button {
box-sizing: border-box;
}
/* 全局安全区底部内边距 */
.safe-area-bottom {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
/* 全局规范卡片类 */
.yjyf-card {
margin: $yjyf-space-sm $yjyf-space-lg 0;
padding: $yjyf-space-md;
background: $yjyf-bg-card;
border-radius: $yjyf-radius-md;
box-shadow: $yjyf-shadow-card;
}
/* 即时按压微交互反馈 (消除生硬感) */
.clickable-hover {
transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.clickable-hover:active {
opacity: 0.82;
transform: scale(0.985);
}
/* 全局胶囊主行动按钮 */
.yjyf-btn-primary {
height: 88rpx;
line-height: 88rpx;
padding: 0 $yjyf-space-xl;
border-radius: $yjyf-radius-pill;
background: $yjyf-gradient-primary;
color: #FFFFFF;
font-size: $yjyf-font-body;
font-weight: 600;
text-align: center;
box-shadow: 0 8rpx 20rpx rgba(240, 113, 13, 0.28);
border: none;
display: flex;
align-items: center;
justify-content: center;
&[disabled], &.disabled {
opacity: 0.65;
box-shadow: none;
}
}
/* 骨架屏微光呼吸动效 (解决白屏) */
@keyframes yjyf-shimmer {
0% {
background-position: -400rpx 0;
}
100% {
background-position: 400rpx 0;
}
}
.yjyf-shimmer {
background: linear-gradient(90deg, #F0F1F3 25%, #E6E8EA 37%, #F0F1F3 63%);
background-size: 800rpx 100%;
animation: yjyf-shimmer 1.4s ease infinite;
border-radius: 8rpx;
}
</style>