风险测评小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
3.5 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="答题测评" leftClick @leftClick="$utils.navigateBack" bgColor="transparent" />
  4. <view class="main">
  5. <view class="card">
  6. <view class="flex flex-column card-header">
  7. <view>您好 !</view>
  8. <view>请选择您要答题的题库可多选</view>
  9. </view>
  10. <view class="card-content list">
  11. <uv-checkbox-group
  12. v-model="selectedArr"
  13. shape="circle"
  14. >
  15. <view class="flex list-item" v-for="item in list" :key="item.id">
  16. <view class="flex left">
  17. <image class="icon" src="@/static/image/icon.png" mode="widthFix"></image>
  18. <view>{{ item.title }}</view>
  19. </view>
  20. <view>
  21. <uv-checkbox
  22. size="40rpx"
  23. icon-size="40rpx"
  24. activeColor="#014FA2"
  25. :name="item.id"
  26. ></uv-checkbox>
  27. </view>
  28. </view>
  29. </uv-checkbox-group>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="bottom">
  34. <button class="btn" @click="onStart">开始答题</button>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import mixinsList from '@/mixins/list.js'
  40. export default {
  41. mixins: [mixinsList],
  42. data() {
  43. return {
  44. list: [],
  45. selectedArr: [],
  46. mixinsListApi: 'queryCategoryList',
  47. }
  48. },
  49. computed: {
  50. },
  51. onLoad() {
  52. },
  53. methods: {
  54. onStart() {
  55. if (!this.selectedArr.length) {
  56. uni.showToast({
  57. title: '请选择您要答题的题库(可多选)',
  58. icon:'none'
  59. })
  60. return
  61. }
  62. let ids = this.selectedArr.join(';')
  63. uni.redirectTo({
  64. url: `/pages_order/test/answer?ids=${ids}`
  65. })
  66. },
  67. },
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .page__view {
  72. width: 100vw;
  73. min-height: 100vh;
  74. background: linear-gradient(164deg, #014FA2, #014FA2, #2E8AED);
  75. position: relative;
  76. }
  77. .main {
  78. width: 100%;
  79. padding: 54rpx 36rpx;
  80. padding-bottom: calc(env(safe-area-inset-bottom) + 152rpx + 73rpx);
  81. box-sizing: border-box;
  82. }
  83. .card {
  84. padding: 34rpx 43rpx 34rpx 19rpx;
  85. background: linear-gradient(rgba($color: #3381D4, $alpha: 0.50), rgba($color: #FCFDFE, $alpha: 0.90) 281rpx, rgba($color: #FCFDFE, $alpha: 0.90));
  86. border-radius: 25rpx;
  87. // border: 3rpx solid #FFFFFF;
  88. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  89. &-header {
  90. align-items: flex-start;
  91. row-gap: 10rpx;
  92. padding: 0 0 27rpx 5rpx;
  93. font-size: 30rpx;
  94. line-height: 1.4;
  95. color: #FFFFFF;
  96. }
  97. &-content {
  98. // padding: 0 16rpx;
  99. }
  100. }
  101. .list {
  102. &-item {
  103. width: 100%;
  104. justify-content: space-between;
  105. padding: 30rpx 42rpx 30rpx 24rpx;
  106. box-sizing: border-box;
  107. font-size: 30rpx;
  108. color: #000000;
  109. background: rgba($color: #62BBFF, $alpha: 0.06);
  110. border-radius: 16rpx;
  111. & + & {
  112. margin-top: 17rpx;
  113. }
  114. .left {
  115. column-gap: 18rpx;
  116. }
  117. .icon {
  118. width: 48rpx;
  119. height: auto;
  120. }
  121. }
  122. }
  123. .bottom {
  124. position: fixed;
  125. left: 0;
  126. bottom: 0;
  127. width: 100%;
  128. padding: 17rpx 72rpx;
  129. padding-bottom: calc(env(safe-area-inset-bottom) + 17rpx);
  130. background: #FFFFFF;
  131. box-sizing: border-box;
  132. .btn {
  133. width: 100%;
  134. padding: 26rpx 0;
  135. font-size: 30rpx;
  136. line-height: 1.4;
  137. color: #FFFFFF;
  138. background: #014FA2;
  139. border-radius: 42rpx;
  140. }
  141. }
  142. </style>