diff --git a/.env b/.env
index 97571e0..0c43f01 100644
--- a/.env
+++ b/.env
@@ -2,7 +2,7 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘
VITE_PORT=9520
VITE_PROXY=http://192.168.31.125:8080
VITE_PUBLIC_PATH=./
-VITE_BASE_API=http://192.168.31.217:9000
+VITE_BASE_API=http://192.168.31.51:9000
# VITE_BASE_API=http://121.37.12.51
VITE_I18N_LOCALE=zh-cn
VITE_I18N_FALLBACK_LOCALE=zh-cn
diff --git a/src/views/Home.vue b/src/views/Home.vue
index cf1c130..d4f989e 100644
--- a/src/views/Home.vue
+++ b/src/views/Home.vue
@@ -12,7 +12,8 @@
-
+
@@ -77,6 +81,7 @@ const collected = ref
(false);
const curLevel = ref('');
const levels = ref[]>([]);
const projectId = Cookies.get('sand-projectId') ?? route.query.projectId;
+const step = 150;
// 关卡列表
const getLevel = async (only: any = '') => {
if (only) collected.value = !collected.value;
@@ -113,8 +118,14 @@ const toRole = () => {
ElMessage.error('请选择关卡!');
}
};
-const move = () => {
- window.scrollTo(0, 100);
+const move = (dir: string) => {
+ const el = document.querySelector('#wrap');
+ const param = {
+ behavior: 'smooth',
+ };
+ if (dir === 'left' || dir === 'right') param.left = el.scrollLeft + (dir === 'left' ? -150 : 150);
+ if (dir === 'up' || dir === 'down') param.top = el.scrollTop + (dir === 'up' ? -150 : 150);
+ el.scrollTo(param);
};
onMounted(() => {
getLevel();
@@ -122,11 +133,18 @@ onMounted(() => {