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.

81 lines
1.8 KiB

  1. <template>
  2. <div class="home">
  3. <img src="../assets/enter.jpg" alt="进入测试" class="image" @click="jumpPage">
  4. </div>
  5. </template>
  6. <script>
  7. import axios from 'axios';
  8. export default {
  9. name: 'App',
  10. data() {
  11. return {
  12. activeTab: 'question'
  13. }
  14. },
  15. methods:{
  16. async jumpPage(){
  17. const submissionData={
  18. // jwcode:91000001,//有成绩的
  19. // jwcode:90098888,//有成绩的
  20. // jwcode:90098889,//有成绩的
  21. // jwcode:90098890,//有成绩的
  22. // jwcode:90098891,//有成绩的
  23. // jwcode:90098892,//有成绩的
  24. // jwcode:90098893,//没有成绩的
  25. jwcode:90098894,//没有成绩的
  26. };
  27. localStorage.setItem('submissionData', JSON.stringify(submissionData));
  28. console.log('存储的数据:', localStorage.getItem('submissionData'));
  29. try{
  30. const res = await axios.post('http://192.168.40.41:8000/api/knowledge/scores',submissionData);
  31. this.score = res.data.data[0].score;
  32. console.log(this.score);
  33. if(this.score==null){
  34. this.$router.push('/text');
  35. }
  36. else{
  37. this.$router.push('/report');
  38. }
  39. }catch(err){
  40. this.$router.push('/text');
  41. }
  42. }
  43. },
  44. async mounted(){
  45. localStorage.removeItem('submissionData');
  46. },
  47. }
  48. </script>
  49. <style scoped>
  50. * {
  51. margin: 0;
  52. padding: 0;
  53. box-sizing: border-box;
  54. }
  55. .home {
  56. position: relative;
  57. min-height: 100vh;
  58. display: flex;
  59. background-image: url('@/assets/home.jpg');
  60. background-size: cover;
  61. background-position: center;
  62. }
  63. .image {
  64. position: fixed;
  65. width: 200px;
  66. min-height: 160px;
  67. max-height: 160px;
  68. object-fit: contain;
  69. bottom: 70px;
  70. left: 682px;
  71. /* left: 35.5%; */
  72. }
  73. .image:hover {
  74. transform: scale(1.2);
  75. filter: brightness(1.1);
  76. }
  77. </style>