|
@@ -93,7 +93,9 @@ class CustomerProfile extends Component {
|
|
|
checkCompShow: false,
|
|
|
checkCompList: [],
|
|
|
|
|
|
- currAddress: []
|
|
|
+ currAddress: [],
|
|
|
+
|
|
|
+ loading: false,
|
|
|
};
|
|
|
this.queryByUidAll = this.queryByUidAll.bind(this);
|
|
|
this.update = this.update.bind(this);
|
|
@@ -486,7 +488,7 @@ class CustomerProfile extends Component {
|
|
|
return { flag, message };
|
|
|
}
|
|
|
|
|
|
- onSaveAllData(callback) {
|
|
|
+ onSaveAllData(succCallback, errorCallback) {
|
|
|
const { dtails } = this.state;
|
|
|
|
|
|
let params = {
|
|
@@ -574,19 +576,29 @@ class CustomerProfile extends Component {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ this.setState({ loading: true })
|
|
|
updateUser(params).then((v) => {
|
|
|
+ this.setState({ loading: false });
|
|
|
if (v.error.length === 0) {
|
|
|
Taro.showToast({
|
|
|
title: "修改成功",
|
|
|
});
|
|
|
|
|
|
- callback && callback(v.data);
|
|
|
+ succCallback && succCallback(v.data);
|
|
|
} else {
|
|
|
+ errorCallback && errorCallback();
|
|
|
Taro.showToast({
|
|
|
title: v.error[0].message,
|
|
|
icon: "none",
|
|
|
});
|
|
|
}
|
|
|
+ }).catch(() => {
|
|
|
+ this.setState({ loading: false });
|
|
|
+ Taro.showToast({
|
|
|
+ title: "提交失败!",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ errorCallback && errorCallback();
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -1383,7 +1395,7 @@ class CustomerProfile extends Component {
|
|
|
) : null}
|
|
|
<View style={{ display: 'flex', marginTop: '24rpx' }}>
|
|
|
<AtButton type="secondary" circle onClick={this.handlePrevClick.bind(this)}>上一页</AtButton>
|
|
|
- <AtButton type="primary" circle onClick={this.handleNextClick.bind(this)}>下一页</AtButton>
|
|
|
+ <AtButton type="primary" circle loading={this.state.loading} onClick={this.handleNextClick.bind(this)}>下一页</AtButton>
|
|
|
</View>
|
|
|
</View>
|
|
|
:
|
|
@@ -1916,7 +1928,7 @@ class CustomerProfile extends Component {
|
|
|
|
|
|
<View style={{ display: 'flex', marginTop: '24rpx' }}>
|
|
|
<AtButton type="secondary" circle onClick={this.handlePrevClick.bind(this)}>上一页</AtButton>
|
|
|
- <AtButton type="primary" circle onClick={this.handleNextClick.bind(this)}>下一页</AtButton>
|
|
|
+ <AtButton type="primary" circle loading={this.state.loading} onClick={this.handleNextClick.bind(this)}>下一页</AtButton>
|
|
|
</View>
|
|
|
{/* </View> */}
|
|
|
</View>
|