question.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view>
  3. <view class="contentList">
  4. <view class="headerTitle">
  5. <view class="leftIcon" v-for="(item, index) in titleS" :key="index" v-if="item.value === list[nowPageData].type">
  6. <span >{{ item.label }}</span>
  7. </view>
  8. <view class="right">
  9. 1
  10. <span class="lengNum">/10</span>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="footer_tab">
  15. <u-line color="#D6D6DB" />
  16. <u-row gutter="16">
  17. <u-col span="4">
  18. <view class="box">
  19. <view style="text-align: center;margin-left: 30rpx;position: absolute;left: 20rpx;">
  20. <image src="/static/sc.png" class="sc"></image>
  21. <view class="sc_t">收藏</view>
  22. </view>
  23. </view>
  24. </u-col>
  25. <u-col span="4">
  26. <view class="box">
  27. <view style="text-align: center;" @click="menu">
  28. <image src="/static/up.png" style="width: 58rpx;height: 22rpx;"></image>
  29. <view class="sc_t">答题卡</view>
  30. </view>
  31. </view>
  32. </u-col>
  33. <u-col span="4">
  34. <view class="box">
  35. <view style="text-align: center;margin-right: 30rpx;position: absolute;right: 20rpx;">
  36. <image src="/static/jj.png" class="sc"></image>
  37. <view class="sc_t">交卷</view>
  38. </view>
  39. </view>
  40. </u-col>
  41. </u-row>
  42. </view>
  43. <u-popup v-model="show" mode="bottom" :safe-area-inset-bottom="true">
  44. <view class="popup_box">
  45. <scroll-view scroll-y="true" class="popup_list">
  46. <view v-for="(item, index) in list" :key="index" class="btn_num" :class="index % 2 == 0 ? 'btn_bac2' : 'btn_bac1'">
  47. <text class="">{{ index + 1 }}</text>
  48. </view>
  49. </scroll-view>
  50. </view>
  51. </u-popup>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. data() {
  57. return {
  58. type: 1,
  59. show: false,
  60. list: [],
  61. nowPageData: 0,
  62. titleS: [
  63. {
  64. label: '单选题',
  65. value: 1
  66. },
  67. {
  68. label: '多选题',
  69. value: 2
  70. }
  71. ]
  72. };
  73. },
  74. onLoad(option) {
  75. this.titleListFn(option);
  76. },
  77. onShow() {},
  78. methods: {
  79. titleListFn(option) {
  80. if (option.bankSectionId) {
  81. var data = {
  82. bankSectionId: option.bankSectionId
  83. };
  84. }
  85. if (option.examId) {
  86. var data = {
  87. examId: option.examId
  88. };
  89. }
  90. this.$api.questiondetailList(data).then(res => {
  91. this.list = res.data.rows;
  92. });
  93. },
  94. menu() {
  95. this.show = true;
  96. }
  97. }
  98. };
  99. </script>
  100. <style>
  101. ::-webkit-scrollbar {
  102. width: 0;
  103. height: 0;
  104. color: transparent;
  105. }
  106. .u-drawer-content-visible {
  107. border-radius: 32rpx 32rpx 0rpx 0rpx;
  108. overflow: hidden;
  109. }
  110. </style>
  111. <style scope>
  112. .contentList {
  113. padding: 0rpx 32rpx;
  114. }
  115. .contentList > .headerTitle {
  116. display: flex;
  117. align-items: center;
  118. justify-content: space-between;
  119. color: #32467b;
  120. }
  121. .headerTitle > .leftIcon {
  122. padding: 0rpx 10rpx;
  123. height: 36rpx;
  124. line-height: 36rpx;
  125. border: 1rpx solid #32467b;
  126. font-size: 28rpx;
  127. border-radius: 10rpx;
  128. background-color: rgba(50, 70, 123, 0.1);
  129. }
  130. .headerTitle > .right > .lengNum {
  131. font-size: 28rpx;
  132. color: #999999;
  133. }
  134. .btn_bac2 {
  135. background: #32467b;
  136. color: #fff;
  137. }
  138. .btn_bac1 {
  139. background: #f7f8ff;
  140. color: #666666;
  141. }
  142. .btn_num::before {
  143. content: '';
  144. padding-top: 100%;
  145. display: block;
  146. }
  147. .btn_num text {
  148. font-size: 24rpx;
  149. width: 100%;
  150. display: inline-block;
  151. text-align: center;
  152. top: 50%;
  153. position: absolute;
  154. height: 30rpx;
  155. line-height: 30rpx;
  156. margin-top: -15rpx;
  157. }
  158. .btn_num {
  159. border-radius: 32rpx;
  160. width: 16%;
  161. margin: 2%;
  162. display: inline-block;
  163. position: relative;
  164. }
  165. .popup_list {
  166. border-radius: 32rpx 32rpx 0rpx 0rpx;
  167. height: 899rpx;
  168. background: #f2f3f6;
  169. padding-bottom: 30rpx;
  170. }
  171. .popup_box {
  172. height: 899rpx;
  173. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  174. border-radius: 32rpx 32rpx 0rpx 0rpx;
  175. background: #f2f3f6;
  176. padding: 30rpx;
  177. }
  178. .sc_t {
  179. font-size: 22rpx;
  180. color: #000000;
  181. }
  182. .box {
  183. height: 95rpx;
  184. display: flex;
  185. flex-direction: column;
  186. justify-content: center;
  187. position: relative;
  188. }
  189. .sc {
  190. width: 29rpx;
  191. height: 29rpx;
  192. }
  193. .footer_tab {
  194. position: fixed;
  195. bottom: 0;
  196. height: 96rpx;
  197. width: 100%;
  198. background-color: #ffffff;
  199. }
  200. page {
  201. background: #ffffff;
  202. }
  203. </style>