From b640da725f85be6b8e220a884115bbf7036fc616 Mon Sep 17 00:00:00 2001 From: 葛建军 <627299690@qq.com> Date: Wed, 11 Apr 2018 17:32:07 +0800 Subject: [PATCH] 家长慧我的孩子页面修改、校园卡激活界面添加。 --- ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj | 4 ++++ ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ActivationSchoolCardViewController.swift | 43 +++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ChildrenDetailViewController.swift | 38 +++++++++++++++++++++++++++++++++++++- ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift | 2 +- 5 files changed, 242 insertions(+), 2 deletions(-) create mode 100644 ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ActivationSchoolCardViewController.swift diff --git a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj index c2b5168..f505f57 100644 --- a/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj +++ b/ParentAssistant/ParentAssistant.xcodeproj/project.pbxproj @@ -106,6 +106,7 @@ BF7A4C85204E338500460463 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF7A4C7F204E338400460463 /* LaunchScreen.storyboard */; }; BF7A4C86204E338500460463 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF7A4C81204E338400460463 /* Main.storyboard */; }; BF7A4C87204E338500460463 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = BF7A4C83204E338400460463 /* Info.plist */; }; + BFA7443A207DB6EE00845D30 /* ActivationSchoolCardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA74439207DB6EE00845D30 /* ActivationSchoolCardViewController.swift */; }; BFBC06C52063AE8900CCFAFF /* ZLaunchAd.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06BB2063AE8800CCFAFF /* ZLaunchAd.swift */; }; BFBC06C62063AE8900CCFAFF /* ZLaunchAdAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06BC2063AE8800CCFAFF /* ZLaunchAdAnimation.swift */; }; BFBC06C72063AE8900CCFAFF /* ZLaunchAdButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBC06BD2063AE8800CCFAFF /* ZLaunchAdButton.swift */; }; @@ -266,6 +267,7 @@ BF7A4C80204E338400460463 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; BF7A4C82204E338400460463 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; BF7A4C83204E338400460463 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BFA74439207DB6EE00845D30 /* ActivationSchoolCardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivationSchoolCardViewController.swift; sourceTree = ""; }; BFBC06BB2063AE8800CCFAFF /* ZLaunchAd.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchAd.swift; sourceTree = ""; }; BFBC06BC2063AE8800CCFAFF /* ZLaunchAdAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchAdAnimation.swift; sourceTree = ""; }; BFBC06BD2063AE8800CCFAFF /* ZLaunchAdButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ZLaunchAdButton.swift; sourceTree = ""; }; @@ -700,6 +702,7 @@ BF406CDB2057C110000A6681 /* OrderDetailViewController.swift */, BFF9B7EC2057776100F39B3E /* MyChildrenViewController.swift */, BFF9B7F52057A4C900F39B3E /* ChildrenDetailViewController.swift */, + BFA74439207DB6EE00845D30 /* ActivationSchoolCardViewController.swift */, BF621CAB205660E90040D2C1 /* My.storyboard */, ); path = Controller; @@ -1039,6 +1042,7 @@ BFBC06CD2063AE8900CCFAFF /* ZLaunchImageView.swift in Sources */, BF406CDC2057C110000A6681 /* OrderDetailViewController.swift in Sources */, BFEAAAC4205257460072FAAF /* LXCalendarMonthModel.m in Sources */, + BFA7443A207DB6EE00845D30 /* ActivationSchoolCardViewController.swift in Sources */, BF38847E205CDE2D00A240EF /* JSViewController.swift in Sources */, ADE33B312062202300BEA6E6 /* Macro.swift in Sources */, ADF159612069E00000A9485D /* CalendarView.swift in Sources */, diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ActivationSchoolCardViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ActivationSchoolCardViewController.swift new file mode 100644 index 0000000..0982f1f --- /dev/null +++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ActivationSchoolCardViewController.swift @@ -0,0 +1,43 @@ +// +// ActivationSchoolCardViewController.swift +// ParentAssistant +// +// Created by 葛建军 on 2018/4/11. +// Copyright © 2018年 HANGZHOUTEAM. All rights reserved. +// + +import UIKit +//校卡激活页面 +class ActivationSchoolCardViewController: UINavigationController { + var info:StudentClassInfo!//孩子信息 + @IBOutlet var nameLabel: UILabel!//孩子姓名 + @IBOutlet var cardNumberTextField: UITextField!//卡号 + override func viewDidLoad() { + super.viewDidLoad() + nameLabel.text = info.studentName + } + // MARK: - 确定按钮 + @IBAction func activationAction(_ sender: UIButton) { + if cardNumberTextField.text == "" { + self.view.makeToast("卡号不能为空") + } + + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destinationViewController. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ChildrenDetailViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ChildrenDetailViewController.swift index c4a7961..2a5aef0 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ChildrenDetailViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/ChildrenDetailViewController.swift @@ -15,7 +15,7 @@ class ChildrenDetailViewController: UIViewController { @IBOutlet var classTextField: UITextField!//班级 @IBOutlet var placeTextField: UITextField!//学校所属地区 @IBOutlet var numberTextField: UITextField!//学生账号 - var info:StudentClassInfo! + var info:StudentClassInfo!//孩子信息 override func viewDidLoad() { super.viewDidLoad() setUpWithInfo() @@ -27,6 +27,42 @@ class ChildrenDetailViewController: UIViewController { placeTextField.text = info.cityName+info.areaName numberTextField.text = info.studentCode } + // MARK: - 校卡激活 + @IBAction func activationSchoolCardAction(_ sender: UIButton) { + let vc = Story.instantiateViewControllerWithIdentifier("ActivationSchoolCardViewController", storyName: "My") as! ActivationSchoolCardViewController + vc.info = info + self.navigationController?.pushViewController(vc, animated: true) + } + // MARK: - 解除绑定 + @IBAction func unbundlingAction(_ sender: UIButton) { + //登录并返回页面 + let alertVC = UIAlertController(title: "提示", message: "是否解除 \(info.studentName) 绑定?", preferredStyle: UIAlertControllerStyle.alert) + let backBtn = UIAlertAction(title: "取消", style: UIAlertActionStyle.default) { (action) in + } + let showBtn = UIAlertAction(title: "确定", style: UIAlertActionStyle.default) { (action) in + self.unbundlingAction() + } + alertVC.addAction(backBtn) + alertVC.addAction(showBtn) + self.present(alertVC, animated: true, completion: nil) + } + func unbundlingAction(){ + SVProgressHUD.show() + HTTPServer.shared.getUnBindStudent(["parentid":info.parentId as AnyObject,"studentid":info.studentId as AnyObject]) { (str, error) in + SVProgressHUD.dismiss() + if error == nil{ + if JSON.fromString(str)!["status"].intValue == 1{ + AccountManager.shared.refreshUserInfo(AccountManager.shared.phone(), completionHandler: { (finish) in + self.navigationController?.popToRootViewController(animated: true) + }) + }else{ + appDelegate.window!.makeToast("解绑孩子失败:\(JSON.fromString(str)!["message"].stringValue)") + } + }else{ + appDelegate.window!.makeToast("解绑孩子失败:\(String(describing: error))") + } + } + } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard index dc49008..8c20141 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard +++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/My.storyboard @@ -1567,6 +1567,44 @@ + + @@ -1576,14 +1614,20 @@ + + + + + + @@ -1602,6 +1646,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift index 27d8576..0a5a0fa 100644 --- a/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift +++ b/ParentAssistant/ParentAssistant/Classes/controllers/my/Controller/MyChildrenViewController.swift @@ -72,7 +72,7 @@ extension MyChildrenViewController:UITableViewDelegate,UITableViewDataSource { } //先要设cell可编辑 func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { - return true + return false } //定义编辑样式 func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCellEditingStyle { -- libgit2 0.21.0