소스 검색

添加商品展示控件封装(未完)

iOS-Abel 2 년 전
부모
커밋
4cad59f471

+ 8 - 2
Asteria.xcodeproj/project.pbxproj

@@ -13,6 +13,7 @@
 		8134C1B72A1359E6006EB0EC /* ASSignDayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1B62A1359E6006EB0EC /* ASSignDayView.m */; };
 		8134C1B72A1359E6006EB0EC /* ASSignDayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1B62A1359E6006EB0EC /* ASSignDayView.m */; };
 		8134C1BA2A1372A7006EB0EC /* ASUserCenterEnterItemV.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1B92A1372A7006EB0EC /* ASUserCenterEnterItemV.m */; };
 		8134C1BA2A1372A7006EB0EC /* ASUserCenterEnterItemV.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1B92A1372A7006EB0EC /* ASUserCenterEnterItemV.m */; };
 		8134C1BD2A1372D5006EB0EC /* ASUserCenterTableHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1BC2A1372D5006EB0EC /* ASUserCenterTableHeadView.m */; };
 		8134C1BD2A1372D5006EB0EC /* ASUserCenterTableHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1BC2A1372D5006EB0EC /* ASUserCenterTableHeadView.m */; };
+		8134C1C52A145172006EB0EC /* ASProductItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8134C1C42A145172006EB0EC /* ASProductItemView.m */; };
 		814F5CEF2A11B1F2003847A9 /* ASUserCenterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 814F5CEE2A11B1F2003847A9 /* ASUserCenterViewController.m */; };
 		814F5CEF2A11B1F2003847A9 /* ASUserCenterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 814F5CEE2A11B1F2003847A9 /* ASUserCenterViewController.m */; };
 		814F5CF52A11B37E003847A9 /* ASUserAvaterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 814F5CF42A11B37E003847A9 /* ASUserAvaterView.m */; };
 		814F5CF52A11B37E003847A9 /* ASUserAvaterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 814F5CF42A11B37E003847A9 /* ASUserAvaterView.m */; };
 		814F5D052A11B76F003847A9 /* Roboto-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5CF82A11B76F003847A9 /* Roboto-Medium.ttf */; };
 		814F5D052A11B76F003847A9 /* Roboto-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 814F5CF82A11B76F003847A9 /* Roboto-Medium.ttf */; };
