|
|
@@ -141,11 +141,22 @@ export default {
|
|
|
if (res.code === 200 && res.data) {
|
|
|
self.report = res.data
|
|
|
}
|
|
|
+ }).catch(function() {}).finally(function() {
|
|
|
self.loading = false
|
|
|
- }).catch(function() {
|
|
|
- self.loading = false
|
|
|
+ self.loadRecommendations()
|
|
|
})
|
|
|
},
|
|
|
+ loadRecommendations: function() {
|
|
|
+ var self = this
|
|
|
+ var memberId = self.memberId || uni.getStorageSync('currentChildId')
|
|
|
+ if (!memberId) return
|
|
|
+ self.recLoading = true
|
|
|
+ getProfileRecommend({ memberId: memberId, types: ['article', 'activity'], limit: 5 }).then(function(res) {
|
|
|
+ if (res.code === 200 && res.data && res.data.recommendations) {
|
|
|
+ self.recommendations = res.data.recommendations
|
|
|
+ }
|
|
|
+ }).catch(function() {}).finally(function() { self.recLoading = false })
|
|
|
+ },
|
|
|
getScoreLevel: function(score) {
|
|
|
if (score >= 85) return 'excellent'
|
|
|
if (score >= 70) return 'good'
|
|
|
@@ -388,6 +399,25 @@ export default {
|
|
|
color: #666;
|
|
|
}
|
|
|
|
|
|
+/* ===== 推荐卡片 ===== */
|
|
|
+.rec-section { margin: 20rpx 30rpx; }
|
|
|
+.rec-list { display: flex; flex-direction: column; gap: 16rpx; }
|
|
|
+.rec-card {
|
|
|
+ background: rgba(255,255,255,0.95);
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 24rpx 28rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
|
|
|
+}
|
|
|
+.rec-card-left { display: flex; align-items: center; flex: 1; min-width: 0; }
|
|
|
+.rec-card-icon { font-size: 44rpx; margin-right: 16rpx; flex-shrink: 0; }
|
|
|
+.rec-card-info { flex: 1; min-width: 0; }
|
|
|
+.rec-card-title { font-size: 28rpx; font-weight: 600; color: #1a1a2e; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
+.rec-card-desc { font-size: 22rpx; color: #94a3b8; margin-top: 4rpx; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
+.rec-card-score { font-size: 28rpx; font-weight: 700; color: #FF6B35; flex-shrink: 0; margin-left: 16rpx; }
|
|
|
+
|
|
|
/* ===== 加载中 ===== */
|
|
|
.loading-state {
|
|
|
display: flex;
|