leon 1 vuosi sitten
vanhempi
commit
22e28407b1

+ 17 - 0
src/_moment/pages/relation.scss

@@ -0,0 +1,17 @@
+.relation_item {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    height: 138px;
+    padding-left: 40px;
+    padding-right: 40px;
+    box-sizing: border-box;
+    width: 750px;
+}
+
+.relation_avatar{
+    margin-right: 24px;
+    width: 86px;
+    height: 86px;
+    border-radius: 43px;
+}

+ 132 - 3
src/_moment/pages/relation.tsx

@@ -1,5 +1,134 @@
-import { View } from "@tarojs/components";
+import { MainColorType } from "@/context/themes/color";
+import { getMyFollowers, getMyFollowings, getMyFriends } from "@/services/friend";
+import { View, Image, Text } from "@tarojs/components";
+import { useEffect, useState } from "react";
+import './relation.scss'
+import NewButton, { NewButtonType } from "@/_health/base/new_button";
+import { rpxToPx } from "@/utils/tools";
+import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
+import { IconArrow } from "@/components/basic/Icons";
+
+export default function Relation() {
+    const [count, setCount] = useState(0)
+    const [count2, setCount2] = useState(0)
+    const [count3, setCount3] = useState(0)
+    const [friends, setFriends] = useState<any>([])
+    const [followers, setFollowers] = useState<any>([])
+    const [followings, setFollowings] = useState<any>([])
+    const [index, setIndex] = useState(0)
+
+    useEffect(() => {
+        getRelation()
+        getFollowers()
+        getFollowings()
+    }, [])
+
+    function getRelation() {
+        getMyFriends({
+            page: 1,
+            limit: 20
+        }).then(res => {
+            console.log(res)
+            setCount((res as any).total)
+            setFriends((res as any).data)
+        })
+    }
+    function getFollowers() {
+        getMyFollowers({
+            page: 1,
+            limit: 20
+        }).then(res => {
+            console.log(res)
+            setCount2((res as any).total)
+            setFollowers((res as any).data)
+        })
+    }
+    function getFollowings() {
+        getMyFollowings({
+            page: 1,
+            limit: 20
+        }).then(res => {
+            console.log(res)
+            setCount3((res as any).total)
+            setFollowings((res as any).data)
+        })
+    }
+
+    function friendsList() {
+        return <View>
+            {/* <View>好友数量{count}</View> */}
+            {
+                friends.map((item, index) => {
+                    return followItem(item, index * 1000)
+                })
+            }
+        </View>
+    }
+
+    function followerList() {
+        return <View>
+            {/* <View>我的关注{count2}</View> */}
+            {
+                followers.map((item, index) => {
+                    return followItem(item, index * 1000)
+                })
+            }
+        </View>
+    }
+
+    function followingList() {
+        return <View>
+            {/* <View>我的粉丝{count3}</View> */}
+            {
+                followings.map((item, index) => {
+                    return followItem(item, index)
+                })
+            }
+        </View>
+    }
+
+    function followItem(item, index) {
+        return <View key={index} className="relation_item" onClick={()=>{
+            jumpPage('./home')
+        }}>
+            <Image src={item.avatar} className="relation_avatar" />
+            <Text className="h34" style={{ color: MainColorType.link, flex: 1 }}>{item.nickname}</Text>
+            {/* <Text>{item.relation}</Text> */}
+            {
+                item.relation == 'FRIEND' && <Text className="h30 g02">Friend</Text>
+            }
+            {
+                item.relation == 'FOLLOWING' && <Text className="h30 g02">Following</Text>
+            }
+            {
+                item.relation == 'FOLLOWER' && <NewButton 
+                    title="Follow"
+                    type={NewButtonType.alpha}
+                    color={MainColorType.blue}
+                    width={rpxToPx(136)}
+                    height={rpxToPx(72)}
+                />
+            }
+            <IconArrow width={rpxToPx(34)} color={MainColorType.g02} />
+        </View>
+    }
+
+    return <View style={{ backgroundColor: '#fff', minHeight: '100vh' }}>
+        <View style={{ display: 'flex', flexDirection: 'row', height: 50 }}>
+            <View style={{ flex: 1, color: index == 0 ? '#000' : MainColorType.g02, textAlign: 'center' }} onClick={() => { setIndex(0) }}>搭子</View>
+            <View style={{ flex: 1, color: index == 1 ? '#000' : MainColorType.g02, textAlign: 'center' }} onClick={() => { setIndex(1) }}>关注</View>
+            <View style={{ flex: 1, color: index == 2 ? '#000' : MainColorType.g02, textAlign: 'center' }} onClick={() => { setIndex(2) }}>粉丝</View>
+        </View>
+
+        {
+            index == 0 && friendsList()
+        }
+        {
+            index == 1 && followingList()
+        }
+        {
+            index == 2 && followerList()
+        }
+    </View>
 
-export default function Relation(){
-    return <View></View>
 }

+ 1 - 1
src/components/navigation/TabBar.tsx

@@ -63,7 +63,7 @@ export default function Component(props: { index: number }) {
         </View>
         <View className={selIndex == 4 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(4)}>
             <Image className='tabbar-icon' src={selIndex == 4 ? require('@assets/_health/user_sel.png') : require('@assets/_health/user.png')} />
-            <View className={selIndex == 4 ? 'tabbar-item-text-sel' : 'tabbar-item-text'}>{t('health.friends')}</View>
+            <View className={selIndex == 4 ? 'tabbar-item-text-sel' : 'tabbar-item-text'}>{t('health.moments')}</View>
         </View>
         <View className={selIndex == 1 ? 'tabbar-item tabbar-item-sel' : 'tabbar-item'} onClick={() => switchTab(1)}>
             <Image className='tabbar-icon' src={selIndex == 1 ? require('@assets/_health/compass_sel.png') : require('@assets/_health/compass.png')} />

+ 4 - 0
src/context/locales/en.js

@@ -1223,5 +1223,9 @@ export default {
         reminder_confirm: 'Activate',
 
         friends:'Friends',
+        moments:'Moments',
+        my_moments:'My Moments',
+        my_friends:'My Friends',
+        notification:'Notifications',
     }
 }

+ 4 - 0
src/context/locales/zh.js

@@ -1224,5 +1224,9 @@ export default {
         reminder_confirm:'前往激活',
 
         friends:'搭子圈',
+        moments:'搭子圈',
+        my_moments:'我的主页',
+        my_friends:'我的搭子',
+        notification:'消息通知',
     }
 }

