Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

OnboardingView.vue 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template lang="pug">
  2. main.view--onboarding
  3. article(
  4. style='display: flex; flex-direction: column; align-items: center'
  5. v-if='survey'
  6. )
  7. .step(v-for='(step, i) in survey.steps')
  8. component(
  9. :aspect-questions='step.component == "Aspects" ? survey.aspectQuestions : null'
  10. :is='step.component'
  11. :question='step'
  12. @handle-submit='onSubmit'
  13. @update-answers='updateAnswers'
  14. v-if='step && currentStep == i'
  15. )
  16. </template>
  17. <script>
  18. import { surveyFactory } from '@/utils'
  19. import { allSteps } from '@/utils/lang'
  20. import stepViews from '@/components/onboarding'
  21. // import savesurveybyprfileid - call it on submit
  22. // paginate to save every steps answers
  23. export default {
  24. name: 'OnboardingView',
  25. components: {
  26. ...stepViews,
  27. },
  28. data: () => ({
  29. answered: {},
  30. aspectQuestions: [],
  31. currentStep: 0,
  32. survey: null,
  33. }),
  34. async created() {
  35. this.survey = await surveyFactory.createSurvey(allSteps['usa'])
  36. },
  37. methods: {
  38. onSubmit() {
  39. console.log(JSON.stringify(this.answered))
  40. },
  41. goToStep(num) {
  42. this.currentStep = num
  43. },
  44. updateAnswers(payload) {
  45. // null payload is passed on splash page
  46. if (payload) {
  47. const k = payload.question.response_key_prompt
  48. this.answered[k] = payload.answer
  49. console.log(`${k}:`, this.answered[k])
  50. console.log(`Updated answers: ${JSON.stringify(this.answered)}`)
  51. if (k === 'aspects') return
  52. }
  53. this.goToStep(this.currentStep + 1)
  54. },
  55. },
  56. }
  57. </script>
  58. <style lang="sass">
  59. .view--onboarding
  60. width: 100%
  61. max-width: 428px
  62. background-color: #fff
  63. color: #1F2024
  64. font-family: Century Gothic,CenturyGothic,AppleGothic,sans-serif
  65. margin: 0 auto
  66. article
  67. height: 100vh
  68. .w-button
  69. display: flex
  70. width: 315px
  71. height: 60px
  72. border-radius: 6
  73. background-color: #D5D5D5
  74. color: #1F2024
  75. margin: 11px auto
  76. font-weight: bold
  77. font-size: 16px
  78. text-transform: uppercase
  79. &.next-btn
  80. border-radius: 6px
  81. background-color: #5BA626
  82. color: #1F2024
  83. height: 50px
  84. width: 315px
  85. font-size: 18px
  86. padding: 7px
  87. .w-card
  88. background-color: #1F2024
  89. justify-content: center
  90. align-items: center
  91. width: 100%
  92. <<<<<<< HEAD
  93. h3
  94. text-transform: uppercase
  95. =======
  96. h3
  97. text-transform: uppercase
  98. >>>>>>> 41496c8 (:sparkles: questionnaire styles added #TODO radio buttons checked correct color)
  99. text-align: center
  100. font-size: 28px
  101. font-weight: bold
  102. color: white
  103. margin-top: 88px
  104. p
  105. color: white
  106. font-size: 18px
  107. padding: 11px
  108. text-align: center
  109. margin: 22px auto
  110. font-weight: bold
  111. input
  112. display: flex
  113. width: 315px
  114. height: 60px
  115. padding: 11px
  116. border-radius: 6
  117. background-color: #D5D5D5
  118. color: #1F2024
  119. margin: 11px auto
  120. font-weight: bold
  121. font-size: 16px
  122. .w-select
  123. padding: 11px
  124. color: #1F2024
  125. .search-type
  126. color: #1F2024
  127. height: 50px
  128. &.question
  129. p
  130. font-size: 18px
  131. text-align: left
  132. margin: 7px auto
  133. font-weight: normal
  134. section
  135. p
  136. margin: 0
  137. font-weight: bold
  138. text-transform: capitalize
  139. .w-radio__input
  140. background-color: #D93D59
  141. .w-card__content
  142. .w-button
  143. height: 50px
  144. background-color: #5BA626
  145. </style>