Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
lls_program
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-08-29 15:41:45 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
49a9ef2e5336f9cad0a2ccbd40f13ec519b4bd9d
49a9ef2e
1 parent
ac9d763f
feat(ActivitiesCover): 添加家庭状态检查逻辑
在参加活动按钮点击时检查用户是否已加入家庭 如果未加入家庭则提示并引导至欢迎页
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
src/pages/ActivitiesCover/index.vue
src/pages/ActivitiesCover/index.vue
View file @
49a9ef2
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-08-29 1
0:31:14
* @LastEditTime: 2025-08-29 1
5:39:47
* @FilePath: /lls_program/src/pages/ActivitiesCover/index.vue
* @Description: 活动海报页面 - 展示活动信息并处理定位授权
-->
...
...
@@ -71,7 +71,7 @@
class="join-button"
color="#3B82F6"
:loading="isJoining"
@click="
handle
JoinActivity"
@click="
checkFamilyStatusAnd
JoinActivity"
>
{{ hasLocationAuth ? '进入活动' : '参加活动' }}
</nut-button>
...
...
@@ -139,6 +139,7 @@ import PosterBuilder from '../../components/PosterBuilder/index.vue'
const hasLocationAuth = ref(false) // 是否已授权定位
const isJoining = ref(false) // 是否正在加入活动
const userLocation = ref({ lng: null, lat: null }) // 用户位置信息
const hasJoinedFamily = ref(false); // TODO: 是否加入家庭
// 海报生成相关状态
const show_share = ref(false) // 显示分享弹窗
...
...
@@ -241,6 +242,31 @@ const getUserLocation = async () => {
}
/**
* 检查用户是否加入家庭并处理参加活动按钮点击
*/
const checkFamilyStatusAndJoinActivity = async () => {
// Mock data: hasJoinedFamily is set to false
if (!hasJoinedFamily.value) {
Taro.showModal({
title: '提示',
content: '没有加入家庭是无法参加活动的',
cancelText: '关闭',
confirmText: '前往加入',
success: (res) => {
if (res.confirm) {
Taro.navigateTo({
url: '/pages/Welcome/index',
});
}
},
});
} else {
handleJoinActivity();
}
};
/**
* 处理参加活动按钮点击
*/
const handleJoinActivity = async () => {
...
...
Please
register
or
login
to post a comment