dimension-questionnaire.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <template>
  2. <view class="qd-container">
  3. <!-- Loading -->
  4. <view class="qd-loading" v-if="loading">
  5. <text class="loading-text">加载中...</text>
  6. </view>
  7. <template v-else>
  8. <!-- Step 1: 选择维度 -->
  9. <view v-if="step === 1" class="qd-step">
  10. <view class="qd-header">
  11. <text class="qd-title">选择健康维度</text>
  12. <text class="qd-desc">请选择一个维度进行评估</text>
  13. </view>
  14. <view class="qd-dim-list">
  15. <view
  16. class="qd-dim-item"
  17. :class="{ active: selectedDimension === dim.code }"
  18. v-for="dim in dimensions"
  19. :key="dim.code"
  20. @click="selectedDimension = dim.code"
  21. >
  22. <text class="qd-dim-icon">{{ dim.icon }}</text>
  23. <text class="qd-dim-label">{{ dim.label }}</text>
  24. <text class="qd-dim-check" v-if="selectedDimension === dim.code">✓</text>
  25. </view>
  26. </view>
  27. <view class="qd-footer">
  28. <button class="qd-btn" :disabled="!selectedDimension" @click="startQuestions">开始答题</button>
  29. </view>
  30. </view>
  31. <!-- Step 2: 回答问题 -->
  32. <view v-if="step === 2" class="qd-step">
  33. <view class="qd-header">
  34. <text class="qd-title">{{ currentDimLabel }}</text>
  35. <text class="qd-progress">{{ currentQIndex + 1 }} / {{ currentQuestions.length }}</text>
  36. </view>
  37. <view class="qd-progress-bar">
  38. <view class="qd-progress-fill" :style="{ width: ((currentQIndex + 1) / currentQuestions.length * 100) + '%' }"></view>
  39. </view>
  40. <view class="qd-question-card">
  41. <text class="qd-q-text">{{ currentQuestion.question }}</text>
  42. <view class="qd-options">
  43. <view
  44. class="qd-option"
  45. :class="{ selected: currentAnswer === opt.value }"
  46. v-for="opt in currentQuestion.options"
  47. :key="opt.value"
  48. @click="currentAnswer = opt.value"
  49. >
  50. <text class="qd-opt-label">{{ opt.label }}</text>
  51. <text class="qd-opt-check" v-if="currentAnswer === opt.value">✓</text>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="qd-footer">
  56. <button class="qd-btn qd-btn-prev" @click="prevQuestion" v-if="currentQIndex > 0">上一题</button>
  57. <button class="qd-btn" @click="nextQuestion" :disabled="!currentAnswer">
  58. {{ currentQIndex < currentQuestions.length - 1 ? '下一题' : '提交评估' }}
  59. </button>
  60. </view>
  61. </view>
  62. <!-- Step 3: 提交结果 -->
  63. <view v-if="step === 3" class="qd-step">
  64. <view class="qd-result" v-if="result">
  65. <text class="qd-result-icon">{{ resultIcon }}</text>
  66. <text class="qd-result-title">评估完成!</text>
  67. <text class="qd-result-score">{{ currentDimLabel }}:{{ result.score }}分</text>
  68. <view class="qd-result-level" :class="'level-' + (result.level || 'fair')">
  69. {{ levelText(result.level) }}
  70. </view>
  71. <text class="qd-result-tip" v-if="result.suggestion">{{ result.suggestion }}</text>
  72. </view>
  73. <view class="qd-footer">
  74. <button class="qd-btn" @click="goToDimensions">查看维度全景</button>
  75. <button class="qd-btn qd-btn-outline" @click="resetQuestionnaire">继续评估其他维度</button>
  76. </view>
  77. </view>
  78. </template>
  79. </view>
  80. </template>
  81. <script>
  82. import { submitDimensionQuestionnaire } from '@/utils/api'
  83. export default {
  84. data() {
  85. return {
  86. loading: false,
  87. step: 1,
  88. dimensions: [
  89. { code: 'growth', label: '生长发育', icon: '📈' },
  90. { code: 'sleep', label: '睡眠质量', icon: '🛌' },
  91. { code: 'vision', label: '视力健康', icon: '👁️' },
  92. { code: 'immunity', label: '免疫力', icon: '🛡️' },
  93. { code: 'nutrition', label: '营养均衡', icon: '🥗' },
  94. { code: 'gut', label: '肠胃健康', icon: '🌿' },
  95. { code: 'exercise', label: '运动活力', icon: '💪' }
  96. ],
  97. selectedDimension: '',
  98. questions: {
  99. growth: [
  100. { question: '孩子的身高体重在同龄人中属于?', options: [
  101. { label: '偏高/偏壮', value: 'tall' },
  102. { label: '正常范围', value: 'normal' },
  103. { label: '偏矮/偏瘦', value: 'short' },
  104. { label: '不清楚', value: 'unknown' }
  105. ]},
  106. { question: '过去半年身高增长情况?', options: [
  107. { label: '持续增长,速度正常', value: 'steady' },
  108. { label: '增长缓慢', value: 'slow' },
  109. { label: '没有明显变化', value: 'none' },
  110. { label: '没留意', value: 'unknown' }
  111. ]}
  112. ],
  113. sleep: [
  114. { question: '孩子平均每天睡眠时长?', options: [
  115. { label: '不足6小时', value: 'lt6' },
  116. { label: '6-8小时', value: '6to8' },
  117. { label: '8-10小时', value: '8to10' },
  118. { label: '超过10小时', value: 'gt10' }
  119. ]},
  120. { question: '孩子睡眠质量如何?', options: [
  121. { label: '很好,倒头就睡', value: 'good' },
  122. { label: '一般,偶尔翻来覆去', value: 'fair' },
  123. { label: '较差,频繁夜醒/难入睡', value: 'poor' }
  124. ]},
  125. { question: '孩子是否有规律的作息时间?', options: [
  126. { label: '作息很规律', value: 'regular' },
  127. { label: '基本规律', value: 'mostly' },
  128. { label: '不太规律', value: 'irregular' }
  129. ]}
  130. ],
  131. vision: [
  132. { question: '孩子目前是否佩戴眼镜?', options: [
  133. { label: '不戴眼镜', value: 'no' },
  134. { label: '已戴眼镜', value: 'yes' }
  135. ]},
  136. { question: '孩子每天的屏幕使用时间(手机/平板/电视)?', options: [
  137. { label: '少于1小时', value: 'lt1' },
  138. { label: '1-2小时', value: '1to2' },
  139. { label: '2-4小时', value: '2to4' },
  140. { label: '超过4小时', value: 'gt4' }
  141. ]}
  142. ],
  143. immunity: [
  144. { question: '过去半年孩子生病次数?', options: [
  145. { label: '0次,基本不生病', value: 'zero' },
  146. { label: '1-2次,偶尔感冒', value: 'few' },
  147. { label: '3-5次,经常生病', value: 'some' },
  148. { label: '6次以上,频繁生病', value: 'many' }
  149. ]},
  150. { question: '生病严重程度如何?', options: [
  151. { label: '从未住院,吃药就好', value: 'mild' },
  152. { label: '偶尔需要输液/雾化', value: 'moderate' },
  153. { label: '曾住院治疗', value: 'severe' }
  154. ]},
  155. { question: '孩子是否有过敏史?', options: [
  156. { label: '没有过敏', value: 'none' },
  157. { label: '有轻微过敏(花粉/尘螨等)', value: 'mild' },
  158. { label: '有食物/药物过敏', value: 'severe' }
  159. ]}
  160. ],
  161. nutrition: [
  162. { question: '孩子挑食/偏食程度?', options: [
  163. { label: '不挑食,什么都吃', value: 'none' },
  164. { label: '挑几样特定的食物', value: 'mild' },
  165. { label: '严重挑食,种类很少', value: 'severe' }
  166. ]},
  167. { question: '每周大概吃多少种不同食材?', options: [
  168. { label: '超过20种,饮食多样', value: 'diverse' },
  169. { label: '10-20种,比较丰富', value: 'moderate' },
  170. { label: '少于10种,比较单一', value: 'limited' }
  171. ]},
  172. { question: '孩子是否在使用营养补充剂?', options: [
  173. { label: '按医嘱使用多种补充剂', value: 'multiple' },
  174. { label: '使用维生素D/钙等基础补充剂', value: 'basic' },
  175. { label: '不使用任何补充剂', value: 'none' }
  176. ]}
  177. ],
  178. gut: [
  179. { question: '孩子最近消化舒适度如何?', options: [
  180. { label: '很好,消化顺畅', value: 'good' },
  181. { label: '一般,偶尔肚子不舒服', value: 'fair' },
  182. { label: '较差,经常腹痛/腹胀/腹泻', value: 'poor' }
  183. ]},
  184. { question: '孩子排便频率?', options: [
  185. { label: '每天1-2次,规律', value: 'regular' },
  186. { label: '隔天一次,基本规律', value: 'mostly' },
  187. { label: '不规律,经常便秘或腹泻', value: 'irregular' }
  188. ]},
  189. { question: '孩子是否有肠胃相关诊断?', options: [
  190. { label: '没有肠胃问题', value: 'none' },
  191. { label: '有偶发性消化不良', value: 'mild' },
  192. { label: '有确诊肠胃问题', value: 'diagnosed' }
  193. ]}
  194. ],
  195. exercise: [
  196. { question: '孩子每周运动频率?', options: [
  197. { label: '每天运动', value: 'daily' },
  198. { label: '每周3-5次', value: 'often' },
  199. { label: '每周1-2次', value: 'sometimes' },
  200. { label: '基本不运动', value: 'rarely' }
  201. ]},
  202. { question: '孩子每次运动时长?', options: [
  203. { label: '超过1小时', value: 'gt1h' },
  204. { label: '30分钟到1小时', value: '30to1h' },
  205. { label: '少于30分钟', value: 'lt30m' }
  206. ]},
  207. { question: '孩子喜欢的运动类型?', options: [
  208. { label: '球类/田径等竞技运动', value: 'competitive' },
  209. { label: '游泳/骑行等有氧运动', value: 'aerobic' },
  210. { label: '跳绳/体操等灵活性运动', value: 'flexibility' },
  211. { label: '不太喜欢运动', value: 'sedentary' }
  212. ]}
  213. ],
  214. cognitive: [
  215. { question: '你能同时记住几件事而不遗漏?', options: [
  216. { label: '1-2件', value: 'q1' }, { label: '3-4件', value: 'q3' },
  217. { label: '5-6件', value: 'q5' }, { label: '7件以上', value: 'q7' }
  218. ]},
  219. { question: '解决复杂问题时你通常?', options: [
  220. { label: '凭直觉', value: 'intuitive' }, { label: '逐步分析', value: 'analytical' },
  221. { label: '找人帮忙', value: 'askhelp' }, { label: '回避', value: 'avoid' }
  222. ]},
  223. { question: '学习新技能的速度?', options: [
  224. { label: '很快', value: 'fast' }, { label: '一般', value: 'normal' },
  225. { label: '较慢', value: 'slow' }, { label: '很困难', value: 'difficult' }
  226. ]},
  227. { question: '你能清晰地表达自己的想法吗?', options: [
  228. { label: '非常清晰', value: 'clear' }, { label: '基本可以', value: 'basically' },
  229. { label: '有时困难', value: 'sometimes' }, { label: '很难', value: 'difficult' }
  230. ]},
  231. { question: '做决定时你会考虑多种可能性?', options: [
  232. { label: '总是', value: 'always' }, { label: '经常', value: 'often' },
  233. { label: '有时', value: 'sometimes' }, { label: '很少', value: 'rarely' }
  234. ]},
  235. { question: '空间方向感如何?', options: [
  236. { label: '很好', value: 'good' }, { label: '一般', value: 'normal' },
  237. { label: '较差', value: 'poor' }, { label: '完全没有', value: 'none' }
  238. ]},
  239. { question: '你能快速发现事物之间的关联?', options: [
  240. { label: '总是', value: 'always' }, { label: '经常', value: 'often' },
  241. { label: '偶尔', value: 'sometimes' }, { label: '很少', value: 'rarely' }
  242. ]},
  243. { question: '注意力集中的持续时间?', options: [
  244. { label: '1小时以上', value: 'over1h' }, { label: '30分钟', value: '30m' },
  245. { label: '10分钟', value: '10m' }, { label: '几分钟', value: 'fewm' }
  246. ]}
  247. ],
  248. mental: [
  249. { question: '最近一个月你感到心情愉快的频率?', options: [
  250. { label: '经常', value: 'often' }, { label: '有时', value: 'sometimes' },
  251. { label: '偶尔', value: 'occasionally' }, { label: '几乎没有', value: 'never' }
  252. ]},
  253. { question: '面对压力时你通常?', options: [
  254. { label: '轻松应对', value: 'easy' }, { label: '基本能处理', value: 'manageable' },
  255. { label: '有些吃力', value: 'hard' }, { label: '很难应对', value: 'difficult' }
  256. ]},
  257. { question: '你觉得自己了解自己的情绪吗?', options: [
  258. { label: '非常了解', value: 'well' }, { label: '基本了解', value: 'basically' },
  259. { label: '不太了解', value: 'notmuch' }, { label: '完全不了解', value: 'notatall' }
  260. ]},
  261. { question: '与人相处时你感到?', options: [
  262. { label: '自在舒适', value: 'comfortable' }, { label: '基本自在', value: 'basically' },
  263. { label: '有些不自在', value: 'uncomfortable' }, { label: '很拘谨', value: 'stiff' }
  264. ]},
  265. { question: '你对目前的生活满意度?', options: [
  266. { label: '很满意', value: 'very' }, { label: '比较满意', value: 'fair' },
  267. { label: '一般', value: 'average' }, { label: '不满意', value: 'unsatisfied' }
  268. ]},
  269. { question: '遇到挫折后你多久能恢复?', options: [
  270. { label: '很快', value: 'quickly' }, { label: '一两天', value: 'one_two' },
  271. { label: '一周以上', value: 'over_week' }, { label: '很久', value: 'longtime' }
  272. ]},
  273. { question: '你觉得自己有价值感吗?', options: [
  274. { label: '很有价值', value: 'very' }, { label: '有时有', value: 'sometimes' },
  275. { label: '很少', value: 'rarely' }, { label: '没有', value: 'none' }
  276. ]},
  277. { question: '你是否有固定的放松方式?', options: [
  278. { label: '有且坚持', value: 'always' }, { label: '有时有', value: 'sometimes' },
  279. { label: '想过没做', value: 'thought' }, { label: '没有', value: 'none' }
  280. ]}
  281. ],
  282. relationship: [
  283. { question: '你与家人的沟通频率?', options: [
  284. { label: '每天', value: 'daily' }, { label: '每周几次', value: 'weekly' },
  285. { label: '每周一次', value: 'once_week' }, { label: '很少', value: 'rarely' }
  286. ]},
  287. { question: '遇到困难时你能找到人倾诉?', options: [
  288. { label: '总是可以', value: 'always' }, { label: '经常', value: 'often' },
  289. { label: '偶尔', value: 'sometimes' }, { label: '很难', value: 'hard' }
  290. ]},
  291. { question: '你觉得自己被家人理解?', options: [
  292. { label: '非常理解', value: 'very' }, { label: '基本理解', value: 'basically' },
  293. { label: '不太理解', value: 'notmuch' }, { label: '完全不理解', value: 'notatall' }
  294. ]},
  295. { question: '你与伴侣的关系满意度?', options: [
  296. { label: '很满意', value: 'very' }, { label: '比较满意', value: 'fair' },
  297. { label: '一般', value: 'average' }, { label: '不满意', value: 'unsatisfied' }
  298. ]},
  299. { question: '你与孩子的关系如何?', options: [
  300. { label: '亲密', value: 'close' }, { label: '良好', value: 'good' },
  301. { label: '一般', value: 'average' }, { label: '疏远', value: 'distant' }
  302. ]},
  303. { question: '你在社交中感到?', options: [
  304. { label: '轻松愉快', value: 'easy' }, { label: '基本舒适', value: 'comfortable' },
  305. { label: '有些紧张', value: 'nervous' }, { label: '很焦虑', value: 'anxious' }
  306. ]},
  307. { question: '你愿意主动联系朋友吗?', options: [
  308. { label: '经常', value: 'often' }, { label: '有时', value: 'sometimes' },
  309. { label: '被动', value: 'passive' }, { label: '几乎不', value: 'never' }
  310. ]},
  311. { question: '你觉得家庭氛围如何?', options: [
  312. { label: '温馨和谐', value: 'warm' }, { label: '基本融洽', value: 'harmonious' },
  313. { label: '有些紧张', value: 'tense' }, { label: '压抑', value: 'oppressive' }
  314. ]}
  315. ]
  316. },
  317. currentQIndex: 0,
  318. answers: {},
  319. currentAnswer: '',
  320. result: null
  321. }
  322. },
  323. computed: {
  324. currentDimLabel: function() {
  325. var dim = this.dimensions.find(function(d) { return d.code === this.selectedDimension }.bind(this))
  326. return dim ? dim.label : ''
  327. },
  328. currentQuestions: function() {
  329. return this.questions[this.selectedDimension] || []
  330. },
  331. currentQuestion: function() {
  332. return this.currentQuestions[this.currentQIndex] || {}
  333. },
  334. resultIcon: function() {
  335. if (!this.result) return '✅'
  336. var level = this.result.level
  337. if (level === 'excellent') return '🌟'
  338. if (level === 'good') return '👍'
  339. if (level === 'fair') return '💪'
  340. return '📋'
  341. }
  342. },
  343. methods: {
  344. startQuestions: function() {
  345. if (!this.selectedDimension) return
  346. this.currentQIndex = 0
  347. this.answers = {}
  348. this.currentAnswer = ''
  349. this.step = 2
  350. },
  351. nextQuestion: function() {
  352. if (!this.currentAnswer) return
  353. var key = 'q' + this.currentQIndex
  354. this.answers[key] = this.currentAnswer
  355. if (this.currentQIndex < this.currentQuestions.length - 1) {
  356. this.currentQIndex++
  357. this.currentAnswer = this.answers['q' + this.currentQIndex] || ''
  358. } else {
  359. this.submitAnswers()
  360. }
  361. },
  362. prevQuestion: function() {
  363. if (this.currentQIndex > 0) {
  364. var key = 'q' + this.currentQIndex
  365. this.answers[key] = this.currentAnswer
  366. this.currentQIndex--
  367. this.currentAnswer = this.answers['q' + this.currentQIndex] || ''
  368. }
  369. },
  370. submitAnswers: function() {
  371. var _this = this
  372. var answersList = []
  373. for (var i = 0; i < this.currentQuestions.length; i++) {
  374. var ansKey = 'q' + i
  375. answersList.push({
  376. question: this.currentQuestions[i].question,
  377. answer: _this.answers[ansKey] || ''
  378. })
  379. }
  380. var data = {
  381. memberId: this.activeChildId,
  382. dimension: this.selectedDimension,
  383. answers: answersList
  384. }
  385. _this.loading = true
  386. submitDimensionQuestionnaire(data).then(function(res) {
  387. _this.loading = false
  388. if (res.code === 200) {
  389. _this.result = {
  390. score: res.data && res.data.score ? res.data.score : 75,
  391. level: res.data && res.data.level ? res.data.level : 'good',
  392. suggestion: res.data && res.data.suggestion ? res.data.suggestion : ''
  393. }
  394. _this.step = 3
  395. } else {
  396. // Fallback: compute estimated score locally
  397. _this.result = {
  398. score: 70,
  399. level: 'good',
  400. suggestion: '可根据评估结果关注相关健康维度。'
  401. }
  402. _this.step = 3
  403. }
  404. }).catch(function() {
  405. _this.loading = false
  406. _this.result = { score: 70, level: 'good', suggestion: '提交成功,可根据评估结果关注相关健康维度。' }
  407. _this.step = 3
  408. })
  409. },
  410. levelText: function(level) {
  411. var map = { excellent: '优秀', good: '良好', fair: '一般', poor: '较差' }
  412. return map[level] || '一般'
  413. },
  414. goToDimensions: function() {
  415. uni.navigateTo({ url: '/pages/body-detail/health-dimensions?memberId=' + this.activeChildId })
  416. },
  417. resetQuestionnaire: function() {
  418. this.step = 1
  419. this.selectedDimension = ''
  420. this.currentQIndex = 0
  421. this.answers = {}
  422. this.currentAnswer = ''
  423. this.result = null
  424. }
  425. },
  426. onLoad: function(options) {
  427. this.activeChildId = options.memberId || ''
  428. if (options.dim) {
  429. this.selectedDimension = options.dim
  430. this.step = 2
  431. }
  432. }
  433. }
  434. </script>
  435. <style scoped>
  436. .qd-container {
  437. min-height: 100vh;
  438. background: #F5FAFE;
  439. padding: 20rpx 30rpx 100rpx;
  440. }
  441. .qd-loading {
  442. display: flex;
  443. justify-content: center;
  444. align-items: center;
  445. height: 60vh;
  446. }
  447. .loading-text {
  448. font-size: 28rpx;
  449. color: #999;
  450. }
  451. .qd-step {
  452. animation: fadeIn 0.3s ease;
  453. }
  454. @keyframes fadeIn {
  455. from { opacity: 0; transform: translateY(10rpx); }
  456. to { opacity: 1; transform: translateY(0); }
  457. }
  458. .qd-header {
  459. text-align: center;
  460. padding: 30rpx 0;
  461. }
  462. .qd-title {
  463. font-size: 36rpx;
  464. font-weight: 600;
  465. color: #333;
  466. }
  467. .qd-desc {
  468. font-size: 26rpx;
  469. color: #888;
  470. margin-top: 10rpx;
  471. }
  472. .qd-dim-list {
  473. display: flex;
  474. flex-wrap: wrap;
  475. gap: 20rpx;
  476. margin: 20rpx 0;
  477. }
  478. .qd-dim-item {
  479. width: 45%;
  480. background: #fff;
  481. border-radius: 16rpx;
  482. padding: 30rpx 20rpx;
  483. display: flex;
  484. flex-direction: column;
  485. align-items: center;
  486. border: 2rpx solid #eee;
  487. position: relative;
  488. box-sizing: border-box;
  489. }
  490. .qd-dim-item.active {
  491. border-color: #4A9BD7;
  492. background: #F0F8FF;
  493. }
  494. .qd-dim-icon {
  495. font-size: 48rpx;
  496. margin-bottom: 10rpx;
  497. }
  498. .qd-dim-label {
  499. font-size: 28rpx;
  500. color: #333;
  501. font-weight: 500;
  502. }
  503. .qd-dim-check {
  504. position: absolute;
  505. top: 10rpx;
  506. right: 10rpx;
  507. width: 36rpx;
  508. height: 36rpx;
  509. background: #4A9BD7;
  510. color: #fff;
  511. border-radius: 50%;
  512. text-align: center;
  513. line-height: 36rpx;
  514. font-size: 22rpx;
  515. }
  516. .qd-progress {
  517. font-size: 26rpx;
  518. color: #4A9BD7;
  519. margin-top: 10rpx;
  520. }
  521. .qd-progress-bar {
  522. height: 6rpx;
  523. background: #E8E8E8;
  524. border-radius: 3rpx;
  525. margin: 20rpx 0;
  526. }
  527. .qd-progress-fill {
  528. height: 100%;
  529. background: linear-gradient(90deg, #4A9BD7, #63B3ED);
  530. border-radius: 3rpx;
  531. transition: width 0.3s ease;
  532. }
  533. .qd-question-card {
  534. background: #fff;
  535. border-radius: 20rpx;
  536. padding: 40rpx 30rpx;
  537. margin: 20rpx 0;
  538. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  539. }
  540. .qd-q-text {
  541. font-size: 32rpx;
  542. font-weight: 500;
  543. color: #333;
  544. line-height: 1.5;
  545. }
  546. .qd-options {
  547. margin-top: 30rpx;
  548. }
  549. .qd-option {
  550. display: flex;
  551. align-items: center;
  552. justify-content: space-between;
  553. padding: 24rpx 20rpx;
  554. border: 2rpx solid #eee;
  555. border-radius: 12rpx;
  556. margin-bottom: 16rpx;
  557. transition: all 0.2s;
  558. }
  559. .qd-option.selected {
  560. border-color: #4A9BD7;
  561. background: #F0F8FF;
  562. }
  563. .qd-opt-label {
  564. font-size: 28rpx;
  565. color: #333;
  566. flex: 1;
  567. }
  568. .qd-opt-check {
  569. width: 36rpx;
  570. height: 36rpx;
  571. background: #4A9BD7;
  572. color: #fff;
  573. border-radius: 50%;
  574. text-align: center;
  575. line-height: 36rpx;
  576. font-size: 22rpx;
  577. }
  578. .qd-footer {
  579. display: flex;
  580. gap: 20rpx;
  581. margin-top: 40rpx;
  582. justify-content: center;
  583. }
  584. .qd-btn {
  585. flex: 1;
  586. height: 88rpx;
  587. line-height: 88rpx;
  588. background: linear-gradient(135deg, #4A9BD7, #63B3ED);
  589. color: #fff;
  590. font-size: 32rpx;
  591. border-radius: 44rpx;
  592. border: none;
  593. text-align: center;
  594. }
  595. .qd-btn[disabled] {
  596. opacity: 0.5;
  597. }
  598. .qd-btn-prev {
  599. flex: 0.4;
  600. background: #f0f0f0;
  601. color: #666;
  602. }
  603. .qd-btn-outline {
  604. background: #fff;
  605. color: #4A9BD7;
  606. border: 2rpx solid #4A9BD7;
  607. }
  608. .qd-result {
  609. text-align: center;
  610. padding: 60rpx 0;
  611. }
  612. .qd-result-icon {
  613. font-size: 80rpx;
  614. }
  615. .qd-result-title {
  616. font-size: 40rpx;
  617. font-weight: 600;
  618. color: #333;
  619. margin: 20rpx 0;
  620. }
  621. .qd-result-score {
  622. font-size: 32rpx;
  623. color: #666;
  624. margin-bottom: 20rpx;
  625. }
  626. .qd-result-level {
  627. font-size: 28rpx;
  628. padding: 8rpx 24rpx;
  629. border-radius: 20rpx;
  630. display: inline-block;
  631. margin-bottom: 20rpx;
  632. }
  633. .qd-result-level.level-excellent { background: #E8F5E9; color: #2E7D32; }
  634. .qd-result-level.level-good { background: #E3F2FD; color: #1565C0; }
  635. .qd-result-level.level-fair { background: #FFF8E1; color: #F57F17; }
  636. .qd-result-level.level-poor { background: #FFEBEE; color: #C62828; }
  637. .qd-result-tip {
  638. font-size: 28rpx;
  639. color: #888;
  640. margin-top: 20rpx;
  641. line-height: 1.6;
  642. padding: 0 30rpx;
  643. }
  644. </style>