Pārlūkot izejas kodu

Merge branch 'develop' of http://svn.ouj.com:3000/duowan_iOS/SuperShow into develop

zhongbaojian 4 gadi atpakaļ
vecāks
revīzija
f4b579133c

+ 2 - 2
SuperShow/Assets.xcassets/Home/home_ic_music.imageset/Contents.json

@@ -6,12 +6,12 @@
     },
     {
       "idiom" : "universal",
-      "filename" : "音乐@2x.png",
+      "filename" : "home_ic_music@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "音乐@3x.png",
+      "filename" : "home_ic_music@3x.png",
       "scale" : "3x"
     }
   ],

BIN
SuperShow/Assets.xcassets/Home/home_ic_music.imageset/home_ic_music@2x.png


BIN
SuperShow/Assets.xcassets/Home/home_ic_music.imageset/home_ic_music@3x.png


BIN
SuperShow/Assets.xcassets/Home/home_ic_music.imageset/音乐@2x.png


BIN
SuperShow/Assets.xcassets/Home/home_ic_music.imageset/音乐@3x.png


+ 2 - 2
SuperShow/Macro/OJAStyle.swift

@@ -121,11 +121,11 @@ class WSSStyle: NSObject {
         super.init()
     }
 
-    /// 首页cell的descLabel属性,字体13,行距4
+    /// 首页cell的descLabel属性,字体15,行距4
     var homeCellDescAttributeDict: [NSAttributedString.Key: Any] = {
         let style = NSMutableParagraphStyle()
         style.lineSpacing = 4
-        let dict = [NSAttributedString.Key.font: OJAFont.font13,
+        let dict = [NSAttributedString.Key.font: OJAFont.font15,
                     NSAttributedString.Key.foregroundColor: OJATextColor.colorWhite,
                     NSAttributedString.Key.paragraphStyle: style]
         return dict

+ 37 - 1
SuperShow/OJAGPUImageDecoder/Input/OJAImageFrameInput.swift

@@ -29,7 +29,7 @@ class OJAImageFrameInput: NSObject {
         super.init()
     }
 
-    init(templateItem: OJATemplateItemModel) {
+    init(templateItem: OJATemplateItemModel, fatherItem: OJATemplateItemModel? = nil) {
         self.templateItem = templateItem
         var image = kWSSTemplateAddVideoPlaceholderImage
 
@@ -60,6 +60,42 @@ class OJAImageFrameInput: NSObject {
         //        if let temp = resultImage.oja_imageByResize(to: CGSize(width: 540, height: 960), contentMode: .scaleAspectFill) {
         //            resultImage = temp
         //        }
+
+        // 图片裁剪处理 fix: 补充创意模板 如 老虎机 使用 templateItemModel 里面的 comps 参数,还需要用到 x y 的中心点 父类的宽高进行 处理裁剪素材
+        if let superItem = fatherItem {
+            let boundsSize = CGSize(width: superItem.w, height: superItem.h)
+            let identifyRect = CGRect(x: 0.0, y: 0.0, width: 1.0, height: 1.0)
+
+            let centerPoint = CGPoint(x: templateItem.x, y: templateItem.y)
+            let offsetX = -(centerPoint.x - templateItem.w * 0.5)
+            let offsetY = (centerPoint.y - templateItem.h * 0.5)
+
+            let cropRect = CGRect(x: offsetX / templateItem.w,
+                                  y: offsetY / templateItem.h,
+                                  width: boundsSize.width / templateItem.w,
+                                  height: boundsSize.height / templateItem.h)
+
+            WSSSimpleLog("=========>croprect:\(cropRect)")
+            if identifyRect != cropRect {
+                let semaphore = DispatchSemaphore(value: 0)
+                DispatchQueue.main.async {
+                    let imageSizeW = image.size.width
+                    let imageSizeH = image.size.height
+                    let realRect = CGRect(x: cropRect.origin.x * imageSizeW,
+                                          y: cropRect.origin.y * imageSizeH,
+                                          width: cropRect.size.width * imageSizeW,
+                                          height: cropRect.size.height * imageSizeH)
+                    if let cropImage = image.oja_imageByCrop(to: realRect) {
+                        image = cropImage
+                        semaphore.signal()
+                    } else {
+                        semaphore.signal()
+                    }
+                }
+                semaphore.wait()
+            }
+        }
+
         pictureFile = OJAImagePicture(image: image)
         pictureFile.processImageFrame(at: CMTime.zero)
         super.init()

+ 3 - 3
SuperShow/OJAGPUImageDecoder/Input/OJAPreCompositionFrameInput.swift

@@ -27,13 +27,13 @@ class OJAPreCompositionFrameInput: OJAFrameInput {
         self.templateItem = templateItem
         if let items = templateItem.comps {
             if items.count == 1 {
-                pictureInput = OJAImageFrameInput(templateItem: items[0])
+                pictureInput = OJAImageFrameInput(templateItem: items[0], fatherItem: templateItem)
             } else {
                 for item in templateItem.comps! {
                     if item.type == .videoCover {
-                        pictureInput = OJAImageFrameInput(templateItem: item)
+                        pictureInput = OJAImageFrameInput(templateItem: item, fatherItem: templateItem)
                     } else if item.type == .image {
-                        maskInput = OJAImageFrameInput(templateItem: item)
+                        maskInput = OJAImageFrameInput(templateItem: item, fatherItem: templateItem)
                     }
                 }
                 let blendFilter = OJAImageMaskBlendFilter()

+ 1 - 1
SuperShow/UI/Recommend/Views/WSSRecommendCell.swift

@@ -120,7 +120,7 @@ class WSSRecommendCell: UITableViewCell {
 
     @IBOutlet var descLabel: UILabel! {
         didSet {
-            descLabel.font = OJAFont.font14
+            descLabel.font = OJAFont.font15
             descLabel.textColor = OJATextColor.colorWhite
         }
     }

+ 11 - 11
SuperShow/UI/Recommend/Views/WSSRecommendCell.xib

@@ -3,7 +3,7 @@
     <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15509"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -85,7 +85,7 @@
                         </constraints>
                     </view>
                     <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_ic_music" translatesAutoresizingMaskIntoConstraints="NO" id="egk-al-XQy">
-                        <rect key="frame" x="16" y="514" width="17" height="17"/>
+                        <rect key="frame" x="16" y="516" width="17" height="17"/>
                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="17" id="N6z-dT-rnX"/>
@@ -93,7 +93,7 @@
                         </constraints>
                     </imageView>
                     <button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qpz-Dc-a5q">
-                        <rect key="frame" x="16" y="405" width="40" height="19"/>
+                        <rect key="frame" x="16" y="412.5" width="40" height="19"/>
                         <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.20000000000000001" colorSpace="custom" customColorSpace="calibratedRGB"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="19" id="jKT-P4-dJ9"/>
@@ -104,11 +104,11 @@
                         <state key="normal" title="0s" image="home_ic_time"/>
                     </button>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="---" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ESf-KH-1hN" customClass="MarqueeLabel" customModule="MarqueeLabel">
-                        <rect key="frame" x="38" y="513.5" width="150" height="18"/>
+                        <rect key="frame" x="38" y="516.5" width="150" height="16"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="150" id="o6C-da-Ha2"/>
                         </constraints>
-                        <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                        <fontDescription key="fontDescription" type="system" pointSize="13"/>
                         <color key="textColor" red="0.90196078431372551" green="0.90196078431372551" blue="0.90196078431372551" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
@@ -135,7 +135,7 @@
                         <rect key="frame" x="0.0" y="0.0" width="375" height="88"/>
                     </imageView>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h92-Dw-sxm">
-                        <rect key="frame" x="50.5" y="436" width="180" height="16"/>
+                        <rect key="frame" x="50.5" y="443.5" width="180" height="16"/>
                         <subviews>
                             <stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="kKe-KL-MQb">
                                 <rect key="frame" x="0.0" y="0.0" width="125.5" height="16"/>
@@ -229,7 +229,7 @@
                         </constraints>
                     </view>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="---" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ud6-KN-auL">
-                        <rect key="frame" x="16" y="434" width="24.5" height="20"/>
+                        <rect key="frame" x="16" y="441.5" width="24.5" height="20"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="20" id="GP3-XR-hkW"/>
                             <constraint firstAttribute="width" relation="lessThanOrEqual" constant="240" id="zmo-NN-fGZ"/>
@@ -239,7 +239,7 @@
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="---" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="4" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wGs-RV-fGI">
-                        <rect key="frame" x="16" y="469" width="264" height="18"/>
+                        <rect key="frame" x="16" y="476.5" width="264" height="18"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="264" id="mWK-aA-LUh"/>
                         </constraints>
@@ -261,7 +261,7 @@
                     <constraint firstItem="ESf-KH-1hN" firstAttribute="leading" secondItem="egk-al-XQy" secondAttribute="trailing" constant="5" id="99e-1b-1J0"/>
                     <constraint firstAttribute="trailing" secondItem="H3t-aF-mje" secondAttribute="trailing" id="9Kq-qy-0rG"/>
                     <constraint firstItem="SVC-ut-eBF" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="9LG-hA-wUj"/>
-                    <constraint firstItem="hcJ-q7-zt4" firstAttribute="top" secondItem="egk-al-XQy" secondAttribute="bottom" constant="16" id="9ak-Jl-NtN"/>
+                    <constraint firstItem="hcJ-q7-zt4" firstAttribute="top" secondItem="egk-al-XQy" secondAttribute="bottom" constant="14" id="9ak-Jl-NtN"/>
                     <constraint firstItem="egk-al-XQy" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="AV9-F8-6Bi"/>
                     <constraint firstAttribute="trailing" secondItem="iDe-iJ-VpT" secondAttribute="trailing" id="C60-d6-Zos"/>
                     <constraint firstItem="ud6-KN-auL" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="DdD-os-FrH"/>
@@ -273,7 +273,6 @@
                     <constraint firstItem="H3t-aF-mje" firstAttribute="top" secondItem="iff-NP-beP" secondAttribute="bottom" constant="20" id="RdA-wI-6Nc"/>
                     <constraint firstItem="H3t-aF-mje" firstAttribute="bottom" secondItem="mgo-Xw-zh4" secondAttribute="bottom" id="TRh-CG-mQv"/>
                     <constraint firstItem="qpz-Dc-a5q" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="VrD-eW-2e0"/>
-                    <constraint firstItem="H3t-aF-mje" firstAttribute="top" secondItem="wGs-RV-fGI" secondAttribute="bottom" constant="126" id="We4-4z-Exu"/>
                     <constraint firstAttribute="trailing" secondItem="SVC-ut-eBF" secondAttribute="trailing" id="WhV-bA-nGp"/>
                     <constraint firstItem="H3t-aF-mje" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Yxx-iv-7Ud"/>
                     <constraint firstItem="h92-Dw-sxm" firstAttribute="leading" secondItem="ud6-KN-auL" secondAttribute="trailing" constant="10" id="dhm-AW-5b9"/>
@@ -288,6 +287,7 @@
                     <constraint firstAttribute="bottom" secondItem="H3t-aF-mje" secondAttribute="bottom" id="sQE-ks-yTn"/>
                     <constraint firstItem="wGs-RV-fGI" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="ssl-Lb-1vW"/>
                     <constraint firstItem="h92-Dw-sxm" firstAttribute="centerY" secondItem="ud6-KN-auL" secondAttribute="centerY" id="t24-zU-e1a"/>
+                    <constraint firstItem="ESf-KH-1hN" firstAttribute="top" secondItem="wGs-RV-fGI" secondAttribute="bottom" constant="22" id="yf3-MN-lXc"/>
                 </constraints>
             </tableViewCellContentView>
             <viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
@@ -320,7 +320,7 @@
         <image name="home_cell_collect" width="34" height="34"/>
         <image name="home_cell_collect_on" width="34" height="34"/>
         <image name="home_cell_share" width="34" height="34"/>
-        <image name="home_ic_music" width="15" height="15"/>
+        <image name="home_ic_music" width="14" height="14"/>
         <image name="home_ic_play" width="64" height="70"/>
         <image name="home_ic_time" width="11" height="11"/>
         <image name="home_ic_vip" width="41.5" height="16"/>