/** cell上的付款按钮事件 */ - (IBAction)paymentButtonClick:(UIButton *)sender { /** * @author SongXing, 15-07-31 10:07:26 * * 7、8系统上cell的父类关系不一致 */ CPMyOrderVC_Cell *cell; CGRect buttonRect = sender.frame; for (CPMyOrderVC_Cell *c in [self.tableView visibleCells]) { if (CGRectIntersectsRect(buttonRect, cell.frame)) { cell = c; } } NSIndexPath * path = [self.tableView indexPathForCell:cell]; CPRouteOrderEntity *order = self.orders[path.row]; // 比较出发日期和当前日期 NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; fmt.dateFormat = @"yyyy-MM-dd HH:mm:ss"; NSDate *orderStartTime = [fmt dateFromString:order.start_time]; NSDate *now = [NSDate date]; NSDateComponents *cmps = [orderStartTime componentsToDate:now]; //过出发时间72小时可删除, 已付款可删除 if (cmps.month >= 1 || cmps.day >= 3 || cmps.hour >= 72) { kToastWithString(@"已超过出发时间72小时,不可以再支付了")
时间: 2024-10-09 19:29:23