training-hub.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="container">
  3. <view class="header-bar">
  4. <text class="back-btn" @click="goBack">← 返回</text>
  5. <text class="header-title">认知训练中心</text>
  6. <text class="header-placeholder"></text>
  7. </view>
  8. <view class="desc-section">
  9. <text class="desc-text">选择训练游戏,提升你的认知能力</text>
  10. </view>
  11. <view class="game-card" @click="goGame('schulte')">
  12. <view class="game-card-left">
  13. <text class="game-icon">🎯</text>
  14. </view>
  15. <view class="game-card-center">
  16. <text class="game-name">舒尔特方格</text>
  17. <text class="game-desc">提升专注力和反应速度</text>
  18. </view>
  19. <text class="game-arrow">›</text>
  20. </view>
  21. <view class="game-card" @click="goGame('1a2b')">
  22. <view class="game-card-left">
  23. <text class="game-icon">🔢</text>
  24. </view>
  25. <view class="game-card-center">
  26. <text class="game-name">猜数字</text>
  27. <text class="game-desc">锻炼逻辑思维和推理能力</text>
  28. </view>
  29. <text class="game-arrow">›</text>
  30. </view>
  31. <view class="note-section">
  32. <text class="note-text">更多训练游戏正在开发中,敬请期待</text>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data: function() {
  39. return {
  40. memberId: null
  41. }
  42. },
  43. onLoad: function(options) {
  44. if (options && options.memberId) {
  45. this.memberId = options.memberId
  46. }
  47. },
  48. methods: {
  49. goBack: function() {
  50. uni.navigateBack()
  51. },
  52. goGame: function(game) {
  53. var url = ''
  54. if (game === 'schulte') {
  55. url = '/pages/games/schulte'
  56. } else if (game === '1a2b') {
  57. url = '/pages/games/1a2b'
  58. }
  59. if (url) {
  60. uni.navigateTo({ url: url })
  61. }
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped>
  67. .container {
  68. min-height: 100vh;
  69. background: linear-gradient(180deg, #FFF8E1 0%, #f5f7fa 100%);
  70. padding-bottom: 60rpx;
  71. }
  72. .header-bar {
  73. display: flex;
  74. flex-direction: row;
  75. align-items: center;
  76. justify-content: space-between;
  77. padding: 80rpx 30rpx 30rpx;
  78. }
  79. .back-btn {
  80. font-size: 30rpx;
  81. color: #B8860B;
  82. padding: 10rpx;
  83. }
  84. .header-title {
  85. font-size: 36rpx;
  86. font-weight: bold;
  87. color: #B8860B;
  88. }
  89. .header-placeholder {
  90. width: 60rpx;
  91. }
  92. .desc-section {
  93. padding: 0 30rpx 30rpx;
  94. }
  95. .desc-text {
  96. font-size: 26rpx;
  97. color: #999;
  98. text-align: center;
  99. display: block;
  100. }
  101. .game-card {
  102. display: flex;
  103. flex-direction: row;
  104. align-items: center;
  105. background: #fff;
  106. margin: 0 30rpx 20rpx;
  107. padding: 30rpx;
  108. border-radius: 20rpx;
  109. box-shadow: 0 4rpx 20rpx rgba(255, 215, 0, 0.12);
  110. border-left: 8rpx solid #FFD700;
  111. }
  112. .game-card:active {
  113. opacity: 0.8;
  114. }
  115. .game-card-left {
  116. width: 80rpx;
  117. height: 80rpx;
  118. border-radius: 20rpx;
  119. background: #FFF8E1;
  120. display: flex;
  121. align-items: center;
  122. justify-content: center;
  123. margin-right: 20rpx;
  124. }
  125. .game-icon {
  126. font-size: 40rpx;
  127. }
  128. .game-card-center {
  129. flex: 1;
  130. }
  131. .game-name {
  132. font-size: 30rpx;
  133. font-weight: bold;
  134. color: #333;
  135. display: block;
  136. margin-bottom: 6rpx;
  137. }
  138. .game-desc {
  139. font-size: 24rpx;
  140. color: #999;
  141. display: block;
  142. }
  143. .game-arrow {
  144. font-size: 40rpx;
  145. color: #ccc;
  146. margin-left: 10rpx;
  147. }
  148. .note-section {
  149. padding: 40rpx 30rpx;
  150. text-align: center;
  151. }
  152. .note-text {
  153. font-size: 24rpx;
  154. color: #ccc;
  155. }
  156. </style>