Jelajahi Sumber

1.修改iOS Apex Drivers通知处理方式,弹出Alert提示。
2.修改iOS Apex Drivers Order Backend Flag。

Pen Li 7 tahun lalu
induk
melakukan
8db66437b2

+ 14 - 0
Redant Drivers/Apex And Drivers.xcodeproj/project.pbxproj

@@ -36,6 +36,9 @@
 		420D11262133F7E200149B37 /* RAOrderFilterViewController+DataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D11252133F7E200149B37 /* RAOrderFilterViewController+DataSource.m */; };
 		420D11292133F7F600149B37 /* RAOrderFilterViewController+TableDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 420D11282133F7F600149B37 /* RAOrderFilterViewController+TableDelegate.m */; };
 		420D112B2133F98600149B37 /* fake_order_filter.json in Resources */ = {isa = PBXBuildFile; fileRef = 420D112A2133F98600149B37 /* fake_order_filter.json */; };
+		422BD95A213CE06300DF8E89 /* backend_flag.png in Resources */ = {isa = PBXBuildFile; fileRef = 422BD959213CE06300DF8E89 /* backend_flag.png */; };
+		422BD95C213CE0F300DF8E89 /* HomeHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = 422BD95B213CE0F300DF8E89 /* HomeHeader.xib */; };
+		422BD95F213CE2E600DF8E89 /* RABadgeNumberView.m in Sources */ = {isa = PBXBuildFile; fileRef = 422BD95E213CE2E600DF8E89 /* RABadgeNumberView.m */; };
 		422DA1C02134FA7D0021BD70 /* RAPresentationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 422DA1BF2134FA7D0021BD70 /* RAPresentationController.m */; };
 		423C6A4E20C909FC00455E27 /* RANotificationNameCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 423C6A4D20C909FC00455E27 /* RANotificationNameCenter.m */; };
 		424204DC20C61561005AEED9 /* RAQRCodeScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 424204DB20C61561005AEED9 /* RAQRCodeScannerViewController.m */; };
@@ -213,6 +216,10 @@
 		420D11272133F7F600149B37 /* RAOrderFilterViewController+TableDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RAOrderFilterViewController+TableDelegate.h"; sourceTree = "<group>"; };
 		420D11282133F7F600149B37 /* RAOrderFilterViewController+TableDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RAOrderFilterViewController+TableDelegate.m"; sourceTree = "<group>"; };
 		420D112A2133F98600149B37 /* fake_order_filter.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = fake_order_filter.json; sourceTree = "<group>"; };
+		422BD959213CE06300DF8E89 /* backend_flag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = backend_flag.png; sourceTree = "<group>"; };
+		422BD95B213CE0F300DF8E89 /* HomeHeader.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HomeHeader.xib; sourceTree = "<group>"; };
+		422BD95D213CE2E600DF8E89 /* RABadgeNumberView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RABadgeNumberView.h; sourceTree = "<group>"; };
+		422BD95E213CE2E600DF8E89 /* RABadgeNumberView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RABadgeNumberView.m; sourceTree = "<group>"; };
 		422DA1BE2134FA7D0021BD70 /* RAPresentationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAPresentationController.h; sourceTree = "<group>"; };
 		422DA1BF2134FA7D0021BD70 /* RAPresentationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAPresentationController.m; sourceTree = "<group>"; };
 		423C6A4C20C909FC00455E27 /* RANotificationNameCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RANotificationNameCenter.h; sourceTree = "<group>"; };
@@ -478,6 +485,7 @@
 				4205FD6520C13BF400DB42B4 /* RAOrderCell.m */,
 				4205FD7020C1465400DB42B4 /* RAHomeOrderModel.h */,
 				4205FD7120C1465400DB42B4 /* RAHomeOrderModel.m */,
+				422BD95B213CE0F300DF8E89 /* HomeHeader.xib */,
 			);
 			path = Home;
 			sourceTree = "<group>";
