| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 | ////  AS_GoodsDetailsC.m//  Asteria////  Created by 王猛 on 2023/5/6.//#import "AS_GoodsDetailsC.h"#import "GoodsDetailSrcView.h"#import "ASGoodsDetailsVM.h"#import "GoodsDetailsBottomV.h"#import "AS_GoodsReviewsListC.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];    [self ucm_subVeiwsTapBlock];    }- (void)initSubviews{    [super initSubviews];    [self.view addSubview:self.scrV];    [self.view addSubview:self.bottomV];    }- (void)ucm_subVeiwsTapBlock{    @weakify(self)    self.bottomV.ViewtapClose = ^(NSInteger num, id  _Nonnull data) {        @strongify(self)        [self action_GoodsSizeC];    };}- (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:self.entity_id forKey:@"productId"];    [params setObject:@"USD" forKey:@"currencyCode"];    [MBProgressHUD showHUDAddedTo:self.view animated:YES];    [self.VM ry_requestGetApi:Goods_productGetProductsById param:params];}-(void)ry_respnsData:(nullable id)data            parseAry:(nullable NSMutableArray *)arry              sucess:(BOOL)sucessOrFail                mark:(NSString *)mark          reqNetType:(ReqNetType)reqNetType{    [MBProgressHUD hideHUDForView:self.view animated:YES];    if(sucessOrFail){        if([mark isEqualToString:Goods_productGetProductsById]){            GoodsInformationM *model = (GoodsInformationM *)[arry firstObject];            self.model = model;            self.title = model.name;            [self.scrV tt_configData:model];        }    }}#pragma mark - **************** TT_BaseScrollViewDelegate ****************-(void)tengteng_configtapchilds:(NSInteger)num data:(id)data{    if(num == GoodsReviewsTag){        [self action_GoodsReviewsListC];    }}#pragma mark - **************** action ****************-(void)action_GoodsReviewsListC{    AS_GoodsReviewsListC *allPic = [[AS_GoodsReviewsListC alloc]init];    allPic.goodsM = self.model;    [self.navigationController pushViewController:allPic animated:YES];}-(void)action_GoodsSizeC{    UIViewController *viewController = [[CTMediator sharedInstance] Goods_GoodsSizeC:@{@"model":self.model}];    viewController.modalPresentationStyle = UIModalPresentationFullScreen;    [self presentViewController:viewController animated:YES completion:nil];}#pragma mark - **************** lazy ****************- (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
 |