diff --git a/src/pages/family/detail.module.scss b/src/pages/family/detail.module.scss index 2d3986c..0a80408 100644 --- a/src/pages/family/detail.module.scss +++ b/src/pages/family/detail.module.scss @@ -74,6 +74,42 @@ margin-top: 24px; } +// 邀请行:与 ListRow 同款外观,但右侧为 open-type=share 的原生 Button(触发转发面板) +.shareRow { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 104px; + padding: 0 32px; + background: $color-bg-white; + border-bottom: 1px solid $color-border; +} + +.shareLabel { + font-size: 30px; + color: $color-text; +} + +// 清除小程序 Button 原生样式(边框/底色/行高),仅保留命中区 +.shareBtn { + margin: 0; + padding: 0; + width: auto; + min-width: 0; + background: transparent; + border: none; + line-height: inherit; + + &::after { + border: none; + } +} + +.shareArrow { + font-size: 36px; + color: $color-text-placeholder; +} + .sectionTitle { display: block; font-size: 26px; diff --git a/src/pages/family/detail.tsx b/src/pages/family/detail.tsx index 3e81eae..6653253 100644 --- a/src/pages/family/detail.tsx +++ b/src/pages/family/detail.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' -import { useRouter, useDidShow } from '@tarojs/taro' -import { View, Text } from '@tarojs/components' +import { useRouter, useDidShow, useShareAppMessage } from '@tarojs/taro' +import { View, Text, Button } from '@tarojs/components' import { Navbar } from '@/components/navbar' import { Loading } from '@/components/loading' import { StateView } from '@/components/state-view' @@ -59,6 +59,12 @@ export default function FamilyDetail() { load() }) + // 邀请分享:接收方从分享卡进入本页后点「加入」走 joinHome(code) + useShareAppMessage(() => ({ + title: `邀请你加入家庭圈「${family?.name ?? ''}」`, + path: `${ROUTES.FAMILY_DETAIL}?id=${familyId}&invite=1` + })) + const addCared = () => { navigateTo(`${ROUTES.FAMILY_CONTACT_ADD}?familyId=${familyId}`) } @@ -153,7 +159,16 @@ export default function FamilyDetail() { - + {/* open-type=share 触发右上角同款转发面板;Button 原生样式清除交由 shareBtn 样式接管 */} + + 邀请他人 + +