fix: resolve miniapp compile errors

This commit is contained in:
2026-09-10 18:37:53 +08:00
parent 45ca118453
commit 76a10e5de0
3 changed files with 19 additions and 3 deletions
+4
View File
@@ -45,7 +45,11 @@ const appStyle = read('miniapp/app.wxss')
assert.match(appStyle, /--color-bg-page:\s*#FAFAF8/i, '全局背景令牌必须为 #FAFAF8')
assert.match(appStyle, /--spacing-section:\s*48rpx/i, '模块间距必须为 24px(48rpx)')
const sharedServiceStyle = read('miniapp/styles/service-page.wxss')
assert.doesNotMatch(sharedServiceStyle, /@import\s+["']\.\.\/\.\.\/app\.wxss["']/, '共享页面样式不能错误导入 ../../app.wxss')
const homeMarkup = read('miniapp/pages/index/index.wxml')
assert.doesNotMatch(homeMarkup, /<[^>]+wx:elif="\{\{recommendations\.length\}\}"[^>]+wx:for=/, '推荐条件分支与循环必须分离,避免 wx:else 失联')
assert.match(homeMarkup, /<block wx:elif="\{\{recommendations\.length\}\}">/, '推荐列表必须使用 block 条件分支')
assertInOrder(homeMarkup, [
'品牌区', '用户状态条', 'Banner 轮播', '8个核心入口', '今日推荐',
'善缘公益服务', '近期公益活动', '善缘服务站', '婚恋课堂', '安全提醒',