Commit 87dd31b4 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

bug fix

parent 6f7db351
...@@ -28,6 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -28,6 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
SHUserAccountManager.shared.logCollection(with: .appStart) SHUserAccountManager.shared.logCollection(with: .appStart)
IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.enable = true
IQKeyboardManager.shared.enableAutoToolbar = false
self.window = UIWindow(frame: UIScreen.main.bounds) self.window = UIWindow(frame: UIScreen.main.bounds)
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "设置@2x.png", "filename" : "矩形@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "设置@3x.png", "filename" : "矩形@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "头像 男孩 (1)@2x.png", "filename" : "笔记列表编辑@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "头像 男孩 (1)@3x.png", "filename" : "笔记列表编辑@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="portrait" appearance="light"/> <device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <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"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
...@@ -49,10 +50,10 @@ ...@@ -49,10 +50,10 @@
<rect key="frame" x="0.0" y="510" width="375" height="268"/> <rect key="frame" x="0.0" y="510" width="375" height="268"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7CA-md-1C7"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7CA-md-1C7">
<rect key="frame" x="56" y="34.666666666666636" width="263.33333333333331" height="64.666666666666686"/> <rect key="frame" x="55" y="34.333333333333364" width="265.33333333333331" height="65.333333333333314"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Soc-NE-Z9a"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Soc-NE-Z9a">
<rect key="frame" x="4.0000000000000142" y="3.9999999999999964" width="255.33333333333337" height="56.666666666666657"/> <rect key="frame" x="4" y="4.0000000000000036" width="257.33333333333331" height="57.333333333333343"/>
<color key="backgroundColor" red="0.20784313730000001" green="0.48627450979999998" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.20784313730000001" green="0.48627450979999998" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="width" secondItem="Soc-NE-Z9a" secondAttribute="height" multiplier="247:55" id="lt7-vV-ua9"/> <constraint firstAttribute="width" secondItem="Soc-NE-Z9a" secondAttribute="height" multiplier="247:55" id="lt7-vV-ua9"/>
...@@ -72,13 +73,13 @@ ...@@ -72,13 +73,13 @@
</constraints> </constraints>
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3天免费试用,之后¥498/年,随时取消" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bYQ-iK-LKQ"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3天免费试用,之后¥498/年,随时取消" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bYQ-iK-LKQ">
<rect key="frame" x="63.333333333333329" y="117.33333333333337" width="248.66666666666669" height="17"/> <rect key="frame" x="63.666666666666657" y="117.66666666666663" width="247.99999999999997" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" tag="100" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zdZ-po-8RK"> <button opaque="NO" tag="100" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zdZ-po-8RK">
<rect key="frame" x="56" y="201.66666666666663" width="48" height="25.333333333333343"/> <rect key="frame" x="55" y="201.33333333333337" width="48" height="26.333333333333343"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="48" id="Huy-Ey-M4D"/> <constraint firstAttribute="width" constant="48" id="Huy-Ey-M4D"/>
</constraints> </constraints>
...@@ -87,7 +88,7 @@ ...@@ -87,7 +88,7 @@
<fragment content="隐私政策"> <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" size="12" name=".PingFangSC-Regular"/> <font key="NSFont" metaFont="cellTitle"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/> <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
<integer key="NSUnderline" value="1"/> <integer key="NSUnderline" value="1"/>
</attributes> </attributes>
...@@ -99,13 +100,13 @@ ...@@ -99,13 +100,13 @@
</connections> </connections>
</button> </button>
<button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8CH-Xu-Rvt"> <button opaque="NO" tag="101" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8CH-Xu-Rvt">
<rect key="frame" x="163.66666666666666" y="201.66666666666663" width="48" height="25.333333333333343"/> <rect key="frame" x="162.66666666666666" y="201.33333333333337" width="50" height="26.333333333333343"/>
<state key="normal"> <state key="normal">
<attributedString key="attributedTitle"> <attributedString key="attributedTitle">
<fragment content="恢复购买"> <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" size="12" name=".PingFangSC-Regular"/> <font key="NSFont" metaFont="cellTitle"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/> <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
<integer key="NSUnderline" value="1"/> <integer key="NSUnderline" value="1"/>
</attributes> </attributes>
...@@ -117,13 +118,13 @@ ...@@ -117,13 +118,13 @@
</connections> </connections>
</button> </button>
<button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="97G-xL-vUR"> <button opaque="NO" tag="102" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="97G-xL-vUR">
<rect key="frame" x="271" y="201.66666666666663" width="48.333333333333314" height="25.333333333333343"/> <rect key="frame" x="272" y="201.33333333333337" width="48.333333333333314" height="26.333333333333343"/>
<state key="normal"> <state key="normal">
<attributedString key="attributedTitle"> <attributedString key="attributedTitle">
<fragment content="使用条款"> <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" size="12" name=".PingFangSC-Regular"/> <font key="NSFont" metaFont="cellTitle"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/> <paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
<integer key="NSUnderline" value="1"/> <integer key="NSUnderline" value="1"/>
</attributes> </attributes>
...@@ -135,7 +136,7 @@ ...@@ -135,7 +136,7 @@
</connections> </connections>
</button> </button>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="zdZ-po-8RK" firstAttribute="centerY" secondItem="paw-ud-pJv" secondAttribute="centerY" multiplier="1.6" id="5mv-Ms-Okb"/> <constraint firstItem="zdZ-po-8RK" firstAttribute="centerY" secondItem="paw-ud-pJv" secondAttribute="centerY" multiplier="1.6" id="5mv-Ms-Okb"/>
<constraint firstItem="8CH-Xu-Rvt" firstAttribute="leading" secondItem="zdZ-po-8RK" secondAttribute="trailing" constant="59.666666666666657" id="9x4-zX-RjQ"/> <constraint firstItem="8CH-Xu-Rvt" firstAttribute="leading" secondItem="zdZ-po-8RK" secondAttribute="trailing" constant="59.666666666666657" id="9x4-zX-RjQ"/>
...@@ -191,7 +192,7 @@ ...@@ -191,7 +192,7 @@
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="强大AI支持,准确率高达98%" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YlN-ec-ALx"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="强大AI支持,准确率高达98%" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YlN-ec-ALx">
<rect key="frame" x="30.000000000000014" y="4" width="236.33333333333337" height="21.666666666666668"/> <rect key="frame" x="30.000000000000014" y="4" width="237.66666666666669" height="21.666666666666668"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/> <fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -321,7 +322,7 @@ ...@@ -321,7 +322,7 @@
</constraints> </constraints>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="永久保存到iCloud" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c3N-aa-suO"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="永久保存到iCloud" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c3N-aa-suO">
<rect key="frame" x="30.000000000000014" y="4" width="143.33333333333337" height="21.666666666666668"/> <rect key="frame" x="30" y="4" width="143" height="21.666666666666668"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/> <fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -343,7 +344,8 @@ ...@@ -343,7 +344,8 @@
</constraints> </constraints>
</stackView> </stackView>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <viewLayoutGuide key="safeArea" id="vu7-FC-44s"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="vu7-FC-44s" firstAttribute="trailing" secondItem="paw-ud-pJv" secondAttribute="trailing" id="1FV-EK-IXz"/> <constraint firstItem="vu7-FC-44s" firstAttribute="trailing" secondItem="paw-ud-pJv" secondAttribute="trailing" id="1FV-EK-IXz"/>
<constraint firstItem="vu7-FC-44s" firstAttribute="trailing" secondItem="rdF-tz-yuV" secondAttribute="trailing" constant="10" id="1zJ-h7-e5L"/> <constraint firstItem="vu7-FC-44s" firstAttribute="trailing" secondItem="rdF-tz-yuV" secondAttribute="trailing" constant="10" id="1zJ-h7-e5L"/>
...@@ -362,7 +364,6 @@ ...@@ -362,7 +364,6 @@
<constraint firstItem="rdF-tz-yuV" firstAttribute="top" secondItem="vu7-FC-44s" secondAttribute="top" id="sTT-lR-Cih"/> <constraint firstItem="rdF-tz-yuV" firstAttribute="top" secondItem="vu7-FC-44s" secondAttribute="top" id="sTT-lR-Cih"/>
<constraint firstItem="Da1-ng-YHc" firstAttribute="centerY" secondItem="iye-Iu-Z0h" secondAttribute="centerY" multiplier="1.3" id="tAp-1A-Ixr"/> <constraint firstItem="Da1-ng-YHc" firstAttribute="centerY" secondItem="iye-Iu-Z0h" secondAttribute="centerY" multiplier="1.3" id="tAp-1A-Ixr"/>
</constraints> </constraints>
<viewLayoutGuide key="safeArea" id="vu7-FC-44s"/>
</view> </view>
<connections> <connections>
<outlet property="bgImvConstaint" destination="P6H-DC-o9o" id="xdP-K4-4SM"/> <outlet property="bgImvConstaint" destination="P6H-DC-o9o" id="xdP-K4-4SM"/>
...@@ -380,5 +381,8 @@ ...@@ -380,5 +381,8 @@
<image name="goods_bg" width="375" height="510"/> <image name="goods_bg" width="375" height="510"/>
<image name="goods_cancel" width="20" height="20"/> <image name="goods_cancel" width="20" height="20"/>
<image name="goods_check" width="20" height="20"/> <image name="goods_check" width="20" height="20"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources> </resources>
</document> </document>
...@@ -50,9 +50,13 @@ class SHGoodsViewController: SHBaseViewController { ...@@ -50,9 +50,13 @@ class SHGoodsViewController: SHBaseViewController {
yearStoreBtnBgView.layer.cornerRadius = yearStoreBtnBgView.frame.size.height/2 yearStoreBtnBgView.layer.cornerRadius = yearStoreBtnBgView.frame.size.height/2
yearStoreBtn.layer.cornerRadius = yearStoreBtn.frame.size.height/2 yearStoreBtn.layer.cornerRadius = yearStoreBtn.frame.size.height/2
yearStoreBtn.setTitle(SHUserAccountManager.shared.autoButtonText, for: .normal) if SHUserAccountManager.shared.autoButtonText.length != 0 {
yearStoreLab.text = SHUserAccountManager.shared.threeDayText yearStoreBtn.setTitle(SHUserAccountManager.shared.autoButtonText, for: .normal)
}
if SHUserAccountManager.shared.threeDayText.length != 0 {
yearStoreLab.text = SHUserAccountManager.shared.threeDayText
}
let animation = CABasicAnimation.init() let animation = CABasicAnimation.init()
animation.duration = 0.66 animation.duration = 0.66
animation.beginTime = 0 animation.beginTime = 0
......
...@@ -36,9 +36,11 @@ ...@@ -36,9 +36,11 @@
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pga-Oe-RdW"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pga-Oe-RdW">
<rect key="frame" x="310.5" y="46.5" width="58" height="29"/> <rect key="frame" x="268.5" y="43" width="100" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="立即解锁"/> <state key="normal" title="立即解锁" backgroundImage="mine_goods_btn_bg">
<color key="titleColor" red="0.17254901960784313" green="0.17254901960784313" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button> </button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="解除限制,使用速记大师高级版" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jRc-7Y-1Ab"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="解除限制,使用速记大师高级版" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jRc-7Y-1Ab">
<rect key="frame" x="45.5" y="64.5" width="200" height="17"/> <rect key="frame" x="45.5" y="64.5" width="200" height="17"/>
...@@ -292,6 +294,7 @@ ...@@ -292,6 +294,7 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="mine_goods_btn_bg" width="100" height="36"/>
<image name="mine_top_bg" width="335" height="100"/> <image name="mine_top_bg" width="335" height="100"/>
<systemColor name="systemBackgroundColor"> <systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......
...@@ -36,8 +36,6 @@ class SHMineViewController: SHBaseViewController { ...@@ -36,8 +36,6 @@ class SHMineViewController: SHBaseViewController {
self.navigationItem.title = "我的" self.navigationItem.title = "我的"
// self.navigationItem.rightBarButtonItem = UIBarButtonItem.init(image: UIImage.init(named: "mine_setting"), style: .plain, target: self, action: #selector(setting))
tableHeaderView.frame = CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH, height: 118*kAutoWidth) tableHeaderView.frame = CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH, height: 118*kAutoWidth)
tableView.tableHeaderView = tableHeaderView tableView.tableHeaderView = tableHeaderView
tableView.tableFooterView = UIView.init() tableView.tableFooterView = UIView.init()
......
...@@ -104,8 +104,105 @@ ...@@ -104,8 +104,105 @@
<rect key="frame" x="0.0" y="100" width="414" height="678"/> <rect key="frame" x="0.0" y="100" width="414" height="678"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="SHRecordDetailsCell" rowHeight="230" id="FuP-dQ-RqL" customClass="SHRecordDetailsCell" customModule="速记大师" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="414" height="230"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="FuP-dQ-RqL" id="klG-KN-TVi">
<rect key="frame" x="0.0" y="0.0" width="414" height="230"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gUb-Id-PRL">
<rect key="frame" x="50" y="5" width="344" height="220"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AEn-sK-b1J">
<rect key="frame" x="18" y="18" width="44" height="21.5"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" red="0.0" green="0.074509803920000006" blue="0.23921568630000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cNh-iW-ZMM">
<rect key="frame" x="18" y="80.5" width="309" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="recordDetails_voice" translatesAutoresizingMaskIntoConstraints="NO" id="ERh-59-xML">
<rect key="frame" x="18" y="107.5" width="16" height="16"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oyF-JM-3zi">
<rect key="frame" x="39" y="107" width="36" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.58431372550000005" green="0.62745098040000002" blue="0.72156862749999995" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vl0-Nu-rDx">
<rect key="frame" x="18" y="49.5" width="36" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.58431372550000005" green="0.62745098040000002" blue="0.72156862749999995" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xQ0-xq-IV7">
<rect key="frame" x="296" y="100.5" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="Uao-zm-8yN"/>
<constraint firstAttribute="height" constant="30" id="hPD-1F-ZsN"/>
</constraints>
<state key="normal" image="recordDetails_icloud"/>
<state key="selected" image="recordDetails_icloud_selected"/>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="oyF-JM-3zi" firstAttribute="centerY" secondItem="ERh-59-xML" secondAttribute="centerY" id="05H-3q-1nA"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="AEn-sK-b1J" secondAttribute="trailing" constant="17" id="22e-iI-u93"/>
<constraint firstItem="oyF-JM-3zi" firstAttribute="leading" secondItem="ERh-59-xML" secondAttribute="trailing" constant="5" id="P3A-75-ldz"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="ERh-59-xML" secondAttribute="bottom" constant="10" id="S07-iA-hSp"/>
<constraint firstItem="AEn-sK-b1J" firstAttribute="top" secondItem="gUb-Id-PRL" secondAttribute="top" constant="18" id="Yt8-RS-W09"/>
<constraint firstItem="xQ0-xq-IV7" firstAttribute="centerY" secondItem="oyF-JM-3zi" secondAttribute="centerY" id="YvC-PY-wPA"/>
<constraint firstItem="Vl0-Nu-rDx" firstAttribute="top" secondItem="AEn-sK-b1J" secondAttribute="bottom" constant="10" id="d0q-1V-4Rm"/>
<constraint firstItem="AEn-sK-b1J" firstAttribute="leading" secondItem="gUb-Id-PRL" secondAttribute="leading" constant="18" id="e5b-Kl-eug"/>
<constraint firstAttribute="trailing" secondItem="cNh-iW-ZMM" secondAttribute="trailing" constant="17" id="hiS-EU-ac8"/>
<constraint firstItem="cNh-iW-ZMM" firstAttribute="leading" secondItem="AEn-sK-b1J" secondAttribute="leading" id="kEu-HK-jKa"/>
<constraint firstAttribute="trailing" secondItem="xQ0-xq-IV7" secondAttribute="trailing" constant="18" id="lpN-OU-eBz"/>
<constraint firstItem="ERh-59-xML" firstAttribute="top" secondItem="cNh-iW-ZMM" secondAttribute="bottom" constant="10" id="tud-Zh-0Et"/>
<constraint firstItem="cNh-iW-ZMM" firstAttribute="top" secondItem="Vl0-Nu-rDx" secondAttribute="bottom" constant="14" id="vPT-Td-plj"/>
<constraint firstItem="ERh-59-xML" firstAttribute="leading" secondItem="AEn-sK-b1J" secondAttribute="leading" id="yR0-Vr-Vx9"/>
<constraint firstItem="Vl0-Nu-rDx" firstAttribute="leading" secondItem="AEn-sK-b1J" secondAttribute="leading" id="ypp-04-pMb"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="U72-QE-Wb0">
<rect key="frame" x="10" y="95" width="40" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="Tma-xD-IU1"/>
<constraint firstAttribute="height" constant="40" id="fmK-mh-HV7"/>
</constraints>
<state key="normal" image="recordDetails_select"/>
<state key="selected" image="recordDetails_selected"/>
</button>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="gUb-Id-PRL" secondAttribute="trailing" constant="20" id="36L-ZE-0od"/>
<constraint firstAttribute="bottom" secondItem="gUb-Id-PRL" secondAttribute="bottom" constant="5" id="VSt-Rp-NNA"/>
<constraint firstItem="U72-QE-Wb0" firstAttribute="leading" secondItem="klG-KN-TVi" secondAttribute="leading" constant="10" id="W5k-JY-cn3"/>
<constraint firstItem="U72-QE-Wb0" firstAttribute="centerY" secondItem="klG-KN-TVi" secondAttribute="centerY" id="WZJ-q5-h8Y"/>
<constraint firstItem="gUb-Id-PRL" firstAttribute="leading" secondItem="U72-QE-Wb0" secondAttribute="trailing" id="ibu-KE-cvF"/>
<constraint firstItem="gUb-Id-PRL" firstAttribute="top" secondItem="klG-KN-TVi" secondAttribute="top" constant="5" id="o5W-ix-83K"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="bgView" destination="gUb-Id-PRL" id="KKn-It-jxk"/>
<outlet property="duringLab" destination="oyF-JM-3zi" id="bun-jQ-9l1"/>
<outlet property="icloudBtn" destination="xQ0-xq-IV7" id="Q0y-TB-a1B"/>
<outlet property="intervalConstraint" destination="Tma-xD-IU1" id="bac-yZ-98J"/>
<outlet property="leftConstraint" destination="W5k-JY-cn3" id="k3v-Ez-efp"/>
<outlet property="selectedBtn" destination="U72-QE-Wb0" id="yXK-Gx-OYA"/>
<outlet property="timeLab" destination="Vl0-Nu-rDx" id="V6d-Av-NkK"/>
<outlet property="titleName" destination="AEn-sK-b1J" id="Sv4-Hg-dvW"/>
<outlet property="txtLab" destination="cNh-iW-ZMM" id="7RW-La-yA1"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="SHRecordListCell" rowHeight="95" id="Y8c-0f-L8I" customClass="SHRecordListCell" customModule="速记大师" customModuleProvider="target"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="SHRecordListCell" rowHeight="95" id="Y8c-0f-L8I" customClass="SHRecordListCell" customModule="速记大师" customModuleProvider="target">
<rect key="frame" x="0.0" y="28" width="414" height="95"/> <rect key="frame" x="0.0" y="258" width="414" height="95"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Y8c-0f-L8I" id="7W5-bl-5Kb"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Y8c-0f-L8I" id="7W5-bl-5Kb">
<rect key="frame" x="0.0" y="0.0" width="414" height="95"/> <rect key="frame" x="0.0" y="0.0" width="414" height="95"/>
...@@ -168,7 +265,7 @@ ...@@ -168,7 +265,7 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d2Q-zE-Eh0"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d2Q-zE-Eh0">
<rect key="frame" x="70" y="42" width="274" height="24"/> <rect key="frame" x="70" y="42" width="274" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title=" 去除广告和限制,使用高级版速大师 " backgroundImage="record_bottom_advert"/> <state key="normal" title=" 去除广告和限制,使用高级版速大师 " backgroundImage="record_bottom_advert"/>
<connections> <connections>
<action selector="advertBtnClick" destination="wHB-ed-c6Y" eventType="touchUpInside" id="NIZ-3J-ggE"/> <action selector="advertBtnClick" destination="wHB-ed-c6Y" eventType="touchUpInside" id="NIZ-3J-ggE"/>
</connections> </connections>
...@@ -514,9 +611,20 @@ ...@@ -514,9 +611,20 @@
</view> </view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="maK-EO-jzl"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="maK-EO-jzl">
<rect key="frame" x="0.0" y="0.0" width="414" height="60"/> <rect key="frame" x="0.0" y="0.0" width="414" height="60"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="recordDetails_bottom_mask" translatesAutoresizingMaskIntoConstraints="NO" id="5pT-bZ-rta">
<rect key="frame" x="0.0" y="-8" width="414" height="8"/>
<constraints>
<constraint firstAttribute="height" constant="8" id="8BV-im-gLG"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints> <constraints>
<constraint firstItem="5pT-bZ-rta" firstAttribute="bottom" secondItem="maK-EO-jzl" secondAttribute="top" id="O4T-A6-3Dn"/>
<constraint firstItem="5pT-bZ-rta" firstAttribute="leading" secondItem="maK-EO-jzl" secondAttribute="leading" id="UEd-VE-ws4"/>
<constraint firstAttribute="height" constant="60" id="Y5S-Yj-Prn"/> <constraint firstAttribute="height" constant="60" id="Y5S-Yj-Prn"/>
<constraint firstAttribute="trailing" secondItem="5pT-bZ-rta" secondAttribute="trailing" id="rlJ-gx-ydD"/>
</constraints> </constraints>
</view> </view>
</subviews> </subviews>
...@@ -689,6 +797,7 @@ ...@@ -689,6 +797,7 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="recordDetails_bottom_mask" width="375" height="8"/>
<image name="recordDetails_icloud" width="16" height="16"/> <image name="recordDetails_icloud" width="16" height="16"/>
<image name="recordDetails_icloud_selected" width="16" height="16"/> <image name="recordDetails_icloud_selected" width="16" height="16"/>
<image name="recordDetails_select" width="20" height="20"/> <image name="recordDetails_select" width="20" height="20"/>
......
...@@ -335,7 +335,7 @@ extension SHRecordDetailsVC { ...@@ -335,7 +335,7 @@ extension SHRecordDetailsVC {
} }
}else{ }else{
UIView.animate(withDuration: 0.25) { UIView.animate(withDuration: 0.25) {
self.bottomHeightConstraint?.constant = 120 self.bottomHeightConstraint?.constant = 128
self.view.layoutIfNeeded() self.view.layoutIfNeeded()
} }
} }
...@@ -344,6 +344,12 @@ extension SHRecordDetailsVC { ...@@ -344,6 +344,12 @@ extension SHRecordDetailsVC {
@IBAction func markAlertBtnClick(_ sender:UIButton){ @IBAction func markAlertBtnClick(_ sender:UIButton){
self.markAlertViewShow(false) self.markAlertViewShow(false)
bottomView?.cancel = true bottomView?.cancel = true
if SHUserAccountManager.shared.isMember == false && self.currentModel.dataSources.count > 0{
self.goGoods("home_record")
return
}
switch sender.tag { switch sender.tag {
case 200: case 200:
let input = SHInputController.init() let input = SHInputController.init()
...@@ -423,6 +429,5 @@ extension SHRecordDetailsVC: UITableViewDelegate, UITableViewDataSource{ ...@@ -423,6 +429,5 @@ extension SHRecordDetailsVC: UITableViewDelegate, UITableViewDataSource{
self.currentModel = model self.currentModel = model
self.updateocloudUI() self.updateocloudUI()
} }
} }
} }
...@@ -23,9 +23,10 @@ class SHRecordListViewController: SHBaseViewController { ...@@ -23,9 +23,10 @@ class SHRecordListViewController: SHBaseViewController {
let keyValueStore = NSUbiquitousKeyValueStore.default let keyValueStore = NSUbiquitousKeyValueStore.default
var dataSources: Array<SHRecordFolderModel> = [] var dataSources: Array<SHRecordFolderModel> = []
var searchDataSource: Array<SHRecordFolderModel> = [] var searchDataSource: Array<Array<AnyObject>> = []
var topDataSources: Array<SHRecordFolderModel> = [] var topDataSources: Array<SHRecordFolderModel> = []
var recordsDataSource: Array<SHRecordModel> = []
var searchView: UISearchBar! var searchView: UISearchBar!
lazy var searchBarVC: UISearchController = { lazy var searchBarVC: UISearchController = {
let searchBarVC = UISearchController.init(searchResultsController: nil) let searchBarVC = UISearchController.init(searchResultsController: nil)
...@@ -46,6 +47,8 @@ class SHRecordListViewController: SHBaseViewController { ...@@ -46,6 +47,8 @@ class SHRecordListViewController: SHBaseViewController {
super.viewDidAppear(animated) super.viewDidAppear(animated)
prepareDateSource() prepareDateSource()
self.tableView?.reloadData() self.tableView?.reloadData()
advertBtn?.isHidden = SHUserAccountManager.shared.isMember
} }
override func viewDidDisappear(_ animated: Bool) { override func viewDidDisappear(_ animated: Bool) {
...@@ -105,6 +108,10 @@ class SHRecordListViewController: SHBaseViewController { ...@@ -105,6 +108,10 @@ class SHRecordListViewController: SHBaseViewController {
self.tableHeaderView?.addSubview(searchView) self.tableHeaderView?.addSubview(searchView)
tableView?.tableFooterView = UIView.init() tableView?.tableFooterView = UIView.init()
tableView?.estimatedRowHeight = 44
tableView?.rowHeight = UITableView.automaticDimension
// tableView?.separatorStyle = .none
} }
func prepareDateSource(){ func prepareDateSource(){
...@@ -176,6 +183,13 @@ class SHRecordListViewController: SHBaseViewController { ...@@ -176,6 +183,13 @@ class SHRecordListViewController: SHBaseViewController {
dataSources = topDataSources+dataSources dataSources = topDataSources+dataSources
recordsDataSource = []
for folder in dataSources{
for model in folder.dataSources{
recordsDataSource.append(model)
}
}
tableView?.reloadData() tableView?.reloadData()
maskHintLab?.text = "点击上面右上角添加笔记本" maskHintLab?.text = "点击上面右上角添加笔记本"
...@@ -195,6 +209,12 @@ class SHRecordListViewController: SHBaseViewController { ...@@ -195,6 +209,12 @@ class SHRecordListViewController: SHBaseViewController {
} }
@objc func userCilck(){ @objc func userCilck(){
if SHUserAccountManager.shared.isMember == false && self.dataSources.count > 0{
self.goGoods("home_record")
return
}
addModel() addModel()
} }
...@@ -207,7 +227,10 @@ class SHRecordListViewController: SHBaseViewController { ...@@ -207,7 +227,10 @@ class SHRecordListViewController: SHBaseViewController {
} }
@IBAction func advertBtnClick(){ @IBAction func advertBtnClick(){
if SHUserAccountManager.shared.isMember == false{
self.goGoods("home_record")
return
}
} }
@IBAction func goRecord(){ @IBAction func goRecord(){
...@@ -402,39 +425,128 @@ extension SHRecordListViewController { ...@@ -402,39 +425,128 @@ extension SHRecordListViewController {
//MARK: tableView delegate //MARK: tableView delegate
extension SHRecordListViewController: UITableViewDelegate, UITableViewDataSource{ extension SHRecordListViewController: UITableViewDelegate, UITableViewDataSource{
func numberOfSections(in tableView: UITableView) -> Int {
if self.searchBarVC.isActive {
return 2
}
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if self.searchBarVC.isActive { if self.searchBarVC.isActive {
return searchDataSource.count
return searchDataSource[section].count
} }
return dataSources.count return dataSources.count
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return kAutoWidth*60 if indexPath.section == 0 {
return kAutoWidth*60
} else {
return UITableView.automaticDimension
}
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "SHRecordListCell", for: indexPath) as! SHRecordListCell
if self.searchBarVC.isActive { if self.searchBarVC.isActive {
cell.model = searchDataSource[indexPath.row] if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "SHRecordListCell", for: indexPath) as! SHRecordListCell
let folders:[SHRecordFolderModel] = searchDataSource[indexPath.section] as! [SHRecordFolderModel]
cell.model = folders[indexPath.row]
cell.searchStr = self.searchBarVC.searchBar.text ?? ""
cell.selectionStyle = .none
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: "SHRecordDetailsCell", for: indexPath) as! SHRecordDetailsCell
let records:[SHRecordModel] = searchDataSource[indexPath.section] as! [SHRecordModel]
let model = records[indexPath.row]
cell.model = model
cell.edit = false
cell.icloudBtn?.isHidden = true
cell.searchStr = self.searchBarVC.searchBar.text ?? ""
cell.selectionStyle = .none
cell.separatorInset = UIEdgeInsets.init(top: 0, left: kScreenWidth/2, bottom: 0, right: kScreenWidth/2)
return cell
}
}else{ }else{
let cell = tableView.dequeueReusableCell(withIdentifier: "SHRecordListCell", for: indexPath) as! SHRecordListCell
cell.model = dataSources[indexPath.row] cell.model = dataSources[indexPath.row]
cell.selectionStyle = .none
return cell
} }
cell.selectionStyle = .none
return cell
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let details = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordDetailsVC") as! SHRecordDetailsVC
if self.searchBarVC.isActive { if self.searchBarVC.isActive {
details.currentModel = searchDataSource[indexPath.row] if indexPath.section == 0{
let details = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordDetailsVC") as! SHRecordDetailsVC
let folders:[SHRecordFolderModel] = searchDataSource[indexPath.section] as! [SHRecordFolderModel]
details.currentModel = folders[indexPath.row]
self.navigationController?.pushViewController(details, animated: true)
} else {
let records:[SHRecordModel] = searchDataSource[indexPath.section] as! [SHRecordModel]
let recordModel = records[indexPath.row]
let folderModel = self.dataSources.filter({
let record = $0.dataSources.filter({ $0.pathFile == recordModel.pathFile }).first
if record != nil {
return true
} else {
return false
}
}).first
let input = SHInputController.init()
input.folderModel = folderModel
input.dataModel = recordModel
self.navigationController?.pushViewController(input, animated: true)
input.saveSuccessCallBack = { model in
self.searchBarVC.searchBar.text = ""
self.prepareDateSource()
self.tableView?.reloadData()
}
}
}else{ }else{
let details = UIStoryboard.init(name: "Record", bundle: nil).instantiateViewController(withIdentifier: "SHRecordDetailsVC") as! SHRecordDetailsVC
details.currentModel = dataSources[indexPath.row] details.currentModel = dataSources[indexPath.row]
self.navigationController?.pushViewController(details, animated: true)
}
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if self.searchBarVC.isActive {
return 50
}
return 0.001
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if self.searchBarVC.isActive {
let view = UIView.init(frame: CGRect.init(x: 0, y: 0, width: kScreenWidth, height: 50))
view.backgroundColor = UIColor.groupTableViewBackground
let bottomView = UIView.init(frame: CGRect.init(x: 0, y: 10, width: kScreenWidth, height: 40))
bottomView.backgroundColor = UIColor.white
view.addSubview(bottomView)
let lab = UILabel.init(frame: CGRect.init(x: 20, y: 0, width: kScreenWidth-20, height: 40))
lab.text = section == 0 ? "笔记本" : "笔记"
lab.font = UIFont.systemFont(ofSize: 14)
lab.textColor = UIColor.init(hexStr: "999999")
let line = UIView.init(frame: CGRect.init(x: 20, y: 39, width: kScreenWidth-20, height: 1))
line.backgroundColor = UIColor.groupTableViewBackground
bottomView.addSubview(lab)
bottomView.addSubview(line)
return view
}else{
return UIView()
} }
self.navigationController?.pushViewController(details, animated: true)
} }
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
...@@ -509,13 +621,23 @@ extension SHRecordListViewController: UISearchResultsUpdating, UISearchBarDelega ...@@ -509,13 +621,23 @@ extension SHRecordListViewController: UISearchResultsUpdating, UISearchBarDelega
func updateSearchResults(for searchController: UISearchController) { func updateSearchResults(for searchController: UISearchController) {
searchDataSource.removeAll() searchDataSource.removeAll()
var searchArr: Array<SHRecordFolderModel> = [] var folderSearchArr: Array<SHRecordFolderModel> = []
searchArr = ZYPinYinSearch.search(withOriginalArray: dataSources, andSearchText: searchController.searchBar.text, andSearchByPropertyName: "name") as! Array<SHRecordFolderModel> folderSearchArr = ZYPinYinSearch.search(withOriginalArray: dataSources, andSearchText: searchController.searchBar.text, andSearchByPropertyName: "name") as! Array<SHRecordFolderModel>
var recordSearchTitleArr: Array<SHRecordModel> = []
recordSearchTitleArr = ZYPinYinSearch.search(withOriginalArray: recordsDataSource, andSearchText: searchController.searchBar.text, andSearchByPropertyName: "rename") as! Array<SHRecordModel>
var recordSearchTxtArr: Array<SHRecordModel> = []
recordSearchTxtArr = ZYPinYinSearch.search(withOriginalArray: recordsDataSource, andSearchText: searchController.searchBar.text, andSearchByPropertyName: "txt") as! Array<SHRecordModel>
let recordSearchArr: Array<SHRecordModel> = (recordSearchTitleArr+recordSearchTxtArr).filterDuplicates({$0.pathFile})
if searchController.searchBar.text?.length == 0 { if searchController.searchBar.text?.length == 0 {
searchDataSource.append(contentsOf: dataSources) searchDataSource.append(dataSources)
searchDataSource.append(recordsDataSource)
}else { }else {
searchDataSource.append(contentsOf: searchArr) searchDataSource.append(folderSearchArr)
searchDataSource.append(recordSearchArr)
} }
self.tableView?.reloadData() self.tableView?.reloadData()
......
...@@ -151,7 +151,7 @@ class SHRecordMoveFileVC: SHBaseViewController { ...@@ -151,7 +151,7 @@ class SHRecordMoveFileVC: SHBaseViewController {
} }
} }
} }
MBProgressHUD.show("正在转移中,请稍后...", view: nil) MBProgressHUD.show("正在移动...", view: nil)
let list = CRUserDefaults.recordList let list = CRUserDefaults.recordList
if var recordList = list{ if var recordList = list{
//增 //增
...@@ -171,7 +171,7 @@ class SHRecordMoveFileVC: SHBaseViewController { ...@@ -171,7 +171,7 @@ class SHRecordMoveFileVC: SHBaseViewController {
for (index, subDict) in recordList.enumerated(){ for (index, subDict) in recordList.enumerated(){
let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict) let subFolderModel:SHRecordFolderModel = getDataDictWith(dict: subDict)
if subFolderModel.id == currentModel.id { if subFolderModel.id == currentModel.id {
subFolderModel.modifyDate = nowDate // subFolderModel.modifyDate = nowDate
subFolderModel.dataSources = currentModel.dataSources subFolderModel.dataSources = currentModel.dataSources
let dic = getDictWith(obj: subFolderModel) let dic = getDictWith(obj: subFolderModel)
recordList[index] = dic recordList[index] = dic
......
...@@ -53,6 +53,31 @@ class SHRecordDetailsCell: UITableViewCell { ...@@ -53,6 +53,31 @@ class SHRecordDetailsCell: UITableViewCell {
} }
} }
var searchStr: String = "" {
didSet{
let titleAtt = NSMutableAttributedString.init(string: model.rename)
let ranges = self.rangeOfString(string: model.rename.lowercased() as NSString, andInString: searchStr.lowercased())
for range in ranges {
titleAtt.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.init(hexStr: "4183F2"), range: range)
}
titleName?.attributedText = titleAtt
let txtAtt = NSMutableAttributedString.init(string: model.txt)
let txtRanges = self.rangeOfString(string: model.txt.lowercased() as NSString, andInString: searchStr.lowercased())
for range in txtRanges {
txtAtt.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.init(hexStr: "4183F2"), range: range)
}
txtLab?.attributedText = txtAtt
}
}
private var _edit: Bool? private var _edit: Bool?
var edit: Bool { var edit: Bool {
set{ set{
...@@ -76,6 +101,37 @@ class SHRecordDetailsCell: UITableViewCell { ...@@ -76,6 +101,37 @@ class SHRecordDetailsCell: UITableViewCell {
} }
} }
/// 获取字符出现的位置信息(支持多次位置获取)
/// - Parameter string: 原始文本
/// - Parameter inString: 需要查找的字符
private func rangeOfString(string:NSString,
andInString inString:String) -> [NSRange] {
var arrRange = [NSRange]()
var _fullText = string
var rang:NSRange = _fullText.range(of: inString)
while rang.location != NSNotFound {
var location:Int = 0
if arrRange.count > 0 {
if arrRange.last!.location + arrRange.last!.length < string.length {
location = arrRange.last!.location + arrRange.last!.length
}
}
_fullText = NSString.init(string: _fullText.substring(from: rang.location + rang.length))
if arrRange.count > 0 {
rang.location += location
}
arrRange.append(rang)
rang = _fullText.range(of: inString)
}
return arrRange
}
override func layoutSubviews() { override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="export_alert" translatesAutoresizingMaskIntoConstraints="NO" id="zWB-vg-VZR"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="export_alert" translatesAutoresizingMaskIntoConstraints="NO" id="zWB-vg-VZR">
<rect key="frame" x="74" y="44" width="200" height="98"/> <rect key="frame" x="74" y="44" width="200" height="98"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="会议记录成功" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TRx-zi-zxr"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="笔记保存成功" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TRx-zi-zxr">
<rect key="frame" x="107" y="164" width="134" height="26.5"/> <rect key="frame" x="107" y="164" width="134" height="26.5"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
<color key="textColor" red="0.13333333333333333" green="0.13333333333333333" blue="0.13333333333333333" alpha="0.84705882352941175" colorSpace="calibratedRGB"/> <color key="textColor" red="0.13333333333333333" green="0.13333333333333333" blue="0.13333333333333333" alpha="0.84705882352941175" colorSpace="calibratedRGB"/>
......
...@@ -35,7 +35,7 @@ class SHRecordGuideView: UIView { ...@@ -35,7 +35,7 @@ class SHRecordGuideView: UIView {
holedView.addHoleRect(CGRect.init(x: SCREEN_WIDTH-44-10, y: kStatusBarHeight, width: 44, height: 44), cornerRadius: 4) holedView.addHoleRect(CGRect.init(x: SCREEN_WIDTH-44-10, y: kStatusBarHeight, width: 44, height: 44), cornerRadius: 4)
let hintLab = UILabel() let hintLab = UILabel()
hintLab.text = "点击“✓”即可结束本次会议记录" hintLab.text = "点击“✓”即可结束并保存录音"
hintLab.textColor = UIColor.white hintLab.textColor = UIColor.white
hintLab.numberOfLines = 0 hintLab.numberOfLines = 0
hintLab.textAlignment = .center hintLab.textAlignment = .center
......
...@@ -15,7 +15,7 @@ class SHRecordListCell: UITableViewCell { ...@@ -15,7 +15,7 @@ class SHRecordListCell: UITableViewCell {
set{ set{
_model = newValue _model = newValue
nameLab?.text = newValue.name nameLab?.attributedText = NSAttributedString.init(string: newValue.name)
countLab?.text = "\(newValue.dataSources.count)" countLab?.text = "\(newValue.dataSources.count)"
// timeLab?.text = newValue.createDate.format("yyyy-MM-dd HH:mm") // timeLab?.text = newValue.createDate.format("yyyy-MM-dd HH:mm")
...@@ -28,11 +28,57 @@ class SHRecordListCell: UITableViewCell { ...@@ -28,11 +28,57 @@ class SHRecordListCell: UITableViewCell {
} }
} }
var searchStr: String = "" {
didSet{
let titleAtt = NSMutableAttributedString.init(string: model.name)
let ranges = self.rangeOfString(string: model.name.lowercased() as NSString, andInString: searchStr.lowercased())
for range in ranges {
titleAtt.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor.init(hexStr: "4183F2"), range: range)
}
nameLab?.attributedText = titleAtt
}
}
@IBOutlet weak var nameLab: UILabel? @IBOutlet weak var nameLab: UILabel?
@IBOutlet weak var timeLab: UILabel? @IBOutlet weak var timeLab: UILabel?
@IBOutlet weak var countLab: UILabel? @IBOutlet weak var countLab: UILabel?
@IBOutlet weak var topImV: UIImageView? @IBOutlet weak var topImV: UIImageView?
/// 获取字符出现的位置信息(支持多次位置获取)
/// - Parameter string: 原始文本
/// - Parameter inString: 需要查找的字符
private func rangeOfString(string:NSString,
andInString inString:String) -> [NSRange] {
var arrRange = [NSRange]()
var _fullText = string
var rang:NSRange = _fullText.range(of: inString)
while rang.location != NSNotFound {
var location:Int = 0
if arrRange.count > 0 {
if arrRange.last!.location + arrRange.last!.length < string.length {
location = arrRange.last!.location + arrRange.last!.length
}
}
_fullText = NSString.init(string: _fullText.substring(from: rang.location + rang.length))
if arrRange.count > 0 {
rang.location += location
}
arrRange.append(rang)
rang = _fullText.range(of: inString)
}
return arrRange
}
@objc private func countSecond(_ during:NSInteger) -> String { @objc private func countSecond(_ during:NSInteger) -> String {
//小时计算 //小时计算
let hours = (during)%(24*3600)/3600; let hours = (during)%(24*3600)/3600;
......
...@@ -19,8 +19,8 @@ class SHCloudManager: NSObject { ...@@ -19,8 +19,8 @@ class SHCloudManager: NSObject {
let recordFolderName = "recordFolder" let recordFolderName = "recordFolder"
lazy var container = CKContainer.default() lazy var container = CKContainer.default()
lazy var dateBase = container.publicCloudDatabase // lazy var dateBase = container.publicCloudDatabase
// lazy var dateBase = container.privateCloudDatabase lazy var dateBase = container.privateCloudDatabase
lazy var folderResults:[CKRecord] = [] lazy var folderResults:[CKRecord] = []
lazy var recordResults:[CKRecord] = [] lazy var recordResults:[CKRecord] = []
......
...@@ -13,7 +13,7 @@ class SHStoreManager: NSObject { ...@@ -13,7 +13,7 @@ class SHStoreManager: NSObject {
@objc class func purchaseWithProductId(productId: String, inView: UIView, success: @escaping(()->Void) ,faliure: @escaping((String)->Void)) { @objc class func purchaseWithProductId(productId: String, inView: UIView, success: @escaping(()->Void) ,faliure: @escaping((String)->Void)) {
MBProgressHUD.showMessage("支付中...", delayTime: 90, mode: .indeterminate, to: inView) MBProgressHUD.showMessage("请稍等...", delayTime: 90, mode: .indeterminate, to: inView)
SwiftyStoreKit.purchaseProduct(productId, quantity: 1, atomically: true) { result in SwiftyStoreKit.purchaseProduct(productId, quantity: 1, atomically: true) { result in
MBProgressHUD.hide(for: inView) MBProgressHUD.hide(for: inView)
switch result { switch result {
...@@ -93,7 +93,7 @@ class SHStoreManager: NSObject { ...@@ -93,7 +93,7 @@ class SHStoreManager: NSObject {
print("Unknown error. Please contact support") print("Unknown error. Please contact support")
MBProgressHUD.showError("无法连接到 iTunes Store, 请稍后再试") MBProgressHUD.showError("无法连接到 iTunes Store, 请稍后再试")
case .paymentCancelled: case .paymentCancelled:
MBProgressHUD.showError("您已取消购买") MBProgressHUD.showError("操作取消")
case .paymentInvalid: case .paymentInvalid:
MBProgressHUD.showError("无法购买, 请试试其他的") MBProgressHUD.showError("无法购买, 请试试其他的")
print("The purchase identifier was invalid") print("The purchase identifier was invalid")
......
...@@ -34,7 +34,7 @@ import SwiftyJSON ...@@ -34,7 +34,7 @@ import SwiftyJSON
@objc var isMember: Bool { @objc var isMember: Bool {
return true // return true
let dateFormatter = DateFormatter() let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_CN") dateFormatter.locale = Locale(identifier: "en_CN")
......
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