|
@@ -142,24 +142,26 @@ const Index: React.FC<Props> = ({ store }) => {
|
|
const getGuessLike = (page) => {
|
|
const getGuessLike = (page) => {
|
|
indexComponents?.guess_like({ workDirection: bookStore.workDirection, ...page })
|
|
indexComponents?.guess_like({ workDirection: bookStore.workDirection, ...page })
|
|
}
|
|
}
|
|
- //下来加载
|
|
|
|
|
|
+ //下拉加载
|
|
const load = async () => {
|
|
const load = async () => {
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- let { size, total, records } = indexStore?.indexGuessLike?.[app?.appInfo?.appCategory === 1 ? "longBookInfoAppVOS" : "shortBookInfoAppVOS"]
|
|
|
|
- let pageSize = size + 20
|
|
|
|
- if (records?.length >= total) {
|
|
|
|
- Taro.showToast({
|
|
|
|
- title: '没有更多了~~',
|
|
|
|
- duration: 2000,
|
|
|
|
- icon: 'none'
|
|
|
|
- })
|
|
|
|
- reject()
|
|
|
|
- return
|
|
|
|
- } else {
|
|
|
|
- getGuessLike({ pageSize, pageNum: 1 })
|
|
|
|
- resolve(true)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ if(indexConfig['guess_like']){
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ let { size, total, records } = indexStore?.indexGuessLike?.[app?.appInfo?.appCategory === 1 ? "longBookInfoAppVOS" : "shortBookInfoAppVOS"]
|
|
|
|
+ let pageSize = size + 20
|
|
|
|
+ if (records?.length >= total) {
|
|
|
|
+ Taro.showToast({
|
|
|
|
+ title: '没有更多了~~',
|
|
|
|
+ duration: 2000,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ reject()
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ getGuessLike({ pageSize, pageNum: 1 })
|
|
|
|
+ resolve(true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return <ScrollViewHoc load={load} filterClassName='.searchTs' navHeight={indexStore.navHeight}>
|
|
return <ScrollViewHoc load={load} filterClassName='.searchTs' navHeight={indexStore.navHeight}>
|
|
<View style={{ display: "flex", flexFlow: 'column' }}>
|
|
<View style={{ display: "flex", flexFlow: 'column' }}>
|