Commit 76309da3 by houweibin

1,地址添加国家编辑入口

2,出版本前准备
3,应该未完成功能
4,其他调整
parent 036617e2
...@@ -227,6 +227,7 @@ ...@@ -227,6 +227,7 @@
C0DD533A1EE55190002D1E0C /* KWMSplashView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0DD53301EE55190002D1E0C /* KWMSplashView.xib */; }; C0DD533A1EE55190002D1E0C /* KWMSplashView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C0DD53301EE55190002D1E0C /* KWMSplashView.xib */; };
C0DD533B1EE55190002D1E0C /* KWMSuperLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0DD53321EE55190002D1E0C /* KWMSuperLoadingView.m */; }; C0DD533B1EE55190002D1E0C /* KWMSuperLoadingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C0DD53321EE55190002D1E0C /* KWMSuperLoadingView.m */; };
C0DD533C1EE55190002D1E0C /* MMJRefreshNormalHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = C0DD53341EE55190002D1E0C /* MMJRefreshNormalHeader.m */; }; C0DD533C1EE55190002D1E0C /* MMJRefreshNormalHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = C0DD53341EE55190002D1E0C /* MMJRefreshNormalHeader.m */; };
C0DD534D1EE6AE06002D1E0C /* BaseCell.m in Sources */ = {isa = PBXBuildFile; fileRef = C0DD534C1EE6AE06002D1E0C /* BaseCell.m */; };
C0E8AE091D7D030B00C193DC /* KWMEditAddressVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C0E8AE081D7D030B00C193DC /* KWMEditAddressVC.m */; }; C0E8AE091D7D030B00C193DC /* KWMEditAddressVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C0E8AE081D7D030B00C193DC /* KWMEditAddressVC.m */; };
C0E8AE0C1D7D503600C193DC /* KWMPaySuccessVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C0E8AE0B1D7D503600C193DC /* KWMPaySuccessVC.m */; }; C0E8AE0C1D7D503600C193DC /* KWMPaySuccessVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C0E8AE0B1D7D503600C193DC /* KWMPaySuccessVC.m */; };
C0E8AE121D7D52B200C193DC /* KWMPayTypeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C0E8AE111D7D52B200C193DC /* KWMPayTypeVC.m */; }; C0E8AE121D7D52B200C193DC /* KWMPayTypeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C0E8AE111D7D52B200C193DC /* KWMPayTypeVC.m */; };
...@@ -677,6 +678,8 @@ ...@@ -677,6 +678,8 @@
C0DD53321EE55190002D1E0C /* KWMSuperLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMSuperLoadingView.m; sourceTree = "<group>"; }; C0DD53321EE55190002D1E0C /* KWMSuperLoadingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMSuperLoadingView.m; sourceTree = "<group>"; };
C0DD53331EE55190002D1E0C /* MMJRefreshNormalHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMJRefreshNormalHeader.h; sourceTree = "<group>"; }; C0DD53331EE55190002D1E0C /* MMJRefreshNormalHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMJRefreshNormalHeader.h; sourceTree = "<group>"; };
C0DD53341EE55190002D1E0C /* MMJRefreshNormalHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMJRefreshNormalHeader.m; sourceTree = "<group>"; }; C0DD53341EE55190002D1E0C /* MMJRefreshNormalHeader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMJRefreshNormalHeader.m; sourceTree = "<group>"; };
C0DD534B1EE6AE06002D1E0C /* BaseCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseCell.h; sourceTree = "<group>"; };
C0DD534C1EE6AE06002D1E0C /* BaseCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseCell.m; sourceTree = "<group>"; };
C0E8AE071D7D030B00C193DC /* KWMEditAddressVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMEditAddressVC.h; sourceTree = "<group>"; }; C0E8AE071D7D030B00C193DC /* KWMEditAddressVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMEditAddressVC.h; sourceTree = "<group>"; };
C0E8AE081D7D030B00C193DC /* KWMEditAddressVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMEditAddressVC.m; sourceTree = "<group>"; }; C0E8AE081D7D030B00C193DC /* KWMEditAddressVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KWMEditAddressVC.m; sourceTree = "<group>"; };
C0E8AE0A1D7D503600C193DC /* KWMPaySuccessVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMPaySuccessVC.h; sourceTree = "<group>"; }; C0E8AE0A1D7D503600C193DC /* KWMPaySuccessVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KWMPaySuccessVC.h; sourceTree = "<group>"; };
...@@ -1641,6 +1644,8 @@ ...@@ -1641,6 +1644,8 @@
C0DD53251EE55190002D1E0C /* Cell */ = { C0DD53251EE55190002D1E0C /* Cell */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C0DD534B1EE6AE06002D1E0C /* BaseCell.h */,
C0DD534C1EE6AE06002D1E0C /* BaseCell.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2119,6 +2124,7 @@ ...@@ -2119,6 +2124,7 @@
8077F79A1D73E39000A2E2E2 /* KWMBrandCaramelCell.m in Sources */, 8077F79A1D73E39000A2E2E2 /* KWMBrandCaramelCell.m in Sources */,
9BE61D011ECD71610031D21E /* KWMCartResult.m in Sources */, 9BE61D011ECD71610031D21E /* KWMCartResult.m in Sources */,
C084F4571D6D975400A0625D /* KWMSearchBar.m in Sources */, C084F4571D6D975400A0625D /* KWMSearchBar.m in Sources */,
C0DD534D1EE6AE06002D1E0C /* BaseCell.m in Sources */,
C0E8AE091D7D030B00C193DC /* KWMEditAddressVC.m in Sources */, C0E8AE091D7D030B00C193DC /* KWMEditAddressVC.m in Sources */,
807AF4A51DC984950000A326 /* KWMCustomerResult.m in Sources */, 807AF4A51DC984950000A326 /* KWMCustomerResult.m in Sources */,
C066650F1D7675FC00F02EF4 /* KWMAboutUsVC.m in Sources */, C066650F1D7675FC00F02EF4 /* KWMAboutUsVC.m in Sources */,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
#import "KWMBlogCell.h" #import "KWMBlogCell.h"
#import "KWMImageUtil.h"
#import <SDWebImage/UIImageView+WebCache.h> #import <SDWebImage/UIImageView+WebCache.h>
@implementation KWMBlogCell @implementation KWMBlogCell
...@@ -46,7 +47,8 @@ ...@@ -46,7 +47,8 @@
if (article.imageScr == nil) { if (article.imageScr == nil) {
self.imageHeight.constant = 0; self.imageHeight.constant = 0;
}else{ }else{
NSURL *imageURL = [NSURL URLWithString:article.imageScr]; NSString *imageString = [KWMImageUtil getProductImageUrlByOriginalUrl:article.imageScr ImageSize:NormalImage];
NSURL *imageURL = [NSURL URLWithString:imageString];
[self.ivImg sd_setImageWithURL:imageURL placeholderImage:[UIImage imageNamed:@"ic_loading_big"]]; [self.ivImg sd_setImageWithURL:imageURL placeholderImage:[UIImage imageNamed:@"ic_loading_big"]];
} }
} }
......
...@@ -76,7 +76,8 @@ ...@@ -76,7 +76,8 @@
isShow = showAll;//记录是否展开 isShow = showAll;//记录是否展开
if(position == 0){ if(position == 0){
self.vHeader.hidden = NO; self.vHeader.hidden = NO;
self.headerHeight.constant = 80; //self.headerHeight.constant = 80;
self.headerHeight.constant = 45;
}else{ }else{
self.vHeader.hidden = YES; self.vHeader.hidden = YES;
self.headerHeight.constant = 0; self.headerHeight.constant = 0;
......
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9GU-8G-dS5" userLabel="header"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9GU-8G-dS5" userLabel="header">
<rect key="frame" x="0.0" y="0.0" width="375" height="80"/> <rect key="frame" x="0.0" y="0.0" width="375" height="45"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AZR-1t-dC0"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="AZR-1t-dC0">
<rect key="frame" x="0.0" y="0.0" width="375" height="70"/> <rect key="frame" x="0.0" y="0.0" width="375" height="35"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="订单:42043124" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jGI-UQ-mqY"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="订单:42043124" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jGI-UQ-mqY">
<rect key="frame" x="27" y="9" width="99" height="18.5"/> <rect key="frame" x="27" y="9" width="99" height="18.5"/>
...@@ -31,13 +31,13 @@ ...@@ -31,13 +31,13 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="总计:¥" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z8Q-AY-djl"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="总计:¥" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z8Q-AY-djl">
<rect key="frame" x="273" y="42" width="34.5" height="17"/> <rect key="frame" x="273" y="7" width="34.5" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.94509803920000002" green="0.57254901960000004" blue="0.60392156860000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.94509803920000002" green="0.57254901960000004" blue="0.60392156860000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2630" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j8B-sN-dbR"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2630" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j8B-sN-dbR">
<rect key="frame" x="309" y="37.5" width="38.5" height="22.5"/> <rect key="frame" x="309" y="2.5" width="38.5" height="22.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="16"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="16"/>
<color key="textColor" red="0.94509803921568625" green="0.5725490196078431" blue="0.60392156862745094" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.94509803921568625" green="0.5725490196078431" blue="0.60392156862745094" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</connections> </connections>
</button> </button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gxP-ry-glr"> <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gxP-ry-glr">
<rect key="frame" x="27" y="34" width="53" height="31"/> <rect key="frame" x="27" y="-1" width="53" height="31"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<state key="normal" title="取消订单"> <state key="normal" title="取消订单">
<color key="titleColor" red="0.22352941176470587" green="0.22352941176470587" blue="0.22352941176470587" alpha="1" colorSpace="calibratedRGB"/> <color key="titleColor" red="0.22352941176470587" green="0.22352941176470587" blue="0.22352941176470587" alpha="1" colorSpace="calibratedRGB"/>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<constraints> <constraints>
<constraint firstItem="jGI-UQ-mqY" firstAttribute="centerY" secondItem="AZR-1t-dC0" secondAttribute="centerY" id="2PX-eQ-5Vc"/> <constraint firstItem="jGI-UQ-mqY" firstAttribute="centerY" secondItem="AZR-1t-dC0" secondAttribute="centerY" id="2PX-eQ-5Vc"/>
<constraint firstItem="z8Q-AY-djl" firstAttribute="bottom" secondItem="j8B-sN-dbR" secondAttribute="bottom" constant="-1" id="996-Oc-OCL"/> <constraint firstItem="z8Q-AY-djl" firstAttribute="bottom" secondItem="j8B-sN-dbR" secondAttribute="bottom" constant="-1" id="996-Oc-OCL"/>
<constraint firstAttribute="height" constant="70" id="BeA-GR-GUJ"/> <constraint firstAttribute="height" constant="35" id="BeA-GR-GUJ"/>
<constraint firstItem="gxP-ry-glr" firstAttribute="leading" secondItem="AZR-1t-dC0" secondAttribute="leading" constant="27" id="LHm-QN-4y6"/> <constraint firstItem="gxP-ry-glr" firstAttribute="leading" secondItem="AZR-1t-dC0" secondAttribute="leading" constant="27" id="LHm-QN-4y6"/>
<constraint firstItem="jGI-UQ-mqY" firstAttribute="top" secondItem="AZR-1t-dC0" secondAttribute="top" constant="9" id="Q5p-Me-6Vr"/> <constraint firstItem="jGI-UQ-mqY" firstAttribute="top" secondItem="AZR-1t-dC0" secondAttribute="top" constant="9" id="Q5p-Me-6Vr"/>
<constraint firstAttribute="bottom" secondItem="gxP-ry-glr" secondAttribute="bottom" constant="5" id="Qee-qh-xKt"/> <constraint firstAttribute="bottom" secondItem="gxP-ry-glr" secondAttribute="bottom" constant="5" id="Qee-qh-xKt"/>
...@@ -89,12 +89,12 @@ ...@@ -89,12 +89,12 @@
<constraints> <constraints>
<constraint firstItem="AZR-1t-dC0" firstAttribute="top" secondItem="9GU-8G-dS5" secondAttribute="top" id="Szs-Kf-cpj"/> <constraint firstItem="AZR-1t-dC0" firstAttribute="top" secondItem="9GU-8G-dS5" secondAttribute="top" id="Szs-Kf-cpj"/>
<constraint firstItem="AZR-1t-dC0" firstAttribute="leading" secondItem="9GU-8G-dS5" secondAttribute="leading" id="jqw-l8-sfc"/> <constraint firstItem="AZR-1t-dC0" firstAttribute="leading" secondItem="9GU-8G-dS5" secondAttribute="leading" id="jqw-l8-sfc"/>
<constraint firstAttribute="height" constant="80" id="nDR-HH-jdo"/> <constraint firstAttribute="height" constant="45" id="nDR-HH-jdo"/>
<constraint firstAttribute="trailing" secondItem="AZR-1t-dC0" secondAttribute="trailing" id="wfW-Ki-zB9"/> <constraint firstAttribute="trailing" secondItem="AZR-1t-dC0" secondAttribute="trailing" id="wfW-Ki-zB9"/>
</constraints> </constraints>
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ijW-ut-DIo" userLabel="content"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ijW-ut-DIo" userLabel="content">
<rect key="frame" x="0.0" y="80" width="375" height="80"/> <rect key="frame" x="0.0" y="45" width="375" height="80"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_loading" translatesAutoresizingMaskIntoConstraints="NO" id="nIn-Ka-NkB"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_loading" translatesAutoresizingMaskIntoConstraints="NO" id="nIn-Ka-NkB">
<rect key="frame" x="27" y="5" width="60" height="60"/> <rect key="frame" x="27" y="5" width="60" height="60"/>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="p1A-G5-zfb" userLabel="footer"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="p1A-G5-zfb" userLabel="footer">
<rect key="frame" x="0.0" y="160" width="375" height="40"/> <rect key="frame" x="0.0" y="125" width="375" height="40"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="40" id="zbc-4i-Uw4"/> <constraint firstAttribute="height" constant="40" id="zbc-4i-Uw4"/>
......
...@@ -77,18 +77,22 @@ ...@@ -77,18 +77,22 @@
//如果是尾行 //如果是尾行
bool isShowOther = [sectionArr containsObject:[NSString stringWithFormat:@"%ld",(long)indexPath.section]]; bool isShowOther = [sectionArr containsObject:[NSString stringWithFormat:@"%ld",(long)indexPath.section]];
if(indexPath.row == 3 && !isShowOther){ if(indexPath.row == 3 && !isShowOther){
return 200-80; //return 200-80;
return 165-45;
} }
NSInteger allRow = [self returnSectionRow:indexPath.section]; NSInteger allRow = [self returnSectionRow:indexPath.section];
if (indexPath.row == (allRow -1) && allRow > 4) {//最后一行 if (indexPath.row == (allRow -1) && allRow > 4) {//最后一行
return 200-80; //return 200-80;
return 165-45;
} }
//如果是首行 //如果是首行
if(indexPath.row == 0){ if(indexPath.row == 0){
return 200-40; //return 200-40;
return 165-40;
} }
//如果是中间几行 //如果是中间几行
return 200 - 80 -40; //return 200 - 80 -40;
return 165-45-40;
} }
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
......
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
@interface KWMEditAddressVC : KWMBaseVC<UITextFieldDelegate> @interface KWMEditAddressVC : KWMBaseVC<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfCountry;
@property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfProvince; @property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfProvince;
@property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfCity; @property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfCity;
@property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfArea;
@property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfAddress; @property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfAddress;
@property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfAddressDetail; @property (weak, nonatomic) IBOutlet KWMTextFieldUtil *tfAddressDetail;
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
//固定值为30,弹出软键盘时修改 //固定值为30,弹出软键盘时修改
@property(nonatomic,weak)IBOutlet NSLayoutConstraint *heightOfProvinceTop; @property(nonatomic,weak)IBOutlet NSLayoutConstraint *marginTopOfCountry;
//保存用上个页面传过来的地址对象,为空时表示此页为“添加地址”页面 //保存用上个页面传过来的地址对象,为空时表示此页为“添加地址”页面
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
} }
- (void)onClickBackgroundView:(UITapGestureRecognizer *)tapGesture{ - (void)onClickBackgroundView:(UITapGestureRecognizer *)tapGesture{
[self.tfCountry resignFirstResponder];
[self.tfProvince resignFirstResponder]; [self.tfProvince resignFirstResponder];
[self.tfCity resignFirstResponder]; [self.tfCity resignFirstResponder];
[self.tfArea resignFirstResponder];
[self.tfAddress resignFirstResponder]; [self.tfAddress resignFirstResponder];
[self.tfAddressDetail resignFirstResponder]; [self.tfAddressDetail resignFirstResponder];
[self.tfZip resignFirstResponder]; [self.tfZip resignFirstResponder];
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
-(void)initTextField{ -(void)initTextField{
self.tfName.delegate = self; self.tfName.delegate = self;
self.tfPhone.delegate = self; self.tfPhone.delegate = self;
self.tfCountry.delegate = self;
self.tfProvince.delegate = self; self.tfProvince.delegate = self;
self.tfCity.delegate = self; self.tfCity.delegate = self;
self.tfAddress.delegate = self; self.tfAddress.delegate = self;
...@@ -55,11 +56,11 @@ ...@@ -55,11 +56,11 @@
[self.tfProvince setTextFiledCountLimit:10]; [self.tfProvince setTextFiledCountLimit:10];
[self.tfCity setTextFiledCountLimit:10]; [self.tfCity setTextFiledCountLimit:10];
[self.tfArea setTextFiledCountLimit:10];
[self.tfName setTextFiledCountLimit:10]; [self.tfName setTextFiledCountLimit:10];
[self.tfAddress setTextFiledCountLimit:50]; [self.tfAddress setTextFiledCountLimit:50];
[self.tfAddressDetail setTextFiledCountLimit:50]; [self.tfAddressDetail setTextFiledCountLimit:50];
self.tfCountry.tag = 0;
self.tfProvince.tag = 1; self.tfProvince.tag = 1;
self.tfCity.tag = 2; self.tfCity.tag = 2;
self.tfAddress.tag = 3; self.tfAddress.tag = 3;
...@@ -81,6 +82,7 @@ ...@@ -81,6 +82,7 @@
if (_address) { if (_address) {
self.tfName.text = _address.lastName; self.tfName.text = _address.lastName;
self.tfPhone.text = _address.phone; self.tfPhone.text = _address.phone;
self.tfCountry.text = _address.country;
self.tfProvince.text = _address.province; self.tfProvince.text = _address.province;
self.tfCity.text = _address.city; self.tfCity.text = _address.city;
self.tfAddress.text = _address.address1; self.tfAddress.text = _address.address1;
...@@ -91,7 +93,9 @@ ...@@ -91,7 +93,9 @@
//点击存储按钮 //点击存储按钮
-(void)clickRightButton{ -(void)clickRightButton{
if([KWMStringUtil isEmpty:self.tfProvince.text]){ if([KWMStringUtil isEmpty:self.tfCountry.text]){
[self showToast:@"请输入国家"];
}else if([KWMStringUtil isEmpty:self.tfProvince.text]){
[self showToast:@"请输入省份"]; [self showToast:@"请输入省份"];
}else if([KWMStringUtil isEmpty:self.tfCity.text]){ }else if([KWMStringUtil isEmpty:self.tfCity.text]){
[self showToast:@"请输入城市"]; [self showToast:@"请输入城市"];
...@@ -137,20 +141,39 @@ ...@@ -137,20 +141,39 @@
requestAddress.city = self.tfCity.text; requestAddress.city = self.tfCity.text;
requestAddress.address1 = self.tfAddress.text; requestAddress.address1 = self.tfAddress.text;
requestAddress.address2 = self.tfAddressDetail.text; requestAddress.address2 = self.tfAddressDetail.text;
requestAddress.country = @"China"; requestAddress.country = self.tfCountry.text;
requestAddress.countryCode = @"";
requestAddress.zip = self.tfZip.text; requestAddress.zip = self.tfZip.text;
requestAddress.firstName = @""; requestAddress.firstName = requestAddress.firstName?requestAddress.firstName:@"";
return requestAddress; return requestAddress;
} }
-(void)showAddressError:(NSError *)error{
if(error && error.userInfo){
NSString *errorInfoString = [NSString stringWithFormat:@"%@",error.userInfo];
if(errorInfoString){
if([errorInfoString rangeOfString:@"province"].location != NSNotFound &&
[errorInfoString rangeOfString:@"is not valid"].location != NSNotFound){
[self showToast:@"请填写正确的省份,例如美国的亚拉巴马州则填写:Alabama"];
return;
}
if([errorInfoString rangeOfString:@"country"].location != NSNotFound &&
[errorInfoString rangeOfString:@"is not a valid"].location != NSNotFound){
[self showToast:@"请填写正确的国家,例如美国则填写:United States"];
return;
}
}
}
[self showToast:@"更新地址失败"];
}
-(void)addAddress{ -(void)addAddress{
[self showLoading]; [self showLoading];
[self.client createAddress:[self getAddress] callback:^(BUYAddress *address, NSError *error) { [self.client createAddress:[self getAddress] callback:^(BUYAddress *address, NSError *error) {
[self hideLoading]; [self hideLoading];
if(error!=nil){ if(error!=nil){
[self showError:error]; [self showAddressError:error];
[self showToast:@"更新地址失败"];
}else if(address!=nil){ }else if(address!=nil){
self.address = address; self.address = address;
[self updateCustomerAddress]; [self updateCustomerAddress];
...@@ -168,8 +191,7 @@ ...@@ -168,8 +191,7 @@
[self hideLoading]; [self hideLoading];
NSLog(@"error = %@",error); NSLog(@"error = %@",error);
if (error != nil) { if (error != nil) {
[self showError:error]; [self showAddressError:error];
[self showToast:@"更新地址失败"];
}else if(address != nil){ }else if(address != nil){
[self updateCustomerAddress]; [self updateCustomerAddress];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
...@@ -180,6 +202,8 @@ ...@@ -180,6 +202,8 @@
} }
- (void)updateCustomerAddress{ - (void)updateCustomerAddress{
[self showLoading]; [self showLoading];
[self.client getCustomerCallback:^(BUYCustomer * _Nullable customer, NSError * _Nullable error) { [self.client getCustomerCallback:^(BUYCustomer * _Nullable customer, NSError * _Nullable error) {
...@@ -209,7 +233,7 @@ ...@@ -209,7 +233,7 @@
if(removeTag < 0){ if(removeTag < 0){
removeTag = 0; removeTag = 0;
} }
self.heightOfProvinceTop.constant = 30 - 57 * removeTag; self.marginTopOfCountry.constant = 30 - 57 * removeTag;
[UIView animateWithDuration:0.5 animations:^{ [UIView animateWithDuration:0.5 animations:^{
[self.view layoutIfNeeded]; [self.view layoutIfNeeded];
}]; }];
...@@ -219,7 +243,7 @@ ...@@ -219,7 +243,7 @@
//键盘弹出 //键盘弹出
-(void)keyboardWillHide:(NSNotification *)notification{ -(void)keyboardWillHide:(NSNotification *)notification{
self.heightOfProvinceTop.constant = 30; self.marginTopOfCountry.constant = 30;
[UIView animateWithDuration:0.5 animations:^{ [UIView animateWithDuration:0.5 animations:^{
[self.view layoutIfNeeded]; [self.view layoutIfNeeded];
}]; }];
......
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
if (startRange.location != NSNotFound) { if (startRange.location != NSNotFound) {
newImageUrl=[[NSMutableString alloc]initWithString:originalImgUrl]; newImageUrl=[[NSMutableString alloc]initWithString:originalImgUrl];
NSArray<NSString *> *imageWH = [self getImageWH:ImageSize]; NSArray<NSString *> *imageWH = [self getImageWH:ImageSize];
NSString *size = [NSString stringWithFormat:@"imageView2/1/w/%@/h/%@/",imageWH[0],imageWH[1]]; NSString *size = [NSString stringWithFormat:@"imageView2/2/w/%@/h/%@/",imageWH[0],imageWH[1]];
[newImageUrl insertString:size atIndex:startRange.location+1]; [newImageUrl insertString:size atIndex:startRange.location+1];
} }
} }
......
//
// BaseCell.h
// iCemarose
//
// Created by HouWeiBin on 2017/6/6.
// Copyright © 2017年 kollway. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BaseCell : UICollectionViewCell
@end
//
// BaseCell.m
// iCemarose
//
// Created by HouWeiBin on 2017/6/6.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "BaseCell.h"
@implementation BaseCell
@end
...@@ -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.3.2</string> <string>1.3.3</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2017053117</string> <string>2017060617</string>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>weixin</string> <string>weixin</string>
......
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