From 34be320ee1bce1fc1943eed84ad2598e4280e948 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 23 Oct 2023 11:12:57 +0800 Subject: [PATCH] fix --- .env | 2 +- src/views/Home.vue | 125 +++++++++++++++++++++++++--- src/views/product/bank/Add.vue | 2 +- src/views/product/bank/Approve.vue | 2 +- src/views/product/bank/Config.vue | 2 +- src/views/product/insurance/Add.vue | 21 ++++- 6 files changed, 134 insertions(+), 20 deletions(-) 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(() => {