YMMineInfoView.m 19 KB

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