This commit is contained in:
2025-04-30 16:34:02 +08:00
parent dd5cf8ad36
commit 32258f688e
11 changed files with 85 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "pv_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "pv_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -21,7 +21,7 @@
<rect key="frame" x="15" y="0.0" width="290" height="48"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dJI-wp-REe">
<rect key="frame" x="15.000000000000004" y="15" width="37.333333333333343" height="18"/>
<rect key="frame" x="15" y="15" width="260" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
@@ -29,6 +29,7 @@
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="dJI-wp-REe" secondAttribute="trailing" constant="15" id="4tu-cI-LLV"/>
<constraint firstAttribute="bottom" secondItem="dJI-wp-REe" secondAttribute="bottom" constant="15" id="56o-wF-6WX"/>
<constraint firstItem="dJI-wp-REe" firstAttribute="leading" secondItem="APJ-0z-014" secondAttribute="leading" constant="15" id="K7d-Zk-3Xm"/>
<constraint firstItem="dJI-wp-REe" firstAttribute="top" secondItem="APJ-0z-014" secondAttribute="top" constant="15" id="rcr-4D-gn9"/>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -37,6 +37,7 @@
<constraints>
<constraint firstItem="iR3-wu-qoW" firstAttribute="centerX" secondItem="1rb-eT-Nio" secondAttribute="centerX" id="RQZ-fQ-m5a"/>
<constraint firstItem="iR3-wu-qoW" firstAttribute="leading" secondItem="1rb-eT-Nio" secondAttribute="leading" constant="15" id="cJC-Hg-OGF"/>
<constraint firstAttribute="trailing" secondItem="iR3-wu-qoW" secondAttribute="trailing" constant="15" id="g7D-im-mYw"/>
<constraint firstItem="zKK-V0-BdP" firstAttribute="centerX" secondItem="1rb-eT-Nio" secondAttribute="centerX" id="hhT-Cc-pPI"/>
<constraint firstItem="zKK-V0-BdP" firstAttribute="width" secondItem="1rb-eT-Nio" secondAttribute="width" id="k8Y-OO-Lni"/>
<constraint firstItem="iR3-wu-qoW" firstAttribute="top" secondItem="zKK-V0-BdP" secondAttribute="bottom" constant="15" id="mTp-7p-nmt"/>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -27,8 +27,8 @@
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y8C-he-Bhk">
<rect key="frame" x="15" y="43" width="41" height="31"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y8C-he-Bhk">
<rect key="frame" x="15" y="43" width="260" height="31"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="http://">
@@ -43,6 +43,8 @@
<constraint firstItem="y8C-he-Bhk" firstAttribute="leading" secondItem="x4W-IN-GCA" secondAttribute="leading" id="5gE-8Z-avW"/>
<constraint firstItem="x4W-IN-GCA" firstAttribute="leading" secondItem="jXW-hO-rus" secondAttribute="leading" constant="15" id="6Fa-1H-ib8"/>
<constraint firstItem="x4W-IN-GCA" firstAttribute="centerX" secondItem="jXW-hO-rus" secondAttribute="centerX" id="Nba-FX-aT4"/>
<constraint firstAttribute="trailing" secondItem="y8C-he-Bhk" secondAttribute="trailing" constant="15" id="V1o-Ay-ZWP"/>
<constraint firstAttribute="trailing" secondItem="x4W-IN-GCA" secondAttribute="trailing" constant="15" id="hjy-Hp-ODH"/>
<constraint firstItem="y8C-he-Bhk" firstAttribute="top" secondItem="x4W-IN-GCA" secondAttribute="bottom" constant="10" id="ipO-cU-B4V"/>
</constraints>
</view>
@@ -64,7 +66,7 @@
</objects>
<resources>
<systemColor name="linkColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

View File

@@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIButton *arrowBtn;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *widthConstraint;
@property (weak, nonatomic) IBOutlet UIButton *pvLab;
@property (nonatomic, strong) PushRecordList *list;

View File

