// // DRDetailGuideView.m // YouHuiProject // // Created by 小花 on 2018/7/13. // Copyright © 2018年 kuxuan. All rights reserved. // #import "DRDetailGuideView.h" @implementation DRDetailGuideView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor yhGrayColor]; [self initSubViews]; } return self; } - (void)initSubViews { UIImageView *icon = [[UIImageView alloc] initWithFrame:CGRectMake(16, 0, 17, 15)]; icon.centerY = self.height/2; icon.image = [UIImage imageNamed:@"money_de"]; icon.userInteractionEnabled = YES; [self addSubview:icon]; UILabel *des = [[UILabel alloc] initWithFrame:CGRectMake(icon.right+5, 0, SCREEN_WIDTH-50, self.height)]; des.userInteractionEnabled = YES; des.textColor = [UIColor homeRedColor]; des.text = @"您自己购买可得佣金,您分享商品被别人购买也得佣金!"; des.font = [UIFont systemFontOfSize:12]; des.numberOfLines = 2; [self addSubview:des]; UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(self.width-7-15, 0, 7, 12)]; img.image = [UIImage imageNamed:@"next_right"]; img.centerY = self.height/2; [self addSubview:img]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapViewAction)]; [self addGestureRecognizer:tap]; } - (void)tapViewAction { [MobClick event:GoodsDetailVipInfo]; if (self.tapAction) { self.tapAction(); } } @end