+ 1 - 1
src/pages/discover/discover.config.ts

@@ -1,6 +1,6 @@
 export default definePageConfig({
     // "disableScroll": false,
-    // "navigationBarTitleText":"",
+    "navigationBarTitleText":"",
     // "enablePullDownRefresh":true,
     "navigationBarBackgroundColor":"#f5f5f5"
     // "enablePageMeta":true

+ 52 - 212
src/pages/friend/friend.tsx

@@ -10,241 +10,81 @@ import { followUser, getFriendDashBoard, getFriendMoments, getMyFriends, getUser
 import FriendGuide from "./guide";
 import EmptyContent from "./empty_content";
 import MomentItem from "./moment_item";
+import { useTranslation } from "react-i18next";
+import { windows } from "@/services/health";
+import { setFastWithSleep, setFinishSetup, setLongFast, setRefreshs, setWindows } from "@/store/health";
+import { getInfoSuccess } from "@/store/user";
+import FriendMain from "./friend_main";
 
-let useRoute;
-let useNavigation;
-if (process.env.TARO_ENV == 'rn') {
-    useRoute = require("@react-navigation/native").useRoute
-    useNavigation = require("@react-navigation/native").useNavigation
-}
 
-let timer;
 export default function Friend() {
+    const dispatch = useDispatch();
     const user = useSelector((state: any) => state.user);
-    const launchObj = Taro.getLaunchOptionsSync()
-
-    const observerObjBottom = Taro.createIntersectionObserver().relativeToViewport({ bottom: 100 })
-
-    const [friends, setFriends] = useState<any>([])
-    const [count, setCount] = useState(0)
-
-    const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
-    const navigationBarHeight = systemInfo.statusBarHeight + 44;
-
-    let router
-    let navigation;
-    if (useNavigation) {
-        navigation = useNavigation()
-    }
-
-    if (process.env.TARO_ENV == 'rn') {
-        router = useRoute()
-    }
-    else {
-        router = useRouter()
-    }
-
     const [loaded, setLoaded] = useState(false)
-    const [homeType, setHomeType] = useState('NO_FRIEND')
-    const [dashBoard, setDashBoard] = useState<any>(null)
-    const [moments, setMoments] = useState<any>([])
 
     useEffect(() => {
-        timer = setInterval(() => {
-            setCount(count => count + 1)
-        }, 1000)
-        return () => {
-            clearInterval(timer)
+        if (process.env.TARO_ENV == 'weapp') {
+            loadWXCache()
+        }
+        else {
+            loadRNCache()
         }
     }, [])
 
-
     useEffect(() => {
-        myFriends()
-        if (router.params.type == 'share') {
-            console.log('b', launchObj.shareTicket)
-            if (launchObj.shareTicket) {
-                Taro.getShareInfo({
-                    shareTicket: launchObj.shareTicket,
-                    success(result) {
-                        console.log('share info', result)
-                        updateRelation(result)
-                    },
-                })
-            }
-            else {
-                updateRelation(null)
-            }
-        }
-        console.log('c')
+        getWindows()
     }, [user.isLogin])
 
-    function myFriends() {
-        if (!user.isLogin) {
-            setLoaded(true)
-            return
-        }
-        getMyFriends({
-            page: 1,
-            limit: 10
-        }).then(res => {
-            console.log(res)
-            setCount((res as any).total)
-            setFriends((res as any).data)
-        })
-
-        getFriendDashBoard().then(res => {
-            setLoaded(true)
-            setHomeType((res as any).homepage_type)
-            setDashBoard(res)
-        })
-
-        getFriendMoments({
-            page: 1,
-            limit: 50
-        }).then(res => {
-            setMoments((res as any).data)
+    function getWindows() {
+        windows().then(res => {
+            dispatch(setFastWithSleep((res as any).fast_with_sleep))
+            dispatch(setWindows((res as any).windows))
+            dispatch(setLongFast((res as any).long_fast))
+            dispatch(setRefreshs((res as any).refresh_timestamps))
+            dispatch(setFinishSetup((res as any).finish_setup))
+        }).catch(e => {
         })
     }
 
-    function updateRelation(obj) {
-        if (!user.isLogin) {
-            Taro.setStorageSync('share_uid', router.params.uid)
-            Taro.setStorageSync('share_info', JSON.stringify(obj))
-            return
+    function loadWXCache() {
+        var gps = Taro.getStorageSync('gps')
+        if (gps) {
+            global.locationDetail = JSON.parse(gps)
         }
-        console.log('user login')
-        if (user.id != router.params.uid) {
-            var params: any = {
-                follow_origin: obj ? 'WECHAT_GROUP_CHAT' : 'WECHAT_PRIVATE_CHAT'
-            }
-            if (obj) {
-                params.wechat = obj
-            }
-            followUser(router.params.uid, params).then(res => {
-                myFriends()
-            })
+        global.memberAlert = Taro.getStorageSync('memberAlert') || false
+        var userData = Taro.getStorageSync('userData')
+        if (userData) {
+            console.log('load user cache')
+            dispatch(getInfoSuccess(JSON.parse(userData)));
         }
+        setLoaded(true)
     }
 
-
-    useEffect(() => {
-        // observerObjBottom.observe('#a', (res) => {
-        //     console.log('a')
-        // })
-        // observerObjBottom.observe('#b', (res) => {
-        //     console.log('b')
-        // })
-        // observerObjBottom.observe('#c', (res) => {
-        //     console.log('c')
-        // })
-        // observerObjBottom.observe('#d', (res) => {
-        //     console.log('d')
-        // })
-        observerObjBottom.observe('#e', (res) => {
-            console.log('e')
-        })
-    }, [])
-
-    if (process.env.TARO_ENV == 'weapp' /*&& global.allowShare*/) {
-        Taro.updateShareMenu({
-            withShareTicket: true,
-            success() { }
-        })
-
-        useShareAppMessage((e) => {
-            var sharePath = ``
-            if (global.shareData) {
-                console.log(global.shareData)
-            }
-            console.log('share_url', '/pages/friend/friend?type=share&uid=' + user.id)
-            return {
-                title: 'Friends ',
-                path: '/pages/friend/friend?type=share&uid=' + user.id,
-                // imageUrl: imageUrl
-            }
-        })
-    }
-
-    function friendGuide() {
-        return <View>
-            <View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
-            <FriendGuide />
-            {
-                process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
-            }</View>
-    }
-
-    function empty() {
-        return <View>
-            <View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
-            <EmptyContent friends={dashBoard.friends} />
-            {
-                process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
-            }
-        </View>
-    }
-
-    function content() {
-        if (!loaded) {
-            return <View >
-                {
-                    process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
-                }
-            </View>
+    async function loadRNCache() {
+        var showDayRing = await getStorage('showDayRing') || false;
+        var showNightRing = await getStorage('showNightRing') || false;
+        global.memberAlert = await getStorage('memberAlert') || false
+        var gps = await getStorage('gps')
+        if (gps) {
+            global.locationDetail = JSON.parse(gps)
         }
-        if (!user.isLogin) {
-            return friendGuide()
-        }
-        switch (homeType) {
-            case 'NO_FRIEND':
-                return friendGuide()
-            case 'NO_MOMENT':
-                return empty()
-
+        var userData = await getStorage('userData')
+        console.log(userData)
+        if (userData) {
+            dispatch(getInfoSuccess(JSON.parse(userData)));
         }
-        return <View >
-            <View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
-            <View style={{ backgroundColor: '#fff', minHeight: '100vh' }}>
-                {
-                    moments.map((item, index) => {
-                        return <View key={index}>
-                            <MomentItem data={item} />
-                        </View>
-                    })
-                }
-            </View>
-
-            {
-                process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
-            }
-        </View>
+        setLoaded(true)
     }
 
-    return content()
-
-
-    return <View>
-        <ScrollView scrollY style={{ height: '100vh' }}>
-            <Button openType="share">分享</Button>
-            <View>好友数量{count}</View>
-            {
-                friends.map((item, index) => {
-                    return <View key={index}>
-                        <Image src={item.avatar} style={{ width: 70, height: 70 }} />
-                        <Text>{item.nickname}</Text>
-                        <Text>{item.relation}</Text>
-                    </View>
-                })
-            }
-            <View style={{ height: '100vh', backgroundColor: 'pink', width: rpxToPx(750) }} id="a"></View>
-            <View style={{ height: '100vh', backgroundColor: 'blue', width: rpxToPx(750) }} id="b"></View>
-            <View style={{ height: '100vh', backgroundColor: 'yellow', width: rpxToPx(750) }} id="c"></View>
-            <View style={{ height: '100vh', backgroundColor: 'green', width: rpxToPx(750) }} id="d"></View>
-            <View style={{ height: '100vh', backgroundColor: 'red', width: rpxToPx(750) }} id="e"></View>
-        </ScrollView>
-        {
-            process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
+    async function getStorage(key: string) {
+        try {
+            const res = await Taro.getStorage({ key });
+            return res.data;
+        } catch {
+            return '';
         }
-    </View>
+    }
+    if (!loaded)
+        return <View />
+    return <FriendMain />
 }

+ 291 - 0
src/pages/friend/friend_main.tsx

@@ -0,0 +1,291 @@
+
+
+import TabBar from "@/components/navigation/TabBar";
+import { rpxToPx } from "@/utils/tools";
+import { View, Text, Image, ScrollView, Button } from "@tarojs/components";
+import Taro, { useRouter, useShareAppMessage } from "@tarojs/taro";
+import { useDispatch, useSelector } from "react-redux";
+import { useEffect, useState } from "react";
+import { followUser, getFriendDashBoard, getFriendMoments, getMyFriends, getUserHome } from "@/services/friend";
+import FriendGuide from "./guide";
+import EmptyContent from "./empty_content";
+import MomentItem from "./moment_item";
+import { useTranslation } from "react-i18next";
+import { windows } from "@/services/health";
+import { setFastWithSleep, setFinishSetup, setLongFast, setRefreshs, setWindows } from "@/store/health";
+import { getInfoSuccess } from "@/store/user";
+import showActionSheet from "@/components/basic/ActionSheet";
+import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
+
+let useRoute;
+let useNavigation;
+if (process.env.TARO_ENV == 'rn') {
+    useRoute = require("@react-navigation/native").useRoute
+    useNavigation = require("@react-navigation/native").useNavigation
+}
+
+let timer;
+export default function FriendMain() {
+    const user = useSelector((state: any) => state.user);
+    const launchObj = Taro.getLaunchOptionsSync()
+
+    const observerObjBottom = Taro.createIntersectionObserver().relativeToViewport({ bottom: 100 })
+
+    const [friends, setFriends] = useState<any>([])
+    const [count, setCount] = useState(0)
+
+    const systemInfo: any = Taro.getWindowInfo ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
+    const navigationBarHeight = systemInfo.statusBarHeight + 44;
+
+    let router
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
+    if (process.env.TARO_ENV == 'rn') {
+        router = useRoute()
+    }
+    else {
+        router = useRouter()
+    }
+
+    const [loaded, setLoaded] = useState(false)
+    const [homeType, setHomeType] = useState('NO_FRIEND')
+    const [dashBoard, setDashBoard] = useState<any>(null)
+    const [moments, setMoments] = useState<any>([])
+    const dispatch = useDispatch()
+    const { t } = useTranslation()
+
+    useEffect(() => {
+        loadData()
+        timer = setInterval(() => {
+            setCount(count => count + 1)
+        }, 1000)
+        return () => {
+            clearInterval(timer)
+        }
+
+
+    }, [])
+
+    function loadData() {
+        var userData = Taro.getStorageSync('userData')
+        if (userData) {
+            console.log('load user cache')
+            dispatch(getInfoSuccess(JSON.parse(userData)));
+        }
+    }
+
+    
+
+
+    useEffect(() => {
+        myFriends()
+        if (router.params.type == 'share') {
+            if (launchObj.shareTicket) {
+                Taro.getShareInfo({
+                    shareTicket: launchObj.shareTicket,
+                    success(result) {
+                        console.log('share info', result)
+                        updateRelation(result)
+                    },
+                })
+            }
+            else {
+                updateRelation(null)
+            }
+        }
+    }, [user.isLogin])
+
+    function myFriends() {
+        if (!user.isLogin) {
+            setLoaded(true)
+
+            return
+        }
+        
+
+        getFriendDashBoard().then(res => {
+            setLoaded(true)
+            setHomeType((res as any).homepage_type)
+            setDashBoard(res)
+        })
+
+        getFriendMoments({
+            page: 1,
+            limit: 10
+        }).then(res => {
+            setMoments((res as any).data)
+        })
+    }
+
+    function updateRelation(obj) {
+        if (!user.isLogin) {
+            Taro.setStorageSync('share_uid', router.params.uid)
+            Taro.setStorageSync('share_info', JSON.stringify(obj))
+            return
+        }
+        console.log('user login')
+        if (user.id != router.params.uid) {
+            var params: any = {
+                follow_origin: obj ? 'WECHAT_GROUP_CHAT' : 'WECHAT_PRIVATE_CHAT'
+            }
+            if (obj) {
+                params.wechat = obj
+            }
+            followUser(router.params.uid, params).then(res => {
+                myFriends()
+            })
+        }
+    }
+
+
+    useEffect(() => {
+        // observerObjBottom.observe('#a', (res) => {
+        //     console.log('a')
+        // })
+        // observerObjBottom.observe('#b', (res) => {
+        //     console.log('b')
+        // })
+        // observerObjBottom.observe('#c', (res) => {
+        //     console.log('c')
+        // })
+        // observerObjBottom.observe('#d', (res) => {
+        //     console.log('d')
+        // })
+        observerObjBottom.observe('#e', (res) => {
+            console.log('e')
+        })
+    }, [])
+
+    if (process.env.TARO_ENV == 'weapp' /*&& global.allowShare*/) {
+        Taro.updateShareMenu({
+            withShareTicket: true,
+            success() { }
+        })
+
+        useShareAppMessage((e) => {
+            var sharePath = ``
+            if (global.shareData) {
+                console.log(global.shareData)
+            }
+            console.log('share_url', '/pages/friend/friend?type=share&uid=' + user.id)
+            return {
+                title: 'Friends ',
+                path: '/pages/friend/friend?type=share&uid=' + user.id,
+                // imageUrl: imageUrl
+            }
+        })
+    }
+
+    function more(){
+        showActionSheet({
+            title:'',
+            itemList:['个人主页','我的搭子','消息通知'],
+            success:(index)=>{
+                switch(index){
+                    case 0:
+                        jumpPage('/_moment/pages/home')
+                        break;
+                    case 1:
+                        jumpPage('/_moment/pages/relation')
+                        break
+                    case 2:
+                        jumpPage('/_moment/pages/message')
+                        break
+                }
+            }
+        })
+    }
+
+    function friendGuide() {
+        return <View>
+            <View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
+            <FriendGuide />
+            {
+                process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
+            }</View>
+    }
+
+    function empty() {
+        return <View>
+            <View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
+            <EmptyContent friends={dashBoard.friends} />
+            {
+                process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
+            }
+        </View>
+    }
+
+    function content() {
+        if (!loaded) {
+            return <View >
+                {
+                    process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
+                }
+            </View>
+        }
+        if (!user.isLogin) {
+            return friendGuide()
+        }
+        switch (homeType) {
+            case 'NO_FRIEND':
+                return friendGuide()
+            case 'NO_MOMENT':
+                return empty()
+
+        }
+        return <View >
+            <View style={{
+                height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff', display: 'flex',
+                flexDirection: 'column', justifyContent: 'flex-end'
+            }}>
+                <View style={{ height: 44, width: rpxToPx(750),position:'relative', display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
+                    <View>{t('health.moments')}</View>
+                    <View onClick={more} style={{position:'absolute',left:0,top:0,bottom:0,width:80,display:'flex',alignItems:'center',justifyContent:'center'}}>More</View>
+                </View>
+            </View>
+            <View style={{ backgroundColor: '#fff', minHeight: '100vh' }}>
+                {
+                    moments.map((item, index) => {
+                        return <View key={index}>
+                            <MomentItem data={item} />
+                        </View>
+                    })
+                }
+            </View>
+
+            {
+                process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
+            }
+        </View>
+    }
+
+    return content()
+
+
+    return <View>
+        <ScrollView scrollY style={{ height: '100vh' }}>
+            <Button openType="share">分享</Button>
+            <View>好友数量{count}</View>
+            {
+                friends.map((item, index) => {
+                    return <View key={index}>
+                        <Image src={item.avatar} style={{ width: 70, height: 70 }} />
+                        <Text>{item.nickname}</Text>
+                        <Text>{item.relation}</Text>
+                    </View>
+                })
+            }
+            <View style={{ height: '100vh', backgroundColor: 'pink', width: rpxToPx(750) }} id="a"></View>
+            <View style={{ height: '100vh', backgroundColor: 'blue', width: rpxToPx(750) }} id="b"></View>
+            <View style={{ height: '100vh', backgroundColor: 'yellow', width: rpxToPx(750) }} id="c"></View>
+            <View style={{ height: '100vh', backgroundColor: 'green', width: rpxToPx(750) }} id="d"></View>
+            <View style={{ height: '100vh', backgroundColor: 'red', width: rpxToPx(750) }} id="e"></View>
+        </ScrollView>
+        {
+            process.env.TARO_ENV == 'weapp' && <TabBar index={4} />
+        }
+    </View>
+}

+ 17 - 4
src/pages/friend/moment_item.tsx

@@ -12,6 +12,7 @@ import { rpxToPx } from "@/utils/tools";
 import { getThemeColor } from "@/features/health/hooks/health_hooks";
 import CoverList from "@/_health/components/cover_list";
 import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
+import { IconActive } from "@/components/basic/Icons";
 
 dayjs.extend(relativeTime);
 dayjs.extend(isToday);
@@ -43,16 +44,16 @@ export default function MomentItem(props: { data: any }) {
         return list.map(obj => obj.url);
     }
 
-    function goProfile(){
+    function goProfile() {
         jumpPage(`/_moment/pages/home?uid=${user.id}`)
     }
 
-    function goDetail(){
+    function goDetail() {
         jumpPage(`/_health/pages/timeline_detail?disable_edit=1&window_id=${link.window_id}`)
     }
 
     return <View className="moment_item">
-        <Image className="moment_avatar" src={user.avatar} mode="aspectFill" onClick={goProfile}/>
+        <Image className="moment_avatar" src={user.avatar} mode="aspectFill" onClick={goProfile} />
         <View className="moment_detail" onClick={goDetail}>
             <View className="h34 bold" style={{ color: MainColorType.link, marginBottom: rpxToPx(6) }}>{user.nickname}</View>
             {
@@ -63,7 +64,7 @@ export default function MomentItem(props: { data: any }) {
                 moment.media.length > 0 && <CoverList imgs={formatImages(moment.media)} count={moment.media.length} />
             }
             {
-                link && <View style={{ marginTop: rpxToPx(24) }}>
+                link && link.ring && <View style={{ marginTop: rpxToPx(24) }}>
                     <TargetProgress
                         color={getThemeColor(link.window)}
                         showRing={true}
@@ -74,6 +75,18 @@ export default function MomentItem(props: { data: any }) {
                     />
                 </View>
             }
+            {
+                link && link.move && <View style={{ marginTop: rpxToPx(24) }}>
+                    <TargetProgress
+                        color={getThemeColor(link.window)}
+                        showRing={false}
+                        desc={link.move.description}
+                        icon={
+                            <IconActive color={MainColorType.active} width={rpxToPx(32)} />
+                        }
+                    />
+                </View>
+            }
             <View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', marginTop: rpxToPx(24) }}>
                 <View className="h26 g02">{formatTime(moment.timestamp)}</View>
                 <View style={{ position: 'relative' }}>

+ 27 - 1
src/services/friend.tsx

@@ -1,4 +1,4 @@
-import { API_FOLLOW_USER, API_FRIEND_DASHBOARD, API_FRIEND_MOMENTS, API_MY_FRIENDS, API_USER_HOME } from "./http/api";
+import { API_FOLLOW_USER, API_FRIEND_DASHBOARD, API_FRIEND_MOMENTS, API_MY_FOLLOWERS, API_MY_FOLLOWINGS, API_MY_FRIENDS, API_USER_HOME } from "./http/api";
 import { request } from "./http/request";
 
 export const followUser = (id,params) => {
@@ -27,6 +27,32 @@ export const getMyFriends = (params) => {
     })
 }
 
+export const getMyFollowings = (params) =>{
+    return new Promise((resolve, reject) => {
+        request({
+            url: API_MY_FOLLOWINGS, method: 'GET', data: {...params}
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        }).catch(e => {
+            reject(e)
+        })
+    })
+}
+
+export const getMyFollowers = (params) =>{
+    return new Promise((resolve, reject) => {
+        request({
+            url: API_MY_FOLLOWERS, method: 'GET', data: {...params}
+        }).then(res => {
+            resolve(res);
+            // dispatch(loginSuccess(res));
+        }).catch(e => {
+            reject(e)
+        })
+    })
+}
+
 export const getFriendDashBoard = ()=>{
     return new Promise((resolve, reject) => {
         request({

+ 2 - 0
src/services/http/api.js

@@ -124,6 +124,8 @@ export const API_RESET_TESTINFO = `${baseUrl}/api/user/test-resets`
 //friend
 export const API_FOLLOW_USER = `${baseUrl}/api/users`
 export const API_MY_FRIENDS = `${baseUrl}/api/user/friends`
+export const API_MY_FOLLOWINGS = `${baseUrl}/api/user/followings`
+export const API_MY_FOLLOWERS = `${baseUrl}/api/user/followers`
 export const API_FRIEND_DASHBOARD = `${baseUrl}/api/user/friend/dashboard`
 export const API_USER_HOME = `${baseUrl}/api/user/home`
 export const API_FRIEND_MOMENTS = `${baseUrl}/api/user/friend-moments`