diff --git a/src/views/zhongchou/index.vue b/src/views/zhongchou/index.vue index dd2b5a9..679a889 100644 --- a/src/views/zhongchou/index.vue +++ b/src/views/zhongchou/index.vue @@ -306,7 +306,17 @@ const updateProgressDisplay = () => { // hkFill.style.height = `${hkProgressHeight.value}%` // } } - +const getQueryVariable = (variable) => { + const query = window.location.search.substring(1) + const vars = query.split('&') + for (let i = 0; i < vars.length; i++) { + const pair = vars[i].split('=') + if (pair[0] === variable) { + return pair[1] + } + } + return '' +} // 组件挂载时初始化 onMounted(() => { nextTick(() => { @@ -314,11 +324,13 @@ onMounted(() => { fetchActivity() updateProgressBarHeight() updateProgressDisplay() - + let token = ''; + token = getQueryVariable('token') + localStorage.setItem('localToken', token); // 添加窗口大小改变监听 window.addEventListener('resize', () => { nextTick(() => { - updateProgressBarHeight() + updateProgressBarHeight() }) }) }) @@ -1166,7 +1178,7 @@ const hideRules = () => { /* 调整手机版高度 */ right: 5px; bottom: -210px; - background-image: url('@/assets/img/zhongchou/手机周年庆装饰.png'); + background-image: url('@/assets/img/zhongchou/手机周年庆装饰.png'); /* 需要准备此图片资源 */ } @@ -1181,7 +1193,7 @@ const hideRules = () => { font-size: 0.9rem; padding: 6px 12px; max-width: 85vw; - + /* 在极小屏幕上进一步缩小 */ } }