index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="wake-up-page">
  3. <head-component :headinfo=headinfo></head-component>
  4. <div class="page-content">
  5. <div class="content-text-box">
  6. <!-- <img class="head-icon" src="@/assets/images/wakeup/background-content-style.png" alt="404">-->
  7. <p>
  8. 生涯是个人有目的、连续不断的生活模式,由我们选择扮演的各种生活角色、所从事的活动组成。生涯不仅仅是职业,对我们每个人而言,最大的幸福不只是在职业上的成功,更在于一生中是否能拥有一个多彩、平衡、充盈的生涯。
  9. </p>
  10. </div>
  11. <div class="page-img-box">
  12. <div class="img-box">
  13. <img src="@/assets/images/wakeup/card1.png" @click="jumpTo('/xjc-integratedmachine/wakeup/career_recognize/index')">
  14. </div>
  15. <div class="img-box">
  16. <img src="@/assets/images/wakeup/card2.png" @click="jumpTo('/xjc-integratedmachine/wakeup/rainbow/paint')">
  17. </div>
  18. <div class="img-box">
  19. <img src="@/assets/images/wakeup/card3.png" @click="jumpTo('/xjc-integratedmachine/wakeup/rainbow/knowledge_explanation_1')">
  20. </div>
  21. <div class="img-box">
  22. <img src="@/assets/images/wakeup/card4.png" @click="jumpTo('/xjc-integratedmachine/wakeup/career_example/index')">
  23. </div>
  24. <div class="img-box">
  25. <img src="@/assets/images/wakeup/card5.png" @click="jumpTo('/xjc-integratedmachine/wakeup/career_cinema/index')">
  26. </div>
  27. </div>
  28. <div class="content-bottom">
  29. <div class="draw draggable-ball" ref="draggableBox" @touchstart.native="startDrag" :style="{ left: position.x + 'px', top: position.y + 'px' }">
  30. <img src="@/assets/images/wakeup/float-box.png" />
  31. </div>
  32. <div class="ai-rabit">
  33. <div class="ai-rabit-text">
  34. 你好,同学欢迎进入生涯学习系统
  35. </div>
  36. <img src="@/assets/images/wakeup/ai-rabit.png" />
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script setup>
  43. import headComponent from '@/views/xjc-integratedmachine/components/head_component.vue'
  44. const router = useRouter()
  45. const headinfo = ref({})
  46. // const isDragging = ref(false)
  47. const offset = ref({ x: 0, y: 0 })
  48. // const startX = ref(0)
  49. // const startY = ref(0)
  50. function setHeadinfo(){
  51. headinfo.value = {
  52. title: '生涯唤醒学习系统',
  53. user: {
  54. avatar: '头像路径',
  55. nickName: '张三'
  56. },
  57. backUrl : '/index'
  58. }
  59. }
  60. function jumpTo(path) {
  61. router.push({
  62. path: path,
  63. query: {name: 123}
  64. })
  65. }
  66. onMounted(() => {
  67. setHeadinfo()
  68. })
  69. import { reactive, onMounted } from 'vue';
  70. const position = reactive({ x: 100, y: 10 });
  71. let isDragging = false;
  72. let originX, originY;
  73. const startDrag = (e) => {
  74. console.log("e",e);
  75. // let chartDiv = document.getElementById("ring-chart");
  76. isDragging = true;
  77. originX = e.clientX - position.x;
  78. originY = e.clientY - position.y;
  79. document.addEventListener('touchmove', onMouseMove);
  80. document.addEventListener('touchend', stopDrag);
  81. };
  82. const onMouseMove = (e) => {
  83. if (isDragging) {
  84. position.x = e.clientX - originX;
  85. position.y = e.clientY - originY;
  86. }
  87. };
  88. const stopDrag = () => {
  89. isDragging = false;
  90. document.removeEventListener('touchmove', onMouseMove);
  91. document.removeEventListener('touchend', stopDrag);
  92. };
  93. const draggableBox = ref(null);
  94. let startX = 0;
  95. let startY = 0;
  96. let currentX = 0;
  97. let currentY = 0;
  98. const handleTouchStart = (event) => {
  99. startX = event.touches[0].clientX - draggableBox.value.offsetLeft;
  100. startY = event.touches[0].clientY - draggableBox.value.offsetTop;
  101. };
  102. const handleTouchMove = (event) => {
  103. currentX = event.touches[0].clientX - startX;
  104. currentY = event.touches[0].clientY - startY;
  105. draggableBox.value.style.transform = `translate3D(${currentX}px, ${currentY}px, 0)`;
  106. };
  107. const handleTouchEnd = () => {
  108. // 可以添加触摸结束后的处理逻辑,比如设置一个最终的拖拽位置等
  109. };
  110. </script>
  111. <style scoped lang="scss">
  112. .wake-up-page{
  113. background: url('@/assets/images/login/login-home-background.png') no-repeat;
  114. background-size: 1920px 1080px;
  115. z-index:10;
  116. width: 100%;
  117. height: 1080px;
  118. .page-content{
  119. width: 100%;
  120. position: absolute;
  121. top: 123px;
  122. bottom: 0;
  123. p{
  124. padding-left: 44px;
  125. padding-right: 44px;
  126. font-weight: 400;
  127. font-size: 30px;
  128. color: #333333;
  129. line-height: 52px;
  130. letter-spacing: 3px;
  131. text-indent: 2em;
  132. }
  133. }
  134. .content-text-box{
  135. width: 100%;
  136. //height: 126px;
  137. background: url('@/assets/images/wakeup/background-content-style.png') no-repeat;
  138. background-size: 1920px 126px;
  139. margin-top:23px;
  140. display: flex;
  141. align-items: center;
  142. }
  143. .page-img-box{
  144. width: 100%;
  145. display: flex;
  146. justify-content:space-around;
  147. align-items: center;
  148. margin-top: 49px;
  149. .img-box{
  150. width: 366px;
  151. height: 501px;
  152. img{
  153. width: 350px;
  154. height: 501px;
  155. }
  156. }
  157. }
  158. .content-bottom{
  159. width: 100%;
  160. //height: 37px;
  161. display: flex;
  162. justify-content: space-between;
  163. position: relative;
  164. .draw{
  165. width: 109px;
  166. height: 170px;
  167. margin-left: -76px;
  168. img{
  169. width: 109px;
  170. height: 170px;
  171. }
  172. }
  173. .ai-rabit{
  174. //width: 178px;
  175. //height: 274px;
  176. position: absolute;
  177. right: 45px;
  178. top: -50px;
  179. display: flex;
  180. //justify-content: space-between;
  181. align-items: center;
  182. .ai-rabit-text{
  183. width: 345px;
  184. height: 89px;
  185. //border: 1px solid;
  186. background: #E8EEF7;
  187. font-weight: 300;
  188. margin-bottom: 20px;
  189. font-size: 22px;
  190. color: #000000;
  191. padding:16px;
  192. border-radius: 24px 24px 24px 24px;
  193. }
  194. img{
  195. width: 178px;
  196. height: 270px;
  197. }
  198. }
  199. }
  200. }
  201. .temp{
  202. width:20vw;
  203. height: 10vh;
  204. background: #85eff5;
  205. border: solid 1px #a2fffc;
  206. border-radius: 10px;
  207. cursor: pointer;
  208. }
  209. .draggable-ball {
  210. touch-action: none;
  211. position: absolute;
  212. //width: 50px;
  213. //height: 50px;
  214. //background-color: blue;
  215. //border-radius: 50%;
  216. cursor: pointer;
  217. user-select: none; /* 防止拖拽时选中文字 */
  218. }
  219. </style>