AS_GoodsDetailsC.m 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // AS_GoodsDetailsC.m
  3. // Asteria
  4. //
  5. // Created by 王猛 on 2023/5/6.
  6. //
  7. #import "AS_GoodsDetailsC.h"
  8. #import "GoodsDetailSrcView.h"
  9. #import "GoodsDetailsVM.h"
  10. @interface AS_GoodsDetailsC ()<TT_BaseScrollViewDelegate>
  11. @property (nonatomic, strong) GoodsDetailSrcView *scrV;
  12. @property (nonatomic, strong) GoodsInformationM *model;
  13. @end
  14. @implementation AS_GoodsDetailsC
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. [self reqNet_GoodsDetails_productGetProduct];
  18. }
  19. - (void)initSubviews{
  20. [super initSubviews];
  21. [self.view addSubview:self.scrV];
  22. }
  23. - (void)viewDidLayoutSubviews{
  24. IPhoneXHeigh
  25. [self.scrV mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.left.right.bottom.mas_equalTo(0);
  27. make.top.mas_equalTo(securitytop_Y);
  28. make.bottom.mas_equalTo(-65-securityBottom_H);
  29. }];
  30. }
  31. - (void)ucm_bindvmmodel{
  32. [self ucm_setupvm:[GoodsDetailsVM class]];
  33. }
  34. -(void)reqNet_GoodsDetails_productGetProduct{
  35. NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
  36. // [params setObject:self.entity_id forKey:@"entity_id"];
  37. [params setObject:@"48187" forKey:@"entity_id"];
  38. [MBProgressHUD showHUDAddedTo:self.view animated:YES];
  39. [self ucm_confignetworkforname:GoodsDetails_productGetProduct params:params vmClass:[GoodsDetailsVM class]];
  40. }
  41. - (void)ucm_vcResponseAllData:(UCMHttpRequestResponse *)allData Data:(NSMutableArray *)Data is_showmsg:(BOOL)is_showmsg is_list:(BOOL)is_list SucessORfail:(BOOL)SucessORfail has_more:(BOOL)has_more mark:(NSString *)mark extend_info:(NSDictionary *)extend_info{
  42. [MBProgressHUD hideHUDForView:self.view animated:YES];
  43. if(!SucessORfail){
  44. if([mark isEqualToString:GoodsDetails_productGetProduct]){
  45. [self.view makeToast:allData.ucm_responseMessage duration:2 position:CSToastPositionCenter title:@"" image:nil style:nil completion:^(BOOL didTap) {
  46. [self.navigationController popViewControllerAnimated:YES];
  47. }];
  48. }else{
  49. [self.view makeToast:allData.ucm_responseMessage duration:2 position:CSToastPositionCenter];
  50. }
  51. return;
  52. }
  53. if([mark isEqualToString:GoodsDetails_productGetProduct]){
  54. GoodsInformationM *model =[Data firstObject];
  55. self.title = model.title;
  56. // double totalPay = [model.price stringByReplacingOccurrencesOfString:model.price_unit withString:@""].doubleValue;
  57. self.model = model;
  58. [self.scrV tt_configData:model];
  59. }
  60. }
  61. - (GoodsDetailSrcView *)scrV {
  62. if (!_scrV) {
  63. _scrV = [[GoodsDetailSrcView alloc] init];
  64. _scrV.TTscrolldelegate = self;
  65. }
  66. return _scrV;
  67. }
  68. @end