hookehuyr

refactor: 移除未使用的首页相关文件并清理代码

删除不再使用的首页页面文件(index.vue, index.config.js, index.less)
更新app.config.js移除首页路由配置
清理auth页面和authRedirect工具中的调试代码和多余空格
/*
* @Date: 2025-06-28 10:33:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-05 23:31:55
* @LastEditTime: 2025-09-06 22:11:14
* @FilePath: /lls_program/src/app.config.js
* @Description: 文件描述
*/
export default {
pages: [
// 'pages/index/index',
'pages/Dashboard/index',
'pages/Welcome/index',
'pages/auth/index',
......
......@@ -358,7 +358,7 @@ const calculateFixedHeight = async () => {
try {
const searchHeight = await getElementHeight('.search-section')
const categoryHeight = await getElementHeight('.category-section')
searchSectionHeight.value = searchHeight
categorySectionHeight.value = categoryHeight
} catch (error) {
......
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-05 09:38:36
* @LastEditTime: 2025-09-06 22:13:30
* @FilePath: /lls_program/src/pages/auth/index.vue
* @Description: 文件描述
-->
......@@ -37,17 +37,17 @@ export default {
})
// 根据环境判断是否传递openid参数
const requestData = {
code: res.code
code: res.code,
};
// 测试环境下传递openid,正式环境不传递
if (process.env.NODE_ENV === 'development') {
requestData.openid = 'h-008';
// requestData.openid = 'h-008';
// requestData.openid = 'h-009';
// requestData.openid = 'h-010';
// requestData.openid = 'h-011';
// requestData.openid = 'h-012';
// requestData.openid = 'h-013';
requestData.openid = 'h-013';
// requestData.openid = 'oWbdFvkD5VtloC50wSNR9IWiU2q8';
// requestData.openid = 'oex8h5QZnZJto3ttvO6swSvylAQo';
}
......
export default {
navigationBarTitleText: '首页'
}
/**
* index页面样式
*/
.index {
// padding: 20px;
.nut-button {
margin-bottom: 20px;
}
}
<!--
* @Date: 2025-06-28 10:33:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-08-27 16:04:30
* @FilePath: /lls_program/src/pages/index/index.vue
* @Description: 文件描述
-->
<template>
<view class="index">
<PointsCollector ref="pointsCollectorRef" height="30vh" />
<nut-button type="success" @click="handleCollectAll" style="margin-top: 20rpx;">一键收取</nut-button>
</view>
</template>
<script setup>
import { ref } from 'vue'
import PointsCollector from '@/components/PointsCollector.vue'
import "./index.less";
const pointsCollectorRef = ref(null)
/**
* 触发积分收集组件的一键收取
*/
const handleCollectAll = () => {
if (pointsCollectorRef.value) {
pointsCollectorRef.value.collectAll()
}
}
</script>
<script>
import { getCurrentPageParam } from "@/utils/weapp";
export default {
name: "indexPage",
onHide () {
console.warn('index onHide')
},
onShareAppMessage() {
let params = getCurrentPageParam();
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: "xxx", // 默认是小程序的名称(可以写slogan等)
path: `pages/detail/index?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}&room_type=${params.room_type}`, // 默认是当前页面,必须是以'/'开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
// 转发成功之后的回调
if (res.errMsg == 'shareAppMessage:ok') {
//
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
// 来自页面内的按钮的转发
// if (options.from == 'button') {
// var eData = options.target.dataset;
// // 此处可以修改 shareObj 中的内容
// shareObj.path = '/pages/goods/goods?goodId=' + eData.id;
// }
// 返回shareObj
return shareObj;
}
};
</script>
......@@ -104,7 +104,7 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index
if (success) {
return true
}
// 如果不是最后一次重试,等待一段时间后重试
if (i < maxRetries) {
console.warn(`页面跳转重试 ${i + 1}/${maxRetries}`)
......@@ -121,15 +121,15 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index
const targetUrl = `/${savedPath}`
const isHomePage = savedPath.includes('Dashboard/index') || savedPath === 'pages/Dashboard/index'
// 尝试跳转到保存的页面
const success = await navigateWithRetry(targetUrl, isHomePage, retryCount)
if (!success) {
console.warn('跳转到保存页面失败,尝试跳转到默认页面')
// 如果跳转失败,尝试跳转到默认页面
const fallbackSuccess = await navigateWithRetry(defaultPath, true, retryCount)
if (!fallbackSuccess) {
// 最后的降级方案:使用 switchTab 跳转到首页
console.warn('所有跳转方式失败,使用 switchTab 降级方案')
......@@ -151,7 +151,7 @@ export const returnToOriginalPage = async (defaultPath = '/pages/Dashboard/index
} else {
// 没有保存的路径,直接跳转到默认页面
const success = await navigateWithRetry(defaultPath, true, retryCount)
if (!success) {
// 降级方案
console.warn('跳转到默认页面失败,使用 switchTab 降级方案')
......