// // PdDetailViewModel.h // FirstLink // // Created by 王孝道 on 15/6/8. // Copyright (c) 2015年 FirstLink. All rights reserved. // #import #import "PindanDetailItem.h" #import "ShipAddress.h" #import "SubmitDiscountItem.h" #import "CashCouponUseItem.h" #import "PindanSpecItem.h" #import "AuthorityItem.h" #import "CommentItem.h" #import "FKDetailRequest.h" #import "PdDetailBottomView.h" #import "FKPurchaseCache.h" #import "UserDefaultManager.h" typedef enum { kDetailCellTypeUnknown = 0, kDetailCellTypeMainImg, // 大图 kDetailCellTypeAuthority, // 权限 kDetailCellTypePriceExplain, // 价格详情 kDetailCellTypeTalk, // 说说推荐 kDetailCellTypeProductHeader, // 产品展示头部 kDetailCellTypeProductShow, // 产品展示 kDetailCellTypeFeature, // 特色保障 kDetailCellTypePriceDetailHeader, // 价格说明header kDetailCellTypeNationalPrice, // 国外价格 kDetailCellTypeNationalPostage, // 国际物流 kDetailCellTypeCountryInPrice, // 国内参考价格 kDetailCellTypeTransitHeader, // 发货说明 kDetailCellTypeTransitSource, // 商品来源地 kDetailCellTypeTransitLink, // 原链接 kDetailCellTypeTransitTime, // 发货时间 kDetailCellTypeSpecGuige, // 规格 kDetailCellTypeSpecComment, // 评论header kDetailCellTypeComment, // 评论 kDetailCellTypeNoComment, // 无评论提示 kDetailCellTypeMoreComment, // 更多评论 kDetailCellTypeGroupProgress, // 拼团状态 kDetailCellTypeGroupBuy, // 拼团下单 kDetailCellTypeGroupTalk, // 拼团描述 } kDetailCellType; @interface PindanDetailViewModel : NSObject @property (nonatomic, strong) PindanDetailItem *pindanDetailItem; @property (nonatomic, strong) NSString *userID; @property (nonatomic, strong) NSString *postID; @property (nonatomic, assign) BOOL showPriceExplain; @property (nonatomic, assign) BOOL hasSpecs; // 是否有规格可以选 @property (nonatomic, assign) BOOL isProductStateEnd; // 产品是否过期结束 @property (nonatomic, assign) BOOL isProductStateSaleDone; // 产品是否售罄 @property (nonatomic, strong) NSIndexPath *lastIndexPath; // 最后一行 - (NSDictionary *)infoForRequestType:(kRequestType)type withInfo:(NSDictionary *)dict; - (void)saveIntoDataSource:(PindanDetailItem *)item; - (NSInteger)numberOfSectionsInTableView; - (NSInteger)numberOfRowsInSection:(NSInteger)section; - (CGFloat)cellHeightForIndexPath:(NSIndexPath *)indexPath; - (kDetailCellType)cellTypeForIndexPath:(NSIndexPath *)indexPath; - (NSString *)cellIdentifyForIndexPath:(NSIndexPath *)indexPath; - (CommentItem *)commentItemForIndex:(NSInteger)index; - (BOOL)isCommentBySelfForRow:(NSInteger)row; // 判断评论是否是自己发起的 - (NSString *)getCommentPlaceHolderWithIndex:(NSInteger)index; // 取得回复默认的提示 #pragma mark - PurchaseCache - (FKPurchaseCache *)saveDataIntoCache:(FKPurchaseCache *)cache orderType:(kOrderType)orderType; //- (void)mergeDataFromCache:(FKPurchaseCache *)cache; #pragma mark - Getter & Setter - (void)setIsFavorite:(BOOL)favorite; - (BOOL)isFavorite; - (void)setShareURL:(NSString *)shareURL; - (NSString *)shareURL; - (void)setCommentArray:(NSArray *)commentArray; - (NSArray *)commentArray; - (void)setCommentCount:(NSString *)count; - (NSString *)commentCount; - (NSInteger)orderCount; - (NSInteger)userOrderCount; - (NSString *)title; - (NSString *)firstPic; - (kUserLevel)userLevel; - (NSString *)webURL; - (NSAttributedString *)totalPriceAttributedString; - (NSString *)totalPrice; - (NSString *)referPrice; - (NSString *)vipPrice; - (NSString *)estimatePrice; - (NSString *)internationalPostage; - (NSTimeInterval)timeInterval; - (void)setTimeInterval:(NSTimeInterval)time; - (BOOL)isPostageFree; - (BOOL)isOnlyVIP; - (BOOL)isOnlyNew; - (NSString *)nickname; - (NSString *)introduceText; - (NSString *)headURL; - (NSString *)serviceUserID; - (NSString *)serviceNickname; - (NSString *)serviceHeadURL; - (NSArray *)specsArray; - (NSInteger)limiteNum; - (NSString *)firstSpecImgURL; - (NSArray *)productShowArray; - (NSArray *)allProductIMGURLArray; - (ProductShowItem *)showItemAtIndex:(int)index; - (NSString *)buyChannel; - (NSString *)source; - (NSString *)arrivalTime; - (BOOL)isRemind; - (BOOL)isVIP; - (BOOL)isNeedIDCard; - (BOOL)isHasShowIDCardAlert; - (void)setHasShowIDCardAlert; - (kPindanState)pindanState; - (ProductState)productState; //- (SubmitOrderItem *)submitModelWithSpecArray:(NSArray *)specArray orderType:(kOrderType)orderType; @end