questionDetail.wxml 3.0 KB

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