|
@@ -1,13 +1,14 @@
|
|
|
import HistoryItem from "@/features/health/HistoryItem";
|
|
import HistoryItem from "@/features/health/HistoryItem";
|
|
|
import { records } from "@/services/health";
|
|
import { records } from "@/services/health";
|
|
|
import { rpxToPx } from "@/utils/tools";
|
|
import { rpxToPx } from "@/utils/tools";
|
|
|
-import { View, Text } from "@tarojs/components";
|
|
|
|
|
|
|
+import { View, Text, Image } from "@tarojs/components";
|
|
|
import VirtualList from "@tarojs/components/virtual-list";
|
|
import VirtualList from "@tarojs/components/virtual-list";
|
|
|
import Taro from "@tarojs/taro";
|
|
import Taro from "@tarojs/taro";
|
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
|
import { useEffect, useState } from "react";
|
|
import { useEffect, useState } from "react";
|
|
|
import { useSelector } from "react-redux";
|
|
import { useSelector } from "react-redux";
|
|
|
import ListFooter from "../components/list_footer";
|
|
import ListFooter from "../components/list_footer";
|
|
|
|
|
+import JournalCover from "@/features/journal/components/journal_cover";
|
|
|
|
|
|
|
|
export default function Recent(props: { type?: string, fast_type?: string, children: any }) {
|
|
export default function Recent(props: { type?: string, fast_type?: string, children: any }) {
|
|
|
const [list, setList] = useState<any>([])
|
|
const [list, setList] = useState<any>([])
|
|
@@ -19,7 +20,7 @@ export default function Recent(props: { type?: string, fast_type?: string, child
|
|
|
const [loaded, setLoaded] = useState(false)
|
|
const [loaded, setLoaded] = useState(false)
|
|
|
const [total, setTotal] = useState(0)
|
|
const [total, setTotal] = useState(0)
|
|
|
const systemInfo = Taro.getSystemInfoSync();
|
|
const systemInfo = Taro.getSystemInfoSync();
|
|
|
- const pageHeight = systemInfo.screenHeight-(systemInfo.statusBarHeight??0)-(systemInfo.platform === 'ios' ? 44 : 48)
|
|
|
|
|
|
|
+ const pageHeight = systemInfo.screenHeight - (systemInfo.statusBarHeight ?? 0) - (systemInfo.platform === 'ios' ? 44 : 48)
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
loadData(1)
|
|
loadData(1)
|
|
@@ -109,6 +110,7 @@ export default function Recent(props: { type?: string, fast_type?: string, child
|
|
|
title: moment.title,
|
|
title: moment.title,
|
|
|
description: moment.description,
|
|
description: moment.description,
|
|
|
url: moment.media[0].url,
|
|
url: moment.media[0].url,
|
|
|
|
|
+ urls: moment.media,
|
|
|
event_id: event.id
|
|
event_id: event.id
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
@@ -174,6 +176,8 @@ export default function Recent(props: { type?: string, fast_type?: string, child
|
|
|
else {
|
|
else {
|
|
|
console.log('ssss', list.length, array.length)
|
|
console.log('ssss', list.length, array.length)
|
|
|
setList([...list, ...array])
|
|
setList([...list, ...array])
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// if (index>=5){
|
|
// if (index>=5){
|
|
|
// return
|
|
// return
|
|
|
// }
|
|
// }
|
|
@@ -212,21 +216,39 @@ export default function Recent(props: { type?: string, fast_type?: string, child
|
|
|
}
|
|
}
|
|
|
return <View />
|
|
return <View />
|
|
|
}
|
|
}
|
|
|
- return <View style={{height:'100vh',overflow:'hidden'}}>
|
|
|
|
|
|
|
+ return <View style={{ height: '100vh', overflow: 'hidden' }}>
|
|
|
<recycle-view batch={true} id="recycleId"
|
|
<recycle-view batch={true} id="recycleId"
|
|
|
// style="height:500"
|
|
// style="height:500"
|
|
|
height={pageHeight}
|
|
height={pageHeight}
|
|
|
onScrolltolower={more}
|
|
onScrolltolower={more}
|
|
|
- // onScrolltolower={refresh}
|
|
|
|
|
|
|
+ // onScrolltolower={refresh}
|
|
|
>
|
|
>
|
|
|
<view slot="before">{props.children}</view>
|
|
<view slot="before">{props.children}</view>
|
|
|
{
|
|
{
|
|
|
list.map((item, index) => {
|
|
list.map((item, index) => {
|
|
|
|
|
+ // var urlArray: any = []
|
|
|
|
|
+ // if (item.pics.length > 0) {
|
|
|
|
|
+ // debugger
|
|
|
|
|
+ // urlArray = item.pics.map(obj => obj.url);
|
|
|
|
|
+ // }
|
|
|
|
|
+ debugger
|
|
|
return <recycle-item key={index}>
|
|
return <recycle-item key={index}>
|
|
|
- <View style={{backgroundColor:'#fff'}}>
|
|
|
|
|
|
|
+ <View style={{ backgroundColor: '#fff', display: 'flex', flexDirection: 'column', width: rpxToPx(750) }}>
|
|
|
{
|
|
{
|
|
|
historyMonth(index)
|
|
historyMonth(index)
|
|
|
}
|
|
}
|
|
|
|
|
+ {/* {
|
|
|
|
|
+ item.dataArray && item.dataArray[0].type == 'PIC_TEXT' && <Text>{item.dataArray[0].data[0].description}</Text>
|
|
|
|
|
+ }
|
|
|
|
|
+ {
|
|
|
|
|
+ item.dataArray && item.dataArray[0].type == 'PIC_TEXT' && <JournalCover imgs={[item.dataArray[0].data[0].url,item.dataArray[0].data[0].url,item.dataArray[0].data[0].url,item.dataArray[0].data[0].url,item.dataArray[0].data[0].url]}/>
|
|
|
|
|
+ } */}
|
|
|
|
|
+ {/* {
|
|
|
|
|
+ item.texts.length > 0 && <Text>{item.texts[0].description}</Text>
|
|
|
|
|
+ }
|
|
|
|
|
+ {
|
|
|
|
|
+ item.pics.length > 0 && <JournalCover imgs={item.pics}/>
|
|
|
|
|
+ } */}
|
|
|
<HistoryItem
|
|
<HistoryItem
|
|
|
data={item}
|
|
data={item}
|
|
|
preData={index > 0 ? list[index - 1] : null}
|
|
preData={index > 0 ? list[index - 1] : null}
|
|
@@ -238,6 +260,12 @@ export default function Recent(props: { type?: string, fast_type?: string, child
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
|
|
|
|
|
}} />
|
|
}} />
|
|
|
|
|
+ {/* <Image src="https://fast-prod.oss-cn-beijing.aliyuncs.com/users/832f82c2bf616063fcf5619063a060c9/food-journal/2024/64efc6fe-5fca-49a3-9828-497e87ad9582_20241216120746_684.jpg?x-oss-process=image/format,webp"
|
|
|
|
|
+ style={{
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ height: 100
|
|
|
|
|
+ }}
|
|
|
|
|
+ /> */}
|
|
|
</View>
|
|
</View>
|
|
|
</recycle-item>
|
|
</recycle-item>
|
|
|
})
|
|
})
|