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-09-22 16:12:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
088f283e11202686ef245c649934bbbbd33e9d99
088f283e
1 parent
f55890ab
fix(JoinFamily): 修复被踢出家庭用户仍可直接加入的问题
检查家庭是否被踢出状态,如果是则显示选择弹窗而非直接加入
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
src/pages/JoinFamily/index.vue
src/pages/JoinFamily/index.vue
View file @
088f283
...
...
@@ -128,8 +128,8 @@
<view class="flex-1">
<view class="font-medium text-gray-900 mb-1">
{{ family.name }}
<text v-if="family.is_kicked" class="text-xs text-red-500 ml-2">(被大家长移除后无法再加入)</text>
</view>
<text v-if="family.is_kicked" class="text-xs text-red-500">被大家长移除后无法再加入</text>
<view class="text-sm text-gray-600 line-clamp-2">{{ family.note }}</view>
</view>
...
...
@@ -400,22 +400,32 @@ const handleJoinFamily = async () => {
}
if (families.length === 1) {
// 只有一个家庭,直接加入
const joinFamily = await joinFamilyAPI({
family_id: families[0].id,
role: selectedRole.value
})
if (joinFamily.code) {
Taro.showToast({
title: '加入成功',
icon: 'success'
})
setTimeout(() => {
Taro.redirectTo({
url: '/pages/Dashboard/index'
})
}, 1500)
// 只有一个家庭,检查是否被踢出
const family = families[0];
if (family.is_kicked) {
// 被踢出状态,显示选择弹窗让用户知道
showFamilySelector.value = true;
mockFamilies.value = families;
} else {
// 未被踢出,直接加入
const joinFamily = await joinFamilyAPI({
family_id: family.id,
role: selectedRole.value
});
if (joinFamily.code) {
Taro.showToast({
title: '加入成功',
icon: 'success'
});
setTimeout(() => {
Taro.redirectTo({
url: '/pages/Dashboard/index'
});
}, 1500);
}
}
} else {
// 多个家庭,显示选择弹窗
...
...
Please
register
or
login
to post a comment