index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div class="maturity-game-page">
  3. <head-component :headinfo=headinfo></head-component>
  4. <div class="page-content">
  5. <div class="top">
  6. <img src="@/assets/images/wakeup/maturity/maturity-game-title.png" >
  7. </div>
  8. <div class="bottom">
  9. <img src="@/assets/images/wakeup/maturity/maturity-game-left.png" @click="jumpTo('/xjc-integratedmachine/wakeup/career_maturity/knowledge_explanation')">
  10. <img src="@/assets/images/wakeup/maturity/maturity-game-right.png" @click="jumpTo('/xjc-integratedmachine/wakeup/career_maturity/maturity_game')">
  11. </div>
  12. <drag_component></drag_component>
  13. </div>
  14. </div>
  15. </template>
  16. <script setup>
  17. import headComponent from '@/views/xjc-integratedmachine/components/head_component.vue'
  18. import drag_component from "@/views/xjc-integratedmachine/components/drag_component.vue";
  19. import {onMounted} from "vue";
  20. const router = useRouter()
  21. const headinfo = ref({})
  22. const draggedItem = ref(null);
  23. function dragStart(event) {
  24. draggedItem.value = event.target;
  25. }
  26. function drop(event) {
  27. event.preventDefault(); // 防止默认处理(例如打开链接)
  28. if (event.target !== draggedItem.value) {
  29. const target = event.target; // 获取放置的目标元素
  30. const item = draggedItem.value; // 获取被拖拽的元素
  31. // 交换位置或进行其他操作
  32. item.parentNode.insertBefore(item, target); // 将被拖拽的元素插入到目标元素之前
  33. }
  34. }
  35. function setHeadinfo(){
  36. headinfo.value = {
  37. title: '生涯唤醒学习系统',
  38. user: {
  39. avatar: '头像路径',
  40. nickName: '张三'
  41. },
  42. backUrl: '/xjc-integratedmachine/wakeup/index',
  43. backUrlUse:true,
  44. }
  45. }
  46. onMounted(() => {
  47. setHeadinfo()
  48. })
  49. function jumpTo(path) {
  50. router.push({
  51. path: path,
  52. query: {name: 123}
  53. })
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .maturity-game-page{
  58. background: url('@/assets/images/wakeup/maturity/maturity-game-bg.png') no-repeat;
  59. background-size: 1920px 1080px;
  60. z-index:10;
  61. width: 100%;
  62. height: 1080px;
  63. .page-content{
  64. width: 100%;
  65. position: absolute;
  66. top: 123px;
  67. bottom: 0;
  68. .top{
  69. width: 100%;
  70. height: 212px;
  71. display: flex;
  72. justify-content: center;
  73. margin-top: 104px;
  74. img{
  75. width: 864px;
  76. height: 212px;
  77. }
  78. }
  79. .bottom{
  80. width: 100%;
  81. height: 248px;
  82. display: flex;
  83. justify-content: space-around;
  84. margin-top:186px;
  85. img{
  86. width: 398px;
  87. height: 248px;
  88. }
  89. }
  90. }
  91. }
  92. </style>