Commit f9e1d840 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

location

parent b43afd88
No preview for this file type
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
A95A97B124D1132A0035A684 /* ZJGuardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A95A97AF24D1132A0035A684 /* ZJGuardCell.xib */; }; A95A97B124D1132A0035A684 /* ZJGuardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A95A97AF24D1132A0035A684 /* ZJGuardCell.xib */; };
A95A97B424D120F20035A684 /* ZJElectricalRemindVC.m in Sources */ = {isa = PBXBuildFile; fileRef = A95A97B324D120F20035A684 /* ZJElectricalRemindVC.m */; }; A95A97B424D120F20035A684 /* ZJElectricalRemindVC.m in Sources */ = {isa = PBXBuildFile; fileRef = A95A97B324D120F20035A684 /* ZJElectricalRemindVC.m */; };
A95A97B824D121140035A684 /* ZJCoulometricRemindCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A95A97B624D121140035A684 /* ZJCoulometricRemindCell.m */; }; A95A97B824D121140035A684 /* ZJCoulometricRemindCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A95A97B624D121140035A684 /* ZJCoulometricRemindCell.m */; };
A95A97B924D121140035A684 /* ZJCoulometricRemindCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A95A97B724D121140035A684 /* ZJCoulometricRemindCell.xib */; };
A95F5C9E248DE272001DB97E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A95F5C9D248DE272001DB97E /* Security.framework */; }; A95F5C9E248DE272001DB97E /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A95F5C9D248DE272001DB97E /* Security.framework */; };
A95F5CBE248F2506001DB97E /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A95F5CBD248F2506001DB97E /* CoreTelephony.framework */; }; A95F5CBE248F2506001DB97E /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A95F5CBD248F2506001DB97E /* CoreTelephony.framework */; };
A95F5CC0248F6D25001DB97E /* libc++.1.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A95F5CBF248F6D25001DB97E /* libc++.1.tbd */; }; A95F5CC0248F6D25001DB97E /* libc++.1.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A95F5CBF248F6D25001DB97E /* libc++.1.tbd */; };
...@@ -977,15 +976,15 @@ ...@@ -977,15 +976,15 @@
children = ( children = (
A9C2B8CF24D039B400010EAE /* ZJBaseCareViewController.h */, A9C2B8CF24D039B400010EAE /* ZJBaseCareViewController.h */,
A9C2B8D724D039B400010EAE /* ZJBaseCareViewController.m */, A9C2B8D724D039B400010EAE /* ZJBaseCareViewController.m */,
A9C2B8D924D039B400010EAE /* ZJCareViewController.h */,
A9C2B8D224D039B400010EAE /* ZJCareViewController.m */,
A9C2B8D324D039B400010EAE /* ZJCareStyle2ViewController.h */, A9C2B8D324D039B400010EAE /* ZJCareStyle2ViewController.h */,
A9C2B8D824D039B400010EAE /* ZJCareStyle2ViewController.m */, A9C2B8D824D039B400010EAE /* ZJCareStyle2ViewController.m */,
A9C2B8D024D039B400010EAE /* ZJJinJiViewController.h */, A9C2B8D024D039B400010EAE /* ZJJinJiViewController.h */,
A9C2B8D624D039B400010EAE /* ZJJinJiViewController.m */,
A9C2B8D524D039B400010EAE /* ZJXiaoXiViewController.h */,
A9C2B8D124D039B400010EAE /* ZJXiaoXiViewController.m */, A9C2B8D124D039B400010EAE /* ZJXiaoXiViewController.m */,
A9C2B8D224D039B400010EAE /* ZJCareViewController.m */,
A9C2B8D424D039B400010EAE /* ZJTianJiaViewController.m */, A9C2B8D424D039B400010EAE /* ZJTianJiaViewController.m */,
A9C2B8D524D039B400010EAE /* ZJXiaoXiViewController.h */,
A9C2B8D624D039B400010EAE /* ZJJinJiViewController.m */,
A9C2B8D924D039B400010EAE /* ZJCareViewController.h */,
A9C2B8DA24D039B400010EAE /* ZJTianJiaViewController.h */, A9C2B8DA24D039B400010EAE /* ZJTianJiaViewController.h */,
); );
path = Controller; path = Controller;
...@@ -1177,11 +1176,11 @@ ...@@ -1177,11 +1176,11 @@
A9C2B94124D039B400010EAE /* ZJLocationRemindFriendSelectView.h */, A9C2B94124D039B400010EAE /* ZJLocationRemindFriendSelectView.h */,
A9C2B94224D039B400010EAE /* ZJLocationAttentionCell.swift */, A9C2B94224D039B400010EAE /* ZJLocationAttentionCell.swift */,
A9C2B94324D039B400010EAE /* ZJLocationAttentionView.swift */, A9C2B94324D039B400010EAE /* ZJLocationAttentionView.swift */,
A9C2B94424D039B400010EAE /* Model */,
A9C2B94724D039B400010EAE /* ZJLocationRemindSelectController.m */, A9C2B94724D039B400010EAE /* ZJLocationRemindSelectController.m */,
A9C2B94824D039B400010EAE /* ZJLocationFindViewCell.m */, A9C2B94824D039B400010EAE /* ZJLocationFindViewCell.m */,
A9C2B94924D039B400010EAE /* ZJLocationFindSearchViewController.m */, A9C2B94924D039B400010EAE /* ZJLocationFindSearchViewController.m */,
A9C2B94A24D039B400010EAE /* ZJLocationAttentionVC.xib */, A9C2B94A24D039B400010EAE /* ZJLocationAttentionVC.xib */,
A9C2B94424D039B400010EAE /* Model */,
); );
path = LocationAttention; path = LocationAttention;
sourceTree = "<group>"; sourceTree = "<group>";
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#import "Dolphins-Swift.h" #import "Dolphins-Swift.h"
#import "ZJReminderMainController.h" #import "ZJReminderMainController.h"
#import "ZJAddReminderController.h" #import "ZJAddReminderController.h"
#import "ZJUserInfoManager.h"
@interface ZJGuardViewController ()<UICollectionViewDelegate, UICollectionViewDataSource> @interface ZJGuardViewController ()<UICollectionViewDelegate, UICollectionViewDataSource>
...@@ -116,7 +117,11 @@ ...@@ -116,7 +117,11 @@
} }
break; break;
case 1:{ case 1:{
if (![ZJUserInfoManager shared].isLogin){
[MBProgressHUD showMessage:@"请先进行登陆"];
return;
}
ZJLocationAttentionVC * vc = [ZJLocationAttentionVC new]; ZJLocationAttentionVC * vc = [ZJLocationAttentionVC new];
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
} }
......
...@@ -12,6 +12,7 @@ class ZJLocationAttentionVC: BaseViewController { ...@@ -12,6 +12,7 @@ class ZJLocationAttentionVC: BaseViewController {
@IBOutlet weak var locationTableView: UITableView! @IBOutlet weak var locationTableView: UITableView!
@IBOutlet weak var maskBgView: UIView! @IBOutlet weak var maskBgView: UIView!
@IBOutlet weak var maskBgView_btn: UIButton!
@IBOutlet weak var headerViewHeight: NSLayoutConstraint? @IBOutlet weak var headerViewHeight: NSLayoutConstraint?
@objc var headerFriendsDataSource: Array<ZJFriendModel>? @objc var headerFriendsDataSource: Array<ZJFriendModel>?
...@@ -36,6 +37,8 @@ class ZJLocationAttentionVC: BaseViewController { ...@@ -36,6 +37,8 @@ class ZJLocationAttentionVC: BaseViewController {
if currentFriendModel != nil { if currentFriendModel != nil {
self.getSingleFriendLocationRemindList(currentFriendModel) self.getSingleFriendLocationRemindList(currentFriendModel)
}else{
getFriendList()
} }
} }
...@@ -54,17 +57,7 @@ class ZJLocationAttentionVC: BaseViewController { ...@@ -54,17 +57,7 @@ class ZJLocationAttentionVC: BaseViewController {
headView.phoneLabel.layer.borderColor = headView.desLab.textColor.cgColor; headView.phoneLabel.layer.borderColor = headView.desLab.textColor.cgColor;
headView.phoneLabel.layer.borderWidth = 1 headView.phoneLabel.layer.borderWidth = 1
headView.phoneLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(choosePerson))) headView.phoneLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(choosePerson)))
if currentFriendModel != nil { headView.desLab.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(choosePerson)))
headView.phoneLabel.text = " "+currentFriendModel.phoneNo
headView.desLab.text = "选择好友"
headView.desLab.font = UIFont.systemFont(ofSize: 13)
headView.desLab.textColor = UIColor.init(red: 102.0/255, green: 102.0/255, blue: 102.0/255, alpha: 1.0);
}else{
headView.phoneLabel.text = " "+"暂无好友"
headView.desLab.text = "去添加"
headView.desLab.font = UIFont.systemFont(ofSize: 17)
headView.desLab.textColor = UIColor.init(red: 96.0/255, green: 149.0/255, blue: 255.0/255, alpha: 1.0);
}
headerBgView.addSubview(headView) headerBgView.addSubview(headView)
headerViewHeight?.constant = headerBgView.frame.maxY headerViewHeight?.constant = headerBgView.frame.maxY
...@@ -75,17 +68,46 @@ class ZJLocationAttentionVC: BaseViewController { ...@@ -75,17 +68,46 @@ class ZJLocationAttentionVC: BaseViewController {
self.locationTableView.delegate = self self.locationTableView.delegate = self
self.locationTableView.dataSource = self self.locationTableView.dataSource = self
// maskBgView.isHidden = currentFriendModel == nil true maskBgView.isHidden = currentFriendModel != nil
addLongPres() addLongPres()
} }
func updataUI(){ func updataUI(){
self.locationTableView.reloadData() self.locationTableView.reloadData()
maskBgView.isHidden = locationRemindDataSource.count != 0 maskBgView.isHidden = currentFriendModel != nil
if currentFriendModel != nil {
headView.phoneLabel.text = " "+currentFriendModel.phoneNo
headView.desLab.text = "选择好友"
headView.desLab.font = UIFont.systemFont(ofSize: 13)
headView.desLab.textColor = UIColor.init(red: 102.0/255, green: 102.0/255, blue: 102.0/255, alpha: 1.0);
maskBgView_btn.isSelected = false
maskBgView_btn.isUserInteractionEnabled = true
}else{
headView.phoneLabel.text = " "+"暂无好友"
headView.desLab.text = "去添加"
headView.desLab.font = UIFont.systemFont(ofSize: 17)
headView.desLab.textColor = UIColor.init(red: 96.0/255, green: 149.0/255, blue: 255.0/255, alpha: 1.0);
maskBgView_btn.isSelected = true
maskBgView_btn.isUserInteractionEnabled = false
}
} }
@objc func choosePerson() { @objc func choosePerson() {
if currentFriendModel == nil {
MobClick.beginEvent("gurad_addfriend_click")
let tianJiaVC = ZJTianJiaViewController();
tianJiaVC.updateFriendListCallBack = {
self.getFriendList()
}
self.navigationController?.pushViewController(tianJiaVC, animated: true);
return
}
hiddenDelete() hiddenDelete()
var dataSource:Array<String> = []; var dataSource:Array<String> = [];
...@@ -97,7 +119,6 @@ class ZJLocationAttentionVC: BaseViewController { ...@@ -97,7 +119,6 @@ class ZJLocationAttentionVC: BaseViewController {
friendSelectView = ZJLocationRemindFriendSelectView(boundView: self.headView, dataSource: dataSource, delegate: self) friendSelectView = ZJLocationRemindFriendSelectView(boundView: self.headView, dataSource: dataSource, delegate: self)
friendSelectView?.show() friendSelectView?.show()
self.headView.button.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi)) self.headView.button.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi))
} }
@IBAction func add_address() { @IBAction func add_address() {
...@@ -181,6 +202,37 @@ class ZJLocationAttentionVC: BaseViewController { ...@@ -181,6 +202,37 @@ class ZJLocationAttentionVC: BaseViewController {
deleteImage.removeFromSuperview() deleteImage.removeFromSuperview()
} }
} }
func getFriendList(){
self.headerFriendsDataSource = []
TQNetworkTools.shared().getWith(findFriendList, parameters: [:], success: { (result) in
let dict = result as! NSDictionary
if(dict["status"] as! NSInteger == 200){
let result = dict["result"] as! Dictionary<String, Any>
let data = result["data"] as! Array<Any>
for dic in data{
let model = ZJFriendModel.init()
model.setValuesForKeys(dic as! [String : Any])
self.headerFriendsDataSource?.append(model);
}
self.currentFriendModel = self.headerFriendsDataSource?.first
self.updataUI()
self.getSingleFriendLocationRemindList(self.currentFriendModel)
}else{
MBProgressHUD.showError(dict["msg"] as? String)
}
}) { (error) in
}
}
} }
extension ZJLocationAttentionVC { extension ZJLocationAttentionVC {
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<outlet property="headerViewHeight" destination="uOU-2f-4Ee" id="6WQ-Xh-JRV"/> <outlet property="headerViewHeight" destination="uOU-2f-4Ee" id="6WQ-Xh-JRV"/>
<outlet property="locationTableView" destination="Ylo-1W-DQo" id="m1N-aM-uwu"/> <outlet property="locationTableView" destination="Ylo-1W-DQo" id="m1N-aM-uwu"/>
<outlet property="maskBgView" destination="jqH-qv-uUS" id="fRy-uE-ul3"/> <outlet property="maskBgView" destination="jqH-qv-uUS" id="fRy-uE-ul3"/>
<outlet property="maskBgView_btn" destination="Uob-FV-s6z" id="Iaz-ZE-7C9"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections> </connections>
</placeholder> </placeholder>
...@@ -45,43 +46,15 @@ ...@@ -45,43 +46,15 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9E9-pW-Lib"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9E9-pW-Lib">
<rect key="frame" x="79.5" y="289" width="255" height="62"/> <rect key="frame" x="77" y="289" width="260.5" height="66"/>
<attributedString key="attributedText"> <attributedString key="attributedText">
<fragment content="设置位置提醒后,您关心的人到达或离"> <fragment content="设置位置提醒后,您关心的人到达或离
开某个位置时,会及时通知您,全方位
了解关心的人的安全动向">
<attributes>
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" size="15" name=".PingFangSC-Regular"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
<fragment content="
">
<attributes> <attributes>
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/> <color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" metaFont="system" size="15"/> <font key="NSFont" metaFont="system" size="15"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/> <paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
</attributes> </attributes>
</fragment> </fragment>
<fragment content="开某个位置时,会及时通知您,全方位">
<attributes>
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" size="15" name=".PingFangSC-Regular"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
<fragment content="
">
<attributes>
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" metaFont="system" size="15"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
<fragment content="了解关心的人的安全动向">
<attributes>
<color key="NSColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" size="15" name=".PingFangSC-Regular"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" lineSpacing="6" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString> </attributedString>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
......
...@@ -10,3 +10,6 @@ ...@@ -10,3 +10,6 @@
#import "ZJFriendModel.h" #import "ZJFriendModel.h"
#import "ZJFriendLocationRemindModel.h" #import "ZJFriendLocationRemindModel.h"
#import "ZJLocationRemindSelectController.h" #import "ZJLocationRemindSelectController.h"
#import "ZJTianJiaViewController.h"
#import <UMCommon/MobClick.h>
#import "ZJFriendModel.h"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment