Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 80f27d1

Browse files
MVC&MVVM的准备工作
1. 配置了MVC&MVVM的文件 2. 配置了数据
1 parent 4ec254c commit 80f27d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1136
-7
lines changed

‎MHDevelopExample/MHDevelopExample.xcodeproj/project.pbxproj‎

Lines changed: 242 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//
2+
// SUGoods.h
3+
// MHDevelopExample
4+
//
5+
// Created by senba on 2017年6月9日.
6+
// Copyright © 2017年 CoderMikeHe. All rights reserved.
7+
// 首页商品模型 data-model
8+
9+
#import <Foundation/Foundation.h>
10+
#import "SUGoodsImage.h"
11+
/** 商品运费类型 */
12+
typedef NS_ENUM(NSUInteger, SUGoodsExpressType) {
13+
SUGoodsExpressTypeFree = 0, // 包邮
14+
SUGoodsExpressTypeValue = 1, // 运费
15+
SUGoodsExpressTypeFeeding = 2,// 待议
16+
};
17+
18+
@interface SUGoods : NSObject
19+
/// === 商品相关 ===
20+
/// 商品ID
21+
@property (nonatomic, readwrite, copy) NSString * goodsId;
22+
/// 位置
23+
@property (nonatomic, readwrite, copy) NSString * locationAreaName;
24+
/// 商品名称
25+
@property (nonatomic, readwrite, copy) NSString *title;
26+
/// 商品描述
27+
@property (nonatomic, readwrite, copy) NSString * goodsDescription;
28+
/// 商品价格
29+
@property (nonatomic, readwrite, copy) NSString * price;
30+
/// 商品原价格
31+
@property (nonatomic, readwrite, copy) NSString * oPrice;
32+
/// 浏览次数
33+
@property (nonatomic, readwrite, copy) NSString * hits;
34+
/// 喜欢次数
35+
@property (nonatomic, readwrite, copy) NSString * likes;
36+
/// 留言数量
37+
@property (nonatomic, readwrite, copy) NSString * messages;
38+
/// 商品数量
39+
@property (nonatomic, readwrite, copy) NSString * number;
40+
/// 运费类型: 0 包邮 1 指定运费 2待议
41+
@property (nonatomic, readwrite, assign) SUGoodsExpressType expressType;
42+
/// 运费
43+
@property (nonatomic, readwrite, copy) NSString * expressFee;
44+
/// 更新时间
45+
@property (nonatomic, strong) NSDate * updatedAt;
46+
/// 发布(重新发布)时间
47+
@property (nonatomic, strong) NSDate * editAt;
48+
/// 是否已经收藏
49+
@property (nonatomic, assign) BOOL isLike;
50+
/// 商品预览图片模型列表
51+
@property (nonatomic, readwrite, copy) NSArray <SUGoodsImage *> * images;
52+
/// 是否全新
53+
@property (nonatomic, readwrite, assign , getter = isBrandNew) BOOL brandNew;
54+
/// 活动价
55+
@property (nonatomic, readwrite, copy) NSString *activityPrice;
56+
57+
/// === 商品中的用户相关的信息 ===
58+
/// 用户ID
59+
@property (nonatomic, readwrite, copy) NSString * userId;
60+
/// 用户头像
61+
@property (nonatomic, readwrite, copy) NSString * avatar;
62+
/// 用户昵称
63+
@property (nonatomic, readwrite, copy) NSString * nickName;
64+
/// 是否芝麻认证
65+
@property (nonatomic, assign) BOOL iszm;
66+
67+
68+
@end
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// SUGoods.m
3+
// MHDevelopExample
4+
//
5+
// Created by senba on 2017年6月9日.
6+
// Copyright © 2017年 CoderMikeHe. All rights reserved.
7+
//
8+
9+
#import "SUGoods.h"
10+
11+
@implementation SUGoods
12+
/// 属性map
13+
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
14+
return @{
15+
@"goodsId":@[@"id", @"goodsId", @"goods_id"],
16+
@"goodsDescription":@"description",
17+
@"oPrice":@"oprice",
18+
@"brandNew":@"isNew"
19+
};
20+
}
21+
/// 属性名 生成 class
22+
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
23+
24+
return @{@"images":[SUGoodsImage class]};
25+
}
26+
@end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// SUGoodsImage.h
3+
// MHDevelopExample
4+
//
5+
// Created by senba on 2017年6月9日.
6+
// Copyright © 2017年 CoderMikeHe. All rights reserved.
7+
// 商品预览图模型 data-model
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface SUGoodsImage : NSObject
12+
13+
//图片ID
14+
@property (nonatomic, copy) NSString * imageId;
15+
//用户ID
16+
@property (nonatomic, copy) NSString * userId;
17+
//图片路劲
18+
@property (nonatomic, copy) NSString * path;
19+
//图片地址
20+
@property (nonatomic, copy) NSString * url;
21+
22+
@end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
//
3+
// SUGoodsImage.m
4+
// MHDevelopExample
5+
//
6+
// Created by senba on 2017年6月9日.
7+
// Copyright © 2017年 CoderMikeHe. All rights reserved.
8+
//
9+
10+
#import "SUGoodsImage.h"
11+
12+
@implementation SUGoodsImage
13+
14+
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
15+
return @{ @"imageId" : @"id" };
16+
}
17+
18+
@end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// SUGoodsCell.h
3+
// SenbaUsed
4+
//
5+
// Created by shiba_iOSRB on 16/7/26.
6+
// Copyright © 2016年 曾维俊. All rights reserved.
7+
//
8+
// Goods cell
9+
10+
#import <UIKit/UIKit.h>
11+
12+
#import "SUReactiveView.h"
13+
14+
15+
16+
@interface SUGoodsCell : UITableViewCell<SUReactiveView>
17+
18+
19+
@end

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /