|
@@ -21,6 +21,7 @@ import ListFooter from "@/_health/components/list_footer";
|
|
|
import { MainColorType } from "@/context/themes/color";
|
|
import { MainColorType } from "@/context/themes/color";
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
|
import { IconClose, IconMenu } from "@/components/basic/Icons";
|
|
import { IconClose, IconMenu } from "@/components/basic/Icons";
|
|
|
|
|
+import MomentShare from "./moment_share";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -103,12 +104,10 @@ export default function MomentMain() {
|
|
|
}, [])
|
|
}, [])
|
|
|
|
|
|
|
|
function listenFollowUser(e) {
|
|
function listenFollowUser(e) {
|
|
|
- console.log('home follow user', e)
|
|
|
|
|
myFriends()
|
|
myFriends()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function listenUnfollowUser(e) {
|
|
function listenUnfollowUser(e) {
|
|
|
- console.log('home unfollow user', e)
|
|
|
|
|
myFriends()
|
|
myFriends()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -116,16 +115,11 @@ export default function MomentMain() {
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
myFriends()
|
|
myFriends()
|
|
|
- // const launchObj = Taro.getLaunchOptionsSync()
|
|
|
|
|
- // console.log("heeee", router.params, launchObj)
|
|
|
|
|
if (router.params.type == 'share') {
|
|
if (router.params.type == 'share') {
|
|
|
- // console.log('share begin')
|
|
|
|
|
- // console.log(launchObj)
|
|
|
|
|
if (global.shareTicket) {
|
|
if (global.shareTicket) {
|
|
|
Taro.getShareInfo({
|
|
Taro.getShareInfo({
|
|
|
shareTicket: global.shareTicket,
|
|
shareTicket: global.shareTicket,
|
|
|
success(result) {
|
|
success(result) {
|
|
|
- console.log('share info', result)
|
|
|
|
|
updateRelation(result)
|
|
updateRelation(result)
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
@@ -146,7 +140,6 @@ export default function MomentMain() {
|
|
|
|
|
|
|
|
observerObjBottom.observe('#footer', (res) => {
|
|
observerObjBottom.observe('#footer', (res) => {
|
|
|
setEndSignal(endSignal => endSignal + 1)
|
|
setEndSignal(endSignal => endSignal + 1)
|
|
|
- // console.log(moments.length)
|
|
|
|
|
// if (moments.length==0) return
|
|
// if (moments.length==0) return
|
|
|
// loadMore()
|
|
// loadMore()
|
|
|
})
|
|
})
|
|
@@ -158,8 +151,6 @@ export default function MomentMain() {
|
|
|
}, [endSignal])
|
|
}, [endSignal])
|
|
|
|
|
|
|
|
function measureItemLayouts() {
|
|
function measureItemLayouts() {
|
|
|
-
|
|
|
|
|
- console.log('开始计算位置', new Date().getTime(), moments.length)
|
|
|
|
|
if (moments.length <= 10) {
|
|
if (moments.length <= 10) {
|
|
|
moments.forEach((item, index) => {
|
|
moments.forEach((item, index) => {
|
|
|
query.select(`#history2-${index}`).boundingClientRect()
|
|
query.select(`#history2-${index}`).boundingClientRect()
|
|
@@ -175,7 +166,6 @@ export default function MomentMain() {
|
|
|
});
|
|
});
|
|
|
setItemLayouts(layouts)
|
|
setItemLayouts(layouts)
|
|
|
setItemHeights(heights)
|
|
setItemHeights(heights)
|
|
|
- console.log('结束计算位置', new Date().getTime())
|
|
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
@@ -187,7 +177,6 @@ export default function MomentMain() {
|
|
|
query.exec((res) => {
|
|
query.exec((res) => {
|
|
|
var layouts: any = []
|
|
var layouts: any = []
|
|
|
var heights: any = []
|
|
var heights: any = []
|
|
|
- // console.log(res)
|
|
|
|
|
res.forEach((rect, index) => {
|
|
res.forEach((rect, index) => {
|
|
|
|
|
|
|
|
if (rect) {
|
|
if (rect) {
|
|
@@ -197,7 +186,6 @@ export default function MomentMain() {
|
|
|
});
|
|
});
|
|
|
setItemLayouts([...itemLayouts, ...layouts])
|
|
setItemLayouts([...itemLayouts, ...layouts])
|
|
|
setItemHeights([...itemHeights, ...heights])
|
|
setItemHeights([...itemHeights, ...heights])
|
|
|
- console.log('结束计算位置', new Date().getTime())
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -243,13 +231,10 @@ export default function MomentMain() {
|
|
|
limit: 10
|
|
limit: 10
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
setIsPulling(false)
|
|
setIsPulling(false)
|
|
|
- console.log(index)
|
|
|
|
|
if (index == 1) {
|
|
if (index == 1) {
|
|
|
- console.log('ss')
|
|
|
|
|
setMoments((res as any).data)
|
|
setMoments((res as any).data)
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- console.log('ooo')
|
|
|
|
|
setMoments([...moments, ...(res as any).data])
|
|
setMoments([...moments, ...(res as any).data])
|
|
|
}
|
|
}
|
|
|
setLoading(false)
|
|
setLoading(false)
|
|
@@ -302,7 +287,6 @@ export default function MomentMain() {
|
|
|
if (loading) return;
|
|
if (loading) return;
|
|
|
if (noMore) return;
|
|
if (noMore) return;
|
|
|
setLoading(true)
|
|
setLoading(true)
|
|
|
- console.log(page)
|
|
|
|
|
var index = page;
|
|
var index = page;
|
|
|
index++;
|
|
index++;
|
|
|
setPage(index)
|
|
setPage(index)
|
|
@@ -337,14 +321,14 @@ export default function MomentMain() {
|
|
|
}}>关闭</View> */}
|
|
}}>关闭</View> */}
|
|
|
{
|
|
{
|
|
|
user.isLogin && <View style={{
|
|
user.isLogin && <View style={{
|
|
|
- position: 'absolute', left: 0, top: navigationBarHeight-44, width: 44, height: 44,
|
|
|
|
|
|
|
+ position: 'absolute', left: 10, top: navigationBarHeight-44, width: 44, height: 44,
|
|
|
display: 'flex', alignItems: 'center', justifyContent: 'center'
|
|
display: 'flex', alignItems: 'center', justifyContent: 'center'
|
|
|
}}
|
|
}}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
setCloseGuide(true)
|
|
setCloseGuide(true)
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
- <IconClose color="#000" width={20} height={20} />
|
|
|
|
|
|
|
+ <IconClose color="#000" width={30} height={30} />
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -359,14 +343,14 @@ export default function MomentMain() {
|
|
|
<View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
|
|
<View style={{ height: navigationBarHeight, width: rpxToPx(750), backgroundColor: '#fff' }} />
|
|
|
{
|
|
{
|
|
|
user.isLogin && <View style={{
|
|
user.isLogin && <View style={{
|
|
|
- position: 'absolute', left: 0, top: navigationBarHeight-44, width: 44, height: 44,
|
|
|
|
|
|
|
+ position: 'absolute', left: 10, top: navigationBarHeight-44, width: 44, height: 44,
|
|
|
display: 'flex', alignItems: 'center', justifyContent: 'center'
|
|
display: 'flex', alignItems: 'center', justifyContent: 'center'
|
|
|
}}
|
|
}}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
setCloseGuide(true)
|
|
setCloseGuide(true)
|
|
|
}}
|
|
}}
|
|
|
>
|
|
>
|
|
|
- <IconClose color="#000" width={20} height={20} />
|
|
|
|
|
|
|
+ <IconClose color="#000" width={30} height={30} />
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
<EmptyContent friends={dashBoard.friends} />
|
|
<EmptyContent friends={dashBoard.friends} />
|
|
@@ -376,8 +360,6 @@ export default function MomentMain() {
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // console.log(pageTop, itemLayouts)
|
|
|
|
|
-
|
|
|
|
|
function listDetail() {
|
|
function listDetail() {
|
|
|
return <View >
|
|
return <View >
|
|
|
<View style={{
|
|
<View style={{
|
|
@@ -563,9 +545,11 @@ export default function MomentMain() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return <View>
|
|
return <View>
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
content()
|
|
content()
|
|
|
}
|
|
}
|
|
|
|
|
+ <MomentShare />
|
|
|
|
|
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|