1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- //
- // GoodsDetailsBottomV.m
- // Asteria
- //
- // Created by 王猛 on 2023/12/27.
- //
- #import "GoodsDetailsBottomV.h"
- @interface GoodsDetailsBottomV ()
- @property (nonatomic, strong) QMUIButton *shopBtn;
- @property (nonatomic, strong) QMUIButton *addCartBtn;
- @end
- @implementation GoodsDetailsBottomV
- - (void)tt_setupViews{
- UIView *lineV = [[UIView alloc]init];
- lineV.backgroundColor = [UIColor colorWithHexString:@"#666666"];
- lineV.frame = CGRectMake(0, 0, KScreenWidth, 0.5);
- [self addSubview:lineV];
- [self addSubview:self.shopBtn];
- [self addSubview:self.addCartBtn];
- [self btnSetCornRious];
-
-
- }
- -(void)btnSetCornRious{
-
- UIBezierPath* rounded = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.shopBtn.mj_w, self.shopBtn.mj_h) byRoundingCorners: UIRectCornerTopLeft | UIRectCornerBottomLeft cornerRadii:CGSizeMake(4, 4)];
- CAShapeLayer* shape = [[CAShapeLayer alloc] init];
- shape.frame = CGRectMake(0, 0, self.shopBtn.mj_w, self.shopBtn.mj_h);
- [shape setPath:rounded.CGPath];
- self.shopBtn.layer.mask = shape;
-
- UIBezierPath* rounded1 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, self.addCartBtn.mj_w, self.addCartBtn.mj_h) byRoundingCorners: UIRectCornerTopRight | UIRectCornerBottomRight cornerRadii:CGSizeMake(4, 4)];
- CAShapeLayer* shape1 = [[CAShapeLayer alloc] init];
- shape1.frame = CGRectMake(0, 0, self.addCartBtn.mj_w, self.addCartBtn.mj_h);
- [shape1 setPath:rounded1.CGPath];
- self.addCartBtn.layer.mask = shape1;
- }
- -(void)handle_shopEvent:(UIButton *)btn{
- [self generaltriggermethodType:1 data:@""];
- }
- -(void)handle_addCartEvent:(UIButton *)btn{
- [self generaltriggermethodType:2 data:@""];
- }
- - (QMUIButton *)shopBtn {
- if (!_shopBtn) {
- _shopBtn = [QMUIButton buttonWithType:UIButtonTypeCustom];
- _shopBtn.backgroundColor = [UIColor colorWithHexString:@"#82E8CD"];
- _shopBtn.frame = CGRectMake(10, 10, (self.mj_w-20)/3, 45);
- [_shopBtn setTitleColor:Col_000 forState:UIControlStateNormal];
- _shopBtn.titleLabel.font = [UIFont fontWithName:Rob_Bold size:16];
- [_shopBtn setTitle:@"SHOP NOW" forState:UIControlStateNormal];
- [_shopBtn addTarget:self action:@selector(handle_shopEvent:) forControlEvents:UIControlEventTouchUpInside];
- }
- return _shopBtn;
- }
- - (QMUIButton *)addCartBtn {
- if (!_addCartBtn) {
- _addCartBtn = [[QMUIButton alloc]init];
- _addCartBtn.frame = CGRectMake((CGRectGetMaxX(self.shopBtn.frame)), 10, (self.mj_w-20)/3*2, 45);
- _addCartBtn.backgroundColor = [UIColor colorWithHexString:@"#32CFB0"];
- [_addCartBtn setTitleColor:Col_000 forState:UIControlStateNormal];
- _addCartBtn.titleLabel.font = [UIFont fontWithName:Rob_Bold size:16];
- [_addCartBtn setTitle:@"ADD TO CART" forState:UIControlStateNormal];
- [_addCartBtn setImage:[UIImage imageNamed:@"goods_add_cart"] forState:UIControlStateNormal];
- [_addCartBtn addTarget:self action:@selector(handle_addCartEvent:) forControlEvents:UIControlEventTouchUpInside];
- _addCartBtn.imagePosition = QMUIButtonImagePositionLeft;
- _addCartBtn.spacingBetweenImageAndTitle =10.0f;
- }
- return _addCartBtn;
- }
- @end
|