@@ -145,6 +146,8 @@
 		8134C1B92A1372A7006EB0EC /* ASUserCenterEnterItemV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterEnterItemV.m; sourceTree = "<group>"; };
 		8134C1B92A1372A7006EB0EC /* ASUserCenterEnterItemV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterEnterItemV.m; sourceTree = "<group>"; };
 		8134C1BB2A1372D5006EB0EC /* ASUserCenterTableHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserCenterTableHeadView.h; sourceTree = "<group>"; };
 		8134C1BB2A1372D5006EB0EC /* ASUserCenterTableHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserCenterTableHeadView.h; sourceTree = "<group>"; };
 		8134C1BC2A1372D5006EB0EC /* ASUserCenterTableHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterTableHeadView.m; sourceTree = "<group>"; };
 		8134C1BC2A1372D5006EB0EC /* ASUserCenterTableHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterTableHeadView.m; sourceTree = "<group>"; };
+		8134C1C32A145172006EB0EC /* ASProductItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASProductItemView.h; sourceTree = "<group>"; };
+		8134C1C42A145172006EB0EC /* ASProductItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASProductItemView.m; sourceTree = "<group>"; };
 		814F5CED2A11B1F2003847A9 /* ASUserCenterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserCenterViewController.h; sourceTree = "<group>"; };
 		814F5CED2A11B1F2003847A9 /* ASUserCenterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserCenterViewController.h; sourceTree = "<group>"; };
 		814F5CEE2A11B1F2003847A9 /* ASUserCenterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterViewController.m; sourceTree = "<group>"; };
 		814F5CEE2A11B1F2003847A9 /* ASUserCenterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterViewController.m; sourceTree = "<group>"; };
 		814F5CF32A11B37E003847A9 /* ASUserAvaterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserAvaterView.h; sourceTree = "<group>"; };
 		814F5CF32A11B37E003847A9 /* ASUserAvaterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserAvaterView.h; sourceTree = "<group>"; };
@@ -186,8 +189,6 @@
 		81C3B45029F669C900D79294 /* ColorDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorDefine.h; sourceTree = "<group>"; };
 		81C3B45029F669C900D79294 /* ColorDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ColorDefine.h; sourceTree = "<group>"; };
 		81C3B45329F66C1700D79294 /* UIView+PublicInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+PublicInit.h"; sourceTree = "<group>"; };
 		81C3B45329F66C1700D79294 /* UIView+PublicInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+PublicInit.h"; sourceTree = "<group>"; };
 		81C3B45429F66C1700D79294 /* UIView+PublicInit.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+PublicInit.m"; sourceTree = "<group>"; };
 		81C3B45429F66C1700D79294 /* UIView+PublicInit.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+PublicInit.m"; sourceTree = "<group>"; };
-		9A2027F32A137B6A00FF4DAF /* Asteria.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Asteria.entitlements; sourceTree = "<group>"; };
-		9A2027F42A137B8600FF4DAF /* AuthenticationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AuthenticationServices.framework; path = System/Library/Frameworks/AuthenticationServices.framework; sourceTree = SDKROOT; };
 		81E257EC2A120756004EEF71 /* ASUserCenterTopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserCenterTopView.h; sourceTree = "<group>"; };
 		81E257EC2A120756004EEF71 /* ASUserCenterTopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserCenterTopView.h; sourceTree = "<group>"; };
 		81E257ED2A120756004EEF71 /* ASUserCenterTopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterTopView.m; sourceTree = "<group>"; };
 		81E257ED2A120756004EEF71 /* ASUserCenterTopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASUserCenterTopView.m; sourceTree = "<group>"; };
 		81E257F12A120975004EEF71 /* ASUserBaseInfoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserBaseInfoView.h; sourceTree = "<group>"; };
 		81E257F12A120975004EEF71 /* ASUserBaseInfoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASUserBaseInfoView.h; sourceTree = "<group>"; };
@@ -196,6 +197,8 @@
 		81E257F82A122AC6004EEF71 /* ASUI.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ASUI.xcassets; sourceTree = "<group>"; };
 		81E257F82A122AC6004EEF71 /* ASUI.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ASUI.xcassets; sourceTree = "<group>"; };
 		81E257FB2A12340E004EEF71 /* ASEnterItemV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASEnterItemV.h; sourceTree = "<group>"; };
 		81E257FB2A12340E004EEF71 /* ASEnterItemV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASEnterItemV.h; sourceTree = "<group>"; };
 		81E257FC2A12340E004EEF71 /* ASEnterItemV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASEnterItemV.m; sourceTree = "<group>"; };
 		81E257FC2A12340E004EEF71 /* ASEnterItemV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASEnterItemV.m; sourceTree = "<group>"; };
+		9A2027F32A137B6A00FF4DAF /* Asteria.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Asteria.entitlements; sourceTree = "<group>"; };
+		9A2027F42A137B8600FF4DAF /* AuthenticationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AuthenticationServices.framework; path = System/Library/Frameworks/AuthenticationServices.framework; sourceTree = SDKROOT; };
 		9A337E362A04EE1A00D058A5 /* Target_B.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Target_B.m; sourceTree = "<group>"; };
 		9A337E362A04EE1A00D058A5 /* Target_B.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Target_B.m; sourceTree = "<group>"; };
 		9A337E372A04EE1A00D058A5 /* Target_B.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Target_B.h; sourceTree = "<group>"; };
 		9A337E372A04EE1A00D058A5 /* Target_B.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Target_B.h; sourceTree = "<group>"; };
 		9A337E382A04EE1A00D058A5 /* BViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BViewController.h; sourceTree = "<group>"; };
 		9A337E382A04EE1A00D058A5 /* BViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BViewController.h; sourceTree = "<group>"; };
@@ -504,6 +507,8 @@
 				81E257F02A120952004EEF71 /* UserInfoV */,
 				81E257F02A120952004EEF71 /* UserInfoV */,
 				8134C1B52A1359E6006EB0EC /* ASSignDayView.h */,
 				8134C1B52A1359E6006EB0EC /* ASSignDayView.h */,
 				8134C1B62A1359E6006EB0EC /* ASSignDayView.m */,
 				8134C1B62A1359E6006EB0EC /* ASSignDayView.m */,
