Commit 9efb8c34 authored by Sandy's avatar Sandy

修改部分界面

parent 60b617d9
{
"images" : [
{
"idiom" : "universal",
"filename" : "smallEmptyImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "orderDetail_canceled.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "orderDetail_canceled@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "orderDetail_completed.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "orderDetail_completed@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "orderDetail_transported.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "orderDetail_transported@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "orderDetail_waitefortransport.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "orderDetail_waitefortransport@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "orderDetail_waitforpay.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "orderDetail_waitforpay@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
[self addChildVC:homeVC title:@"店铺" imageName:@"home_tabbar" selectImgName:@"home_selected_tabbar"]; [self addChildVC:homeVC title:@"店铺" imageName:@"home_tabbar" selectImgName:@"home_selected_tabbar"];
[self addChildVC:storeVC title:@"商城" imageName:@"store_tabbar" selectImgName:@"store_selected_tabbar"]; // [self addChildVC:storeVC title:@"商城" imageName:@"store_tabbar" selectImgName:@"store_selected_tabbar"];
[self addChildVCNoNavigationbar:masageVC title:@"消息" imageName:@"message_tabbar" selectImgName:@"message_selected_tabbar"]; [self addChildVCNoNavigationbar:masageVC title:@"消息" imageName:@"message_tabbar" selectImgName:@"message_selected_tabbar"];
[self addChildVC:mineVC title:@"我的" imageName:@"mine_tabbar" selectImgName:@"mine_selected_tabbar"]; [self addChildVC:mineVC title:@"我的" imageName:@"mine_tabbar" selectImgName:@"mine_selected_tabbar"];
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
@interface OrderDetailTopView () @interface OrderDetailTopView ()
@property (weak, nonatomic) IBOutlet UIView *viewExpress; @property (weak, nonatomic) IBOutlet UIView *viewExpress;
@property (weak, nonatomic) IBOutlet UIImageView *imgIcon;
@property (weak, nonatomic) IBOutlet UILabel *labelState;
@end @end
@implementation OrderDetailTopView @implementation OrderDetailTopView
...@@ -25,6 +27,41 @@ ...@@ -25,6 +27,41 @@
[self.viewExpress removeFromSuperview]; [self.viewExpress removeFromSuperview];
} }
switch (self.orderType) {
case ORDERTOPTYPE_NOPAYMENT:
{
self.imgIcon.image = [UIImage imageNamed:@"orderDetail_waitforpay"];
self.labelState.text = @"等待付款";
}
break;
case ORDERTOPTYPE_WAITFORDISPATCH:
{
self.imgIcon.image = [UIImage imageNamed:@"orderDetail_waitefortransport"];
self.labelState.text = @"等待发货";
}
break;
case ORDERTOPTYPE_TRANSPORTED:
{
self.imgIcon.image = [UIImage imageNamed:@"orderDetail_transported"];
self.labelState.text = @"已发货";
}
break;
case ORDERTOPTYPE_COMMPLETE:
{
self.imgIcon.image = [UIImage imageNamed:@"orderDetail_completed"];
self.labelState.text = @"已完成";
}
break;
case ORDERTOPTYPE_CANCELED:
{
self.imgIcon.image = [UIImage imageNamed:@"orderDetail_canceled"];
self.labelState.text = @"已取消";
}
break;
default:
break;
}
} }
- (void)updateHeight { - (void)updateHeight {
...@@ -32,9 +69,9 @@ ...@@ -32,9 +69,9 @@
} }
- (void)viewWithModel:(JavenOrderModel *)model { - (void)viewWithModel:(JavenOrderModel *)model {
self.labelName = model.consumer.name; self.labelName.text = model.address.name;
JavenAddress *address = model.address; JavenAddress *address = model.address;
self.labelAddress.text = [NSString stringWithFormat:@"%@%@%@%@", address.nation ? address.nation : @"", address.city, address.country, address.address]; self.labelAddress.text = [NSString stringWithFormat:@"%@%@%@%@%@", address.nation ? address.nation : @"", address.province, address.city, address.country, address.address];
self.labelPhoneNumber.text = model.consumer.code; self.labelPhoneNumber.text = model.consumer.code;
} }
......
...@@ -168,12 +168,21 @@ ...@@ -168,12 +168,21 @@
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="orderDetail_waitefortransport" translatesAutoresizingMaskIntoConstraints="NO" id="CCq-Cf-mp9">
<rect key="frame" x="216" y="10" width="74" height="100"/>
<constraints>
<constraint firstAttribute="width" constant="74" id="VMy-2S-sy9"/>
<constraint firstAttribute="height" constant="100" id="jMo-VD-pwn"/>
</constraints>
</imageView>
</subviews> </subviews>
<color key="backgroundColor" red="0.48627450979999998" green="0.76470588240000004" blue="0.1450980392" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.48627450979999998" green="0.76470588240000004" blue="0.1450980392" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="120" id="5NF-bg-COp"/> <constraint firstAttribute="height" constant="120" id="5NF-bg-COp"/>
<constraint firstItem="nyc-Bh-qZx" firstAttribute="centerY" secondItem="hQw-oZ-PUV" secondAttribute="centerY" id="B1x-lb-Dsd"/> <constraint firstItem="nyc-Bh-qZx" firstAttribute="centerY" secondItem="hQw-oZ-PUV" secondAttribute="centerY" id="B1x-lb-Dsd"/>
<constraint firstItem="CCq-Cf-mp9" firstAttribute="centerY" secondItem="nyc-Bh-qZx" secondAttribute="centerY" id="Ygb-Ld-d90"/>
<constraint firstItem="nyc-Bh-qZx" firstAttribute="leading" secondItem="hQw-oZ-PUV" secondAttribute="leading" constant="22" id="ecB-5T-290"/> <constraint firstItem="nyc-Bh-qZx" firstAttribute="leading" secondItem="hQw-oZ-PUV" secondAttribute="leading" constant="22" id="ecB-5T-290"/>
<constraint firstAttribute="trailing" secondItem="CCq-Cf-mp9" secondAttribute="trailing" constant="30" id="wBq-Go-aSq"/>
</constraints> </constraints>
</view> </view>
</subviews> </subviews>
...@@ -208,11 +217,13 @@ ...@@ -208,11 +217,13 @@
</variation> </variation>
<connections> <connections>
<outlet property="bottomView" destination="kMe-iN-q0b" id="RF7-79-dgV"/> <outlet property="bottomView" destination="kMe-iN-q0b" id="RF7-79-dgV"/>
<outlet property="imgIcon" destination="CCq-Cf-mp9" id="Kot-eG-EsE"/>
<outlet property="labelAddress" destination="rM9-W2-1PT" id="Vpk-og-XdW"/> <outlet property="labelAddress" destination="rM9-W2-1PT" id="Vpk-og-XdW"/>
<outlet property="labelExpress" destination="qgd-cT-Y2S" id="qkY-uL-Ys8"/> <outlet property="labelExpress" destination="qgd-cT-Y2S" id="qkY-uL-Ys8"/>
<outlet property="labelExpressTime" destination="KAE-q5-yVI" id="mUx-78-qVY"/> <outlet property="labelExpressTime" destination="KAE-q5-yVI" id="mUx-78-qVY"/>
<outlet property="labelName" destination="J01-8B-y5r" id="jwt-aT-2P0"/> <outlet property="labelName" destination="J01-8B-y5r" id="jwt-aT-2P0"/>
<outlet property="labelPhoneNumber" destination="v7R-er-zaD" id="jiO-J8-KxV"/> <outlet property="labelPhoneNumber" destination="v7R-er-zaD" id="jiO-J8-KxV"/>
<outlet property="labelState" destination="nyc-Bh-qZx" id="A7V-bB-9BO"/>
<outlet property="viewExpress" destination="9bs-ar-XXb" id="rCv-CW-UTd"/> <outlet property="viewExpress" destination="9bs-ar-XXb" id="rCv-CW-UTd"/>
</connections> </connections>
<point key="canvasLocation" x="180" y="291"/> <point key="canvasLocation" x="180" y="291"/>
...@@ -222,5 +233,6 @@ ...@@ -222,5 +233,6 @@
<image name="call_icon" width="45" height="45"/> <image name="call_icon" width="45" height="45"/>
<image name="icon_order_address" width="33" height="32"/> <image name="icon_order_address" width="33" height="32"/>
<image name="icon_order_car" width="36" height="29"/> <image name="icon_order_car" width="36" height="29"/>
<image name="orderDetail_waitefortransport" width="103" height="88"/>
</resources> </resources>
</document> </document>
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
- (void)defaultLoginAction { - (void)defaultLoginAction {
BaseViewController *baseVC = [[BaseViewController alloc] init]; // BaseViewController *baseVC = [[BaseViewController alloc] init];
baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; // baseVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:baseVC animated:YES completion:nil]; // [self presentViewController:baseVC animated:YES completion:nil];
//
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"]) { if ([[NSUserDefaults standardUserDefaults] objectForKey:@"passWord"]) {
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "JavenBankCards.h"
@interface BankTableViewCell : UITableViewCell @interface BankTableViewCell : UITableViewCell
- (void)cellWithModel:(JavenBankCards *)model;
@end @end
...@@ -10,10 +10,17 @@ ...@@ -10,10 +10,17 @@
@interface BankTableViewCell () @interface BankTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imgViewBackground; @property (weak, nonatomic) IBOutlet UIImageView *imgViewBackground;
@property (weak, nonatomic) IBOutlet UILabel *labelBankName;
@property (weak, nonatomic) IBOutlet UILabel *labelBankNO;
@end @end
@implementation BankTableViewCell @implementation BankTableViewCell
- (void)cellWithModel:(JavenBankCards *)model {
self.labelBankName.text = model.bank;
self.labelBankNO.text = [NSString stringWithFormat:@"**** **** **** %@", [model.cardNo substringWithRange:NSMakeRange(model.cardNo.length - 4, 4)]];
}
- (void)awakeFromNib { - (void)awakeFromNib {
// Initialization code // Initialization code
self.imgViewBackground.layer.masksToBounds = YES; self.imgViewBackground.layer.masksToBounds = YES;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<constraint firstAttribute="height" constant="50" id="NZD-As-l8U"/> <constraint firstAttribute="height" constant="50" id="NZD-As-l8U"/>
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="储蓄卡" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJ7-8i-4f5"> <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="储蓄卡" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xJ7-8i-4f5">
<rect key="frame" x="90" y="54" width="45" height="18"/> <rect key="frame" x="90" y="54" width="45" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/> <fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
...@@ -72,6 +72,8 @@ ...@@ -72,6 +72,8 @@
</tableViewCellContentView> </tableViewCellContentView>
<connections> <connections>
<outlet property="imgViewBackground" destination="CD7-rL-3Ij" id="H9j-dt-pFj"/> <outlet property="imgViewBackground" destination="CD7-rL-3Ij" id="H9j-dt-pFj"/>
<outlet property="labelBankNO" destination="jAQ-ZS-i4d" id="Q2g-Zx-hhv"/>
<outlet property="labelBankName" destination="1bl-Gu-RDW" id="JWi-4r-jbM"/>
</connections> </connections>
<point key="canvasLocation" x="385" y="387"/> <point key="canvasLocation" x="385" y="387"/>
</tableViewCell> </tableViewCell>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="60"/> <rect key="frame" x="0.0" y="0.0" width="320" height="60"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XEH-EO-w12"> <button opaque="NO" contentMode="scaleAspectFit" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XEH-EO-w12">
<rect key="frame" x="0.0" y="1" width="320" height="59"/> <rect key="frame" x="0.0" y="1" width="320" height="59"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="130" id="CeF-dx-cXo"/> <constraint firstAttribute="width" constant="130" id="CeF-dx-cXo"/>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<state key="normal" title=" 添加银行卡" image="mine_add_icon"> <state key="normal" title=" 添加银行卡" image="mine_add_icon">
<color key="titleColor" red="0.34509803919999998" green="0.75686274509999996" blue="0.050980392159999999" alpha="1" colorSpace="calibratedRGB"/> <color key="titleColor" red="0.34509803919999998" green="0.75686274509999996" blue="0.050980392159999999" alpha="1" colorSpace="calibratedRGB"/>
</state> </state>
<state key="selected" title="修改"/> <state key="selected" title=" 修改" image="smallEmptyImage"/>
<variation key="default"> <variation key="default">
<mask key="constraints"> <mask key="constraints">
<exclude reference="CeF-dx-cXo"/> <exclude reference="CeF-dx-cXo"/>
...@@ -67,5 +67,6 @@ ...@@ -67,5 +67,6 @@
</objects> </objects>
<resources> <resources>
<image name="mine_add_icon" width="20" height="20"/> <image name="mine_add_icon" width="20" height="20"/>
<image name="smallEmptyImage" width="1" height="1"/>
</resources> </resources>
</document> </document>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
MyBandCardViewController *myBankCardVC = [[MyBandCardViewController alloc] init]; MyBandCardViewController *myBankCardVC = [[MyBandCardViewController alloc] init];
myBankCardVC.isShowNavigationBar = YES; myBankCardVC.isShowNavigationBar = YES;
myBankCardVC.hidesBottomBarWhenPushed = YES; myBankCardVC.hidesBottomBarWhenPushed = YES;
myBankCardVC.reseller = self.reseller; // myBankCardVC.reseller = self.reseller;
[self.navigationController pushViewController:myBankCardVC animated:YES]; [self.navigationController pushViewController:myBankCardVC animated:YES];
} }
......
...@@ -54,12 +54,19 @@ ...@@ -54,12 +54,19 @@
}]; }];
} }
- (IBAction)actionHelp:(id)sender { - (IBAction)actionHelp:(id)sender {
MyAcountHelfViewController *helpVC = [[MyAcountHelfViewController alloc] init]; MyAcountHelfViewController *helpVC = [[MyAcountHelfViewController alloc] init];
helpVC.isShowNavigationBar = YES; helpVC.isShowNavigationBar = YES;
[self.navigationController pushViewController:helpVC animated:YES]; [self.navigationController pushViewController:helpVC animated:YES];
} }
- (IBAction)actionGoBill:(id)sender {
}
- (IBAction)actionBac:(id)sender { - (IBAction)actionBac:(id)sender {
[self popAction]; [self popAction];
} }
......
...@@ -74,19 +74,29 @@ ...@@ -74,19 +74,29 @@
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="账单" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aQ2-Ra-9g7"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="账单" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aQ2-Ra-9g7">
<rect key="frame" x="320" y="77" width="40" height="24"/> <rect key="frame" x="320" y="77" width="40" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/> <fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView hidden="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_bill" translatesAutoresizingMaskIntoConstraints="NO" id="egs-2O-iKB"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_bill" translatesAutoresizingMaskIntoConstraints="NO" id="egs-2O-iKB">
<rect key="frame" x="314" y="116" width="53" height="43"/> <rect key="frame" x="314" y="116" width="53" height="43"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="43" id="MX8-di-oyd"/> <constraint firstAttribute="height" constant="43" id="MX8-di-oyd"/>
<constraint firstAttribute="width" constant="53" id="opN-wf-o4B"/> <constraint firstAttribute="width" constant="53" id="opN-wf-o4B"/>
</constraints> </constraints>
</imageView> </imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W6s-1P-UTv">
<rect key="frame" x="297" y="70" width="78" height="98"/>
<constraints>
<constraint firstAttribute="width" constant="78" id="He6-a6-9WP"/>
<constraint firstAttribute="height" constant="98" id="Lh9-uD-wqh"/>
</constraints>
<connections>
<action selector="actionGoBill:" destination="-1" eventType="touchUpInside" id="OXv-qh-YhR"/>
</connections>
</button>
</subviews> </subviews>
<color key="backgroundColor" red="0.48627450979999998" green="0.76470588240000004" blue="0.1450980392" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.48627450979999998" green="0.76470588240000004" blue="0.1450980392" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
...@@ -97,7 +107,9 @@ ...@@ -97,7 +107,9 @@
<constraint firstItem="uKL-7j-fA6" firstAttribute="leading" secondItem="GpK-ZS-xDF" secondAttribute="leading" constant="14" id="I4V-JL-QVI"/> <constraint firstItem="uKL-7j-fA6" firstAttribute="leading" secondItem="GpK-ZS-xDF" secondAttribute="leading" constant="14" id="I4V-JL-QVI"/>
<constraint firstItem="PPm-Va-bG0" firstAttribute="top" secondItem="GpK-ZS-xDF" secondAttribute="top" constant="18" id="PHS-8g-KdE"/> <constraint firstItem="PPm-Va-bG0" firstAttribute="top" secondItem="GpK-ZS-xDF" secondAttribute="top" constant="18" id="PHS-8g-KdE"/>
<constraint firstItem="qUL-pA-7p5" firstAttribute="top" secondItem="GpK-ZS-xDF" secondAttribute="top" id="QvF-5D-Wnt"/> <constraint firstItem="qUL-pA-7p5" firstAttribute="top" secondItem="GpK-ZS-xDF" secondAttribute="top" id="QvF-5D-Wnt"/>
<constraint firstAttribute="trailing" secondItem="W6s-1P-UTv" secondAttribute="trailing" id="Ved-z0-F9Z"/>
<constraint firstItem="mvG-Qa-pDy" firstAttribute="top" secondItem="uKL-7j-fA6" secondAttribute="bottom" constant="8" id="WUS-My-6ky"/> <constraint firstItem="mvG-Qa-pDy" firstAttribute="top" secondItem="uKL-7j-fA6" secondAttribute="bottom" constant="8" id="WUS-My-6ky"/>
<constraint firstItem="W6s-1P-UTv" firstAttribute="top" secondItem="v0z-xY-O0r" secondAttribute="bottom" constant="13" id="XG5-bI-PAZ"/>
<constraint firstItem="aQ2-Ra-9g7" firstAttribute="centerX" secondItem="v0z-xY-O0r" secondAttribute="centerX" id="XQc-Ey-H97"/> <constraint firstItem="aQ2-Ra-9g7" firstAttribute="centerX" secondItem="v0z-xY-O0r" secondAttribute="centerX" id="XQc-Ey-H97"/>
<constraint firstItem="mCL-jB-CAj" firstAttribute="centerX" secondItem="GpK-ZS-xDF" secondAttribute="centerX" id="Z1L-Yg-zuw"/> <constraint firstItem="mCL-jB-CAj" firstAttribute="centerX" secondItem="GpK-ZS-xDF" secondAttribute="centerX" id="Z1L-Yg-zuw"/>
<constraint firstAttribute="trailing" secondItem="v0z-xY-O0r" secondAttribute="trailing" constant="15" id="cic-Ii-Dpg"/> <constraint firstAttribute="trailing" secondItem="v0z-xY-O0r" secondAttribute="trailing" constant="15" id="cic-Ii-Dpg"/>
...@@ -355,7 +367,7 @@ ...@@ -355,7 +367,7 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="bac" width="13" height="24"/> <image name="bac" width="11" height="20"/>
<image name="icon_bill" width="54" height="57"/> <image name="icon_bill" width="54" height="57"/>
</resources> </resources>
</document> </document>
...@@ -60,28 +60,18 @@ ...@@ -60,28 +60,18 @@
} }
- (NSDictionary *)getParams { - (NSDictionary *)getParams {
JavenBankCards *bankCard = [[JavenBankCards alloc] init]; JavenBankCards *bankCard;
if (self.reseller.certificate.bankCards.count > 0) {
bankCard = self.reseller.certificate.bankCards[0];
}else{
bankCard = [[JavenBankCards alloc] init];
}
bankCard.cardNo = self.bankCardID; bankCard.cardNo = self.bankCardID;
bankCard.bank = [self.labelBankName.text componentsSeparatedByString:@"·"][0]; bankCard.bank = [self.labelBankName.text componentsSeparatedByString:@"·"][0];
NSDictionary *dic = [bankCard dictionaryRepresentation]; NSDictionary *dic = [bankCard dictionaryRepresentation];
NSDictionary *myDictionary = @{@"uuid" : [NSNull null],
@"owner" : @{@"uuid" : [NSNull null],
@"code" : [NSNull null],
@"name" : [NSNull null]},
@"carrier" : [NSNull null],
@"address" : @{@"nation" : [NSNull null],
@"province" : [NSNull null],
@"city" : [NSNull null],
@"country" : [NSNull null],
@"address" : [NSNull null],
@"zip" : [NSNull null]},
@"bank" : [self.labelBankName.text componentsSeparatedByString:@"·"][0],
@"branchBank" : [NSNull null],
@"cardNo" : self.bankCardID};
self.reseller.certificate.bankCards = @[dic]; self.reseller.certificate.bankCards = @[dic];
NSDictionary *params = [self getParamsWithReseller:self.reseller]; NSDictionary *params = [self getParamsWithReseller:self.reseller];
return params; return params;
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
[self addBottomView]; [self addBottomView];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self getReseller];
}
- (void)setUpTableView { - (void)setUpTableView {
self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"BankTableViewCell" cellId:kCellID]; self.tableView = [UITableView plainTableViewWithTarget:self cellNibName:@"BankTableViewCell" cellId:kCellID];
...@@ -46,11 +50,13 @@ ...@@ -46,11 +50,13 @@
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1; return self.reseller.certificate.bankCards.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
BankTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID forIndexPath:indexPath]; BankTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID forIndexPath:indexPath];
JavenBankCards *bankModel = self.reseller.certificate.bankCards[indexPath.row];
[cell cellWithModel:bankModel];
return cell; return cell;
} }
...@@ -81,7 +87,20 @@ ...@@ -81,7 +87,20 @@
[self.navigationController pushViewController:addBankIDVC animated:YES]; [self.navigationController pushViewController:addBankIDVC animated:YES];
} }
- (void)getReseller{
WS(weakSelf)
[[HTTPCilent shareCilent] GET:[NSString stringWithFormat:@"reseller/get/%@", [UserInfo shareInstance].uuid] parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
if ([responseObject[@"code"] isEqualToNumber:@0]) {
weakSelf.reseller = [JavenResellerBigModel modelObjectWithDictionary:responseObject[@"reseller"]];
[weakSelf.tableView reloadData];
weakSelf.bottomView.btnAdd.selected = self.reseller.certificate.bankCards.count == 1;
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
}];
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
// //
// JavenCertificate.m // JavenCertificate.m
// //
// Created by Z on 16/5/3 // Created by Z on 16/5/16
// Copyright (c) 2016 __MyCompanyName__. All rights reserved. // Copyright (c) 2016 __MyCompanyName__. All rights reserved.
// //
#import "JavenCertificate.h" #import "JavenCertificate.h"
#import "JavenBankCards.h"
NSString *const kJavenCertificateIdValidated = @"idValidated"; NSString *const kJavenCertificateIdValidated = @"idValidated";
...@@ -38,10 +39,22 @@ NSString *const kJavenCertificateTrueName = @"trueName"; ...@@ -38,10 +39,22 @@ NSString *const kJavenCertificateTrueName = @"trueName";
// This check serves to make sure that a non-NSDictionary object // This check serves to make sure that a non-NSDictionary object
// passed into the model class doesn't break the parsing. // passed into the model class doesn't break the parsing.
if(self && [dict isKindOfClass:[NSDictionary class]]) { if(self && [dict isKindOfClass:[NSDictionary class]]) {
self.idValidated = [[self objectOrNilForKey:kJavenCertificateIdValidated fromDictionary:dict] boolValue]; self.idValidated = [[self objectOrNilForKey:kJavenCertificateIdValidated fromDictionary:dict] boolValue];
self.bankCards = [self objectOrNilForKey:kJavenCertificateBankCards fromDictionary:dict]; NSObject *receivedJavenBankCards = [dict objectForKey:kJavenCertificateBankCards];
self.trueName = [self objectOrNilForKey:kJavenCertificateTrueName fromDictionary:dict]; NSMutableArray *parsedJavenBankCards = [NSMutableArray array];
if ([receivedJavenBankCards isKindOfClass:[NSArray class]]) {
for (NSDictionary *item in (NSArray *)receivedJavenBankCards) {
if ([item isKindOfClass:[NSDictionary class]]) {
[parsedJavenBankCards addObject:[JavenBankCards modelObjectWithDictionary:item]];
}
}
} else if ([receivedJavenBankCards isKindOfClass:[NSDictionary class]]) {
[parsedJavenBankCards addObject:[JavenBankCards modelObjectWithDictionary:(NSDictionary *)receivedJavenBankCards]];
}
self.bankCards = [NSArray arrayWithArray:parsedJavenBankCards];
self.trueName = [self objectOrNilForKey:kJavenCertificateTrueName fromDictionary:dict];
} }
return self; return self;
...@@ -64,11 +77,11 @@ NSString *const kJavenCertificateTrueName = @"trueName"; ...@@ -64,11 +77,11 @@ NSString *const kJavenCertificateTrueName = @"trueName";
} }
[mutableDict setValue:[NSArray arrayWithArray:tempArrayForBankCards] forKey:kJavenCertificateBankCards]; [mutableDict setValue:[NSArray arrayWithArray:tempArrayForBankCards] forKey:kJavenCertificateBankCards];
[mutableDict setValue:self.trueName forKey:kJavenCertificateTrueName]; [mutableDict setValue:self.trueName forKey:kJavenCertificateTrueName];
return [NSDictionary dictionaryWithDictionary:mutableDict]; return [NSDictionary dictionaryWithDictionary:mutableDict];
} }
- (NSString *)description - (NSString *)description
{ {
return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]];
} }
...@@ -86,7 +99,7 @@ NSString *const kJavenCertificateTrueName = @"trueName"; ...@@ -86,7 +99,7 @@ NSString *const kJavenCertificateTrueName = @"trueName";
- (id)initWithCoder:(NSCoder *)aDecoder - (id)initWithCoder:(NSCoder *)aDecoder
{ {
self = [super init]; self = [super init];
self.idValidated = [aDecoder decodeBoolForKey:kJavenCertificateIdValidated]; self.idValidated = [aDecoder decodeBoolForKey:kJavenCertificateIdValidated];
self.bankCards = [aDecoder decodeObjectForKey:kJavenCertificateBankCards]; self.bankCards = [aDecoder decodeObjectForKey:kJavenCertificateBankCards];
self.trueName = [aDecoder decodeObjectForKey:kJavenCertificateTrueName]; self.trueName = [aDecoder decodeObjectForKey:kJavenCertificateTrueName];
...@@ -95,7 +108,7 @@ NSString *const kJavenCertificateTrueName = @"trueName"; ...@@ -95,7 +108,7 @@ NSString *const kJavenCertificateTrueName = @"trueName";
- (void)encodeWithCoder:(NSCoder *)aCoder - (void)encodeWithCoder:(NSCoder *)aCoder
{ {
[aCoder encodeBool:_idValidated forKey:kJavenCertificateIdValidated]; [aCoder encodeBool:_idValidated forKey:kJavenCertificateIdValidated];
[aCoder encodeObject:_bankCards forKey:kJavenCertificateBankCards]; [aCoder encodeObject:_bankCards forKey:kJavenCertificateBankCards];
[aCoder encodeObject:_trueName forKey:kJavenCertificateTrueName]; [aCoder encodeObject:_trueName forKey:kJavenCertificateTrueName];
...@@ -106,7 +119,7 @@ NSString *const kJavenCertificateTrueName = @"trueName"; ...@@ -106,7 +119,7 @@ NSString *const kJavenCertificateTrueName = @"trueName";
JavenCertificate *copy = [[JavenCertificate alloc] init]; JavenCertificate *copy = [[JavenCertificate alloc] init];
if (copy) { if (copy) {
copy.idValidated = self.idValidated; copy.idValidated = self.idValidated;
copy.bankCards = [self.bankCards copyWithZone:zone]; copy.bankCards = [self.bankCards copyWithZone:zone];
copy.trueName = [self.trueName copyWithZone:zone]; copy.trueName = [self.trueName copyWithZone:zone];
......
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