|
|
@@ -69,9 +69,9 @@ export default function Journal() {
|
|
|
getJounalsData(1)
|
|
|
}, [window])
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
- console.log('last show status',showDate)
|
|
|
- },[showDate])
|
|
|
+ useEffect(() => {
|
|
|
+ console.log('last show status', showDate)
|
|
|
+ }, [showDate])
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (journals.length > 0) {
|
|
|
@@ -92,6 +92,7 @@ export default function Journal() {
|
|
|
|
|
|
function getJounalsData(index = 1) {
|
|
|
setLoading(true)
|
|
|
+ setPage(index)
|
|
|
var params: any = {
|
|
|
page: index,
|
|
|
limit: 10,
|
|
|
@@ -149,10 +150,10 @@ export default function Journal() {
|
|
|
}
|
|
|
|
|
|
function onScroll(e) {
|
|
|
- var top = e.detail.scrollTop
|
|
|
- myScrollTop = top
|
|
|
+ var top = e.detail.scrollTop - e.detail.deltaY
|
|
|
+ myScrollTop = e.detail.scrollTop
|
|
|
|
|
|
- if (e.detail.scrollTop > 60) {
|
|
|
+ if (top > 60) {
|
|
|
|
|
|
Taro.setNavigationBarTitle({
|
|
|
title: pageTitle()
|
|
|
@@ -184,14 +185,14 @@ export default function Journal() {
|
|
|
setDate('')
|
|
|
}
|
|
|
|
|
|
- if (itemLayouts.length > 0 && itemLayouts[0] > top) {
|
|
|
- setShowDate(false)
|
|
|
- setDate('')
|
|
|
- console.log(itemLayouts[0], showDate, date, top)
|
|
|
- }
|
|
|
- else {
|
|
|
- console.log(itemLayouts[0], showDate, date, top)
|
|
|
- }
|
|
|
+ // if (itemLayouts.length > 0 && itemLayouts[0] > top) {
|
|
|
+ // setShowDate(false)
|
|
|
+ // setDate('')
|
|
|
+ // console.log(itemLayouts[0], showDate, date, top, e.detail.deltaY)
|
|
|
+ // }
|
|
|
+ // else {
|
|
|
+ // console.log(itemLayouts[0], showDate, date, top, e.detail.deltaY)
|
|
|
+ // }
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -278,7 +279,7 @@ export default function Journal() {
|
|
|
}
|
|
|
}
|
|
|
if (showDate) {
|
|
|
- return <View className="history_year_month h42 bold">{dateStr2}</View>
|
|
|
+ return <View className="history_year_month h42 bold" style={{marginBottom:rpxToPx(60)}}>{dateStr2}</View>
|
|
|
}
|
|
|
return <View />
|
|
|
}
|
|
|
@@ -513,17 +514,10 @@ export default function Journal() {
|
|
|
|
|
|
return <StickyDateList onRefresherRefresh={() => {
|
|
|
setIsPulling(true)
|
|
|
- getJounalsData()
|
|
|
+ getJounalsData(1)
|
|
|
}} isPulling={isPulling}
|
|
|
onScroll={onScroll}
|
|
|
showDate={showDate}
|
|
|
- scrollUpper={
|
|
|
- () => {
|
|
|
- console.log('9527')
|
|
|
- setDate('')
|
|
|
- setShowDate(false)
|
|
|
- }
|
|
|
- }
|
|
|
date={date}
|
|
|
loadMore={() => {
|
|
|
more()
|
|
|
@@ -567,7 +561,7 @@ export default function Journal() {
|
|
|
<View style={{ width: rpxToPx(40), flexShrink: 0 }} />
|
|
|
</ScrollView>
|
|
|
} */}
|
|
|
- <View style={{ minHeight: '100vh', backgroundColor: '#fff' }}>
|
|
|
+ <View style={{ minHeight: '100vh', backgroundColor: '#fff', paddingTop: rpxToPx(60) }}>
|
|
|
{
|
|
|
journals.map((item, index) => {
|
|
|
// if (index>0) return <View key={index}/>
|
|
|
@@ -614,8 +608,7 @@ export default function Journal() {
|
|
|
{
|
|
|
loaded && journals.length == 0 && <NoRecord />
|
|
|
}
|
|
|
- <View style={{ height: rpxToPx(40), flexShrink: 0, backgroundColor: '#fff' }} />
|
|
|
</View>
|
|
|
- <ListFooter noMore={(journals.length > 0) && (total == journals.length)} />
|
|
|
+ <ListFooter noMore={(journals.length > 0) && (total == journals.length)} loading={loading} />
|
|
|
</View></StickyDateList>
|
|
|
}
|