test: lock miniapp reference page scope
This commit is contained in:
+3
-3
@@ -69,9 +69,9 @@
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "丹阳公益婚恋",
|
||||
"navigationBarBackgroundColor": "#E96B6B",
|
||||
"navigationBarBackgroundColor": "#171D72",
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#FAFAF8",
|
||||
"backgroundColor": "#F4F5FA",
|
||||
"backgroundTextStyle": "dark",
|
||||
"enablePullDownRefresh": false
|
||||
},
|
||||
@@ -113,4 +113,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,20 @@ page {
|
||||
--color-primary-light: #FFF3F2;
|
||||
--color-primary-lighter: #FFF8F7;
|
||||
|
||||
/* ============ 小程序参考图品牌主题 ============ */
|
||||
--mini-night-start: #172A72;
|
||||
--mini-night-end: #25104F;
|
||||
--mini-night-soft: #3445A1;
|
||||
--mini-accent-pink: #FF4F91;
|
||||
--mini-accent-coral: #FF6A78;
|
||||
--mini-card-bg: rgba(255, 255, 255, 0.98);
|
||||
--mini-text: #1F2744;
|
||||
--mini-muted: #7D839B;
|
||||
--mini-card-radius: 24rpx;
|
||||
--mini-text-on-night: #FFFFFF;
|
||||
--mini-text-on-night-muted: rgba(255, 255, 255, 0.72);
|
||||
--mini-shadow: 0 16rpx 40rpx rgba(28, 30, 88, 0.14);
|
||||
|
||||
/* ============ 功能色(规范 §4) ============ */
|
||||
--color-success: #2E9B68;
|
||||
--color-success-light: #ECF8F2;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- 公益活动列表页 U31 -->
|
||||
<view class="act-page">
|
||||
<view class="act-page reference-page">
|
||||
<!-- 顶部区:标题 + 我的活动入口 -->
|
||||
<view class="act-page__topbar">
|
||||
<ui-section-header
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="service-page"><view class="hero"><text class="eyebrow">婚恋反诈中心</text><text class="hero-title">真诚交往,也要守住安全边界</text><text class="hero-desc">平台不会以任何理由要求转账、投资或提供银行卡密码。</text></view><view class="content"><view class="block"><text class="block-title">常见风险信号</text><view class="card danger-card"><view wx:for="{{warnings}}" wx:key="*this" class="feature-row"><view class="feature-icon">!</view><view class="feature-copy"><text class="feature-title">{{item}}</text><text class="feature-desc">遇到异常请停止转账并保存相关记录</text></view></view></view></view><view class="block"><text class="block-title">遇到可疑情况怎么办</text><view class="card"><view class="feature-row"><view class="feature-icon">1</view><view class="feature-copy"><text class="feature-title">停止资金操作</text><text class="feature-desc">不要继续转账、充值或提供验证码</text></view></view><view class="feature-row"><view class="feature-icon">2</view><view class="feature-copy"><text class="feature-title">保存相关证据</text><text class="feature-desc">保留聊天、付款与账号信息</text></view></view><view class="feature-row"><view class="feature-icon">3</view><view class="feature-copy"><text class="feature-title">及时举报或报警</text><text class="feature-desc">紧急情况请直接拨打 110</text></view></view></view></view></view><view class="fixed-action"><view class="primary-btn" bindtap="report">举报可疑行为</view></view></view>
|
||||
<view class="service-page reference-page"><view class="hero"><text class="eyebrow">婚恋反诈中心</text><text class="hero-title">真诚交往,也要守住安全边界</text><text class="hero-desc">平台不会以任何理由要求转账、投资或提供银行卡密码。</text></view><view class="content"><view class="block"><text class="block-title">常见风险信号</text><view class="card danger-card"><view wx:for="{{warnings}}" wx:key="*this" class="feature-row"><view class="feature-icon">!</view><view class="feature-copy"><text class="feature-title">{{item}}</text><text class="feature-desc">遇到异常请停止转账并保存相关记录</text></view></view></view></view><view class="block"><text class="block-title">遇到可疑情况怎么办</text><view class="card"><view class="feature-row"><view class="feature-icon">1</view><view class="feature-copy"><text class="feature-title">停止资金操作</text><text class="feature-desc">不要继续转账、充值或提供验证码</text></view></view><view class="feature-row"><view class="feature-icon">2</view><view class="feature-copy"><text class="feature-title">保存相关证据</text><text class="feature-desc">保留聊天、付款与账号信息</text></view></view><view class="feature-row"><view class="feature-icon">3</view><view class="feature-copy"><text class="feature-title">及时举报或报警</text><text class="feature-desc">紧急情况请直接拨打 110</text></view></view></view></view></view><view class="fixed-action"><view class="primary-btn" bindtap="report">举报可疑行为</view></view></view>
|
||||
@@ -1 +1 @@
|
||||
<view class="service-page"><view class="hero"><text class="eyebrow">婚恋课堂</text><text class="hero-title">认真学习,更好地相遇</text><text class="hero-desc">提供真实、克制、可实践的关系成长与安全知识。</text></view><scroll-view scroll-x style="white-space:nowrap;padding:24rpx 32rpx;box-sizing:border-box"><text wx:for="{{categories}}" wx:key="*this" data-index="{{index}}" bindtap="select" class="tag {{active===index ? '' : 'warning'}}">{{item}}</text></scroll-view><view class="content"><view wx:for="{{articles}}" wx:key="id" class="article-card" data-id="{{item.id}}" bindtap="open"><view class="article-cover"><text>{{item.category}}</text></view><view class="article-body"><text class="article-title">{{item.title}}</text><text class="article-meta">{{item.category}} · 阅读约 {{item.read}}</text></view></view></view></view>
|
||||
<view class="service-page reference-page"><view class="hero"><text class="eyebrow">婚恋课堂</text><text class="hero-title">认真学习,更好地相遇</text><text class="hero-desc">提供真实、克制、可实践的关系成长与安全知识。</text></view><scroll-view scroll-x style="white-space:nowrap;padding:24rpx 32rpx;box-sizing:border-box"><text wx:for="{{categories}}" wx:key="*this" data-index="{{index}}" bindtap="select" class="tag {{active===index ? '' : 'warning'}}">{{item}}</text></scroll-view><view class="content"><view wx:for="{{articles}}" wx:key="id" class="article-card" data-id="{{item.id}}" bindtap="open"><view class="article-cover"><text>{{item.category}}</text></view><view class="article-body"><text class="article-title">{{item.title}}</text><text class="article-meta">{{item.category}} · 阅读约 {{item.read}}</text></view></view></view></view>
|
||||
@@ -1 +1 @@
|
||||
<view class="service-page"><view class="hero"><text class="eyebrow">U55 公益婚恋咨询</text><text class="hero-title">当关系让你困扰,可以认真谈一谈</text><text class="hero-desc">由婚恋咨询人员提供关系与情绪支持;咨询服务与公益红娘服务彼此独立。</text></view><view class="content"><view class="block"><text class="block-title">我们可以提供的帮助</text><text class="block-subtitle">选择最接近当前需要的方向</text><view class="card"><view class="feature-row" wx:for="{{services}}" wx:key="type" bindtap="onSelectService" data-type="{{item.type}}"><view class="feature-icon">{{index+1}}</view><view class="feature-copy"><text class="feature-title">{{item.name}}</text><text class="feature-desc">{{item.description}}</text></view><text class="arrow">›</text></view></view></view><view class="notice">咨询内容会按敏感信息保护。公益红娘不能查看咨询正文,咨询人员也只能处理明确分配给自己的服务。</view></view></view>
|
||||
<view class="service-page reference-page"><view class="hero"><text class="eyebrow">U55 公益婚恋咨询</text><text class="hero-title">当关系让你困扰,可以认真谈一谈</text><text class="hero-desc">由婚恋咨询人员提供关系与情绪支持;咨询服务与公益红娘服务彼此独立。</text></view><view class="content"><view class="block"><text class="block-title">我们可以提供的帮助</text><text class="block-subtitle">选择最接近当前需要的方向</text><view class="card"><view class="feature-row" wx:for="{{services}}" wx:key="type" bindtap="onSelectService" data-type="{{item.type}}"><view class="feature-icon">{{index+1}}</view><view class="feature-copy"><text class="feature-title">{{item.name}}</text><text class="feature-desc">{{item.description}}</text></view><text class="arrow">›</text></view></view></view><view class="notice">咨询内容会按敏感信息保护。公益红娘不能查看咨询正文,咨询人员也只能处理明确分配给自己的服务。</view></view></view>
|
||||
@@ -1,9 +1,9 @@
|
||||
<!-- 找对象页 U19-U20(重构:ui-user-card + matchStore + recommendationService.discover) -->
|
||||
<view class="page">
|
||||
<view class="page app-page reference-page">
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-bar">
|
||||
<view class="search-input">
|
||||
<text class="search-icon">🔍</text>
|
||||
<text class="search-icon">搜索</text>
|
||||
<input
|
||||
class="search-field"
|
||||
placeholder="搜索符合条件的对象"
|
||||
|
||||
@@ -2,12 +2,36 @@
|
||||
* 首页 - V1.1 新版(U18)
|
||||
* 结构:品牌区 → 用户状态条 → Banner → 8入口 → 推荐 → 服务建议 → 活动 → 服务站 → 安全提醒
|
||||
*/
|
||||
const authStore = require('../../stores/authStore')
|
||||
const { authStore, appStore } = require('../../stores')
|
||||
const api = require('../../utils/api')
|
||||
|
||||
const ENTRY_VISUALS = {
|
||||
find_object: { tone: 'rose', iconAsset: '/assets/tabbar/discover-active.png' },
|
||||
matchmaker: { tone: 'purple', iconAsset: '/assets/brand/logo-mark.png' },
|
||||
activities: { tone: 'blue', iconAsset: '/assets/tabbar/activity-active.png' },
|
||||
counseling: { tone: 'pink', iconAsset: '/assets/tabbar/message-active.png' },
|
||||
classroom: { tone: 'amber', iconAsset: '/assets/covers/classroom-default.jpg' },
|
||||
premarital: { tone: 'indigo', iconAsset: '/assets/tabbar/home-active.png' },
|
||||
anti_fraud: { tone: 'red', iconAsset: '/assets/covers/anti-fraud-default.jpg' },
|
||||
service_station: { tone: 'green', iconAsset: '/assets/covers/station-default.jpg' },
|
||||
}
|
||||
|
||||
const QUICK_ENTRIES = [
|
||||
{ code: 'find_object', label: '找对象', targetPage: '/pages/discover/discover', enabled: true },
|
||||
{ code: 'matchmaker', label: '公益红娘', targetPage: '/pages/matchmaker/matchmaker', enabled: true },
|
||||
{ code: 'activities', label: '公益活动', targetPage: '/pages/activity/activity', enabled: true },
|
||||
{ code: 'counseling', label: '婚恋咨询', targetPage: '/pages/counseling-intro/counseling-intro', enabled: true },
|
||||
{ code: 'classroom', label: '婚恋课堂', targetPage: '/pages/content/content', enabled: true },
|
||||
{ code: 'premarital', label: '婚前辅导', targetPage: '/pages/premarital-intro/premarital-intro', enabled: true },
|
||||
{ code: 'anti_fraud', label: '婚恋反诈', targetPage: '/pages/anti-fraud/anti-fraud', enabled: true },
|
||||
{ code: 'service_station', label: '善缘服务站', targetPage: '/pages/service-station/service-station', enabled: true },
|
||||
].map((entry) => ({ ...entry, ...ENTRY_VISUALS[entry.code] }))
|
||||
|
||||
Page({
|
||||
data: {
|
||||
unreadCount: 0,
|
||||
loading: true,
|
||||
loadError: false,
|
||||
userState: null,
|
||||
isOnboarding: false,
|
||||
isVerified: false,
|
||||
@@ -18,7 +42,7 @@ Page({
|
||||
statusChecks: [],
|
||||
banners: [],
|
||||
currentBannerIndex: 0,
|
||||
quickEntries: [],
|
||||
quickEntries: QUICK_ENTRIES,
|
||||
recommendations: [],
|
||||
recState: 'idle',
|
||||
actionLoadingUserId: '',
|
||||
@@ -42,7 +66,7 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (authStore.state.isLoggedIn) {
|
||||
if (authStore.state.isLoggedIn && !this.data.loading) {
|
||||
this.loadHomeData()
|
||||
}
|
||||
},
|
||||
@@ -56,6 +80,7 @@ Page({
|
||||
async checkAuthAndLoad() {
|
||||
if (!authStore.state.isLoggedIn) {
|
||||
this.setData({
|
||||
loading: false,
|
||||
isOnboarding: true,
|
||||
onboardingMessage: '登录后即可开始寻找合适的人',
|
||||
onboardingActions: [{ text: '去登录', event: 'login', variant: 'primary' }],
|
||||
@@ -66,12 +91,13 @@ Page({
|
||||
},
|
||||
|
||||
async loadHomeData() {
|
||||
this.setData({ loading: true, loadError: false })
|
||||
try {
|
||||
const res = await api.get('/home')
|
||||
this.processHomeData(res)
|
||||
} catch (err) {
|
||||
console.error('首页数据加载失败', err)
|
||||
this.setData({ recState: 'error' })
|
||||
this.setData({ loading: false, loadError: true, recState: 'error' })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -83,33 +109,40 @@ Page({
|
||||
const profileStatus = userState?.profileStatus || ''
|
||||
const eligStatus = userState?.localEligibilityStatus || 'not_declared'
|
||||
|
||||
const isOnboarding = !userState || profileStatus !== 'approved'
|
||||
const isOnboarding = !userState || !userState.verified || (profileStatus !== 'approved' && profileStatus !== 'completed')
|
||||
const isPaused = relStatus === 'paused'
|
||||
const isSuccessful = relStatus === 'matched_successfully'
|
||||
const isVerified = eligStatus === 'verified'
|
||||
|
||||
const checks = [
|
||||
{ label: '已实名', done: userState?.verified || false },
|
||||
{ label: '本地资格', done: eligStatus === 'verified' || eligStatus === 'pending_review' },
|
||||
{ label: '本地资格', done: eligStatus === 'verified' },
|
||||
{ label: '资料已审核', done: profileStatus === 'approved' || profileStatus === 'completed' },
|
||||
]
|
||||
|
||||
this.setData({
|
||||
loading: false, loadError: false,
|
||||
userState,
|
||||
isOnboarding, isVerified, isPaused, isSuccessful,
|
||||
onboardingMessage: this.buildOnboardingMessage(userState, profileStatus, eligStatus),
|
||||
onboardingActions: this.buildOnboardingActions(userState, profileStatus, eligStatus),
|
||||
statusChecks: checks,
|
||||
banners, quickEntries,
|
||||
banners: banners || [],
|
||||
quickEntries: quickEntries?.length
|
||||
? quickEntries.map((entry) => ({ ...entry, ...ENTRY_VISUALS[entry.code] }))
|
||||
: QUICK_ENTRIES,
|
||||
recommendations: recommendations || [],
|
||||
recState: (recommendations && recommendations.length > 0) ? 'loaded' : 'empty',
|
||||
serviceRecommendations, activities, serviceLocation,
|
||||
serviceRecommendations: serviceRecommendations || [], activities: activities || [], serviceLocation,
|
||||
articles: data.articles || [],
|
||||
safetyNotice: safetyNotice || this.data.safetyNotice,
|
||||
})
|
||||
},
|
||||
|
||||
buildOnboardingMessage(state, profileStatus, eligStatus) {
|
||||
if (!state) return '登录后即可开始寻找合适的人'
|
||||
if (!state.verified) return '完成实名认证后,即可继续完善资料并使用公益婚恋服务'
|
||||
if (profileStatus === 'pending_review') return '资料正在人工审核,请耐心等待审核结果'
|
||||
if (eligStatus === 'not_declared') return '完成本地资格声明后即可开始寻找合适的人'
|
||||
if (eligStatus === 'needs_evidence') return '补充本地资格佐证后即可开始寻找合适的人'
|
||||
if (profileStatus !== 'approved' && profileStatus !== 'completed') return '资料审核通过后即可开始寻找合适的人'
|
||||
@@ -143,20 +176,21 @@ Page({
|
||||
wx.navigateTo({ url: `/pages/activity-detail/activity-detail?id=${targetValue}` })
|
||||
} else if (targetType === 'matchmaker') {
|
||||
wx.navigateTo({ url: '/pages/matchmaker/matchmaker' })
|
||||
} else if (targetType === 'service_location' && targetValue) {
|
||||
wx.navigateTo({ url: `/pages/local-eligibility/local-eligibility?from=service_station&id=${targetValue}` })
|
||||
} else {
|
||||
const routes = { matchmaker: '/pages/matchmaker/matchmaker', counseling: '/pages/counseling-intro/counseling-intro', premarital: '/pages/premarital-intro/premarital-intro', service_location: '/pages/service-station/service-station', article: '/pages/content-detail/content-detail', internal_page: targetValue }
|
||||
const url = routes[targetType]
|
||||
if (url && /^\/pages\//.test(url)) wx.navigateTo({ url })
|
||||
}
|
||||
},
|
||||
|
||||
onEntryTap(e) {
|
||||
const { code, enabled, targetPage } = e.currentTarget.dataset.entry
|
||||
if (!enabled) {
|
||||
wx.showToast({ title: '完成资料后可使用此功能', icon: 'none' })
|
||||
wx.showToast({ title: e.currentTarget.dataset.entry.disabledReason || '暂不可使用此功能', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (targetPage.startsWith('pages/')) {
|
||||
wx.navigateTo({ url: targetPage })
|
||||
}
|
||||
if (targetPage === '/pages/discover/discover' || targetPage === '/pages/activity/activity') wx.switchTab({ url: targetPage })
|
||||
else if (targetPage?.startsWith('/pages/')) wx.navigateTo({ url: targetPage })
|
||||
},
|
||||
|
||||
onViewDetail(e) {
|
||||
@@ -203,7 +237,7 @@ Page({
|
||||
},
|
||||
|
||||
onResume() {
|
||||
wx.showToast({ title: '功能开发中', icon: 'none' })
|
||||
wx.navigateTo({ url: '/pages/relationship-status/relationship-status' })
|
||||
},
|
||||
|
||||
onSeeMore() { wx.switchTab({ url: '/pages/discover/discover' }) },
|
||||
@@ -213,7 +247,7 @@ Page({
|
||||
if (id) wx.navigateTo({ url: `/pages/activity-detail/activity-detail?id=${id}` })
|
||||
},
|
||||
onStationTap() {
|
||||
wx.navigateTo({ url: '/pages/local-eligibility/local-eligibility?from=service_station' })
|
||||
wx.navigateTo({ url: '/pages/service-station/service-station' })
|
||||
},
|
||||
onServiceTap(e) {
|
||||
const type = e.currentTarget.dataset.type
|
||||
@@ -221,14 +255,17 @@ Page({
|
||||
case 'matchmaker': wx.navigateTo({ url: '/pages/matchmaker/matchmaker' })
|
||||
break
|
||||
case 'counseling':
|
||||
wx.navigateTo({ url: '/pages/counseling-intro/counseling-intro' })
|
||||
break
|
||||
case 'premarital':
|
||||
wx.navigateTo({ url: `/pages/local-eligibility/local-eligibility?from=${type}` })
|
||||
wx.navigateTo({ url: '/pages/premarital-intro/premarital-intro' })
|
||||
break
|
||||
}
|
||||
},
|
||||
onSafetyTap() {
|
||||
wx.navigateTo({ url: '/pages/local-eligibility/local-eligibility?from=anti_fraud' })
|
||||
wx.navigateTo({ url: '/pages/anti-fraud/anti-fraud' })
|
||||
},
|
||||
onArticleTap(e) { wx.navigateTo({ url: `/pages/content-detail/content-detail?id=${e.currentTarget.dataset.id}` }) },
|
||||
onMessages() { wx.switchTab({ url: '/pages/messages/messages' }) },
|
||||
|
||||
formatDate(timestamp) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<view class="page">
|
||||
<view class="page app-page reference-page">
|
||||
<!-- 品牌区 -->
|
||||
<view class="brand-bar">
|
||||
<view><text class="brand-name">善缘丹阳</text><text class="brand-slogan">真实相识 · 公益牵线</text></view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- 公益红娘服务页 U33 -->
|
||||
<view class="mm-page">
|
||||
<view class="mm-page reference-page">
|
||||
<ui-nav-bar
|
||||
title="公益红娘"
|
||||
status-bar-height="{{statusBarHeight}}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!-- 消息列表页 U23 -->
|
||||
<view class="page">
|
||||
<view class="page reference-page">
|
||||
<ui-section-header
|
||||
wx:if="{{conversations.length > 0}}"
|
||||
title="消息"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<view class="page">
|
||||
<view class="page reference-page">
|
||||
<ui-empty wx:if="{{!isLoggedIn}}" illustration="default" title="登录后查看我的服务" description="管理资料、缘分与公益服务记录" actions="{{loginActions}}" bind:action="onLoginAction"/>
|
||||
<ui-loading wx:elif="{{loadStatus === 'loading' && !profile}}" mode="skeleton" rows="6"/>
|
||||
<block wx:else>
|
||||
@@ -19,4 +19,4 @@
|
||||
<view class="list-group"><view class="list-row danger" bindtap="onLogout"><text class="list-label">退出登录</text></view></view>
|
||||
<ui-danger-action-dialog visible="{{showLogoutDialog}}" action="{{logoutAction}}" bind:confirm="onConfirmLogout" bind:cancel="onCancelLogout"/>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="service-page"><view class="hero"><text class="eyebrow">U58 婚前辅导</text><text class="hero-title">在进入婚姻前,把重要的事认真谈清楚</text><text class="hero-desc">帮助双方讨论共同生活、家庭责任与沟通方式,可邀请伴侣共同参与。</text></view><view class="content"><view class="block"><text class="block-title">辅导内容</text><view class="card"><view class="feature-row"><view class="feature-icon">沟</view><view class="feature-copy"><text class="feature-title">沟通与期望</text><text class="feature-desc">表达需求、倾听差异,形成可以共同遵守的约定</text></view></view><view class="feature-row"><view class="feature-icon">家</view><view class="feature-copy"><text class="feature-title">家庭与责任</text><text class="feature-desc">讨论家庭角色、财务安排与双方家庭关系</text></view></view><view class="feature-row"><view class="feature-icon">伴</view><view class="feature-copy"><text class="feature-title">共同生活</text><text class="feature-desc">对生活方式、未来计划和冲突处理建立共识</text></view></view></view></view><view class="notice">双方共同参与效果更好,但必须基于自愿,不会因为一方申请而自动通知或要求另一方参加。</view></view><view class="fixed-action"><view class="primary-btn" bindtap="onApply">申请婚前辅导</view></view></view>
|
||||
<view class="service-page reference-page"><view class="hero"><text class="eyebrow">U58 婚前辅导</text><text class="hero-title">在进入婚姻前,把重要的事认真谈清楚</text><text class="hero-desc">帮助双方讨论共同生活、家庭责任与沟通方式,可邀请伴侣共同参与。</text></view><view class="content"><view class="block"><text class="block-title">辅导内容</text><view class="card"><view class="feature-row"><view class="feature-icon">沟</view><view class="feature-copy"><text class="feature-title">沟通与期望</text><text class="feature-desc">表达需求、倾听差异,形成可以共同遵守的约定</text></view></view><view class="feature-row"><view class="feature-icon">家</view><view class="feature-copy"><text class="feature-title">家庭与责任</text><text class="feature-desc">讨论家庭角色、财务安排与双方家庭关系</text></view></view><view class="feature-row"><view class="feature-icon">伴</view><view class="feature-copy"><text class="feature-title">共同生活</text><text class="feature-desc">对生活方式、未来计划和冲突处理建立共识</text></view></view></view></view><view class="notice">双方共同参与效果更好,但必须基于自愿,不会因为一方申请而自动通知或要求另一方参加。</view></view><view class="fixed-action"><view class="primary-btn" bindtap="onApply">申请婚前辅导</view></view></view>
|
||||
@@ -1 +1 @@
|
||||
<view class="service-page"><view class="hero"><text class="eyebrow">固定公益服务阵地</text><text class="hero-title">善缘丹阳公益服务站</text><text class="hero-desc">提供面对面的婚恋服务咨询,让线上服务在丹阳有真实落点。</text></view><view class="content"><view class="block"><text class="block-title">服务站信息</text><view class="card"><view class="feature-row"><view class="feature-icon">址</view><view class="feature-copy"><text class="feature-title">丹阳市城区公益服务中心</text><text class="feature-desc">丹阳市云阳街道(具体地址以预约确认为准)</text></view></view><view class="feature-row"><view class="feature-icon">时</view><view class="feature-copy"><text class="feature-title">周二至周日 09:00–17:30</text><text class="feature-desc">节假日开放时间以平台通知为准</text></view></view></view></view><view class="block"><text class="block-title">可预约服务</text><view class="card"><view wx:for="{{services}}" wx:key="*this" class="menu-row"><view class="feature-icon">{{index+1}}</view><text class="feature-title" style="flex:1">{{item}}</text><text class="arrow">›</text></view></view></view><view class="notice">服务站人员仅处理现场预约与指定服务,不会浏览无关用户资料。</view></view><view class="fixed-action"><view class="primary-btn" bindtap="book">预约到站服务</view></view></view>
|
||||
<view class="service-page reference-page"><view class="hero"><text class="eyebrow">固定公益服务阵地</text><text class="hero-title">善缘丹阳公益服务站</text><text class="hero-desc">提供面对面的婚恋服务咨询,让线上服务在丹阳有真实落点。</text></view><view class="content"><view class="block"><text class="block-title">服务站信息</text><view class="card"><view class="feature-row"><view class="feature-icon">址</view><view class="feature-copy"><text class="feature-title">丹阳市城区公益服务中心</text><text class="feature-desc">丹阳市云阳街道(具体地址以预约确认为准)</text></view></view><view class="feature-row"><view class="feature-icon">时</view><view class="feature-copy"><text class="feature-title">周二至周日 09:00–17:30</text><text class="feature-desc">节假日开放时间以平台通知为准</text></view></view></view></view><view class="block"><text class="block-title">可预约服务</text><view class="card"><view wx:for="{{services}}" wx:key="*this" class="menu-row"><view class="feature-icon">{{index+1}}</view><text class="feature-title" style="flex:1">{{item}}</text><text class="arrow">›</text></view></view></view><view class="notice">服务站人员仅处理现场预约与指定服务,不会浏览无关用户资料。</view></view><view class="fixed-action"><view class="primary-btn" bindtap="book">预约到站服务</view></view></view>
|
||||
@@ -0,0 +1,70 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const root = resolve(import.meta.dirname, '..')
|
||||
const read = (path) => readFileSync(resolve(root, path), 'utf8')
|
||||
const app = JSON.parse(read('miniapp/app.json'))
|
||||
const corePages = [
|
||||
'index',
|
||||
'discover',
|
||||
'messages',
|
||||
'activity',
|
||||
'mine',
|
||||
'matchmaker',
|
||||
'counseling-intro',
|
||||
'premarital-intro',
|
||||
'content',
|
||||
'anti-fraud',
|
||||
'service-station',
|
||||
]
|
||||
const quickEntryCodes = [
|
||||
'find_object',
|
||||
'matchmaker',
|
||||
'activities',
|
||||
'counseling',
|
||||
'classroom',
|
||||
'premarital',
|
||||
'anti_fraud',
|
||||
'service_station',
|
||||
]
|
||||
|
||||
assert.deepEqual(
|
||||
app.tabBar.list.map((item) => item.text),
|
||||
['首页', '找对象', '消息', '活动', '我的'],
|
||||
'五个 Tab 的顺序发生偏移',
|
||||
)
|
||||
|
||||
for (const page of corePages) {
|
||||
const base = `miniapp/pages/${page}/${page}`
|
||||
for (const extension of ['.json', '.wxml', '.wxss']) {
|
||||
assert.ok(existsSync(resolve(root, base + extension)), `${page}${extension} 不存在`)
|
||||
}
|
||||
const template = read(base + '.wxml')
|
||||
assert.match(template, /reference-page/, `${page} 未接入参考图页面骨架`)
|
||||
assert.doesNotMatch(template, /[\u{1F300}-\u{1FAFF}]/u, `${page} 含 Emoji`)
|
||||
}
|
||||
|
||||
const homeLogic = read('miniapp/pages/index/index.ts')
|
||||
let previousIndex = -1
|
||||
for (const code of quickEntryCodes) {
|
||||
const index = homeLogic.indexOf(code)
|
||||
assert.ok(index >= 0, `首页缺少入口 ${code}`)
|
||||
assert.ok(index > previousIndex, `首页入口 ${code} 顺序错误`)
|
||||
previousIndex = index
|
||||
}
|
||||
|
||||
const theme = read('miniapp/app.wxss')
|
||||
for (const token of [
|
||||
'--mini-night-start',
|
||||
'--mini-night-end',
|
||||
'--mini-accent-pink',
|
||||
'--mini-accent-coral',
|
||||
'--mini-card-bg',
|
||||
'--mini-card-radius',
|
||||
'--mini-shadow',
|
||||
]) {
|
||||
assert.ok(theme.includes(token), `缺少全局 Token ${token}`)
|
||||
}
|
||||
|
||||
console.log('Miniapp reference contracts passed')
|
||||
Reference in New Issue
Block a user