|
|
@@ -1,25 +1,50 @@
|
|
|
<template>
|
|
|
- <view class="container">
|
|
|
+ <view class="wisdom-container">
|
|
|
+ <!-- 1. 品牌头部 -->
|
|
|
<PageBanner theme="wisdom"
|
|
|
tagline="学以启智 · 慧及未来"
|
|
|
quote="知者不惑,仁者不忧" />
|
|
|
|
|
|
- <view class="section" v-if="sectionVisible('today_tasks') && isLoggedIn">
|
|
|
- <view class="section-header">
|
|
|
- <text class="section-title">📋 我的任务</text>
|
|
|
- <text class="section-more" @click="goTasks">全部 ›</text>
|
|
|
- </view>
|
|
|
- <view class="task-wrap" v-if="todayTasks.length > 0">
|
|
|
- <view class="task-item" v-for="task in todayTasks" :key="task.id">
|
|
|
- <text class="task-name">{{ task.title }}</text>
|
|
|
- <text class="task-points">+{{ task.points || 0 }}分</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="task-empty" v-else>
|
|
|
- <text class="task-empty-text">今日暂无任务</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ <!-- 2. 游客专属区块 -->
|
|
|
+ <template v-if="!isLoggedIn">
|
|
|
+ <LoginGuideCard
|
|
|
+ title="登录后查看全家智慧成长数据"
|
|
|
+ :items="[
|
|
|
+ '查看全家认知能量数据和测评报告',
|
|
|
+ '记录每日成长,获取智慧能量',
|
|
|
+ '参与认知训练,提升综合能力'
|
|
|
+ ]" />
|
|
|
+ <WisdomTips />
|
|
|
+ </template>
|
|
|
|
|
|
+ <!-- 3. 五维能量条(登录后) -->
|
|
|
+ <FamilyEnergyBar
|
|
|
+ v-if="isLoggedIn"
|
|
|
+ dimensionCode="wisdom"
|
|
|
+ :sandboxData="sandboxData"
|
|
|
+ :dualDimension="dualDimension" />
|
|
|
+
|
|
|
+ <!-- 4. 家庭成员关系图谱(登录后) -->
|
|
|
+ <FamilyRelationGraph
|
|
|
+ v-if="isLoggedIn && familyMembersVisible.length > 0"
|
|
|
+ dimensionCode="wisdom"
|
|
|
+ :selfId="activeChildId"
|
|
|
+ :members="familyMembersVisible"
|
|
|
+ :energyMap="energyMapForGraph"
|
|
|
+ :intimacyMap="intimacyMapForGraph"
|
|
|
+ @memberTap="goMemberDetail" />
|
|
|
+
|
|
|
+ <!-- 5. 用户快捷入口 -->
|
|
|
+ <UserQuickEntry
|
|
|
+ v-if="isLoggedIn"
|
|
|
+ :userName="userName"
|
|
|
+ roleName="家长"
|
|
|
+ :currentChildName="activeChildName"
|
|
|
+ :children="children"
|
|
|
+ @childChanged="onChildChanged"
|
|
|
+ @scrollTo="scrollToSection" />
|
|
|
+
|
|
|
+ <!-- 6. 功能入口 -->
|
|
|
<view class="func-section" v-if="sectionVisible('func_entries')">
|
|
|
<view class="func-grid">
|
|
|
<view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
|
|
|
@@ -31,72 +56,177 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="section" v-if="sectionVisible('hot_activities')">
|
|
|
+ <!-- 7. 认知摘要区(登录后) -->
|
|
|
+ <view class="section" v-if="isLoggedIn">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">🔥 热门活动</text>
|
|
|
- <text class="section-more" @click="goMoreActivities">更多 ›</text>
|
|
|
+ <text class="section-title">认知概览</text>
|
|
|
+ <text class="section-more" @click="goCognitiveReport">查看详情 ›</text>
|
|
|
</view>
|
|
|
- <scroll-view scroll-x class="activity-scroll" show-scrollbar="false">
|
|
|
- <view class="activity-card" v-for="act in hotActivities" :key="act.id" @click="goActivityDetail(act.id)">
|
|
|
- <image class="activity-img" :src="act.image || '/static/default-activity.png'" mode="aspectFill" />
|
|
|
- <view class="activity-info">
|
|
|
- <text class="activity-name">{{ act.name }}</text>
|
|
|
- <text class="activity-meta">{{ act.date }} · {{ act.location }}</text>
|
|
|
- </view>
|
|
|
+ <view class="cognition-summary" v-if="cognitiveReport">
|
|
|
+ <view class="summary-main">
|
|
|
+ <text class="summary-score">{{ cognitiveReport.overallScore || '--' }}</text>
|
|
|
+ <text class="summary-label">综合认知评分</text>
|
|
|
+ </view>
|
|
|
+ <view class="summary-detail">
|
|
|
+ <text class="summary-dan">DAN等级: {{ cognitiveReport.danLevel || '-' }}</text>
|
|
|
+ <text class="summary-min" v-if="lowestDimension">
|
|
|
+ 待提升: {{ lowestDimension.label }} ({{ lowestDimension.score }})
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="cognition-empty" v-else>
|
|
|
+ <text class="empty-tip">暂无认知测评数据</text>
|
|
|
+ <text class="empty-sub">完成DAN评估后查看详细报告</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 8. 自己出题入口卡(登录后) -->
|
|
|
+ <view class="section highlight-card" v-if="isLoggedIn" @click="goSelfQuiz">
|
|
|
+ <view class="highlight-card-inner">
|
|
|
+ <view class="highlight-card-left">
|
|
|
+ <text class="highlight-icon">✏️</text>
|
|
|
+ </view>
|
|
|
+ <view class="highlight-card-right">
|
|
|
+ <text class="highlight-title">自己出题自己答</text>
|
|
|
+ <text class="highlight-desc">元认知训练:自己出题、自己判分,提升学习能力</text>
|
|
|
+ </view>
|
|
|
+ <text class="highlight-arrow">›</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 9. 训练中心入口卡(登录后) -->
|
|
|
+ <view class="section highlight-card" v-if="isLoggedIn" @click="goTrainingHub">
|
|
|
+ <view class="highlight-card-inner">
|
|
|
+ <view class="highlight-card-left">
|
|
|
+ <text class="highlight-icon">🧠</text>
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
+ <view class="highlight-card-right">
|
|
|
+ <text class="highlight-title">认知训练中心</text>
|
|
|
+ <text class="highlight-desc">舒尔特方格 · 猜数字 — 多维度认知训练游戏</text>
|
|
|
+ </view>
|
|
|
+ <text class="highlight-arrow">›</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="section" v-if="sectionVisible('recommended_products')">
|
|
|
+ <!-- 10. 维度任务 -->
|
|
|
+ <DimensionTasks
|
|
|
+ v-if="isLoggedIn"
|
|
|
+ dimensionCode="wisdom"
|
|
|
+ :tasks="dimensionTasks"
|
|
|
+ @taskClick="onTaskClick"
|
|
|
+ @moreTasks="goTasks" />
|
|
|
+
|
|
|
+ <!-- 11. 维度活动 -->
|
|
|
+ <DimensionActivities
|
|
|
+ dimensionCode="wisdom"
|
|
|
+ :activities="dimensionActivities"
|
|
|
+ @activityClick="goActivityDetail"
|
|
|
+ @moreActivities="goMoreActivities" />
|
|
|
+
|
|
|
+ <!-- 12. 维度商品 -->
|
|
|
+ <DimensionProducts
|
|
|
+ dimensionCode="wisdom"
|
|
|
+ :products="dimensionProducts"
|
|
|
+ @productClick="goProductDetail"
|
|
|
+ @moreProducts="goMoreProducts" />
|
|
|
+
|
|
|
+ <!-- 13. 智慧小贴士 -->
|
|
|
+ <view class="section" v-if="sectionVisible('wisdom_tips')">
|
|
|
<view class="section-header">
|
|
|
- <text class="section-title">🛍️ 推荐商品</text>
|
|
|
- <text class="section-more" @click="goMoreProducts">更多 ›</text>
|
|
|
+ <text class="section-title">智慧小贴士</text>
|
|
|
</view>
|
|
|
- <view class="product-list">
|
|
|
- <view class="product-card" v-for="prod in recommendedProducts" :key="prod.id" @click="goProductDetail(prod.id)">
|
|
|
- <image class="product-img" :src="prod.image || '/static/default-product.png'" mode="aspectFill" />
|
|
|
- <text class="product-name line-clamp-2">{{ prod.name }}</text>
|
|
|
- <text class="product-price">{{ formatPriceWithSymbol(prod.price) }}</text>
|
|
|
+ <view class="tips-list">
|
|
|
+ <view class="tip-card" v-for="item in wisdomTips" :key="item.id">
|
|
|
+ <text class="tip-title">{{ item.title }}</text>
|
|
|
+ <text class="tip-summary">{{ item.summary }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <!-- 14. 快捷操作按钮 -->
|
|
|
+ <view class="section quick-actions" v-if="isLoggedIn">
|
|
|
+ <view class="action-btn" @click="goCognitiveReport">
|
|
|
+ <text class="action-icon">📊</text>
|
|
|
+ <text class="action-text">认知报告</text>
|
|
|
+ </view>
|
|
|
+ <view class="action-btn" @click="goTrainingHub">
|
|
|
+ <text class="action-icon">🧠</text>
|
|
|
+ <text class="action-text">认知训练</text>
|
|
|
+ </view>
|
|
|
+ <view class="action-btn" @click="goAssessment">
|
|
|
+ <text class="action-icon">📋</text>
|
|
|
+ <text class="action-text">测评预约</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 底部占位 -->
|
|
|
<view class="bottom-spacer"></view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
|
-import { getVisibleSections, getEnergyOverview, getTodayTasks } from '../../utils/api.js'
|
|
|
+import LoginGuideCard from '../../components/LoginGuideCard.vue'
|
|
|
+import WisdomTips from '../../components/WisdomTips.vue'
|
|
|
+import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
|
|
|
+import UserQuickEntry from '../../components/UserQuickEntry.vue'
|
|
|
+import DimensionTasks from '../../components/DimensionTasks.vue'
|
|
|
+import DimensionActivities from '../../components/DimensionActivities.vue'
|
|
|
+import DimensionProducts from '../../components/DimensionProducts.vue'
|
|
|
+import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
|
|
|
+import { getVisibleSections, getChildren, getTodayTasksByCategory, getActivityList, getProductsByDomain, getFamilyEnergySandbox, getAssessmentLatestResult } from '../../utils/api.js'
|
|
|
|
|
|
export default {
|
|
|
- components: { PageBanner },
|
|
|
+ components: { PageBanner, LoginGuideCard, WisdomTips, FamilyEnergyBar, UserQuickEntry, DimensionTasks, DimensionActivities, DimensionProducts, FamilyRelationGraph },
|
|
|
data() {
|
|
|
return {
|
|
|
isLoggedIn: false,
|
|
|
role: null,
|
|
|
- currentChildId: null,
|
|
|
- totalEnergy: null,
|
|
|
+ activeChildId: null,
|
|
|
+ activeChildName: '',
|
|
|
+ userName: '',
|
|
|
+ children: [],
|
|
|
+ familyMembersVisible: [],
|
|
|
+ sandboxData: null,
|
|
|
+ dualDimension: null,
|
|
|
visibleSections: [],
|
|
|
+ cognitiveReport: null,
|
|
|
+ lowestDimension: null,
|
|
|
+ dimensionTasks: [],
|
|
|
+ dimensionActivities: [],
|
|
|
+ dimensionProducts: [],
|
|
|
funcList: [
|
|
|
- { icon: '\u{1F4DA}', label: '学习任务', needLogin: true, page: '/pages/tasks/tasks' },
|
|
|
- { icon: '\u{1F3AE}', label: '小游戏', needLogin: false, page: '/pages/games/list' },
|
|
|
- { icon: '\u{1F9E9}', label: '测评中心', needLogin: false, page: '/pages/assessment/apply' },
|
|
|
- { icon: '\u{1F4D6}', label: '阅读天地', needLogin: false, page: '/pages/mind/articles' },
|
|
|
- { icon: '\u{1F4A1}', label: '知识挑战', needLogin: false, page: '' }
|
|
|
- ],
|
|
|
- hotActivities: [
|
|
|
- { id: 1, name: '少儿编程启蒙营', date: '周六', location: '线上', image: '' },
|
|
|
- { id: 2, name: '经典阅读分享会', date: '周日', location: '浠艾福中心', image: '' },
|
|
|
- { id: 3, name: '科学实验探索课', date: '下周六', location: '浠艾福中心', image: '' }
|
|
|
+ { icon: '\u{1F4CA}', label: '认知报告', needLogin: true, page: '/pages/wisdom/cognitive-report' },
|
|
|
+ { icon: '\u{270F}\uFE0F', label: '自己出题', needLogin: true, page: '/pages/wisdom/self-quiz' },
|
|
|
+ { icon: '\u{1F9E0}', label: '训练中心', needLogin: true, page: '/pages/wisdom/training-hub' },
|
|
|
+ { icon: '\u{1F3AF}', label: '测评预约', needLogin: false, page: '/pages/assessment/apply' },
|
|
|
+ { icon: '\u{1F4D6}', label: '阅读天地', needLogin: false, page: '/pages/mind/articles' }
|
|
|
],
|
|
|
- recommendedProducts: [
|
|
|
- { id: 1, name: '儿童百科全书套装', price: 199, image: '' },
|
|
|
- { id: 2, name: '益智棋类礼盒', price: 159, image: '' },
|
|
|
- { id: 3, name: '科学实验套装', price: 299, image: '' },
|
|
|
- { id: 4, name: '中外名著精选', price: 129, image: '' }
|
|
|
- ],
|
|
|
- todayTasks: []
|
|
|
+ wisdomTips: [
|
|
|
+ { id: 1, title: '认知发展的关键期', summary: '儿童认知发展存在关键期窗口,抓住每个阶段的核心能力培养机会。' },
|
|
|
+ { id: 2, title: '元认知训练的意义', summary: '教会孩子"学会如何学习",通过自我监控和反思提升学习效率。' },
|
|
|
+ { id: 3, title: '专注力的培养方法', summary: '从短时间专注起步,逐步延长专注时长,配合舒尔特方格等训练工具。' },
|
|
|
+ { id: 4, title: '多维度认知刺激', summary: '综合运用视、听、触等多种感官刺激,促进大脑神经网络全面发展。' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ energyMapForGraph: function() {
|
|
|
+ var map = {}
|
|
|
+ if (this.sandboxData && this.sandboxData.members) {
|
|
|
+ for (var i = 0; i < this.sandboxData.members.length; i++) {
|
|
|
+ var m = this.sandboxData.members[i]
|
|
|
+ map[m.memberId || m.id] = {
|
|
|
+ bodyScore: m.bodyScore || 0,
|
|
|
+ mindScore: m.mindScore || 0,
|
|
|
+ actionScore: m.actionScore || 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return map
|
|
|
+ },
|
|
|
+ intimacyMapForGraph: function() {
|
|
|
+ return {}
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
@@ -104,58 +234,147 @@ export default {
|
|
|
this.isLoggedIn = !!token
|
|
|
if (this.isLoggedIn) {
|
|
|
this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
|
|
|
- this.currentChildId = uni.getStorageSync('currentChildId') || null
|
|
|
+ this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '家长'
|
|
|
}
|
|
|
this.loadSectionConfig()
|
|
|
if (this.isLoggedIn) {
|
|
|
- this.loadEnergyData()
|
|
|
- this.loadTodayTasks()
|
|
|
+ this.loadChildren()
|
|
|
+ this.loadFamilyMembersVisible()
|
|
|
+ this.loadCognitiveReport()
|
|
|
}
|
|
|
+ this.loadDimensionActivities()
|
|
|
+ this.loadDimensionProducts()
|
|
|
},
|
|
|
methods: {
|
|
|
- async loadSectionConfig() {
|
|
|
- var baseSections = ['func_entries', 'hot_activities', 'recommended_products']
|
|
|
+ loadSectionConfig: function() {
|
|
|
+ var baseSections = ['func_entries', 'wisdom_tips']
|
|
|
if (!uni.getStorageSync('token')) {
|
|
|
this.visibleSections = baseSections
|
|
|
return
|
|
|
}
|
|
|
var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
|
|
|
- try {
|
|
|
- var res = await getVisibleSections({ pageKey: 'wisdom', role: role })
|
|
|
+ var self = this
|
|
|
+ getVisibleSections({ pageKey: 'wisdom', role: role }).then(function(res) {
|
|
|
if (res.code === 200 && res.data) {
|
|
|
var keys = res.data.map(function(s) { return s.sectionKey })
|
|
|
var merged = baseSections.slice()
|
|
|
keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
|
|
|
- this.visibleSections = merged
|
|
|
+ self.visibleSections = merged
|
|
|
+ }
|
|
|
+ }).catch(function(e) {
|
|
|
+ self.visibleSections = ['func_entries', 'wisdom_tips']
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadChildren: function() {
|
|
|
+ var self = this
|
|
|
+ getChildren().then(function(res) {
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
+ self.children = res.data
|
|
|
+ if (self.children.length > 0) {
|
|
|
+ var activeId = uni.getStorageSync('currentChildId')
|
|
|
+ if (activeId) {
|
|
|
+ for (var i = 0; i < self.children.length; i++) {
|
|
|
+ if (self.children[i].id == activeId) {
|
|
|
+ self.activeChildId = activeId
|
|
|
+ self.activeChildName = self.children[i].nickname || self.children[i].name || ''
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!self.activeChildId) {
|
|
|
+ self.activeChildId = self.children[0].id
|
|
|
+ self.activeChildName = self.children[0].nickname || self.children[0].name || ''
|
|
|
+ uni.setStorageSync('currentChildId', self.activeChildId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(function(e) {})
|
|
|
+ },
|
|
|
+ loadFamilyMembersVisible: function() {
|
|
|
+ var self = this
|
|
|
+ getFamilyEnergySandbox().then(function(res) {
|
|
|
+ if (res && res.data) {
|
|
|
+ self.sandboxData = res.data.sandboxData || null
|
|
|
+ self.dualDimension = res.data.dualDimension || null
|
|
|
+ if (res.data.members) {
|
|
|
+ self.familyMembersVisible = res.data.members
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(function(e) {})
|
|
|
+ },
|
|
|
+ loadCognitiveReport: function() {
|
|
|
+ var self = this
|
|
|
+ var childId = this.activeChildId
|
|
|
+ if (!childId) return
|
|
|
+ getAssessmentLatestResult(childId).then(function(res) {
|
|
|
+ if (res.code === 200 && res.data) {
|
|
|
+ self.cognitiveReport = res.data
|
|
|
+ self.findLowestDimension(res.data)
|
|
|
+ }
|
|
|
+ }).catch(function(e) {})
|
|
|
+ },
|
|
|
+ findLowestDimension: function(report) {
|
|
|
+ var dims = [
|
|
|
+ { key: 'perceptionScore', label: '感知能力' },
|
|
|
+ { key: 'focusScore', label: '专注力' },
|
|
|
+ { key: 'memoryScore', label: '记忆力' },
|
|
|
+ { key: 'logicScore', label: '逻辑思维' },
|
|
|
+ { key: 'spatialScore', label: '空间思维' },
|
|
|
+ { key: 'processingSpeedScore', label: '加工速度' }
|
|
|
+ ]
|
|
|
+ var lowest = null
|
|
|
+ var minVal = Infinity
|
|
|
+ for (var i = 0; i < dims.length; i++) {
|
|
|
+ var val = report[dims[i].key]
|
|
|
+ if (val !== null && val !== undefined && val < minVal) {
|
|
|
+ minVal = val
|
|
|
+ lowest = { label: dims[i].label, score: val }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.lowestDimension = lowest
|
|
|
+ },
|
|
|
+ onChildChanged: function(childId) {
|
|
|
+ this.activeChildId = childId
|
|
|
+ uni.setStorageSync('currentChildId', childId)
|
|
|
+ for (var i = 0; i < this.children.length; i++) {
|
|
|
+ if (this.children[i].id == childId) {
|
|
|
+ this.activeChildName = this.children[i].nickname || this.children[i].name || ''
|
|
|
+ break
|
|
|
}
|
|
|
- } catch (e) {
|
|
|
- this.visibleSections = ['func_entries', 'hot_activities', 'recommended_products']
|
|
|
}
|
|
|
+ this.loadFamilyMembersVisible()
|
|
|
+ this.loadCognitiveReport()
|
|
|
},
|
|
|
- async loadEnergyData() {
|
|
|
- var childId = this.currentChildId
|
|
|
+ loadDimensionTasks: function() {
|
|
|
+ var self = this
|
|
|
+ var childId = this.activeChildId
|
|
|
if (!childId) return
|
|
|
- try {
|
|
|
- var res = await getEnergyOverview(childId)
|
|
|
+ getTodayTasksByCategory(childId, 'wisdom').then(function(res) {
|
|
|
if (res && res.data) {
|
|
|
- this.totalEnergy = res.data.totalEnergy || 0
|
|
|
+ self.dimensionTasks = res.data.slice(0, 5)
|
|
|
}
|
|
|
- } catch (e) { console.log('获取能量概览失败', e) }
|
|
|
+ }).catch(function(e) {})
|
|
|
},
|
|
|
- async loadTodayTasks() {
|
|
|
- var childId = this.currentChildId
|
|
|
- if (!childId) return
|
|
|
- try {
|
|
|
- var res = await getTodayTasks(childId)
|
|
|
+ loadDimensionActivities: function() {
|
|
|
+ var self = this
|
|
|
+ getActivityList({ dimensionCode: 'wisdom', page: 1, size: 5 }).then(function(res) {
|
|
|
if (res && res.data) {
|
|
|
- this.todayTasks = res.data.slice(0, 5)
|
|
|
+ self.dimensionActivities = res.data.records || res.data
|
|
|
}
|
|
|
- } catch (e) { console.log('获取今日任务失败', e) }
|
|
|
+ }).catch(function(e) {})
|
|
|
},
|
|
|
- sectionVisible(key) {
|
|
|
+ loadDimensionProducts: function() {
|
|
|
+ var self = this
|
|
|
+ getProductsByDomain('wisdom', 1, 4).then(function(res) {
|
|
|
+ if (res && res.data) {
|
|
|
+ self.dimensionProducts = res.data.records || res.data
|
|
|
+ }
|
|
|
+ }).catch(function(e) {})
|
|
|
+ },
|
|
|
+ sectionVisible: function(key) {
|
|
|
return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
|
|
|
},
|
|
|
- onFuncClick(item) {
|
|
|
+ onFuncClick: function(item) {
|
|
|
if (item.needLogin && !this.isLoggedIn) {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
@@ -173,10 +392,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- goMoreActivities() {},
|
|
|
- goActivityDetail(id) {},
|
|
|
- goMoreProducts() {},
|
|
|
- goProductDetail(id) {
|
|
|
+ scrollToSection: function(section) {},
|
|
|
+ goMemberDetail: function(memberId) {
|
|
|
+ uni.navigateTo({ url: '/pages/wisdom/member-wisdom-detail?memberId=' + memberId })
|
|
|
+ },
|
|
|
+ goCognitiveReport: function() {
|
|
|
+ uni.navigateTo({ url: '/pages/wisdom/cognitive-report' })
|
|
|
+ },
|
|
|
+ goSelfQuiz: function() {
|
|
|
+ uni.navigateTo({ url: '/pages/wisdom/self-quiz' })
|
|
|
+ },
|
|
|
+ goTrainingHub: function() {
|
|
|
+ uni.navigateTo({ url: '/pages/wisdom/training-hub' })
|
|
|
+ },
|
|
|
+ goAssessment: function() {
|
|
|
+ uni.navigateTo({ url: '/pages/assessment/apply' })
|
|
|
+ },
|
|
|
+ onTaskClick: function(task) {},
|
|
|
+ goTasks: function() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
|
|
|
+ goActivityDetail: function(id) {},
|
|
|
+ goMoreActivities: function() {},
|
|
|
+ goProductDetail: function(id) {
|
|
|
var token = uni.getStorageSync('token')
|
|
|
if (token) {
|
|
|
uni.navigateTo({ url: '/pages/discover/product-detail/product-detail?id=' + id })
|
|
|
@@ -184,14 +420,13 @@ export default {
|
|
|
uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/wisdom/index') })
|
|
|
}
|
|
|
},
|
|
|
- goTasks() { uni.switchTab({ url: '/pages/tasks/tasks' }) },
|
|
|
- goLogin() { uni.navigateTo({ url: '/pages/login/login' }) }
|
|
|
+ goMoreProducts: function() {}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.container {
|
|
|
+.wisdom-container {
|
|
|
min-height: 100vh;
|
|
|
background: #f5f7fa;
|
|
|
padding-bottom: 120rpx;
|
|
|
@@ -202,6 +437,7 @@ export default {
|
|
|
position: relative;
|
|
|
z-index: 2;
|
|
|
}
|
|
|
+
|
|
|
.func-grid {
|
|
|
background: #fff;
|
|
|
border-radius: 24rpx;
|
|
|
@@ -209,15 +445,18 @@ export default {
|
|
|
display: flex;
|
|
|
box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
|
|
|
}
|
|
|
+
|
|
|
.func-item {
|
|
|
flex: 1;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
}
|
|
|
+
|
|
|
.func-item:active {
|
|
|
opacity: 0.7;
|
|
|
}
|
|
|
+
|
|
|
.func-icon-wrap {
|
|
|
width: 88rpx;
|
|
|
height: 88rpx;
|
|
|
@@ -228,137 +467,230 @@ export default {
|
|
|
justify-content: center;
|
|
|
margin-bottom: 10rpx;
|
|
|
}
|
|
|
+
|
|
|
.func-icon {
|
|
|
font-size: 40rpx;
|
|
|
}
|
|
|
+
|
|
|
.func-label {
|
|
|
font-size: 24rpx;
|
|
|
color: #333;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
|
|
|
+/* ===== Section ===== */
|
|
|
.section {
|
|
|
margin: 20rpx 20rpx;
|
|
|
}
|
|
|
+
|
|
|
.section-header {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
margin-bottom: 20rpx;
|
|
|
}
|
|
|
+
|
|
|
.section-title {
|
|
|
font-size: 30rpx;
|
|
|
font-weight: bold;
|
|
|
color: #333;
|
|
|
}
|
|
|
+
|
|
|
.section-more {
|
|
|
font-size: 24rpx;
|
|
|
color: #999;
|
|
|
}
|
|
|
|
|
|
-.activity-scroll {
|
|
|
- white-space: nowrap;
|
|
|
+/* ===== 认知概览 ===== */
|
|
|
+.cognition-summary {
|
|
|
+ background: linear-gradient(135deg, #FFD700, #FFA500);
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 30rpx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.summary-main {
|
|
|
+ text-align: center;
|
|
|
+ margin-right: 30rpx;
|
|
|
+ padding-right: 30rpx;
|
|
|
+ border-right: 2rpx solid rgba(255,255,255,0.3);
|
|
|
}
|
|
|
-.activity-card {
|
|
|
- display: inline-block;
|
|
|
- width: 280rpx;
|
|
|
- margin-right: 20rpx;
|
|
|
+
|
|
|
+.summary-score {
|
|
|
+ font-size: 60rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #fff;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+
|
|
|
+.summary-label {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: rgba(255,255,255,0.85);
|
|
|
+ display: block;
|
|
|
+ margin-top: 4rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.summary-detail {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+
|
|
|
+.summary-dan {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #fff;
|
|
|
+ font-weight: bold;
|
|
|
+ display: block;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.summary-min {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: rgba(255,255,255,0.85);
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+
|
|
|
+.cognition-empty {
|
|
|
background: #fff;
|
|
|
border-radius: 16rpx;
|
|
|
- overflow: hidden;
|
|
|
+ padding: 40rpx;
|
|
|
+ text-align: center;
|
|
|
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
}
|
|
|
-.activity-img {
|
|
|
- width: 280rpx;
|
|
|
- height: 180rpx;
|
|
|
- background: #f0f0f0;
|
|
|
-}
|
|
|
-.activity-info {
|
|
|
- padding: 16rpx;
|
|
|
-}
|
|
|
-.activity-name {
|
|
|
+
|
|
|
+.empty-tip {
|
|
|
font-size: 26rpx;
|
|
|
- font-weight: bold;
|
|
|
- color: #333;
|
|
|
+ color: #999;
|
|
|
display: block;
|
|
|
}
|
|
|
-.activity-meta {
|
|
|
+
|
|
|
+.empty-sub {
|
|
|
font-size: 22rpx;
|
|
|
- color: #999;
|
|
|
- margin-top: 8rpx;
|
|
|
+ color: #ccc;
|
|
|
+ margin-top: 6rpx;
|
|
|
display: block;
|
|
|
}
|
|
|
|
|
|
-.product-list {
|
|
|
+/* ===== 高亮卡片 ===== */
|
|
|
+.highlight-card {
|
|
|
+ margin: 20rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.highlight-card-inner {
|
|
|
display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- gap: 20rpx;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ background: linear-gradient(135deg, #FFF8E1, #fff);
|
|
|
+ border: 2rpx solid #FFD700;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 24rpx;
|
|
|
}
|
|
|
-.product-card {
|
|
|
- width: calc(50% - 10rpx);
|
|
|
- background: #fff;
|
|
|
- border-radius: 16rpx;
|
|
|
- overflow: hidden;
|
|
|
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+
|
|
|
+.highlight-card:active {
|
|
|
+ opacity: 0.8;
|
|
|
}
|
|
|
-.product-img {
|
|
|
- width: 100%;
|
|
|
- height: 240rpx;
|
|
|
- background: #f0f0f0;
|
|
|
+
|
|
|
+.highlight-card-left {
|
|
|
+ width: 72rpx;
|
|
|
+ height: 72rpx;
|
|
|
+ border-radius: 18rpx;
|
|
|
+ background: #FFD700;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-right: 20rpx;
|
|
|
}
|
|
|
-.product-name {
|
|
|
- font-size: 26rpx;
|
|
|
- color: #333;
|
|
|
- padding: 12rpx 16rpx 0;
|
|
|
+
|
|
|
+.highlight-icon {
|
|
|
+ font-size: 36rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.highlight-card-right {
|
|
|
+ flex: 1;
|
|
|
}
|
|
|
-.product-price {
|
|
|
+
|
|
|
+.highlight-title {
|
|
|
font-size: 28rpx;
|
|
|
- color: #F97316;
|
|
|
font-weight: bold;
|
|
|
- padding: 8rpx 16rpx 16rpx;
|
|
|
+ color: #B8860B;
|
|
|
display: block;
|
|
|
+ margin-bottom: 4rpx;
|
|
|
}
|
|
|
-.line-clamp-2 {
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: -webkit-box;
|
|
|
- -webkit-line-clamp: 2;
|
|
|
- -webkit-box-orient: vertical;
|
|
|
+
|
|
|
+.highlight-desc {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #999;
|
|
|
+ display: block;
|
|
|
}
|
|
|
|
|
|
-.task-wrap {
|
|
|
- background: #fff;
|
|
|
- border-radius: 16rpx;
|
|
|
- overflow: hidden;
|
|
|
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+.highlight-arrow {
|
|
|
+ font-size: 36rpx;
|
|
|
+ color: #ccc;
|
|
|
+ margin-left: 10rpx;
|
|
|
}
|
|
|
-.task-item {
|
|
|
+
|
|
|
+/* ===== 小贴士 ===== */
|
|
|
+.tips-list {
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 28rpx 24rpx;
|
|
|
- border-bottom: 1rpx solid #f0f0f0;
|
|
|
+ flex-direction: column;
|
|
|
}
|
|
|
-.task-item:last-child {
|
|
|
- border-bottom: none;
|
|
|
+
|
|
|
+.tip-card {
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ padding: 24rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+ border-left: 6rpx solid #FFD700;
|
|
|
}
|
|
|
-.task-name {
|
|
|
+
|
|
|
+.tip-title {
|
|
|
font-size: 26rpx;
|
|
|
+ font-weight: bold;
|
|
|
color: #333;
|
|
|
+ display: block;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
}
|
|
|
-.task-points {
|
|
|
+
|
|
|
+.tip-summary {
|
|
|
font-size: 24rpx;
|
|
|
- color: #F97316;
|
|
|
+ color: #999;
|
|
|
+ line-height: 1.5;
|
|
|
+ display: block;
|
|
|
}
|
|
|
-.task-empty {
|
|
|
+
|
|
|
+/* ===== 快捷操作 ===== */
|
|
|
+.quick-actions {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-around;
|
|
|
+ margin: 20rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.action-btn {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
background: #fff;
|
|
|
border-radius: 16rpx;
|
|
|
- padding: 60rpx;
|
|
|
- text-align: center;
|
|
|
+ padding: 20rpx 30rpx;
|
|
|
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+ flex: 1;
|
|
|
+ margin: 0 8rpx;
|
|
|
}
|
|
|
-.task-empty-text {
|
|
|
- font-size: 26rpx;
|
|
|
- color: #999;
|
|
|
+
|
|
|
+.action-btn:active {
|
|
|
+ opacity: 0.7;
|
|
|
+}
|
|
|
+
|
|
|
+.action-icon {
|
|
|
+ font-size: 36rpx;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.action-text {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #333;
|
|
|
}
|
|
|
|
|
|
.bottom-spacer {
|