index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div class="li_box" :class="{'active':item.warn}">
  3. <div class="lb_title adf">
  4. <span>*</span>
  5. {{index+1}}. {{item.question}}
  6. </div>
  7. <div class="lb_answers">
  8. <u-radio-group
  9. :value="item.answer"
  10. placement="column"
  11. @change="radioChange"
  12. >
  13. <view class="la_item" v-for="(pre,idx) in item.userAnswer" :key="idx">
  14. <u-radio
  15. :label="pre.questionOption"
  16. :name="pre.questionOption"
  17. activeColor="#833478"
  18. size="36rpx"
  19. iconSize="32rpx"
  20. labelSize="32rpx"
  21. ></u-radio>
  22. </view>
  23. </u-radio-group>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. name: "QuestionItem",
  30. props: {
  31. item: {
  32. type: Object,
  33. required: true
  34. },
  35. index: {
  36. type: Number,
  37. required: true
  38. }
  39. },
  40. methods: {
  41. radioChange(value) {
  42. this.$emit('change', {
  43. value: value,
  44. index: this.index
  45. });
  46. }
  47. }
  48. }
  49. </script>
  50. <style scoped lang="less">
  51. .li_box{
  52. width: 100%;
  53. padding: 32rpx 34rpx;
  54. box-sizing: border-box;
  55. &.active{
  56. border: 2rpx dotted #FD4F66;
  57. padding: 30rpx 32rpx;
  58. }
  59. .lb_title{
  60. font-family: PingFang-SC, PingFang-SC;
  61. font-weight: bold;
  62. font-size: 32rpx;
  63. color: #252525;
  64. line-height: 48rpx;
  65. span{
  66. font-family: PingFangSC, PingFang SC;
  67. font-weight: 400;
  68. font-size: 32rpx;
  69. color: #FD4F66;
  70. line-height: 51rpx;
  71. }
  72. }
  73. .lb_answers{
  74. width: calc(100% - 40rpx);
  75. margin: 30rpx 20rpx 0;
  76. box-sizing: border-box;
  77. border: 1rpx solid #E5E7EB;
  78. .la_item{
  79. padding: 34rpx 24rpx;
  80. border-bottom: 1rpx solid #E5E7EB;
  81. &:last-child{
  82. border-bottom: none;
  83. }
  84. }
  85. }
  86. .la_inp{
  87. width: 100%;
  88. height: 96rpx;
  89. border-radius: 24rpx;
  90. border: 1rpx solid #DFCDDC;
  91. padding: 24rpx 30rpx;
  92. box-sizing: border-box;
  93. margin-top: 30rpx;
  94. }
  95. .la_warn{
  96. padding: 7rpx 23rpx;
  97. margin-top: 20rpx;
  98. background: #FFECEC;
  99. .lw{
  100. width: 36rpx;
  101. height: 36rpx;
  102. border-radius: 50%;
  103. background: #FD4F66;
  104. }
  105. span{
  106. font-family: PingFangSC, PingFang SC;
  107. font-weight: 400;
  108. font-size: 24rpx;
  109. color: #FD4F66;
  110. line-height: 51rpx;
  111. margin-left: 17rpx;
  112. }
  113. }
  114. }
  115. </style>