This commit is contained in:
@@ -43,20 +43,28 @@ const h5JavaScriptCode = h5JavaScriptFiles
|
||||
.map((filePath) => readText(filePath))
|
||||
.join('\n')
|
||||
|
||||
// H5 uses the embedded Tencent JS map and the backend route service. The
|
||||
// historical external-map handoff must not be required by this bundle check.
|
||||
for (const required of [
|
||||
'第三方',
|
||||
'打开地图',
|
||||
'jweixin',
|
||||
'miniProgram',
|
||||
'/pages/open-location/index',
|
||||
'baidumap://',
|
||||
'iosamap://',
|
||||
'androidamap://'
|
||||
'/gis/outdoor-map',
|
||||
'/routes/plan',
|
||||
'/places/suggestions',
|
||||
'/geocoding/reverse',
|
||||
'重新检测',
|
||||
'手动选择起点',
|
||||
'地图选点',
|
||||
'semanticEnterBuilding'
|
||||
]) {
|
||||
assertContains(h5JavaScriptCode, required, 'H5 全量 JS')
|
||||
}
|
||||
|
||||
for (const forbidden of ['native-location']) {
|
||||
for (const forbidden of [
|
||||
'OutdoorNavigationPanel',
|
||||
'打开地图导航',
|
||||
'baidumap://',
|
||||
'iosamap://',
|
||||
'androidamap://'
|
||||
]) {
|
||||
assertNotContains(h5JavaScriptCode, forbidden, 'H5 全量 JS')
|
||||
}
|
||||
|
||||
@@ -78,32 +86,22 @@ const mpArrivalPanelTemplatePath = path.join(
|
||||
'ArrivalPanel.wxml'
|
||||
)
|
||||
const mpArrivalPanelTemplate = readText(mpArrivalPanelTemplatePath)
|
||||
assertContains(mpArrivalPanelCode, '打开地图导航', 'mp-weixin 来馆组件')
|
||||
assertContains(
|
||||
mpArrivalPanelCode,
|
||||
'../../services/WechatOpenLocationService.js',
|
||||
'mp-weixin 来馆组件'
|
||||
)
|
||||
assertContains(mpArrivalPanelCode, 'typeChange', 'mp-weixin 来馆组件')
|
||||
assertContains(mpArrivalPanelTemplate, '去这里', 'mp-weixin 来馆模板')
|
||||
assertNotContains(mpArrivalPanelCode, 'third-party-providers', 'mp-weixin 来馆组件')
|
||||
assertNotContains(mpArrivalPanelTemplate, 'provider-sheet', 'mp-weixin 来馆模板')
|
||||
assertNotContains(mpArrivalPanelTemplate, '第三方导航', 'mp-weixin 来馆模板')
|
||||
|
||||
const mpAppConfigPath = path.join(mpRoot, 'app.json')
|
||||
const mpAppConfig = JSON.parse(readText(mpAppConfigPath))
|
||||
if (!mpAppConfig.pages?.includes('pages/open-location/index')) {
|
||||
throw new Error('mp-weixin app.json 未注册 open-location 页面')
|
||||
}
|
||||
|
||||
console.log(JSON.stringify({
|
||||
h5: {
|
||||
html: path.relative(projectRoot, htmlPath),
|
||||
entry: path.relative(projectRoot, entryPath),
|
||||
pageChunk: path.relative(projectRoot, pageChunkPath),
|
||||
navigationMode: 'third-party-providers'
|
||||
navigationMode: 'embedded-tencent-map'
|
||||
},
|
||||
mpWeixin: {
|
||||
component: path.relative(projectRoot, mpArrivalPanelPath),
|
||||
template: path.relative(projectRoot, mpArrivalPanelTemplatePath),
|
||||
navigationMode: 'native-location'
|
||||
navigationMode: 'arrival-target-selection'
|
||||
}
|
||||
}, null, 2))
|
||||
|
||||
Reference in New Issue
Block a user