refactor: 移除未使用的首页相关文件并清理代码
删除不再使用的首页页面文件(index.vue, index.config.js, index.less) 更新app.config.js移除首页路由配置 清理auth页面和authRedirect工具中的调试代码和多余空格
Showing
7 changed files
with
11 additions
and
100 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2025-06-28 10:33:00 | 2 | * @Date: 2025-06-28 10:33:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-09-05 23:31:55 | 4 | + * @LastEditTime: 2025-09-06 22:11:14 |
| 5 | * @FilePath: /lls_program/src/app.config.js | 5 | * @FilePath: /lls_program/src/app.config.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| 8 | export default { | 8 | export default { |
| 9 | pages: [ | 9 | pages: [ |
| 10 | - // 'pages/index/index', | ||
| 11 | 'pages/Dashboard/index', | 10 | 'pages/Dashboard/index', |
| 12 | 'pages/Welcome/index', | 11 | 'pages/Welcome/index', |
| 13 | 'pages/auth/index', | 12 | 'pages/auth/index', | ... | ... |
| ... | @@ -358,7 +358,7 @@ const calculateFixedHeight = async () => { | ... | @@ -358,7 +358,7 @@ const calculateFixedHeight = async () => { |
| 358 | try { | 358 | try { |
| 359 | const searchHeight = await getElementHeight('.search-section') | 359 | const searchHeight = await getElementHeight('.search-section') |
| 360 | const categoryHeight = await getElementHeight('.category-section') | 360 | const categoryHeight = await getElementHeight('.category-section') |
| 361 | - | 361 | + |
| 362 | searchSectionHeight.value = searchHeight | 362 | searchSectionHeight.value = searchHeight |
| 363 | categorySectionHeight.value = categoryHeight | 363 | categorySectionHeight.value = categoryHeight |
| 364 | } catch (error) { | 364 | } catch (error) { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-09-05 09:38:36 | 4 | + * @LastEditTime: 2025-09-06 22:13:30 |
| 5 | * @FilePath: /lls_program/src/pages/auth/index.vue | 5 | * @FilePath: /lls_program/src/pages/auth/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -37,17 +37,17 @@ export default { | ... | @@ -37,17 +37,17 @@ export default { |
| 37 | }) | 37 | }) |
| 38 | // 根据环境判断是否传递openid参数 | 38 | // 根据环境判断是否传递openid参数 |
| 39 | const requestData = { | 39 | const requestData = { |
| 40 | - code: res.code | 40 | + code: res.code, |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | // 测试环境下传递openid,正式环境不传递 | 43 | // 测试环境下传递openid,正式环境不传递 |
| 44 | if (process.env.NODE_ENV === 'development') { | 44 | if (process.env.NODE_ENV === 'development') { |
| 45 | - requestData.openid = 'h-008'; | 45 | + // requestData.openid = 'h-008'; |
| 46 | // requestData.openid = 'h-009'; | 46 | // requestData.openid = 'h-009'; |
| 47 | // requestData.openid = 'h-010'; | 47 | // requestData.openid = 'h-010'; |
| 48 | // requestData.openid = 'h-011'; | 48 | // requestData.openid = 'h-011'; |
| 49 | // requestData.openid = 'h-012'; | 49 | // requestData.openid = 'h-012'; |
| 50 | - // requestData.openid = 'h-013'; | 50 | + requestData.openid = 'h-013'; |
| 51 | // requestData.openid = 'oWbdFvkD5VtloC50wSNR9IWiU2q8'; | 51 | // requestData.openid = 'oWbdFvkD5VtloC50wSNR9IWiU2q8'; |
| 52 | // requestData.openid = 'oex8h5QZnZJto3ttvO6swSvylAQo'; | 52 | // requestData.openid = 'oex8h5QZnZJto3ttvO6swSvylAQo'; |
| 53 | } | 53 | } | ... | ... |
src/pages/index/index.config.js
deleted
100644 → 0
src/pages/index/index.less
deleted
100644 → 0
src/pages/index/index.vue
deleted
100644 → 0
| 1 | -<!-- | ||
| 2 | - * @Date: 2025-06-28 10:33:00 | ||
| 3 | - * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | - * @LastEditTime: 2025-08-27 16:04:30 | ||
| 5 | - * @FilePath: /lls_program/src/pages/index/index.vue | ||
| 6 | - * @Description: 文件描述 | ||
| 7 | ---> | ||
| 8 | -<template> | ||
| 9 | - <view class="index"> | ||
| 10 | - <PointsCollector ref="pointsCollectorRef" height="30vh" /> | ||
| 11 | - <nut-button type="success" @click="handleCollectAll" style="margin-top: 20rpx;">一键收取</nut-button> | ||
| 12 | - </view> | ||
| 13 | -</template> | ||
| 14 | - | ||
| 15 | -<script setup> | ||
| 16 | -import { ref } from 'vue' | ||
| 17 | -import PointsCollector from '@/components/PointsCollector.vue' | ||
| 18 | -import "./index.less"; | ||
| 19 | - | ||
| 20 | -const pointsCollectorRef = ref(null) | ||
| 21 | - | ||
| 22 | -/** | ||
| 23 | - * 触发积分收集组件的一键收取 | ||
| 24 | - */ | ||
| 25 | -const handleCollectAll = () => { | ||
| 26 | - if (pointsCollectorRef.value) { | ||
| 27 | - pointsCollectorRef.value.collectAll() | ||
| 28 | - } | ||
| 29 | -} | ||
| 30 | -</script> | ||
| 31 | - | ||
| 32 | -<script> | ||
| 33 | -import { getCurrentPageParam } from "@/utils/weapp"; | ||
| 34 | - | ||
| 35 | -export default { | ||
| 36 | - name: "indexPage", | ||
| 37 | - onHide () { | ||
| 38 | - console.warn('index onHide') | ||
| 39 | - }, | ||
| 40 | - onShareAppMessage() { | ||
| 41 | - let params = getCurrentPageParam(); | ||
| 42 | - // 设置菜单中的转发按钮触发转发事件时的转发内容 | ||
| 43 | - var shareObj = { | ||
| 44 | - title: "xxx", // 默认是小程序的名称(可以写slogan等) | ||
| 45 | - path: `pages/detail/index?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}&room_type=${params.room_type}`, // 默认是当前页面,必须是以'/'开头的完整路径 | ||
| 46 | - imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 | ||
| 47 | - success: function (res) { | ||
| 48 | - // 转发成功之后的回调 | ||
| 49 | - if (res.errMsg == 'shareAppMessage:ok') { | ||
| 50 | - // | ||
| 51 | - } | ||
| 52 | - }, | ||
| 53 | - fail: function () { | ||
| 54 | - // 转发失败之后的回调 | ||
| 55 | - if (res.errMsg == 'shareAppMessage:fail cancel') { | ||
| 56 | - // 用户取消转发 | ||
| 57 | - } else if (res.errMsg == 'shareAppMessage:fail') { | ||
| 58 | - // 转发失败,其中 detail message 为详细失败信息 | ||
| 59 | - } | ||
| 60 | - }, | ||
| 61 | - complete: function () { | ||
| 62 | - // 转发结束之后的回调(转发成不成功都会执行) | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | - // 来自页面内的按钮的转发 | ||
| 66 | - // if (options.from == 'button') { | ||
| 67 | - // var eData = options.target.dataset; | ||
| 68 | - // // 此处可以修改 shareObj 中的内容 | ||
| 69 | - // shareObj.path = '/pages/goods/goods?goodId=' + eData.id; | ||
| 70 | - // } | ||
| 71 | - // 返回shareObj | ||
| 72 | - return shareObj; | ||
| 73 | - } | ||
| 74 | -}; | ||
| 75 | -</script> |
| ... | @@ -104,7 +104,7 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index | ... | @@ -104,7 +104,7 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index |
| 104 | if (success) { | 104 | if (success) { |
| 105 | return true | 105 | return true |
| 106 | } | 106 | } |
| 107 | - | 107 | + |
| 108 | // 如果不是最后一次重试,等待一段时间后重试 | 108 | // 如果不是最后一次重试,等待一段时间后重试 |
| 109 | if (i < maxRetries) { | 109 | if (i < maxRetries) { |
| 110 | console.warn(`页面跳转重试 ${i + 1}/${maxRetries}`) | 110 | console.warn(`页面跳转重试 ${i + 1}/${maxRetries}`) |
| ... | @@ -121,15 +121,15 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index | ... | @@ -121,15 +121,15 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index |
| 121 | 121 | ||
| 122 | const targetUrl = `/${savedPath}` | 122 | const targetUrl = `/${savedPath}` |
| 123 | const isHomePage = savedPath.includes('Dashboard/index') || savedPath === 'pages/Dashboard/index' | 123 | const isHomePage = savedPath.includes('Dashboard/index') || savedPath === 'pages/Dashboard/index' |
| 124 | - | 124 | + |
| 125 | // 尝试跳转到保存的页面 | 125 | // 尝试跳转到保存的页面 |
| 126 | const success = await navigateWithRetry(targetUrl, isHomePage, retryCount) | 126 | const success = await navigateWithRetry(targetUrl, isHomePage, retryCount) |
| 127 | - | 127 | + |
| 128 | if (!success) { | 128 | if (!success) { |
| 129 | console.warn('跳转到保存页面失败,尝试跳转到默认页面') | 129 | console.warn('跳转到保存页面失败,尝试跳转到默认页面') |
| 130 | // 如果跳转失败,尝试跳转到默认页面 | 130 | // 如果跳转失败,尝试跳转到默认页面 |
| 131 | const fallbackSuccess = await navigateWithRetry(defaultPath, true, retryCount) | 131 | const fallbackSuccess = await navigateWithRetry(defaultPath, true, retryCount) |
| 132 | - | 132 | + |
| 133 | if (!fallbackSuccess) { | 133 | if (!fallbackSuccess) { |
| 134 | // 最后的降级方案:使用 switchTab 跳转到首页 | 134 | // 最后的降级方案:使用 switchTab 跳转到首页 |
| 135 | console.warn('所有跳转方式失败,使用 switchTab 降级方案') | 135 | console.warn('所有跳转方式失败,使用 switchTab 降级方案') |
| ... | @@ -151,7 +151,7 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index | ... | @@ -151,7 +151,7 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index |
| 151 | } else { | 151 | } else { |
| 152 | // 没有保存的路径,直接跳转到默认页面 | 152 | // 没有保存的路径,直接跳转到默认页面 |
| 153 | const success = await navigateWithRetry(defaultPath, true, retryCount) | 153 | const success = await navigateWithRetry(defaultPath, true, retryCount) |
| 154 | - | 154 | + |
| 155 | if (!success) { | 155 | if (!success) { |
| 156 | // 降级方案 | 156 | // 降级方案 |
| 157 | console.warn('跳转到默认页面失败,使用 switchTab 降级方案') | 157 | console.warn('跳转到默认页面失败,使用 switchTab 降级方案') | ... | ... |
-
Please register or login to post a comment