@@ -623,6 +631,8 @@
 				425B97E320C7BD3800B35713 /* UIView+Toast.m */,
 				424BA1E12136806C007912EC /* UIImage+RedAnt.h */,
 				424BA1E22136806C007912EC /* UIImage+RedAnt.m */,
+				422BD95D213CE2E600DF8E89 /* RABadgeNumberView.h */,
+				422BD95E213CE2E600DF8E89 /* RABadgeNumberView.m */,
 			);
 			name = Utils;
 			sourceTree = "<group>";
@@ -907,6 +917,7 @@
 		71EAA32520B9571B002F003C = {
 			isa = PBXGroup;
 			children = (
+				422BD959213CE06300DF8E89 /* backend_flag.png */,
 				42C1B26F2134D61100637085 /* Filter.png */,
 				420D11222133F7A700149B37 /* Checkmark.png */,
 				4255EC8120C51A4F00E5DA24 /* Barcode_n.png */,
@@ -1070,8 +1081,10 @@
 				71EAA33E20B95720002F003C /* LaunchScreen.storyboard in Resources */,
 				420D112B2133F98600149B37 /* fake_order_filter.json in Resources */,
 				4255EC8220C51A5000E5DA24 /* Barcode_n.png in Resources */,
+				422BD95C213CE0F300DF8E89 /* HomeHeader.xib in Resources */,
 				4255ECA120C5400400E5DA24 /* Barcode_h.png in Resources */,
 				4258D16320CE298500067071 /* list.png in Resources */,
+				422BD95A213CE06300DF8E89 /* backend_flag.png in Resources */,
 				42D8B8A320C2253E001C125F /* fake_order_list.json in Resources */,
 				420D11042133E03A00149B37 /* orderFilter.storyboard in Resources */,
 				424204E420C65827005AEED9 /* Camera.storyboard in Resources */,
@@ -1109,6 +1122,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				422BD95F213CE2E600DF8E89 /* RABadgeNumberView.m in Sources */,
 				4255EC8720C51D4900E5DA24 /* RAEditPhotoCell.m in Sources */,
 				4280034520C0F146004D4F50 /* NSString+Base64.m in Sources */,
 				424204F320C68E02005AEED9 /* RAProgressHUD.m in Sources */,

+ 9 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/CollectionView/RADetailActionSubCell.m

@@ -18,6 +18,15 @@
 
 @implementation RADetailActionSubCell
 
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    
+    self.layer.borderWidth = 0.1f;
+    self.layer.borderColor = [UIColor lightGrayColor].CGColor;
+    self.layer.cornerRadius = 5.0f;
+    self.layer.masksToBounds = YES;
+}
+
 - (void)setModel:(RADetailActionModel *)model {
     _model = model;
     

+ 1 - 2
Redant Drivers/Apex And Drivers/Detail/Detail.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -186,7 +186,6 @@ OAKLAND,CA</string>
                                                                     </button>
                                                                 </subviews>
                                                             </view>
-                                                            <color key="backgroundColor" red="0.64783424140000001" green="0.22448275840000001" blue="0.21907054149999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                             <constraints>
                                                                 <constraint firstItem="5xB-Fx-vYR" firstAttribute="width" secondItem="NRo-Hn-zDX" secondAttribute="width" id="1yI-GZ-JrT"/>
                                                                 <constraint firstItem="5xB-Fx-vYR" firstAttribute="centerX" secondItem="NRo-Hn-zDX" secondAttribute="centerX" id="2vz-5F-VXV"/>

+ 108 - 96
Redant Drivers/Apex And Drivers/FakeData/fake_order_list.json

@@ -1,98 +1,110 @@
 {
-  "result": 2,
-  "sections": [
-    {
-      "type": 2,
-      "title": "New Order",
-      "totalCount":3,
-      "orders": [
-        {
-          "orderID": "00000001",
-          "orderNo": "AFS180530001200",
-          "containerNo": "TCNU6432476",
-          "date": "5/30/2018",
-          "status": 2,
-          "title": "Pickup Order New"
-        },
-        {
-          "orderID": "00000002",
-          "orderNo": "AFS180530001201",
-          "containerNo": "TCNU6432477",
-          "date": "5/30/2018",
-          "status": 2,
-          "title": "Pickup Order New"
-        },
-        {
-          "orderID": "00000003",
-          "orderNo": "AFS180530001202",
-          "containerNo": "TCNU6432478",
-          "date": "5/30/2018",
-          "status": 2,
-          "title": "Pickup Order New"
-        }
-      ]
-    },
-    {
-      "type": 1,
-      "title": "Processing Order",
-      "totalCount":23,
-      "orders": [
-        {
-          "orderID": "00000001",
-          "orderNo": "AFS180530001200",
-          "containerNo": "TCNU6432476",
-          "date": "5/30/2018",
-          "status": 1,
-          "title": "Pickup Order New"
-        },
-        {
-          "orderID": "00000002",
-          "orderNo": "AFS180530001201",
-          "containerNo": "TCNU6432477",
-          "date": "5/30/2018",
-          "status": 1,
-          "title": "Pickup Order New"
-        },
-        {
-          "orderID": "00000003",
-          "orderNo": "AFS180530001202",
-          "containerNo": "TCNU6432478",
-          "date": "5/30/2018",
-          "status": 1,
-          "title": "Pickup Order New"
-        }
-      ]
-    },
-    {
-      "type": 3,
-      "title": "Finish Order",
-      "totalCount":23,
-      "orders": [
-        {
-          "orderID": "00000001",
-          "orderNo": "AFS180530001200",
-          "containerNo": "TCNU6432476",
-          "date": "5/30/2018",
-          "status": 3,
-          "title": "Pickup Order New"
-        },
-        {
-          "orderID": "00000002",
-          "orderNo": "AFS180530001201",
-          "containerNo": "TCNU6432477",
-          "date": "5/30/2018",
-          "status": 3,
-          "title": "Pickup Order New"
-        },
-        {
-          "orderID": "00000003",
-          "orderNo": "AFS180530001202",
-          "containerNo": "TCNU6432478",
-          "date": "5/30/2018",
-          "status": 3,
-          "title": "Pickup Order New"
-        }
-      ]
-    }
-  ]
+    "result": 2,
+    "sections": [
+                 {
+                 "type": 2,
+                 "title": "New Order",
+                 "totalCount": 3,
+                 "orders": [
+                            {
+                            "orderID": "00000001",
+                            "orderNo": "AFS180530001200",
+                            "containerNo": "TCNU6432476",
+                            "date": "5/30/2018",
+                            "status": 2,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            },
+                            {
+                            "orderID": "00000002",
+                            "orderNo": "AFS180530001201",
+                            "containerNo": "TCNU6432477",
+                            "date": "5/30/2018",
+                            "status": 2,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            },
+                            {
+                            "orderID": "00000003",
+                            "orderNo": "AFS180530001202",
+                            "containerNo": "TCNU6432478",
+                            "date": "5/30/2018",
+                            "status": 2,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            }
+                            ],
+                 "backendFlagCount": 3
+                 },
+                 {
+                 "type": 1,
+                 "title": "Processing Order",
+                 "totalCount": 23,
+                 "orders": [
+                            {
+                            "orderID": "00000001",
+                            "orderNo": "AFS180530001200",
+                            "containerNo": "TCNU6432476",
+                            "date": "5/30/2018",
+                            "status": 1,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            },
+                            {
+                            "orderID": "00000002",
+                            "orderNo": "AFS180530001201",
+                            "containerNo": "TCNU6432477",
+                            "date": "5/30/2018",
+                            "status": 1,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            },
+                            {
+                            "orderID": "00000003",
+                            "orderNo": "AFS180530001202",
+                            "containerNo": "TCNU6432478",
+                            "date": "5/30/2018",
+                            "status": 1,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            }
+                            ],
+                 "backendFlagCount": 3
+                 },
+                 {
+                 "type": 3,
+                 "title": "Finish Order",
+                 "totalCount": 23,
+                 "orders": [
+                            {
+                            "orderID": "00000001",
+                            "orderNo": "AFS180530001200",
+                            "containerNo": "TCNU6432476",
+                            "date": "5/30/2018",
+                            "status": 3,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            },
+                            {
+                            "orderID": "00000002",
+                            "orderNo": "AFS180530001201",
+                            "containerNo": "TCNU6432477",
+                            "date": "5/30/2018",
+                            "status": 3,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            },
+                            {
+                            "orderID": "00000003",
+                            "orderNo": "AFS180530001202",
+                            "containerNo": "TCNU6432478",
+                            "date": "5/30/2018",
+                            "status": 3,
+                            "title": "Pickup Order New",
+                            "backendFlag": true
+                            }
+                            ],
+                 "backendFlagCount": 3
+                 }
+                 ]
 }

+ 11 - 8
Redant Drivers/Apex And Drivers/Home/Home.storyboard

@@ -48,13 +48,6 @@
                                                             <nil key="textColor"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
-                                                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Rxe-zz-m6W">
-                                                            <rect key="frame" x="340" y="5.5" width="20" height="20"/>
-                                                            <constraints>
-                                                                <constraint firstAttribute="height" constant="20" id="G2B-kt-1dz"/>
-                                                                <constraint firstAttribute="width" constant="20" id="SmO-AW-5Qc"/>
-                                                            </constraints>
-                                                        </imageView>
                                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0oy-zO-2fZ">
                                                             <rect key="frame" x="85" y="34" width="275" height="96"/>
                                                             <subviews>
@@ -143,6 +136,13 @@
                                                                 <constraint firstItem="LR1-3j-ccn" firstAttribute="leading" secondItem="0oy-zO-2fZ" secondAttribute="leading" id="wXZ-Kd-16P"/>
                                                             </constraints>
                                                         </view>
+                                                        <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="backend_flag.png" translatesAutoresizingMaskIntoConstraints="NO" id="Rxe-zz-m6W">
+                                                            <rect key="frame" x="340" y="5" width="20" height="20"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="height" constant="20" id="G2B-kt-1dz"/>
+                                                                <constraint firstAttribute="width" constant="20" id="SmO-AW-5Qc"/>
+                                                            </constraints>
+                                                        </imageView>
                                                     </subviews>
                                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                     <constraints>
@@ -242,7 +242,7 @@
                                                             <nil key="textColor"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
-                                                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wDi-Zy-4rB">
+                                                        <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="backend_flag.png" translatesAutoresizingMaskIntoConstraints="NO" id="wDi-Zy-4rB">
                                                             <rect key="frame" x="340" y="5.5" width="20" height="20"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="width" constant="20" id="RNz-ZX-3Xe"/>
@@ -399,4 +399,7 @@
             <point key="canvasLocation" x="262" y="126"/>
         </scene>
     </scenes>
+    <resources>
+        <image name="backend_flag.png" width="25" height="25"/>
+    </resources>
 </document>

+ 53 - 0
Redant Drivers/Apex And Drivers/Home/HomeHeader.xib

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="Of7-Zs-dma">
+            <rect key="frame" x="0.0" y="0.0" width="658" height="44"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <subviews>
+                <label opaque="NO" userInteractionEnabled="NO" tag="5000" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zid-Ks-zO5">
+                    <rect key="frame" x="10" y="12" width="42" height="21"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+                <button opaque="NO" tag="5002" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="J4X-Vt-JUe">
+                    <rect key="frame" x="612" y="7" width="36" height="30"/>
+                    <state key="normal" title="More"/>
+                </button>
+                <view tag="5001" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="68c-5k-TZT" customClass="RABadgeNumberView">
+                    <rect key="frame" x="57" y="12.5" width="20" height="20"/>
+                    <color key="backgroundColor" red="1" green="0.1047433005" blue="0.075207091899999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="20" id="XrI-P3-tmm"/>
+                        <constraint firstAttribute="width" constant="20" id="zar-3j-Nh6"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <constraints>
+                <constraint firstItem="m5T-tW-9hq" firstAttribute="trailing" secondItem="J4X-Vt-JUe" secondAttribute="trailing" constant="10" id="3b3-JN-LZE"/>
+                <constraint firstItem="J4X-Vt-JUe" firstAttribute="centerY" secondItem="m5T-tW-9hq" secondAttribute="centerY" id="9Rn-o7-OPT"/>
+                <constraint firstItem="68c-5k-TZT" firstAttribute="leading" secondItem="zid-Ks-zO5" secondAttribute="trailing" constant="5" id="DeO-mo-zFg"/>
+                <constraint firstItem="68c-5k-TZT" firstAttribute="centerY" secondItem="zid-Ks-zO5" secondAttribute="centerY" id="UuK-J4-dxh"/>
+                <constraint firstItem="J4X-Vt-JUe" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="68c-5k-TZT" secondAttribute="trailing" priority="999" constant="5" id="n9j-ds-8Ub"/>
+                <constraint firstItem="zid-Ks-zO5" firstAttribute="leading" secondItem="m5T-tW-9hq" secondAttribute="leading" constant="10" id="yj0-oj-G87"/>
+                <constraint firstItem="zid-Ks-zO5" firstAttribute="centerY" secondItem="m5T-tW-9hq" secondAttribute="centerY" id="zTW-Hz-NFg"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <viewLayoutGuide key="safeArea" id="m5T-tW-9hq"/>
+            <point key="canvasLocation" x="205" y="-122"/>
+        </view>
+    </objects>
+</document>

+ 1 - 0
Redant Drivers/Apex And Drivers/Home/RAHomeOrderModel.h

@@ -30,6 +30,7 @@ typedef enum {
 @property (nonatomic,copy) NSString *orderID;
 @property (nonatomic,copy) NSString *order_type2;
 @property (nonatomic,copy) NSString *iconURL;
+@property (nonatomic,assign) BOOL backendFlag;
 
 @property (nonatomic,strong,readonly) UIImage *icon;
 

+ 36 - 15
Redant Drivers/Apex And Drivers/Home/RAHomeViewController+HomeTableDelegate.m

@@ -8,6 +8,7 @@
 
 #import "RAHomeViewController+HomeTableDelegate.h"
 #import "RAHomeOrderModel.h"
+#import "RABadgeNumberView.h"
 
 
 @implementation RAHomeViewController (HomeTableDelegate)
@@ -20,23 +21,43 @@
 
 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
     
-    UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 44.0f)];
+//    UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 44.0f)];
+//    header.backgroundColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:0.8];
+//    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 11, CGRectGetWidth(tableView.bounds) - 100, 22)];
+//    [header addSubview:label];
+//
+//    label.text = [self titleForSection:section];
+//
+//    UIButton *expandBtn = [UIButton buttonWithType:UIButtonTypeSystem];
+//    expandBtn.frame = CGRectMake(CGRectGetWidth(tableView.bounds) - 90, 11, 80, 22);
+//    [expandBtn setTitle:@"More" forState:UIControlStateNormal];
+//
+//
+//    expandBtn.tag = section;
+//    [expandBtn addTarget:self action:@selector(sectionExpandSwithBtnClick:) forControlEvents:UIControlEventTouchUpInside];
+//    [header addSubview:expandBtn];
+//
+//    expandBtn.hidden = ![self hasMoreOrderForSection:section];
+//
+    
+    UIView *header = [[[NSBundle mainBundle] loadNibNamed:@"HomeHeader" owner:nil options:nil] objectAtIndex:0];
     header.backgroundColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:0.8];
-    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 11, CGRectGetWidth(tableView.bounds) - 100, 22)];
-    [header addSubview:label];
     
-    label.text = [self titleForSection:section];
-
-    UIButton *expandBtn = [UIButton buttonWithType:UIButtonTypeSystem];
-    expandBtn.frame = CGRectMake(CGRectGetWidth(tableView.bounds) - 90, 11, 80, 22);
-    [expandBtn setTitle:@"More" forState:UIControlStateNormal];
-//    [expandBtn setTitleColor:expandBtn.tintColor forState:UIControlStateNormal];
-//    [expandBtn setTitleColor:UIColorFromRGB(0xffffff) forState:UIControlStateHighlighted];
-    expandBtn.tag = section;
-    [expandBtn addTarget:self action:@selector(sectionExpandSwithBtnClick:) forControlEvents:UIControlEventTouchUpInside];
-    [header addSubview:expandBtn];
+    UILabel *titleLabel = (UILabel *)[header viewWithTag:5000];
+    RABadgeNumberView *badgeNumberView = (RABadgeNumberView *)[header viewWithTag:5001];
+    UIButton *moreBtn = (UIButton *)[header viewWithTag:5002];
+    
+    titleLabel.text = [self titleForSection:section];
+    
+    if (section == 0) {
+        badgeNumberView.badgeNumber = 20;
+    } else {
+        badgeNumberView.badgeNumber = 999;
+    }
     
