├── MeiTuanWaiMai.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── maxin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── maxin.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── MeiTuanWaiMai.xcscheme │ └── xcschememanagement.plist ├── MeiTuanWaiMai ├── Application │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── ViewController.h │ └── ViewController.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── Resource │ │ ├── 1.imageset │ │ ├── 1.png │ │ └── Contents.json │ │ ├── 10.imageset │ │ ├── 10.png │ │ └── Contents.json │ │ ├── 2.imageset │ │ ├── 2.png │ │ └── Contents.json │ │ ├── 3.imageset │ │ ├── 3.png │ │ └── Contents.json │ │ ├── 4.imageset │ │ ├── 4.png │ │ └── Contents.json │ │ ├── 5.imageset │ │ ├── 5.png │ │ └── Contents.json │ │ ├── 6.imageset │ │ ├── 6.png │ │ └── Contents.json │ │ ├── 7.imageset │ │ ├── 7.png │ │ └── Contents.json │ │ ├── 8.imageset │ │ ├── 8.png │ │ └── Contents.json │ │ ├── 9.imageset │ │ ├── 9.png │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── add.imageset │ │ ├── Contents.json │ │ └── add.png │ │ ├── adddetail.imageset │ │ ├── Contents.json │ │ └── adddetail.png │ │ ├── gouwuche.imageset │ │ ├── Contents.json │ │ └── gouwuche.png │ │ └── sub.imageset │ │ ├── Contents.json │ │ └── sub.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Controllers │ ├── MainViewController.h │ └── MainViewController.m ├── Info.plist ├── Model.json ├── Models │ ├── OrderModel.h │ └── OrderModel.m ├── PrefixHeader.pch ├── ViewModel │ ├── ViewModel.h │ └── ViewModel.m ├── Views │ ├── BadgeView.h │ ├── BadgeView.m │ ├── GoodsListView.h │ ├── GoodsListView.m │ ├── GoodslistCell.h │ ├── GoodslistCell.m │ ├── GoodslistCell.xib │ ├── MainTableViewCell.h │ ├── MainTableViewCell.m │ ├── MainTableViewCell.xib │ ├── OverlayView.h │ ├── OverlayView.m │ ├── ShoppingCartView.h │ └── ShoppingCartView.m ├── main.m └── tools │ ├── ThrowLineTool.h │ └── ThrowLineTool.m └── README.md /MeiTuanWaiMai.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 84213C201C33E1FA00155AEE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84213C1F1C33E1FA00155AEE /* main.m */; }; 11 | 84213C291C33E1FA00155AEE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84213C271C33E1FA00155AEE /* Main.storyboard */; }; 12 | 84213C2B1C33E1FA00155AEE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84213C2A1C33E1FA00155AEE /* Assets.xcassets */; }; 13 | 84213C2E1C33E1FA00155AEE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84213C2C1C33E1FA00155AEE /* LaunchScreen.storyboard */; }; 14 | 84213C3D1C33E2EE00155AEE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84213C3A1C33E2EE00155AEE /* AppDelegate.m */; }; 15 | 84213C3E1C33E2EE00155AEE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84213C3C1C33E2EE00155AEE /* ViewController.m */; }; 16 | 84213C411C33E32700155AEE /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84213C401C33E32700155AEE /* MainViewController.m */; }; 17 | 84213C451C33E46F00155AEE /* MainTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84213C431C33E46F00155AEE /* MainTableViewCell.m */; }; 18 | 84213C461C33E46F00155AEE /* MainTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84213C441C33E46F00155AEE /* MainTableViewCell.xib */; }; 19 | 84B539761C3BB00300B59D64 /* OrderModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B539751C3BB00300B59D64 /* OrderModel.m */; }; 20 | 84B539791C3BCA6F00B59D64 /* ShoppingCartView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B539781C3BCA6F00B59D64 /* ShoppingCartView.m */; }; 21 | 84B5397E1C3C05CA00B59D64 /* ThrowLineTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B5397D1C3C05CA00B59D64 /* ThrowLineTool.m */; }; 22 | 84B539811C3C13DC00B59D64 /* BadgeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B539801C3C13DC00B59D64 /* BadgeView.m */; }; 23 | 84B539841C3C166F00B59D64 /* OverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B539831C3C166F00B59D64 /* OverlayView.m */; }; 24 | 84B539881C3C2CEA00B59D64 /* GoodslistCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B539861C3C2CEA00B59D64 /* GoodslistCell.m */; }; 25 | 84B539891C3C2CEA00B59D64 /* GoodslistCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84B539871C3C2CEA00B59D64 /* GoodslistCell.xib */; }; 26 | 84B5398C1C3CAEB300B59D64 /* GoodsListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84B5398B1C3CAEB300B59D64 /* GoodsListView.m */; }; 27 | 84E5F5971C4E8F9900989C80 /* ViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E5F5961C4E8F9900989C80 /* ViewModel.m */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 84213C1B1C33E1FA00155AEE /* MeiTuanWaiMai.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MeiTuanWaiMai.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 84213C1F1C33E1FA00155AEE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 33 | 84213C281C33E1FA00155AEE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | 84213C2A1C33E1FA00155AEE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 35 | 84213C2D1C33E1FA00155AEE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 36 | 84213C2F1C33E1FA00155AEE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 84213C391C33E2EE00155AEE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 38 | 84213C3A1C33E2EE00155AEE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 39 | 84213C3B1C33E2EE00155AEE /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 40 | 84213C3C1C33E2EE00155AEE /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 41 | 84213C3F1C33E32700155AEE /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 42 | 84213C401C33E32700155AEE /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 43 | 84213C421C33E46F00155AEE /* MainTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainTableViewCell.h; sourceTree = ""; }; 44 | 84213C431C33E46F00155AEE /* MainTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainTableViewCell.m; sourceTree = ""; }; 45 | 84213C441C33E46F00155AEE /* MainTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainTableViewCell.xib; sourceTree = ""; }; 46 | 84213C4D1C33EFE100155AEE /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = ""; }; 47 | 84B539741C3BB00300B59D64 /* OrderModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderModel.h; sourceTree = ""; }; 48 | 84B539751C3BB00300B59D64 /* OrderModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OrderModel.m; sourceTree = ""; }; 49 | 84B539771C3BCA6F00B59D64 /* ShoppingCartView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShoppingCartView.h; sourceTree = ""; }; 50 | 84B539781C3BCA6F00B59D64 /* ShoppingCartView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingCartView.m; sourceTree = ""; }; 51 | 84B5397C1C3C05CA00B59D64 /* ThrowLineTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThrowLineTool.h; sourceTree = ""; }; 52 | 84B5397D1C3C05CA00B59D64 /* ThrowLineTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThrowLineTool.m; sourceTree = ""; }; 53 | 84B5397F1C3C13DC00B59D64 /* BadgeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BadgeView.h; sourceTree = ""; }; 54 | 84B539801C3C13DC00B59D64 /* BadgeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BadgeView.m; sourceTree = ""; }; 55 | 84B539821C3C166F00B59D64 /* OverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlayView.h; sourceTree = ""; }; 56 | 84B539831C3C166F00B59D64 /* OverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OverlayView.m; sourceTree = ""; }; 57 | 84B539851C3C2CEA00B59D64 /* GoodslistCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoodslistCell.h; sourceTree = ""; }; 58 | 84B539861C3C2CEA00B59D64 /* GoodslistCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoodslistCell.m; sourceTree = ""; }; 59 | 84B539871C3C2CEA00B59D64 /* GoodslistCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GoodslistCell.xib; sourceTree = ""; }; 60 | 84B5398A1C3CAEB300B59D64 /* GoodsListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GoodsListView.h; sourceTree = ""; }; 61 | 84B5398B1C3CAEB300B59D64 /* GoodsListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GoodsListView.m; sourceTree = ""; }; 62 | 84E5F5951C4E8F9900989C80 /* ViewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewModel.h; sourceTree = ""; }; 63 | 84E5F5961C4E8F9900989C80 /* ViewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewModel.m; sourceTree = ""; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | 84213C181C33E1FA00155AEE /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | /* End PBXFrameworksBuildPhase section */ 75 | 76 | /* Begin PBXGroup section */ 77 | 84213C121C33E1FA00155AEE = { 78 | isa = PBXGroup; 79 | children = ( 80 | 84213C1D1C33E1FA00155AEE /* MeiTuanWaiMai */, 81 | 84213C1C1C33E1FA00155AEE /* Products */, 82 | ); 83 | sourceTree = ""; 84 | }; 85 | 84213C1C1C33E1FA00155AEE /* Products */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 84213C1B1C33E1FA00155AEE /* MeiTuanWaiMai.app */, 89 | ); 90 | name = Products; 91 | sourceTree = ""; 92 | }; 93 | 84213C1D1C33E1FA00155AEE /* MeiTuanWaiMai */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 84E5F5941C4E8F6A00989C80 /* ViewModel */, 97 | 84213C491C33EFA500155AEE /* tools */, 98 | 84213C361C33E2CA00155AEE /* Controllers */, 99 | 84213C371C33E2CA00155AEE /* Models */, 100 | 84213C381C33E2CA00155AEE /* Views */, 101 | 84213C351C33E28400155AEE /* Application */, 102 | 84213C1E1C33E1FA00155AEE /* Supporting Files */, 103 | ); 104 | path = MeiTuanWaiMai; 105 | sourceTree = ""; 106 | }; 107 | 84213C1E1C33E1FA00155AEE /* Supporting Files */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 84213C4D1C33EFE100155AEE /* PrefixHeader.pch */, 111 | 84213C271C33E1FA00155AEE /* Main.storyboard */, 112 | 84213C2A1C33E1FA00155AEE /* Assets.xcassets */, 113 | 84213C2C1C33E1FA00155AEE /* LaunchScreen.storyboard */, 114 | 84213C2F1C33E1FA00155AEE /* Info.plist */, 115 | 84213C1F1C33E1FA00155AEE /* main.m */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | 84213C351C33E28400155AEE /* Application */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 84213C391C33E2EE00155AEE /* AppDelegate.h */, 124 | 84213C3A1C33E2EE00155AEE /* AppDelegate.m */, 125 | 84213C3B1C33E2EE00155AEE /* ViewController.h */, 126 | 84213C3C1C33E2EE00155AEE /* ViewController.m */, 127 | ); 128 | path = Application; 129 | sourceTree = ""; 130 | }; 131 | 84213C361C33E2CA00155AEE /* Controllers */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 84213C3F1C33E32700155AEE /* MainViewController.h */, 135 | 84213C401C33E32700155AEE /* MainViewController.m */, 136 | ); 137 | path = Controllers; 138 | sourceTree = ""; 139 | }; 140 | 84213C371C33E2CA00155AEE /* Models */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 84B539741C3BB00300B59D64 /* OrderModel.h */, 144 | 84B539751C3BB00300B59D64 /* OrderModel.m */, 145 | ); 146 | path = Models; 147 | sourceTree = ""; 148 | }; 149 | 84213C381C33E2CA00155AEE /* Views */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 84213C421C33E46F00155AEE /* MainTableViewCell.h */, 153 | 84213C431C33E46F00155AEE /* MainTableViewCell.m */, 154 | 84213C441C33E46F00155AEE /* MainTableViewCell.xib */, 155 | 84B539771C3BCA6F00B59D64 /* ShoppingCartView.h */, 156 | 84B539781C3BCA6F00B59D64 /* ShoppingCartView.m */, 157 | 84B5397F1C3C13DC00B59D64 /* BadgeView.h */, 158 | 84B539801C3C13DC00B59D64 /* BadgeView.m */, 159 | 84B539821C3C166F00B59D64 /* OverlayView.h */, 160 | 84B539831C3C166F00B59D64 /* OverlayView.m */, 161 | 84B539851C3C2CEA00B59D64 /* GoodslistCell.h */, 162 | 84B539861C3C2CEA00B59D64 /* GoodslistCell.m */, 163 | 84B539871C3C2CEA00B59D64 /* GoodslistCell.xib */, 164 | 84B5398A1C3CAEB300B59D64 /* GoodsListView.h */, 165 | 84B5398B1C3CAEB300B59D64 /* GoodsListView.m */, 166 | ); 167 | path = Views; 168 | sourceTree = ""; 169 | }; 170 | 84213C491C33EFA500155AEE /* tools */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 84B5397C1C3C05CA00B59D64 /* ThrowLineTool.h */, 174 | 84B5397D1C3C05CA00B59D64 /* ThrowLineTool.m */, 175 | ); 176 | path = tools; 177 | sourceTree = ""; 178 | }; 179 | 84E5F5941C4E8F6A00989C80 /* ViewModel */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 84E5F5951C4E8F9900989C80 /* ViewModel.h */, 183 | 84E5F5961C4E8F9900989C80 /* ViewModel.m */, 184 | ); 185 | path = ViewModel; 186 | sourceTree = ""; 187 | }; 188 | /* End PBXGroup section */ 189 | 190 | /* Begin PBXNativeTarget section */ 191 | 84213C1A1C33E1FA00155AEE /* MeiTuanWaiMai */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 84213C321C33E1FA00155AEE /* Build configuration list for PBXNativeTarget "MeiTuanWaiMai" */; 194 | buildPhases = ( 195 | 84213C171C33E1FA00155AEE /* Sources */, 196 | 84213C181C33E1FA00155AEE /* Frameworks */, 197 | 84213C191C33E1FA00155AEE /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | ); 203 | name = MeiTuanWaiMai; 204 | productName = MeiTuanWaiMai; 205 | productReference = 84213C1B1C33E1FA00155AEE /* MeiTuanWaiMai.app */; 206 | productType = "com.apple.product-type.application"; 207 | }; 208 | /* End PBXNativeTarget section */ 209 | 210 | /* Begin PBXProject section */ 211 | 84213C131C33E1FA00155AEE /* Project object */ = { 212 | isa = PBXProject; 213 | attributes = { 214 | LastUpgradeCheck = 0720; 215 | ORGANIZATIONNAME = maxin; 216 | TargetAttributes = { 217 | 84213C1A1C33E1FA00155AEE = { 218 | CreatedOnToolsVersion = 7.2; 219 | }; 220 | }; 221 | }; 222 | buildConfigurationList = 84213C161C33E1FA00155AEE /* Build configuration list for PBXProject "MeiTuanWaiMai" */; 223 | compatibilityVersion = "Xcode 3.2"; 224 | developmentRegion = English; 225 | hasScannedForEncodings = 0; 226 | knownRegions = ( 227 | en, 228 | Base, 229 | ); 230 | mainGroup = 84213C121C33E1FA00155AEE; 231 | productRefGroup = 84213C1C1C33E1FA00155AEE /* Products */; 232 | projectDirPath = ""; 233 | projectRoot = ""; 234 | targets = ( 235 | 84213C1A1C33E1FA00155AEE /* MeiTuanWaiMai */, 236 | ); 237 | }; 238 | /* End PBXProject section */ 239 | 240 | /* Begin PBXResourcesBuildPhase section */ 241 | 84213C191C33E1FA00155AEE /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 84213C2E1C33E1FA00155AEE /* LaunchScreen.storyboard in Resources */, 246 | 84213C2B1C33E1FA00155AEE /* Assets.xcassets in Resources */, 247 | 84B539891C3C2CEA00B59D64 /* GoodslistCell.xib in Resources */, 248 | 84213C461C33E46F00155AEE /* MainTableViewCell.xib in Resources */, 249 | 84213C291C33E1FA00155AEE /* Main.storyboard in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | /* End PBXResourcesBuildPhase section */ 254 | 255 | /* Begin PBXSourcesBuildPhase section */ 256 | 84213C171C33E1FA00155AEE /* Sources */ = { 257 | isa = PBXSourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | 84213C3E1C33E2EE00155AEE /* ViewController.m in Sources */, 261 | 84B539841C3C166F00B59D64 /* OverlayView.m in Sources */, 262 | 84213C3D1C33E2EE00155AEE /* AppDelegate.m in Sources */, 263 | 84B539881C3C2CEA00B59D64 /* GoodslistCell.m in Sources */, 264 | 84B539791C3BCA6F00B59D64 /* ShoppingCartView.m in Sources */, 265 | 84E5F5971C4E8F9900989C80 /* ViewModel.m in Sources */, 266 | 84213C201C33E1FA00155AEE /* main.m in Sources */, 267 | 84B539811C3C13DC00B59D64 /* BadgeView.m in Sources */, 268 | 84B539761C3BB00300B59D64 /* OrderModel.m in Sources */, 269 | 84213C411C33E32700155AEE /* MainViewController.m in Sources */, 270 | 84B5398C1C3CAEB300B59D64 /* GoodsListView.m in Sources */, 271 | 84213C451C33E46F00155AEE /* MainTableViewCell.m in Sources */, 272 | 84B5397E1C3C05CA00B59D64 /* ThrowLineTool.m in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXSourcesBuildPhase section */ 277 | 278 | /* Begin PBXVariantGroup section */ 279 | 84213C271C33E1FA00155AEE /* Main.storyboard */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | 84213C281C33E1FA00155AEE /* Base */, 283 | ); 284 | name = Main.storyboard; 285 | sourceTree = ""; 286 | }; 287 | 84213C2C1C33E1FA00155AEE /* LaunchScreen.storyboard */ = { 288 | isa = PBXVariantGroup; 289 | children = ( 290 | 84213C2D1C33E1FA00155AEE /* Base */, 291 | ); 292 | name = LaunchScreen.storyboard; 293 | sourceTree = ""; 294 | }; 295 | /* End PBXVariantGroup section */ 296 | 297 | /* Begin XCBuildConfiguration section */ 298 | 84213C301C33E1FA00155AEE /* Debug */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ALWAYS_SEARCH_USER_PATHS = NO; 302 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 303 | CLANG_CXX_LIBRARY = "libc++"; 304 | CLANG_ENABLE_MODULES = YES; 305 | CLANG_ENABLE_OBJC_ARC = YES; 306 | CLANG_WARN_BOOL_CONVERSION = YES; 307 | CLANG_WARN_CONSTANT_CONVERSION = YES; 308 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 309 | CLANG_WARN_EMPTY_BODY = YES; 310 | CLANG_WARN_ENUM_CONVERSION = YES; 311 | CLANG_WARN_INT_CONVERSION = YES; 312 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 313 | CLANG_WARN_UNREACHABLE_CODE = YES; 314 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 315 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 316 | COPY_PHASE_STRIP = NO; 317 | DEBUG_INFORMATION_FORMAT = dwarf; 318 | ENABLE_STRICT_OBJC_MSGSEND = YES; 319 | ENABLE_TESTABILITY = YES; 320 | GCC_C_LANGUAGE_STANDARD = gnu99; 321 | GCC_DYNAMIC_NO_PIC = NO; 322 | GCC_NO_COMMON_BLOCKS = YES; 323 | GCC_OPTIMIZATION_LEVEL = 0; 324 | GCC_PREPROCESSOR_DEFINITIONS = ( 325 | "DEBUG=1", 326 | "$(inherited)", 327 | ); 328 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 329 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 330 | GCC_WARN_UNDECLARED_SELECTOR = YES; 331 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 332 | GCC_WARN_UNUSED_FUNCTION = YES; 333 | GCC_WARN_UNUSED_VARIABLE = YES; 334 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 335 | MTL_ENABLE_DEBUG_INFO = YES; 336 | ONLY_ACTIVE_ARCH = YES; 337 | SDKROOT = iphoneos; 338 | }; 339 | name = Debug; 340 | }; 341 | 84213C311C33E1FA00155AEE /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ALWAYS_SEARCH_USER_PATHS = NO; 345 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 346 | CLANG_CXX_LIBRARY = "libc++"; 347 | CLANG_ENABLE_MODULES = YES; 348 | CLANG_ENABLE_OBJC_ARC = YES; 349 | CLANG_WARN_BOOL_CONVERSION = YES; 350 | CLANG_WARN_CONSTANT_CONVERSION = YES; 351 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 352 | CLANG_WARN_EMPTY_BODY = YES; 353 | CLANG_WARN_ENUM_CONVERSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 356 | CLANG_WARN_UNREACHABLE_CODE = YES; 357 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 358 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 359 | COPY_PHASE_STRIP = NO; 360 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 361 | ENABLE_NS_ASSERTIONS = NO; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | GCC_C_LANGUAGE_STANDARD = gnu99; 364 | GCC_NO_COMMON_BLOCKS = YES; 365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 367 | GCC_WARN_UNDECLARED_SELECTOR = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 369 | GCC_WARN_UNUSED_FUNCTION = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 372 | MTL_ENABLE_DEBUG_INFO = NO; 373 | SDKROOT = iphoneos; 374 | VALIDATE_PRODUCT = YES; 375 | }; 376 | name = Release; 377 | }; 378 | 84213C331C33E1FA00155AEE /* Debug */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 382 | GCC_PREFIX_HEADER = "$(SRCROOT)/MeiTuanWaiMai/PrefixHeader.pch"; 383 | INFOPLIST_FILE = MeiTuanWaiMai/Info.plist; 384 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 385 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 386 | PRODUCT_BUNDLE_IDENTIFIER = com.maxin.MeiTuanWaiMai; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | }; 389 | name = Debug; 390 | }; 391 | 84213C341C33E1FA00155AEE /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | buildSettings = { 394 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 395 | GCC_PREFIX_HEADER = "$(SRCROOT)/MeiTuanWaiMai/PrefixHeader.pch"; 396 | INFOPLIST_FILE = MeiTuanWaiMai/Info.plist; 397 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 399 | PRODUCT_BUNDLE_IDENTIFIER = com.maxin.MeiTuanWaiMai; 400 | PRODUCT_NAME = "$(TARGET_NAME)"; 401 | }; 402 | name = Release; 403 | }; 404 | /* End XCBuildConfiguration section */ 405 | 406 | /* Begin XCConfigurationList section */ 407 | 84213C161C33E1FA00155AEE /* Build configuration list for PBXProject "MeiTuanWaiMai" */ = { 408 | isa = XCConfigurationList; 409 | buildConfigurations = ( 410 | 84213C301C33E1FA00155AEE /* Debug */, 411 | 84213C311C33E1FA00155AEE /* Release */, 412 | ); 413 | defaultConfigurationIsVisible = 0; 414 | defaultConfigurationName = Release; 415 | }; 416 | 84213C321C33E1FA00155AEE /* Build configuration list for PBXNativeTarget "MeiTuanWaiMai" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | 84213C331C33E1FA00155AEE /* Debug */, 420 | 84213C341C33E1FA00155AEE /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | /* End XCConfigurationList section */ 426 | }; 427 | rootObject = 84213C131C33E1FA00155AEE /* Project object */; 428 | } 429 | -------------------------------------------------------------------------------- /MeiTuanWaiMai.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MeiTuanWaiMai.xcodeproj/project.xcworkspace/xcuserdata/maxin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai.xcodeproj/project.xcworkspace/xcuserdata/maxin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /MeiTuanWaiMai.xcodeproj/xcuserdata/maxin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /MeiTuanWaiMai.xcodeproj/xcuserdata/maxin.xcuserdatad/xcschemes/MeiTuanWaiMai.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /MeiTuanWaiMai.xcodeproj/xcuserdata/maxin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MeiTuanWaiMai.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 84213C1A1C33E1FA00155AEE 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Application/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Application/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Application/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Application/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | - (void)didReceiveMemoryWarning { 23 | [super didReceiveMemoryWarning]; 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/1.imageset/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/1.imageset/1.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/10.imageset/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/10.imageset/10.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/10.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "10.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/2.imageset/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/2.imageset/2.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/3.imageset/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/3.imageset/3.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/4.imageset/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/4.imageset/4.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/5.imageset/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/5.imageset/5.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "5.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/6.imageset/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/6.imageset/6.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/6.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "6.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/7.imageset/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/7.imageset/7.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/7.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "7.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/8.imageset/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/8.imageset/8.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/8.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "8.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/9.imageset/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/9.imageset/9.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/9.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "9.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "add.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/add.imageset/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/add.imageset/add.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/adddetail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "adddetail.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/adddetail.imageset/adddetail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/adddetail.imageset/adddetail.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/gouwuche.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "gouwuche.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/gouwuche.imageset/gouwuche.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/gouwuche.imageset/gouwuche.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/sub.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "sub.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MeiTuanWaiMai/Assets.xcassets/Resource/sub.imageset/sub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxandmin/MeiTuanWaiMai/10cd04b2f3d90a1631e7e10b0d95ae8593b75823/MeiTuanWaiMai/Assets.xcassets/Resource/sub.imageset/sub.png -------------------------------------------------------------------------------- /MeiTuanWaiMai/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Controllers/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OrderModel.h" 11 | #import "ShoppingCartView.h" 12 | #import "ThrowLineTool.h" 13 | 14 | @interface MainViewController : UIViewController 15 | 16 | @property(nonatomic,strong)UITableView *maintable; 17 | //抛物线红点 18 | @property (strong, nonatomic) UIImageView *redView; 19 | //数据源 20 | @property(nonatomic,strong) NSMutableArray *dataArray; 21 | //订单数据 22 | @property (nonatomic,strong) NSMutableArray *ordersArray; 23 | //总数量 24 | @property (nonatomic,assign) NSInteger totalOrders; 25 | 26 | @property (nonatomic,strong) ShoppingCartView *shoppcartview; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Controllers/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | 10 | #import "MainViewController.h" 11 | #import "MainTableViewCell.h" 12 | #import "ViewModel.h" 13 | #import "GoodsListView.h" 14 | @interface MainViewController () 15 | 16 | @end 17 | 18 | @implementation MainViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.dataArray = [NSMutableArray new]; 23 | [ThrowLineTool sharedTool].delegate = self; 24 | [self MainTable]; 25 | [self CustomModel]; 26 | 27 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(UpdatemainUI:) name:@"updateUI" object:nil]; 28 | } 29 | 30 | - (void)didReceiveMemoryWarning { 31 | [super didReceiveMemoryWarning]; 32 | } 33 | 34 | /** 35 | * 抛物线小红点 36 | * 37 | * @return 38 | */ 39 | - (UIImageView *)redView 40 | { 41 | if (!_redView) { 42 | _redView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; 43 | _redView.image = [UIImage imageNamed:@"adddetail"]; 44 | _redView.layer.cornerRadius = 10; 45 | } 46 | return _redView; 47 | } 48 | /** 49 | * 存放用户添加到购物车的商品数组 50 | * 51 | * @return 52 | */ 53 | -(NSMutableArray *)ordersArray 54 | { 55 | if (!_ordersArray) { 56 | _ordersArray = [NSMutableArray new]; 57 | } 58 | return _ordersArray; 59 | } 60 | #pragma mark - 初始化数据 61 | /** 62 | * 当前店铺商品数据 63 | */ 64 | -(void)CustomModel{ 65 | 66 | [ViewModel GetShoppdata:^(NSMutableArray *array){ 67 | self.dataArray = array; 68 | }]; 69 | 70 | } 71 | 72 | #pragma mark - 展示数据的Table 73 | -(void)MainTable{ 74 | self.maintable = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-50)]; 75 | self.maintable.dataSource = self; 76 | self.maintable.delegate = self; 77 | self.maintable.separatorStyle = UITableViewCellSelectionStyleNone; 78 | self.maintable.backgroundColor = [UIColor whiteColor]; 79 | [self.view addSubview: self.maintable ]; 80 | [self.maintable registerNib:[UINib nibWithNibName:@"MainTableViewCell" bundle:nil] forCellReuseIdentifier:@"maincell"]; 81 | 82 | self.shoppcartview = [[ShoppingCartView alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height - 50, CGRectGetWidth(self.view.bounds), 50) inView:self.view]; 83 | [self.view addSubview:self.shoppcartview]; 84 | 85 | 86 | } 87 | 88 | #pragma mark - TableViewDelegate and DataSource 89 | -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 90 | { 91 | return 1; 92 | } 93 | 94 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 95 | { 96 | return [self.dataArray count]; 97 | } 98 | 99 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 100 | { 101 | 102 | return 60; 103 | } 104 | 105 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 106 | { 107 | MainTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"maincell" forIndexPath:indexPath]; 108 | OrderModel *model = [[OrderModel alloc]initWithDictionary:[self.dataArray objectAtIndex:indexPath.row]]; 109 | [cell setmaintablecell:model]; 110 | __weak __typeof(&*cell)weakCell =cell; 111 | __block __typeof(self)bself = self; 112 | cell.plusBlock = ^(NSInteger nCount,BOOL animated) 113 | { 114 | /** 115 | * 给当前选中商品添加一个数量 116 | */ 117 | NSMutableDictionary * dic = self.dataArray[indexPath.row]; 118 | [dic setObject:[NSNumber numberWithInteger:nCount] forKey:@"orderCount"]; 119 | 120 | /** 121 | * 通过坐标转换得到抛物线的起点和终点 122 | */ 123 | CGRect parentRectA = [weakCell convertRect:weakCell.addBtn.frame toView:self.view]; 124 | CGRect parentRectB = [self.shoppcartview convertRect:self.shoppcartview.shoppingCartBtn.frame toView:self.view]; 125 | /** 126 | * 是否执行添加的动画 127 | */ 128 | if (animated) { 129 | [bself.view addSubview:self.redView]; 130 | [[ThrowLineTool sharedTool] throwObject:self.redView from:parentRectA.origin to:parentRectB.origin]; 131 | bself.ordersArray = [ViewModel storeOrders:dic OrderData:self.ordersArray isAdded:YES]; 132 | } else{ 133 | bself.ordersArray = [ViewModel storeOrders:dic OrderData:self.ordersArray isAdded:NO]; 134 | } 135 | 136 | bself.shoppcartview.OrderList.objects = self.ordersArray; 137 | [bself.shoppcartview updateFrame:self.shoppcartview.OrderList]; 138 | [bself.shoppcartview.OrderList.tableView reloadData]; 139 | bself.shoppcartview.badgeValue = [ViewModel CountOthersWithorderData:self.ordersArray]; 140 | double price = [ViewModel GetTotalPrice:bself.ordersArray]; 141 | [bself.shoppcartview setTotalMoney:price]; 142 | 143 | }; 144 | 145 | return cell; 146 | } 147 | 148 | #pragma mark - 设置购物车动画 149 | - (void)animationDidFinish 150 | { 151 | 152 | [self.redView removeFromSuperview]; 153 | [UIView animateWithDuration:0.1 animations:^{ 154 | self.shoppcartview.shoppingCartBtn.transform = CGAffineTransformMakeScale(0.8, 0.8); 155 | } completion:^(BOOL finished) { 156 | [UIView animateWithDuration:0.1 animations:^{ 157 | self.shoppcartview.shoppingCartBtn.transform = CGAffineTransformMakeScale(1, 1); 158 | } completion:^(BOOL finished) { 159 | 160 | }]; 161 | 162 | }]; 163 | } 164 | 165 | #pragma mark - 通知更新 166 | -(void)UpdatemainUI:(NSNotification *)Notification{ 167 | 168 | NSMutableDictionary *dic =[NSMutableDictionary dictionaryWithDictionary: Notification.userInfo]; 169 | //重新计算订单数组。 170 | self.ordersArray = [ViewModel storeOrders:dic[@"update"] OrderData:self.ordersArray isAdded:[dic[@"isAdd"] boolValue]]; 171 | self.shoppcartview.OrderList.objects = self.ordersArray; 172 | //设置高度。 173 | [self.shoppcartview updateFrame:self.shoppcartview.OrderList]; 174 | [self.shoppcartview.OrderList.tableView reloadData]; 175 | //设置数量、价格 176 | self.shoppcartview.badgeValue = [ViewModel CountOthersWithorderData:self.ordersArray]; 177 | double price = [ViewModel GetTotalPrice:self.ordersArray]; 178 | [self.shoppcartview setTotalMoney:price]; 179 | //重新设置数据源 180 | self.dataArray = [ViewModel UpdateArray:self.dataArray atSelectDictionary:dic[@"update"]]; 181 | [self.maintable reloadData]; 182 | 183 | } 184 | 185 | -(void)dealloc{ 186 | [[NSNotificationCenter defaultCenter] removeObserver:self forKeyPath:@"updateUI"]; 187 | } 188 | 189 | 190 | @end 191 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Model.json: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg936\cocoartf1404\cocoasubrtf340 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 6 | 7 | \f0\fs24 \cf0 \{\ 8 | Apart = "0.05";\ 9 | BaseShippingCost = 0;\ 10 | DetailAddress = "\\U5b9c\\U5c71\\U8def1718\\U53f7";\ 11 | EndTime = "20:59";\ 12 | Grade = 4;\ 13 | Id = 94;\ 14 | LogoPath = "http://139.196.168.180:88//advertisement/20151119/c007161f-df01-4e11-8bed-4e687e2d47ed.png";\ 15 | Lon = "121.3961";\ 16 | Name = "\\U5b9c\\U5c71\\U8def\\U5e97";\ 17 | OrderFullAmount = 0;\ 18 | ProductCategoryId = 0;\ 19 | ProductId = 0;\ 20 | ProductName = "";\ 21 | ProductPrice = 0;\ 22 | StarTime = "07:00";\ 23 | lat = "31.17458";\ 24 | \},\ 25 | \{\ 26 | Apart = "12.59";\ 27 | BaseShippingCost = 0;\ 28 | DetailAddress = "\\U6c38\\U6cf0\\U8def630\\U5f0462\\U53f7101\\U5ba4";\ 29 | EndTime = "18:59";\ 30 | Grade = 5;\ 31 | Id = 92;\ 32 | LogoPath = "http://139.196.168.180:88//advertisement/20151119/5e2b0966-da09-42eb-b77b-e4ef31b1d817.png";\ 33 | Lon = "121.52383";\ 34 | Name = "\\U6c38\\U6cf0\\U82b1\\U82d1\\U8d85\\U5e02";\ 35 | OrderFullAmount = 0;\ 36 | ProductCategoryId = 0;\ 37 | ProductId = 0;\ 38 | ProductName = "";\ 39 | ProductPrice = 0;\ 40 | StarTime = "07:00";\ 41 | lat = "31.14529";\ 42 | \},\ 43 | \{\ 44 | Apart = "14.40";\ 45 | BaseShippingCost = 0;\ 46 | DetailAddress = "\\U6c38\\U6cf0\\U8def1821\\U53f7";\ 47 | EndTime = "22:59";\ 48 | Grade = 0;\ 49 | Id = 93;\ 50 | LogoPath = "http://139.196.168.180:88//advertisement/20151119/9ad5e3db-72d0-4b0e-a196-782346964a99.png";\ 51 | Lon = "121.54518";\ 52 | Name = "\\U5149\\U660e\\U4fbf\\U5229\\U5e97";\ 53 | OrderFullAmount = 0;\ 54 | ProductCategoryId = 0;\ 55 | ProductId = 0;\ 56 | ProductName = "";\ 57 | ProductPrice = 0;\ 58 | StarTime = "10:00";\ 59 | lat = "31.15219";\ 60 | \},\ 61 | \{\ 62 | Apart = "16.90";\ 63 | BaseShippingCost = 0;\ 64 | DetailAddress = "\\U79c0\\U6cbf\\U8def619\\U53f7";\ 65 | EndTime = "22:59";\ 66 | Grade = 0;\ 67 | Id = 90;\ 68 | LogoPath = "http://139.196.168.180:88//advertisement/20151119/e923f56f-4bad-4af1-8f1b-618e9545ff01.png";\ 69 | Lon = "121.56932";\ 70 | Name = "\\U798f\\U4e07\\U5bb6\\U4fbf\\U5229\\U5e97";\ 71 | OrderFullAmount = 0;\ 72 | ProductCategoryId = 0;\ 73 | ProductId = 0;\ 74 | ProductName = "";\ 75 | ProductPrice = 0;\ 76 | StarTime = "10:00";\ 77 | lat = "31.14105";\ 78 | \},\ 79 | \{\ 80 | Apart = "17.34";\ 81 | BaseShippingCost = 0;\ 82 | DetailAddress = "\\U5eb7\\U6865\\U8def1118\\U53f7\\Uff08\\U5fa1\\U5c71\\U8def\\U53e3\\Uff09";\ 83 | EndTime = "20:59";\ 84 | Grade = 0;\ 85 | Id = 88;\ 86 | LogoPath = "http://139.196.168.180:88//advertisement/20151119/e1eb1ec2-5793-4881-a4c2-c53f730b5c0c.png";\ 87 | Lon = "121.57698";\ 88 | Name = "\\U7b2c\\U4e03\\U8d2d\\U7269\\U8d85\\U5e02";\ 89 | OrderFullAmount = 0;\ 90 | ProductCategoryId = 0;\ 91 | ProductId = 0;\ 92 | ProductName = "";\ 93 | ProductPrice = 0;\ 94 | StarTime = "08:00";\ 95 | lat = "31.15551";\ 96 | \},\ 97 | \{\ 98 | Apart = "18.54";\ 99 | BaseShippingCost = 0;\ 100 | DetailAddress = "\\U5eb7\\U6865\\U8def1605\\U53f7";\ 101 | EndTime = "21:59";\ 102 | Grade = 0;\ 103 | Id = 89;\ 104 | LogoPath = "http://139.196.168.180:88//advertisement/20151119/333e87a8-4a82-4fe1-91db-41c1c7f7fb52.png";\ 105 | Lon = "121.58986";\ 106 | Name = "\\U65f6\\U4ee3\\U534e\\U8054";\ 107 | OrderFullAmount = 0;\ 108 | ProductCategoryId = 0;\ 109 | ProductId = 0;\ 110 | ProductName = "";\ 111 | ProductPrice = 0;\ 112 | StarTime = "09:00";\ 113 | lat = "31.15678";\ 114 | \},\ 115 | \{\ 116 | Apart = "19.33";\ 117 | BaseShippingCost = 0;\ 118 | DetailAddress = "\\U79c0\\U6d66\\U8def1586\\U53f7";\ 119 | EndTime = "18:59";\ 120 | Grade = 0;\ 121 | Id = 91;\ 122 | LogoPath = "http://139.196.168.180:88//advertisement/20151119/14074930-6f54-483f-be99-eea64be8428d.png";\ 123 | Lon = "121.59394";\ 124 | Name = "\\U60e0\\U5bb6\\U4fbf\\U5229";\ 125 | OrderFullAmount = 0;\ 126 | ProductCategoryId = 0;\ 127 | ProductId = 0;\ 128 | ProductName = "";\ 129 | ProductPrice = 0;\ 130 | StarTime = "08:00";\ 131 | lat = "31.13538";\ 132 | \}} -------------------------------------------------------------------------------- /MeiTuanWaiMai/Models/OrderModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // OrderModel.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OrderModel : NSObject 12 | 13 | @property(nonatomic,copy)NSString *orderid; 14 | @property(nonatomic,copy)NSString *name; 15 | @property(nonatomic,copy)NSString *min_price; 16 | @property(nonatomic,copy)NSString *praise_num; 17 | @property(nonatomic,copy)NSString *picture; 18 | @property(nonatomic,copy)NSString *month_saled; 19 | @property(nonatomic,copy)NSString *orderCount; 20 | -(instancetype)initWithDictionary:(NSDictionary *)dic; 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Models/OrderModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // OrderModel.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import "OrderModel.h" 10 | 11 | @implementation OrderModel 12 | 13 | 14 | -(instancetype)initWithDictionary:(NSDictionary *)dic{ 15 | 16 | if (self = [super init]) { 17 | 18 | [self setValue:dic[@"id"] forKey:@"orderid"]; 19 | [self setValue:dic[@"name"] forKey:@"name"]; 20 | [self setValue:dic[@"min_price"] forKey:@"min_price"]; 21 | [self setValue:dic[@"praise_num"] forKey:@"praise_num"]; 22 | [self setValue:dic[@"picture"] forKey:@"picture"]; 23 | [self setValue:dic[@"month_saled"] forKey:@"month_saled"]; 24 | [self setValue:dic[@"orderCount"] forKey:@"orderCount"]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | #define ScreenHeight [UIScreen mainScreen].bounds.size.height 13 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 14 | 15 | 16 | #endif /* PrefixHeader_pch */ 17 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/ViewModel/ViewModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewModel.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/19. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewModel : NSObject 12 | #pragma mark 初始化 13 | +(void)GetShoppdata:(void(^)(NSMutableArray *array))shopDataBlock; 14 | 15 | #pragma mark - 计算价格 16 | +(double)GetTotalPrice:(NSMutableArray *)dataArray; 17 | 18 | #pragma mark - 计算订单数据 19 | +(NSMutableArray *)storeOrders:(NSMutableDictionary *)dictionary OrderData:(NSMutableArray *)orderArray isAdded:(BOOL)added; 20 | 21 | #pragma mark - 计算数量 22 | +(NSInteger) CountOthersWithorderData:(NSMutableArray *)ordersArray; 23 | 24 | #pragma mark - 更新显示数据 25 | +(NSMutableArray *)UpdateArray:(NSMutableArray *)dataArray atSelectDictionary:(NSMutableDictionary *)dictionary; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/ViewModel/ViewModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewModel.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/19. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import "ViewModel.h" 10 | 11 | @implementation ViewModel 12 | 13 | +(void)GetShoppdata:(void(^)(NSMutableArray *array))shopDataBlock{ 14 | 15 | /** 16 | * 在这个方法里面请求数据,处理回调 17 | */ 18 | 19 | 20 | NSMutableArray *array = [NSMutableArray new]; 21 | 22 | NSDictionary *dic1 = @{@"id": @9323283, 23 | @"name": @"马可波罗意面", 24 | @"min_price": @12.0, 25 | @"praise_num": @20, 26 | @"picture":@"1.png", 27 | @"month_saled":@12}; 28 | 29 | NSDictionary *dic2 = @{@"id": @9323284, 30 | @"name": @"鲜珍焗面", 31 | @"min_price": @28.0, 32 | @"praise_num": @6, 33 | @"picture":@"2.png", 34 | @"month_saled":@34}; 35 | 36 | NSDictionary *dic3 = @{@"id": @9323285, 37 | @"name": @"经典焗面", 38 | @"min_price": @28.0, 39 | @"praise_num": @8, 40 | @"picture":@"3.png", 41 | @"month_saled":@16}; 42 | 43 | NSDictionary *dic4 = @{@"id": @26844943, 44 | @"name": @"摩洛哥烤肉焗饭", 45 | @"min_price": @32.0, 46 | @"praise_num": @1, 47 | @"picture":@"4.png", 48 | @"month_saled":@56}; 49 | 50 | NSDictionary *dic5 = @{@"id": @9323279, 51 | @"name": @"莎莎鸡肉饭", 52 | @"min_price": @29.0, 53 | @"praise_num": @11, 54 | @"picture":@"5.png", 55 | @"month_saled":@11}; 56 | 57 | NSDictionary *dic6 = @{@"id": @9323289, 58 | @"name": @"曼哈顿海鲜巧达汤", 59 | @"min_price": @22.0, 60 | @"praise_num": @2, 61 | @"picture":@"6.png", 62 | @"month_saled":@5}; 63 | 64 | NSDictionary *dic7 = @{@"id": @9323243, 65 | @"name": @"意式香辣12寸传统", 66 | @"min_price": @72.0, 67 | @"praise_num": @0, 68 | @"picture":@"7.png", 69 | @"month_saled":@19}; 70 | 71 | NSDictionary *dic8 = @{@"id": @9323220, 72 | @"name": @"超级棒约翰9寸卷边", 73 | @"min_price": @64.0, 74 | @"praise_num": @28, 75 | @"picture":@"8.png", 76 | @"month_saled":@7}; 77 | 78 | NSDictionary *dic9 = @{@"id": @9323280, 79 | @"name": @"牛肉培根焗饭", 80 | @"min_price": @30.0, 81 | @"praise_num": @48, 82 | @"picture":@"9.png", 83 | @"month_saled":@0}; 84 | 85 | NSDictionary *dic10 = @{@"id": @9323267, 86 | @"name": @"胡椒薯格", 87 | @"min_price": @16.0, 88 | @"praise_num": @9, 89 | @"picture":@"10.png", 90 | @"month_saled":@136}; 91 | 92 | array = [@[[dic1 mutableCopy],[dic2 mutableCopy],[dic3 mutableCopy],[dic4 mutableCopy],[dic5 mutableCopy],[dic6 mutableCopy],[dic7 mutableCopy],[dic8 mutableCopy],[dic9 mutableCopy],[dic10 mutableCopy]] mutableCopy]; 93 | 94 | shopDataBlock(array); 95 | } 96 | 97 | #pragma mark - 计算价格 98 | +(double)GetTotalPrice:(NSMutableArray *)dataArray{ 99 | 100 | double nTotal = 0; 101 | for (NSDictionary *dic in dataArray) { 102 | 103 | if ([dic objectForKey:@"orderCount"] !=nil) { 104 | 105 | nTotal += [[dic objectForKey:@"orderCount"] integerValue] * [[dic objectForKey:@"min_price"] integerValue]; 106 | } 107 | } 108 | return nTotal; 109 | } 110 | 111 | #pragma mark - 计算订单数据 112 | +(NSMutableArray *)storeOrders:(NSMutableDictionary *)dictionary OrderData:(NSMutableArray *)orderArray isAdded:(BOOL)added{ 113 | 114 | 115 | NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:dictionary]; 116 | //增加订单和减少订单 117 | if (added) { 118 | 119 | if (orderArray.count!=0) { 120 | 121 | BOOL flage = YES; 122 | for (NSMutableDictionary *dic in orderArray) { 123 | if (dic[@"id"] == dict[@"id"]){ 124 | 125 | NSInteger count = [dict[@"orderCount"] integerValue]; 126 | [dic setValue:[NSString stringWithFormat:@"%ld",(long)count] forKey:@"orderCount"]; 127 | flage = NO; 128 | break; 129 | } 130 | } 131 | if(flage){ 132 | [orderArray addObject:dict]; 133 | } 134 | 135 | }else{ 136 | 137 | [orderArray addObject:dict]; 138 | } 139 | 140 | }else{ 141 | 142 | for (int i=0; i 10 | 11 | @interface BadgeView : UIView 12 | 13 | -(instancetype)initWithFrame:(CGRect)frame withString:(NSString *)string; 14 | 15 | -(instancetype)initWithFrame:(CGRect)frame withString:(NSString *)string withTextColor:(UIColor *)textColor; 16 | 17 | @property (nonatomic,strong) NSString *badgeValue; 18 | 19 | @property (nonatomic,strong) UIColor *textColor; 20 | @property (nonatomic,strong) UILabel *textLabel; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/BadgeView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BadgeView.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/5. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import "BadgeView.h" 10 | 11 | @implementation BadgeView 12 | 13 | +(BadgeView *)initWithString:(NSString *)string withTextColor:(UIColor *)textColor 14 | { 15 | return [[self alloc] initWithString:string withTextColor:textColor]; 16 | } 17 | 18 | -(instancetype)initWithFrame:(CGRect)frame withString:(NSString *)string 19 | { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | self.backgroundColor = [UIColor redColor]; 23 | self.layer.cornerRadius = frame.size.height /2; 24 | self.textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)]; 25 | self.textLabel.font = [UIFont systemFontOfSize:10.0f]; 26 | self.textLabel.textColor = [UIColor whiteColor]; 27 | self.textLabel.text = string; 28 | self.textLabel.textAlignment = NSTextAlignmentCenter; 29 | [self addSubview:self.textLabel]; 30 | self.badgeValue = string; 31 | } 32 | return self; 33 | } 34 | 35 | -(instancetype)initWithFrame:(CGRect)frame withString:(NSString *)string withTextColor:(UIColor *)textColor 36 | { 37 | return [self initWithFrame:frame withString:string]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/GoodsListView.h: -------------------------------------------------------------------------------- 1 | // 2 | // GoodsListView.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/6. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GoodsListView : UIView 12 | 13 | @property (nonatomic,strong) NSMutableArray *objects; 14 | 15 | @property (nonatomic,strong) UITableView *tableView; 16 | 17 | -(instancetype)initWithFrame:(CGRect)frame withObjects:(NSMutableArray *)objects; 18 | 19 | -(instancetype)initWithFrame:(CGRect)frame withObjects:(NSMutableArray *)objects canReorder:(BOOL)reOrder; 20 | 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/GoodsListView.m: -------------------------------------------------------------------------------- 1 | // 2 | // GoodsListView.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/6. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import "GoodsListView.h" 10 | #import "GoodslistCell.h" 11 | #import "OrderModel.h" 12 | #import "ViewModel.h" 13 | #import "MainViewController.h" 14 | 15 | @implementation GoodsListView 16 | 17 | 18 | -(instancetype)initWithFrame:(CGRect)frame withObjects:(NSMutableArray *)objects{ 19 | 20 | return [self initWithFrame:frame withObjects:objects canReorder:NO]; 21 | } 22 | 23 | -(instancetype)initWithFrame:(CGRect)frame withObjects:(NSMutableArray *)objects canReorder:(BOOL)reOrder{ 24 | 25 | self = [super initWithFrame:frame]; 26 | 27 | if (self) { 28 | 29 | self.objects = [NSMutableArray arrayWithArray:objects]; 30 | [self layoutUI]; 31 | } 32 | return self; 33 | } 34 | 35 | -(void)layoutUI 36 | { 37 | self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.7]; 38 | self.tableView = [[UITableView alloc] initWithFrame:self.bounds]; 39 | self.tableView.bounces = NO; 40 | self.tableView.showsHorizontalScrollIndicator = NO; 41 | self.tableView.showsVerticalScrollIndicator = NO; 42 | self.tableView.backgroundColor = [UIColor clearColor]; 43 | [self addSubview:self.tableView]; 44 | self.tableView.delegate = self; 45 | self.tableView.dataSource = self; 46 | [self.tableView registerNib:[UINib nibWithNibName:@"GoodslistCell" bundle:nil] forCellReuseIdentifier:@"GoodslistCell"]; 47 | 48 | 49 | } 50 | 51 | 52 | #pragma mark - TableViewDelegate 53 | 54 | -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 55 | { 56 | return 1; 57 | } 58 | 59 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 60 | { 61 | return [self.objects count]; 62 | } 63 | 64 | -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 65 | 66 | return 50; 67 | } 68 | 69 | 70 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 71 | 72 | GoodslistCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GoodslistCell" forIndexPath:indexPath]; 73 | OrderModel *model = [[OrderModel alloc]initWithDictionary:[self.objects objectAtIndex:indexPath.row]]; 74 | 75 | [cell ListModel:model]; 76 | cell.operationBlock=^(NSInteger number,BOOL plus){ 77 | 78 | NSMutableDictionary * dic = self.objects[indexPath.row]; 79 | //更新选中订单列表中的数量 80 | [dic setValue:[NSNumber numberWithInteger:number] forKey:@"orderCount"]; 81 | 82 | NSMutableDictionary *notification = [[NSMutableDictionary alloc]init]; 83 | [notification setValue:[NSNumber numberWithBool:plus] forKey:@"isAdd"]; 84 | [notification setValue:dic forKey:@"update"]; 85 | [[NSNotificationCenter defaultCenter] postNotificationName:@"updateUI" object:self userInfo:notification]; 86 | }; 87 | return cell; 88 | 89 | } 90 | 91 | 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/GoodslistCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // GoodslistCell.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/6. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OrderModel.h" 11 | @interface GoodslistCell : UITableViewCell 12 | 13 | @property (strong, nonatomic) IBOutlet UILabel *Namelabel; 14 | 15 | @property (strong, nonatomic) IBOutlet UILabel *priceLabel; 16 | 17 | @property (weak, nonatomic) IBOutlet UILabel *numberLabel; 18 | 19 | @property (weak, nonatomic) IBOutlet UIButton *minus; 20 | 21 | @property (weak, nonatomic) IBOutlet UIButton *plus; 22 | 23 | @property (nonatomic,copy) void (^operationBlock)(NSInteger number,BOOL plus); 24 | 25 | @property (nonatomic,assign) NSInteger id; 26 | 27 | @property (nonatomic,assign) NSInteger number; 28 | 29 | -(void)ListModel:(OrderModel *)model; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/GoodslistCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // GoodslistCell.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/6. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import "GoodslistCell.h" 10 | 11 | @implementation GoodslistCell 12 | 13 | - (void)awakeFromNib { 14 | // Initialization code 15 | } 16 | 17 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 18 | [super setSelected:selected animated:animated]; 19 | 20 | // Configure the view for the selected state 21 | } 22 | 23 | -(void)ListModel:(OrderModel *)model{ 24 | 25 | self.Namelabel.text = [NSString stringWithFormat:@"%@",model.name]; 26 | self.priceLabel.text = [NSString stringWithFormat:@"¥ %.2f",[model.min_price floatValue]]; 27 | self.numberLabel.text = [NSString stringWithFormat:@"%@",model.orderCount]; 28 | } 29 | 30 | - (IBAction)minusclick:(id)sender { 31 | self.number =[self.numberLabel.text intValue]; 32 | self.number -=1; 33 | [self showNumber:self.number]; 34 | self.operationBlock(self.number,NO); 35 | } 36 | 37 | - (IBAction)plusclick:(id)sender { 38 | self.number =[self.numberLabel.text intValue]; 39 | self.number += 1; 40 | [self showNumber:self.number]; 41 | self.operationBlock(self.number,YES); 42 | 43 | } 44 | 45 | -(void)showNumber:(NSUInteger)count 46 | { 47 | self.numberLabel.text = [NSString stringWithFormat:@"%lu",(unsigned long)self.number]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/GoodslistCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 30 | 36 | 46 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/MainTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainTableViewCell.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | #import "OrderModel.h" 12 | 13 | @interface MainTableViewCell : UITableViewCell 14 | 15 | @property (strong, nonatomic) IBOutlet UIImageView *goodsimage; 16 | 17 | @property (strong, nonatomic) IBOutlet UILabel *goodsname; 18 | @property (strong, nonatomic) IBOutlet UILabel *goodsprice; 19 | 20 | @property (strong, nonatomic) IBOutlet UIButton *subBtn; 21 | @property (strong, nonatomic) IBOutlet UIButton *addBtn; 22 | 23 | @property (strong, nonatomic) IBOutlet UILabel *goodsNumber; 24 | 25 | @property (assign, nonatomic) NSInteger orderId; 26 | 27 | @property (assign, nonatomic) NSUInteger number; 28 | 29 | //增加减少订单数量 需不需要动画效果 30 | @property (copy, nonatomic) void (^plusBlock)(NSInteger count,BOOL animated); 31 | 32 | -(void)setmaintablecell:(OrderModel *)model; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/MainTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainTableViewCell.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import "MainTableViewCell.h" 10 | 11 | @implementation MainTableViewCell 12 | 13 | /** 14 | * 重新绘制Cell线 15 | * 16 | */ 17 | -(void)drawRect:(CGRect)rect 18 | { 19 | CGContextRef ctx=UIGraphicsGetCurrentContext(); 20 | 21 | CGContextSetLineWidth(ctx,0.25); 22 | CGContextSetLineCap(ctx, kCGLineCapRound); 23 | CGContextSetStrokeColorWithColor(ctx,[UIColor lightGrayColor].CGColor); 24 | CGContextMoveToPoint(ctx,0,rect.size.height-0.25); 25 | CGContextAddLineToPoint(ctx,rect.size.width,rect.size.height-0.25); 26 | CGContextStrokePath(ctx); 27 | [super drawRect:rect]; 28 | } 29 | 30 | - (void)awakeFromNib { 31 | 32 | self.number = 0; 33 | self.goodsimage.contentMode = UIViewContentModeScaleAspectFill; 34 | self.goodsimage.layer.cornerRadius = 5; 35 | self.goodsimage.layer.masksToBounds = YES; 36 | [self.subBtn setHidden:YES]; 37 | [self.goodsNumber setHidden:YES]; 38 | [self bringSubviewToFront:self.goodsimage]; 39 | 40 | } 41 | 42 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 43 | [super setSelected:selected animated:animated]; 44 | 45 | } 46 | 47 | -(void)setmaintablecell:(OrderModel *)model{ 48 | self.goodsimage.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",model.picture]]; 49 | self.goodsname.text = [NSString stringWithFormat:@"%@",model.name]; 50 | self.goodsprice.text = [NSString stringWithFormat:@"¥ %.2f",[model.min_price floatValue]]; 51 | self.goodsNumber.text = [NSString stringWithFormat:@"%@",model.orderCount]; 52 | if ([model.orderCount intValue] > 0) 53 | { 54 | [self.subBtn setHidden:NO]; 55 | [self.goodsNumber setHidden:NO]; 56 | } 57 | else 58 | { 59 | [self.subBtn setHidden:YES]; 60 | [self.goodsNumber setHidden:YES]; 61 | } 62 | } 63 | 64 | 65 | - (IBAction)subButton:(id)sender { 66 | self.number =[self.goodsNumber.text intValue]; 67 | self.number -=1; 68 | self.plusBlock(self.number,NO); 69 | [self showOrderNumbers:self.number]; 70 | } 71 | 72 | - (IBAction)addButton:(id)sender { 73 | self.number =[self.goodsNumber.text intValue]; 74 | self.number +=1; 75 | self.plusBlock(self.number,YES); 76 | [self showOrderNumbers:self.number]; 77 | 78 | } 79 | 80 | -(void)showOrderNumbers:(NSUInteger)count 81 | { 82 | self.goodsNumber.text = [NSString stringWithFormat:@"%lu",(unsigned long)self.number]; 83 | if (self.number > 0) 84 | { 85 | [self.subBtn setHidden:NO]; 86 | [self.goodsNumber setHidden:NO]; 87 | } 88 | else 89 | { 90 | [self.subBtn setHidden:YES]; 91 | [self.goodsNumber setHidden:YES]; 92 | } 93 | } 94 | 95 | 96 | 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/MainTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 31 | 37 | 50 | 63 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/OverlayView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OverlayView.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/5. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ShoppingCartView; 11 | 12 | @interface OverlayView : UIView 13 | 14 | @property (nonatomic,strong) ShoppingCartView *ShoppingCartView; 15 | @end 16 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/OverlayView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OverlayView.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/5. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import "OverlayView.h" 10 | #import "ShoppingCartView.h" 11 | @implementation OverlayView 12 | 13 | -(instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.6]; 18 | } 19 | return self; 20 | } 21 | 22 | -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 23 | { 24 | UITouch *touch = [touches anyObject]; 25 | UIView *view = touch.view; 26 | 27 | if (view == self) { 28 | [self.ShoppingCartView dismissAnimated:YES]; 29 | } 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/ShoppingCartView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ShoppingCartView.h 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/5. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OverlayView.h" 11 | #import "BadgeView.h" 12 | #import "GoodsListView.h" 13 | 14 | @interface ShoppingCartView : UIView 15 | 16 | @property (nonatomic,strong) BadgeView *badge; 17 | @property (nonatomic,strong) OverlayView *OverlayView;//遮罩图层 18 | @property (nonatomic,strong) GoodsListView *OrderList;//选择的订单列表 19 | @property (strong, nonatomic) UIButton *shoppingCartBtn; 20 | 21 | @property (strong, nonatomic) UILabel *money;//价格 22 | 23 | @property (strong, nonatomic) UIButton *payButton;//选好了 24 | 25 | @property (nonatomic,assign) NSUInteger minFreeMoney;//最低起送价 26 | 27 | @property (strong, nonatomic) UILabel *line; //分割线 28 | 29 | @property (nonatomic,strong) UIView *parentView;//背景图层 30 | 31 | @property (nonatomic,assign) NSInteger nTotal;//总价 32 | 33 | @property (nonatomic,assign) BOOL open; 34 | 35 | @property (nonatomic,assign) NSInteger badgeValue; 36 | 37 | -(instancetype) initWithFrame:(CGRect)frame inView:(UIView *)parentView; 38 | -(void)dismissAnimated:(BOOL) animated; 39 | -(void)setTotalMoney:(NSInteger)nTotal; 40 | -(void)updateFrame:(GoodsListView *)orderListView; 41 | @end 42 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/Views/ShoppingCartView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ShoppingCartView.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 16/1/5. 6 | // Copyright © 2016年 maxin. All rights reserved. 7 | // 8 | 9 | #import "ShoppingCartView.h" 10 | #import "BadgeView.h" 11 | 12 | @implementation ShoppingCartView 13 | 14 | -(instancetype) initWithFrame:(CGRect)frame inView:(UIView *)parentView 15 | { 16 | self = [super initWithFrame:frame]; 17 | if (self) { 18 | self.parentView = parentView; 19 | [self layoutUI]; 20 | } 21 | return self; 22 | } 23 | 24 | -(void)layoutUI{ 25 | 26 | self.minFreeMoney = 20; 27 | 28 | self.line = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 0.5)]; 29 | self.line.layer.borderColor = [UIColor lightGrayColor].CGColor; 30 | self.line.layer.borderWidth = 0.25; 31 | [self addSubview:self.line]; 32 | 33 | //购物金额提示框 34 | self.money = [[UILabel alloc] initWithFrame:CGRectMake(70, 10, self.bounds.size.width-140, 30)]; 35 | [self.money setTextColor:[UIColor grayColor]]; 36 | [self.money setText:@"购物车空空如也~"]; 37 | [self.money setFont:[UIFont systemFontOfSize:13.0]]; 38 | [self addSubview:self.money]; 39 | 40 | 41 | //结账按钮 42 | self.payButton = [UIButton buttonWithType:UIButtonTypeCustom]; 43 | self.payButton.frame = CGRectMake(self.bounds.size.width - 100, 5, 90,35); 44 | [self.payButton addTarget:self action:@selector(payclick:) forControlEvents:UIControlEventTouchUpInside]; 45 | self.payButton.layer.cornerRadius = 5; 46 | self.payButton.titleLabel.font = [UIFont boldSystemFontOfSize:14]; 47 | self.payButton.backgroundColor = [UIColor lightGrayColor]; 48 | [self.payButton setTitle:[NSString stringWithFormat:@"还差¥%ld",(unsigned long)self.minFreeMoney] forState:UIControlStateNormal]; 49 | self.payButton.enabled = NO; 50 | [self addSubview:self.payButton]; 51 | 52 | 53 | //购物车 54 | self.shoppingCartBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 55 | [self.shoppingCartBtn setUserInteractionEnabled:NO]; 56 | [self.shoppingCartBtn setBackgroundImage:[UIImage imageNamed:@"gouwuche"] forState:UIControlStateNormal]; 57 | self.shoppingCartBtn.frame = CGRectMake(10, -10, 50,50); 58 | [self.shoppingCartBtn addTarget:self action:@selector(shoppCartClick:) forControlEvents:UIControlEventTouchUpInside]; 59 | [self addSubview:self.shoppingCartBtn]; 60 | 61 | //小圆点 62 | self.badge = [[BadgeView alloc] initWithFrame:CGRectMake(self.shoppingCartBtn.frame.size.width - 18, 5, 18, 18) withString:nil]; 63 | [self.shoppingCartBtn addSubview:self.badge]; 64 | self.badge.hidden = YES; 65 | 66 | int maxHeight = self.parentView.frame.size.height - 250; 67 | self.OrderList = [[GoodsListView alloc] initWithFrame:CGRectMake(0,self.parentView.bounds.size.height - maxHeight, self.bounds.size.width, maxHeight) withObjects:nil canReorder:YES]; 68 | 69 | self.OverlayView = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-50)]; 70 | self.OverlayView.ShoppingCartView = self; 71 | [self.OverlayView addSubview:self]; 72 | [self.parentView addSubview:self.OverlayView]; 73 | self.OverlayView.alpha = 0.0; 74 | self.open = NO; 75 | } 76 | 77 | 78 | -(void)setBadgeValue:(NSInteger)badgeValue{ 79 | 80 | _badgeValue = badgeValue; 81 | self.badge.textLabel.text = [NSString stringWithFormat:@"%lu",(unsigned long)badgeValue]; 82 | if (badgeValue>0) { 83 | self.badge.hidden = NO; 84 | } 85 | else{ 86 | self.badge.hidden = YES; 87 | } 88 | 89 | } 90 | 91 | 92 | #pragma mark 结算 93 | - (void)payclick:(id)sender { 94 | NSLog(@"%@", self.OrderList.objects); 95 | 96 | } 97 | 98 | #pragma mark 点击购物车 99 | - (void)shoppCartClick:(id)sender { 100 | if (!self.badgeValue>0) { 101 | [self.shoppingCartBtn setUserInteractionEnabled:NO]; 102 | return; 103 | } 104 | [self updateFrame:self.OrderList]; 105 | [self.OverlayView addSubview:self.OrderList]; 106 | 107 | [UIView animateWithDuration:0.5 animations:^{ 108 | CGPoint point = self.shoppingCartBtn.center; 109 | CGPoint labelPoint = self.money.center; 110 | 111 | point.y -= (self.OrderList.frame.size.height + 50); 112 | labelPoint.x -= 60; 113 | self.OverlayView.alpha = 1.0; 114 | 115 | [self.shoppingCartBtn setCenter:point]; 116 | [self.money setCenter:labelPoint]; 117 | } completion:^(BOOL finished) { 118 | 119 | self.open = YES; 120 | }]; 121 | 122 | } 123 | 124 | 125 | #pragma mark 更新ListView 的高度 126 | -(void)updateFrame:(GoodsListView *)orderListView 127 | { 128 | if(orderListView.objects.count ==0){ 129 | [self dismissAnimated:YES]; 130 | return; 131 | } 132 | float height = 0; 133 | height = [orderListView.objects count] * 50; 134 | int maxHeight = self.parentView.frame.size.height - 250; 135 | if (height >= maxHeight) { 136 | height = maxHeight; 137 | } 138 | 139 | float orignY = self.OrderList.frame.origin.y; 140 | 141 | self.OrderList.frame = CGRectMake(self.OrderList.frame.origin.x, self.parentView.bounds.size.height - height - 50, self.OrderList.frame.size.width, height); 142 | float currentY = self.OrderList.frame.origin.y; 143 | 144 | if (self.open) { 145 | [UIView animateWithDuration:0.5 animations:^{ 146 | CGPoint point = self.shoppingCartBtn.center; 147 | point.y -= orignY - currentY; 148 | [self.shoppingCartBtn setCenter:point]; 149 | 150 | } completion:^(BOOL finished) { 151 | 152 | 153 | }]; 154 | } 155 | 156 | } 157 | 158 | #pragma mark - dismiss 159 | -(void)dismissAnimated:(BOOL)animated 160 | { 161 | 162 | [self.shoppingCartBtn bringSubviewToFront:self.OverlayView]; 163 | [UIView animateWithDuration:0.5 animations:^{ 164 | _OverlayView.alpha = 0.0; 165 | self.shoppingCartBtn.frame = CGRectMake(10, -10, 50,50); 166 | self.money.frame = CGRectMake(70, 10, self.bounds.size.width, 30); 167 | 168 | } completion:^(BOOL finished) { 169 | self.open = NO; 170 | }]; 171 | } 172 | 173 | 174 | #pragma mark - 计算价格 175 | -(void)setTotalMoney:(NSInteger)nTotal 176 | { 177 | self.nTotal = nTotal; 178 | NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; 179 | 180 | formatter.numberStyle = kCFNumberFormatterDecimalStyle; 181 | 182 | NSString *amount = [formatter stringFromNumber:[NSNumber numberWithInteger:nTotal]]; 183 | if(self.nTotal > 0) 184 | { 185 | self.money.font = [UIFont systemFontOfSize:20.0f]; 186 | self.money.textColor = [UIColor redColor]; 187 | self.money.text = [NSString stringWithFormat:@"共¥%@",amount]; 188 | NSInteger value = self.minFreeMoney - self.nTotal; 189 | if (value > 0) { 190 | 191 | self.payButton.enabled = NO; 192 | [self.payButton setTitle:[NSString stringWithFormat:@"还差¥%ld",(long)value] forState:UIControlStateNormal]; 193 | [self.payButton setBackgroundColor:[UIColor grayColor]]; 194 | } 195 | else 196 | { 197 | self.payButton.enabled = YES; 198 | [self.payButton setTitle:@"选好了" forState:UIControlStateNormal]; 199 | [self.payButton setBackgroundColor:[UIColor redColor]]; 200 | } 201 | [self.shoppingCartBtn setUserInteractionEnabled:YES]; 202 | } 203 | else 204 | { 205 | [self.money setTextColor:[UIColor grayColor]]; 206 | [self.money setText:@"购物车空空如也~"]; 207 | [self.money setFont:[UIFont systemFontOfSize:13.0]]; 208 | 209 | self.payButton.enabled = NO; 210 | [self.payButton setTitle:[NSString stringWithFormat:@"还差¥%ld",(unsigned long)self.minFreeMoney] forState:UIControlStateNormal]; 211 | [self.payButton setBackgroundColor:[UIColor grayColor]]; 212 | 213 | [self.shoppingCartBtn setUserInteractionEnabled:NO]; 214 | } 215 | 216 | } 217 | 218 | 219 | @end 220 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MeiTuanWaiMai 4 | // 5 | // Created by maxin on 15/12/30. 6 | // Copyright © 2015年 maxin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/tools/ThrowLineTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThrowLineTool.h 3 | // CoreAnimationTest 4 | // 5 | // Created by yh on 15/11/13. 6 | // Copyright © 2015年 yh. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @protocol ThrowLineToolDelegate; 14 | 15 | @interface ThrowLineTool : NSObject 16 | 17 | @property (nonatomic, assign) iddelegate; 18 | @property (nonatomic, retain) UIView *showingView; 19 | 20 | + (ThrowLineTool *)sharedTool; 21 | 22 | /** 23 | * 将某个view或者layer从起点抛到终点 24 | * 25 | * @param obj 被抛的物体 26 | * @param start 起点坐标 27 | * @param end 终点坐标 28 | */ 29 | - (void)throwObject:(UIView *)obj from:(CGPoint)start to:(CGPoint)end; 30 | 31 | @end 32 | 33 | 34 | @protocol ThrowLineToolDelegate 35 | 36 | /** 37 | * 抛物线结束的回调 38 | */ 39 | - (void)animationDidFinish; 40 | 41 | @end 42 | 43 | 44 | -------------------------------------------------------------------------------- /MeiTuanWaiMai/tools/ThrowLineTool.m: -------------------------------------------------------------------------------- 1 | // 2 | // ThrowLineTool.m 3 | // CoreAnimationTest 4 | // 5 | // Created by yh on 15/11/13. 6 | // Copyright © 2015年 yh. All rights reserved. 7 | // 8 | 9 | #import "ThrowLineTool.h" 10 | 11 | static ThrowLineTool *s_sharedInstance = nil; 12 | @implementation ThrowLineTool 13 | 14 | + (ThrowLineTool *)sharedTool 15 | { 16 | if (!s_sharedInstance) { 17 | s_sharedInstance = [[[self class] alloc] init]; 18 | } 19 | return s_sharedInstance; 20 | } 21 | 22 | /** 23 | * 将某个view或者layer从起点抛到终点 24 | * 25 | * @param obj 被抛的物体 26 | * @param start 起点坐标 27 | * @param end 终点坐标 28 | */ 29 | - (void)throwObject:(UIView *)obj from:(CGPoint)start to:(CGPoint)end 30 | { 31 | self.showingView = obj; 32 | UIBezierPath *path= [UIBezierPath bezierPath]; 33 | [path moveToPoint:CGPointMake(start.x, start.y)]; 34 | [path addQuadCurveToPoint:CGPointMake(end.x+25, end.y+25) controlPoint:CGPointMake(start.x - 180, start.y - 200)]; 35 | [self groupAnimation:path]; 36 | } 37 | 38 | 39 | #pragma mark - 组合动画 40 | -(void)groupAnimation:(UIBezierPath *)path 41 | { 42 | CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 43 | animation.path = path.CGPath; 44 | animation.rotationMode = kCAAnimationRotateAuto; 45 | CABasicAnimation *expandAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 46 | expandAnimation.duration = 0.5f; 47 | expandAnimation.fromValue = [NSNumber numberWithFloat:1]; 48 | expandAnimation.toValue = [NSNumber numberWithFloat:1.0f]; 49 | expandAnimation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 50 | 51 | CABasicAnimation *narrowAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; 52 | narrowAnimation.beginTime = 0.5; 53 | narrowAnimation.fromValue = [NSNumber numberWithFloat:1.0f]; 54 | narrowAnimation.duration = 1.5f; 55 | narrowAnimation.toValue = [NSNumber numberWithFloat:1.0f]; 56 | 57 | narrowAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 58 | 59 | CAAnimationGroup *groups = [CAAnimationGroup animation]; 60 | groups.animations = @[animation,expandAnimation,narrowAnimation]; 61 | groups.duration = 0.8f; 62 | groups.removedOnCompletion=NO; 63 | groups.fillMode=kCAFillModeForwards; 64 | groups.delegate = self; 65 | [self.showingView.layer addAnimation:groups forKey:@"group"]; 66 | } 67 | 68 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag 69 | { 70 | if (self.delegate && [self.delegate respondsToSelector:@selector(animationDidFinish)]) { 71 | [self.delegate performSelector:@selector(animationDidFinish) withObject:nil]; 72 | } 73 | self.showingView = nil; 74 | } 75 | 76 | 77 | 78 | 79 | @end 80 | 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MeiTuanWaiMai 2 | --------------------------------------------------------------------------------