普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.7 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="问卷测评" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="transparent" />
  4. <view class="main">
  5. <view :class="['step', step === current ? 'is-active' : '']" v-for="(item, step) in steps" :key="item.id">
  6. <view class="step-zh">{{ `{ ${item.title} }` }}</view>
  7. <view class="step-en">{{ item.enTitle }}</view>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import { mapState } from 'vuex'
  14. export default {
  15. data() {
  16. return {
  17. current: 0,
  18. }
  19. },
  20. computed: {
  21. ...mapState(['paperInfo']),
  22. steps() {
  23. console.log('paperInfo', this.paperInfo)
  24. const { category } = this.paperInfo
  25. return category?.map?.(item => {
  26. const { id, title, enTitle } = item
  27. return { id, title, enTitle }
  28. })
  29. },
  30. },
  31. onLoad(arg) {
  32. console.log('onLoad', arg)
  33. this.current = parseInt(arg.step || 0)
  34. console.log('current', this.current)
  35. setTimeout(() => {
  36. this.$utils.redirectTo(`/pages_order/report/test/answer?step=${this.current}`)
  37. }, 1500)
  38. }
  39. }
  40. </script>
  41. <style scoped lang="scss">
  42. .page__view {
  43. width: 100vw;
  44. min-height: 100vh;
  45. background-color: $uni-bg-color;
  46. position: relative;
  47. }
  48. .main {
  49. margin-top: 214rpx;
  50. }
  51. .step {
  52. text-align: center;
  53. font-family: PingFang SC;
  54. line-height: 1.4;
  55. color: #989898;
  56. &.is-active {
  57. color: #252545;
  58. }
  59. &-zh {
  60. font-weight: 600;
  61. font-size: 48rpx;
  62. }
  63. &-en {
  64. font-weight: 400;
  65. font-size: 26rpx;
  66. }
  67. & + & {
  68. margin-top: 80rpx;
  69. }
  70. }
  71. </style>