-    expandBtn.hidden = ![self hasMoreOrderForSection:section];
+    moreBtn.tag = 6000 + section;
+    [moreBtn addTarget:self action:@selector(sectionExpandSwithBtnClick:) forControlEvents:UIControlEventTouchUpInside];
+    moreBtn.hidden = ![self hasMoreOrderForSection:section];
     
     return header;
 }
@@ -55,7 +76,7 @@
 #pragma mark - Action
 
 - (void)sectionExpandSwithBtnClick:(UIButton *)sender {
-    [self showMoreOrderForSection:sender.tag];
+    [self showMoreOrderForSection:sender.tag - 6000];
 }
 
 @end

+ 5 - 5
Redant Drivers/Apex And Drivers/Home/RAOrderCell.m

@@ -115,9 +115,9 @@
     return self;
 }
 
-- (instancetype)setStatus:(RAOrderStatus)status {
-
-    self.markView.hidden = status != RAOrderStatusNew;
+- (instancetype)setBackendFlag:(BOOL)flag {
+    
+    self.markView.hidden = !flag;
     
     return self;
 }
@@ -137,10 +137,10 @@
     NSString *containerNo = _orderModel.containerNo;
     NSString *date = _orderModel.date;
     NSString *orderType2 = _orderModel.order_type2;
-    RAOrderStatus status = _orderModel.status;
+    BOOL flag = _orderModel.backendFlag;
     UIImage *icon = _orderModel.icon;
     
-    [[[[[[[self setTitle:title] setOrderNo:orderNo] setContainerNo:containerNo] setDate:date] setStatus:status] setOrderType2:orderType2] setStatusIcon:icon];
+    [[[[[[[self setTitle:title] setOrderNo:orderNo] setContainerNo:containerNo] setDate:date] setBackendFlag:flag] setOrderType2:orderType2] setStatusIcon:icon];
     
 }
 

