AS_GoodsDetailsC.m 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 "ASGoodsDetailsVM.h"
  10. #import "GoodsDetailsBottomV.h"
  11. @interface AS_GoodsDetailsC ()<TT_BaseScrollViewDelegate,RY_baseVMprotocol>
  12. @property (nonatomic, strong) GoodsInformationM *model;
  13. @property (nonatomic, strong) ASGoodsDetailsVM *VM;
  14. @property (nonatomic, strong) GoodsDetailSrcView *scrV;
  15. @property (nonatomic, strong) GoodsDetailsBottomV *bottomV;
  16. @end
  17. @implementation AS_GoodsDetailsC
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. [self reqNet_GoodsDetails_productGetProduct];
  21. }
  22. - (void)initSubviews{
  23. [super initSubviews];
  24. [self.view addSubview:self.scrV];
  25. [self.view addSubview:self.bottomV];
  26. }
  27. - (void)viewDidLayoutSubviews{
  28. IPhoneXHeigh
  29. [self.scrV mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.left.mas_equalTo(0);
  31. make.width.mas_equalTo(KScreenWidth);
  32. make.top.mas_equalTo(securitytop_Y);
  33. make.bottom.mas_equalTo(-65-securityBottom_H);
  34. }];
  35. }
  36. - (void)ucm_bindvmmodel{
  37. self.VM = [[ASGoodsDetailsVM alloc]initDelegate:self];
  38. }
  39. -(void)reqNet_GoodsDetails_productGetProduct{
  40. NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
  41. // [params setObject:@"55475" forKey:@"productId"];
  42. [params setObject:@"31556" forKey:@"productId"];
  43. [params setObject:@"USD" forKey:@"currencyCode"];
  44. [MBProgressHUD showHUDAddedTo:self.view animated:YES];
  45. [self.VM ry_requestGetApi:Goods_productGetProductsById param:params];
  46. }
  47. -(void)ry_respnsParseData:(id)data
  48. sucess:(BOOL)sucessOrFail
  49. mark:(NSString *)mark{
  50. [MBProgressHUD hideHUDForView:self.view animated:YES];
  51. if(sucessOrFail){
  52. if([mark isEqualToString:Goods_productGetProductsById]){
  53. GoodsInformationM *model = (GoodsInformationM *)data;
  54. self.title = model.name;
  55. [self.scrV tt_configData:model];
  56. }
  57. }
  58. }
  59. - (GoodsDetailSrcView *)scrV {
  60. if (!_scrV) {
  61. _scrV = [[GoodsDetailSrcView alloc] init];
  62. _scrV.contentSize = CGSizeMake(KScreenWidth, MAXFLOAT);
  63. _scrV.TTscrolldelegate = self;
  64. }
  65. return _scrV;
  66. }
  67. - (GoodsDetailsBottomV *)bottomV {
  68. if (!_bottomV) {
  69. IPhoneXHeigh
  70. _bottomV = [[GoodsDetailsBottomV alloc] initWithFrame:CGRectMake(0, KScreenHeight - securityBottom_H-65, KScreenWidth, securityBottom_H+65)];
  71. _bottomV.backgroundColor = Col_FFF;
  72. }
  73. return _bottomV;
  74. }
  75. @end