Skip to content

Commit 73f7338

Browse files
committed
修改订单不能滑动的问题
1 parent a53b626 commit 73f7338

3 files changed

Lines changed: 55 additions & 8 deletions

File tree

Coding_iOS/Controllers/Shop/ShopOrderViewController.m

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,17 @@ - (void)carouselDidScroll:(iCarousel *)carousel{
119119

120120
- (void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel{
121121

122-
123122
ShopOrderListView *listView = (ShopOrderListView *)carousel.currentItemView;
124123
_myOrder.orderType = carousel.currentItemIndex;
125124
listView.myOrder = _myOrder;
126125
[listView reloadData];
127126

128-
// if (_mySegmentControl) {
129-
// _mySegmentControl.currentIndex = carousel.currentItemIndex;
130-
// }
131-
// [carousel.visibleItemViews enumerateObjectsUsingBlock:^(UIView *obj, NSUInteger idx, BOOL *stop) {
132-
// [obj setSubScrollsToTop:(obj == carousel.currentItemView)];
133-
// }];
127+
if (_mySegmentControl) {
128+
_mySegmentControl.currentIndex = carousel.currentItemIndex;
129+
}
130+
[carousel.visibleItemViews enumerateObjectsUsingBlock:^(UIView *obj, NSUInteger idx, BOOL *stop) {
131+
[obj setSubScrollsToTop:(obj == carousel.currentItemView)];
132+
}];
134133
}
135134

136135
- (void)dealloc

Coding_iOS/Models/ShopOrderModel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ - (instancetype)init
1515
self = [super init];
1616
if (self) {
1717
_page = @1;
18-
_pageSize = @100;
18+
_pageSize = @20;
1919
_orderType = ShopOrderAll;
2020
_dateSource = [NSMutableArray arrayWithCapacity:20];
2121
}

Coding_iOS/Views/TableListView/ShopOrderListView.m

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,63 @@ - (void)reloadData
9696
}];
9797

9898
[self.myTableView reloadData];
99+
100+
__weak typeof(self) weakSelf = self;
101+
[self.myTableView addInfiniteScrollingWithActionHandler:^{
102+
[weakSelf refreshMore];
103+
}];
99104
}
100105

106+
101107
- (void)refresh
102108
{
103109
[self.myRefreshControl endRefreshing];
104110

105111
// [self loadData];
106112
}
107113

114+
- (void)refreshMore
115+
{
116+
if (_myOrder.isLoading || !_myOrder.canLoadMore) {
117+
[_myTableView.infiniteScrollingView stopAnimating];
118+
[_myTableView.infiniteScrollingView ]
119+
return;
120+
}
121+
_myOrder.willLoadMore = YES;
122+
[self sendRequest];
123+
}
124+
125+
- (void)sendRequest
126+
{
127+
// __weak typeof(self) weakSelf = self;
128+
// [[Coding_NetAPIManager sharedManager] request_Comments_WithProjectTpoic:self. andBlock:^(id data, NSError *error) {
129+
// [weakSelf.refreshControl endRefreshing];
130+
// [weakSelf.myTableView.infiniteScrollingView stopAnimating];
131+
// if (data) {
132+
// [weakSelf.curTopic configWithComments:data];
133+
// weakSelf.myTableView.showsInfiniteScrolling = weakSelf.curTopic.canLoadMore;
134+
// }
135+
// [weakSelf.myTableView reloadData];
136+
// }];
137+
138+
__weak typeof(self) weakSelf = self;
139+
_myOrder.page = @(_myOrder.page.intValue +1);
140+
[[Coding_NetAPIManager sharedManager] request_shop_OrderListWithOrder:_myOrder andBlock:^(id data, NSError *error) {
141+
[weakSelf.myRefreshControl endRefreshing];
142+
[weakSelf endLoading];
143+
[weakSelf.myTableView.infiniteScrollingView stopAnimating];
144+
if (data) {
145+
_dataSource = [_myOrder getDataSourceByOrderType];
146+
[weakSelf.myTableView reloadData];
147+
}
148+
// [weakSelf configBlankPage:EaseBlankPageTypeTopic hasData:(weakSelf.myOrder.dateSource.count > 0) hasError:(error != nil) reloadButtonBlock:^(id sender) {
149+
// [weakSelf refresh];
150+
// }];
151+
152+
}];
153+
154+
}
155+
108156
//- (void)loadData
109157
//{
110158
// __weak typeof(self) weakSelf = self;

0 commit comments

Comments
 (0)