+ 16 - 0
Redant Drivers/Apex And Drivers/RABadgeNumberView.h

@@ -0,0 +1,16 @@
+//
+//  RABadgeNumberView.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/3.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RABadgeNumberView : UIView
+
+@property (nonatomic,assign) NSUInteger badgeNumber;///< Default is 0 ,while the value is 0,then it be hidden.the max value is 99
+@property (nonatomic,strong) UIColor *foregroundColor;///<textColor
+
+@end

+ 233 - 0
Redant Drivers/Apex And Drivers/RABadgeNumberView.m

@@ -0,0 +1,233 @@
+//
+//  RABadgeNumberView.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/3.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RABadgeNumberView.h"
+
+#define Max_Width 30.0f
+#define Min_Width 16.0f
+#define Text_Size 12.0f
+
+@interface RABadgeNumberView ()
+{
+    UIColor *_backgroundColor;
+    UIColor *_foregroundColor;
+}
+@property (nonatomic,strong) CAShapeLayer *originLayer;
+@property (nonatomic,strong) CAShapeLayer *borderLayer;
+@property (nonatomic,strong) CATextLayer *valueLayer;
+
+@end
+
+
+@implementation RABadgeNumberView
+
+#pragma mark - Utils
+
++ (CGSize)sizeOfString:(NSString *)string font:(UIFont *)font{
+    
+    if (string == nil) {
+        return CGSizeZero;
+    }
+    
+    NSDictionary *attribute = @{NSFontAttributeName: font};
+    
+    CGSize resSize = [string boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT)
+                                          options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading)
+                                       attributes:attribute
+                                          context:nil].size;
+    
+    return resSize;
+}
+
+#pragma mark - Public
+
+- (void)setBadgeNumber:(NSUInteger)badgeNumber {
+    _badgeNumber = badgeNumber;
+    
+    self.hidden = _badgeNumber == 0;
+    
+    NSString *text = nil;
+    if (_badgeNumber > 99) {
+        text = @"99+";
+    } else {
+        text = [NSString stringWithFormat:@"%lu",badgeNumber];
+    }
+    
+    [self.valueLayer setString:text];
+    
+    [self updateUI];
+}
+
+- (void)setForegroundColor:(UIColor *)foregroundColor {
+    _foregroundColor = foregroundColor;
+    self.valueLayer.foregroundColor = _foregroundColor.CGColor;
+}
+
+- (void)setBackgroundColor:(UIColor *)backgroundColor {
+    _backgroundColor = backgroundColor;
+    [self updateColor];
+}
+
+#pragma mark - Private
+
+- (UIColor *)foregroundColor {
+    if (_foregroundColor == nil) {
+        _foregroundColor = [UIColor whiteColor];
+    }
+    return _foregroundColor;
+}
+
+- (UIColor *)backgroundColor {
+    if (_backgroundColor == nil) {
+        _backgroundColor = [UIColor redColor];
+    }
+    return _backgroundColor;
+}
+
+- (void)willMoveToSuperview:(UIView *)newSuperview {
+    
+    [super willMoveToSuperview:newSuperview];
+    
+    [self.layer addSublayer:self.originLayer];
+    [self.layer addSublayer:self.borderLayer];
+    [self.layer addSublayer:self.valueLayer];
+    
+    [self updateUI];
+}
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    
+    [self updateUI];
+}
+
+#pragma mark Frame
+
+- (void)setWidth:(CGFloat)width {
+    
+    NSLayoutConstraint *widthConstraint = nil;
+    for (NSLayoutConstraint *constraint in self.constraints) {
+        if (constraint.firstAttribute == NSLayoutAttributeWidth) {
+            widthConstraint = constraint;
+        }
+    }
+    
+    if (widthConstraint) {
+        widthConstraint.constant = width;
+    } else {
+        
+        CGRect bounds = self.bounds;
+        bounds.size.width = width;
+        self.bounds = bounds;
+    }
+}
+
+- (void)setHeight:(CGFloat)height {
+    
+    NSLayoutConstraint *heightConstraint = nil;
+    for (NSLayoutConstraint *constraint in self.constraints) {
+        if (constraint.firstAttribute == NSLayoutAttributeHeight) {
+            heightConstraint = constraint;
+        }
+    }
+    
+    if (heightConstraint) {
+        heightConstraint.constant = height;        
+    } else {
+        
+        CGRect bounds = self.bounds;
+        bounds.size.height = height;
+        self.bounds = bounds;
+    }
+}
+
+- (void)updateUI {
+    
+    CGSize size = [self.class sizeOfString:self.valueLayer.string font:[UIFont systemFontOfSize:Text_Size]];
+    CGSize textSize = size;
+    if (size.width < Min_Width) {
+        size.width = Min_Width;
+    }
+    
+    if (size.height < Min_Width) {
+        size.height = Min_Width;
+    }
+    
+    if (size.height > size.width) {
+        size.width = size.height;
+    }
+    
+    size.width += 5.0f;
+    size.height += 5.0f;
+    
+    CGFloat r = size.height * 0.5;
+    
+    // 更新自身Size
+    if (self.badgeNumber < 10) {
+        [self setWidth:size.width];
+    } else {
+        [self setWidth:size.width + 5];
+    }
+    [self setHeight:size.height];
+    
+    // drag layer
+    self.borderLayer.path = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:r].CGPath;
+    
+    // 更新TextLayer Frame
+    CGFloat x = (CGRectGetWidth(self.bounds) - textSize.width) * 0.5,y = (CGRectGetHeight(self.bounds) - textSize.height) * 0.5;
+    self.valueLayer.frame = CGRectMake(x, y, textSize.width, textSize.height);
+}
+
+- (void)updateColor {
+    self.originLayer.fillColor = self.backgroundColor.CGColor;
+    self.originLayer.strokeColor = self.backgroundColor.CGColor;
+    self.borderLayer.fillColor = self.backgroundColor.CGColor;
+    self.borderLayer.strokeColor = self.backgroundColor.CGColor;
+}
+
+#pragma mark Layer
+
+- (CAShapeLayer *)originLayer {
+    if (!_originLayer) {
+        _originLayer = [CAShapeLayer layer];
+        _originLayer.fillColor = self.backgroundColor.CGColor;
+        _originLayer.strokeColor = self.backgroundColor.CGColor;
+        _originLayer.lineWidth = 0.1f;
+    }
+    return _originLayer;
+}
+
+- (CAShapeLayer *)borderLayer {
+    if (!_borderLayer) {
+        _borderLayer = [CAShapeLayer layer];
+        _borderLayer.fillColor = self.backgroundColor.CGColor;
+        _borderLayer.strokeColor = self.backgroundColor.CGColor;
+        _borderLayer.lineWidth = 0.1f;
+    }
+    return _borderLayer;
+}
+
+- (CATextLayer *)valueLayer {
+    if (!_valueLayer) {
+        _valueLayer = [CATextLayer layer];
+        _valueLayer.foregroundColor = self.foregroundColor.CGColor;
+        _valueLayer.contentsScale = [UIScreen mainScreen].scale;
+        _valueLayer.alignmentMode = kCAAlignmentCenter;
+        _valueLayer.contentsGravity = kCAGravityCenter;
+        
+        UIFont *font = [UIFont systemFontOfSize:Text_Size];
+        CGFontRef fontRef = CGFontCreateWithFontName((__bridge_retained CFStringRef)font.fontName);
+        _valueLayer.font = fontRef;
+        _valueLayer.fontSize = font.pointSize;
+        CGFontRelease(fontRef);
+    }
+    return _valueLayer;
+}
+
+
+@end

+ 22 - 1
Redant Drivers/Apex And Drivers/RANavigationController.m

@@ -49,7 +49,28 @@
 
 //    [RASingleton.sharedInstance writeLog:[NSString stringWithFormat:@"%s",__func__]];
     if (orderID) {
-        [self pushDetailViewControllerForOrderID:orderID type:orderType type2:orderType2];
+        
+       
+        NSString *msg = [aps objectForKey:@"message"];
+        if (msg.length == 0) {
+            msg = [NSString stringWithFormat:@"%@ status changed,view detail?",orderID];
+        }
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:msg preferredStyle:UIAlertControllerStyleAlert];
+        
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+        }];
+        
+        __weak typeof(self) weakSelf = self;
+        UIAlertAction *detailAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            [weakSelf pushDetailViewControllerForOrderID:orderID type:orderType type2:orderType2];
+        }];
+        
+        [alertVC addAction:cancelAction];
+        [alertVC addAction:detailAction];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
     }
 }
 

TEMPAT SAMPAH
Redant Drivers/backend_flag.png