refactor: 清理未使用的首页副本文件并调整路由顺序
移除未使用的首页副本文件(index copy目录下的文件) 将Dashboard页面调整至Welcome页面之前 在Dashboard和ActivitiesCover页面添加家庭加入状态检查逻辑
Showing
6 changed files
with
11 additions
and
156 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-01 14:31:43 | 4 | + * @LastEditTime: 2025-09-02 15:16:41 |
| 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', | 10 | // 'pages/index/index', |
| 11 | + 'pages/Dashboard/index', | ||
| 11 | 'pages/Welcome/index', | 12 | 'pages/Welcome/index', |
| 12 | 'pages/auth/index', | 13 | 'pages/auth/index', |
| 13 | - 'pages/Dashboard/index', | ||
| 14 | 'pages/MyFamily/index', | 14 | 'pages/MyFamily/index', |
| 15 | 'pages/CreateFamily/index', | 15 | 'pages/CreateFamily/index', |
| 16 | 'pages/JoinFamily/index', | 16 | 'pages/JoinFamily/index', | ... | ... |
| 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-08-29 15:39:47 | 4 | + * @LastEditTime: 2025-09-02 15:27:05 |
| 5 | * @FilePath: /lls_program/src/pages/ActivitiesCover/index.vue | 5 | * @FilePath: /lls_program/src/pages/ActivitiesCover/index.vue |
| 6 | * @Description: 活动海报页面 - 展示活动信息并处理定位授权 | 6 | * @Description: 活动海报页面 - 展示活动信息并处理定位授权 |
| 7 | --> | 7 | --> |
| ... | @@ -139,7 +139,7 @@ import PosterBuilder from '../../components/PosterBuilder/index.vue' | ... | @@ -139,7 +139,7 @@ import PosterBuilder from '../../components/PosterBuilder/index.vue' |
| 139 | const hasLocationAuth = ref(false) // 是否已授权定位 | 139 | const hasLocationAuth = ref(false) // 是否已授权定位 |
| 140 | const isJoining = ref(false) // 是否正在加入活动 | 140 | const isJoining = ref(false) // 是否正在加入活动 |
| 141 | const userLocation = ref({ lng: null, lat: null }) // 用户位置信息 | 141 | const userLocation = ref({ lng: null, lat: null }) // 用户位置信息 |
| 142 | -const hasJoinedFamily = ref(false); // TODO: 是否加入家庭 | 142 | +const hasJoinedFamily = ref(false); |
| 143 | 143 | ||
| 144 | // 海报生成相关状态 | 144 | // 海报生成相关状态 |
| 145 | const show_share = ref(false) // 显示分享弹窗 | 145 | const show_share = ref(false) // 显示分享弹窗 |
| ... | @@ -631,6 +631,9 @@ const savePoster = () => { | ... | @@ -631,6 +631,9 @@ const savePoster = () => { |
| 631 | 631 | ||
| 632 | // 页面挂载时检查定位授权状态 | 632 | // 页面挂载时检查定位授权状态 |
| 633 | onMounted(() => { | 633 | onMounted(() => { |
| 634 | + // TODO: 是否加入家庭 | ||
| 635 | + hasJoinedFamily.value = Math.random > 0.5 ? true : false; | ||
| 636 | + // 检查定位授权弹窗 | ||
| 634 | checkLocationAuth() | 637 | checkLocationAuth() |
| 635 | }) | 638 | }) |
| 636 | </script> | 639 | </script> | ... | ... |
| ... | @@ -383,11 +383,11 @@ const initPageData = async () => { | ... | @@ -383,11 +383,11 @@ const initPageData = async () => { |
| 383 | 383 | ||
| 384 | useDidShow(() => { | 384 | useDidShow(() => { |
| 385 | // TODO: 等待真实接口获取用户是否加入家庭 | 385 | // TODO: 等待真实接口获取用户是否加入家庭 |
| 386 | - // const hasJoinedFamily = false; // Change to true to simulate having a family | 386 | + const hasJoinedFamily = Math.random() > 0.5; // Change to true to simulate having a family |
| 387 | 387 | ||
| 388 | - // if (!hasJoinedFamily) { | 388 | + if (!hasJoinedFamily) { |
| 389 | - // Taro.redirectTo({ url: '/pages/Welcome/index' }); | 389 | + Taro.redirectTo({ url: '/pages/Welcome/index' }); |
| 390 | - // } | 390 | + } |
| 391 | initPageData(); | 391 | initPageData(); |
| 392 | 392 | ||
| 393 | // TODO: 真实情况下 需要重新获取积分列表, 测试随机积分获取状态 | 393 | // TODO: 真实情况下 需要重新获取积分列表, 测试随机积分获取状态 | ... | ... |
src/pages/index copy/index.config.js
deleted
100644 → 0
src/pages/index copy/index.less
deleted
100644 → 0
src/pages/index copy/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 17:13:11 | ||
| 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 Taro from '@tarojs/taro' | ||
| 17 | -import '@tarojs/taro/html.css' | ||
| 18 | -import { ref, onMounted } from 'vue' | ||
| 19 | -import { useDidShow, useReady } from '@tarojs/taro' | ||
| 20 | -import PointsCollector from '@/components/PointsCollector.vue' | ||
| 21 | -import "./index.less"; | ||
| 22 | - | ||
| 23 | -const pointsCollectorRef = ref(null) | ||
| 24 | - | ||
| 25 | -/** | ||
| 26 | - * 触发积分收集组件的一键收取 | ||
| 27 | - */ | ||
| 28 | -const handleCollectAll = () => { | ||
| 29 | - if (pointsCollectorRef.value) { | ||
| 30 | - pointsCollectorRef.value.collectAll() | ||
| 31 | - } | ||
| 32 | -} | ||
| 33 | - | ||
| 34 | -// 生命周期钩子 | ||
| 35 | -useDidShow(() => { | ||
| 36 | - console.warn('index onShow') | ||
| 37 | -}) | ||
| 38 | - | ||
| 39 | -useReady(async () => { | ||
| 40 | - console.warn('index onReady') | ||
| 41 | - // 版本更新检查 | ||
| 42 | - if (!Taro.canIUse("getUpdateManager")) { | ||
| 43 | - Taro.showModal({ | ||
| 44 | - title: "提示", | ||
| 45 | - content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试", | ||
| 46 | - showCancel: false, | ||
| 47 | - }); | ||
| 48 | - return; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - // https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html | ||
| 52 | - const updateManager = Taro.getUpdateManager(); | ||
| 53 | - | ||
| 54 | - updateManager.onCheckForUpdate((res) => { | ||
| 55 | - // 请求完新版本信息的回调 | ||
| 56 | - if (res.hasUpdate) { | ||
| 57 | - updateManager.onUpdateReady(function () { | ||
| 58 | - Taro.showModal({ | ||
| 59 | - title: "更新提示", | ||
| 60 | - content: "新版本已经准备好,是否重启应用?", | ||
| 61 | - success: function (res) { | ||
| 62 | - if (res.confirm) { | ||
| 63 | - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
| 64 | - updateManager.applyUpdate(); | ||
| 65 | - } | ||
| 66 | - }, | ||
| 67 | - }); | ||
| 68 | - }); | ||
| 69 | - | ||
| 70 | - updateManager.onUpdateFailed(function () { | ||
| 71 | - // 新版本下载失败 | ||
| 72 | - Taro.showModal({ | ||
| 73 | - title: "更新提示", | ||
| 74 | - content: "新版本已上线,请删除当前小程序,重新搜索打开", | ||
| 75 | - }); | ||
| 76 | - }); | ||
| 77 | - } | ||
| 78 | - }); | ||
| 79 | -}) | ||
| 80 | - | ||
| 81 | -onMounted(() => { | ||
| 82 | - console.warn('index mounted') | ||
| 83 | -}) | ||
| 84 | - | ||
| 85 | -// 分享功能 | ||
| 86 | -wx.showShareMenu({ | ||
| 87 | - withShareTicket: true, | ||
| 88 | - menus: ['shareAppMessage', 'shareTimeline'] | ||
| 89 | -}) | ||
| 90 | -</script> | ||
| 91 | - | ||
| 92 | -<script> | ||
| 93 | -import { getCurrentPageParam } from "@/utils/weapp"; | ||
| 94 | - | ||
| 95 | -export default { | ||
| 96 | - name: "indexPage", | ||
| 97 | - onHide () { | ||
| 98 | - console.warn('index onHide') | ||
| 99 | - }, | ||
| 100 | - onShareAppMessage() { | ||
| 101 | - let params = getCurrentPageParam(); | ||
| 102 | - // 设置菜单中的转发按钮触发转发事件时的转发内容 | ||
| 103 | - var shareObj = { | ||
| 104 | - title: "xxx", // 默认是小程序的名称(可以写slogan等) | ||
| 105 | - path: `pages/detail/index?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}&room_type=${params.room_type}`, // 默认是当前页面,必须是以'/'开头的完整路径 | ||
| 106 | - imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4 | ||
| 107 | - success: function (res) { | ||
| 108 | - // 转发成功之后的回调 | ||
| 109 | - if (res.errMsg == 'shareAppMessage:ok') { | ||
| 110 | - // | ||
| 111 | - } | ||
| 112 | - }, | ||
| 113 | - fail: function () { | ||
| 114 | - // 转发失败之后的回调 | ||
| 115 | - if (res.errMsg == 'shareAppMessage:fail cancel') { | ||
| 116 | - // 用户取消转发 | ||
| 117 | - } else if (res.errMsg == 'shareAppMessage:fail') { | ||
| 118 | - // 转发失败,其中 detail message 为详细失败信息 | ||
| 119 | - } | ||
| 120 | - }, | ||
| 121 | - complete: function () { | ||
| 122 | - // 转发结束之后的回调(转发成不成功都会执行) | ||
| 123 | - } | ||
| 124 | - } | ||
| 125 | - // 来自页面内的按钮的转发 | ||
| 126 | - // if (options.from == 'button') { | ||
| 127 | - // var eData = options.target.dataset; | ||
| 128 | - // // 此处可以修改 shareObj 中的内容 | ||
| 129 | - // shareObj.path = '/pages/goods/goods?goodId=' + eData.id; | ||
| 130 | - // } | ||
| 131 | - // 返回shareObj | ||
| 132 | - return shareObj; | ||
| 133 | - } | ||
| 134 | -}; | ||
| 135 | -</script> |
-
Please register or login to post a comment