Parcourir la Source

sell flower order

xiaoxi il y a 6 ans
Parent
commit
9fddb81d22

BIN
CAISHEN.xcworkspace/xcuserdata/xiaoxi.xcuserdatad/UserInterfaceState.xcuserstate


+ 21 - 10
CAISHEN/Money/我的/controller/KXMoneyMineViewController.m

@@ -209,17 +209,29 @@
209 209
     switch (indexPath.row) {
210 210
         case 0:
211 211
         {
212
-            KXSFMineOrderViewController *orderVC = [[KXSFMineOrderViewController alloc] init];
213
-            [self.navigationController pushViewController:orderVC animated:YES];
212
+            if ([[KXLoginManager shareInstance] isLogin]) {
213
+                KXSFMineOrderViewController *orderVC = [[KXSFMineOrderViewController alloc] init];
214
+                [self.navigationController pushViewController:orderVC animated:YES];
215
+            } else {
216
+                [self pushToLoginVC];
217
+            }
214 218
         }
215 219
             break;
216 220
         case 1:
217 221
         {
218
-            KXSFAreaViewController *areaVC = [[KXSFAreaViewController alloc] init];
219
-            [self.navigationController pushViewController:areaVC animated:YES];
222
+            if ([[KXLoginManager shareInstance] isLogin]) {
223
+                KXSFAreaViewController *areaVC = [[KXSFAreaViewController alloc] init];
224
+                [self.navigationController pushViewController:areaVC animated:YES];
225
+            } else {
226
+                [self pushToLoginVC];
227
+            }
220 228
         }
221 229
             break;
222 230
         case 2:
231
+        {
232
+            KXAboutUsViewController *aboutVC = [[KXAboutUsViewController alloc] init];
233
+            [self.navigationController pushViewController:aboutVC animated:YES];
234
+        }
223 235
             break;
224 236
         case 3:
225 237
             if ([[KXLoginManager shareInstance] isLogin]) {
@@ -231,18 +243,17 @@
231 243
             break;
232 244
         case 4:
233 245
         {
234
-            KXAboutUsViewController *aboutVC = [[KXAboutUsViewController alloc] init];
235
-            [self.navigationController pushViewController:aboutVC animated:YES];
236
-        }
237
-            break;
238
-        case 5:
239
-        {
240 246
             KXCustomWebViewController *webVC = [[KXCustomWebViewController alloc] init];
241 247
             webVC.webStr = [NSString stringWithFormat:@"http://m.henhaojie.com/agreement-bnd.html?name=%@",[NSString getAppName]];
242 248
             webVC.title = @"隐私政策";
243 249
             [self.navigationController pushViewController:webVC animated:YES];
244 250
         }
245 251
             break;
252
+        case 5:
253
+        {
254
+            
255
+        }
256
+            break;
246 257
         default:
247 258
             break;
248 259
     }

+ 17 - 2
CAISHEN/SellFlowers/Main/controllers/KXSFSubmitOrderViewController.swift

@@ -17,6 +17,7 @@ class KXSFSubmitOrderViewController: KXBaseViewController ,UITableViewDataSource
17 17
     var isSelectAddress = false
18 18
     var goodDetailData : NSMutableArray = NSMutableArray.init()
19 19
     var addressId = ""
20
+    let kSFSaveAreaDataPath = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)[0] + "/SFSaveAreaData.plst"
20 21
     
21 22
     override func viewDidLoad() {
22 23
         super.viewDidLoad()
@@ -42,13 +43,27 @@ class KXSFSubmitOrderViewController: KXBaseViewController ,UITableViewDataSource
42 43
     }
43 44
     
44 45
     lazy var tableView : UITableView = {
45
-        var table : UITableView = UITableView.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT - NavHeight - 50), style: .grouped)
46
+        var table : UITableView = UITableView.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT - NavHeight - 50 - safeBottomHeight), style: .grouped)
46 47
         table.delegate = self
47 48
         table.dataSource = self
48 49
         table.separatorColor = .none
49 50
         table.register(KXSFSubmitTableVIewCell.classForCoder(), forCellReuseIdentifier: otherCellID)
50 51
         table.register(KXSFBuySubmitOrderTableCell.classForCoder(), forCellReuseIdentifier: goodCellID)
51 52
         var headerView : KXSFSubmitTableViewHeader = KXSFSubmitTableViewHeader.init(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH, height: 100))
53
+        let data : NSMutableArray = NSKeyedUnarchiver.unarchiveObject(withFile: kSFSaveAreaDataPath) as? NSMutableArray ?? NSMutableArray.init()
54
+        for model : KXSFMineAreaModel in data as! [KXSFMineAreaModel] {
55
+            if model.isNormal == true{
56
+                headerView.addBtn.removeFromSuperview()
57
+                addressId = model.id!
58
+                isSelectAddress = true
59
+                headerView.nameLabel.isHidden = false
60
+                headerView.addressLabel.isHidden = false
61
+                headerView.arrImage.isHidden = false
62
+                headerView.nameLabel.text = "收货人:" + model.consignee!
63
+                headerView.addressLabel.text = model.address!
64
+                footView.button.backgroundColor = UIColor.base()
65
+            }
66
+        }
52 67
         weak var weakSelf = self
53 68
         headerView.bk_(whenTapped: {
54 69
             let vc : KXSFAreaViewController = KXSFAreaViewController()
@@ -73,7 +88,7 @@ class KXSFSubmitOrderViewController: KXBaseViewController ,UITableViewDataSource
73 88
     }()
74 89
     
75 90
     lazy var footView : KXSFSubmitOrderFootView = {
76
-        var footVIew = KXSFSubmitOrderFootView.init(frame: CGRect(x: 0, y: SCREEN_HEIGHT-50-TabbarHeight-safeBottomHeight, width: SCREEN_WIDTH, height: 50))
91
+        var footVIew = KXSFSubmitOrderFootView.init(frame: CGRect(x: 0, y: SCREEN_HEIGHT-50-NavHeight-safeBottomHeight, width: SCREEN_WIDTH, height: 50))
77 92
         footVIew.backgroundColor = UIColor.white
78 93
         footVIew.delegate = self
79 94
         return footVIew

+ 6 - 0
CAISHEN/SellFlowers/Mine/controllers/KXSFAreaViewController.swift

@@ -88,6 +88,12 @@ extension KXSFAreaViewController{
88 88
         let cell : KXSFMIneAreaTableViewCell = tableView.dequeueReusableCell(withIdentifier: kTableViewCellId) as! KXSFMIneAreaTableViewCell
89 89
         let model : KXSFMineAreaModel = dataSource[indexPath.row] as! KXSFMineAreaModel
90 90
         cell.configTableViewCell(model: model , indexPath: indexPath as NSIndexPath)
91
+        if isOrderPush {
92
+            cell.configHiddenEditLabel(hidden: true)
93
+        } else {
94
+            cell.configHiddenEditLabel(hidden: false)
95
+        }
96
+        
91 97
         return cell
92 98
     }
93 99
     

+ 4 - 0
CAISHEN/SellFlowers/Mine/view/KXSFMineOrderTableViewCell.swift

@@ -95,6 +95,10 @@ class KXSFMIneAreaTableViewCell: UITableViewCell {
95 95
         areaLabel?.text = addModel.area! + addModel.address!
96 96
     }
97 97
     
98
+    func configHiddenEditLabel(hidden: Bool) {
99
+        editLabel?.isHidden = hidden
100
+    }
101
+    
98 102
     required init?(coder aDecoder: NSCoder) {
99 103
         fatalError("init(coder:) has not been implemented")
100 104
     }