result.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <template>
  2. <view>
  3. <view id="top-box" class="cu-bar bg-white solid-bottom">
  4. <view class="action text-black">
  5. <text v-if="currentType===1">判断题</text>
  6. <text v-else-if="currentType===2">单选题</text>
  7. <text v-else-if="currentType===3">多选题</text>
  8. <text v-else-if="currentType===4">填空题</text>
  9. <text v-else-if="currentType===5">问答题</text>
  10. </view>
  11. <view class="action">
  12. <button class="cu-btn bg-green shadow" @tap="showCardModal" data-target="modalCard">答题卡</button>
  13. </view>
  14. </view>
  15. <view class="cu-modal" :class="modalCard=='modalCard'?'show':''" @tap="hideCardModal">
  16. <view class="cu-dialog" @tap.stop>
  17. <scroll-view class="page padding" :scroll-y=true :style="{'height':swiperHeight}" >
  18. <view class="cu-bar solid-bottom">
  19. <view class="action">
  20. <text class="cuIcon-title text-red"></text>答题卡
  21. </view>
  22. </view>
  23. <view class="grid col-5 ">
  24. <view class="margin-tb-sm text-center" v-for="(subject,index) in subjectList" :key="index">
  25. <button class="cu-btn round" :class="[subject.userAnswer.length===0?'line-grey':'bg-red']" @click="AppointedSubject(index)" >{{index+1}}</button>
  26. </view>
  27. </view>
  28. </scroll-view>
  29. </view>
  30. </view>
  31. <view class="cu-modal padding " :class="modalError=='modalError'?'show':''" @tap="hideErrorModal">
  32. <view class="cu-dialog bg-white" @tap.stop>
  33. <view class="cu-bar solid-bottom ">
  34. <view class="action">
  35. <text class="cuIcon-title text-red"></text>试题纠错
  36. </view>
  37. </view>
  38. <radio-group class="block" >
  39. <view class="cu-list menu text-left">
  40. <view class="cu-item cu-item-error" v-for="error in errorList" >
  41. <radio :value="error"></radio>
  42. <view class="title text-black margin-left">{{error}}</view>
  43. </view>
  44. </view>
  45. </radio-group>
  46. <view class="padding flex flex-direction ">
  47. <button class="cu-btn bg-red margin-tb-sm lg" @click="SubmitError">提 交</button>
  48. </view>
  49. </view>
  50. </view>
  51. <form>
  52. <swiper :current="subjectIndex" class="swiper-box" @change="SwiperChange" :style="{'height':swiperHeight}">
  53. <swiper-item v-for="(subject,index) in subjectList">
  54. <view v-if="index-subjectIndex>=-1&&index-subjectIndex<=1">
  55. <view class="cu-bar bg-white solid-bottom">
  56. <view class="action text-black">
  57. <text class="cuIcon-title text-red"></text>{{subject.title}}
  58. </view>
  59. </view>
  60. <view>
  61. <radio-group class="block" @change="RadioboxChange" v-if="subject.type===1||subject.type===2">
  62. <view class="cu-form-group" v-for="option in subject.optionList">
  63. <radio :value="option.id" :checked="subject.userAnswer.indexOf(option.id) > -1?true:false"></radio>
  64. <view class="title text-black">{{option.id}}.{{option.content}}</view>
  65. </view>
  66. </radio-group>
  67. <checkbox-group class="block" @change="CheckboxChange" v-else-if="subject.type===3">
  68. <view class="cu-form-group" v-for="option in subject.optionList">
  69. <checkbox :value="option.id" :class="subject.userAnswer.indexOf(option.id) > -1?'checked':''" :checked="subject.userAnswer.indexOf(option.id) > -1?true:false"></checkbox>
  70. <view class="title text-black">{{option.id}}.{{option.content}}</view>
  71. </view>
  72. </checkbox-group>
  73. <view v-else-if="subject.type===4">
  74. <view class="cu-form-group solid-bottom">
  75. <view class="title text-black">
  76. 答:
  77. </view>
  78. <input placeholder="文本输入框" name="input" v-model="subject.userAnswer" @blur="textInput" ></input>
  79. </view>
  80. </view>
  81. <view v-else-if="subject.type===5">
  82. <view class="cu-bar cu-bar-title bg-white margin-top">
  83. <view class="action text-black">
  84. 答:
  85. </view>
  86. </view>
  87. <view class="cu-form-group solid margin">
  88. <textarea maxlength="-1" @blur="textInput" v-model="subject.userAnswer" placeholder="多行文本输入框"></textarea>
  89. </view>
  90. </view>
  91. </view>
  92. <view v-show="subject.showAnswer" class="margin-top solid-top">
  93. <view class="cu-bar">
  94. <view class="action text-grey">
  95. <text>正确答案:</text>
  96. <text class="solid-bottom padding-left text-green">{{subject.answer}}</text>
  97. </view>
  98. </view>
  99. <view class="cu-bar cu-bar-title">
  100. <view class="action text-grey">
  101. <text>解析:</text>
  102. </view>
  103. </view>
  104. <view class="text-content padding text-grey">
  105. {{subject.explain}}
  106. </view>
  107. </view>
  108. </view>
  109. </swiper-item>
  110. </swiper>
  111. </form>
  112. <view id="foot-box" class="cu-bar tabbar bg-white shadow foot">
  113. <view class="action" @click="MoveSubject(-1)">
  114. <view class="cuIcon-cu-image">
  115. <text class="lg cuIcon-back text-gray"></text>
  116. </view>
  117. <view class="text-gray">上一题</view>
  118. </view>
  119. <view class="action" @click="MoveSubject(1)">
  120. <view class="cuIcon-cu-image">
  121. <text class="lg text-gray cuIcon-right"></text>
  122. </view>
  123. <view class="text-gray">下一题</view>
  124. </view>
  125. <view class="action" @click="FavorSubject">
  126. <view class="cuIcon-cu-image">
  127. <text class="lg cuIcon-favor" :class="[userFavor?'text-red':'text-gray']"></text>
  128. </view>
  129. <view :class="[userFavor?'text-red':'text-gray']">收藏</view>
  130. </view>
  131. <view class="action" @click="ShowAnswerChange">
  132. <view class="cuIcon-cu-image">
  133. <text class="lg text-gray cuIcon-question"></text>
  134. </view>
  135. <view class="text-gray">解答</view>
  136. </view>
  137. <view class="action" @tap="showErrorModal" data-target="modalError">
  138. <view class="cuIcon-cu-image">
  139. <text class="lg text-gray cuIcon-warn"></text>
  140. </view>
  141. <view class="text-gray">纠错</view>
  142. </view>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. /*
  148. *
  149. * 需要二次开发或项目外包的请加QQ 271478027 或 微信 jialongvip
  150. *
  151. */
  152. export default {
  153. data() {
  154. return {
  155. userFavor:false,//是否已收藏
  156. currentType: 0, //当前题型
  157. subjectIndex: 0,//跳转索引
  158. autoShowAnswer: false,//答错是否显答案
  159. autoRadioNext:true,//判断题、单项题,自动移下一题
  160. swiperHeight: '800px',//
  161. title: '初中二年级2019期中考券',
  162. subjectList:[
  163. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  164. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  165. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  166. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  167. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  168. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  169. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  170. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  171. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  172. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  173. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  174. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  175. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  176. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  177. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  178. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  179. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  180. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  181. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  182. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  183. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  184. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  185. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  186. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  187. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  188. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  189. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  190. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  191. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  192. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  193. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  194. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  195. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  196. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  197. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  198. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  199. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  200. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  201. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  202. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  203. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  204. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  205. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  206. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  207. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  208. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  209. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  210. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  211. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  212. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  213. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  214. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  215. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  216. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  217. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  218. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  219. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  220. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  221. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  222. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  223. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  224. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  225. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  226. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  227. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  228. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  229. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  230. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  231. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  232. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  233. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  234. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  235. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  236. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  237. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  238. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  239. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  240. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  241. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  242. {"title":"什么美国要限制华为?","type":5,"optionList":[{"id":"","content":""}],"answer":"","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  243. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  244. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  245. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  246. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  247. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  248. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  249. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  250. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  251. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  252. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  253. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  254. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  255. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  256. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  257. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  258. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  259. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  260. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  261. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  262. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  263. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  264. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  265. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  266. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  267. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  268. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  269. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  270. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"},
  271. {"title":"水是液体?","type":1,"optionList":[{"id":"A","content":"对"},{"id":"B","content":"错"}],"answer":"A","userAnswer":"","userFavor":false,"explain":"难到是固体不成?"},
  272. {"title":"电流分有?","type":2,"optionList":[{"id":"A","content":"直流"},{"id":"B","content":"交流"},{"id":"C","content":"直流和交流"}],"answer":"C","userAnswer":"","userFavor":false,"explain":"科技学依据"},
  273. {"title":"酸菜鱼的味道?","type":3,"optionList":[{"id":"A","content":"咸味"},{"id":"B","content":"辣味"},{"id":"C","content":"甜味"},{"id":"D","content":"酸味"}],"answer":"A,B,D","userAnswer":"","userFavor":false,"explain":"你怎么想都行,要的就是这个味,答案只能选A,B,D"},
  274. {"title":"床前(____)光,疑是地上霜。","type":4,"optionList":[{"id":"","content":""}],"answer":"明月","userAnswer":"","userFavor":false,"explain":"问答题没有选项,无法做答,且不参与计分"}
  275. ],
  276. modalCard: null ,//显示答题卡
  277. modalError:null , //纠错卡
  278. errorList:['题目不完整','答案不正确','含有错别字','图片不存在','解析不完整','其他错误']
  279. }
  280. },
  281. onReady() {
  282. var tempHeight = 800;
  283. var _me = this;
  284. uni.getSystemInfo({
  285. //获取手机屏幕高度信息,让swiper的高度和手机屏幕一样高                
  286. success: function(res) {
  287. // console.log(res.model);                    
  288. // console.log(res.pixelRatio);                    
  289. // console.log(res.windowWidth);                    
  290. // console.log(res.windowHeight);
  291. // //这里是手机屏幕高度                    
  292. // console.log(res.language);                    
  293. // console.log(res.version);                    
  294. // console.log(res.platform);                    
  295. tempHeight = res.windowHeight;
  296. console.log("屏幕可用高度 " + tempHeight);
  297. uni.createSelectorQuery().select("#top-box").fields({
  298. size: true,
  299. scrollOffset: true
  300. }, (data) => {
  301. tempHeight -= data.height;
  302. console.log("减掉顶部后的高度 " + tempHeight);
  303. uni.createSelectorQuery().select("#foot-box").fields({
  304. size: true,
  305. scrollOffset: true
  306. }, (data) => {
  307. tempHeight -= data.height;
  308. console.log("减掉底部后的高度 " + tempHeight);
  309. _me.swiperHeight = tempHeight + 'px';
  310. console.log("滑屏最后高度 " + _me.swiperHeight);
  311. }).exec();
  312. }).exec();
  313. }
  314. });
  315. },
  316. onLoad() {
  317. this.currentType = this.subjectList[0].type;
  318. uni.setNavigationBarTitle({
  319. title: this.title
  320. });
  321. //添加用户显示答案字段
  322. for (var i = 0; i < this.subjectList.length; i++) {
  323. this.$set(this.subjectList[i],"showAnswer",false);
  324. }
  325. },
  326. methods: {
  327. showCardModal: function(e) {
  328. this.modalCard = e.currentTarget.dataset.target
  329. },
  330. hideCardModal: function(e) {
  331. this.modalCard = null
  332. },
  333. showErrorModal: function(e) {
  334. this.modalError = e.currentTarget.dataset.target
  335. },
  336. hideErrorModal: function(e) {
  337. this.modalError = null
  338. },
  339. SwiperChange: function(e) { //滑动事件
  340. let index = e.target.current;
  341. if (index != undefined) {
  342. this.subjectIndex = index;
  343. this.currentType = this.subjectList[index].type;
  344. this.userFavor = this.subjectList[index].userFavor;
  345. }
  346. },
  347. RadioboxChange : function(e) { //单选选中
  348. var items = this.subjectList[this.subjectIndex].optionList;
  349. var values = e.detail.value;
  350. this.subjectList[this.subjectIndex].userAnswer = values;
  351. if(this.autoRadioNext && this.subjectIndex < this.subjectList.length - 1){
  352. this.subjectIndex += 1;
  353. };
  354. },
  355. CheckboxChange: function(e) { //复选选中
  356. var items = this.subjectList[this.subjectIndex].optionList;
  357. var values = e.detail.value;
  358. this.subjectList[this.subjectIndex].userAnswer = "";
  359. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  360. for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
  361. if (items[i].id == values[j]) {
  362. this.subjectList[this.subjectIndex].userAnswer += items[i].id;
  363. break
  364. }
  365. }
  366. }
  367. },
  368. textInput : function(e) { //填空题
  369. this.subjectList[this.subjectIndex].userAnswer = e.detail.value;
  370. },
  371. ShowAnswerChange: function(e) { //显示答案
  372. if(this.subjectList[this.subjectIndex].showAnswer)
  373. {
  374. this.subjectList[this.subjectIndex].showAnswer=false;
  375. }
  376. else{
  377. this.subjectList[this.subjectIndex].showAnswer=true;
  378. }
  379. },
  380. FavorSubject: function(e) { //收藏题
  381. if(this.userFavor)
  382. {
  383. this.userFavor=false;
  384. this.subjectList[this.subjectIndex].userFavor=false;
  385. }
  386. else{
  387. this.userFavor=true;
  388. this.subjectList[this.subjectIndex].userFavor=true;
  389. }
  390. },
  391. MoveSubject: function(e) { //上一题、下一题
  392. if (e === -1 && this.subjectIndex != 0) {
  393. this.subjectIndex -= 1;
  394. }
  395. if (e === 1 && this.subjectIndex < this.subjectList.length - 1) {
  396. this.subjectIndex += 1;
  397. }
  398. },
  399. AppointedSubject: function(e) { //题卡指定
  400. this.modalCard = null;
  401. this.subjectIndex = e;
  402. },
  403. SubmitError: function(e) { //提交纠错
  404. this.modalError = null;
  405. }
  406. }
  407. }
  408. </script>
  409. <style>
  410. @import "../../colorui/animation.css";
  411. page {
  412. background-color: #FFFFFF;
  413. }
  414. .cu-form-group {
  415. justify-content: flex-start
  416. }
  417. .cu-form-group .title {
  418. padding-left: 30upx;
  419. padding-right: 0upx;
  420. }
  421. .cu-form-group+.cu-form-group {
  422. border-top: none;
  423. }
  424. .cu-bar-title {
  425. min-height: 50upx;
  426. }
  427. .cu-list.menu>.cu-item-error{justify-content: flex-start;}
  428. </style>