风险测评小程序前端代码仓库
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.

157 lines
3.4 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. // todo
  47. mixinsListApi: '',
  48. }
  49. },
  50. computed: {
  51. },
  52. onLoad() {
  53. },
  54. methods: {
  55. onStart() {
  56. console.log('onStartTest', this.selectedArr)
  57. // todo: fetch
  58. let ids = this.selectedArr.map(item => item.id).join(';')
  59. uni.navigateTo({
  60. url: `/pages_order/test/answer?ids=${ids}`
  61. })
  62. },
  63. },
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .page__view {
  68. width: 100vw;
  69. min-height: 100vh;
  70. background: linear-gradient(164deg, #014FA2, #014FA2, #2E8AED);
  71. position: relative;
  72. }
  73. .main {
  74. width: 100%;
  75. padding: 54rpx 36rpx;
  76. padding-bottom: calc(env(safe-area-inset-bottom) + 152rpx + 73rpx);
  77. box-sizing: border-box;
  78. }
  79. .card {
  80. padding: 34rpx 43rpx 34rpx 19rpx;
  81. background: linear-gradient(rgba($color: #3381D4, $alpha: 0.50), rgba($color: #FCFDFE, $alpha: 0.90) 281rpx, rgba($color: #FCFDFE, $alpha: 0.90));
  82. border-radius: 25rpx;
  83. // border: 3rpx solid #FFFFFF;
  84. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  85. &-header {
  86. align-items: flex-start;
  87. row-gap: 10rpx;
  88. padding: 0 0 27rpx 5rpx;
  89. font-size: 30rpx;
  90. line-height: 1.4;
  91. color: #FFFFFF;
  92. }
  93. &-content {
  94. // padding: 0 16rpx;
  95. }
  96. }
  97. .list {
  98. &-item {
  99. width: 100%;
  100. justify-content: space-between;
  101. padding: 30rpx 42rpx 30rpx 24rpx;
  102. box-sizing: border-box;
  103. font-size: 30rpx;
  104. color: #000000;
  105. background: rgba($color: #62BBFF, $alpha: 0.06);
  106. border-radius: 16rpx;
  107. & + & {
  108. margin-top: 17rpx;
  109. }
  110. .left {
  111. column-gap: 18rpx;
  112. }
  113. .icon {
  114. width: 48rpx;
  115. height: auto;
  116. }
  117. }
  118. }
  119. .bottom {
  120. position: fixed;
  121. left: 0;
  122. bottom: 0;
  123. width: 100%;
  124. padding: 17rpx 72rpx;
  125. padding-bottom: calc(env(safe-area-inset-bottom) + 17rpx);
  126. background: #FFFFFF;
  127. box-sizing: border-box;
  128. .btn {
  129. width: 100%;
  130. padding: 26rpx 0;
  131. font-size: 30rpx;
  132. line-height: 1.4;
  133. color: #FFFFFF;
  134. background: #014FA2;
  135. border-radius: 42rpx;
  136. }
  137. }
  138. </style>