From d9edbf0562e482df09583fe8679ebb13551decda Mon Sep 17 00:00:00 2001 From: huanglimeng <627513797@qq.com> Date: Wed, 4 Feb 2026 20:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E5=BF=83=E5=8A=9F=E8=83=BD=E7=A8=B3?= =?UTF-8?q?=E5=AE=9A=E7=89=88=20v1=20-=20=E5=AE=8C=E6=88=9012=E4=B8=AA?= =?UTF-8?q?=E4=B8=BB=E6=B5=81=E7=89=8C=E9=98=B5=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=8D=A1=E7=89=8C=E5=B8=83=E5=B1=80=E5=92=8C=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 83 ++++++++++++++++++++++++++++++------------ pages/index/index.wxml | 29 +++++++++++++-- pages/index/index.wxss | 12 ++++-- 3 files changed, 92 insertions(+), 32 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index 2acd471..b89bbca 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -99,14 +99,6 @@ const SPREADS = [ "description": "聚焦关键问题,找出当下最可行的应对方式。", "aiSchema": ["core_theme", "current_state", "action_advice"] }, - { - "id": "five_situation_analysis", - "name": "现状分析", - "cardCount": 5, - "positions": ["现状", "内在因素", "外在影响", "行动方向", "可能结果"], - "description": "从内外层面拆解局势,明确下一步行动。", - "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] - }, { "id": "two_choice_decision", "name": "二选一抉择", @@ -115,6 +107,14 @@ const SPREADS = [ "description": "对比两种选择的潜在走向,辅助理性决策。", "aiSchema": ["core_theme", "potential_influence", "action_advice"] }, + { + "id": "five_situation_analysis", + "name": "现状分析", + "cardCount": 5, + "positions": ["现状", "内在因素", "外在影响", "行动方向", "可能结果"], + "description": "从内外层面拆解局势,明确下一步行动。", + "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] + }, { "id": "relationship_spread", "name": "关系洞察", @@ -122,6 +122,54 @@ const SPREADS = [ "positions": ["你的位置", "对方的位置", "关系现状", "隐藏影响", "未来趋势"], "description": "理解一段关系中的互动模式与发展方向。", "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] + }, + { + "id": "timeline_spread", + "name": "时间之流", + "cardCount": 5, + "positions": ["远古根源", "过去影响", "当下状态", "近期发展", "未来趋势"], + "description": "追溯事件的时间线,看清发展脉络。", + "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] + }, + { + "id": "diamond_spread", + "name": "钻石牌阵", + "cardCount": 5, + "positions": ["问题本质", "过去原因", "未来发展", "外部资源", "最佳行动"], + "description": "多角度剖析问题,找到解决之道。", + "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] + }, + { + "id": "spiritual_guidance", + "name": "灵性指引", + "cardCount": 7, + "positions": ["当前能量", "内在阻碍", "潜在天赋", "灵性课题", "指导建议", "未来机遇", "最高指引"], + "description": "深入探索内在世界,获得灵性层面的启发。", + "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] + }, + { + "id": "horseshoe_spread", + "name": "马蹄铁牌阵", + "cardCount": 7, + "positions": ["过去", "现在", "未来", "你的态度", "他人影响", "障碍", "最终结果"], + "description": "全面了解情况的来龙去脉与未来走向。", + "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] + }, + { + "id": "celtic_cross", + "name": "凯尔特十字", + "cardCount": 10, + "positions": ["现状", "挑战", "根基", "过去", "可能性", "近期未来", "你的态度", "外部影响", "希望与恐惧", "最终结果"], + "description": "最经典的综合牌阵,深度解析生命议题。", + "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] + }, + { + "id": "tree_of_life", + "name": "生命之树", + "cardCount": 10, + "positions": ["王冠", "智慧", "理解", "慈悲", "严厉", "美丽", "胜利", "荣耀", "基础", "王国"], + "description": "基于卡巴拉生命之树的深度灵性探索。", + "aiSchema": ["core_theme", "current_state", "potential_influence", "action_advice"] } ]; @@ -526,21 +574,8 @@ Page({ // --- 导航优化:统一返回逻辑 --- handleBack: function () { - const pages = getCurrentPages(); - if (pages.length > 1) { - wx.navigateBack({ - delta: 1 - }); - } else { - // 兜底逻辑:如果是在第一层,则跳转回首页 - wx.switchTab({ - url: '/pages/home/home' - }).catch(() => { - // 如果不是 tabBar,则使用 reLaunch - wx.reLaunch({ - url: '/pages/home/home' - }); - }); - } + wx.navigateBack({ + delta: 1 + }); } }) diff --git a/pages/index/index.wxml b/pages/index/index.wxml index cb20e70..ac388ab 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -64,10 +64,31 @@ module.exports.getTransform = function(indices, currentIdx, count) { var pos = indices.indexOf(currentIdx); if (pos !== -1) { - var itemWidth = 140 + 20; - var centerOffset = (pos - (count - 1) / 2) * itemWidth; - // 位移到上方槽位 (向上位移以对准 slots-container) - return 'translate(' + centerOffset + 'rpx, -450rpx) rotate(0deg)'; + // 每排最多5张牌 + var maxPerRow = 5; + var row = Math.floor(pos / maxPerRow); // 第几排(0或1) + var col = pos % maxPerRow; // 该排的第几个 + var cardsInRow = (row === 0) ? Math.min(count, maxPerRow) : (count - maxPerRow); + + // 槽位:宽100rpx + gap 20rpx = 120rpx 间距 + var slotWidth = 100; + var gap = 20; + var slotSpacing = slotWidth + gap; + + // 计算该排槽位的水平居中偏移 + // 从该排中间位置开始计算 + var centerOffset = (col - (cardsInRow - 1) / 2) * slotSpacing; + + // 垂直偏移计算 + // 第一排槽位:向上 -520rpx(已验证接近正确) + // 第二排:需要减少向上的距离 + // 槽位高度160 + gap 20 = 180,但实际可能需要微调 + var firstRowY = -520; + var secondRowOffset = 200; // 增加偏移量,让第二排更接近fan-deck + var yOffset = firstRowY + (row * secondRowOffset); // row=0: -520, row=1: -320 + + // 位移并缩小到0.65 + return 'translate(' + centerOffset + 'rpx, ' + yOffset + 'rpx) scale(0.65) rotate(0deg)'; } else { // 保持在牌堆中的放射状 return 'rotate(' + ((currentIdx - 10) * 8) + 'deg)'; diff --git a/pages/index/index.wxss b/pages/index/index.wxss index a5e6e51..1500ecf 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -151,17 +151,21 @@ page { .slots-container { display: flex; + flex-wrap: wrap; /* 允许换行 */ justify-content: center; - gap: 20rpx; - height: 240rpx; + gap: 20rpx; /* 保持20rpx间距,与计算一致 */ + min-height: 240rpx; /* 改为最小高度 */ + max-height: 480rpx; /* 最多两排的高度 */ margin-bottom: 60rpx; width: 100%; + padding: 0 30rpx; /* 增加左右padding确保居中 */ } .slot-item { - width: 140rpx; - height: 220rpx; + width: 100rpx; /* 与WXS计算的宽度一致 */ + height: 160rpx; /* 与WXS计算的高度一致 */ position: relative; + flex-shrink: 0; /* 防止收缩 */ } .slot-placeholder {