微信小程序页面迁移校验之前 P5任务处理之前

This commit is contained in:
Neo
2026-03-09 01:19:21 +08:00
parent 263bf96035
commit 6e20987d2f
1112 changed files with 153824 additions and 219694 deletions

View File

@@ -0,0 +1,3 @@
{
"component": true
}

View File

@@ -0,0 +1,28 @@
/**
* 开发调试浮动按钮组件
*
* 仅在 develop 环境下显示,点击跳转到 dev-tools 页面。
* 使用 movable-view 实现可拖拽。
*/
Component({
data: {
visible: false,
x: 580, // 初始位置右下角附近rpx 换算后的 px 近似值)
y: 1100,
},
lifetimes: {
attached() {
// 仅 develop 环境显示
const accountInfo = wx.getAccountInfoSync()
const env = accountInfo.miniProgram.envVersion
this.setData({ visible: env === "develop" })
},
},
methods: {
goDevTools() {
wx.navigateTo({ url: "/pages/dev-tools/dev-tools" })
},
},
})

View File

@@ -0,0 +1,15 @@
<!--
开发调试浮动按钮 — 仅 develop 环境渲染
可拖拽,点击跳转到 dev-tools 页面
-->
<movable-area wx:if="{{visible}}" class="fab-area">
<movable-view
class="fab-btn"
direction="all"
x="{{x}}"
y="{{y}}"
bindtap="goDevTools"
>
<text class="fab-icon">🛠</text>
</movable-view>
</movable-area>

View File

@@ -0,0 +1,29 @@
/* 浮动按钮覆盖全屏,不阻挡页面交互 */
.fab-area {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 9999;
}
.fab-btn {
width: 96rpx;
height: 96rpx;
border-radius: 50%;
background: rgba(24, 144, 255, 0.9);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.25);
pointer-events: auto;
}
.fab-icon {
font-size: 40rpx;
line-height: 96rpx;
text-align: center;
width: 96rpx;
}