import Taro, { Component } from '@tarojs/taro'
import { ScrollView } from '@tarojs/components'
import { Page, AtPage, AtPreview, AtPreviewItem, AtTitle, AtButton } from '@CUI'
import cgi from '../../../config/cgi.js'
import styles from './query_res.module.scss'
const sdk = Taro.getApp().sdk
export default class Index extends Page {
config = {
navigationBarTitleText: '查詢結(jié)果'
}
state = {
page: 1,
formData: null,
list: null,
}
componentWillMount() {
console.log('手機(jī)端測(cè)試')
if (this.$router.params) {
this.setState({ formData: this.$router.params })
let params = this.$router.params
sdk.request({
url: cgi.publicService,
method: 'POST',
data: {
sessionId: "fujunyinid",
serviceId: "gwyDevolution",
taskId: params.taskId,
pageNo: "1",
department: params.department,
searchContent: params.inputValue
},
header: { 'content-type': 'application/json' },
}).then(res => {
if (res.responseBody.list.length === 0) {
Taro.showToast({
title: '沒有相關(guān)數(shù)據(jù)',
icon: 'none',
duration: 2000
})
setTimeout(() => {
Taro.navigateBack(1)
}, 3000)
} else {
this.setState({ list: res.responseBody.list })
}
})
}
}
componentDidMount() { }
componentWillUnmount() { }
componentDidShow() { }
componentDidHide() { }
onScrollToLower(e) {
if (this.state.loading) return
this.setState({
loading: true
})
Taro.showLoading({
title: '加載中...',
mask: true
})
this.setState({ page: this.state.page += 1 })
sdk.request({
url: cgi.publicService,
method: 'POST',
data: {
sessionId: "fujunyinid",
serviceId: "gwyDevolution",
taskId: this.state.formData.taskId,
pageNo: this.state.page,
department: this.state.formData.department,
},
header: { 'content-type': 'application/json' },
}).then(res => {
let reslist = res.responseBody.list
if (reslist && reslist.length > 0) {
this.setState({
list: this.state.list.concat(reslist)
})
this.setState({
loading: false
})
} else {
Taro.showToast({
title: '沒有更多數(shù)據(jù)了...',
icon: 'none',
duration: 2000
})
}
Taro.hideLoading()
})
}
render() {
const Threshold = 40
return (
<AtPage className={styles.test}>
<ScrollView
className={styles.ScollHight}
scrollY
lowerThreshold={Threshold}
onScrollToLower={this.onScrollToLower.bind(this)}
onScroll={this.onScroll}
>
<AtTitle>查詢結(jié)果</AtTitle>
{
this.state.list && this.state.list.map((item) => {
return <AtPreview title='' actionText='' onActionClick={this.handleClick}>
<AtPreviewItem title='項(xiàng)目名稱:' text={item.projectName} hasBorder />
<AtPreviewItem title='審批部門:' text={item.department} hasBorder />
{item.processingDecisions && <AtPreviewItem title='處理決定:' text={item.processingDecisions} />}
</AtPreview>
})
}
</ScrollView>
</AtPage>
)
}
}
react加載更多
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
- 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)蓖扑,“玉大人唉铜,你說(shuō)我怎么就攤上這事÷筛埽” “怎么了潭流?”我有些...
- 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)柜去。 經(jīng)常有香客問(wèn)我幻枉,道長(zhǎng),這世上最難降的妖魔是什么诡蜓? 我笑而不...
- 正文 為了忘掉前任,我火速辦了婚禮胰挑,結(jié)果婚禮上蔓罚,老公的妹妹穿的比我還像新娘。我一直安慰自己瞻颂,他們只是感情好豺谈,可當(dāng)我...
- 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著贡这,像睡著了一般茬末。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
- 那天丽惭,我揣著相機(jī)與錄音击奶,去河邊找鬼。 笑死责掏,一個(gè)胖子當(dāng)著我的面吹牛柜砾,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播换衬,決...
- 文/蒼蘭香墨 我猛地睜開眼痰驱,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了瞳浦?” 一聲冷哼從身側(cè)響起担映,我...
- 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎叫潦,沒想到半個(gè)月后蝇完,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
- 正文 獨(dú)居荒郊野嶺守林人離奇死亡诅挑,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
- 正文 我和宋清朗相戀三年四敞,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片拔妥。...
- 正文 年R本政府宣布硬纤,位于F島的核電站解滓,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏筝家。R本人自食惡果不足惜洼裤,卻給世界環(huán)境...
- 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望溪王。 院中可真熱鬧腮鞍,春花似錦、人聲如沸莹菱。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)道伟。三九已至迹缀,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背祝懂。 一陣腳步聲響...
- 正文 我出身青樓兄朋,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親怜械。 傳聞我的和親對(duì)象是個(gè)殘疾皇子颅和,可洞房花燭夜當(dāng)晚...
推薦閱讀更多精彩內(nèi)容
- 下拉刷新的工具我用的是:react-native-pullrefresh-scrollview,上拉加載更多沒找到...
- react-native列表FlatList下拉刷新上拉加載更多實(shí)現(xiàn) 具體代碼懶得擇了,這里只給出比官網(wǎng)文檔全一點(diǎn)...
- react-native-page-listview 對(duì)ListView/FlatList的封裝,可以很方便的分頁(yè)...
- RN-ListViewLoadMorereact-native中處理ListView的下拉刷新和上拉加載更多 Re...
- 0缕允、寫在前面 用React Native也有一段時(shí)間了峡扩,新出來(lái)的加載列表控件FlatList也出來(lái)了,F(xiàn)latLi...