浏览代码

triangleView

Chris 6 年之前
父节点
当前提交
b1c2e1863f

+ 4 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -317,6 +317,7 @@
 		A7FF1596228CFA8100A85748 /* OrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1595228CFA8100A85748 /* OrderListViewController.swift */; };
 		A7FF1598228D092A00A85748 /* OrderListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1597228D092A00A85748 /* OrderListModel.swift */; };
 		A7FF159C228D9E3D00A85748 /* OrderRefundDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF159B228D9E3C00A85748 /* OrderRefundDetailModel.swift */; };
+		BD09C84122955B480080D5A4 /* PopTopTriangleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD09C84022955B480080D5A4 /* PopTopTriangleView.swift */; };
 		BD1DC6C5228CFD0B00B89C57 /* SwiftMoyaNetWorkServiceOrder.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1DC6C3228CFD0B00B89C57 /* SwiftMoyaNetWorkServiceOrder.swift */; };
 		BD1DC6C6228CFD0B00B89C57 /* SwiftMoyaServiceOrderApi.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1DC6C4228CFD0B00B89C57 /* SwiftMoyaServiceOrderApi.swift */; };
 		BD1DC6C9228D005000B89C57 /* OrderCreateParameterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1DC6C8228D005000B89C57 /* OrderCreateParameterModel.swift */; };
@@ -714,6 +715,7 @@
 		A7FF1595228CFA8100A85748 /* OrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderListViewController.swift; sourceTree = "<group>"; };
 		A7FF1597228D092A00A85748 /* OrderListModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderListModel.swift; sourceTree = "<group>"; };
 		A7FF159B228D9E3C00A85748 /* OrderRefundDetailModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderRefundDetailModel.swift; sourceTree = "<group>"; };
+		BD09C84022955B480080D5A4 /* PopTopTriangleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopTopTriangleView.swift; sourceTree = "<group>"; };
 		BD1DC6C3228CFD0B00B89C57 /* SwiftMoyaNetWorkServiceOrder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftMoyaNetWorkServiceOrder.swift; sourceTree = "<group>"; };
 		BD1DC6C4228CFD0B00B89C57 /* SwiftMoyaServiceOrderApi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftMoyaServiceOrderApi.swift; sourceTree = "<group>"; };
 		BD1DC6C8228D005000B89C57 /* OrderCreateParameterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderCreateParameterModel.swift; sourceTree = "<group>"; };
@@ -1791,6 +1793,7 @@
 				A775CBFD2237493600EBDCF8 /* ShoppingMallNavigationBarView.swift */,
 				A775CBFF223774A300EBDCF8 /* ShoppingMallView.swift */,
 				A7A98E3022801B10005306E9 /* ShoppingMallListView.swift */,
+				BD09C84022955B480080D5A4 /* PopTopTriangleView.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -3594,6 +3597,7 @@
 				A7CC750A22715755003C4F38 /* MessageDetailesViewController.swift in Sources */,
 				BDAA40F7228E947500CF841D /* OrderApplyRefundAccountCell.swift in Sources */,
 				A71AF0B8226EF9EC001730FE /* SearchResultNavigationbarView.swift in Sources */,
+				BD09C84122955B480080D5A4 /* PopTopTriangleView.swift in Sources */,
 				A70B2C5A22886ADF00B2449F /* ShopViewController.swift in Sources */,
 				BDF862AE228E57E1000DEF84 /* OrderCommentDefaultCollectionCell.swift in Sources */,
 				A70B2C3E228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift in Sources */,

+ 86 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingMall/View/PopTopTriangleView.swift

@@ -0,0 +1,86 @@
+//
+//  PopTopTriangleView.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/5/22.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PopTopTriangleView: BaseView {
+    
+    var address: String? {
+        didSet {
+            addressLabel.text = self.address
+        }
+    }
+    
+    override func setupViews() {
+        self.backgroundColor = kffffffColor
+        addSubview(triangleView)
+        addSubview(contentView)
+        contentView.addSubview(addressLabel)
+    }
+    
+    override func setupLayouts() {
+        triangleView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview()
+            make.left.equalToSuperview().offset(4)
+            make.width.equalTo(15)
+            make.height.equalTo(8)
+        }
+        
+        contentView.snp.makeConstraints { (make) in
+            make.top.equalTo(triangleView.snp_bottom)
+            make.left.right.equalToSuperview()
+            make.height.equalTo(24)
+        }
+        
+        addressLabel.snp.makeConstraints { (make) in
+            make.left.equalToSuperview().offset(5)
+            make.right.equalToSuperview().offset(-8)
+            make.bottom.equalToSuperview().offset(-5)
+            make.height.equalTo(14)
+        }
+        
+    }
+    
+    private lazy var triangleView: UIView = {
+        let triangleView = UIView(frame: CGRect(x: 0, y: 0, width: 8, height: 14))
+        triangleView.backgroundColor = kffffffColor
+        
+        // 画三角
+        let trianglePath = UIBezierPath()
+        var point = CGPoint(x: 0, y: 8)
+        trianglePath.move(to: point)
+        point = CGPoint(x: 14/2, y: 0)
+        trianglePath.addLine(to: point)
+        point = CGPoint(x: 14, y: 8)
+        trianglePath.addLine(to: point)
+        trianglePath.close()
+        let triangleLayer = CAShapeLayer()
+        triangleLayer.path = trianglePath.cgPath
+        triangleLayer.fillColor = kRGBAColor(r: 0, g: 0, b: 0, a: 0.6).cgColor
+        triangleView.layer.addSublayer(triangleLayer)
+        return triangleView
+    }()
+    
+    private lazy var contentView: UIView = {
+        let contentView = UIView()
+        contentView.backgroundColor = UIColor.black
+        contentView.alpha = 0.6
+        contentView.cornerRadius = 2
+        contentView.masksToBounds = true
+        return contentView
+    }()
+    
+    private lazy var addressLabel: UILabel = {
+        let addressLabel = UILabel()
+        addressLabel.text = "建设西路新旅城南门自提点"
+        addressLabel.textColor = kffffffColor
+        addressLabel.font = kScaleRegularFont14
+        return addressLabel
+    }()
+    
+}