questionDetail.wxml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <view>
  2. <view class="top">
  3. <van-slider value="{{answerSize*100/exams.length}}" use-button-slot
  4. active-color="#FF4330"
  5. inactive-color='#CFCFCF' custom-class="progress" bar-height="6rpx">
  6. <view slot="button"></view>
  7. </van-slider>
  8. <view class="progress-txt">{{answerSize}}/{{exams.length}}</view>
  9. </view>
  10. <view class="content" wx:for="{{exams}}" wx:key="index">
  11. <view class='question'>
  12. <view class="tag">{{index + 1}}</view>
  13. <view class="title">{{item.stem}}</view>
  14. <view class="type">{{qType[item.questionType]}}</view>
  15. </view>
  16. <view class='opt-list'
  17. wx:if="{{item.questionType == questionTypesEnum.SINGLE || item.questionType == questionTypesEnum.MULTIPLE}}">
  18. <view class='opt' wx:for="{{item.questionnaireAnswerList}}" wx:for-item="opt" wx:key="index"
  19. bind:tap="slectAnswer"
  20. data-q="{{item}}"
  21. data-opt="{{opt}}">
  22. <view hidden="{{!answers[item.id][opt.id]}}">
  23. <van-image width="24rpx" height="24rpx"
  24. src='/images/ic_radio_active.png'
  25. />
  26. </view>
  27. <view hidden="{{answers[item.id][opt.id]}}">
  28. <van-image width="24rpx" height="24rpx"
  29. hidden="{{!answers[item.id][opt.id]}}"
  30. src="/images/ic_radio_default.png"
  31. />
  32. </view>
  33. <view class="radio-txt">{{opt.answer}}</view>
  34. </view>
  35. <van-field
  36. wx:if="{{item.otherAnswerType}}"
  37. data-id="{{item.id+'*'}}"
  38. value="{{answers[item.id+'*']}}"
  39. custom-style="background: #F1F1F1;border-radius: 8rpx;font-size: 24rpx;ont-weight: 400;color: #333333;width:600rpx;margin-left:50rpx;"
  40. border="{{ false }}"
  41. bind:change="onChange"
  42. />
  43. </view>
  44. <van-field
  45. wx:else
  46. data-id="{{item.id}}"
  47. value="{{answers[item.id]}}"
  48. bind:change="onChange"
  49. type="textarea"
  50. custom-style="margin: 40rpx 10rpx 10rpx;background: #F1F1F1;border-radius: 8rpx;font-size: 24rpx;font-weight: 400;color: #333333;"
  51. autosize
  52. placeholder="请写下你想对我们说的建议"
  53. placeholder-style="font-size: 24rpx;font-weight: 400;color: #999999;"
  54. input-class="input-class"
  55. border="{{ false }}"
  56. />
  57. </view>
  58. <view class="mtb50">
  59. <edu-button title="提交" bind:click="toPut"/>
  60. </view>
  61. </view>