Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stopPullDownRefresh() {
Taro.stopPullDownRefresh()
}
// 刷新数据
yield takeLatest(createdDocumentPulldownRefreshRequest.type, function* () {
try {
const response = yield getUserDocs({ offset: 0 });
yield put(initCreatedDocListSuccess({ createdDocs: response.data }));
Taro.vibrateShort();
} catch (error) {
Taro.showToast({
title: '请求失败',
icon: 'none'
});
}
Taro.stopPullDownRefresh();
});
}
api.get(url, params).then((res) => {
if (repo_page === 1) {
that.setState({
repos: res.data.items
})
} else {
that.setState({
repos: repos.concat(res.data.items)
})
}
let status = res.data.length < GLOBAL_CONFIG.PER_PAGE ? REFRESH_STATUS.NO_MORE_DATA : REFRESH_STATUS.NORMAL
that.setState({
repo_status: status
})
Taro.hideLoading()
Taro.stopPullDownRefresh()
})
}
fetchDataComplete() {
if (process.env.NODE_ENV === 'development') {
setTimeout(() => {
this.setState({
searching: false
})
}, 2000)
} else {
this.setState({
searching: false
})
}
Taro.stopPullDownRefresh()
}
},()=>{
Taro.stopPullDownRefresh();
})
});
api.get(url, params).then((res)=>{
if (page === 1) {
that.setState({
dataList: res.data
})
} else {
that.setState({
dataList: dataList.concat(res.data)
})
}
let status = res.data.length < GLOBAL_CONFIG.PER_PAGE ? REFRESH_STATUS.NO_MORE_DATA : REFRESH_STATUS.NORMAL
that.setState({
refresh_status: status
})
Taro.stopPullDownRefresh()
Taro.hideLoading()
})
}
},()=>{
Taro.stopPullDownRefresh();
})
});
api.get(url, params).then((res)=>{
if (close_page === 1) {
that.setState({
closedList: res.data
})
} else {
that.setState({
closedList: closedList.concat(res.data)
})
}
let status = res.data.length < GLOBAL_CONFIG.PER_PAGE ? REFRESH_STATUS.NO_MORE_DATA : REFRESH_STATUS.NORMAL
that.setState({
close_status: status
})
Taro.hideLoading()
Taro.stopPullDownRefresh()
})
}