Commit 6eda1664 by lee

加入分享功能

parent 7d4885e3
...@@ -31,8 +31,9 @@ pod 'MJRefresh', '~> 3.1' ...@@ -31,8 +31,9 @@ pod 'MJRefresh', '~> 3.1'
pod 'SFFocusViewLayout', '~> 2.0' pod 'SFFocusViewLayout', '~> 2.0'
#pod 'YYWebImage' #pod 'YYWebImage'
pod 'MagicalRecord','~> 2.2' pod 'MagicalRecord','~> 2.2'
pod 'Mobile-Buy-SDK',:git => 'https://github.com/houweibin/mobile-buy-sdk-ios' #pod 'Mobile-Buy-SDK',:git => 'https://github.com/houweibin/mobile-buy-sdk-ios'
#pod 'Mobile-Buy-SDK',:path => '../Pods/mobile-buy-sdk-ios' #pod 'Mobile-Buy-SDK',:path => '../Pods/mobile-buy-sdk-ios'
pod 'Mobile-Buy-SDK', :path => '~/Developer/mobile-buy-sdk-ios'
pod 'JLRoutes' pod 'JLRoutes'
pod 'iCarousel', '~> 1.8' pod 'iCarousel', '~> 1.8'
pod 'MagicalRecord','~> 2.2' pod 'MagicalRecord','~> 2.2'
......
...@@ -1012,6 +1012,7 @@ ...@@ -1012,6 +1012,7 @@
DA8D64111F31C67F00B8F4A6 /* DeepLinkURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeepLinkURLProtocol.m; sourceTree = "<group>"; }; DA8D64111F31C67F00B8F4A6 /* DeepLinkURLProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeepLinkURLProtocol.m; sourceTree = "<group>"; };
DA8D64131F31CD2600B8F4A6 /* DPWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DPWebViewController.h; sourceTree = "<group>"; }; DA8D64131F31CD2600B8F4A6 /* DPWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DPWebViewController.h; sourceTree = "<group>"; };
DA8D64141F31CD2600B8F4A6 /* DPWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DPWebViewController.m; sourceTree = "<group>"; }; DA8D64141F31CD2600B8F4A6 /* DPWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DPWebViewController.m; sourceTree = "<group>"; };
DA9096D5207C71FD000FE45C /* Cemarose.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Cemarose.entitlements; sourceTree = "<group>"; };
DAB643181F04CFE5002CD7FE /* AppDelegate+Deeplink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+Deeplink.h"; sourceTree = "<group>"; }; DAB643181F04CFE5002CD7FE /* AppDelegate+Deeplink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+Deeplink.h"; sourceTree = "<group>"; };
DAB643191F04CFE5002CD7FE /* AppDelegate+Deeplink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+Deeplink.m"; sourceTree = "<group>"; }; DAB643191F04CFE5002CD7FE /* AppDelegate+Deeplink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+Deeplink.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -1319,6 +1320,7 @@ ...@@ -1319,6 +1320,7 @@
C034E68C1D6AEB12006EE129 /* iCemarose */ = { C034E68C1D6AEB12006EE129 /* iCemarose */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
DA9096D5207C71FD000FE45C /* Cemarose.entitlements */,
C034E6C01D6AEC7A006EE129 /* Class */, C034E6C01D6AEC7A006EE129 /* Class */,
C034E68D1D6AEB12006EE129 /* Supporting Files */, C034E68D1D6AEB12006EE129 /* Supporting Files */,
); );
...@@ -2393,6 +2395,11 @@ ...@@ -2393,6 +2395,11 @@
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 72Z44QQ9ZD; DevelopmentTeam = 72Z44QQ9ZD;
ProvisioningStyle = Manual; ProvisioningStyle = Manual;
SystemCapabilities = {
com.apple.SafariKeychain = {
enabled = 1;
};
};
}; };
C034E6A21D6AEB13006EE129 = { C034E6A21D6AEB13006EE129 = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
...@@ -2573,14 +2580,18 @@ ...@@ -2573,14 +2580,18 @@
inputPaths = ( inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-iCemarose/Pods-iCemarose-resources.sh", "${SRCROOT}/Pods/Target Support Files/Pods-iCemarose/Pods-iCemarose-resources.sh",
"${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle", "${PODS_ROOT}/MJRefresh/MJRefresh/MJRefresh.bundle",
"$PODS_CONFIGURATION_BUILD_DIR/Mobile-Buy-SDK/Buy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/Mobile-Buy-SDK/Buy.bundle",
"${PODS_ROOT}/SAMCategories/SAMCategories/SAMCategories.bundle", "${PODS_ROOT}/SAMCategories/SAMCategories/SAMCategories.bundle",
"${PODS_ROOT}/SAMKeychain/Support/SAMKeychain.bundle", "${PODS_ROOT}/SAMKeychain/Support/SAMKeychain.bundle",
$PODS_CONFIGURATION_BUILD_DIR/TOWebViewController/TOWebViewControllerLocalizable.bundle, "${PODS_CONFIGURATION_BUILD_DIR}/TOWebViewController/TOWebViewControllerLocalizable.bundle",
); );
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MJRefresh.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Buy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SAMCategories.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SAMKeychain.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOWebViewControllerLocalizable.bundle",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
...@@ -3001,6 +3012,7 @@ ...@@ -3001,6 +3012,7 @@
baseConfigurationReference = 9B58353B797587723B0E7515 /* Pods-iCemarose.debug.xcconfig */; baseConfigurationReference = 9B58353B797587723B0E7515 /* Pods-iCemarose.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = iCemarose/Cemarose.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer: Yibo Jia (W6TWSKB7VU)"; CODE_SIGN_IDENTITY = "iPhone Developer: Yibo Jia (W6TWSKB7VU)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Yibo Jia (W6TWSKB7VU)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Yibo Jia (W6TWSKB7VU)";
DEVELOPMENT_TEAM = 72Z44QQ9ZD; DEVELOPMENT_TEAM = 72Z44QQ9ZD;
...@@ -3062,7 +3074,7 @@ ...@@ -3062,7 +3074,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.kollway.cemarose; PRODUCT_BUNDLE_IDENTIFIER = com.kollway.cemarose;
PRODUCT_NAME = Cemarose; PRODUCT_NAME = Cemarose;
PROVISIONING_PROFILE = "94b8a872-e069-46d5-98b3-bdeb4faacdef"; PROVISIONING_PROFILE = "7a1b4ed4-9565-4d87-ab92-f369c1991c0c";
PROVISIONING_PROFILE_SPECIFIER = ios_distribution_dev_cemarose; PROVISIONING_PROFILE_SPECIFIER = ios_distribution_dev_cemarose;
TARGETED_DEVICE_FAMILY = 1; TARGETED_DEVICE_FAMILY = 1;
}; };
...@@ -3073,6 +3085,7 @@ ...@@ -3073,6 +3085,7 @@
baseConfigurationReference = B5C3F0326028FE5E2F51B4C1 /* Pods-iCemarose.release.xcconfig */; baseConfigurationReference = B5C3F0326028FE5E2F51B4C1 /* Pods-iCemarose.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = iCemarose/Cemarose.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer: Yibo Jia (W6TWSKB7VU)"; CODE_SIGN_IDENTITY = "iPhone Developer: Yibo Jia (W6TWSKB7VU)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Yibo Jia (W6TWSKB7VU)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Yibo Jia (W6TWSKB7VU)";
DEVELOPMENT_TEAM = 72Z44QQ9ZD; DEVELOPMENT_TEAM = 72Z44QQ9ZD;
......
...@@ -156,6 +156,14 @@ ...@@ -156,6 +156,14 @@
return [WXApi handleOpenURL:url delegate:self]; return [WXApi handleOpenURL:url delegate:self];
} }
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
if ([self handleURL:userActivity.webpageURL]) {
restorationHandler(nil);
return true;
}
return false;
}
#pragma mark - #pragma mark -
#pragma mark WXApiDelegate 微信分享的相关回调 #pragma mark WXApiDelegate 微信分享的相关回调
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
<constraint firstAttribute="height" constant="24" id="x1H-Jw-5lD"/> <constraint firstAttribute="height" constant="24" id="x1H-Jw-5lD"/>
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="v 1.6.7" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ytF-B2-drm"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="v 1.6.10" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ytF-B2-drm">
<rect key="frame" x="168" y="631" width="39" height="16"/> <rect key="frame" x="165" y="631" width="45" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:www.cemarose.cn</string>
<string>applinks:www.cemarose.com</string>
</array>
</dict>
</plist>
...@@ -422,6 +422,13 @@ static NSString *idStr = @"KWMBrandCaramelCell"; ...@@ -422,6 +422,13 @@ static NSString *idStr = @"KWMBrandCaramelCell";
if(jsonDictionary){ if(jsonDictionary){
@try{ @try{
NSArray *array = (NSArray *)jsonDictionary; NSArray *array = (NSArray *)jsonDictionary;
array = [array rx_filterWithBlock:^BOOL(NSDictionary *each) {
NSArray * tags = [[each objectForKey:@"tags"] componentsSeparatedByString:@", "];
if ([tags containsObject:@"small pic"]) {
return [[[KWMUserDao shareDao] tags] containsObject:@"Business"] || [[[KWMUserDao shareDao] tags] containsObject:@"Staff"];
}
return [[each objectForKey:@"available"] boolValue];
}];
if(array){ if(array){
BUYModelManager *modelManager = [[BUYModelManager alloc]init]; BUYModelManager *modelManager = [[BUYModelManager alloc]init];
result = [modelManager buy_objectsWithEntityName:[BUYProduct entityName] JSONArray:array]; result = [modelManager buy_objectsWithEntityName:[BUYProduct entityName] JSONArray:array];
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
// //
#import "DPWebViewController.h" #import "DPWebViewController.h"
#import <RegexKitLite/RegexKitLite.h>
#import "KWMShareVC.h"
@interface DPWebViewController () @interface DPWebViewController ()
...@@ -14,11 +16,38 @@ ...@@ -14,11 +16,38 @@
@implementation DPWebViewController @implementation DPWebViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.navigationButtonsHidden = YES; self.navigationButtonsHidden = YES;
self.view.backgroundColor = [UIColor whiteColor]; self.view.backgroundColor = [UIColor whiteColor];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
self.shouldStartLoadRequestHandler = ^BOOL(NSURLRequest *request, UIWebViewNavigationType navigationType) {
if ([request.URL.scheme isEqualToString:@"share"]) {
NSString * title = [[request.URL.absoluteString stringByMatching:@"title/(.*?)/" capture:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString * url = [[request.URL.absoluteString stringByMatching:@"url/(.*?)/" capture:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString * image = [[request.URL.absoluteString stringByMatching:@"image/(.*?)/" capture:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString * content = [[request.URL.absoluteString stringByMatching:@"content/(.*?)/" capture:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
KWMShareVC *shareVC = (KWMShareVC *)[KWMBaseVC findControllerBy:[KWMShareVC kwmTag] fromStoryboard:@"New"];
shareVC.shareUrl = url;
shareVC.imageUrl = image;
shareVC.productName = title;
shareVC.content = content;
CGSize size = [UIScreen mainScreen].bounds.size;
[self showPresentation:shareVC size:size tapOutsideClose:YES style:MZFormSheetPresentationTransitionStyleFade];
return NO;
}
return YES;
};
[self.webView stringByEvaluatingJavaScriptFromString:@"window.appverson = 168;"];
}
- (void)viewDidLayoutSubviews {
// self.webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
UIEdgeInsets inset = self.webView.scrollView.contentInset;
[super viewDidLayoutSubviews];
self.webView.scrollView.contentInset = inset;
} }
- (void)viewWillAppear:(BOOL)animated{ - (void)viewWillAppear:(BOOL)animated{
...@@ -34,11 +63,28 @@ ...@@ -34,11 +63,28 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
} }
- (void)viewWillDisappear:(BOOL)animated{ - (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
self.navigationController.navigationBar.items.lastObject.title = nil; self.navigationController.navigationBar.items.lastObject.title = nil;
} }
- (MZFormSheetPresentationViewController *)showPresentation:(UIViewController *)vc size:(CGSize)size tapOutsideClose:(BOOL)tapOutsideClose style:(MZFormSheetPresentationTransitionStyle)style {
MZFormSheetPresentationViewController *mz = [[MZFormSheetPresentationViewController alloc] initWithContentViewController:vc];
mz.presentationController.shouldDismissOnBackgroundViewTap = tapOutsideClose;
mz.presentationController.movementActionWhenKeyboardAppears = MZFormSheetActionWhenKeyboardAppearsCenterVertically;
mz.contentViewControllerTransitionStyle = style;
if (size.width > 0 && size.height > 0) {
mz.presentationController.contentViewSize = size;
}
mz.presentationController.shouldCenterVertically = YES;
[self presentViewController:mz
animated:YES
completion:nil];
return mz;
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
......
...@@ -56,8 +56,12 @@ ...@@ -56,8 +56,12 @@
_lbOrderNum.text = [NSString stringWithFormat:@"订单 %@",order.identifier ? order.identifier.stringValue:@""]; _lbOrderNum.text = [NSString stringWithFormat:@"订单 %@",order.identifier ? order.identifier.stringValue:@""];
// _lbTotalPrice.text = [NSString stringWithFormat:@"%@",[KWMStringUtil getEUR2CNYstring:order.totalPrice]]; // _lbTotalPrice.text = [NSString stringWithFormat:@"%@",[KWMStringUtil getEUR2CNYstring:order.totalPrice]];
// _lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:order.totalPrice]; // _lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:order.totalPrice];
_lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:order.totalPrice currencyCode:order.currency]; if (order.currencyRate.intValue > 1) {
_lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:[order.totalPrice decimalNumberByMultiplyingBy: order.currencyRate] currencyCode: @"CNY"];
}else {
_lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:order.totalPrice currencyCode:order.currency];
}
__block NSInteger fulfilledCount = 0; __block NSInteger fulfilledCount = 0;
[order.lineItems enumerateObjectsUsingBlock:^(BUYLineItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { [order.lineItems enumerateObjectsUsingBlock:^(BUYLineItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.fulfilledValue) { if (obj.fulfilledValue) {
...@@ -74,7 +78,11 @@ ...@@ -74,7 +78,11 @@
_lineItem = lineItem; _lineItem = lineItem;
// self.lbPrice.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:lineItem.price]]; // self.lbPrice.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:lineItem.price]];
// self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:lineItem.price]; // self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:lineItem.price];
if (_order.currencyRate.intValue > 1) {
self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:[_order.currencyRate decimalNumberByMultiplyingBy: lineItem.price] currencyCode:@"CNY"];
}else {
self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:lineItem.price currencyCode:@"EUR"]; self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:lineItem.price currencyCode:@"EUR"];
}
self.lbName.text = lineItem.title; self.lbName.text = lineItem.title;
if([KWMStringUtil isEmpty:lineItem.variantTitle]){ if([KWMStringUtil isEmpty:lineItem.variantTitle]){
self.lbSize.text = [NSString stringWithFormat:@"x%@",lineItem.quantity]; self.lbSize.text = [NSString stringWithFormat:@"x%@",lineItem.quantity];
......
...@@ -173,11 +173,11 @@ ...@@ -173,11 +173,11 @@
if(!arr){ if(!arr){
return orderCell; return orderCell;
} }
BUYLineItem *lineItem = [arr objectAtIndex:indexPath.row];
orderCell.lineItem = lineItem;
//当前section行数 //当前section行数
orderCell.lineCount = [self getRowCountBySection:indexPath.section]; orderCell.lineCount = [self getRowCountBySection:indexPath.section];
orderCell.order = [self.dataList objectAtIndex:indexPath.section]; orderCell.order = [self.dataList objectAtIndex:indexPath.section];
BUYLineItem *lineItem = [arr objectAtIndex:indexPath.row];
orderCell.lineItem = lineItem;
orderCell.markSection = indexPath.section; orderCell.markSection = indexPath.section;
orderCell.imageUrl = [self getProductImage:lineItem.productId]; orderCell.imageUrl = [self getProductImage:lineItem.productId];
[orderCell updateUI:indexPath.row productCount:arr.count showAll:isExpend]; [orderCell updateUI:indexPath.row productCount:arr.count showAll:isExpend];
......
...@@ -116,7 +116,6 @@ ...@@ -116,7 +116,6 @@
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message { - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
NSNumber *height = [message.body objectForKey:@"height"]; NSNumber *height = [message.body objectForKey:@"height"];
NSLog(@"fuck height: %@",height);
[self.delegate kwm_updatedHeight:height.floatValue + 50]; [self.delegate kwm_updatedHeight:height.floatValue + 50];
} }
......
...@@ -117,6 +117,8 @@ ...@@ -117,6 +117,8 @@
self.detailView1.delegate = self; self.detailView1.delegate = self;
self.detailView2.delegate = self; self.detailView2.delegate = self;
self.midDetailView.delegate = self; self.midDetailView.delegate = self;
self.midDetailView.hidden = NO;
[self initBottomViewHidden]; [self initBottomViewHidden];
if(self.product){ if(self.product){
[self.detailView1 setSizeGuideHidden:!self.typeTag]; [self.detailView1 setSizeGuideHidden:!self.typeTag];
...@@ -167,7 +169,7 @@ ...@@ -167,7 +169,7 @@
self.buyNowBtnWidthConstraint.constant = -120; self.buyNowBtnWidthConstraint.constant = -120;
[self.buyNowBtn setTitle:@"我要拼团" forState:UIControlStateNormal]; [self.buyNowBtn setTitle:@"我要拼团" forState:UIControlStateNormal];
self.midDetailViewTopConstraint.constant = 104; self.midDetailViewTopConstraint.constant = 104;
self.shareBtn.hidden = YES; // self.shareBtn.hidden = YES;
} }
} }
} }
...@@ -256,7 +258,7 @@ ...@@ -256,7 +258,7 @@
-(IBAction)onClickShare:(id)sender{ -(IBAction)onClickShare:(id)sender{
if(self.product){ if(self.product){
KWMShareVC *shareVC = (KWMShareVC *)[KWMBaseVC findControllerBy:[KWMShareVC kwmTag] fromStoryboard:@"New"]; KWMShareVC *shareVC = (KWMShareVC *)[KWMBaseVC findControllerBy:[KWMShareVC kwmTag] fromStoryboard:@"New"];
shareVC.shareUrl = [NSString stringWithFormat:@"https://www.cemarose.com/products/%@",self.product.handle]; shareVC.shareUrl = [NSString stringWithFormat:@"https://www.cemarose.cn/products/%@",self.product.handle];
shareVC.imageUrl = [KWMImageUtil getProductImageUrl:self.product ImageSize:SmallImage]; shareVC.imageUrl = [KWMImageUtil getProductImageUrl:self.product ImageSize:SmallImage];
shareVC.productName = self.product.title; shareVC.productName = self.product.title;
CGSize size = [UIScreen mainScreen].bounds.size; CGSize size = [UIScreen mainScreen].bounds.size;
...@@ -397,7 +399,7 @@ ...@@ -397,7 +399,7 @@
self.productId = product.identifier; self.productId = product.identifier;
self.colorMeterfield = nil; self.colorMeterfield = nil;
self.adminProduct = nil; self.adminProduct = nil;
[self.scrollView setContentOffset:CGPointMake(0, 0) animated:YES]; [self.scrollView setContentOffset:CGPointMake(0, 0) animated:NO];
[self initView]; [self initView];
[self clearSelect]; [self clearSelect];
} }
...@@ -542,6 +544,7 @@ ...@@ -542,6 +544,7 @@
#pragma mark - KWMMidViewDetailDelegate #pragma mark - KWMMidViewDetailDelegate
-(void) kwm_updatedHeight:(CGFloat)height { -(void) kwm_updatedHeight:(CGFloat)height {
NSLog(@">>> %f", height);
self.heightMidView.constant = height; self.heightMidView.constant = height;
} }
...@@ -850,13 +853,18 @@ ...@@ -850,13 +853,18 @@
- (void)setProduct:(BUYProduct *)product { - (void)setProduct:(BUYProduct *)product {
_product = product; _product = product;
NSArray *types = @[@"baby",@"girls",@"boys",@"shoes",@"newborn"]; NSArray *types = @[@"shoes",@"baby",@"girls",@"boys",@"newborn"];
for (NSString *tag in self.product.tags) { for (NSString *tag in types) {
if ([types containsObject:tag.lowercaseString]) { if ([self.product.tags containsObject:tag]) {
self.typeTag = tag.lowercaseString; self.typeTag = tag.lowercaseString;
break;
} }
} }
// for (NSString *tag in self.product.tags) {
// if ([types containsObject:tag.lowercaseString]) {
// self.typeTag = tag.lowercaseString;
// break;
// }
// }
[self.detailView1 setSizeGuideHidden:!self.typeTag]; [self.detailView1 setSizeGuideHidden:!self.typeTag];
} }
......
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="t55-gT-VGG" customClass="KWMMidDetailView"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="t55-gT-VGG" customClass="KWMMidDetailView">
<rect key="frame" x="0.0" y="625" width="375" height="104"/> <rect key="frame" x="0.0" y="625" width="375" height="104"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="104" id="Pwf-vg-Z3k"/> <constraint firstAttribute="height" constant="104" id="Pwf-vg-Z3k"/>
</constraints> </constraints>
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
@property (nonatomic,strong) NSString *productName; @property (nonatomic,strong) NSString *productName;
@property (nonatomic,strong) NSString *content;
- (IBAction)onShareToFriend:(id)sender; - (IBAction)onShareToFriend:(id)sender;
- (IBAction)onShareToCircle:(id)sender; - (IBAction)onShareToCircle:(id)sender;
......
...@@ -28,6 +28,13 @@ ...@@ -28,6 +28,13 @@
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
} }
-(NSString *) content {
if (_content) {
return _content;
}
return @"这个衣服很不错,你也来看看吧";
}
+(NSString *)kwmTag{ +(NSString *)kwmTag{
return @"KWMShareVC"; return @"KWMShareVC";
} }
...@@ -37,7 +44,7 @@ ...@@ -37,7 +44,7 @@
//设置图片 //设置图片
NSURL *imageURL = [NSURL URLWithString:self.imageUrl]; NSURL *imageURL = [NSURL URLWithString:self.imageUrl];
UIImage *image = [UIImage imageWithData:[[NSData alloc] initWithContentsOfURL:imageURL]]; UIImage *image = [UIImage imageWithData:[[NSData alloc] initWithContentsOfURL:imageURL]];
[KWMWeChatUtil shareToCircleWithTitle:self.productName message:@"这个衣服很不错,你也来看看吧" image:image urlString:self.shareUrl sender:self]; [KWMWeChatUtil shareToCircleWithTitle:self.productName message:self.content image:image urlString:self.shareUrl sender:self];
} }
} }
...@@ -46,7 +53,7 @@ ...@@ -46,7 +53,7 @@
//设置图片 //设置图片
NSURL *imageURL = [NSURL URLWithString:self.imageUrl]; NSURL *imageURL = [NSURL URLWithString:self.imageUrl];
UIImage *image = [UIImage imageWithData:[[NSData alloc] initWithContentsOfURL:imageURL]]; UIImage *image = [UIImage imageWithData:[[NSData alloc] initWithContentsOfURL:imageURL]];
[KWMWeChatUtil shareToFriendWithTitle:self.productName message:@"这个衣服很不错,你也来看看吧" image:image urlString:self.shareUrl sender:self]; [KWMWeChatUtil shareToFriendWithTitle:self.productName message:self.content image:image urlString:self.shareUrl sender:self];
} }
} }
...@@ -58,7 +65,7 @@ ...@@ -58,7 +65,7 @@
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: baseColor,NSForegroundColorAttributeName: baseColor,NSFontAttributeName: [UIFont systemFontOfSize:18.0f]}]; [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: baseColor,NSForegroundColorAttributeName: baseColor,NSFontAttributeName: [UIFont systemFontOfSize:18.0f]}];
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init]; MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
//NSArray *phones = [[NSArray alloc] initWithObjects:phone.phone, nil]; //NSArray *phones = [[NSArray alloc] initWithObjects:phone.phone, nil];
controller.body = [NSString stringWithFormat:@"这个衣服很不错,你也来看看吧<%@>", self.shareUrl]; controller.body = [NSString stringWithFormat:@"%@<%@>", self.content, self.shareUrl];
//[controller setRecipients:phones]; //[controller setRecipients:phones];
controller.messageComposeDelegate = self; controller.messageComposeDelegate = self;
[self presentViewController:controller animated:YES completion:nil]; [self presentViewController:controller animated:YES completion:nil];
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
+(NSString *)transformTag:(KWMFilter *)filter tag:(NSString *)tag{ +(NSString *)transformTag:(KWMFilter *)filter tag:(NSString *)tag{
NSDictionary *mapping = @{ NSDictionary *mapping = @{
@"Spring/Summer 2018":@"spring-summer-2018",
@"Autumn/Winter 2017":@"autumn-winter-2017", @"Autumn/Winter 2017":@"autumn-winter-2017",
@"Spring/Summer 2017":@"spring-summer-2017", @"Spring/Summer 2017":@"spring-summer-2017",
@"Autumn/Winter 2016":@"autumn-winter-2016", @"Autumn/Winter 2016":@"autumn-winter-2016",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#import "UIColor+SAMAdditions.h" #import "UIColor+SAMAdditions.h"
#import "KWMStringUtil.h" #import "KWMStringUtil.h"
static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/Winter 2017\",\"Spring/Summer 2017\",\"Autumn/Winter 2016\",\"Spring/Summer 2016\",\"Autumn/Winter 2015\"]},{\"group\":\"GENDER\",\"tags\":[\"Girls\",\"Boys\"]},{\"group\":\"SIZE\",\"tags\":[\"0 month\",\"3 month\",\"6 month\",\"9 month\",\"12 month\",\"18 month\",\"2 year\",\"3 year\",\"4 year\",\"5 year\",\"6 year\",\"7 year\",\"8 year\",\"10 year\",\"12 year\",\"14 year\",\"16 year\"]},{\"group\":\"Shoe Size\",\"tags\":[\"18\",\"19\",\"20\",\"21\",\"22\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"29\",\"30\",\"31\",\"32\",\"33\",\"34\",\"35\",\"37\",\"38\",\"39\"]},{\"group\":\"PRODUCT TYPE\",\"tags\":[\"Accessories\",\"Babysuits\",\"Coats & Jackets\",\"Dresses\",\"Leggings\",\"Raincoat\",\"Sets\",\"Shoes\",\"Skirts\",\"Swimwear\",\"Tights\",\"Tops\",\"Toys\",\"Trousers & Shorts\",\"Underwear\"]}]"; static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Spring/Summer 2018\",\"Autumn/Winter 2017\",\"Spring/Summer 2017\",\"Autumn/Winter 2016\",\"Spring/Summer 2016\",\"Autumn/Winter 2015\"]},{\"group\":\"GENDER\",\"tags\":[\"Girls\",\"Boys\"]},{\"group\":\"SIZE\",\"tags\":[\"0 month\",\"3 month\",\"6 month\",\"9 month\",\"12 month\",\"18 month\",\"2 year\",\"3 year\",\"4 year\",\"5 year\",\"6 year\",\"7 year\",\"8 year\",\"10 year\",\"12 year\",\"14 year\",\"16 year\"]},{\"group\":\"Shoe Size\",\"tags\":[\"18\",\"19\",\"20\",\"21\",\"22\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"29\",\"30\",\"31\",\"32\",\"33\",\"34\",\"35\",\"37\",\"38\",\"39\"]},{\"group\":\"PRODUCT TYPE\",\"tags\":[\"Accessories\",\"Babysuits\",\"Coats & Jackets\",\"Dresses\",\"Leggings\",\"Raincoat\",\"Sets\",\"Shoes\",\"Skirts\",\"Swimwear\",\"Tights\",\"Tops\",\"Toys\",\"Trousers & Shorts\",\"Underwear\"]}]";
@interface KWMFilterView() @interface KWMFilterView()
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.6.7</string> <string>1.6.10</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.6.7</string> <string>1.6.10.1</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment