index3.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="li_box">
  3. <view class="lb_title">
  4. {{index+1}}. {{item.question}}<br>
  5. <span style="color: #536387;font-size: 28rpx;line-height: 36rpx;margin-top: 12rpx;">{{item.questionEnglish||''}}</span>
  6. </view>
  7. <view class="lb_card">
  8. <view class="lb_box" v-for="(ua,ui) in item[arrayKey]" :key="ui">
  9. <view class="memo">{{assessmentMethodCfg[ua.assessmentMethod]||''}}</view>
  10. <view class="lb_answers">
  11. <u-radio-group
  12. :value="ua.answer"
  13. placement="column"
  14. @change="e=>radioChange(e,ua.assessmentMethod,item.id)"
  15. >
  16. <u-radio
  17. v-for="(pre,idx) in ua.questionOption"
  18. :key="idx"
  19. :label="pre.questionOption"
  20. :name="pre.questionOption"
  21. activeColor="#33A7A7"
  22. size="36rpx"
  23. iconSize="32rpx"
  24. labelColor="#002846"
  25. labelSize="28rpx"
  26. :custom-style="{
  27. 'padding': '0 24rpx',
  28. 'background': '#FFFFFF',
  29. 'border-radius': '24rpx',
  30. 'margin-top': '10rpx',
  31. 'width': '100%'
  32. }"
  33. ></u-radio>
  34. </u-radio-group>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. name: "QuestionItem",
  43. options: {
  44. styleIsolation: 'shared'
  45. },
  46. props: {
  47. item: {
  48. type: Object,
  49. required: true
  50. },
  51. index: {
  52. type: Number,
  53. required: true
  54. },
  55. arrayKey: {
  56. type: String,
  57. default:'userAnswer'
  58. },
  59. },
  60. data(){
  61. return {
  62. assessmentMethodCfg:{
  63. '1':'您对团队当前在此项陈述上所描述的实际表现的同意程度为:',
  64. '2':'此项陈述对该团队当前的重要性: '
  65. }
  66. }
  67. },
  68. methods: {
  69. radioChange(value,assessmentMethod,id) {
  70. this.$emit('change', {
  71. value,
  72. assessmentMethod,
  73. id,
  74. index: this.index
  75. });
  76. }
  77. }
  78. }
  79. </script>
  80. <style scoped lang="scss">
  81. .li_box{
  82. margin-top: 20rpx;
  83. .lb_title{
  84. font-family: PingFang-SC, PingFang-SC;
  85. font-weight: bold;
  86. font-size: 32rpx;
  87. color: #002846;
  88. line-height: 48rpx;
  89. }
  90. .lb_card{
  91. background: #F2F9F9;
  92. border-radius: 24rpx;
  93. padding: 0 24rpx 40rpx;
  94. overflow: hidden;
  95. margin-top: 32rpx;
  96. }
  97. .lb_box{
  98. margin-top: 40rpx;
  99. .memo{
  100. font-family: PingFangSC, PingFang SC;
  101. font-weight: 400;
  102. font-size: 24rpx;
  103. color: #009191;
  104. line-height: 24rpx;
  105. }
  106. .lb_answers{
  107. width: 100%;
  108. margin-top: 20rpx;
  109. ::v-deep .u-radio__text {
  110. width: 100% !important;
  111. padding: 31rpx 0 !important;
  112. }
  113. }
  114. }
  115. }
  116. </style>