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

完善更新appUI

parent 4d7a7d0b
{
"images" : [
{
"filename" : "upapptop.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "upapptop@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "upapptop@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -11,6 +11,8 @@ protocol GeliAlertViewDelegate {
func sureGeliAlertViewAction(sender:UIButton)
}
class GeliAlertView: UIView {
@IBOutlet weak var versionLbl: UILabel!
@IBOutlet weak var upAppIconV: UIImageView!
var contentView:UIView!
var delegate: GeliAlertViewDelegate?
@IBOutlet weak var titileLbl: UILabel!
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GeliAlertView" customModule="GeliBusinessPlatform" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GeliAlertView" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="leftBtn" destination="Dyd-7e-8BO" id="zeE-Lz-ROb"/>
<outlet property="rightBtn" destination="PtZ-E6-HsS" id="Emz-2g-FU4"/>
<outlet property="tishiLbl" destination="iMI-qP-BVc" id="zAu-zu-3me"/>
<outlet property="titileLbl" destination="7p8-wL-wRa" id="Qvs-im-IUC"/>
<outlet property="upAppIconV" destination="iga-CE-Dxv" id="fMS-Eb-qv2"/>
<outlet property="versionLbl" destination="6Ht-ZM-hXV" id="ZQX-ER-KBy"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
......@@ -25,10 +28,10 @@
<color key="backgroundColor" name="提示视图背景色"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4ac-ng-NSx" userLabel="tishiView">
<rect key="frame" x="69.666666666666686" y="369" width="275" height="158"/>
<rect key="frame" x="72" y="369" width="270" height="158"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7p8-wL-wRa">
<rect key="frame" x="25" y="25" width="225" height="42"/>
<rect key="frame" x="15" y="25" width="240" height="42"/>
<attributedString key="attributedText">
<fragment content="如忘记密码,请联系后台人员修改密码,请联系:">
<attributes>
......@@ -41,21 +44,21 @@
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xhi-ml-JFj">
<rect key="frame" x="1" y="108" width="273" height="1"/>
<rect key="frame" x="1" y="108" width="268" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="xKu-GJ-32y"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="96c-u2-CE4">
<rect key="frame" x="137" y="109" width="1" height="48"/>
<rect key="frame" x="134.66666666666666" y="109" width="1" height="48"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="4IU-gD-Hxc"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iMI-qP-BVc">
<rect key="frame" x="84.333333333333314" y="77" width="106" height="21"/>
<rect key="frame" x="82" y="77" width="106" height="21"/>
<attributedString key="attributedText">
<fragment content="020-81338860">
<attributes>
......@@ -67,7 +70,7 @@
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Dyd-7e-8BO">
<rect key="frame" x="0.0" y="109" width="137" height="49"/>
<rect key="frame" x="0.0" y="109" width="134.66666666666666" height="49"/>
<color key="tintColor" name="灰色字体颜色"/>
<state key="normal">
<attributedString key="attributedTitle">
......@@ -83,7 +86,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PtZ-E6-HsS">
<rect key="frame" x="138" y="109" width="137" height="49"/>
<rect key="frame" x="135.66666666666663" y="109" width="134.33333333333337" height="49"/>
<state key="normal">
<attributedString key="attributedTitle">
<fragment content="拨打">
......@@ -105,13 +108,13 @@
<constraint firstAttribute="bottom" secondItem="xhi-ml-JFj" secondAttribute="bottom" constant="49" id="2nP-SJ-3dR"/>
<constraint firstItem="Dyd-7e-8BO" firstAttribute="leading" secondItem="4ac-ng-NSx" secondAttribute="leading" id="2qn-nX-ZXk"/>
<constraint firstItem="96c-u2-CE4" firstAttribute="leading" secondItem="Dyd-7e-8BO" secondAttribute="trailing" id="3L1-qU-b4b"/>
<constraint firstItem="7p8-wL-wRa" firstAttribute="leading" secondItem="4ac-ng-NSx" secondAttribute="leading" constant="25" id="4KC-YT-6RC"/>
<constraint firstItem="7p8-wL-wRa" firstAttribute="leading" secondItem="4ac-ng-NSx" secondAttribute="leading" constant="15" id="4KC-YT-6RC"/>
<constraint firstItem="PtZ-E6-HsS" firstAttribute="top" secondItem="xhi-ml-JFj" secondAttribute="bottom" id="694-pb-BId"/>
<constraint firstItem="iMI-qP-BVc" firstAttribute="centerX" secondItem="4ac-ng-NSx" secondAttribute="centerX" id="9Yj-DW-13K"/>
<constraint firstAttribute="bottom" secondItem="96c-u2-CE4" secondAttribute="bottom" constant="1" id="B8H-mF-8hg"/>
<constraint firstItem="PtZ-E6-HsS" firstAttribute="leading" secondItem="96c-u2-CE4" secondAttribute="trailing" id="Hv9-Cf-9yK"/>
<constraint firstItem="Dyd-7e-8BO" firstAttribute="top" secondItem="xhi-ml-JFj" secondAttribute="bottom" id="Nib-ju-5Ol"/>
<constraint firstAttribute="trailing" secondItem="7p8-wL-wRa" secondAttribute="trailing" constant="25" id="RbM-HB-kMs"/>
<constraint firstAttribute="trailing" secondItem="7p8-wL-wRa" secondAttribute="trailing" constant="15" id="RbM-HB-kMs"/>
<constraint firstItem="iMI-qP-BVc" firstAttribute="top" secondItem="7p8-wL-wRa" secondAttribute="bottom" constant="10" id="Rgi-Hp-0bK"/>
<constraint firstAttribute="bottom" secondItem="Dyd-7e-8BO" secondAttribute="bottom" id="UxS-V1-Zvm"/>
<constraint firstItem="7p8-wL-wRa" firstAttribute="centerX" secondItem="4ac-ng-NSx" secondAttribute="centerX" id="VIc-Qc-ihp"/>
......@@ -121,7 +124,7 @@
<constraint firstItem="96c-u2-CE4" firstAttribute="top" secondItem="xhi-ml-JFj" secondAttribute="bottom" id="ivg-2E-diS"/>
<constraint firstAttribute="trailing" secondItem="xhi-ml-JFj" secondAttribute="trailing" constant="1" id="kY1-00-Uv1"/>
<constraint firstItem="7p8-wL-wRa" firstAttribute="top" secondItem="4ac-ng-NSx" secondAttribute="top" constant="25" id="qu8-45-Xoy"/>
<constraint firstAttribute="width" constant="275" id="saF-rE-yPg">
<constraint firstAttribute="width" constant="270" id="saF-rE-yPg">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
......@@ -133,20 +136,38 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="upapptop" translatesAutoresizingMaskIntoConstraints="NO" id="iga-CE-Dxv">
<rect key="frame" x="72" y="237" width="270" height="140"/>
<constraints>
<constraint firstAttribute="height" constant="140" id="5oE-WZ-blx"/>
</constraints>
</imageView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="V1.0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Ht-ZM-hXV">
<rect key="frame" x="102" y="302" width="29.333333333333343" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="a7R-IF-Z00" secondAttribute="trailing" id="1sf-h4-kks"/>
<constraint firstItem="iga-CE-Dxv" firstAttribute="width" secondItem="4ac-ng-NSx" secondAttribute="width" multiplier="0.996364" constant="1" id="GAz-cs-qMA"/>
<constraint firstItem="a7R-IF-Z00" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="PTB-f2-Mnu"/>
<constraint firstItem="4ac-ng-NSx" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="QP4-ne-Lh1"/>
<constraint firstAttribute="bottom" secondItem="a7R-IF-Z00" secondAttribute="bottom" id="XEP-Jo-d39"/>
<constraint firstItem="6Ht-ZM-hXV" firstAttribute="top" secondItem="iga-CE-Dxv" secondAttribute="top" constant="65" id="ajH-AE-crc"/>
<constraint firstItem="4ac-ng-NSx" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="hTm-KA-r61"/>
<constraint firstItem="iga-CE-Dxv" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="mnk-HB-1uY"/>
<constraint firstItem="4ac-ng-NSx" firstAttribute="top" secondItem="iga-CE-Dxv" secondAttribute="bottom" constant="-8" id="mxC-Jc-XxI"/>
<constraint firstItem="a7R-IF-Z00" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="t7C-DT-AP2"/>
<constraint firstItem="6Ht-ZM-hXV" firstAttribute="leading" secondItem="iga-CE-Dxv" secondAttribute="leading" constant="30" id="vW0-n4-HC3"/>
</constraints>
<point key="canvasLocation" x="-155" y="111"/>
<point key="canvasLocation" x="-668" y="125"/>
</view>
</objects>
<resources>
<image name="upapptop" width="249" height="140"/>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -608,10 +608,16 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
if appStoreVersion != oldappStoreVersion as!String {
self.updateStr = json["results"][0]["trackViewUrl"].string!
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.upAppIconV.isHidden = false
alertView.versionLbl.isHidden = false
alertView.versionLbl.text = "V" + json["results"][0]["version"].string!
alertView.delegate = self;
alertView.tishiLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.text = "有新版本可更新"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "去更新"), for: .normal)
alertView.tishiLbl.text = ""
alertView.titileLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.textAlignment = .left
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "立即更新"), for: .normal)
alertView.leftBtn.setAttributedTitle(NSAttributedString(string: "残忍拒绝"), for: .normal)
alertView.rightBtn.tag = 1515684912
alertView.appStoreVersion = appStoreVersion
self.view.window?.addSubview(alertView)
......@@ -619,10 +625,16 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
}else{
self.updateStr = json["results"][0]["trackViewUrl"].string!
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.upAppIconV.isHidden = false
alertView.versionLbl.isHidden = false
alertView.versionLbl.text = "V" + json["results"][0]["version"].string!
alertView.delegate = self;
alertView.tishiLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.text = "有新版本可更新"
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "去更新"), for: .normal)
alertView.tishiLbl.text = ""
alertView.titileLbl.text = json["results"][0]["releaseNotes"].string
alertView.titileLbl.textAlignment = .left
alertView.rightBtn.setAttributedTitle(NSAttributedString(string: "立即更新"), for: .normal)
alertView.leftBtn.setAttributedTitle(NSAttributedString(string: "残忍拒绝"), for: .normal)
alertView.rightBtn.tag = 1515684912
alertView.appStoreVersion = appStoreVersion
self.view.window?.addSubview(alertView)
......@@ -630,6 +642,7 @@ class WorkCViewController: BaseViewController, UITableViewDelegate, UITableViewD
}else{
print("不需要更新哦---")
}
}
}
......
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