MIduo.xcodeproj/project.pbxproj
@@ -519,7 +519,6 @@ 2D0FAA0321B61A88001F12A6 /* CollectionGoodsModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0221B61A88001F12A6 /* CollectionGoodsModel.m */; }; 2D0FAA0721B65455001F12A6 /* NewGoodsShareTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0621B65455001F12A6 /* NewGoodsShareTopView.m */; }; 2D0FAA0A21B66562001F12A6 /* SingleFigureShareController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0921B66562001F12A6 /* SingleFigureShareController.m */; }; 2D0FAA0D21B66588001F12A6 /* MultipleFigureShareController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0C21B66588001F12A6 /* MultipleFigureShareController.m */; }; 2D0FAA1021B66B01001F12A6 /* SingleFigureShareSelectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA0F21B66B01001F12A6 /* SingleFigureShareSelectView.m */; }; 2D0FAA1321B67A50001F12A6 /* ShowShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA1221B67A50001F12A6 /* ShowShareView.m */; }; 2D0FAA1721B680C5001F12A6 /* NewShareBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D0FAA1621B680C5001F12A6 /* NewShareBottomView.m */; }; @@ -2166,8 +2165,6 @@ 2D0FAA0621B65455001F12A6 /* NewGoodsShareTopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NewGoodsShareTopView.m; sourceTree = "<group>"; }; 2D0FAA0821B66562001F12A6 /* SingleFigureShareController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SingleFigureShareController.h; sourceTree = "<group>"; }; 2D0FAA0921B66562001F12A6 /* SingleFigureShareController.m */ = {isa = PBXFileReference; indentWidth = 3; lastKnownFileType = sourcecode.c.objc; path = SingleFigureShareController.m; sourceTree = "<group>"; }; 2D0FAA0B21B66588001F12A6 /* MultipleFigureShareController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MultipleFigureShareController.h; sourceTree = "<group>"; }; 2D0FAA0C21B66588001F12A6 /* MultipleFigureShareController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MultipleFigureShareController.m; sourceTree = "<group>"; }; 2D0FAA0E21B66B01001F12A6 /* SingleFigureShareSelectView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SingleFigureShareSelectView.h; sourceTree = "<group>"; }; 2D0FAA0F21B66B01001F12A6 /* SingleFigureShareSelectView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SingleFigureShareSelectView.m; sourceTree = "<group>"; }; 2D0FAA1121B67A50001F12A6 /* ShowShareView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShowShareView.h; sourceTree = "<group>"; }; @@ -3882,8 +3879,6 @@ 0DEBAA9723F6855700CD7521 /* QuickShareChangeImageController.m */, 2D0FAA0821B66562001F12A6 /* SingleFigureShareController.h */, 2D0FAA0921B66562001F12A6 /* SingleFigureShareController.m */, 2D0FAA0B21B66588001F12A6 /* MultipleFigureShareController.h */, 2D0FAA0C21B66588001F12A6 /* MultipleFigureShareController.m */, 2D3A83B6225DDE800001CAE1 /* ModifyTemplateController.h */, 2D3A83B7225DDE800001CAE1 /* ModifyTemplateController.m */, 2D783478215CBE6700D72B3F /* Cell */, @@ -4960,8 +4955,8 @@ 18966C9B20AD7F6A004CD297 /* GDDetailTableViewCell.xib */, 18966C9C20AD7F6A004CD297 /* GDetailView.h */, 18966C9D20AD7F6A004CD297 /* GDetailView.m */, 18966C9E20AD7F6A004CD297 /* GDrecomeTableViewCell.h */, 18966C9F20AD7F6A004CD297 /* GDrecomeTableViewCell.m */, 18966C9E20AD7F6A004CD297 /* GDrecomeTableViewCell.h */, 18966CA020AD7F6A004CD297 /* GDrecomeTableViewCell.xib */, 18966CA120AD7F6A004CD297 /* GoodDeTrViewController.h */, 18966CA220AD7F6A004CD297 /* GoodDeTrViewController.m */, @@ -9215,7 +9210,6 @@ 18AC53861E5A9840006D1FDF /* UIImage+YTH.m in Sources */, 0DDEA058242303AE00A1DACE /* MineUpgradeMemberView.m in Sources */, 2D871B0722A1255200CE2788 /* ActivityCommonTemplateController.m in Sources */, 2D0FAA0D21B66588001F12A6 /* MultipleFigureShareController.m in Sources */, 2D0FAA0321B61A88001F12A6 /* CollectionGoodsModel.m in Sources */, 0D29AB20246AC9210039B6F1 /* GoodsRecommendModel.m in Sources */, 0DEBAA9E23F6A2D700CD7521 /* QuickShareCommentaryView.m in Sources */, @@ -9977,7 +9971,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 81; CURRENT_PROJECT_VERSION = 82; DEPLOYMENT_POSTPROCESSING = NO; DEVELOPMENT_TEAM = 748KKGQ5LW; ENABLE_BITCODE = NO; @@ -10110,7 +10104,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 81; CURRENT_PROJECT_VERSION = 82; DEPLOYMENT_POSTPROCESSING = NO; DEVELOPMENT_TEAM = 748KKGQ5LW; ENABLE_BITCODE = NO; MIduo.xcworkspace/xcuserdata/lrj.xcuserdatad/UserInterfaceState.xcuserstateBinary files differ
MIduo/AppDelegate.m
@@ -53,11 +53,13 @@ @end @implementation AppDelegate { NSTimer *connectionTimer; BOOL done; } @implementation AppDelegate { NSTimer *connectionTimer; BOOL doneNav; } -(void)timerFired:(NSTimer *)timer { done = YES; - (void)timerFired:(NSTimer *)timer { doneNav = YES; } - (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ @@ -105,7 +107,7 @@ //2.é»è®¤æ¯æ²¡æå¼å¯ ä» éåçº¿ç¨ ä¸»çº¿ç¨æ¯æ²¡ç¨ç [runloop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; } while (!done); while (!doneNav); [self loadViewsWithBor:YES]; @@ -206,16 +208,15 @@ PlistFileOperator *plist = [[PlistFileOperator alloc] init]; plist.dataName = @"homeNavData"; [plist writeFileWithData:object]; [self seelpTime]; [self seelpNavTime]; }); } fail:^(id object) { [self seelpTime]; [self seelpNavTime]; }]; } - (void)seelpTime { - (void)seelpNavTime { connectionTimer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired:) userInfo:nil repeats:NO]; [[NSRunLoop currentRunLoop] addTimer:connectionTimer forMode:NSDefaultRunLoopMode]; } MIduo/Êý¾Ý/DataNet/ALNetWorking.m
@@ -67,8 +67,7 @@ }]; } - (void)Post:(NSString *)url param:(NSDictionary *)param timeOut:(NSTimeInterval)timeOut success:(NetBlock)successBlock fail:(ErrorBlock)errorBlock { - (void)Post:(NSString *)url param:(NSDictionary *)param timeOut:(NSTimeInterval)timeOut success:(NetBlock)successBlock fail:(ErrorBlock)errorBlock { url= [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; // AFSecurityPolicy *securityPolicy = [[AFSecurityPolicy alloc] init]; // [securityPolicy setAllowInvalidCertificates:YES]; MIduo/½çÃæ/ÉÌÆ·ÏêÇé/GoodDeTrViewController.m
@@ -327,12 +327,7 @@ } - (CGFloat)fetchTitleHeight { UIImage *icomImage = nil; if (self.goodsModel.shopType == 20 || self.goodsModel.shopType == 21) { icomImage = ALIMAGE_NAMED(@"ic_share_jd"); } else if (self.goodsModel.shopType == 30) { icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); } UIImage *icomImage = ALIMAGE_NAMED(@"ic_share_taobao"); NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; style.lineSpacing = 3; // 坹齿¹å¼ MIduo/½çÃæ/ÉÌÆ·ÏêÇé/JD/Cell/JDGoodsHeaderTableViewCell.m
@@ -385,8 +385,12 @@ UIImage *icomImage = nil; if (model.shopType == 20 || model.shopType == 21) { icomImage = ALIMAGE_NAMED(@"ic_share_jd"); } else if (model.shopType == 30) { icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); } else if (model.shopType == 50) { icomImage = ALIMAGE_NAMED(@"ic_share_sn"); } self.labelImage.image = icomImage; @@ -414,8 +418,8 @@ self.titleLabel.attributedText = attrText; NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; CGFloat height = [self getSpaceLabelHeight:model.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 10]; self.titleLabel.frame = CGRectMake(10, CGRectGetMinY(self.labelImage.frame) - 2, SCREEN_WIDTH - 10, height); CGFloat height = [self getSpaceLabelHeight:model.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; self.titleLabel.frame = CGRectMake(10, CGRectGetMinY(self.labelImage.frame) - 2, SCREEN_WIDTH - 20, height); // æ ç¾ CGFloat gongyiLabelWidth = 0, baokuanLabelWidth = 0; MIduo/½çÃæ/ÉÌÆ·ÏêÇé/JD/Cell/JDGoodsInfoCell.m
@@ -398,7 +398,6 @@ [ self.labelImage updateLayout]; NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; style.lineSpacing = 3; // 坹齿¹å¼ MIduo/½çÃæ/ÉÌÆ·ÏêÇé/JD/JDGoodsDetailController.m
@@ -290,12 +290,7 @@ } - (CGFloat)fetchTitleHeight { UIImage *icomImage = nil; if (self.goodsModel.shopType == 20 || self.goodsModel.shopType == 21) { icomImage = ALIMAGE_NAMED(@"ic_share_jd"); } else if (self.goodsModel.shopType == 30) { icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); } UIImage *icomImage = ALIMAGE_NAMED(@"ic_share_jd"); NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; style.lineSpacing = 3; // 坹齿¹å¼ MIduo/½çÃæ/ÉÌÆ·ÏêÇé/PDD/PDDGoodsDetailController.m
@@ -1541,21 +1541,15 @@ return size.height; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { // code == 2 åå䏿¶ if (self.code == 2) { return SCREEN_WIDTH; } NSInteger shopType = self.goodsModel.shopType; //10-æ·å® 11-å¤©ç« 20-äº¬ä¸ 30-æ¼å¤å¤ UIImage *icomImage = nil; if (shopType == 10) { icomImage = [UIImage imageNamed:@"ic_share_taobao"]; } else if (shopType == 11) { icomImage = [UIImage imageNamed:@"ic_share_tmall"]; } UIImage *icomImage = [UIImage imageNamed:@"ic_share_pdd"]; NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; style.lineSpacing = 3; // 坹齿¹å¼ @@ -1573,7 +1567,7 @@ style.firstLineHeadIndent = firstLineHeadIndentHeight; NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@" %@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@"%@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; //æ¯å¦æè¶ 级ä¼åè¿ CGFloat maxCouponHeight = 0; if (![self.from isEqualToString:@"miandan"]) {// æ¯å¦æ¯å å MIduo/½çÃæ/ÉÌÆ·ÏêÇé/SN/SNGoodsDetailController.m
@@ -1,9 +1,9 @@ // // SNGoodsDetailController.m // PDDGoodsDetailController.m // MIduo // // Created by aeline on 2020/5/27. // Copyright © 2020 yeshi. All rights reserved. // Created by éåºè¿å°ç§ææéå ¬å¸ on 2019/7/25. // Copyright © 2019 yeshi. All rights reserved. // #import "SNGoodsDetailController.h" @@ -21,12 +21,11 @@ #import "SJShopScrollView.h" #import "DetailWKWebview.h" #import "GoodsDetailPopWinView.h" #import "JDNOFanLiButtonView.h" #import "WebLoadProgressView.h" #import "SNTransformView.h" // Cells #import "JDGoodsInfoCell.h" #import "JDGoodsHeaderTableViewCell.h" #import "GDDetailTableViewCell.h" #import "GDrecomeTableViewCell.h" #import "NoShopTableViewCell.h" @@ -39,8 +38,10 @@ #import <ShareSDK/ShareSDK.h> #import <ShareSDKUI/ShareSDK+SSUI.h> @interface SNGoodsDetailController () <UITableViewDelegate, UITableViewDataSource, GDetailViewDelegate, ButtomCarViewDelegate, GDrecomeTableViewCellDelegate, NewLoginViewDelegate,WKNavigationDelegate,WKUIDelegate, UIWebViewDelegate,SJRollingViewDelegate,JDGoodsInfoCellDelegate, InviteCodeControllerDelegate> { @interface SNGoodsDetailController () <UITableViewDelegate, UITableViewDataSource, GoodsHeaderTableViewCellDelegate, GDetailViewDelegate, ButtomCarViewDelegate, GDrecomeTableViewCellDelegate, NewLoginViewDelegate,WKNavigationDelegate,WKUIDelegate, UIWebViewDelegate,SJRollingViewDelegate, InviteCodeControllerDelegate> { CGFloat contentOffsetY; CGFloat oldContentOffsetY; CGFloat newContentOffsetY; @@ -69,9 +70,11 @@ @property (nonatomic, strong) NSMutableArray *likeArray; @property (nonatomic, assign) BOOL isClicked; @property (nonatomic, strong) SJAliBaicun *alibaichuan; @property (nonatomic, assign) NSInteger value; @property (nonatomic, assign) NSInteger code; @property (nonatomic, assign) BOOL native; @property (nonatomic, assign) BOOL isNative; @property (nonatomic, assign) CGFloat tableviewHeight; @property (nonatomic, assign) CGFloat tempWebHeight; @@ -83,7 +86,13 @@ @property (nonatomic, assign) BOOL isProgressHud; /// æ ¹æ®boolå¼å¤ææ¯å¦æ¶è @property (nonatomic, assign) BOOL isCollection; @property (nonatomic, assign) BOOL isCollectionBack; /// æ¯å¦ç¹å»ç»éï¼ç¶æ ç»éææ²¡æå @property (nonatomic, assign) NSInteger clickLoginStates; /// å¯¼èªæ çä¸çç°çº¿ //@property (nonatomic, strong) UIView *navGaryLine; //@property (nonatomic,strong) UIButton *ProLibraryBtn;//éååº @property (nonatomic, strong) SJNoNetwork *noNetworkViews; /// æªè¿æ¥ç½ç» @property (nonatomic, assign) NSInteger netWorkCode; @@ -103,12 +112,20 @@ @property (nonatomic, assign) BOOL storageState; /// æ·å®èçH5æ°æ® (authLink-æ·å®ææé¾æ¥,orderJS-ç¬å订åå è½½çjs代ç ï¼AESå å¯è¿çï¼,orderUrl-ç¬å订åå è½½ç龿¥) @property (nonatomic, nullable, strong) NSDictionary *taoBaoAuthInfoDic; /// å è½½çjsstring @property (nonatomic, nullable, copy) NSString *jsString; /// æ¥æºï¼share/zigouï¼ï¼ @property (nonatomic, nullable, copy) NSString *source; /// ç¬åå è½½çwebview @property (nonatomic, strong) UIWebView *linkWebView; @property (nonatomic,assign) NSInteger type; @property (nonatomic,assign)NSInteger type; @property (nonatomic, nullable, strong) GoodsDetailPopWinView *goodsDetailPopWinView; /// æ°ææ»ç¥ @property (nonatomic, copy) NSString *weex_file_newer; @property (nonatomic, nullable, strong) BaseTipArrPopView *baseTipArrPopView; @property (nonatomic, nullable, strong) BaseTipsPopView *baseTipsPopView; @@ -117,6 +134,13 @@ /// å°é»æ¡ @property (nonatomic, strong) SJRollingView *currentRollingView; @property (nonatomic, assign)BOOL isCopyTaokouling; @property (nonatomic, nullable, copy ) NSString *authLink; @property (nonatomic, nullable, copy ) NSString *couponJumpLink; @property (nonatomic, nullable, copy ) NSString *nativeCouponJumpLink; @property (nonatomic, nullable, copy ) NSString *nativeJumpLink; @property (nonatomic, nullable, strong) WebLoadProgressView *webLoadProgressView; @property (nonatomic, strong) NSTimer *webTimerDis; @@ -130,12 +154,6 @@ @property (nonatomic, strong) UIView *backView; @property (nonatomic, strong) dispatch_source_t timers; /// æ¯å¦å±å¼ææå¸ï¼å¯¹äºJDæ¥è¯´ï¼ @property (nonatomic, assign) BOOL isExpand; /// 京ä¸å¤å¸è½¬é¾ @property (nonatomic, nullable, copy) NSString *couponLink; @property (nonatomic, nullable, copy ) NSString *nativeJumpLink; @end @@ -145,8 +163,10 @@ [super viewDidLoad]; self.navigationController.navigationBar.translucent = NO; self.isLeavedNowView = NO; self.title = @"åå详æ "; [self fetchWeexFileNewer]; if (self.dataDictionary[@"paramsJSON"]) { if (self.dataDictionary[@"paramsJSON"][@"id"]) { @@ -173,10 +193,10 @@ } } if (self.goodsType == 0) { self.goodsType = 5; self.goodsType = 3; } [UMCustomShop umDetailJDEnter:self.from]; [UMCustomShop umDetailPDDEnter:self.from]; self.webHeight = 0.0; self.navigationController.navigationBar.titleTextAttributes = @@ -189,12 +209,14 @@ self.hidesBottomBarWhenPushed = YES; self.clickLoginStates = 0; self.isProgressHud = YES; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(EnterForeground:) name:@"isEnterForeground" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(EnterBackground:) name:@"isEnterBackground" object:nil]; [self initializeInterface]; [self getOrderParseConfig]; // å¦éèåºé¨è§å¾ [self isHideBottomView]; @@ -237,7 +259,6 @@ } fail:^(id object) {}]; } /** *æ¯å¦éèåºé¨è§å¾ */ @@ -245,6 +266,27 @@ if (self.from && [self.from isEqualToString:@"miandan"]) { self.buttomView.from = self.from; } } #pragma mark --- è·åæ°ææ»ç¥ --- /** * * è·åæ°ææ»ç¥ * */ - (void)fetchWeexFileNewer { NSArray *tempArr = [self fetchMainUrlArray]; for (NSDictionary *dic in tempArr) { if ([dic[@"key"] isEqualToString:@"weex_file_newer"]) { self.weex_file_newer = dic[@"value"]; break; } } } - (NSArray *)fetchMainUrlArray { return [[[NSUserDefaults standardUserDefaults] objectForKey:@"MainUrlArray"] objectForKey:@"info"]; } - (void)getAppPageNotificationWithType:(NSString *)type @@ -267,97 +309,6 @@ } fail:^(id object) { }]; } - (CGFloat)getSpaceLabelHeight:(NSString *)str withAttrDict:(NSDictionary *)dict withWidth:(CGFloat)width { CGSize size = [str boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil].size; return size.height; } - (CGFloat)fetchMaxCouponHeight { CGFloat maxCouponHeight = 0; if ([ALUserInfoServiceManger fetchUserInfo]) {// æ¯å¦ç»é if (![ALUserInfoServiceManger isMembership]) {// æ¯å¦æ¯ä¼å if (self.goodsModel.otherInfo.rewardCoupon) { maxCouponHeight = 50; } } } else { if (self.goodsModel.otherInfo.rewardCoupon) { maxCouponHeight = 50; } } return maxCouponHeight; } - (CGFloat)fetchTitleHeight { UIImage *icomImage = nil; if (self.goodsModel.shopType == 20 || self.goodsModel.shopType == 21) { icomImage = ALIMAGE_NAMED(@"ic_share_jd"); } else if (self.goodsModel.shopType == 30) { icomImage = ALIMAGE_NAMED(@"ic_share_pdd"); } else if (self.goodsModel.shopType == 50) { icomImage = ALIMAGE_NAMED(@"ic_share_sn"); } NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; style.lineSpacing = 3; // 坹齿¹å¼ style.alignment = NSTextAlignmentLeft; // é¦è¡ç¼©è¿ CGFloat firstLineHeadIndent = 0; if ([self.goodsModel.title hasPrefix:@"ã"]) { firstLineHeadIndent = icomImage.size.width; } else { firstLineHeadIndent = icomImage.size.width + 8; } style.firstLineHeadIndent = firstLineHeadIndent; NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; CGFloat height = [self getSpaceLabelHeight:self.goodsModel.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; return height; } - (CGFloat)fetchlabelsHeight { CGFloat heightLabel = 0; if ([self isHaveValue:self.goodsModel.labels]) { heightLabel = 22; } return heightLabel; } - (CGFloat)fetchMoreCouponHeight { CGFloat heightCoupnBG = 0; if (_goodsModel.couponInfoList) { if (_goodsModel.couponInfoList.count > 3) { if (self.isExpand) {// æ¯å¦å±å¼ heightCoupnBG = 64 * _goodsModel.couponInfoList.count + ((_goodsModel.couponInfoList.count - 1) * 5); } else { heightCoupnBG = 64 * 3 + ((3 - 1) * 5); } } else { heightCoupnBG = 64 * _goodsModel.couponInfoList.count + ((_goodsModel.couponInfoList.count - 1) * 5); } } return heightCoupnBG; } - (CGFloat)fetchFooterButtonHeght { CGFloat topspaceButtonViewMore = 20; if (_goodsModel.couponInfoList.count > 3 && !_isExpand) { topspaceButtonViewMore = 35; } if (!_shareValid) { topspaceButtonViewMore = 0; } if (!_goodsModel.couponInfoList || _goodsModel.couponInfoList.count == 0) { topspaceButtonViewMore = 0; } return topspaceButtonViewMore + 30 + 15; } #pragma mark - SJRollingViewDelegate @@ -454,13 +405,13 @@ [self.shopScrollView showTimer]; } - (void)viewWillDisappear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [self.navigationController setNavigationBarHidden:NO animated:NO]; [self.goodsDetailPopWinView dismiss]; self.isProgressHud = NO; self.transitionView.hidden = YES; [self.transitionView hiddenTransitionView]; [self hideTransitionView]; self.isLeavedNowView = YES; dispatch_source_cancel(self.timers); [self.shopScrollView stopTimer]; @@ -470,6 +421,12 @@ { self.isLeavedNowView = YES; dispatch_source_cancel(self.timers); } - (void)hideTransitionView { self.transitionView.hidden = YES; [self.transitionView hiddenTransitionView]; } - (void)initializeInterface { @@ -493,7 +450,7 @@ [self.view addSubview:self.backView]; [self.view addSubview:self.noNetworkViews]; [self getAppPageNotificationWithType:@"goodsDetailJD"]; [self getAppPageNotificationWithType:@"goodsDetailPDD"]; [self addNetWorkNotice]; [self.view addSubview:self.backButton]; @@ -551,7 +508,22 @@ [self.goodsDetailPopWinView show]; } - (void)getOrderParseConfig { // config/getOrderParseConfig NSDictionary *dic = @{}; [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP,@"config/getOrderParseConfig"] param:dic success:^(NSDictionary *object) { if (object != nil && [object[@"code"]integerValue] == 0) { self.taoBaoAuthInfoDic = object[@"data"]; NSString *tempJs = object[@"data"][@"orderJS"]; self.jsString = [tempJs aes256_decrypt:tempJs]; } } fail:^(id object) { }]; } - (void)openButtonEvent { self.buttomView.shareButton.enabled = YES; self.buttomView.buyButton.enabled = YES; } @@ -584,15 +556,18 @@ return YES; } - (void)webViewDidFinishLoad:(UIWebView *)webView { - (void)webViewDidFinishLoad:(UIWebView *)webView { [webView stringByEvaluatingJavaScriptFromString:self.jsString]; } - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { } - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { } - (void)EnterForeground:(NSNotification *)notice { - (void)EnterForeground:(NSNotification *)notice { [YTHsharedManger startManger].isEnterForeground = NO; self.transitionView .hidden = YES; [self.transitionView hiddenTransitionView]; @@ -607,10 +582,11 @@ [self.navigationController popViewControllerAnimated:YES]; } - (void)clearTimers { - (void)clearTimers { if (self.code != 2) { //JDGoodsHeaderTableViewCell * cell = (JDGoodsHeaderTableViewCell *)[self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; //[cell clearTimer]; JDGoodsHeaderTableViewCell * cell = (JDGoodsHeaderTableViewCell *)[self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; [cell clearTimer]; [self.shopScrollView clearTimer]; [self.shopview clearTimer]; } @@ -641,21 +617,24 @@ @strongify(self) dispatch_async(dispatch_get_main_queue(), ^{ self.detailTableview.hidden = NO; if ([self isHaveValue:object]) { if (object) { self.code = [object[@"code"] integerValue]; if (self.code == 2) { self.backView.hidden = NO; } else { self.detailTableview.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT -self.tableviewHeight); self.detailTableview.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - self.tableviewHeight); self.buttomView .hidden = NO; } if (self.code == 0) { self.extraDictionary = object[@"data"][@"extra"]; self.fanliValid = [self.extraDictionary[@"fanliValid"] boolValue]; self.shareValid = [self.extraDictionary[@"shareValid"] boolValue]; self.detailUrlString = self.extraDictionary[@"detailUrl"]; self.fanliValid = [self.extraDictionary[@"fanliValid"] boolValue]; // æ¯å¦æè¿å© self.shareValid = [self.extraDictionary[@"shareValid"] boolValue]; // æ¯å¦æå享 self.isNative = [self.extraDictionary[@"isNative"] boolValue]; // æ¯å¦è·³è½¬åçAPP self.detailUrlString = self.extraDictionary[@"detailUrl"]; // å¾æè¯¦æ 龿¥ self.couponJumpLink = self.extraDictionary[@"couponJumpLink"]; self.nativeCouponJumpLink = self.extraDictionary[@"nativeCouponJumpLink"]; if ([self.extraDictionary[@"shareValid"] boolValue]) { self.buttomView.hidden = NO; @@ -665,12 +644,9 @@ self.shareUsersArray = self.extraDictionary[@"listShareUser"]; self.shopview.dataSource = self.shareUsersArray; self.shopScrollView.datasource = self.extraDictionary[@"listCouponUser"]; self.goodsModel = [GoodsDetailBaseModel yy_modelWithJSON:object[@"data"][@"goods"]]; self.isExpand = NO; // æ¯å¦å å ¥åäº«åº self.storageState = [self.extraDictionary[@"storage"] boolValue]; @@ -683,8 +659,10 @@ [self.buttomView loadViewInfomation:self.goodsModel extraDic:self.extraDictionary]; [self.noFanLiButtomView loadViewInfomation:self.goodsModel extraDic:self.extraDictionary]; self.alibaichuan = [[SJAliBaicun alloc] initWithDic:self.extraDictionary[@"tbPidInfo"]]; if ([self isHaveValue:self.goodsModel.moneyInfo.compositionInfo]) { if ([YTHsharedManger startManger].iosonling == 0){ if ([YTHsharedManger startManger].iosonling == 0) { self.labelSubsidy.hidden = NO; self.imageViewSJ.hidden = NO; self.labelSubsidy.text = self.goodsModel.moneyInfo.compositionInfo; @@ -704,9 +682,12 @@ } fail:^(id object) { @strongify(self) dispatch_async(dispatch_get_main_queue(), ^{ self.detailTableview.hidden = NO; [self hideCustomActivityView]; NSError *error = (NSError *)object; if (error.code == -1009) { @@ -721,6 +702,7 @@ } } else { if (self.goodsModel) { self.noNetworkViews.hidden = YES; [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; @@ -735,20 +717,8 @@ }]; } /// æ¯å¦å±å¼äºå¤å¼ å¸(JD) - (BOOL)viewIsExpand { if ([self isHaveValue:self.goodsModel.couponInfoList]) { if (self.goodsModel.couponInfoList.count > 3) { return NO; } else { return YES; } } return YES; } - (void)getRecomeSource { - (void)getRecomeSource { NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; [params setObject:self.goodsID forKey:@"id"]; [params setObject:[NSString stringWithFormat:@"%ld",(long)self.goodsType] forKey:@"goodsType"]; @@ -765,7 +735,6 @@ [self.likeArray addObject:[GoodsDetailBaseModel yy_modelWithJSON:dictionary]]; } } for (NSDictionary *dictionary in object[@"data"][@"listQuality"]) { if ([self isHaveValue:dictionary]) { [self.recommendArray addObject:[GoodsDetailBaseModel yy_modelWithJSON:dictionary]]; @@ -804,16 +773,33 @@ }]; } #pragma mark - GoodsHeaderTableViewCellDelegate - (void)closeRollView { self.isRolling = NO; [self.detailTableview reloadData]; } - (void)taokoulingCopy { self.isCopyTaokouling = YES; self.baseTipsPopView.buttonCount = 2; self.baseTipsPopView.type = 1; self.baseTipsPopView.buttonLeftString = @"å»ç»å½"; self.baseTipsPopView.buttonRightString = @"å»é¢å¸"; self.baseTipsPopView.titleString = @"温馨æç¤º"; self.baseTipsPopView.contentString = @"æªç»å½æ è¿å©ï¼ç¡®å®å è´¹é¢å¸?"; [self.baseTipsPopView showView:nil]; } #pragma mark --- ç«å³é¢å --- - (void)useQuanClicked:(NSString *)couponLink { - (void)useQuanClicked:(JDGoodsHeaderTableViewCell *)cell { if (![self socketReachabilityTest]) { [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; return; } self.couponLink = couponLink; BOOL isFirst = [[NSUserDefaults standardUserDefaults] boolForKey:@"jdAddVerifiStatusFirst"]; BOOL isFirst = [[NSUserDefaults standardUserDefaults] boolForKey:@"pddAddVerifiStatusFirst"]; if (![ALUserInfoServiceManger fetchUID] && !isFirst ) { self.isCopyTaokouling = NO; self.baseTipsPopView.textIsCenter = YES; self.baseTipsPopView.buttonCount = 2; self.baseTipsPopView.type = 1; @@ -834,13 +820,20 @@ [self onInviteVcName:nil]; return; } [self fetchJDCouponLink:couponLink]; [self getSuNingLink]; }; self.baseTipsPopView.rightTouchEvent = ^(NSInteger type) { @strongify(self) [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"jdAddVerifiStatusFirst"]; [self useQuanClicked:couponLink]; [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"pddAddVerifiStatusFirst"]; if (self.isCopyTaokouling) { [UMCustomShop umDetail_copy_token]; [self.commonMethodManage setPasteboardContent:self.goodsModel.couponInfo.token title:@"æ·å£ä»¤å¤å¶æå"]; } else { JDGoodsHeaderTableViewCell * cell = (JDGoodsHeaderTableViewCell *)[self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; [self useQuanClicked:cell]; } }; [self.baseTipsPopView showView:nil]; return; @@ -848,6 +841,9 @@ if(![ALUserInfoServiceManger fetchUID]){ self.transitionView.contentLabel.text = @"æªç»å½æ è¿å©"; self.transitionView.hidden = NO; [self.transitionView showTransitionView]; [self performSelector:@selector(jumpZJPingDuoDuo) withObject:nil/*å¯ä¼ ä»»æç±»ååæ°*/ afterDelay:0.5]; } else { if (![ALUserInfoServiceManger fetchUID]) { @@ -861,46 +857,22 @@ return; } self.transitionView.contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; [self getSuNingLink]; } [self fetchJDCouponLink:couponLink]; [UMCustomShop umDetail_buy]; [UMCustomShop umDetail_coupon_click]; } - (void)fetchJDCouponLink:(NSString *)couponLink { NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; [params setObject:_goodsID forKey:@"id"]; [params setObject:couponLink forKey:@"couponUrl"]; if ([self isHaveValue:[ALUserInfoServiceManger fetchUID]]) { [params setObject:[ALUserInfoServiceManger fetchUID] forKey:@"uid"]; } @weakify(self) [JYNetWorking Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2,@"goods/getSuningLink"] param:params success:^(NSDictionary *object) { [self.view hideToastActivity]; @strongify(self) if ([object[@"code"] integerValue] == 0) { self.native = [object[@"data"][@"native"] boolValue]; //æ¯å¦è·³è½¬åç self.shoppingUrl = object[@"data"][@"jumpLink"]; self.nativeJumpLink = object[@"data"][@"nativeJumpLink"]; self.transitionView.hidden = NO; [self.transitionView showTransitionView]; [self performSelector:@selector(buySNGoods) withObject:nil/*å¯ä¼ ä»»æç±»ååæ°*/ afterDelay:0.5]; } else { [JRToast showWithText:object[@"msg"] bottomOffset:kToolBarH + 15 duration:1.2f]; } } fail:^(id object) { [self.view hideToastActivity]; }]; - (void)jumpZJPingDuoDuo { [YTHsharedManger startManger].isEnterForeground = YES; [self jumpSuNing:self.isNative jumpLink:self.couponJumpLink nativeJumpLink:self.nativeCouponJumpLink]; } #pragma mark- GDrecomeTableViewCellDelegate - (void)cellClicked:(GDrecomeTableViewCell *)cell goodId:(NSString *)goodsID { JDGoodsDetailController *goodDeTrVc = [[JDGoodsDetailController alloc] init]; PDDGoodsDetailController *goodDeTrVc = [[PDDGoodsDetailController alloc] init]; goodDeTrVc.goodsID = goodsID; goodDeTrVc.goodsType = 2; goodDeTrVc.goodsType = 3; [self.navigationController pushViewController:goodDeTrVc animated:YES]; } @@ -909,7 +881,6 @@ [self onLoginVcName:nil title:nil]; return; } // æ¯å¦æ¿æ´»é请åè½ if (![ALUserInfoServiceManger isInvited]) { [self onInviteVcName:nil]; @@ -922,24 +893,13 @@ [self pushAnyInterfaceController:@"ShonpingShareViewController" parms:@{@"url":self.goodsModel.moneyInfo.rateInfoHelpUrl?:@""}]; } - (void)viewMoreCoupon { self.isExpand = YES; NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex:0]; @weakify(self) [UIView performWithoutAnimation:^{ @strongify(self) [self.detailTableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone]; }]; } - (void)onLoginVcName:(NSString *)vcName title:(NSString *)title{ - (void)onLoginVcName:(NSString *)vcName title:(NSString *)title { if (title) { [JRToast showWithText:title bottomOffset:kToolBarH + 15 duration:1.2f]; } else { [JRToast showWithText:@"请å ç»å½æ¿æ å¿«çè´¦å·" bottomOffset:kToolBarH + 15 duration:1.2f]; } // ç»å½çé¢ NewLoginViewController *loginVc = [[NewLoginViewController alloc] init]; loginVc.delegate = self; @@ -972,7 +932,7 @@ - (void)fetchCopyLink { [self.view makeToastActivity:CSToastPositionCenter]; self.buttomView.buttonCopuLink.enabled = NO; self.buttomView.buttonCopuLink.enabled = YES; ((UIImageView *)[self.buttomView.buttonCopuLink subviews][0]).alpha = 0.6; ((UILabel *)[self.buttomView.buttonCopuLink subviews][1]).textColor = UIColorFromRGBValue(0x999999); NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; @@ -1012,10 +972,9 @@ - (void)collectionClicked:(ButtomCarView *)view { if (![self isHaveValue:[ALUserInfoServiceManger fetchUID]]) { [self onLoginVcName:nil title:@"ç»å½åæè½æ¶èå¦"]; [self onLoginVcName:@"goodsDetailCollection" title:@"ç»å½åæè½æ¶èå¦"]; return; } // æ¯å¦æ¿æ´»é请åè½ if (![ALUserInfoServiceManger isInvited]) { [self onInviteVcName:nil]; return; @@ -1028,6 +987,10 @@ } - (void)shareOperationSteps { if (![self socketReachabilityTest]) { [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; return; } if (![ALUserInfoServiceManger fetchUID]) { [self onLoginVcName:nil title:nil]; return; @@ -1079,15 +1042,12 @@ } #pragma mark --- é¢å¸è¿å©/ç«å³è´ä¹° --- - (void)buyClicked:(ButtomCarView *)view { self.isCopyTaokouling = NO; self.transitionView.contentLabel.text = @"è´ä¹°åæè¿å©ï¼å享åæå¥é"; [UMCustomShop umDetail_buy]; [UMCustomShop umDetail_buy_common]; if (![self socketReachabilityTest]) { [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; return; } if (![ALUserInfoServiceManger fetchUID]) { [self onLoginVcName:nil title:nil]; return ; @@ -1098,10 +1058,10 @@ [self onInviteVcName:nil]; return; } [self getJingDongLnk]; [self getSuNingLink]; } - (void)getJingDongLnk { - (void)getSuNingLink { NSDictionary *dic = @{@"uid":[ALUserInfoServiceManger fetchUID],@"id":self.goodsModel.goodsId,@"from" : @"goodsDetail",@"source":self.from?:@""}; [self.view makeToastActivity:CSToastPositionCenter]; @@ -1130,8 +1090,7 @@ - (void)buySNGoods { if (self.goodsModel.hasCoupon) { [UMCustomShop umDetail_buy_to_taobao:@"æå¸"]; } else { }else{ [UMCustomShop umDetail_buy_to_taobao:@"æ å¸"]; } [self jumpSuNing:self.native jumpLink:self.shoppingUrl nativeJumpLink:self.nativeJumpLink]; @@ -1150,11 +1109,6 @@ } } - (void)hideTransitionView { self.transitionView.hidden = YES; [self.transitionView hiddenTransitionView]; } - (void)footprintTaped:(UIButton *)sender { [UMCustomShop umDetail_footer]; FootprintsViewController *footprintsVc = [[FootprintsViewController alloc] init]; @@ -1164,7 +1118,7 @@ #pragma mark --- ç¹å»æ¶è --- - (void)collectTaped:(UIButton *)sender { if (![ALUserInfoServiceManger fetchUID]) { [self onLogin:nil tips:@"ç»å½åæè½æ¶èå¦"]; [self onLogin:@"collection" tips:@"ç»å½åæè½æ¶èå¦"]; return; } // æ¯å¦æ¿æ´»é请åè½ @@ -1174,7 +1128,6 @@ } [self fecthAndPostCollection]; } - (void)fecthAndPostCollection { if (![self socketReachabilityTest]) { [JRToast showWithText:NETWORK_CONNECT_ANOMALY bottomOffset:kToolBarH + 15 duration:1.2f]; @@ -1245,20 +1198,20 @@ { @strongify(self) dispatch_async(dispatch_get_main_queue(), ^{ JDGoodsInfoCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; cell.buttonProLibrary.userInteractionEnabled = YES; JDGoodsHeaderTableViewCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; cell.ProLibraryBtn.userInteractionEnabled = YES; if ([object[@"code"] integerValue] == 0) { BOOL storageState = [object[@"data"][@"storageState"] boolValue]; self.storageState = storageState; if (storageState) { [JRToast showWithText:@"æ·»å è³åäº«åºæå" bottomOffset:kToolBarH + 15 duration:1.2f]; [UMCustomShop umDetail_joinXPK]; cell.buttonProLibrary.selected = YES; cell.ProLibraryBtn.selected = YES; } else { [JRToast showWithText:@"å·²ä»å享åºä¸å é¤" bottomOffset:kToolBarH + 15 duration:1.2f]; [UMCustomShop umDetail_goods_detail_xpk_cancel]; cell.buttonProLibrary.selected = NO; cell.ProLibraryBtn.selected = NO; } } else { @@ -1268,17 +1221,17 @@ } fail:^(id object) { dispatch_async(dispatch_get_main_queue(), ^{ JDGoodsInfoCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; cell.buttonProLibrary.userInteractionEnabled = YES; JDGoodsHeaderTableViewCell *cell = [self.detailTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; cell.ProLibraryBtn.userInteractionEnabled = YES; }); }]; } - (void)noticeMineBackEvent:(NSString *)vcName { - (void)noticeMineBackEvent:(NSString *)vcName { [[NSNotificationCenter defaultCenter] postNotificationName:@"noticeMessageVcUpdateData" object:nil]; [self.messageManger getMessage]; [self getgoodsinfo]; } #pragma mark --- ç»å½ --- @@ -1289,7 +1242,7 @@ loginVc.rootVc = self; loginVc.delegate = self; loginVc.vcName = name; loginVc.from = @"京ä¸è¯¦æ "; loginVc.from = @"æ¼å¤å¤è¯¦æ "; [self.navigationController pushViewController:loginVc animated:YES]; } @@ -1400,7 +1353,8 @@ } #pragma mark - scrollViewDelegate - (void)scrollViewDidScroll:(UIScrollView *)scrollView { - (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView.contentOffset.y > self.lastContentOffest) { self.lastContentOffest = scrollView.contentOffset.y; } @@ -1582,45 +1536,113 @@ return 0; } - (CGFloat)getSpaceLabelHeight:(NSString *)str withAttrDict:(NSDictionary *)dict withWidth:(CGFloat)width { CGSize size = [str boundingRectWithSize:CGSizeMake(width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dict context:nil].size; return size.height; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { // code == 2 åå䏿¶ if (self.code == 2) { return SCREEN_WIDTH; } CGFloat heightCell = 0; if ([YTHsharedManger startManger].iosonling == 1) { heightCell = SCREEN_WIDTH + (20+12) + (15+12) + (20+[self fetchMaxCouponHeight]+[self fetchTitleHeight]) + (5+[self fetchMoreCouponHeight]) + [self fetchlabelsHeight] + [self fetchFooterButtonHeght] - 50; UIImage *icomImage = icomImage = [UIImage imageNamed:@"ic_share_sn"]; NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; style.lineSpacing = 3; // 坹齿¹å¼ style.alignment = NSTextAlignmentLeft; // é¦è¡ç¼©è¿ CGFloat firstLineHeadIndentHeight = 0; if ([self.goodsModel.title hasPrefix:@"ã"]) { firstLineHeadIndentHeight = icomImage.size.width; } else { heightCell = SCREEN_WIDTH + (20+12) + (15+12) + (20+[self fetchMaxCouponHeight]+[self fetchTitleHeight]) + (5+[self fetchMoreCouponHeight]) + [self fetchlabelsHeight] + [self fetchFooterButtonHeght]; firstLineHeadIndentHeight = icomImage.size.width + 8; } return heightCell; } if (indexPath.section == 1) { if (self.code == 2) { if (self.likeArray.count != 0) { NSInteger height = self.likeArray.count / 2 ; if (self.likeArray.count % 2 != 0) { height = height + 1; style.firstLineHeadIndent = firstLineHeadIndentHeight; NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@"%@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; //æ¯å¦æè¶ 级ä¼åè¿ CGFloat maxCouponHeight = 0; if (![self.from isEqualToString:@"miandan"]) {// æ¯å¦æ¯å å if ([ALUserInfoServiceManger fetchUserInfo]) {// æ¯å¦ç»é if (![ALUserInfoServiceManger isMembership]) {// æ¯å¦æ¯ä¼å if (self.goodsModel.otherInfo.rewardCoupon) { maxCouponHeight = 50; } } } else { if (self.goodsModel.otherInfo.rewardCoupon) { maxCouponHeight = 50; } } } //æ¯å¦ææ ç¾ CGFloat labelsHeght = 0; if ([self isHaveValue:self.goodsModel.labels]) { labelsHeght = 22; } CGFloat jianqu = 0; if ([YTHsharedManger startManger].iosonling == 1) { jianqu = 40; } if (self.goodsModel.hasCoupon) { if (self.goodsModel.couponInfo.token && ![self.goodsModel.couponInfo.token isEqualToString:@""]) { return SCREEN_WIDTH + 245 + height + maxCouponHeight + labelsHeght - jianqu; } else { return SCREEN_WIDTH + 205 + height + maxCouponHeight + labelsHeght - jianqu; } } else { return SCREEN_WIDTH + 117 + height + maxCouponHeight + labelsHeght - jianqu; } } if (indexPath.section == 1) { if (self.code == 2) { if (self.likeArray.count != 0) { NSInteger height = self.likeArray.count / 2 ; if (self.likeArray.count % 2 != 0) { height = height + 1; } return height * ((SCREEN_WIDTH-30)/2+136); } if (self.recommendArray.count != 0) { NSInteger height = self.recommendArray.count / 2 ; if (self.recommendArray.count % 2 != 0) { height = height + 1; } return height * ((SCREEN_WIDTH-30)/2+136); } } else { if (self.shareUsersArray.count == 0) { return CGFLOAT_MIN; } else { return 62; } } @@ -1676,7 +1698,8 @@ return CGFLOAT_MIN; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { if (self.code == 2) { NSString *identifier = @"NoShopTableViewCell"; @@ -1688,17 +1711,19 @@ cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } NSString *cellIden = @"jDGoodsInfoCell"; JDGoodsInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIden]; if (!cell){ cell = [[JDGoodsInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIden]; NSString *identifier = @"GoodsHeaderTableViewCell"; JDGoodsHeaderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; if (!cell) { cell = [[JDGoodsHeaderTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; } cell.delegate = self; cell.delegate = self; cell.from = self.from; cell.fanliValid = self.fanliValid; cell.shareValid = self.shareValid; cell.isExpand = self.isExpand; cell.model = self.goodsModel; cell.storageState = self.storageState; [cell.ProLibraryBtn addTarget:self action:@selector(ProLibraryTaped:) forControlEvents:UIControlEventTouchUpInside]; @weakify(self) cell.touchCheckLike = ^{ @@ -1709,9 +1734,8 @@ [self.navigationController pushViewController:searchDetailMainVc animated:YES]; }; [cell.buttonProLibrary addTarget:self action:@selector(ProLibraryTaped:) forControlEvents:UIControlEventTouchUpInside]; if (!_goodsModel) { cell.selectionStyle = UITableViewCellSelectionStyleNone; if (!self.goodsModel) { CATransition *animation = [CATransition animation]; animation.type = kCATransitionFade; animation.duration = 0.4; @@ -1899,7 +1923,8 @@ return view; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { if (section == 0) { if (self.code == 2) { return 10; @@ -1939,7 +1964,8 @@ } } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { if (section == 0) { if (self.code == 2) { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 10)]; @@ -1997,7 +2023,8 @@ } #pragma mark --- getter --- - (UITableView *)detailTableview { - (UITableView *)detailTableview { if (_detailTableview ) { return _detailTableview; } @@ -2041,7 +2068,8 @@ return _detailTableview; } - (GDetailView *)topView { - (GDetailView *)topView { if (_topView) { return _topView; } @@ -2070,7 +2098,8 @@ return _buttomView; } - (JDNOFanLiButtonView *)noFanLiButtomView { - (JDNOFanLiButtonView *)noFanLiButtomView { if (_noFanLiButtomView) { return _noFanLiButtomView; } @@ -2100,7 +2129,8 @@ return _transitionView; } - (UIButton *)backButton { - (UIButton *)backButton { if (_backButton ) { return _backButton; } @@ -2114,7 +2144,8 @@ return _backButton; } - (UIButton *)moreShareButton { - (UIButton *)moreShareButton { if (_moreShareButton ) { return _moreShareButton; } @@ -2131,7 +2162,8 @@ return _moreShareButton; } - (UIButton *)blockBackButton { - (UIButton *)blockBackButton { if (!_blockBackButton ) { _blockBackButton = [UIButton buttonWithType:UIButtonTypeCustom]; _blockBackButton.frame = CGRectMake(0, 0, 70, kNavigationBarH + kStatusBarH); @@ -2140,7 +2172,8 @@ return _blockBackButton; } - (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @@ -2150,15 +2183,16 @@ if (self.timers) { dispatch_source_cancel(self.timers); } [[ALNetWorking startInterface] cancelAll]; [[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self]; if (self.code != 2 && self.extraDictionary) { [self.detailWebView removeObserver:self forKeyPath:@"scrollView.contentSize"]; } } - (SJNoNetwork *)noNetworkViews { - (SJNoNetwork *)noNetworkViews { if (_noNetworkViews) { return _noNetworkViews; } @@ -2174,7 +2208,8 @@ /** ç¹å»èç½ */ - (void)ClickConnectBtn:(UIButton *)sender { - (void)ClickConnectBtn:(UIButton *)sender { if (iOS10) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil]; @@ -2183,7 +2218,8 @@ } } - (SJShopScrollView *)shopScrollView { - (SJShopScrollView *)shopScrollView { if (_shopScrollView) { return _shopScrollView; } @@ -2191,7 +2227,8 @@ return _shopScrollView; } - (SJRollingView *)currentRollingView { - (SJRollingView *)currentRollingView { if (_currentRollingView) { return _currentRollingView; } @@ -2201,7 +2238,8 @@ return _currentRollingView; } - (SJSharedTableViewCell *)shopview { - (SJSharedTableViewCell *)shopview { if (_shopview) { return _shopview; } @@ -2210,7 +2248,8 @@ return _shopview; } - (GDrecomeTableViewCell *)likeCell { - (GDrecomeTableViewCell *)likeCell { if (_likeCell) { return _likeCell; } @@ -2219,7 +2258,8 @@ _likeCell.selectionStyle = UITableViewCellSelectionStyleNone; return _likeCell; } - (GDrecomeTableViewCell *)recomeCell { - (GDrecomeTableViewCell *)recomeCell { if (_recomeCell) { return _recomeCell; } @@ -2266,11 +2306,13 @@ return _backView; } - (void)setDetailUrlString:(NSString *)detailUrlString { - (void)setDetailUrlString:(NSString *)detailUrlString { _detailUrlString = detailUrlString; [self.detailWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:detailUrlString]]]; } - (WKWebView *)detailWebView { - (WKWebView *)detailWebView { if (_detailWebView) { return _detailWebView; } @@ -2282,7 +2324,8 @@ return _detailWebView; } -(UIScrollView *)contentScrollView { -(UIScrollView *)contentScrollView { if (!_contentScrollView) { _contentScrollView = [[UIScrollView alloc]init]; _contentScrollView.contentSize = CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT); @@ -2291,7 +2334,8 @@ return _contentScrollView; } - (WebLoadProgressView *)webLoadProgressView { - (WebLoadProgressView *)webLoadProgressView { if (!_webLoadProgressView) { _webLoadProgressView = [[WebLoadProgressView alloc] init]; _webLoadProgressView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 50); @@ -2300,7 +2344,8 @@ } // 页é¢å¼å§å è½½æ¶è°ç¨ - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { @weakify(self) dispatch_async(dispatch_get_main_queue(), ^{ @strongify(self) @@ -2313,20 +2358,12 @@ } // 页é¢å è½½å®æä¹åè°ç¨ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation { @weakify(self) dispatch_async(dispatch_get_main_queue(), ^{ @strongify(self) [self doSomethingDis]; // 计ç®WKWebViewé«åº¦ [webView evaluateJavaScript:@"document.body.offsetHeight" completionHandler:^(id _Nullable result, NSError * _Nullable error) { self.webHeight = [result doubleValue]; self.tempWebHeight = [result doubleValue]; [UIView performWithoutAnimation:^{ @strongify(self) [self.detailTableview reloadData]; }]; }]; }); } MIduo/½çÃæ/ÉÌÆ·ÏêÇé/WPH/Cell/WPHGoodsdetailInfoCell.m
@@ -364,8 +364,9 @@ self.titleLabel.attributedText = attrText; NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; CGFloat height = [self getSpaceLabelHeight:model.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 10]; self.titleLabel.frame = CGRectMake(10, CGRectGetMinY(self.labelImage.frame) - 2, SCREEN_WIDTH - 10, height); CGFloat height = [self getSpaceLabelHeight:model.title withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; self.titleLabel.frame = CGRectMake(10, CGRectGetMinY(self.labelImage.frame) - 2, SCREEN_WIDTH - 20, height); // æ ç¾ CGFloat gongyiLabelWidth = 0, baokuanLabelWidth = 0; MIduo/½çÃæ/ÉÌÆ·ÏêÇé/WPH/WPHGoodsDetailController.m
@@ -1549,7 +1549,7 @@ style.firstLineHeadIndent = firstLineHeadIndentHeight; NSDictionary *attributeDic = @{NSParagraphStyleAttributeName:style,NSFontAttributeName:[UIFont systemFontOfSize:15]}; CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@" %@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; CGFloat height = [self getSpaceLabelHeight:[NSString stringWithFormat:@"%@",self.goodsModel.title] withAttrDict:attributeDic withWidth:SCREEN_WIDTH - 20]; //æ¯å¦æè¶ 级ä¼åè¿ CGFloat maxCouponHeight = 0; if ([ALUserInfoServiceManger fetchUserInfo]) {// æ¯å¦ç»é MIduo/½çÃæ/ÎÒµÄ/Collection/View/CollectionCell.m
@@ -36,6 +36,8 @@ @property (nonatomic, strong) UIView *quanView; @property (nonatomic, strong) UILabel *quanLabel; /// ææ£ @property (nonatomic, nullable, strong) UILabel *labelDisCount; @property (nonatomic, nullable, strong) UIImageView *imageViewStore; @property (nonatomic, nullable, strong) UILabel *stroreLabel; @@ -142,6 +144,11 @@ [self.quanView addSubview:self.couponLabel]; self.couponLabel.sd_layout.leftSpaceToView(self.quanLabel, 0).rightSpaceToView(self.quanView, 0).topSpaceToView(self.quanView, 0).bottomSpaceToView(self.quanView, 0); // ææ£ [self.bgView addSubview:self.labelDisCount]; self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(0).widthIs(18); self.labelDisCount.sd_cornerRadius = @3; // è¿å©è§å¾ [self.bgView addSubview:self.fanLabel]; @@ -274,6 +281,15 @@ } else if (model.shopType == 30){ [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_pdd"]]; icomImage = [UIImage imageNamed:@"ic_share_pdd"]; } else if (model.shopType == 40){ [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_wph"]]; icomImage = [UIImage imageNamed:@"ic_share_wph"]; } else if (model.shopType == 50){ [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_sn"]]; icomImage = [UIImage imageNamed:@"ic_share_sn"]; } self.typeImageView.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).topSpaceToView(self.bgView, 8).widthIs(icomImage.size.width).heightIs(icomImage.size.height); @@ -363,18 +379,10 @@ self.titleLabel.attributedText = attributedString; // è¿å© NSString *fanLiString = nil; self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); NSString *fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; if (model.moneyInfo.moneyType == 1) { self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; } else { self.fanLabel.textColor = UIColorFromRGBValue(0xFF7800); self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE5C5); fanLiString = [NSString stringWithFormat:@"å¥ %@",model.moneyInfo.fanliMoney]; } CGFloat fanLabelWidth = [self getWidthWithText:fanLiString height:18 font:self.fanLabel.font.pointSize]; self.fanLabel.text = fanLiString; @@ -395,11 +403,39 @@ } else { self.quanView.hidden = YES; totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; if (model.shopType == 40) { totalPriceString = [NSString stringWithFormat:@"%@", model.couponPrice]; } else { totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; } self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); } self.totalPriceLabel.text = totalPriceString; // ææ£ if (model.shopType == 40) { self.labelDisCount.hidden = NO; self.salesLabel.hidden = YES; if ([self isHaveValue:model.discount]) { CGFloat discountLabellWidth = [self getWidthWithText:model.discount height:18 font:self.fanLabel.font.pointSize]; self.labelDisCount.text = model.discount; self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(18).widthIs(roundf(discountLabellWidth + 16)); self.fanLabel.sd_resetLayout.leftSpaceToView(self.labelDisCount, 8).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); } else { self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); } } else { self.labelDisCount.hidden = YES; } // æé«è¿å© NSString *stringMaxFan = model.moneyInfo.maxMoney; @@ -418,7 +454,7 @@ maskLayer.path = maskPath.CGPath; self.labelMaxFan.layer.mask = maskLayer; }; if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""]) { if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""] && model.shopType != 40) { self.imageSanJiao.hidden = NO; self.labelMaxFan.hidden = NO; @@ -695,4 +731,16 @@ return _labelMaxFan; } - (UILabel *)labelDisCount { if (!_labelDisCount) { _labelDisCount = [[UILabel alloc] init]; _labelDisCount.textColor = UIColorFromRGBValue(0xFFFFFF); _labelDisCount.font = [UIFont systemFontOfSize:12]; _labelDisCount.textAlignment = NSTextAlignmentCenter; _labelDisCount.backgroundColor = UIColorFromRGBValue(0xE5005C); _labelDisCount.hidden = YES; } return _labelDisCount; } @end MIduo/½çÃæ/ÎÒµÄ/FootprintsViewCell.m
@@ -36,6 +36,8 @@ @property (nonatomic, strong) UIView *quanView; @property (nonatomic, strong) UILabel *quanLabel; /// ææ£ @property (nonatomic, nullable, strong) UILabel *labelDisCount; @property (nonatomic, nullable, strong) UIImageView *imageViewStore; @property (nonatomic, nullable, strong) UILabel *stroreLabel; @@ -142,6 +144,11 @@ [self.quanView addSubview:self.couponLabel]; self.couponLabel.sd_layout.leftSpaceToView(self.quanLabel, 0).rightSpaceToView(self.quanView, 0).topSpaceToView(self.quanView, 0).bottomSpaceToView(self.quanView, 0); // ææ£ [self.bgView addSubview:self.labelDisCount]; self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(0).widthIs(18); self.labelDisCount.sd_cornerRadius = @3; // è¿å©è§å¾ [self.bgView addSubview:self.fanLabel]; @@ -274,6 +281,15 @@ } else if (model.shopType == 30){ [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_pdd"]]; icomImage = [UIImage imageNamed:@"ic_share_pdd"]; } else if (model.shopType == 40){ [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_wph"]]; icomImage = [UIImage imageNamed:@"ic_share_wph"]; } else if (model.shopType == 50){ [self.typeImageView setImage:[UIImage imageNamed:@"ic_share_sn"]]; icomImage = [UIImage imageNamed:@"ic_share_sn"]; } self.typeImageView.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).topSpaceToView(self.bgView, 8).widthIs(icomImage.size.width).heightIs(icomImage.size.height); @@ -362,18 +378,9 @@ self.titleLabel.attributedText = attributedString; // è¿å© NSString *fanLiString = nil; if (model.moneyInfo.moneyType == 1) { self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; } else { self.fanLabel.textColor = UIColorFromRGBValue(0xFF7800); self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE5C5); fanLiString = [NSString stringWithFormat:@"å¥ %@",model.moneyInfo.fanliMoney]; } NSString *fanLiString = fanLiString = [NSString stringWithFormat:@"è¿ %@",model.moneyInfo.fanliMoney]; self.fanLabel.textColor = UIColorFromRGBValue(0xE5005C); self.fanLabel.backgroundColor = UIColorFromRGBValue(0xFFE7F1); CGFloat fanLabelWidth = [self getWidthWithText:fanLiString height:18 font:self.fanLabel.font.pointSize]; self.fanLabel.text = fanLiString; @@ -394,11 +401,38 @@ } else { self.quanView.hidden = YES; totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; if (model.shopType == 40) { totalPriceString = [NSString stringWithFormat:@"%@", model.couponPrice]; } else { totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; } self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); } self.totalPriceLabel.text = totalPriceString; // ææ£ if (model.shopType == 40) { self.labelDisCount.hidden = NO; self.salesLabel.hidden = YES; if ([self isHaveValue:model.discount]) { CGFloat discountLabellWidth = [self getWidthWithText:model.discount height:18 font:self.fanLabel.font.pointSize]; self.labelDisCount.text = model.discount; self.labelDisCount.sd_layout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).heightIs(18).widthIs(roundf(discountLabellWidth + 16)); self.fanLabel.sd_resetLayout.leftSpaceToView(self.labelDisCount, 8).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); } else { self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); } } else { self.labelDisCount.hidden = YES; } // æé«è¿å© NSString *stringMaxFan = model.moneyInfo.maxMoney; @@ -417,7 +451,7 @@ maskLayer.path = maskPath.CGPath; self.labelMaxFan.layer.mask = maskLayer; }; if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""]) { if (model.moneyInfo.maxMoney && ![model.moneyInfo.maxMoney isEqualToString:@""] && model.shopType != 40) { self.imageSanJiao.hidden = NO; self.labelMaxFan.hidden = NO; @@ -694,4 +728,16 @@ return _labelMaxFan; } - (UILabel *)labelDisCount { if (!_labelDisCount) { _labelDisCount = [[UILabel alloc] init]; _labelDisCount.textColor = UIColorFromRGBValue(0xFFFFFF); _labelDisCount.font = [UIFont systemFontOfSize:12]; _labelDisCount.textAlignment = NSTextAlignmentCenter; _labelDisCount.backgroundColor = UIColorFromRGBValue(0xE5005C); _labelDisCount.hidden = YES; } return _labelDisCount; } @end MIduo/½çÃæ/ËÑË÷/SearchMainController.m
@@ -147,13 +147,14 @@ #pragma mark ------ privte method ------ - (void)getSuggestSearchWithKey:(NSString *)text { NSMutableDictionary *dictionaryMut = [[NSMutableDictionary alloc] init]; NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; if ([self isHaveValue:text]) { [dictionaryMut setValue:text forKey:@"kw"]; [params setObject:text forKey:@"kw"]; } [dictionaryMut setValue:[NSString stringWithFormat:@"%ld",(long)self.selectIndex] forKey:@"goodsType"]; [params setObject:[NSString stringWithFormat:@"%ld",(long)self.selectIndex] forKey:@"goodsType"]; @weakify(self) [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2, @"search/suggestSearch"] param:dictionaryMut success:^(NSDictionary *object) { [[ALNetWorking startInterface] Post:[NSString stringWithFormat:@"%@/%@",domainHTTP2, @"search/suggestSearch"] param:params success:^(NSDictionary *object) { @strongify(self) if (object && [object[@"code"] integerValue] == 0) { [self.arrayData removeAllObjects]; MIduo/½çÃæ/ÑûÇë/ÉÌÆ··ÖÏí/MultipleFigureShareController.h
File was deleted MIduo/½çÃæ/ÑûÇë/ÉÌÆ··ÖÏí/MultipleFigureShareController.m
File was deleted MIduo/½çÃæ/ÑûÇë/ÉÌÆ··ÖÏí/NewGoodsShareController.m
@@ -10,7 +10,7 @@ #import "NewGoodsShareController.h" #import "QuickShareController.h" #import "SingleFigureShareController.h" #import "MultipleFigureShareController.h" // Vivews #import "NewGoodsShareTopView.h" @@ -22,7 +22,6 @@ @property (nonatomic, nullable, strong) QuickShareController *quickShareVc; @property (nonatomic, nullable, strong) SingleFigureShareController *singleFigureShareVc; @property (nonatomic, nullable, strong) MultipleFigureShareController *multipleFigureShareVc; @property (nonatomic, assign) CGFloat viewLindeX; @@ -44,7 +43,7 @@ } - (void)setupDataConfig { self.viewLindeX = ((SCREEN_WIDTH / 3) - 85) / 2; self.viewLindeX = ((SCREEN_WIDTH / 2) - 85) / 2; } #pragma mark --- click_touch_event --- @@ -58,7 +57,6 @@ @strongify(self) self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX, 48-2, 85, 2); self.newGoodsShareView.single_figure_Button.selected = NO; self.newGoodsShareView.multiple_figure_Button.selected = NO; button.selected = YES; }]; [self setupQuickShareVcView]; @@ -70,28 +68,11 @@ @weakify(self) [UIView animateWithDuration:0.3 animations:^{ @strongify(self) self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX + SCREEN_WIDTH / 3, 48 - 2, 85, 2); self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX + SCREEN_WIDTH / 2, 48 - 2, 85, 2); self.newGoodsShareView.buttonQuickShare.selected = NO; self.newGoodsShareView.multiple_figure_Button.selected = NO; button.selected = YES; }]; [self setupSingleFigureShareVcView]; } }]; [[self.newGoodsShareView.multiple_figure_Button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(UIButton *button) { @strongify(self) if (!button.selected) { @weakify(self) [UIView animateWithDuration:0.3 animations:^{ @strongify(self) self.newGoodsShareView.left_Buttom_View.frame = CGRectMake(self.viewLindeX + SCREEN_WIDTH / 3 * 2, 48 - 2, 85, 2); self.newGoodsShareView.buttonQuickShare.selected = NO; self.newGoodsShareView.single_figure_Button.selected = NO; button.selected = YES; }]; [self setupMultipleFigureShareVcView]; } }]; } @@ -104,7 +85,6 @@ - (void)setupQuickShareVcView { [self.singleFigureShareVc.view removeFromSuperview]; [self.multipleFigureShareVc.view removeFromSuperview]; if (!self.quickShareVc) { self.quickShareVc = [[QuickShareController alloc] init]; } @@ -115,7 +95,6 @@ } - (void)setupSingleFigureShareVcView { [self.multipleFigureShareVc.view removeFromSuperview]; [self.quickShareVc.view removeFromSuperview]; if (!self.singleFigureShareVc) { self.singleFigureShareVc = [[SingleFigureShareController alloc] init]; @@ -124,18 +103,6 @@ self.singleFigureShareVc.viewController = self; self.singleFigureShareVc.pageViewHeight = self.pageView.size.height; [self.pageView addSubview:self.singleFigureShareVc.view]; } - (void)setupMultipleFigureShareVcView { [self.singleFigureShareVc.view removeFromSuperview]; [self.quickShareVc.view removeFromSuperview]; if (!self.multipleFigureShareVc) { self.multipleFigureShareVc = [[MultipleFigureShareController alloc] init]; } self.multipleFigureShareVc.resultDic = self.dataDictionary; self.multipleFigureShareVc.viewController = self; self.multipleFigureShareVc.pageViewHeight = self.pageView.size.height; [self.pageView addSubview:self.multipleFigureShareVc.view]; } - (void)navigationConfig { @@ -183,10 +150,8 @@ - (void)resetViewFrame { self.singleFigureShareVc.pageViewHeight = self.pageView.size.height; self.multipleFigureShareVc.pageViewHeight = self.pageView.size.height; [self.singleFigureShareVc resetViewFrame]; [self.multipleFigureShareVc resetViewFrame]; } #pragma mark --- getter --- MIduo/½çÃæ/ÑûÇë/ÉÌÆ··ÖÏí/View/NewGoodsShareTopView.h
@@ -17,8 +17,6 @@ @property (nonatomic, nullable, strong) ALButton *buttonQuickShare; /// åå¾æé® @property (nonatomic, nullable, strong) ALButton *single_figure_Button; /// å¤å¾æé® @property (nonatomic, nullable, strong) ALButton *multiple_figure_Button; @end MIduo/½çÃæ/ÑûÇë/ÉÌÆ··ÖÏí/View/NewGoodsShareTopView.m
@@ -21,15 +21,12 @@ - (void)setupView { [self addSubview:self.buttonQuickShare]; self.buttonQuickShare.sd_layout.leftEqualToView(self).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 3); self.buttonQuickShare.sd_layout.leftEqualToView(self).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 2); [self addSubview:self.single_figure_Button]; self.single_figure_Button.sd_layout.leftSpaceToView(self.buttonQuickShare, 0).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 3); self.single_figure_Button.sd_layout.leftSpaceToView(self.buttonQuickShare, 0).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 2); [self addSubview:self.multiple_figure_Button]; self.multiple_figure_Button.sd_layout.rightEqualToView(self).centerYEqualToView(self).heightIs(30).widthIs(SCREEN_WIDTH / 3); self.left_Buttom_View.frame = CGRectMake(((SCREEN_WIDTH / 3) - 85) / 2, 48 - 2, 85, 2); self.left_Buttom_View.frame = CGRectMake(((SCREEN_WIDTH / 2) - 85) / 2, 48 - 2, 85, 2); self.left_Buttom_View.layer.masksToBounds = YES; self.left_Buttom_View.layer.cornerRadius = 1; [self addSubview:self.left_Buttom_View]; @@ -45,11 +42,7 @@ [_buttonQuickShare setTitle:@" å¿«æ·å享" forState:UIControlStateNormal]; [_buttonQuickShare setTitleColor:UICOLOR_FROM_RGB(0x444444, 1.0) forState:UIControlStateNormal]; [_buttonQuickShare setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; _buttonQuickShare.titleLabel.font = [UIFont systemFontOfSize:15]; if (SCREEN_WIDTH < 375) { _buttonQuickShare.titleLabel.font = [UIFont systemFontOfSize:15 - DYFont]; } _buttonQuickShare.selected = YES; } return _buttonQuickShare; @@ -64,31 +57,10 @@ [_single_figure_Button setTitle:@" åå¾å享" forState:UIControlStateNormal]; [_single_figure_Button setTitleColor:UICOLOR_FROM_RGB(0x444444, 1.0) forState:UIControlStateNormal]; [_single_figure_Button setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; _single_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15]; if (SCREEN_WIDTH < 375) { _single_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15 - DYFont]; } } return _single_figure_Button; } - (ALButton *)multiple_figure_Button { if (!_multiple_figure_Button) { _multiple_figure_Button = [ALButton buttonWithType:UIButtonTypeCustom]; [_multiple_figure_Button setImage:ALIMAGE_NAMED(@"new_share_duotu_normol") forState:UIControlStateNormal]; [_multiple_figure_Button setImage:ALIMAGE_NAMED(@"new_share_duotu_select") forState:UIControlStateSelected]; [_multiple_figure_Button setTitle:@" å¤å¾å享" forState:UIControlStateNormal]; [_multiple_figure_Button setTitleColor:UICOLOR_FROM_RGB(0x444444, 1.0) forState:UIControlStateNormal]; [_multiple_figure_Button setTitleColor:UICOLOR_FROM_RGB(0xE5005C, 1.0) forState:UIControlStateSelected]; _multiple_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15]; if (SCREEN_WIDTH < 375) { _multiple_figure_Button.titleLabel.font = [UIFont systemFontOfSize:15 - DYFont]; } } return _multiple_figure_Button; } - (UIView *)left_Buttom_View { MIduo/½çÃæ/ÑûÇë/ÉÌÆ··ÖÏí/View/ShowShareView.m
@@ -277,30 +277,40 @@ _resultDic = resultDic; if (resultDic) { UIImage *imagesType = nil; if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 10) {// 10-æ·å® 11-å¤©ç« 20-äº¬ä¸ 30-æ¼å¤å¤ NSInteger shopType = ((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType; if (shopType == 10) {// 10-æ·å® 11-å¤©ç« 20-äº¬ä¸ 30-æ¼å¤å¤ imagesType = [UIImage imageNamed:@"ic_share_taobao"]; [self.typeImageView setImage:imagesType]; } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 11) { } else if (shopType == 11) { imagesType = [UIImage imageNamed:@"ic_share_tmall"]; [self.typeImageView setImage:imagesType]; } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 20 || ((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 21) { } else if (shopType == 20 || shopType == 21) { imagesType = [UIImage imageNamed:@"ic_share_jd"]; [self.typeImageView setImage:imagesType]; } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 30) { } else if (shopType == 30) { imagesType = [UIImage imageNamed:@"ic_share_pdd"]; [self.typeImageView setImage:imagesType]; self.typeImageView.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 9).widthIs(imagesType.size.width).heightIs(imagesType.size.height); } else if (shopType == 40) { imagesType = [UIImage imageNamed:@"ic_share_wph"]; [self.typeImageView setImage:imagesType]; } else if (shopType == 50) { imagesType = [UIImage imageNamed:@"ic_share_sn"]; [self.typeImageView setImage:imagesType]; } self.typeImageView.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 9).widthIs(imagesType.size.width).heightIs(imagesType.size.height); self.taobao_tianmall_Label.text = [NSString stringWithFormat:@"%@ Â¥%@",((GoodsDetailBaseModel *)resultDic[@"goods"]).priceName,((GoodsDetailBaseModel *)resultDic[@"goods"]).zkPrice]; // æ é¢ NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; style.lineSpacing = 6 - (self.titleLabel.font.lineHeight - self.titleLabel.font.pointSize); style.lineSpacing = 3; // 坹齿¹å¼ style.alignment = NSTextAlignmentLeft; // é¦è¡ç¼©è¿ @@ -323,6 +333,7 @@ if (SCREEN_WIDTH > 375) { self.titleLabel.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 9).rightSpaceToView(self.scrollView, 5).heightIs(35); } if (IS_IPHONE_X) { self.titleLabel.sd_resetLayout.leftSpaceToView(self.scrollView, 11).topSpaceToView(self.imageView, 10.5).rightSpaceToView(self.scrollView, 5).heightIs(35); } @@ -331,9 +342,14 @@ NSString *totalPrice, *amount; BOOL isCoupon = NO; if (((GoodsDetailBaseModel *)resultDic[@"goods"]).hasCoupon) { if (((GoodsDetailBaseModel *)resultDic[@"goods"]).hasCoupon || shopType == 40) { isCoupon = YES; totalPrice = [NSString stringWithFormat:@"å¸åä»· ï¿¥%@",((GoodsDetailBaseModel *)resultDic[@"goods"]).couponPrice]; NSString *string = @"å¸åä»·"; if (shopType == 40) { string = @"æåä»·"; } totalPrice = [NSString stringWithFormat:@"%@ ï¿¥%@",string, ((GoodsDetailBaseModel *)resultDic[@"goods"]).couponPrice]; amount = [NSString stringWithFormat:@"Â¥ %@",((GoodsDetailBaseModel *)resultDic[@"goods"]).couponInfo.amount]; } else { @@ -359,8 +375,20 @@ } self.totalPriceLabel.attributedText = numString; // å é® if (((GoodsDetailBaseModel *)resultDic[@"goods"]).shopType == 21) { if (shopType == 21) { self.packageMailLabel.text = @"èªè¥"; } else if (shopType == 40) { isCoupon = NO; self.packageMailLabel.font = [UIFont systemFontOfSize:12]; self.packageMailLabel.textColor = UICOLOR_FROM_RGB(0xFFFFFF, 1.0); self.packageMailLabel.backgroundColor = XYRMainColor; NSString *string = ((GoodsDetailBaseModel *)resultDic[@"goods"]).discount; self.packageMailLabel.text = string; CGFloat widthPackageMailLabel = [self getWidthWithText:string height:18 font:12]; self.packageMailLabel.sd_resetLayout.leftSpaceToView(self.scrollView, 12).bottomEqualToView(self.couponView).heightIs(18).widthIs(widthPackageMailLabel + 10); } else { if (!((GoodsDetailBaseModel *)resultDic[@"goods"]).baoyou) { @@ -375,10 +403,13 @@ } else if (((GoodsDetailBaseModel *)resultDic[@"goods"]).salesType == 4) { salesString = @"æ»éé"; } self.salesLabel.text = [NSString stringWithFormat:@"%@ %@",salesString,((GoodsDetailBaseModel *)resultDic[@"goods"]).salesCount]; if ([self isHaveValue:((GoodsDetailBaseModel *)resultDic[@"goods"]).salesCount]) { self.salesLabel.text = [NSString stringWithFormat:@"%@ %@",salesString,((GoodsDetailBaseModel *)resultDic[@"goods"]).salesCount]; } // æä¼æ å¸ if (isCoupon) { UIImage *imageCouponRight = [UIImage imageNamed:@"new_share_dantu_quan"]; UIImage *imageCouponRight = [UIImage imageNamed:@"new_share_dantu_n"]; CGFloat labelHeight = 11.0f; if (SCREEN_WIDTH > 375) { labelHeight = 11.0f + DYFont; @@ -399,7 +430,9 @@ } else { self.couponLabel.hidden = YES; self.descCouponLabel.hidden = YES; self.taobao_tianmall_Label.hidden = YES; if (shopType != 40) {//䏿¯å¯åä¼åå self.taobao_tianmall_Label.hidden = YES; } } // æ·ç¤¼é NSString *fanLiString = resultDic[@"share"][@"spreadMoney"]; @@ -557,9 +590,6 @@ if (!_titleLabel) { _titleLabel = [[YYLabel alloc] init]; _titleLabel.font = [UIFont systemFontOfSize:13]; if (SCREEN_WIDTH < 375) { _titleLabel.font = [UIFont systemFontOfSize:11.0]; } _titleLabel.numberOfLines = 2; _titleLabel.textColor = UIColorFromRGBValue(0x000000); _titleLabel.textVerticalAlignment = YYTextVerticalAlignmentTop; MIduo/½çÃæ/Ê×Ò³/ThirdClassificationCell.m
@@ -393,11 +393,15 @@ } else { self.quanView.hidden = YES; totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; if (model.shopType == 40) { totalPriceString = [NSString stringWithFormat:@"%@", model.couponPrice]; } else { totalPriceString = [NSString stringWithFormat:@"%@", model.zkPrice]; } self.fanLabel.sd_resetLayout.leftSpaceToView(self.titleImageView, 10).bottomEqualToView(self.titleImageView).widthIs(roundf(fanLabelWidth + 16)).heightIs(18); } self.totalPriceLabel.text = totalPriceString; // ææ£ if (model.shopType == 40) { self.labelDisCount.hidden = NO; @@ -420,7 +424,7 @@ self.labelDisCount.hidden = YES; } self.totalPriceLabel.text = totalPriceString; // æé«è¿å© NSString *stringMaxFan = model.moneyInfo.maxMoney; Pods/Pods.xcodeproj/xcuserdata/lrj.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -7,137 +7,137 @@ <key>AFNetworking.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>21</integer> <integer>2</integer> </dict> <key>CRBoxInputView.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>17</integer> <integer>20</integer> </dict> <key>GPUImage.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>26</integer> <integer>16</integer> </dict> <key>IQKeyboardManager.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>7</integer> <integer>8</integer> </dict> <key>MBProgressHUD.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>18</integer> <integer>9</integer> </dict> <key>MJRefresh.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>5</integer> <integer>17</integer> </dict> <key>Masonry.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>2</integer> <integer>3</integer> </dict> <key>Pods-MIduo.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>6</integer> <integer>1</integer> </dict> <key>ReactiveCocoa.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>23</integer> <integer>24</integer> </dict> <key>SAMKeychain.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>24</integer> <integer>22</integer> </dict> <key>SDAutoLayout.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>8</integer> <integer>27</integer> </dict> <key>SDWebImage.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>4</integer> <integer>13</integer> </dict> <key>SVProgressHUD.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>15</integer> <integer>12</integer> </dict> <key>TYSnapshotScroll.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>27</integer> <integer>10</integer> </dict> <key>TZImagePickerController.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>13</integer> <integer>11</integer> </dict> <key>Toast.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>25</integer> <integer>19</integer> </dict> <key>UICollectionViewLeftAlignedLayout.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>9</integer> <integer>21</integer> </dict> <key>UICountingLabel.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>12</integer> <integer>23</integer> </dict> <key>YYCache.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>16</integer> <integer>25</integer> </dict> <key>YYImage.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>22</integer> <integer>18</integer> </dict> <key>YYModel.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>14</integer> <integer>26</integer> </dict> <key>YYText.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>10</integer> <integer>5</integer> </dict> <key>YYWebImage.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>20</integer> <integer>6</integer> </dict> <key>mob_sharesdk-ShareSDK.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>11</integer> <integer>14</integer> </dict> <key>mob_sharesdk-ShareSDK_JS_QQ.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>19</integer> <integer>4</integer> </dict> <key>mob_sharesdk-ShareSDK_JS_SinaWeibo.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>3</integer> <integer>7</integer> </dict> <key>mob_sharesdk-ShareSDK_JS_WeChat.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>1</integer> <integer>15</integer> </dict> </dict> </dict>