1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // AS_GoodsDetailsC.m
- // Asteria
- //
- // Created by 王猛 on 2023/5/6.
- //
- #import "AS_GoodsDetailsC.h"
- #import "GoodsDetailSrcView.h"
- #import "ASGoodsDetailsVM.h"
- #import "GoodsDetailsBottomV.h"
- @interface AS_GoodsDetailsC ()<TT_BaseScrollViewDelegate,RY_baseVMprotocol>
- @property (nonatomic, strong) GoodsInformationM *model;
- @property (nonatomic, strong) ASGoodsDetailsVM *VM;
- @property (nonatomic, strong) GoodsDetailSrcView *scrV;
- @property (nonatomic, strong) GoodsDetailsBottomV *bottomV;
- @end
- @implementation AS_GoodsDetailsC
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self reqNet_GoodsDetails_productGetProduct];
-
- }
- - (void)initSubviews{
- [super initSubviews];
- [self.view addSubview:self.scrV];
- [self.view addSubview:self.bottomV];
-
- }
- - (void)viewDidLayoutSubviews{
- IPhoneXHeigh
- [self.scrV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.width.mas_equalTo(KScreenWidth);
- make.top.mas_equalTo(securitytop_Y);
- make.bottom.mas_equalTo(-65-securityBottom_H);
- }];
- }
- - (void)ucm_bindvmmodel{
- self.VM = [[ASGoodsDetailsVM alloc]initDelegate:self];
- }
- -(void)reqNet_GoodsDetails_productGetProduct{
- NSMutableDictionary * params = [[NSMutableDictionary alloc] init];
- // [params setObject:@"55475" forKey:@"productId"];
- [params setObject:@"31556" forKey:@"productId"];
- [params setObject:@"USD" forKey:@"currencyCode"];
- [MBProgressHUD showHUDAddedTo:self.view animated:YES];
- [self.VM ry_requestGetApi:Goods_productGetProductsById param:params];
- }
- -(void)ry_respnsParseData:(id)data
- sucess:(BOOL)sucessOrFail
- mark:(NSString *)mark{
- [MBProgressHUD hideHUDForView:self.view animated:YES];
- if(sucessOrFail){
- if([mark isEqualToString:Goods_productGetProductsById]){
- GoodsInformationM *model = (GoodsInformationM *)data;
- self.title = model.name;
- [self.scrV tt_configData:model];
- }
- }
- }
- - (GoodsDetailSrcView *)scrV {
- if (!_scrV) {
- _scrV = [[GoodsDetailSrcView alloc] init];
- _scrV.contentSize = CGSizeMake(KScreenWidth, MAXFLOAT);
- _scrV.TTscrolldelegate = self;
- }
- return _scrV;
- }
- - (GoodsDetailsBottomV *)bottomV {
- if (!_bottomV) {
- IPhoneXHeigh
- _bottomV = [[GoodsDetailsBottomV alloc] initWithFrame:CGRectMake(0, KScreenHeight - securityBottom_H-65, KScreenWidth, securityBottom_H+65)];
- _bottomV.backgroundColor = Col_FFF;
-
- }
- return _bottomV;
- }
- @end
|