|
@@ -9,6 +9,7 @@ import { getScenario } from "@/features/health/hooks/health_hooks";
|
|
|
import { setFollow, setJoinData, setJoinTitle } from "@/store/long";
|
|
import { setFollow, setJoinData, setJoinTitle } from "@/store/long";
|
|
|
import Taro from "@tarojs/taro";
|
|
import Taro from "@tarojs/taro";
|
|
|
import { useTranslation } from "react-i18next";
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
|
+import { IconArrow } from "@/components/basic/Icons";
|
|
|
|
|
|
|
|
export default function LongCard(props: { join?: any, user?: any, hideJoin?: boolean, share?: any, title?: string, isFeedItem?: boolean }) {
|
|
export default function LongCard(props: { join?: any, user?: any, hideJoin?: boolean, share?: any, title?: string, isFeedItem?: boolean }) {
|
|
|
const { status, key, from, window } = props.join
|
|
const { status, key, from, window } = props.join
|
|
@@ -16,7 +17,7 @@ export default function LongCard(props: { join?: any, user?: any, hideJoin?: boo
|
|
|
const user = useSelector((state: any) => state.user);
|
|
const user = useSelector((state: any) => state.user);
|
|
|
const long = useSelector((state: any) => state.long);
|
|
const long = useSelector((state: any) => state.long);
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
- const {t} = useTranslation()
|
|
|
|
|
|
|
+ const { t } = useTranslation()
|
|
|
let type = 0
|
|
let type = 0
|
|
|
function join(e) {
|
|
function join(e) {
|
|
|
if (process.env.TARO_ENV == 'weapp') {
|
|
if (process.env.TARO_ENV == 'weapp') {
|
|
@@ -35,7 +36,7 @@ export default function LongCard(props: { join?: any, user?: any, hideJoin?: boo
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (window == 'ACTIVE' || window == 'EAT') {
|
|
if (window == 'ACTIVE' || window == 'EAT') {
|
|
|
- jumpPage(`/_record/pages/log_record?scenario=${window=='EAT'?'MEAL':'ACTIVITY'}&join_id=${key}`)
|
|
|
|
|
|
|
+ jumpPage(`/_record/pages/log_record?scenario=${window == 'EAT' ? 'MEAL' : 'ACTIVITY'}&join_id=${key}`)
|
|
|
// jumpPage(`/_health/pages/add_moment?join_id=${key}&is_temp=${true}&window=${window}&title=${props.title ?? long.title}`)
|
|
// jumpPage(`/_health/pages/add_moment?join_id=${key}&is_temp=${true}&window=${window}&title=${props.title ?? long.title}`)
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
@@ -50,7 +51,7 @@ export default function LongCard(props: { join?: any, user?: any, hideJoin?: boo
|
|
|
// }
|
|
// }
|
|
|
jumpPage(`/_record/pages/time_record?scenario=${window}&join_id=${key}`)
|
|
jumpPage(`/_record/pages/time_record?scenario=${window}&join_id=${key}`)
|
|
|
}
|
|
}
|
|
|
- else if (window=='SLEEP'){
|
|
|
|
|
|
|
+ else if (window == 'SLEEP') {
|
|
|
jumpPage(`/_record/pages/time_record?scenario=${window}&join_id=${key}`)
|
|
jumpPage(`/_record/pages/time_record?scenario=${window}&join_id=${key}`)
|
|
|
// if (getScenario(health.windows, 'SLEEP').status == 'WFS') {
|
|
// if (getScenario(health.windows, 'SLEEP').status == 'WFS') {
|
|
|
// //jumpPage(`/_health/pages/log_time?index=${health.mode == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${health.mode}&op_page=${health.mode == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`)
|
|
// //jumpPage(`/_health/pages/log_time?index=${health.mode == 'FAST' ? 0 : 1}&single=1&is_start=1&window=${health.mode}&op_page=${health.mode == 'FAST' ? 'HOME_FAST' : 'HOME_SLEEP'}`)
|
|
@@ -98,7 +99,7 @@ export default function LongCard(props: { join?: any, user?: any, hideJoin?: boo
|
|
|
return <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
return <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
|
{
|
|
{
|
|
|
props.join.users.map((item, index) => {
|
|
props.join.users.map((item, index) => {
|
|
|
- if (index > 4) return
|
|
|
|
|
|
|
+ // if (index > 4) return
|
|
|
return <Image className="long_avatar" mode="aspectFill" style={{
|
|
return <Image className="long_avatar" mode="aspectFill" style={{
|
|
|
zIndex: 10 - index,
|
|
zIndex: 10 - index,
|
|
|
marginLeft: index == 0 ? 0 : -rpxToPx(20)
|
|
marginLeft: index == 0 ? 0 : -rpxToPx(20)
|
|
@@ -106,79 +107,30 @@ export default function LongCard(props: { join?: any, user?: any, hideJoin?: boo
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
{/* <View className="long_avatar"></View> */}
|
|
{/* <View className="long_avatar"></View> */}
|
|
|
- <View className="h26" style={{ marginLeft: rpxToPx(6) }}>{props.join.users.length > 5 ? `+${props.join.users.length - 5} more ` : ''}</View>
|
|
|
|
|
|
|
+ {/* <View className="h26" style={{ marginLeft: rpxToPx(6) }}>{props.join.users.length > 5 ? `+${props.join.users.length - 5} more ` : ''}</View> */}
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (from)
|
|
|
|
|
- return <View onClick={goDetail} className="long_card_bg" style={{
|
|
|
|
|
- flexDirection: 'column',
|
|
|
|
|
- paddingTop: rpxToPx(18),
|
|
|
|
|
- paddingBottom: rpxToPx(18)
|
|
|
|
|
- }}>
|
|
|
|
|
- <View className="h20 g02" style={{ marginBottom: rpxToPx(6) }}>{t('health.join2')}</View>
|
|
|
|
|
- <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
|
|
|
- <View className="h26" style={{ marginRight: rpxToPx(8) }}>{from.nickname}</View>
|
|
|
|
|
- {
|
|
|
|
|
- users()
|
|
|
|
|
- }
|
|
|
|
|
- <View style={{ flex: 1 }} />
|
|
|
|
|
- {
|
|
|
|
|
- status == 'JOIN' && <View className="h26 bold" style={{ color: MainColorType.link,padding:5,marginRight:-5 }} onClick={join}>{t('health.join')}</View>
|
|
|
|
|
- }
|
|
|
|
|
- {
|
|
|
|
|
- status == 'SHARE' && <ShareBtn onClick={share} hideShare={props.isFeedItem}>
|
|
|
|
|
- <Image src={require('@assets/_health/wechat.png')} style={{ width: rpxToPx(44), height: rpxToPx(44) }} />
|
|
|
|
|
- {/* <View className="h26 bold" style={{ color: MainColorType.success }} >邀请好友加入</View> */}
|
|
|
|
|
- </ShareBtn>
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- </View>
|
|
|
|
|
- </View>
|
|
|
|
|
if (status == 'JOIN')
|
|
if (status == 'JOIN')
|
|
|
- return <View onClick={goDetail} className="long_card_bg long_card_begin">
|
|
|
|
|
|
|
+ return <View onClick={goDetail} style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', marginTop: rpxToPx(24) }}>
|
|
|
{
|
|
{
|
|
|
(props.join && props.join.user_count == 0) && <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
(props.join && props.join.user_count == 0) && <View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
|
<Image className="long_avatar" mode="aspectFill" style={{
|
|
<Image className="long_avatar" mode="aspectFill" style={{
|
|
|
marginRight: rpxToPx(6)
|
|
marginRight: rpxToPx(6)
|
|
|
}} src={props.join.user.avatar} />
|
|
}} src={props.join.user.avatar} />
|
|
|
- <View className="h26 g02">{t('health.call_me_join',{name:props.join.user.nickname})}</View>
|
|
|
|
|
|
|
+
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
{
|
|
{
|
|
|
props.join && props.join.user_count > 0 && users()
|
|
props.join && props.join.user_count > 0 && users()
|
|
|
}
|
|
}
|
|
|
- <View className="h26 bold" style={{ color: MainColorType.link,padding:15,marginRight:-15 }} onClick={join}>{t('health.join')}</View>
|
|
|
|
|
|
|
+ <View className="h24">在跟卡</View>
|
|
|
|
|
+ <IconArrow width={rpxToPx(24)} color={MainColorType.g02}/>
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
if (status == 'SHARE') {
|
|
if (status == 'SHARE') {
|
|
|
- if (!props.join || props.join.user_count == 0) {
|
|
|
|
|
- return <View onClick={goDetail} className="long_card_bg long_card_begin" style={{ alignItems: 'center',paddingLeft:rpxToPx(14) }}>
|
|
|
|
|
- <ShareBtn onClick={share} hideShare={props.isFeedItem}>
|
|
|
|
|
- <View style={{
|
|
|
|
|
- display: 'flex', flexDirection: 'row',
|
|
|
|
|
- alignItems: 'center', justifyContent: 'center'
|
|
|
|
|
- }}>
|
|
|
|
|
- <View style={{ width: rpxToPx(80),marginRight:rpxToPx(10), display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
|
|
|
- <Image src={require('@assets/_health/wechat.png')} style={{ width: rpxToPx(44), height: rpxToPx(44) }} />
|
|
|
|
|
- </View>
|
|
|
|
|
-
|
|
|
|
|
- <View className="h26 bold" style={{ color: MainColorType.success }} >{t('health.call_friends_join')}</View>
|
|
|
|
|
- </View>
|
|
|
|
|
-
|
|
|
|
|
- </ShareBtn>
|
|
|
|
|
- </View>
|
|
|
|
|
- }
|
|
|
|
|
- return <View onClick={goDetail} className="long_card_bg long_card_begin">
|
|
|
|
|
- {
|
|
|
|
|
- props.join && props.join.user_count > 0 && users()
|
|
|
|
|
- }
|
|
|
|
|
- <ShareBtn onClick={share} hideShare={props.isFeedItem}>
|
|
|
|
|
- <Image src={require('@assets/_health/wechat.png')} style={{ width: rpxToPx(44), height: rpxToPx(44) }} />
|
|
|
|
|
- {/* <View className="h26 bold" style={{ color: MainColorType.success }} >邀请好友加入</View> */}
|
|
|
|
|
- </ShareBtn>
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ return <View />
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return <View />
|
|
return <View />
|