+				8134C1C32A145172006EB0EC /* ASProductItemView.h */,
+				8134C1C42A145172006EB0EC /* ASProductItemView.m */,
 			);
 			);
 			path = CustomView;
 			path = CustomView;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -1166,6 +1171,7 @@
 				9AD3460B2A08D60F005CA070 /* UIView+ZFFrame.m in Sources */,
 				9AD3460B2A08D60F005CA070 /* UIView+ZFFrame.m in Sources */,
 				81E257FD2A12340E004EEF71 /* ASEnterItemV.m in Sources */,
 				81E257FD2A12340E004EEF71 /* ASEnterItemV.m in Sources */,
 				81C3B45529F66C1700D79294 /* UIView+PublicInit.m in Sources */,
 				81C3B45529F66C1700D79294 /* UIView+PublicInit.m in Sources */,
+				8134C1C52A145172006EB0EC /* ASProductItemView.m in Sources */,
 				9A5C64582A12064300CBB185 /* AS_LoginC.m in Sources */,
 				9A5C64582A12064300CBB185 /* AS_LoginC.m in Sources */,
 				9AD345FD2A08D60F005CA070 /* ZFPersentInteractiveTransition.m in Sources */,
 				9AD345FD2A08D60F005CA070 /* ZFPersentInteractiveTransition.m in Sources */,
 				9AD345FC2A08D60F005CA070 /* ZFPlayerLogManager.m in Sources */,
 				9AD345FC2A08D60F005CA070 /* ZFPlayerLogManager.m in Sources */,

+ 19 - 0
Asteria/ASUI/CustomView/ASProductItemView.h

@@ -0,0 +1,19 @@
+//
+//  ASProductItemView.h
+//  Asteria
+//
+//  Created by iOS on 2023/5/17.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ASProductItemView : UIView
+
+//@property (nonatomic, strong)HomeProductListModel *model;
+//@property (nonatomic, copy, nullable) void(^addCartBlock)(HomeProductListModel* m);
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 132 - 0
Asteria/ASUI/CustomView/ASProductItemView.m

@@ -0,0 +1,132 @@
+//
+//  ASProductItemView.m
+//  Asteria
+//
+//  Created by iOS on 2023/5/17.
+//
+
+#import "ASProductItemView.h"
+
+@interface ASProductItemView ()
+
+@property (nonatomic, strong) UIImageView *imgV;
+@property (nonatomic, strong) UILabel *titleLb;
+
+@property (nonatomic, strong) UILabel *nowPriceLb;
+@property (nonatomic, strong) UILabel *oldPriceLb;
+
+@property (nonatomic,strong) UILabel *hotLb;
+
+
+@property (nonatomic,strong) UIStackView *lbStackV;
+
+@property (nonatomic,strong) UIButton *addCartBt;
+
+
+//@property (nonatomic, strong)UIStackView *priceStackV;
+//@property (nonatomic, strong) UIView* hotV;
+
+
+@end
+
+@implementation ASProductItemView
+
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self configSubV];
+        self.clipsToBounds = true;
+    }
+    return  self;
+}
+
+- (void) configSubV {
+    self.layer.cornerRadius = 8;
+    self.layer.masksToBounds = true;
+    self.backgroundColor = _F5F5F5;
+    
+    [self addSubview:self.imgV];
+    [self addSubview:self.titleLb];
+    [self addSubview:self.hotLb];
+    [self addSubview: self.nowPriceLb];
+    [self addSubview: self.oldPriceLb];
+    
+    
+}
+
+- (UIImageView *)imgV {
+    if (!_imgV) {
+        UIImageView *v = [[UIImageView alloc] init];
+        v.contentMode = UIViewContentModeScaleToFill;
+        _imgV = v;
+    }
+    return  _imgV;
+}
+
+
+- (UILabel *)titleLb {
+    if (!_titleLb) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Regular size:12];
+        lb.textColor = [UIColor blackColor];
+        lb.textAlignment = NSTextAlignmentLeft;
+        lb.numberOfLines = 2;
+        _titleLb = lb;
+    }
+    return  _titleLb;
+}
+
+- (UILabel *)nowPriceLb {
+    if (!_nowPriceLb) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Bold size:14];
+        lb.textColor = [UIColor blackColor];
+        lb.textAlignment = NSTextAlignmentLeft;
+        _nowPriceLb = lb;
+    }
+    return  _nowPriceLb;
+}
+
+- (UILabel *)oldPriceLb {
+    if (!_oldPriceLb) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Regular size:12];
+        lb.textColor = Col_999;
+        lb.textAlignment = NSTextAlignmentLeft;
+        _oldPriceLb = lb;
+    }
+    return  _oldPriceLb;
+}
+
+
+
+- (UILabel *)hotLb {
+    if (!_hotLb) {
+        UILabel *lb = [[UILabel alloc] init];
+        lb.font = [UIFont fontWithName:Rob_Regular size:12];
+        lb.textColor = Col_666;
+        lb.textAlignment = NSTextAlignmentLeft;
+        _hotLb = lb;
+    }
+    return  _hotLb;
+}
+
+-(UIButton *)addCartBt {
+    if (!_addCartBt) {
+        UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
+        [bt setImage:[UIImage imageNamed:@"list_addbag"] forState:UIControlStateNormal];
+        [bt addTarget:self action:@selector(addCartBtAction) forControlEvents:UIControlEventTouchUpInside];
+        _addCartBt = bt;
+    }
+    return _addCartBt;
+}
+
+
+- (void)addCartBtAction {
+//    if (self.addCartBlock) {
+//        self.addCartBlock(self.model);
+//    }
+}
+
+@end

