暂无描述

PindanDetailViewModel.h 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //
  2. // PdDetailViewModel.h
  3. // FirstLink
  4. //
  5. // Created by 王孝道 on 15/6/8.
  6. // Copyright (c) 2015年 FirstLink. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "PindanDetailItem.h"
  10. #import "ShipAddress.h"
  11. #import "SubmitDiscountItem.h"
  12. #import "CashCouponUseItem.h"
  13. #import "PindanSpecItem.h"
  14. #import "AuthorityItem.h"
  15. #import "CommentItem.h"
  16. #import "FKDetailRequest.h"
  17. #import "PdDetailBottomView.h"
  18. #import "FKPurchaseCache.h"
  19. #import "UserDefaultManager.h"
  20. typedef enum {
  21. kDetailCellTypeUnknown = 0,
  22. kDetailCellTypeMainImg, // 大图
  23. kDetailCellTypeAuthority, // 权限
  24. kDetailCellTypePriceExplain, // 价格详情
  25. kDetailCellTypeTalk, // 说说推荐
  26. kDetailCellTypeProductHeader, // 产品展示头部
  27. kDetailCellTypeProductShow, // 产品展示
  28. kDetailCellTypeFeature, // 特色保障
  29. kDetailCellTypePriceDetailHeader, // 价格说明header
  30. kDetailCellTypeNationalPrice, // 国外价格
  31. kDetailCellTypeNationalPostage, // 国际物流
  32. kDetailCellTypeCountryInPrice, // 国内参考价格
  33. kDetailCellTypeTransitHeader, // 发货说明
  34. kDetailCellTypeTransitSource, // 商品来源地
  35. kDetailCellTypeTransitLink, // 原链接
  36. kDetailCellTypeTransitTime, // 发货时间
  37. kDetailCellTypeSpecGuige, // 规格
  38. kDetailCellTypeSpecComment, // 评论header
  39. kDetailCellTypeComment, // 评论
  40. kDetailCellTypeNoComment, // 无评论提示
  41. kDetailCellTypeMoreComment, // 更多评论
  42. kDetailCellTypeGroupProgress, // 拼团状态
  43. kDetailCellTypeGroupBuy, // 拼团下单
  44. kDetailCellTypeGroupTalk, // 拼团描述
  45. } kDetailCellType;
  46. @interface PindanDetailViewModel : NSObject
  47. @property (nonatomic, strong) PindanDetailItem *pindanDetailItem;
  48. @property (nonatomic, strong) NSString *userID;
  49. @property (nonatomic, strong) NSString *postID;
  50. @property (nonatomic, assign) BOOL showPriceExplain;
  51. @property (nonatomic, assign) BOOL hasSpecs; // 是否有规格可以选
  52. @property (nonatomic, assign) BOOL isProductStateEnd; // 产品是否过期结束
  53. @property (nonatomic, assign) BOOL isProductStateSaleDone; // 产品是否售罄
  54. @property (nonatomic, strong) NSIndexPath *lastIndexPath; // 最后一行
  55. - (NSDictionary *)infoForRequestType:(kRequestType)type withInfo:(NSDictionary *)dict;
  56. - (void)saveIntoDataSource:(PindanDetailItem *)item;
  57. - (NSInteger)numberOfSectionsInTableView;
  58. - (NSInteger)numberOfRowsInSection:(NSInteger)section;
  59. - (CGFloat)cellHeightForIndexPath:(NSIndexPath *)indexPath;
  60. - (kDetailCellType)cellTypeForIndexPath:(NSIndexPath *)indexPath;
  61. - (NSString *)cellIdentifyForIndexPath:(NSIndexPath *)indexPath;
  62. - (CommentItem *)commentItemForIndex:(NSInteger)index;
  63. - (BOOL)isCommentBySelfForRow:(NSInteger)row; // 判断评论是否是自己发起的
  64. - (NSString *)getCommentPlaceHolderWithIndex:(NSInteger)index; // 取得回复默认的提示
  65. #pragma mark - PurchaseCache
  66. - (FKPurchaseCache *)saveDataIntoCache:(FKPurchaseCache *)cache orderType:(kOrderType)orderType;
  67. //- (void)mergeDataFromCache:(FKPurchaseCache *)cache;
  68. #pragma mark - Getter & Setter
  69. - (void)setIsFavorite:(BOOL)favorite;
  70. - (BOOL)isFavorite;
  71. - (void)setShareURL:(NSString *)shareURL;
  72. - (NSString *)shareURL;
  73. - (void)setCommentArray:(NSArray *)commentArray;
  74. - (NSArray *)commentArray;
  75. - (void)setCommentCount:(NSString *)count;
  76. - (NSString *)commentCount;
  77. - (NSInteger)orderCount;
  78. - (NSInteger)userOrderCount;
  79. - (NSString *)title;
  80. - (NSString *)firstPic;
  81. - (kUserLevel)userLevel;
  82. - (NSString *)webURL;
  83. - (NSAttributedString *)totalPriceAttributedString;
  84. - (NSString *)totalPrice;
  85. - (NSString *)referPrice;
  86. - (NSString *)vipPrice;
  87. - (NSString *)estimatePrice;
  88. - (NSString *)internationalPostage;
  89. - (NSTimeInterval)timeInterval;
  90. - (void)setTimeInterval:(NSTimeInterval)time;
  91. - (BOOL)isPostageFree;
  92. - (BOOL)isOnlyVIP;
  93. - (BOOL)isOnlyNew;
  94. - (NSString *)nickname;
  95. - (NSString *)introduceText;
  96. - (NSString *)headURL;
  97. - (NSString *)serviceUserID;
  98. - (NSString *)serviceNickname;
  99. - (NSString *)serviceHeadURL;
  100. - (NSArray *)specsArray;
  101. - (NSInteger)limiteNum;
  102. - (NSString *)firstSpecImgURL;
  103. - (NSArray *)productShowArray;
  104. - (NSArray *)allProductIMGURLArray;
  105. - (ProductShowItem *)showItemAtIndex:(int)index;
  106. - (NSString *)buyChannel;
  107. - (NSString *)source;
  108. - (NSString *)arrivalTime;
  109. - (BOOL)isRemind;
  110. - (BOOL)isVIP;
  111. - (BOOL)isNeedIDCard;
  112. - (BOOL)isHasShowIDCardAlert;
  113. - (void)setHasShowIDCardAlert;
  114. - (kPindanState)pindanState;
  115. - (ProductState)productState;
  116. //- (SubmitOrderItem *)submitModelWithSpecArray:(NSArray *)specArray orderType:(kOrderType)orderType;
  117. @end