index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. }
  58. .lb_title{
  59. font-family: PingFang-SC, PingFang-SC;
  60. font-weight: bold;
  61. font-size: 32rpx;
  62. color: #252525;
  63. line-height: 48rpx;
  64. span{
  65. font-family: PingFangSC, PingFang SC;
  66. font-weight: 400;
  67. font-size: 32rpx;
  68. color: #FD4F66;
  69. line-height: 51rpx;
  70. }
  71. }
  72. .lb_answers{
  73. width: calc(100% - 40rpx);
  74. margin: 30rpx 20rpx 0;
  75. box-sizing: border-box;
  76. border: 1rpx solid #E5E7EB;
  77. .la_item{
  78. padding: 34rpx 24rpx;
  79. border-bottom: 1rpx solid #E5E7EB;
  80. &:last-child{
  81. border-bottom: none;
  82. }
  83. }
  84. }
  85. .la_inp{
  86. width: 100%;
  87. height: 96rpx;
  88. border-radius: 24rpx;
  89. border: 1rpx solid #DFCDDC;
  90. padding: 24rpx 30rpx;
  91. box-sizing: border-box;
  92. margin-top: 30rpx;
  93. }
  94. .la_warn{
  95. padding: 7rpx 23rpx;
  96. margin-top: 20rpx;
  97. background: #FFECEC;
  98. .lw{
  99. width: 36rpx;
  100. height: 36rpx;
  101. border-radius: 50%;
  102. background: #FD4F66;
  103. }
  104. span{
  105. font-family: PingFangSC, PingFang SC;
  106. font-weight: 400;
  107. font-size: 24rpx;
  108. color: #FD4F66;
  109. line-height: 51rpx;
  110. margin-left: 17rpx;
  111. }
  112. }
  113. }
  114. </style>