Browse Source

卖铺宝 优化我的页面 新增 清除缓存

youke 3 years ago
parent
commit
d996a4bdc0

BIN
upAPP.xcworkspace/xcuserdata/youke.xcuserdatad/UserInterfaceState.xcuserstate


+ 27 - 0
upAPP/main/AddNewFile/Controller/setupVC.m

@@ -12,6 +12,9 @@
 @property (weak, nonatomic) IBOutlet UILabel *versionLbl;
 @property (weak, nonatomic) IBOutlet UIView *secretView;
 @property (weak, nonatomic) IBOutlet UIView *softwareView;
+@property (weak, nonatomic) IBOutlet UIView *cleanRubbishView;
+@property (weak, nonatomic) IBOutlet UILabel *rubbishLbl;
+
 @end
 
 @implementation setupVC
@@ -30,6 +33,18 @@
     [self.navigationView setTitle:@"设置"];
     self.navigationView.titleLabel.textColor=[UIColor blackColor];
     self.view.backgroundColor = [UIColor whiteColor];
+    
+    unsigned long iLength = [[SDImageCache sharedImageCache]getSize]/1024.0;
+    if(iLength > 1024.0)
+    {
+        iLength = iLength/1024.0;
+        NSString *sLength = [NSString stringWithFormat:@"%lu",iLength];
+        _rubbishLbl.text = [sLength stringByAppendingString:@"M"];
+    }else{
+        NSString *sLength = [NSString stringWithFormat:@"%lu",iLength];
+        _rubbishLbl.text = [sLength stringByAppendingString:@"kb"];
+    }
+    
      [self.secretView addTapGestureWithBlock:^{
          LMWebviewController *web = [[LMWebviewController alloc]init];
          web.urlString = @"http://m.youpuglobal.com/privacyAgree?move=android";
@@ -43,6 +58,18 @@
             web.urlString = @"http://m.youpuglobal.com/registerAgree?move=android";
             [self.navigationController pushViewController:web animated:true];
        }];
+    UITapGestureRecognizer *cacheTap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(cacheClick:)];
+    [_cleanRubbishView addGestureRecognizer:cacheTap];
+}
+
+-(void)cacheClick:(UITapGestureRecognizer *)sender{
+    
+      [[SDImageCache sharedImageCache] clearDiskOnCompletion:nil];
+      _rubbishLbl.text = @"0M";
+    
+    [ToastView showToast:@"清理完毕"];
+    
+    
 }
 
 @end

+ 35 - 0
upAPP/main/AddNewFile/Controller/setupVC.xib

@@ -10,6 +10,8 @@
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="setupVC">
             <connections>
+                <outlet property="cleanRubbishView" destination="Smh-aT-Tyl" id="dOa-VV-YMf"/>
+                <outlet property="rubbishLbl" destination="1Ig-vH-Aus" id="vUA-50-1D1"/>
                 <outlet property="secretView" destination="Ayn-Qy-ib4" id="5xB-1F-fYG"/>
                 <outlet property="softwareView" destination="nWj-cF-Bae" id="T3X-lf-HII"/>
                 <outlet property="versionLbl" destination="dIe-BK-SGR" id="rGQ-ql-EBv"/>
@@ -95,6 +97,36 @@
                         <constraint firstAttribute="trailing" secondItem="kFe-2M-BUt" secondAttribute="trailing" constant="18" id="gfu-9f-eAb"/>
                     </constraints>
                 </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Smh-aT-Tyl">
