Commit f8abf555 authored by 刘俊宏's avatar 刘俊宏

完成个人中心 下午好

parent 0e992714
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import UIKit import UIKit
import Photos import Photos
import Alamofire import Alamofire
import SwiftDate
class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource { class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource {
@IBOutlet weak var shopNameLbl: UILabel! @IBOutlet weak var shopNameLbl: UILabel!
...@@ -26,17 +26,32 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -26,17 +26,32 @@ class PersonCenterViewController: BaseViewController,UITableViewDelegate,UITable
adminInfo(["user_token":UserToken as Any], success: { (data) in adminInfo(["user_token":UserToken as Any], success: { (data) in
self.dataModel = (data as! AdminInfoModel) self.dataModel = (data as! AdminInfoModel)
self.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + (self.dataModel?.data?.shop_img)!), placeholderImage: UIImage.init(named: "个人设置头像")) self.iconImg.sd_setImage(with: URL(string: SERVERCE_ImageHost + (self.dataModel?.data?.shop_img)!), placeholderImage: UIImage.init(named: "个人设置头像"))
//
self.shopNameLbl.text = self.dataModel?.data?.stall_name self.shopNameLbl.text = self.dataModel?.data?.stall_name
self.nameLbl.text = self.dataModel?.data?.admin_name
}) { (error) in }) { (error) in
} }
self.nameLbl.text = self.nowDateStr()
}
func nowDateStr() -> String {
let date = Date() + 8.hours
if date.compare(.isMorning) {
return "Hi~早上好!"
}else if date.compare(.isAfternoon) {
return "Hi~下午好!"
}else if date.compare(.isEvening) {
return "Hi~傍晚好!"
}else if date.compare(.isNight) {
return "Hi~深夜了!"
}
return ""
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
if dataModel == nil { loadData()
loadData()
}
} }
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/> <device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/> <capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="后台管_理app" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fgk-Rc-0oD"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fgk-Rc-0oD">
<rect key="frame" x="100" y="80" width="175" height="17"/> <rect key="frame" x="100" y="80" width="175" height="17"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="17" id="V7v-hK-fZO"/> <constraint firstAttribute="height" constant="17" id="V7v-hK-fZO"/>
...@@ -79,7 +80,7 @@ ...@@ -79,7 +80,7 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<view alpha="0.75" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L5q-yc-640"> <view alpha="0.75" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L5q-yc-640">
<rect key="frame" x="95" y="105" width="80.5" height="17.5"/> <rect key="frame" x="95" y="105" width="10" height="4"/>
<color key="backgroundColor" name="白色背景色"/> <color key="backgroundColor" name="白色背景色"/>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius"> <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
...@@ -87,8 +88,8 @@ ...@@ -87,8 +88,8 @@
</userDefinedRuntimeAttribute> </userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="省冷一区49档" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1dW-Zl-K3m"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1dW-Zl-K3m">
<rect key="frame" x="100" y="107" width="70.5" height="13.5"/> <rect key="frame" x="100" y="107" width="0.0" height="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/> <fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" name="个人中心灰色字体"/> <color key="textColor" name="个人中心灰色字体"/>
......
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