SPSBQueryListDetailsViewController.m 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. //
  2. // SPSBQueryListDetailsViewController.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/5/28.
  6. //
  7. #import "SPSBQueryListDetailsViewController.h"
  8. #import "SPSBUIGeneralHeader.h"
  9. #import "SPSBPurchasersModel.h"
  10. #import "SPSBQueryListModel.h"
  11. #import <JXHGradientView.h>
  12. #import "SPSBCustomerServiceManager.h"
  13. #import "SPSBMakePhoneCallManager.h"
  14. #import "SPSBConfirmAlertViewController.h"
  15. #import "SPSBPickerViewController.h"
  16. #import "SPSBPickerView.h"
  17. #import "SPSBQueryListDetailsTransactionViewViewController.h"
  18. #import "SPSBRefundViewController.h"
  19. #import "SPSBPurchaseSBDetailsViewController.h"
  20. #import "SPSBPurchaseGJJDetailsViewController.h"
  21. #import "SPSBMyPurchaseOrder.h"
  22. #import "SPSBBusinessManager.h"
  23. #define spsb_queryListDetailsViewBottomButtonTag 3000
  24. #define spsb_queryListDetailsViewCityLabelTag 3000
  25. @interface SPSBQueryListDetailsViewController () {
  26. NSDictionary *_statusDic;
  27. SPSBQueryListModel *_showData;
  28. NSArray *_cityArray;
  29. UIScrollView *_bgScrollView;
  30. UIView *_statusView;
  31. UIView *_bottomView;
  32. UIButton *_refundButton;
  33. UIView *_firstView;
  34. UIView *_detailsView;
  35. SPSBMakePhoneCallManager *_makePhoneCallManager;
  36. }
  37. @end
  38. @implementation SPSBQueryListDetailsViewController
  39. - (void)viewDidLoad {
  40. [super viewDidLoad];
  41. [self initData];
  42. [self setupUI];
  43. }
  44. - (void)initData {
  45. _showData = _spsb_data[0];
  46. _statusDic = [self getOredrStatusData];
  47. [self createCityArray];
  48. _makePhoneCallManager = [[SPSBMakePhoneCallManager alloc] initWithController:self];
  49. }
  50. - (NSDictionary *)getOredrStatusData {
  51. return @{@"2" : @[@"付款成功", @"待专员跟进", @"1"],
  52. @"3" : @[_spsb_businessType == SPSBSocialInsurancePurchase ? @"地税局申报中" : @"公积金中心申报中", @"若有异常会短信/电话通知", @"1"],
  53. @"4" : @[_spsb_businessType == SPSBSocialInsurancePurchase ? @"参保成功" : @"缴存成功", @"次月中可通过官方途径查询", @"1"],
  54. @"5" : @[_spsb_businessType == SPSBSocialInsurancePurchase ? @"参保失败" : @"缴存失败", @"待专员退款,请耐心等候", @"0"],
  55. @"11" : @[@"退款成功", @"待专员跟进", @"0"],
  56. @"15" : @[@"退款中", @"待专员处理,请耐心等候", @"0"]};
  57. }
  58. - (void)createCityArray {
  59. if (_spsb_data.count == 1) return;
  60. NSMutableArray *arr = [@[] mutableCopy];
  61. for (NSInteger i = 0; i < _spsb_data.count; i ++) {
  62. SPSBQueryListModel *mode = _spsb_data[i];
  63. [arr addObject:mode.spsb_city];
  64. }
  65. _cityArray = arr;
  66. }
  67. #pragma mark - Action
  68. - (void)bottomButtonAction:(UIButton *)sender {
  69. if (sender.tag == spsb_queryListDetailsViewBottomButtonTag) {
  70. [spsb_customerServiceManager() toOnlineContactWithBaseController:self];
  71. } else if (sender.tag == spsb_queryListDetailsViewBottomButtonTag + 1) {
  72. [_makePhoneCallManager showHandleContactMenu];
  73. }
  74. }
  75. - (void)detailsButtonAction {
  76. SPSBQueryListDetailsTransactionViewViewController *vc = SPSBQueryListDetailsTransactionViewViewController.new;
  77. vc.spsb_orderNo = _showData.spsb_order_no;
  78. [self.navigationController pushViewController:vc animated:true];
  79. }
  80. - (void)changeCityAction {
  81. if (!_cityArray) return;
  82. SPSBPickerViewController *vc = SPSBPickerViewController.new;
  83. vc.spsb_dataArray = @[_cityArray];
  84. @weakify(self)
  85. vc.spsb_finishChose = ^(SPSBPickerView * _Nonnull pickerView) {
  86. @strongify(self)
  87. [self completeToChoseCityWithPickerView:pickerView];
  88. };
  89. vc.spsb_willDisplay = ^(SPSBPickerView * _Nonnull pickerView) {
  90. [pickerView chooseRow:0 inComponent:0 animated:false];
  91. };
  92. [self presentViewController:vc animated:false completion:nil];
  93. }
  94. - (void)completeToChoseCityWithPickerView:(SPSBPickerView *)pickerView {
  95. NSInteger index = [pickerView.spsb_choseArray[0] integerValue];
  96. _showData = _spsb_data[index];
  97. ((UILabel *)[_firstView viewWithTag:spsb_queryListDetailsViewCityLabelTag]).text = _showData.spsb_city;
  98. [self createStatusView];
  99. [self createDetailsView];
  100. [self judgeBottomView];
  101. }
  102. - (void)goToPurchase {
  103. spsb_setMyPurchaseOrder(SPSBMyPurchaseOrder.new);
  104. spsb_myPurchaseOrder().spsb_isSupplementaryPay = false;
  105. if (_spsb_businessType == SPSBSocialInsurancePurchase) {
  106. [self.navigationController pushViewController:SPSBPurchaseSBDetailsViewController.new animated:true];
  107. } else {
  108. [self.navigationController pushViewController:SPSBPurchaseGJJDetailsViewController.new animated:true];
  109. }
  110. }
  111. - (void)refundAction {
  112. if ([_showData.spsb_pay_status integerValue] == 2) {
  113. SPSBConfirmAlertViewController *vc = [SPSBConfirmAlertViewController alertWithTitle:@"退款申请" content:[NSString stringWithFormat:@"你确定要退%@的%@(需于截止时间前7天申请)", _showData.spsb_for_month, _spsb_businessType == SPSBSocialInsurancePurchase ? @"社保" : @"公积金"]];
  114. [vc setCancelButtonTitle:nil titleColor:nil action:^{
  115. }];
  116. @weakify(self)
  117. [vc setConfirmButtonTitle:nil titleColor:nil action:^{
  118. @strongify(self)
  119. SPSBRefundViewController *vc = SPSBRefundViewController.new;
  120. vc.spsb_data = self->_showData;
  121. [self.navigationController pushViewController:vc animated:true];
  122. }];
  123. [self presentViewController:vc animated:false completion:nil];
  124. return;
  125. }
  126. NSString *str = [self getOredrStatusData][_showData.spsb_pay_status][0];
  127. SPSBConfirmAlertViewController *vc = [SPSBConfirmAlertViewController alertWithTitle:@"退款申请" content:[NSString stringWithFormat:@"该订单状态(%@)不支持申请退款哦", str]];
  128. [vc setConfirmButtonTitle:nil titleColor:nil action:^{
  129. }];
  130. [self presentViewController:vc animated:false completion:nil];
  131. }
  132. #pragma mark - Network Action
  133. #pragma mark - UI
  134. - (void)setupUI {
  135. self.title = @"订单详情";
  136. self.view.backgroundColor = spsb_F5F5F5_color();
  137. [self createBgView];
  138. [self createBottomView];
  139. [self createStatusView];
  140. [self createFirstView];
  141. [self createDetailsView];
  142. }
  143. - (void)createBottomView {
  144. _bottomView = UIView.new;
  145. _bottomView.backgroundColor = spsb_FFFFFF_color(1.f);
  146. [self.view addSubview:_bottomView];
  147. [_bottomView makeConstraints:^(JXHConstraintMaker *make) {
  148. make.leading.and.trailing.and.bottom.equalTo(0);
  149. make.top.equalTo(self.view.safebottom).offset(-56);
  150. }];
  151. NSArray *content = @[jxh_getImage(query_service), jxh_getImage(query_phone), @"联系客服", @"拨打热线"];
  152. UIButton *tempButton = nil;
  153. for (NSInteger i = 0; i < 2; i ++) {
  154. UIButton *button = [UIButton convenienceWithFont:spsb_font(15) target:self action:@selector(bottomButtonAction:)];
  155. [button setTitle:content[i + 2] titleColor:spsb_666666_color() image:content[i] backgroundImage:nil state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
  156. [button setImageEdgeInsets:(UIEdgeInsets){0, -4.5, 0, 4.5}];
  157. [button setTitleEdgeInsets:(UIEdgeInsets){0, 4.5, 0, -4.5}];
  158. button.tag = spsb_queryListDetailsViewBottomButtonTag + i;
  159. [_bottomView addSubview:button];
  160. [button makeConstraints:^(JXHConstraintMaker *make) {
  161. make.top.equalTo(0);
  162. make.height.equalTo(56);
  163. if (tempButton) {
  164. make.leading.equalTo(tempButton.trailing);
  165. make.width.equalTo(tempButton);
  166. make.trailing.equalTo(0);
  167. } else {
  168. make.leading.equalTo(0);
  169. }
  170. }];
  171. tempButton = button;
  172. }
  173. UIView *line = [_bottomView createLine];
  174. [line makeConstraints:^(JXHConstraintMaker *make) {
  175. make.top.equalTo(14);
  176. make.bottom.equalTo(self.view.safebottom).offset(-14);
  177. make.width.equalTo(jxh_onePixe());
  178. make.leading.equalTo(tempButton);
  179. }];
  180. _refundButton = [UIButton convenienceWithFont:spsb_font(17) target:self action:@selector(refundAction)];
  181. [_refundButton setTitle:@"申请退款" titleColor:spsb_3296FB_color() state:JXHButtonControlStateNormal | JXHButtonControlStateHighlighted];
  182. _refundButton.backgroundColor = spsb_FFFFFF_color(1.f);
  183. [_bgScrollView addSubview:_refundButton];
  184. [_refundButton makeConstraints:^(JXHConstraintMaker *make) {
  185. make.bottom.equalTo(self->_bgScrollView).offset(-26);
  186. make.leading.and.trailing.equalTo(0);
  187. make.height.equalTo(50);
  188. }];
  189. [self judgeBottomView];
  190. }
  191. - (void)createStatusView {
  192. NSArray *status = _statusDic[_showData.spsb_pay_status];
  193. NSInteger judgeColor = [status[2] integerValue];
  194. if (_statusView) {
  195. [_statusView removeFromSuperview];
  196. }
  197. _statusView = UIView.new;
  198. [_bgScrollView addSubview:_statusView];
  199. [_statusView makeConstraints:^(JXHConstraintMaker *make) {
  200. make.leading.and.trailing.and.top.equalTo(0);
  201. make.height.equalTo(110);
  202. }];
  203. JXHGradientView *bgView = JXHGradientView.new;
  204. NSArray *colors;
  205. if (judgeColor == 0) {
  206. colors = @[(id)spsb_FF6467_color().CGColor, (id)spsb_FF7F85_color().CGColor];
  207. } else {
  208. colors = @[(id)spsb_5A61FD_color().CGColor, (id)spsb_3296FB_color().CGColor];
  209. }
  210. [bgView setStartPoint:(CGPoint){0, 0} endPoint:(CGPoint){1, 0} colors:colors];
  211. [_statusView addSubview:bgView];
  212. [bgView makeConstraints:^(JXHConstraintMaker *make) {
  213. make.edges.equalTo(0);
  214. }];
  215. if (judgeColor == 1) {
  216. UIImageView *imageView = [[UIImageView alloc] initWithImage:jxh_getImage(inquire_bg)];
  217. [_statusView addSubview:imageView];
  218. [imageView makeConstraints:^(JXHConstraintMaker *make) {
  219. make.trailing.equalTo(0);
  220. make.top.equalTo(32);
  221. }];
  222. }
  223. UILabel *title = [UILabel convenienceWithFont:spsb_semiboldFont(20) text:status[0] textColor:spsb_FFFFFF_color(1.f)];
  224. [_statusView addSubview:title];
  225. [title makeConstraints:^(JXHConstraintMaker *make) {
  226. make.leading.equalTo(15);
  227. make.top.equalTo(30);
  228. }];
  229. UILabel *tips = [UILabel convenienceWithFont:spsb_font(18) text:status[1] textColor:spsb_FFFFFF_color(1.f)];
  230. [_statusView addSubview:tips];
  231. [tips makeConstraints:^(JXHConstraintMaker *make) {
  232. make.leading.equalTo(15);
  233. make.top.equalTo(title.bottom).offset(11);
  234. }];
  235. if (_showData.spsb_remark.length > 0) {
  236. tips.text = _showData.spsb_remark;
  237. UIButton *detailsButton = [UIButton convenienceWithFont:spsb_font(14) target:self action:@selector(detailsButtonAction)];
  238. [detailsButton setTitle:@"查看详情" titleColor:spsb_FFFFFF_color(1.f) state:JXHButtonControlStateNormal];
  239. detailsButton.backgroundColor = spsb_000000_color(0.25);
  240. [detailsButton setLayerCornerRadius:16 corner:UIRectCornerTopLeft | UIRectCornerBottomLeft size:(CGSize){78, 32} clipToBounds:true];
  241. [_statusView addSubview:detailsButton];
  242. [detailsButton makeConstraints:^(JXHConstraintMaker *make) {
  243. make.trailing.equalTo(0);
  244. make.top.equalTo(20);
  245. make.size.equalTo(CGSizeMake(78, 32));
  246. }];
  247. }
  248. }
  249. - (void)createFirstView {
  250. _firstView = UIView.new;
  251. _firstView.backgroundColor = spsb_FFFFFF_color(1.f);
  252. [_bgScrollView addSubview:_firstView];
  253. [_firstView makeConstraints:^(JXHConstraintMaker *make) {
  254. make.leading.and.trailing.equalTo(0);
  255. make.width.equalTo(jxh_screenWidth());
  256. make.top.equalTo(110);
  257. make.height.equalTo(84);
  258. }];
  259. UILabel *timeTitle = [UILabel convenienceWithFont:spsb_font(13) text:_spsb_businessType == SPSBSocialInsurancePurchase ? @"参保月份" : @"缴存月份" textColor:spsb_999999_color()];
  260. [_firstView addSubview:timeTitle];
  261. [timeTitle makeConstraints:^(JXHConstraintMaker *make) {
  262. make.leading.equalTo(15);
  263. make.top.equalTo(16);
  264. }];
  265. UILabel *time = [UILabel convenienceWithFont:spsb_font(20) text:_showData.spsb_for_month textColor:spsb_333333_color()];
  266. [_firstView addSubview:time];
  267. [time makeConstraints:^(JXHConstraintMaker *make) {
  268. make.leading.equalTo(15);
  269. make.top.equalTo(timeTitle.bottom).offset(12);
  270. }];
  271. UILabel *cityTitle = [UILabel convenienceWithFont:spsb_font(13) text:_spsb_businessType == SPSBSocialInsurancePurchase ? @"参保城市" : @"所在城市" textColor:spsb_999999_color()];
  272. [_firstView addSubview:cityTitle];
  273. [cityTitle makeConstraints:^(JXHConstraintMaker *make) {
  274. make.leading.equalTo(20 + jxh_screenWidth() / 2);
  275. make.top.equalTo(timeTitle);
  276. }];
  277. UILabel *city = [UILabel convenienceWithFont:spsb_font(20) text:_showData.spsb_city textColor:spsb_333333_color()];
  278. city.tag = spsb_queryListDetailsViewCityLabelTag;
  279. [_firstView addSubview:city];
  280. [city makeConstraints:^(JXHConstraintMaker *make) {
  281. make.leading.equalTo(cityTitle);
  282. make.top.equalTo(time);
  283. }];
  284. if (_cityArray.count > 1) {
  285. UIImageView *arrow = [[UIImageView alloc] initWithImage:jxh_getImage(arrow-down_gray)];
  286. [_firstView addSubview:arrow];
  287. [arrow makeConstraints:^(JXHConstraintMaker *make) {
  288. make.centerY.equalTo(time);
  289. make.trailing.equalTo(-17);
  290. }];
  291. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changeCityAction)];
  292. [_firstView addGestureRecognizer:tap];
  293. }
  294. [_firstView createLineWithLocation:JXHLineLocationLeft locationOffset:jxh_screenWidth() / 2 headOffset:20 footOffset:20];
  295. }
  296. - (void)createDetailsView {
  297. if (_detailsView) {
  298. [_detailsView removeFromSuperview];
  299. }
  300. _detailsView = UIView.new;
  301. _detailsView.backgroundColor = spsb_FFFFFF_color(1.f);
  302. [_bgScrollView addSubview:_detailsView];
  303. [_detailsView makeConstraints:^(JXHConstraintMaker *make) {
  304. make.top.equalTo(self -> _firstView.bottom).offset(12);
  305. make.leading.and.trailing.equalTo(0);
  306. make.bottom.equalTo(self->_bgScrollView).offset(-88);
  307. }];
  308. UIView *firstTitleView = UIView.new;
  309. [_detailsView addSubview:firstTitleView];
  310. [firstTitleView makeConstraints:^(JXHConstraintMaker *make) {
  311. make.top.and.leading.and.trailing.equalTo(0);
  312. make.height.equalTo(50);
  313. }];
  314. NSString *title;
  315. NSString *firstTitle;
  316. NSString *firstContent;
  317. NSString *secondTitle;
  318. NSString *secondContent;
  319. NSInteger lines = 1;
  320. BOOL isRefund = false;
  321. if ([_showData.spsb_pay_status isEqualToString:@"11"] || [_showData.spsb_pay_status isEqualToString:@"15"]) {
  322. title = @"退款信息";
  323. firstTitle = _spsb_businessType == SPSBSocialInsurancePurchase ? @"参保姓名\n身份证号\n退款原因\n订单号" : @"购买人姓名\n身份证号\n退款原因\n订单号";
  324. NSString *refund = _showData.spsb_refund_reason.length > 13 ? [NSString stringWithFormat:@"%@...", [_showData.spsb_refund_reason substringWithRange:NSMakeRange(0, 13)]] : _showData.spsb_refund_reason;
  325. firstContent = [NSString stringWithFormat:@"%@\n%@\n%@\n%@", _showData.spsb_user_name, _spsb_purchasers.spsb_id_card, refund, _showData.spsb_order_no];
  326. secondTitle = @"原路退回";
  327. secondContent = _showData.spsb_pay_channel;
  328. isRefund = true;
  329. } else {
  330. lines = 0;
  331. title = _spsb_businessType == SPSBSocialInsurancePurchase ? @"参保信息" : @"缴存信息";
  332. firstTitle = _spsb_businessType == SPSBSocialInsurancePurchase ? @"参保姓名\n身份证号\n支付方式\n订单号" : @"购买人姓名\n身份证号\n支付方式\n订单号";
  333. firstContent = [NSString stringWithFormat:@"%@\n%@\n%@\n%@", _showData.spsb_user_name, _spsb_purchasers.spsb_id_card, _showData.spsb_pay_channel, _showData.spsb_order_no];
  334. secondTitle = _spsb_businessType == SPSBSocialInsurancePurchase ? @"社保\n服务费" : @"公积金\n服务费";
  335. secondContent = _spsb_businessType == SPSBSocialInsurancePurchase ? [NSString stringWithFormat:@"¥%.2lf\n¥%.2lf", _showData.spsb_shebaos.floatValue, _showData.spsb_shebao_charge.floatValue] : [NSString stringWithFormat:@"¥%.2lf\n¥%.2lf", _showData.spsb_funds.floatValue, _showData.spsb_fund_charge.floatValue];
  336. if (![_showData.spsb_card_charge isEqualToString:@"0"]) {
  337. secondTitle = [secondTitle stringByAppendingString:@"\n社保卡"];
  338. secondContent = [secondContent stringByAppendingFormat:@"\n¥%.2lf", _showData.spsb_card_charge.floatValue];
  339. }
  340. if (![_showData.spsb_pre_charge isEqualToString:@"0"]) {
  341. secondTitle = [secondTitle stringByAppendingString:@"\n预付费"];
  342. secondContent = [secondContent stringByAppendingFormat:@"\n¥%.2lf", _showData.spsb_pre_charge.floatValue];
  343. }
  344. secondTitle = [secondTitle stringByAppendingString:@"\n现金券(抵扣)"];
  345. secondContent = [secondContent stringByAppendingFormat:@"\n- ¥%.2lf", _showData.spsb_coupon_price.floatValue];
  346. }
  347. if ([_showData.spsb_pay_status isEqualToString:@"15"]) {
  348. firstTitle = [firstTitle stringByAppendingString:@"\n申请时间"];
  349. firstContent = [firstContent stringByAppendingFormat:@"\n%@", _showData.spsb_refund_time];
  350. } else {
  351. firstTitle = [firstTitle stringByAppendingString:@"\n成交时间"];
  352. firstContent = [firstContent stringByAppendingFormat:@"\n%@", _showData.spsb_pay_time];
  353. }
  354. UILabel *firstTitleLabel = [UILabel convenienceWithFont:spsb_font(15) text:title textColor:spsb_333333_color()];
  355. [firstTitleView addSubview:firstTitleLabel];
  356. [firstTitleLabel makeConstraints:^(JXHConstraintMaker *make) {
  357. make.leading.equalTo(15);
  358. make.centerY.equalTo(firstTitleView);
  359. }];
  360. [firstTitleView createLineWithLocation:JXHLineLocationBottom headOffset:15 footOffset:0];
  361. UILabel *left = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_999999_color() limitWidth:jxh_screenWidth()];
  362. [left setAttributedStringWithText:firstTitle lineSpacing:8 lines:0];
  363. [_detailsView addSubview:left];
  364. [left makeConstraints:^(JXHConstraintMaker *make) {
  365. make.top.equalTo(firstTitleView.bottom).offset(27);
  366. make.leading.equalTo(15);
  367. }];
  368. UILabel *right = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_666666_5_color() limitWidth:jxh_screenWidth()];
  369. [right setAttributedStringWithText:firstContent textAlignment:NSTextAlignmentRight lineSpacing:8 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:0];
  370. [_detailsView addSubview:right];
  371. [right makeConstraints:^(JXHConstraintMaker *make) {
  372. make.top.equalTo(firstTitleView.bottom).offset(27);
  373. make.trailing.equalTo(-15);
  374. }];
  375. UIView *interval = UIView.new;
  376. interval.backgroundColor = spsb_F5F5F5_color();
  377. [_detailsView addSubview:interval];
  378. [interval makeConstraints:^(JXHConstraintMaker *make) {
  379. make.leading.and.trailing.equalTo(0);
  380. make.top.equalTo(right.bottom).offset(27);
  381. make.height.equalTo(12);
  382. }];
  383. UIView *secondTitleView = UIView.new;
  384. [_detailsView addSubview:secondTitleView];
  385. [secondTitleView makeConstraints:^(JXHConstraintMaker *make) {
  386. make.top.equalTo(interval.bottom);
  387. make.leading.and.trailing.equalTo(0);
  388. make.height.equalTo(50);
  389. }];
  390. UILabel *secondeTitleLabel = [UILabel convenienceWithFont:spsb_font(15) text:@"实付款" textColor:spsb_333333_color()];
  391. [secondTitleView addSubview:secondeTitleLabel];
  392. [secondeTitleLabel makeConstraints:^(JXHConstraintMaker *make) {
  393. make.leading.equalTo(15);
  394. make.centerY.equalTo(secondTitleView);
  395. }];
  396. UILabel *actual = [UILabel convenienceWithFont:spsb_font(17) text:[NSString stringWithFormat:@"¥%.2lf", _showData.spsb_pay_actual.floatValue] textColor:spsb_FF5E5E_color() textAlignment:NSTextAlignmentRight];
  397. [secondTitleView addSubview:actual];
  398. [actual makeConstraints:^(JXHConstraintMaker *make) {
  399. make.trailing.equalTo(-15);
  400. make.centerY.equalTo(secondTitleView);
  401. }];
  402. [secondTitleView createLineWithLocation:JXHLineLocationBottom headOffset:15 footOffset:0];
  403. left = [UILabel convenienceWithFont:spsb_font(14) textColor:isRefund ? spsb_333333_color() : spsb_999999_color() limitWidth:jxh_screenWidth()];
  404. [left setAttributedStringWithText:secondTitle lineSpacing:8 lines:lines];
  405. [_detailsView addSubview:left];
  406. right = [UILabel convenienceWithFont:spsb_font(14) textColor:spsb_666666_color() limitWidth:jxh_screenWidth()];
  407. [right setAttributedStringWithText:secondContent textAlignment:NSTextAlignmentRight lineSpacing:8 lineHeight:0 paragraphSpacing:0 lineBreakMode:NSLineBreakByTruncatingTail lines:lines];
  408. [_detailsView addSubview:right];
  409. if ([_showData.spsb_pay_status isEqualToString:@"11"] || [_showData.spsb_pay_status isEqualToString:@"15"]) {
  410. [left makeConstraints:^(JXHConstraintMaker *make) {
  411. make.top.equalTo(secondTitleView.bottom);
  412. make.leading.equalTo(15);
  413. make.height.equalTo(50);
  414. }];
  415. [right makeConstraints:^(JXHConstraintMaker *make) {
  416. make.top.equalTo(secondTitleView.bottom);
  417. make.trailing.equalTo(-15);
  418. make.height.equalTo(50);
  419. make.bottom.equalTo(0);
  420. }];
  421. } else {
  422. [left makeConstraints:^(JXHConstraintMaker *make) {
  423. make.top.equalTo(secondTitleView.bottom).offset(27);
  424. make.leading.equalTo(15);
  425. }];
  426. [right makeConstraints:^(JXHConstraintMaker *make) {
  427. make.top.equalTo(secondTitleView.bottom).offset(27);
  428. make.trailing.equalTo(-15);
  429. }];
  430. UIView *line = [_detailsView createLine];
  431. [line makeConstraints:^(JXHConstraintMaker *make) {
  432. make.top.equalTo(right.bottom).offset(27);
  433. make.leading.and.trailing.equalTo(0);
  434. make.height.equalTo(jxh_onePixe());
  435. }];
  436. UIButton *purchaseButton = [UIButton convenienceWithTarget:self action:@selector(goToPurchase)];
  437. [_detailsView addSubview:purchaseButton];
  438. [purchaseButton makeConstraints:^(JXHConstraintMaker *make) {
  439. make.top.equalTo(line.bottom);
  440. make.leading.and.trailing.and.bottom.equalTo(0);
  441. make.height.equalTo(60);
  442. }];
  443. UIImageView *icon = [[UIImageView alloc] initWithImage:_spsb_businessType == SPSBSocialInsurancePurchase ? jxh_getImage(search_shebao_jiao) : jxh_getImage(search_gjj_jiao)];
  444. [purchaseButton addSubview:icon];
  445. [icon makeConstraints:^(JXHConstraintMaker *make) {
  446. make.leading.equalTo(15);
  447. make.centerY.equalTo(purchaseButton);
  448. make.size.equalTo(CGSizeMake(36, 36));
  449. }];
  450. UILabel *label = [UILabel convenienceWithFont:spsb_font(16) text:_spsb_businessType == SPSBSocialInsurancePurchase ? @"自助缴社保" : @"自助缴公积金" textColor:spsb_666666_color()];
  451. [purchaseButton addSubview:label];
  452. [label makeConstraints:^(JXHConstraintMaker *make) {
  453. make.leading.equalTo(icon.trailing).offset(12);
  454. make.centerY.equalTo(purchaseButton);
  455. }];
  456. UIImageView *arrow = [[UIImageView alloc] initWithImage:jxh_getImage(list_arrow)];
  457. [purchaseButton addSubview:arrow];
  458. [arrow makeConstraints:^(JXHConstraintMaker *make) {
  459. make.trailing.equalTo(-15);
  460. make.centerY.equalTo(purchaseButton);
  461. }];
  462. }
  463. }
  464. - (void)judgeBottomView {
  465. if ([_showData.spsb_pay_status isEqualToString:@"2"]) {
  466. _bottomView.hidden = true;
  467. _refundButton.hidden = false;
  468. } else {
  469. _bottomView.hidden = false;
  470. _refundButton.hidden = true;
  471. }
  472. }
  473. - (void)createBgView {
  474. _bgScrollView = [UIScrollView convenienceWithBackgroundColor:spsb_F5F5F5_color()];
  475. [self.view addSubview:_bgScrollView];
  476. [_bgScrollView makeConstraints:^(JXHConstraintMaker *make) {
  477. make.top.and.leading.and.trailing.equalTo(0);
  478. make.bottom.equalTo(self.view.safebottom);
  479. }];
  480. }
  481. @end
  482. #undef spsb_queryListDetailsViewBottomButtonTag
  483. #undef spsb_queryListDetailsViewCityLabelTag