+                    <rect key="frame" x="-12" y="214" width="438" height="50"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="清除缓存" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Pih-C7-W5s">
+                            <rect key="frame" x="27" y="16" width="61.5" height="18"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                            <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="more" translatesAutoresizingMaskIntoConstraints="NO" id="EyM-D8-fe0">
+                            <rect key="frame" x="409" y="19.5" width="11" height="11"/>
+                        </imageView>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="v3.6.0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Ig-vH-Aus">
+                            <rect key="frame" x="363" y="17" width="38" height="16"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    <constraints>
+                        <constraint firstItem="EyM-D8-fe0" firstAttribute="centerY" secondItem="Smh-aT-Tyl" secondAttribute="centerY" id="8Ep-4W-qau"/>
+                        <constraint firstAttribute="trailing" secondItem="EyM-D8-fe0" secondAttribute="trailing" constant="18" id="Ecf-5w-Xcr"/>
+                        <constraint firstItem="Pih-C7-W5s" firstAttribute="centerY" secondItem="Smh-aT-Tyl" secondAttribute="centerY" id="HHI-1y-W2C"/>
+                        <constraint firstAttribute="height" constant="50" id="JFm-5i-CUe"/>
+                        <constraint firstItem="1Ig-vH-Aus" firstAttribute="centerY" secondItem="Pih-C7-W5s" secondAttribute="centerY" id="R5g-7c-6Ch"/>
+                        <constraint firstItem="EyM-D8-fe0" firstAttribute="leading" secondItem="1Ig-vH-Aus" secondAttribute="trailing" constant="8" id="TQv-6n-tNj"/>
+                        <constraint firstItem="Pih-C7-W5s" firstAttribute="leading" secondItem="Smh-aT-Tyl" secondAttribute="leading" constant="27" id="fk3-Wf-oqr"/>
+                    </constraints>
+                </view>
             </subviews>
             <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
             <constraints>
@@ -102,8 +134,11 @@
                 <constraint firstItem="e3n-fs-Oq0" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="2Wn-VP-XdS"/>
                 <constraint firstItem="e3n-fs-Oq0" firstAttribute="trailing" secondItem="Ayn-Qy-ib4" secondAttribute="trailing" id="DgV-H8-Uwo"/>
                 <constraint firstItem="e3n-fs-Oq0" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="45" id="QWe-KJ-MP2"/>
+                <constraint firstItem="Smh-aT-Tyl" firstAttribute="trailing" secondItem="nWj-cF-Bae" secondAttribute="trailing" id="VeH-xJ-KoE"/>
+                <constraint firstItem="Smh-aT-Tyl" firstAttribute="top" secondItem="Ayn-Qy-ib4" secondAttribute="bottom" constant="31" id="dcR-u3-Zcg"/>
                 <constraint firstItem="Ayn-Qy-ib4" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="89" id="gjB-C9-JEd"/>
                 <constraint firstItem="e3n-fs-Oq0" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="-12" id="jML-LU-XJd"/>
+                <constraint firstItem="Smh-aT-Tyl" firstAttribute="leading" secondItem="nWj-cF-Bae" secondAttribute="leading" id="p6o-78-bzN"/>
                 <constraint firstItem="e3n-fs-Oq0" firstAttribute="trailing" secondItem="nWj-cF-Bae" secondAttribute="trailing" id="pNA-XY-iYs"/>
                 <constraint firstItem="e3n-fs-Oq0" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" constant="45" id="wDH-EK-he2"/>
                 <constraint firstItem="e3n-fs-Oq0" firstAttribute="leading" secondItem="nWj-cF-Bae" secondAttribute="leading" id="wV1-4m-4FR"/>

+ 1 - 1
upAPP/main/Me(个人中心)/Controller/NewsViewController.m

@@ -135,7 +135,7 @@
 - (UITableView *)tableView
 {
     if (!_tableView) {
-        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, viewHeight, SCREEN_WIDTH, SCREEN_HEIGHT - viewHeight)];
+        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavigationHeight_N(), SCREEN_WIDTH, SCREEN_HEIGHT - NavigationHeight_N()-TABBAR_HEIGHT)];
         _tableView.dataSource = self;
         _tableView.delegate = self;
         _tableView.backgroundColor = RGBColor(247, 248, 250);