修复上拉加载更多时 ,加载状态判断
This commit is contained in:
parent
5642191c19
commit
1eb423e0c0
|
|
@ -364,11 +364,8 @@ export function reRender(option, extra) {
|
|||
if (this.state.oakEntity && this.state.oakFullpath) {
|
||||
const rows = this.features.runningTree.getFreshValue(this.state.oakFullpath);
|
||||
const oakDirty = this.features.runningTree.isDirty(this.state.oakFullpath);
|
||||
/**
|
||||
* 这里的pullDownRefresh处理的应该有问题,先不动。to wangkejun. By Xc 20230201
|
||||
*/
|
||||
const oakLoading = this.features.runningTree.isLoading(this.state.oakFullpath);
|
||||
const oakLoadingMore = this.features.runningTree.isLoadingMore(this.state.oakFullpath);
|
||||
const oakLoading = !oakLoadingMore && this.features.runningTree.isLoading(this.state.oakFullpath);
|
||||
const oakExecuting = this.features.runningTree.isExecuting(this.state.oakFullpath);
|
||||
const oakExecutable = !oakExecuting && this.features.runningTree.tryExecute(this.state.oakFullpath);
|
||||
const oakLegalActions = rows && checkActionsAndCascadeEntities.call(this, rows, option);
|
||||
|
|
|
|||
|
|
@ -609,15 +609,24 @@ export function createComponent(option, features) {
|
|||
async onPullDownRefresh() {
|
||||
if (!this.state.oakLoading &&
|
||||
this.iAmThePage() &&
|
||||
//!this.state.oakDisablePulldownRefresh &&
|
||||
!this.props.oakDisablePulldownRefresh) {
|
||||
!this.props.oakDisablePulldownRefresh &&
|
||||
!this.state.oakPullDownRefreshLoading) {
|
||||
try {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true,
|
||||
});
|
||||
await (onPullDownRefresh
|
||||
? onPullDownRefresh.call(this)
|
||||
: this.refresh());
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
await wx.stopPullDownRefresh();
|
||||
}
|
||||
catch (err) {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
await wx.stopPullDownRefresh();
|
||||
throw err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,13 +61,21 @@ export function createComponent(option, features) {
|
|||
const Render = super.render();
|
||||
if (this.supportPullDownRefresh()) {
|
||||
return (<PullToRefresh onRefresh={async () => {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true,
|
||||
});
|
||||
await this.refresh();
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
try {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true,
|
||||
});
|
||||
await this.refresh();
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
throw err;
|
||||
}
|
||||
}} refreshing={oakPullDownRefreshLoading} distanceToRefresh={DEFAULT_REACH_BOTTOM_DISTANCE} indicator={{
|
||||
activate: this.t('common::ptrActivate', {
|
||||
'#oakModule': 'oak-frontend-base',
|
||||
|
|
|
|||
|
|
@ -368,11 +368,8 @@ function reRender(option, extra) {
|
|||
if (this.state.oakEntity && this.state.oakFullpath) {
|
||||
const rows = this.features.runningTree.getFreshValue(this.state.oakFullpath);
|
||||
const oakDirty = this.features.runningTree.isDirty(this.state.oakFullpath);
|
||||
/**
|
||||
* 这里的pullDownRefresh处理的应该有问题,先不动。to wangkejun. By Xc 20230201
|
||||
*/
|
||||
const oakLoading = this.features.runningTree.isLoading(this.state.oakFullpath);
|
||||
const oakLoadingMore = this.features.runningTree.isLoadingMore(this.state.oakFullpath);
|
||||
const oakLoading = !oakLoadingMore && this.features.runningTree.isLoading(this.state.oakFullpath);
|
||||
const oakExecuting = this.features.runningTree.isExecuting(this.state.oakFullpath);
|
||||
const oakExecutable = !oakExecuting && this.features.runningTree.tryExecute(this.state.oakFullpath);
|
||||
const oakLegalActions = rows && checkActionsAndCascadeEntities.call(this, rows, option);
|
||||
|
|
|
|||
|
|
@ -612,15 +612,24 @@ function createComponent(option, features) {
|
|||
async onPullDownRefresh() {
|
||||
if (!this.state.oakLoading &&
|
||||
this.iAmThePage() &&
|
||||
//!this.state.oakDisablePulldownRefresh &&
|
||||
!this.props.oakDisablePulldownRefresh) {
|
||||
!this.props.oakDisablePulldownRefresh &&
|
||||
!this.state.oakPullDownRefreshLoading) {
|
||||
try {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true,
|
||||
});
|
||||
await (onPullDownRefresh
|
||||
? onPullDownRefresh.call(this)
|
||||
: this.refresh());
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
await wx.stopPullDownRefresh();
|
||||
}
|
||||
catch (err) {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
await wx.stopPullDownRefresh();
|
||||
throw err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,13 +65,21 @@ function createComponent(option, features) {
|
|||
const Render = super.render();
|
||||
if (this.supportPullDownRefresh()) {
|
||||
return ((0, jsx_runtime_1.jsx)(PullToRefresh_1.default, { onRefresh: async () => {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true,
|
||||
});
|
||||
await this.refresh();
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
try {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true,
|
||||
});
|
||||
await this.refresh();
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false,
|
||||
});
|
||||
throw err;
|
||||
}
|
||||
}, refreshing: oakPullDownRefreshLoading, distanceToRefresh: DEFAULT_REACH_BOTTOM_DISTANCE, indicator: {
|
||||
activate: this.t('common::ptrActivate', {
|
||||
'#oakModule': 'oak-frontend-base',
|
||||
|
|
|
|||
|
|
@ -456,11 +456,8 @@ export function reRender<
|
|||
);
|
||||
|
||||
const oakDirty = this.features.runningTree.isDirty(this.state.oakFullpath);
|
||||
/**
|
||||
* 这里的pullDownRefresh处理的应该有问题,先不动。to wangkejun. By Xc 20230201
|
||||
*/
|
||||
const oakLoading = this.features.runningTree.isLoading(this.state.oakFullpath);
|
||||
const oakLoadingMore = this.features.runningTree.isLoadingMore(this.state.oakFullpath);
|
||||
const oakLoading = !oakLoadingMore && this.features.runningTree.isLoading(this.state.oakFullpath);
|
||||
const oakExecuting = this.features.runningTree.isExecuting(this.state.oakFullpath);
|
||||
const oakExecutable = !oakExecuting && this.features.runningTree.tryExecute(this.state.oakFullpath);
|
||||
|
||||
|
|
|
|||
|
|
@ -944,21 +944,30 @@ export function createComponent<
|
|||
if (
|
||||
!this.state.oakLoading &&
|
||||
this.iAmThePage() &&
|
||||
//!this.state.oakDisablePulldownRefresh &&
|
||||
!this.props.oakDisablePulldownRefresh
|
||||
!this.props.oakDisablePulldownRefresh &&
|
||||
!this.state.oakPullDownRefreshLoading
|
||||
) {
|
||||
try {
|
||||
await (onPullDownRefresh
|
||||
? onPullDownRefresh.call(this)
|
||||
: this.refresh());
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true as any,
|
||||
});
|
||||
await(
|
||||
onPullDownRefresh
|
||||
? onPullDownRefresh.call(this)
|
||||
: this.refresh()
|
||||
);
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false as any,
|
||||
});
|
||||
await wx.stopPullDownRefresh();
|
||||
}
|
||||
catch(err) {
|
||||
} catch (err) {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false as any,
|
||||
});
|
||||
await wx.stopPullDownRefresh();
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
await wx.stopPullDownRefresh();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -119,13 +119,20 @@ export function createComponent<
|
|||
return (
|
||||
<PullToRefresh
|
||||
onRefresh={async () => {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true as any,
|
||||
});
|
||||
await this.refresh();
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false as any,
|
||||
});
|
||||
try {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: true as any,
|
||||
});
|
||||
await this.refresh();
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false as any,
|
||||
});
|
||||
} catch (err) {
|
||||
this.setState({
|
||||
oakPullDownRefreshLoading: false as any,
|
||||
});
|
||||
throw err;
|
||||
}
|
||||
}}
|
||||
refreshing={oakPullDownRefreshLoading}
|
||||
distanceToRefresh={DEFAULT_REACH_BOTTOM_DISTANCE}
|
||||
|
|
|
|||
Loading…
Reference in New Issue