+ 1 - 0
Asteria/Config/ColorDefine.h

@@ -35,6 +35,7 @@
 #define _C8FFED ([UIColor colorWithHexString:@"#C8FFED"])
 #define _C8FFED ([UIColor colorWithHexString:@"#C8FFED"])
 
 
 #define _E5E5E5 ([UIColor colorWithHexString:@"#E5E5E5"])
 #define _E5E5E5 ([UIColor colorWithHexString:@"#E5E5E5"])
+#define _F5F5F5 ([UIColor colorWithHexString:@"#F5F5F5"])
 
 
 // as主题色 绿色
 // as主题色 绿色
 #define _32CFB0 ([UIColor colorWithHexString:@"#32CFB0"])
 #define _32CFB0 ([UIColor colorWithHexString:@"#32CFB0"])

+ 1 - 1
Podfile.lock

@@ -1244,6 +1244,6 @@ SPEC CHECKSUMS:
   YTKNetwork: c16be90b06be003de9e9cd0d3b187cc8eaf35c04
   YTKNetwork: c16be90b06be003de9e9cd0d3b187cc8eaf35c04
   YYCache: 8105b6638f5e849296c71f331ff83891a4942952
   YYCache: 8105b6638f5e849296c71f331ff83891a4942952
 
 
-PODFILE CHECKSUM: c0099ce859b6bca3267c56f1bb17e4c866385446
+PODFILE CHECKSUM: 29d771588f77576e8bd40bc6c07c21b635553f70
 
 
 COCOAPODS: 1.12.1
 COCOAPODS: 1.12.1

+ 1 - 1
Pods/Manifest.lock

@@ -1244,6 +1244,6 @@ SPEC CHECKSUMS:
   YTKNetwork: c16be90b06be003de9e9cd0d3b187cc8eaf35c04
   YTKNetwork: c16be90b06be003de9e9cd0d3b187cc8eaf35c04
   YYCache: 8105b6638f5e849296c71f331ff83891a4942952
   YYCache: 8105b6638f5e849296c71f331ff83891a4942952
 
 
-PODFILE CHECKSUM: c0099ce859b6bca3267c56f1bb17e4c866385446
+PODFILE CHECKSUM: 29d771588f77576e8bd40bc6c07c21b635553f70
 
 
 COCOAPODS: 1.12.1
 COCOAPODS: 1.12.1

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 16152 - 16115
Pods/Pods.xcodeproj/project.pbxproj


+ 1 - 1
Pods/Target Support Files/WMBase/WMBase-umbrella.h

@@ -10,7 +10,7 @@
 #endif
 #endif
 #endif
 #endif
 
 
-#import "CTMediator+Targets.h"
+#import "CTMediator+UserCenter.h"
 #import "TT_GeneralProfile.h"
 #import "TT_GeneralProfile.h"
 #import "UCMBaseC.h"
 #import "UCMBaseC.h"
 #import "UCMHttpRequest.h"
 #import "UCMHttpRequest.h"