wuxing-sandbox.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="wuxing-sandbox">
  3. <view class="sandbox-header">
  4. <text class="sandbox-title">五行能量沙盘</text>
  5. <text class="sandbox-badge">{{ badgeText }}</text>
  6. </view>
  7. <view class="sandbox-star">
  8. <view class="star-point star-point-top" @click="onPointClick('mind')">
  9. <text class="point-icon">🔥</text>
  10. <text class="point-label">心·火</text>
  11. <text class="point-status" v-if="mode === 'preview'">点此登录</text>
  12. </view>
  13. <view class="star-point star-point-left" @click="onPointClick('action')">
  14. <text class="point-icon">🌿</text>
  15. <text class="point-label">行·木</text>
  16. <text class="point-status" v-if="mode === 'preview'">点此登录</text>
  17. </view>
  18. <view class="star-point star-point-right" @click="onPointClick('wealth')">
  19. <text class="point-icon">💧</text>
  20. <text class="point-label">富·水</text>
  21. <text class="point-status" v-if="mode === 'preview'">点此登录</text>
  22. </view>
  23. <view class="star-point star-point-bl" @click="onPointClick('wisdom')">
  24. <text class="point-icon">⚔️</text>
  25. <text class="point-label">智·金</text>
  26. <text class="point-status" v-if="mode === 'preview'">点此登录</text>
  27. </view>
  28. <view class="star-point star-point-br" @click="onPointClick('body')">
  29. <text class="point-icon">🌏</text>
  30. <text class="point-label">身·土</text>
  31. <text class="point-status" v-if="mode === 'preview'">点此登录</text>
  32. </view>
  33. <view class="star-center">
  34. <text class="center-text">五行平衡</text>
  35. <text class="center-sub">共同成长</text>
  36. </view>
  37. </view>
  38. <view class="shenke-hint" v-if="mode === 'preview'">
  39. <text class="hint-text">🌱 完成测评,点亮「身·土」</text>
  40. </view>
  41. <view class="dimension-bar" v-if="mode !== 'preview'">
  42. <view class="dim-item inactive">🌿行</view>
  43. <text class="dim-arrow">→</text>
  44. <view class="dim-item inactive">🔥心</view>
  45. <text class="dim-arrow">→</text>
  46. <view class="dim-item inactive">🌏身</view>
  47. <text class="dim-arrow">→</text>
  48. <view class="dim-item inactive">⚔️智</view>
  49. <text class="dim-arrow">→</text>
  50. <view class="dim-item inactive">💧富</view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. props: {
  57. mode: { type: String, default: 'preview' },
  58. badgeText: { type: String, default: '综合成长力 0%' }
  59. },
  60. methods: {
  61. onPointClick(domain) {
  62. this.$emit('point-click', domain)
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped>
  68. .wuxing-sandbox {
  69. margin: 20rpx 30rpx;
  70. padding: 30rpx;
  71. background: linear-gradient(135deg, #1a1a2e, #16213e);
  72. border-radius: 24rpx;
  73. position: relative;
  74. overflow: hidden;
  75. }
  76. .sandbox-header {
  77. display: flex;
  78. justify-content: space-between;
  79. align-items: center;
  80. margin-bottom: 30rpx;
  81. }
  82. .sandbox-title {
  83. font-size: 28rpx;
  84. font-weight: bold;
  85. color: #FFD700;
  86. }
  87. .sandbox-badge {
  88. font-size: 22rpx;
  89. color: #aaa;
  90. background: rgba(255,255,255,0.1);
  91. padding: 6rpx 16rpx;
  92. border-radius: 20rpx;
  93. }
  94. .sandbox-star {
  95. position: relative;
  96. height: 400rpx;
  97. display: flex;
  98. justify-content: center;
  99. align-items: center;
  100. }
  101. .star-point {
  102. position: absolute;
  103. display: flex;
  104. flex-direction: column;
  105. align-items: center;
  106. width: 120rpx;
  107. }
  108. .star-point-top { top: 0; left: 50%; transform: translateX(-50%); }
  109. .star-point-left { top: 120rpx; left: 20rpx; }
  110. .star-point-right { top: 120rpx; right: 20rpx; }
  111. .star-point-bl { bottom: 40rpx; left: 60rpx; }
  112. .star-point-br { bottom: 40rpx; right: 60rpx; }
  113. .point-icon { font-size: 50rpx; margin-bottom: 6rpx; }
  114. .point-label { font-size: 22rpx; color: #fff; font-weight: bold; }
  115. .point-status { font-size: 18rpx; color: #FF6B6B; margin-top: 4rpx; }
  116. .star-center {
  117. width: 120rpx; height: 120rpx;
  118. background: radial-gradient(circle, rgba(255,215,0,0.2), rgba(255,215,0,0.05));
  119. border: 2rpx solid rgba(255,215,0,0.3);
  120. border-radius: 50%;
  121. display: flex;
  122. flex-direction: column;
  123. justify-content: center;
  124. align-items: center;
  125. }
  126. .center-text { font-size: 22rpx; color: #FFD700; font-weight: bold; }
  127. .center-sub { font-size: 18rpx; color: #aaa; }
  128. .shenke-hint { text-align: center; margin-top: 10rpx; }
  129. .hint-text { font-size: 22rpx; color: rgba(255,215,0,0.7); }
  130. .dimension-bar {
  131. display: flex; align-items: center; justify-content: center;
  132. margin-top: 20rpx; gap: 8rpx;
  133. }
  134. .dim-item {
  135. font-size: 22rpx; color: #FFD700;
  136. background: rgba(255,215,0,0.1);
  137. padding: 6rpx 14rpx; border-radius: 12rpx;
  138. }
  139. .dim-arrow { font-size: 20rpx; color: rgba(255,215,0,0.3); }
  140. </style>