YMMineInfoView.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. //
  2. // YMMineInfoView.m
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2024/2/15.
  6. // Copyright © 2024 MS. All rights reserved.
  7. //
  8. #import "YMMineInfoView.h"
  9. #import "YMMineViewModel.h"
  10. #define kQuantityInfoGridView_rowCount 4
  11. #define kQuantityInfoGridView_itemHeight 60
  12. @interface YMMineInfoView ()
  13. /// 我的VM
  14. @property (nonatomic, strong) YMMineViewModel *viewModel;
  15. /// 用户头像视图
  16. @property (nonatomic, strong) UIView *bgv;
  17. /// 用户头像视图
  18. @property (nonatomic, strong) UIView *bgcv;
  19. /// 用户头像视图
  20. @property (nonatomic, strong) UIImageView *userAvatarView;
  21. /// 用户昵称标签
  22. @property (nonatomic, strong) UILabel *userNicknameLb;
  23. /// 用户VIP图标
  24. @property (nonatomic, strong) UIImageView *userVIPIcon;
  25. /// 用户Code视图
  26. @property (nonatomic, strong) UIView *userCodeView;
  27. /// 用户Code标签
  28. @property (nonatomic, strong) UIImageView *userCodeIcon;
  29. /// 用户Code标签
  30. @property (nonatomic, strong) UILabel *userCodeLb;
  31. /// 用户Code复制图标
  32. @property (nonatomic, strong) UIImageView *userCodeCopyIcon;
  33. /// 用户简介标签
  34. @property (nonatomic, strong) UILabel *userIntroLb;
  35. /// 编辑资料
  36. @property (nonatomic, strong) UIButton *editProfileBtn;
  37. /// 数量信息宫格配置
  38. @property (nonatomic, strong) BAGridView_Config *quantityInfoGridViewConfig;
  39. /// 数量信息宫格视图
  40. @property (nonatomic, strong) BAGridView *quantityInfoGridView;
  41. @property (nonatomic, strong) UIButton *personBtn;
  42. @property (nonatomic, strong) UIButton *customButton;
  43. @property (nonatomic, strong) UIButton *settingButton;
  44. @end
  45. @implementation YMMineInfoView
  46. - (void)ym_setupViews{
  47. [self addSubview:self.bgv];
  48. [self addSubview:self.bgcv];
  49. [self addSubview:self.settingButton];
  50. [self addSubview:self.customButton];
  51. [self addSubview:self.userAvatarView];
  52. [self addSubview:self.personBtn];
  53. [self addSubview:self.userNicknameLb];
  54. [self addSubview:self.userVIPIcon];
  55. [self addSubview:self.userCodeView];
  56. [self.userCodeView addSubview:self.userCodeIcon];
  57. [self.userCodeView addSubview:self.userCodeLb];
  58. [self.userCodeView addSubview:self.userCodeCopyIcon];
  59. [self addSubview:self.userIntroLb];
  60. [self addSubview:self.editProfileBtn];
  61. [self addSubview:self.quantityInfoGridView];
  62. [self setNeedsUpdateConstraints];
  63. [self updateConstraintsIfNeeded];
  64. }
  65. - (void)updateConstraints{
  66. [self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.bottom.equalTo(self.mas_top).offset(NavBarHeight-10);
  68. make.right.equalTo(self).offset(adapt(-20));
  69. make.width.height.mas_equalTo(adapt(24));
  70. }];
  71. [self.customButton mas_makeConstraints:^(MASConstraintMaker *make) {
  72. make.bottom.equalTo(self.settingButton);
  73. make.right.equalTo(self.settingButton.mas_left).offset(adapt(-16));
  74. make.width.height.mas_equalTo(adapt(24));
  75. }];
  76. [self.personBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  77. make.bottom.equalTo(self.mas_top).offset(NavBarHeight-10);
  78. make.left.equalTo(self).offset(adapt(20));
  79. make.width.mas_equalTo(adapt(110));
  80. make.height.mas_equalTo(adapt(28));
  81. }];
  82. [self.bgv mas_makeConstraints:^(MASConstraintMaker *make) {
  83. make.top.equalTo(self.personBtn.mas_bottom).offset(20);
  84. make.left.bottom.right.equalTo(self);
  85. }];
  86. [self.bgcv mas_makeConstraints:^(MASConstraintMaker *make) {
  87. make.top.equalTo(self.bgv.mas_top).offset(20);
  88. make.left.bottom.right.equalTo(self);
  89. }];
  90. [self.userAvatarView mas_makeConstraints:^(MASConstraintMaker *make) {
  91. make.top.equalTo(self.bgv.mas_top).offset(adapt(7));
  92. make.left.equalTo(self.bgv.mas_left).offset(adapt(14));
  93. make.width.height.mas_equalTo(adapt(70));
  94. }];
  95. [self.userNicknameLb mas_makeConstraints:^(MASConstraintMaker *make) {
  96. make.top.equalTo(self.userAvatarView.mas_top).offset(adapt(7));
  97. make.left.equalTo(self.userAvatarView.mas_right).offset(adapt(10));
  98. make.right.lessThanOrEqualTo(self.editProfileBtn.mas_left).offset(adapt(-8));
  99. }];
  100. // 横向抗压缩优先级低
  101. [self.userNicknameLb setContentCompressionResistancePriority:(UILayoutPriorityDefaultLow) forAxis:(UILayoutConstraintAxisHorizontal)];
  102. [self.userCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
  103. make.top.equalTo(self.userAvatarView.mas_top).offset(adapt(34));
  104. make.left.equalTo(self.userAvatarView.mas_right).offset(adapt(10));
  105. make.height.mas_equalTo(adapt(15));
  106. }];
  107. [self.userCodeIcon mas_makeConstraints:^(MASConstraintMaker *make) {
  108. make.centerY.equalTo(self.userCodeView.mas_centerY);
  109. make.left.equalTo(self.userCodeView).offset(adapt(0));
  110. }];
  111. [self.userCodeLb mas_makeConstraints:^(MASConstraintMaker *make) {
  112. make.centerY.equalTo(self.userCodeView.mas_centerY);
  113. make.left.equalTo(self.userCodeView).offset(adapt(0));
  114. }];
  115. [self.userCodeCopyIcon mas_makeConstraints:^(MASConstraintMaker *make) {
  116. make.centerY.equalTo(self.userCodeView.mas_centerY);
  117. make.left.equalTo(self.userCodeLb.mas_right).offset(adapt(5));
  118. make.right.equalTo(self.userCodeView).offset(adapt(-10));
  119. make.width.height.mas_equalTo(adapt(12));
  120. }];
  121. [self.userVIPIcon mas_makeConstraints:^(MASConstraintMaker *make) {
  122. make.centerY.equalTo(self.userNicknameLb.mas_centerY).offset(adapt(0));
  123. make.left.equalTo(self.userNicknameLb.mas_right).offset(adapt(10));
  124. make.right.lessThanOrEqualTo(self.editProfileBtn.mas_left).offset(adapt(-8));
  125. make.width.mas_equalTo(adapt(63));
  126. make.height.mas_equalTo(adapt(23));
  127. }];
  128. [self.userIntroLb mas_makeConstraints:^(MASConstraintMaker *make) {
  129. make.top.equalTo(self.userCodeView.mas_bottom).offset(adapt(10));
  130. make.left.equalTo(self.userAvatarView.mas_right).offset(adapt(10));
  131. make.right.equalTo(self).offset(adapt(-10));
  132. }];
  133. [self.editProfileBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  134. make.centerY.equalTo(self.userAvatarView.mas_centerY);
  135. make.right.equalTo(self.mas_right).offset(adapt(0));
  136. make.width.mas_equalTo(adapt(80));
  137. make.height.mas_equalTo(adapt(28));
  138. }];
  139. [self.quantityInfoGridView mas_makeConstraints:^(MASConstraintMaker *make) {
  140. make.top.equalTo(self.userAvatarView.mas_bottom).offset(10);
  141. make.left.equalTo(self).offset(adapt(15));
  142. make.right.equalTo(self).offset(adapt(-15));
  143. make.bottom.equalTo(self).offset(adapt(-10));
  144. make.height.mas_equalTo(adapt(60));
  145. }];
  146. [super updateConstraints];
  147. }
  148. - (void)ym_bindViewModel:(YMMineViewModel *)viewModel{
  149. if (!viewModel) {
  150. return;
  151. }
  152. _viewModel = viewModel;
  153. @weakify(self)
  154. [[[[RACObserve(self.viewModel, userAvatar) distinctUntilChanged] deliverOnMainThread] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(NSString * userAvatar) {
  155. @strongify(self)
  156. [self.userAvatarView sd_setImageWithURL:[LCTools getImageUrlWithAddress:userAvatar]];
  157. }];
  158. RAC(self.userNicknameLb, text) = RACObserve(self.viewModel, userNickname);
  159. [[[[RACObserve(self.viewModel, isVIP) distinctUntilChanged] deliverOnMainThread] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(NSNumber * isVIP) {
  160. @strongify(self)
  161. if ([isVIP boolValue]) {
  162. self.userVIPIcon.hidden = NO;
  163. } else {
  164. self.userVIPIcon.hidden = YES;
  165. }
  166. }];
  167. [[[[RACObserve(self.viewModel, userCode) distinctUntilChanged] deliverOnMainThread] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(NSString * userCode) {
  168. @strongify(self)
  169. self.userCodeLb.text = stringFormat(@"ID: %@",userCode);
  170. }];
  171. RAC(self.userIntroLb, text) = RACObserve(self.viewModel, userIntro);
  172. [[[[RACObserve(self.viewModel, quantityInfoGridDataArray) distinctUntilChanged] deliverOnMainThread] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(NSArray * quantityInfoGridDataArray) {
  173. @strongify(self)
  174. self.quantityInfoGridView.config = self.quantityInfoGridViewConfig;
  175. self.quantityInfoGridViewConfig.dataArray = quantityInfoGridDataArray;
  176. [self.quantityInfoGridView mas_remakeConstraints:^(MASConstraintMaker *make) {
  177. make.top.equalTo(self.userAvatarView.mas_bottom).offset(adapt(10));
  178. make.left.equalTo(self).offset(adapt(15));
  179. make.right.equalTo(self).offset(adapt(-15));
  180. make.bottom.equalTo(self).offset(adapt(-10));
  181. make.height.mas_equalTo(adapt(60));
  182. }];
  183. }];
  184. }
  185. - (UIButton *)personBtn{
  186. if (!_personBtn) {
  187. _personBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  188. _personBtn.hidden = YES;
  189. [_personBtn setImage:ImageByName(@"ym_mine_go_person_center") forState:UIControlStateNormal];
  190. [_personBtn setTitle:@"个人主页" forState:UIControlStateNormal];
  191. [_personBtn setTitleColor:HexColorFromRGB(0xFFFFFF) forState:UIControlStateNormal];
  192. _personBtn.titleLabel.font = LCBoldFont(18);
  193. _personBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
  194. [_personBtn setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
  195. CGFloat margin = 3;
  196. _personBtn.imageEdgeInsets = UIEdgeInsetsMake(0, margin, 0, -margin);
  197. _personBtn.backgroundColor = UIColor.clearColor;
  198. _personBtn.layer.cornerRadius = adapt(10);
  199. _personBtn.layer.masksToBounds = true;
  200. WS(weakSelf)
  201. [[[_personBtn rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(__kindof UIButton * _Nullable sender) {
  202. [weakSelf.viewModel.commonFunctionsOperationSubject sendNext:@(YMCommonFunctionsTypePersonalPage)];
  203. }];
  204. }
  205. return _personBtn;
  206. }
  207. - (UIView *)bgv {
  208. if (!_bgv) {
  209. _bgv = [[UIView alloc] init];
  210. _bgv.backgroundColor = UIColor.clearColor;
  211. _bgv.layer.cornerRadius = adapt(15);
  212. _bgv.layer.masksToBounds = YES;
  213. }
  214. return _bgv;
  215. }
  216. - (UIView *)bgcv {
  217. if (!_bgcv) {
  218. _bgcv = [[UIView alloc] init];
  219. _bgcv.backgroundColor = UIColor.clearColor;
  220. }
  221. return _bgcv;
  222. }
  223. - (UIImageView *)userAvatarView{
  224. if (!_userAvatarView) {
  225. _userAvatarView = [[UIImageView alloc]init];
  226. _userAvatarView.contentMode = UIViewContentModeScaleAspectFill;
  227. _userAvatarView.backgroundColor = UIColor.lightGrayColor;
  228. _userAvatarView.layer.cornerRadius = adapt(70)/2;
  229. _userAvatarView.layer.masksToBounds = YES;
  230. _userAvatarView.userInteractionEnabled = YES;
  231. WS(weakSelf)
  232. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
  233. [_userAvatarView addGestureRecognizer:tap];
  234. [[[tap rac_gestureSignal] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(id x) {
  235. [weakSelf.viewModel.commonFunctionsOperationSubject sendNext:@(YMCommonFunctionsTypePersonalPage)];
  236. }];
  237. }
  238. return _userAvatarView;
  239. }
  240. - (UIButton *)settingButton{
  241. if (!_settingButton) {
  242. _settingButton = [UIButton buttonWithType:UIButtonTypeCustom];
  243. [_settingButton setImage:ImageByName(@"ym_mine_right_setting") forState:UIControlStateNormal];
  244. WS(weakSelf)
  245. [[[_settingButton rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(__kindof UIButton * _Nullable sender) {
  246. [weakSelf.viewModel.commonFunctionsOperationSubject sendNext:@(YMCommonFunctionsTypeSystemSetting)];
  247. }];
  248. }
  249. return _settingButton;
  250. }
  251. - (UIButton *)customButton{
  252. if (!_customButton) {
  253. _customButton = [UIButton buttonWithType:UIButtonTypeCustom];
  254. [_customButton setImage:ImageByName(@"ym_mine_right_custom") forState:UIControlStateNormal];
  255. WS(weakSelf)
  256. [[[_customButton rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(__kindof UIButton * _Nullable sender) {
  257. [weakSelf.viewModel.commonFunctionsOperationSubject sendNext:@(YMCommonFunctionsTypeOnlineCustomerSupport)];
  258. }];
  259. }
  260. return _customButton;
  261. }
  262. - (UILabel *)userNicknameLb{
  263. if (!_userNicknameLb) {
  264. _userNicknameLb = [[UILabel alloc]init];
  265. _userNicknameLb.font = LCBoldFont(18);
  266. _userNicknameLb.textColor = UIColor.blackColor;//HexColorFromRGB(0x115B3B);
  267. _userNicknameLb.textAlignment = NSTextAlignmentLeft;
  268. _userNicknameLb.text = @"******";
  269. }
  270. return _userNicknameLb;
  271. }
  272. - (UIImageView *)userVIPIcon{
  273. if (!_userVIPIcon) {
  274. _userVIPIcon = [[UIImageView alloc]init];
  275. _userVIPIcon.image = ImageByName(@"ym_mine_vip_icon");
  276. }
  277. return _userVIPIcon;
  278. }
  279. - (UIView *)userCodeView{
  280. if (!_userCodeView) {
  281. _userCodeView = [[UIView alloc]init];
  282. // _userCodeView.backgroundColor = HexColorFromRGBA(0x000000,0.5);
  283. // _userCodeView.layer.cornerRadius = adapt(15)/2;
  284. // _userCodeView.layer.masksToBounds = YES;
  285. // _userCodeView.userInteractionEnabled = YES;
  286. WS(weakSelf)
  287. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] init];
  288. [_userCodeView addGestureRecognizer:tap];
  289. [[[tap rac_gestureSignal] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(id x) {
  290. [weakSelf.viewModel copyUserId];
  291. }];
  292. }
  293. return _userCodeView;
  294. }
  295. - (UIImageView *)userCodeIcon {
  296. if (!_userCodeIcon) {
  297. _userCodeIcon = [[UIImageView alloc] init];
  298. _userCodeIcon.hidden = YES;
  299. _userCodeIcon.image = ImageByName(@"ym_mine_id_icon");
  300. }
  301. return _userCodeIcon;
  302. }
  303. - (UILabel *)userCodeLb{
  304. if (!_userCodeLb) {
  305. _userCodeLb = [[UILabel alloc]init];
  306. _userCodeLb.font = [UIFont italicSystemFontOfSize:12];
  307. _userCodeLb.textColor = UIColor.blackColor;
  308. _userCodeLb.textAlignment = NSTextAlignmentLeft;
  309. _userCodeLb.text = @"ID:***";
  310. }
  311. return _userCodeLb;
  312. }
  313. - (UIImageView *)userCodeCopyIcon{
  314. if (!_userCodeCopyIcon) {
  315. _userCodeCopyIcon = [[UIImageView alloc]init];
  316. //_userCodeCopyIcon.image = [UIImage systemImageNamed:@"doc.on.doc"];
  317. _userCodeCopyIcon.image = ImageByName(@"ym_mine_copy_icon");
  318. _userCodeCopyIcon.tintColor = UIColor.blackColor;
  319. //_userCodeCopyIcon.preferredSymbolConfiguration = [UIImageSymbolConfiguration configurationWithWeight:UIImageSymbolWeightMedium];
  320. }
  321. return _userCodeCopyIcon;
  322. }
  323. - (UILabel *)userIntroLb{
  324. if (!_userIntroLb) {
  325. _userIntroLb = [[UILabel alloc]init];
  326. _userIntroLb.font = LCFont(10);
  327. _userIntroLb.textColor = UIColor.blackColor;
  328. _userIntroLb.textAlignment = NSTextAlignmentLeft;
  329. _userIntroLb.text = @"这个人很懒,什么都没有留下...";
  330. _userIntroLb.numberOfLines = 0;
  331. }
  332. return _userIntroLb;
  333. }
  334. - (UIButton *)editProfileBtn{
  335. if (!_editProfileBtn) {
  336. _editProfileBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  337. _editProfileBtn.hidden = NO;
  338. _editProfileBtn.titleLabel.font = LCFont(12);
  339. [_editProfileBtn setTitle:@"编辑资料" forState:UIControlStateNormal];
  340. [_editProfileBtn setTitleColor:HexColorFromRGB(0xFFFFFF) forState:UIControlStateNormal];
  341. [_editProfileBtn setImage:ImageByName(@"vqu_images_ic_profile_edit_arrow") forState:UIControlStateNormal];
  342. _editProfileBtn.backgroundColor = HexColorFromRGBA(0x000000, 0.3);
  343. _editProfileBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
  344. [_editProfileBtn setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft];
  345. CGFloat margin = 3;
  346. _editProfileBtn.imageEdgeInsets = UIEdgeInsetsMake(0, margin, 0, -margin);
  347. CAShapeLayer *shapeLayer = [CAShapeLayer layer];
  348. shapeLayer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, adapt(80), adapt(28)) byRoundingCorners: UIRectCornerTopLeft | UIRectCornerBottomLeft cornerRadii:CGSizeMake(adapt(14),adapt(14))].CGPath;
  349. _editProfileBtn.layer.mask = shapeLayer;
  350. WS(weakSelf)
  351. [[[_editProfileBtn rac_signalForControlEvents:UIControlEventTouchUpInside] takeUntil:self.rac_willDeallocSignal] subscribeNext:^(__kindof UIButton * _Nullable sender) {
  352. [weakSelf.viewModel gotoEditProfile];
  353. }];
  354. }
  355. return _editProfileBtn;
  356. }
  357. - (BAGridView_Config *)quantityInfoGridViewConfig{
  358. if (!_quantityInfoGridViewConfig) {
  359. _quantityInfoGridViewConfig = [[BAGridView_Config alloc]init];
  360. _quantityInfoGridViewConfig.scrollEnabled = NO;
  361. // 是否显示分割线
  362. _quantityInfoGridViewConfig.showLineView = NO;
  363. // item:分割线颜色,默认:BAKit_Color_Gray_11【BAKit_Color_RGB(248, 248, 248)】
  364. _quantityInfoGridViewConfig.ba_gridView_lineColor = HexColorFromRGB(0xededed);
  365. // item:每行 item 的个数
  366. _quantityInfoGridViewConfig.ba_gridView_rowCount = kQuantityInfoGridView_rowCount;
  367. // item:高度/宽度
  368. _quantityInfoGridViewConfig.ba_gridView_itemHeight = kQuantityInfoGridView_itemHeight;
  369. // item:title 颜色,默认:BAKit_Color_Black【[UIColor blackColor]】
  370. _quantityInfoGridViewConfig.ba_gridView_titleColor = UIColor.blackColor;
  371. _quantityInfoGridViewConfig.ba_gridView_titleDescColor = UIColor.blackColor;
  372. // item:title Font,默认:图文样式下 16,两行文字下(上25,下12)
  373. _quantityInfoGridViewConfig.ba_gridView_titleFont = LCBoldFont(18);
  374. _quantityInfoGridViewConfig.ba_gridView_titleDescFont = LCFont(12);
  375. // item:背景颜色,默认:白色
  376. _quantityInfoGridViewConfig.ba_gridView_backgroundColor = BAKit_Color_Clear_pod;
  377. // item:背景选中颜色,默认:无色
  378. _quantityInfoGridViewConfig.ba_gridView_selectedBackgroundColor = BAKit_Color_Clear_pod;
  379. // badge
  380. _quantityInfoGridViewConfig.ba_gridView_badgeType = kBAGridViewBadgeType_Center;
  381. _quantityInfoGridViewConfig.ba_gridView_badgeFont = LCFont(10);
  382. _quantityInfoGridViewConfig.ba_gridView_badgeRectCorners = UIRectCornerTopLeft | UIRectCornerTopRight |UIRectCornerBottomLeft| UIRectCornerBottomRight;
  383. _quantityInfoGridViewConfig.ba_gridView_badgeCornerRadius = 7;
  384. _quantityInfoGridViewConfig.ba_gridView_badgeBgColor = HexColorFromRGB(0xF4003F);
  385. _quantityInfoGridViewConfig.ba_gridView_badgeTextColor = HexColorFromRGB(0xFFFFFF);
  386. _quantityInfoGridViewConfig.ba_gridView_badgeHeight = 14;
  387. _quantityInfoGridViewConfig.ba_gridView_badgeOffsetPoint = CGPointMake(8, 8);
  388. // _quantityInfoGridViewConfig.ba_gridView_itemEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);
  389. // _quantityInfoGridViewConfig.minimumLineSpacing = 10;
  390. // _quantityInfoGridViewConfig.minimumInteritemSpacing = 10;
  391. _quantityInfoGridViewConfig.gridViewType = BAGridViewTypeTitleDesc;
  392. }
  393. return _quantityInfoGridViewConfig;
  394. }
  395. - (BAGridView *)quantityInfoGridView{
  396. if (!_quantityInfoGridView) {
  397. @weakify(self)
  398. _quantityInfoGridView = [BAGridView ba_creatGridViewWithGridViewConfig:self.quantityInfoGridViewConfig block:^(BAGridItemModel *model, NSIndexPath *indexPath) {
  399. @strongify(self)
  400. [self.viewModel.quantityInfoOperationSubject sendNext:@(self.viewModel.quantityInfoGridDataArray[indexPath.row].infoType)];
  401. }];
  402. }
  403. return _quantityInfoGridView;
  404. }
  405. @end