@@ -39,12 +39,35 @@
self.widthConstraint.constant = width+10;
self.dateLabel.text = self.list.createTime;
self.titleLabel.text = self.list.title;
double minutesDiff = [self minutesDifferenceFromTimeString:self.list.createTime withFormat:@"yyyy-MM-dd HH:mm:ss"];
[self.pvLab setTitle:[NSString stringWithFormat:@" %.0f",1000+minutesDiff] forState:0];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
//
- (double)minutesDifferenceFromTimeString:(NSString *)timeString withFormat:(NSString *)dateFormat {
// 1.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:dateFormat]; // : @"yyyy-MM-dd HH:mm:ss"
// 2. NSDate
NSDate *targetDate = [dateFormatter dateFromString:timeString];
if (!targetDate) {
NSLog(@"时间字符串格式错误!");
return 0;
}
// 3.
NSDate *currentDate = [NSDate date];
// 4.
NSTimeInterval timeInterval = [currentDate timeIntervalSinceDate:targetDate];
// 5.
double minutes = fabs(timeInterval / 60.0);
return minutes;
}
@end

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -59,17 +59,34 @@
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="xaingxia"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="leading" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sKr-SH-pT7">
<rect key="frame" x="15" y="93" width="80" height="20"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="Kiz-f1-Px4"/>
<constraint firstAttribute="height" constant="20" id="fXJ-k1-NjF"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title=" 1000" image="pv_icon">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<constraints>
<constraint firstItem="fYB-eL-33B" firstAttribute="top" secondItem="IqX-dC-Y6b" secondAttribute="bottom" constant="10" id="3dB-7m-zch"/>
<constraint firstAttribute="trailing" secondItem="IqX-dC-Y6b" secondAttribute="trailing" constant="15" id="6Ol-Kh-KWU"/>
<constraint firstItem="5ek-Yw-lmE" firstAttribute="centerY" secondItem="TgL-RB-BCA" secondAttribute="centerY" id="82x-Bc-67k"/>
<constraint firstAttribute="trailing" secondItem="fYB-eL-33B" secondAttribute="trailing" constant="5" id="8KX-ki-Wuk"/>
<constraint firstAttribute="bottom" secondItem="fYB-eL-33B" secondAttribute="bottom" constant="10" id="8o6-GL-OR3"/>
<constraint firstAttribute="trailing" secondItem="dKE-oh-YgT" secondAttribute="trailing" constant="10" id="E9d-F5-psU"/>
<constraint firstItem="IqX-dC-Y6b" firstAttribute="top" secondItem="TgL-RB-BCA" secondAttribute="bottom" constant="10" id="Ppz-5Y-HyX"/>
<constraint firstItem="dKE-oh-YgT" firstAttribute="centerY" secondItem="TgL-RB-BCA" secondAttribute="centerY" id="RsE-7q-n2f"/>
<constraint firstAttribute="bottom" secondItem="sKr-SH-pT7" secondAttribute="bottom" constant="10" id="Ujj-0Q-22o"/>
<constraint firstItem="IqX-dC-Y6b" firstAttribute="centerX" secondItem="3e5-oX-6YU" secondAttribute="centerX" id="Z3K-n4-Izn"/>
<constraint firstItem="IqX-dC-Y6b" firstAttribute="leading" secondItem="TgL-RB-BCA" secondAttribute="leading" id="ape-2Z-rlR"/>
<constraint firstItem="sKr-SH-pT7" firstAttribute="leading" secondItem="3e5-oX-6YU" secondAttribute="leading" constant="15" id="d5I-e9-1Wt"/>
<constraint firstItem="TgL-RB-BCA" firstAttribute="leading" secondItem="3e5-oX-6YU" secondAttribute="leading" constant="15" id="dyL-Yq-flf"/>
<constraint firstItem="TgL-RB-BCA" firstAttribute="top" secondItem="3e5-oX-6YU" secondAttribute="top" constant="15" id="jgl-CI-mBv"/>
<constraint firstItem="5ek-Yw-lmE" firstAttribute="leading" secondItem="TgL-RB-BCA" secondAttribute="trailing" constant="10" id="we3-20-2Rk"/>
@@ -88,6 +105,7 @@
<outlet property="arrowBtn" destination="fYB-eL-33B" id="StK-YE-jDf"/>
<outlet property="dateLabel" destination="dKE-oh-YgT" id="orO-sH-Vsm"/>
<outlet property="mainView" destination="3e5-oX-6YU" id="R7H-UI-cTv"/>
<outlet property="pvLab" destination="sKr-SH-pT7" id="IrT-ap-ll4"/>
<outlet property="titleLabel" destination="IqX-dC-Y6b" id="pIO-2i-W4Z"/>
<outlet property="typeLabel" destination="5ek-Yw-lmE" id="OG2-fm-DiE"/>
<outlet property="widthConstraint" destination="Vlv-qN-mDw" id="bs6-KS-C1v"/>
@@ -96,6 +114,7 @@
</tableViewCell>
</objects>
<resources>
<image name="pv_icon" width="16" height="16"/>
<image name="xaingxia" width="200" height="200"/>
<image name="youxiang" width="200" height="200"/>
</resources>