整理文档并接入 H5 体验测试链路
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from '../../engine/map/mapEngine'
|
||||
import { loadRemoteMapConfig } from '../../utils/remoteMapConfig'
|
||||
import { type AnimationLevel } from '../../utils/animationLevel'
|
||||
import { type H5ExperienceFallbackPayload, type H5ExperienceRequest } from '../../game/experience/h5Experience'
|
||||
type CompassTickData = {
|
||||
angle: number
|
||||
long: boolean
|
||||
@@ -848,8 +849,8 @@ Page({
|
||||
mapEngine = null
|
||||
}
|
||||
|
||||
mapEngine = new MapEngine(INTERNAL_BUILD_VERSION, {
|
||||
onData: (patch) => {
|
||||
mapEngine = new MapEngine(INTERNAL_BUILD_VERSION, {
|
||||
onData: (patch) => {
|
||||
const nextPatch = patch as Partial<MapPageData>
|
||||
const includeDebugFields = this.data.showDebugPanel
|
||||
const includeRulerFields = this.data.showCenterScaleRuler
|
||||
@@ -988,11 +989,14 @@ Page({
|
||||
})
|
||||
}
|
||||
|
||||
if (this.data.showGameInfoPanel) {
|
||||
this.scheduleGameInfoPanelSnapshotSync()
|
||||
}
|
||||
},
|
||||
})
|
||||
if (this.data.showGameInfoPanel) {
|
||||
this.scheduleGameInfoPanelSnapshotSync()
|
||||
}
|
||||
},
|
||||
onOpenH5Experience: (request) => {
|
||||
this.openH5Experience(request)
|
||||
},
|
||||
})
|
||||
|
||||
const storedUserSettings = loadStoredUserSettings()
|
||||
if (storedUserSettings.animationLevel) {
|
||||
@@ -1390,6 +1394,12 @@ Page({
|
||||
mapEngine.handleConnectMockHeartRateBridge()
|
||||
},
|
||||
|
||||
handleOpenWebViewTest() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/webview-test/webview-test',
|
||||
})
|
||||
},
|
||||
|
||||
handleMockBridgeUrlInput(event: WechatMiniprogram.Input) {
|
||||
this.setData({
|
||||
mockBridgeUrlDraft: event.detail.value,
|
||||
@@ -1887,6 +1897,42 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
handleOpenPendingContentCard() {
|
||||
if (mapEngine) {
|
||||
mapEngine.openPendingContentCard()
|
||||
}
|
||||
},
|
||||
|
||||
openH5Experience(request: H5ExperienceRequest) {
|
||||
wx.navigateTo({
|
||||
url: '/pages/experience-webview/experience-webview',
|
||||
success: (result) => {
|
||||
const eventChannel = result.eventChannel
|
||||
eventChannel.on('fallback', (payload: H5ExperienceFallbackPayload) => {
|
||||
if (mapEngine) {
|
||||
mapEngine.handleH5ExperienceFallback(payload)
|
||||
}
|
||||
})
|
||||
eventChannel.on('close', () => {
|
||||
if (mapEngine) {
|
||||
mapEngine.handleH5ExperienceClosed()
|
||||
}
|
||||
})
|
||||
eventChannel.on('submitResult', () => {
|
||||
if (mapEngine) {
|
||||
mapEngine.handleH5ExperienceClosed()
|
||||
}
|
||||
})
|
||||
eventChannel.emit('init', request)
|
||||
},
|
||||
fail: () => {
|
||||
if (mapEngine) {
|
||||
mapEngine.handleH5ExperienceFallback(request.fallback)
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
handleCloseContentCard() {
|
||||
if (mapEngine) {
|
||||
mapEngine.closeContentCard()
|
||||
|
||||
@@ -115,6 +115,10 @@
|
||||
<cover-view class="map-punch-button__text">{{punchButtonText}}</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="map-content-entry" wx:if="{{!showDebugPanel && !showGameInfoPanel && !showResultScene && !showSystemSettingsPanel && pendingContentEntryVisible}}" bindtap="handleOpenPendingContentCard">
|
||||
<cover-view class="map-content-entry__text">{{pendingContentEntryText}}</cover-view>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="screen-button-layer screen-button-layer--start-left" wx:if="{{!showDebugPanel && !showGameInfoPanel && !showResultScene && !showSystemSettingsPanel && showBottomDebugButton && gameSessionStatus !== 'running'}}" bindtap="handleStartGame">
|
||||
<cover-view class="screen-button-layer__text screen-button-layer__text--start">开始</cover-view>
|
||||
</cover-view>
|
||||
@@ -552,6 +556,7 @@
|
||||
</view>
|
||||
<view class="control-row">
|
||||
<view class="control-chip control-chip--primary" bindtap="handleConnectAllMockSources">一键连接模拟源</view>
|
||||
<view class="control-chip control-chip--secondary" bindtap="handleOpenWebViewTest">测试 H5</view>
|
||||
</view>
|
||||
<view class="debug-group-title">定位</view>
|
||||
<view class="info-panel__row">
|
||||
|
||||
@@ -1155,6 +1155,27 @@
|
||||
animation: punch-button-warning 0.56s ease-in-out 1;
|
||||
}
|
||||
|
||||
.map-content-entry {
|
||||
position: absolute;
|
||||
right: 22rpx;
|
||||
bottom: 352rpx;
|
||||
min-width: 96rpx;
|
||||
height: 52rpx;
|
||||
padding: 0 18rpx;
|
||||
border-radius: 28rpx;
|
||||
background: rgba(33, 47, 58, 0.88);
|
||||
box-shadow: 0 10rpx 24rpx rgba(18, 28, 38, 0.2);
|
||||
z-index: 18;
|
||||
}
|
||||
|
||||
.map-content-entry__text {
|
||||
font-size: 22rpx;
|
||||
line-height: 52rpx;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
color: rgba(244, 248, 252, 0.94);
|
||||
}
|
||||
|
||||
|
||||
.race-panel__line {
|
||||
position: absolute;
|
||||
|
||||
Reference in New Issue
Block a user