training-hub.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <view class="container">
  3. <PageBanner theme="wisdom"
  4. tagline="智慧训练中心"
  5. :quote="bannerQuote" />
  6. <!-- 训练说明 -->
  7. <view class="intro-card">
  8. <text class="intro-icon">&#x2696;&#xFE0F;</text>
  9. <text class="intro-title">智·训练中心</text>
  10. <text class="intro-desc">通过科学设计的认知训练游戏,全面提升专注力、逻辑思维与反应速度。每日坚持训练,让智慧之金更加闪耀。</text>
  11. </view>
  12. <!-- 推荐训练 -->
  13. <view class="section">
  14. <view class="section-header">
  15. <text class="section-title">推荐训练</text>
  16. <text class="section-subtitle">选择一项开始挑战</text>
  17. </view>
  18. <view class="game-list">
  19. <view class="game-card" v-for="game in games" :key="game.code" @click="goGame(game)">
  20. <view class="game-icon-wrap">
  21. <text class="game-icon">{{ game.icon }}</text>
  22. </view>
  23. <view class="game-info">
  24. <text class="game-title">{{ game.name }}</text>
  25. <text class="game-desc">{{ game.desc }}</text>
  26. <view class="game-meta">
  27. <view class="difficulty-row">
  28. <text class="difficulty-label">难度:</text>
  29. <view class="stars-row">
  30. <text class="star filled" v-for="i in game.difficulty" :key="'on' + i">&#x2605;</text>
  31. <text class="star empty" v-for="i in (5 - game.difficulty)" :key="'off' + i">&#x2605;</text>
  32. </view>
  33. </view>
  34. <text class="game-badge" v-if="game.badge">{{ game.badge }}</text>
  35. </view>
  36. </view>
  37. <button class="start-btn" hover-class="start-btn-hover">开始挑战</button>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 训练小贴士 -->
  42. <view class="tip-section">
  43. <view class="tip-card">
  44. <view class="tip-left-bar"></view>
  45. <view class="tip-body">
  46. <text class="tip-title">&#x1F4A1; 训练建议</text>
  47. <text class="tip-content">每次训练15-30分钟效果最佳;保持专注,减少干扰;循序渐进,从简单模式开始;定期复盘进步,保持训练动力。</text>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 底部占位 -->
  52. <view class="bottom-spacer"></view>
  53. </view>
  54. </template>
  55. <script>
  56. import PageBanner from '../../components/PageBanner.vue'
  57. var GAME_LIST = [
  58. {
  59. code: 'schulte',
  60. name: '舒尔特方格',
  61. icon: '\u{1F3AF}',
  62. desc: '提升专注力与反应速度',
  63. difficulty: 3,
  64. badge: '入门推荐'
  65. },
  66. {
  67. code: '1a2b',
  68. name: '猜数字',
  69. icon: '\u{1F522}',
  70. desc: '锻炼逻辑思维与推理能力',
  71. difficulty: 4,
  72. badge: '进阶挑战'
  73. }
  74. ]
  75. var GAME_PAGES = {
  76. schulte: '/pages/games/schulte',
  77. '1a2b': '/pages/games/1a2b'
  78. }
  79. export default {
  80. components: { PageBanner },
  81. data: function() {
  82. return {
  83. games: GAME_LIST,
  84. childId: null,
  85. bannerQuote: '学而不思则罔,思而不学则殆'
  86. }
  87. },
  88. onLoad: function(options) {
  89. if (options && options.childId) {
  90. this.childId = options.childId
  91. } else {
  92. var stored = uni.getStorageSync('currentChildId')
  93. if (stored) {
  94. this.childId = stored
  95. }
  96. }
  97. uni.setNavigationBarTitle({
  98. title: '智慧训练中心'
  99. })
  100. },
  101. methods: {
  102. goGame: function(game) {
  103. var url = GAME_PAGES[game.code]
  104. if (!url) {
  105. uni.showToast({ title: '游戏暂未开放', icon: 'none' })
  106. return
  107. }
  108. var childId = this.childId || ''
  109. var queryParams = '?childId=' + childId + '&dimension=wisdom'
  110. uni.navigateTo({ url: url + queryParams })
  111. }
  112. }
  113. }
  114. </script>
  115. <style scoped>
  116. .container {
  117. min-height: 100vh;
  118. background: #FFFBEB;
  119. padding-bottom: 120rpx;
  120. }
  121. /* ===== 训练说明卡 ===== */
  122. .intro-card {
  123. margin: 30rpx;
  124. background: linear-gradient(135deg, #FFFBEB 0%, #FFF8E1 100%);
  125. border-radius: 24rpx;
  126. padding: 40rpx 32rpx;
  127. display: flex;
  128. flex-direction: column;
  129. align-items: center;
  130. border: 1rpx solid rgba(255, 215, 0, 0.2);
  131. box-shadow: 0 4rpx 20rpx rgba(255, 215, 0, 0.1);
  132. }
  133. .intro-icon {
  134. font-size: 56rpx;
  135. margin-bottom: 16rpx;
  136. }
  137. .intro-title {
  138. font-size: 34rpx;
  139. font-weight: bold;
  140. color: #B8860B;
  141. margin-bottom: 16rpx;
  142. letter-spacing: 2rpx;
  143. }
  144. .intro-desc {
  145. font-size: 26rpx;
  146. color: #8B7355;
  147. text-align: center;
  148. line-height: 1.7;
  149. }
  150. /* ===== 通用区段 ===== */
  151. .section {
  152. margin: 20rpx 30rpx;
  153. }
  154. .section-header {
  155. display: flex;
  156. flex-direction: column;
  157. margin-bottom: 24rpx;
  158. }
  159. .section-title {
  160. font-size: 32rpx;
  161. font-weight: bold;
  162. color: #5D4037;
  163. }
  164. .section-subtitle {
  165. font-size: 24rpx;
  166. color: #A0896E;
  167. margin-top: 6rpx;
  168. }
  169. /* ===== 游戏卡片 ===== */
  170. .game-list {
  171. display: flex;
  172. flex-direction: column;
  173. }
  174. .game-card {
  175. display: flex;
  176. flex-direction: column;
  177. background: #FFFFFF;
  178. border-radius: 24rpx;
  179. padding: 32rpx;
  180. margin-bottom: 24rpx;
  181. border: 1rpx solid rgba(255, 215, 0, 0.15);
  182. box-shadow: 0 4rpx 16rpx rgba(255, 215, 0, 0.08);
  183. }
  184. .game-card:active {
  185. opacity: 0.85;
  186. transform: scale(0.98);
  187. }
  188. .game-icon-wrap {
  189. width: 100rpx;
  190. height: 100rpx;
  191. border-radius: 50rpx;
  192. background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  193. display: flex;
  194. align-items: center;
  195. justify-content: center;
  196. margin-bottom: 20rpx;
  197. box-shadow: 0 4rpx 12rpx rgba(255, 215, 0, 0.3);
  198. }
  199. .game-icon {
  200. font-size: 48rpx;
  201. }
  202. .game-info {
  203. display: flex;
  204. flex-direction: column;
  205. margin-bottom: 24rpx;
  206. }
  207. .game-title {
  208. font-size: 32rpx;
  209. font-weight: bold;
  210. color: #5D4037;
  211. margin-bottom: 8rpx;
  212. }
  213. .game-desc {
  214. font-size: 26rpx;
  215. color: #8B7355;
  216. margin-bottom: 16rpx;
  217. line-height: 1.5;
  218. }
  219. .game-meta {
  220. display: flex;
  221. flex-direction: row;
  222. align-items: center;
  223. justify-content: space-between;
  224. }
  225. .difficulty-row {
  226. display: flex;
  227. flex-direction: row;
  228. align-items: center;
  229. }
  230. .difficulty-label {
  231. font-size: 22rpx;
  232. color: #A0896E;
  233. margin-right: 8rpx;
  234. }
  235. .stars-row {
  236. display: flex;
  237. flex-direction: row;
  238. align-items: center;
  239. }
  240. .star {
  241. font-size: 24rpx;
  242. margin-right: 4rpx;
  243. }
  244. .star.filled {
  245. color: #FFD700;
  246. }
  247. .star.empty {
  248. color: #E0D5C0;
  249. }
  250. .game-badge {
  251. font-size: 20rpx;
  252. color: #B8860B;
  253. background: #FFFBEB;
  254. border-radius: 20rpx;
  255. padding: 4rpx 16rpx;
  256. border: 1rpx solid rgba(255, 215, 0, 0.3);
  257. line-height: 1.6;
  258. }
  259. .start-btn {
  260. width: 100%;
  261. height: 80rpx;
  262. line-height: 80rpx;
  263. text-align: center;
  264. background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  265. color: #5D4037;
  266. font-size: 30rpx;
  267. font-weight: bold;
  268. border-radius: 40rpx;
  269. border: none;
  270. padding: 0;
  271. letter-spacing: 4rpx;
  272. box-shadow: 0 4rpx 12rpx rgba(255, 215, 0, 0.3);
  273. }
  274. .start-btn-hover {
  275. opacity: 0.8;
  276. transform: scale(0.96);
  277. }
  278. /* ===== 训练小贴士 ===== */
  279. .tip-section {
  280. margin: 20rpx 30rpx 0;
  281. }
  282. .tip-card {
  283. display: flex;
  284. flex-direction: row;
  285. background: #FFFFFF;
  286. border-radius: 20rpx;
  287. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
  288. overflow: hidden;
  289. border: 1rpx solid rgba(255, 215, 0, 0.1);
  290. }
  291. .tip-left-bar {
  292. width: 6rpx;
  293. flex-shrink: 0;
  294. background: linear-gradient(180deg, #FFD700 0%, #FFA000 100%);
  295. }
  296. .tip-body {
  297. flex: 1;
  298. padding: 28rpx 24rpx;
  299. display: flex;
  300. flex-direction: column;
  301. }
  302. .tip-title {
  303. font-size: 26rpx;
  304. font-weight: bold;
  305. color: #B8860B;
  306. margin-bottom: 12rpx;
  307. }
  308. .tip-content {
  309. font-size: 24rpx;
  310. color: #8B7355;
  311. line-height: 1.7;
  312. }
  313. /* ===== 底部 ===== */
  314. .bottom-spacer {
  315. height: 120rpx;
  316. }
  317. </style>