index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="questionCard">
  3. <view class="title">专项答题</view>
  4. <view class="subTitle">术业有专攻,道义有精论</view>
  5. <view class="tipBox">
  6. <view class="tip" v-for="item in tipList" :key="item.id" :style="{backgroundColor:item.color}">
  7. {{item.val}}
  8. </view>
  9. </view>
  10. <view class="numberBox">
  11. <view
  12. class="number"
  13. v-for="item in 32"
  14. :key="item"
  15. style="background-color: #eeecec"
  16. @click="handleClick(item)">
  17. {{item}}
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. tipList: [{
  27. id: 1,
  28. val: "未答",
  29. color: "#eeecec"
  30. },
  31. {
  32. id: 2,
  33. val: "正确",
  34. color: "#22c134"
  35. },
  36. {
  37. id: 3,
  38. val: "错误",
  39. color: "#ff4d4f"
  40. },
  41. ]
  42. };
  43. },
  44. methods:{
  45. handleClick(val){
  46. // 跳转到对应题号的题目
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. page {
  53. background-color: #fff;
  54. height: 100%;
  55. }
  56. .questionCard {
  57. padding: 40rpx;
  58. .title {
  59. font-size: 60rpx;
  60. font-weight: 900;
  61. }
  62. .subTitle {
  63. margin: 20rpx 0;
  64. color: #666;
  65. }
  66. .tipBox {
  67. // background-color: pink;
  68. display: flex;
  69. justify-content: space-between;
  70. align-items: center;
  71. margin: 50rpx 0;
  72. }
  73. .numberBox {
  74. display: grid;
  75. // grid-template-columns: 1fr 1fr 1fr;
  76. grid-template-columns: 100rpx 100rpx 100rpx 100rpx 100rpx;
  77. justify-content: space-between;
  78. row-gap: 30rpx;
  79. }
  80. .tip,
  81. .number {
  82. width: 100rpx;
  83. height: 100rpx;
  84. text-align: center;
  85. line-height: 100rpx;
  86. border-radius: 20rpx;
  87. }
  88. }
  89. </style>