Commit f7882b76d93293911e980370689eaa17b0234b88

Authored by “张旭”
1 parent cdcf28b7

短剧首页cell , 热榜和横排短剧

metaCode.xcodeproj/project.pbxproj
... ... @@ -106,6 +106,7 @@
106 106 1965FA402AFB38AA00F0F435 /* CNLiveAddGoodsSelectUploadImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1965FA3F2AFB38AA00F0F435 /* CNLiveAddGoodsSelectUploadImageView.swift */; };
107 107 1965FA422AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1965FA412AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift */; };
108 108 197325D22BB11C18002E41A3 /* DatabaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 197325D12BB11C18002E41A3 /* DatabaseManager.swift */; };
  109 + 19864E3F2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */; };
109 110 19AB90642BB412C700B6A79B /* CNLiveDownslideOperationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AB90632BB412C700B6A79B /* CNLiveDownslideOperationManager.swift */; };
110 111 19AD65AA2BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */; };
111 112 19AD65AC2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */; };
... ... @@ -132,6 +133,7 @@
132 133 19C0F76D2BDB48750097CC8F /* CNBindingManageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0F76C2BDB48750097CC8F /* CNBindingManageCell.swift */; };
133 134 19C0F76F2BDB4CE10097CC8F /* CNBindingManageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0F76E2BDB4CE10097CC8F /* CNBindingManageModel.swift */; };
134 135 19C0F7712BDE1A3B0097CC8F /* CNLiveMineChangePhoneController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0F7702BDE1A3B0097CC8F /* CNLiveMineChangePhoneController.swift */; };
  136 + 19C0F7742BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0F7732BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift */; };
135 137 19CC4D472ADD006600308E2A /* CNDownSlideSingleCourseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */; };
136 138 19CC4D492ADD06C500308E2A /* UITableView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D482ADD06C500308E2A /* UITableView+Extension.swift */; };
137 139 19CC4D4B2ADD086F00308E2A /* CNUpSlideDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19CC4D4A2ADD086F00308E2A /* CNUpSlideDetailViewController.swift */; };
... ... @@ -387,6 +389,7 @@
387 389 1965FA3F2AFB38AA00F0F435 /* CNLiveAddGoodsSelectUploadImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveAddGoodsSelectUploadImageView.swift; sourceTree = "<group>"; };
388 390 1965FA412AFB79EA00F0F435 /* CNLiveGoodsCategoryController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveGoodsCategoryController.swift; sourceTree = "<group>"; };
389 391 197325D12BB11C18002E41A3 /* DatabaseManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseManager.swift; sourceTree = "<group>"; };
  392 + 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideRealHotListCell.swift; sourceTree = "<group>"; };
390 393 19AB90632BB412C700B6A79B /* CNLiveDownslideOperationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownslideOperationManager.swift; sourceTree = "<group>"; };
391 394 19AD65A92BA041210045A444 /* CNLiveGoodsDetailsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveGoodsDetailsTableViewCell.swift; sourceTree = "<group>"; };
392 395 19AD65AB2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopCommentRequestShareModel.swift; sourceTree = "<group>"; };
... ... @@ -413,6 +416,7 @@
413 416 19C0F76C2BDB48750097CC8F /* CNBindingManageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNBindingManageCell.swift; sourceTree = "<group>"; };
414 417 19C0F76E2BDB4CE10097CC8F /* CNBindingManageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNBindingManageModel.swift; sourceTree = "<group>"; };
415 418 19C0F7702BDE1A3B0097CC8F /* CNLiveMineChangePhoneController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineChangePhoneController.swift; sourceTree = "<group>"; };
  419 + 19C0F7732BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalAuthController.swift; sourceTree = "<group>"; };
416 420 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNDownSlideSingleCourseCell.swift; sourceTree = "<group>"; };
417 421 19CC4D482ADD06C500308E2A /* UITableView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+Extension.swift"; sourceTree = "<group>"; };
418 422 19CC4D4A2ADD086F00308E2A /* CNUpSlideDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNUpSlideDetailViewController.swift; sourceTree = "<group>"; };
... ... @@ -844,6 +848,7 @@
844 848 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */,
845 849 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */,
846 850 19CC4D4E2ADD0FC200308E2A /* CNUpSlideDetailScrollView.swift */,
  851 + 19864E3E2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift */,
847 852 );
848 853 path = DownSlide;
849 854 sourceTree = "<group>";
... ... @@ -1028,6 +1033,14 @@
1028 1033 path = Model;
1029 1034 sourceTree = "<group>";
1030 1035 };
  1036 + 19C0F7722BDF71890097CC8F /* DigitalAuth */ = {
  1037 + isa = PBXGroup;
  1038 + children = (
  1039 + 19C0F7732BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift */,
  1040 + );
  1041 + path = DigitalAuth;
  1042 + sourceTree = "<group>";
  1043 + };
1031 1044 19CC4D502ADD126D00308E2A /* Util */ = {
1032 1045 isa = PBXGroup;
1033 1046 children = (
... ... @@ -1487,6 +1500,7 @@
1487 1500 7CD6754D2A2840B9008354C1 /* Controller */ = {
1488 1501 isa = PBXGroup;
1489 1502 children = (
  1503 + 19C0F7722BDF71890097CC8F /* DigitalAuth */,
1490 1504 1938BD1A2B4554A800390A34 /* AuthMainController */,
1491 1505 1938BD1C2B4555A000390A34 /* WebController */,
1492 1506 1938BD1B2B45557700390A34 /* DownSlideController */,
... ... @@ -1953,6 +1967,7 @@
1953 1967 790D01852A2D89E100C5978D /* UIColor+CNLiveExtensions.swift in Sources */,
1954 1968 19C0F7672BD8DC4D0097CC8F /* CNThreeLoginModel.swift in Sources */,
1955 1969 794FF1092B02131300385E85 /* CNLiveSaveSearchDB.swift in Sources */,
  1970 + 19864E3F2BEF6A3300586E72 /* CNLiveDownSlideRealHotListCell.swift in Sources */,
1956 1971 79396EED2A319F220053E1AF /* NSObject+CNLiveExtensions.swift in Sources */,
1957 1972 1917331B2B10A0EF007BCC04 /* CNLivePlayerLoadingView.swift in Sources */,
1958 1973 19FA201B2AE60423001F7186 /* CNLiveDownSlideModelLayout.swift in Sources */,
... ... @@ -1981,6 +1996,7 @@
1981 1996 7978A8432A396632007C86B8 /* CNLiveMineViewModel.swift in Sources */,
1982 1997 19AD65AC2BA16CF20045A444 /* CNLiveShopCommentRequestShareModel.swift in Sources */,
1983 1998 191733022B0C4EAB007BCC04 /* CNLiveSelUplSingleImageView.swift in Sources */,
  1999 + 19C0F7742BDF71CA0097CC8F /* CNLiveDigitalAuthController.swift in Sources */,
1984 2000 798A44EE2A305AAC00815935 /* CNLiveBaseNavigationController.swift in Sources */,
1985 2001 1938BD412B4BEC6900390A34 /* CNLiveAlbumListModel.swift in Sources */,
1986 2002 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */,
... ...
metaCode/Classes/Config/CNLiveConfigFontMacro.swift
... ... @@ -62,6 +62,9 @@ let Font_18 = Font(18)
62 62 let Font_19 = Font(19)
63 63 let Font_20 = Font(20)
64 64 let Font_21 = Font(21)
  65 +let Font_22 = Font(22)
  66 +let Font_23 = Font(23)
  67 +let Font_24 = Font(24)
65 68 let Font_25 = Font(25)
66 69 let Font_30 = Font(30)
67 70  
... ...
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveDigitalAuthController.swift 0 → 100644
  1 +//
  2 +// CNLiveDigitalAuthController.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/4/29.
  6 +// 数字认证页面-选择领域
  7 +
  8 +import Foundation
  9 +import SnapKit
  10 +
  11 +class CNLiveDigitalAuthController:CNLiveBaseViewController{
  12 +
  13 + lazy var bgImgView :UIImageView = {
  14 + let iconImgView = UIImageView()
  15 + iconImgView.image = UIImage(named: "auth_blueBg")
  16 + return iconImgView
  17 + }()
  18 +
  19 + lazy var yuanmaLabel: UILabel = {
  20 + let titleLabel = UILabel()
  21 + titleLabel.textColor = .white
  22 + titleLabel.text = "元码数字认证"
  23 + titleLabel.font = Font_24
  24 + titleLabel.adjustsFontSizeToFitWidth=true
  25 + return titleLabel
  26 + }()
  27 +
  28 + lazy var yuanmaDescLabel: UILabel = {
  29 + let titleLabel = UILabel()
  30 + titleLabel.textColor = .white
  31 + titleLabel.text = "真我,连接世界\n元码数字认证,为我赋能"
  32 + titleLabel.numberOfLines = 2
  33 + titleLabel.font = Font_13
  34 + return titleLabel
  35 + }()
  36 +
  37 + lazy var whiteBgView :UIView = {
  38 + let whiteBgView = UIView()
  39 + whiteBgView.backgroundColor = .white
  40 + whiteBgView.layer.cornerRadius = 12
  41 + whiteBgView.clipsToBounds = true
  42 + return whiteBgView
  43 + }()
  44 + lazy var blueLineView :UIView = {
  45 + let blueLineView = UIView()
  46 + blueLineView.backgroundColor = HexColor("#1F64E3")
  47 + blueLineView.layer.cornerRadius = 1.75
  48 + blueLineView.clipsToBounds = true
  49 + return blueLineView
  50 + }()
  51 + lazy var changeLabel: UILabel = {
  52 + let titleLabel = UILabel()
  53 + titleLabel.textColor = HexColor("#333333")
  54 + titleLabel.text = "选择您当前所在领域"
  55 + titleLabel.font = Font_16
  56 + return titleLabel
  57 + }()
  58 +
  59 + lazy var dataArray :NSMutableArray = {
  60 + let dataArray = NSMutableArray()
  61 + return dataArray
  62 + }()
  63 +
  64 +
  65 + override func viewDidLoad() {
  66 + super.viewDidLoad()
  67 + navigationBarHidden = false
  68 + titleName = "元码数字认证"
  69 + self.initUI()
  70 + self.loadData()
  71 + }
  72 +
  73 + deinit {
  74 +
  75 + }
  76 +
  77 + func initUI(){
  78 + self.view.addSubview(self.bgImgView)
  79 + self.bgImgView.snp.makeConstraints { make in
  80 + make.top.equalTo(KNavigationHeight)
  81 + make.left.right.equalToSuperview()
  82 + make.height.equalTo(KSreenWidth*457/375)
  83 + }
  84 +
  85 + self.view.addSubview(self.yuanmaLabel)
  86 + self.yuanmaLabel.snp.makeConstraints { make in
  87 + make.top.equalTo(KNavigationHeight+adapt_length(length: 45))
  88 + make.left.equalTo(adapt_length(length: 30))
  89 + }
  90 +
  91 + self.view.addSubview(self.yuanmaDescLabel)
  92 + self.yuanmaDescLabel.snp.makeConstraints { make in
  93 + make.top.equalTo(self.yuanmaLabel.snp.bottom).offset(adapt_length(length: 10))
  94 + make.left.equalTo(adapt_length(length: 30))
  95 + }
  96 +
  97 + self.view.addSubview(self.whiteBgView)
  98 + self.whiteBgView.snp.makeConstraints { make in
  99 + make.top.equalTo(self.yuanmaDescLabel.snp.bottom).offset(adapt_length(length: 31))
  100 + make.bottom.equalToSuperview()
  101 + make.left.equalTo(15)
  102 + make.right.equalToSuperview().offset(-15)
  103 + }
  104 +
  105 + self.whiteBgView.addSubview(self.blueLineView)
  106 + self.blueLineView.snp.makeConstraints { make in
  107 + make.top.equalTo(24)
  108 + make.left.equalTo(17)
  109 + make.width.equalTo(3)
  110 + make.height.equalTo(15)
  111 + }
  112 +
  113 + self.whiteBgView.addSubview(self.changeLabel)
  114 + self.changeLabel.snp.makeConstraints { make in
  115 + make.centerY.equalTo(self.blueLineView.snp.centerY)
  116 + make.left.equalTo(30)
  117 + }
  118 +
  119 + }
  120 +
  121 + func loadData(){
  122 + self.dataArray = NSMutableArray(array: ["来华留学生","大学生"])
  123 + self.setDataUI()
  124 + }
  125 +
  126 + func setDataUI(){
  127 + var lieNum = 0//列
  128 + var hangNum = 0//行
  129 + let padding = adapt_length(length: 55)//水平方向
  130 + let topMargin = self.changeLabel.bottom + adapt_length(length: 15.5)
  131 + let btnPadding = adapt_length(length: 30)//垂直方向
  132 + let W = (KSreenWidth - 30 - 3*adapt_length(length: 55))/2
  133 + let H = W*136/90.0
  134 +
  135 + for str in self.dataArray {
  136 + let iconBtn = UIButton(frame: CGRect(x: padding+CGFloat(lieNum)*(padding+W), y: topMargin+CGFloat(hangNum)*(btnPadding+H), width: W, height: H))
  137 + iconBtn.setupButtonImageAndTitlePossitionWith(padding: 10, style: .top)
  138 + iconBtn.setTitle(str as? String, for: .normal)
  139 + iconBtn.setTitleColor(HexColor("#1F64E3"), for: .normal)
  140 + iconBtn.setTitleColor(HexColor("#333333"), for: .selected)
  141 + iconBtn.setImage(UIImage(named: ""), for: .normal)
  142 + iconBtn.setImage(UIImage(named: ""), for: .selected)
  143 + iconBtn.backgroundColor = .red
  144 + self.whiteBgView.addSubview(iconBtn)
  145 +
  146 + iconBtn.snp.makeConstraints { make in
  147 + make.left.equalTo(padding+CGFloat(lieNum)*(padding+W))
  148 + make.top.equalTo(self.changeLabel.snp.bottom).offset(adapt_length(length: 15.5)+CGFloat(hangNum)*(btnPadding+H))
  149 + make.width.equalTo(W)
  150 + make.height.equalTo(H)
  151 + }
  152 +
  153 + lieNum = lieNum + 1
  154 + if lieNum == 2{
  155 + hangNum = hangNum + 1
  156 + lieNum = 0
  157 + }
  158 + }
  159 + }
  160 +}
... ...
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
... ... @@ -8,7 +8,7 @@
8 8 import Foundation
9 9 import UIKit
10 10  
11   -//下滑tableview背景颜色
  11 +//下滑tableview背景颜色 浅灰色
12 12 let kCNDownSlideBackgroundColorHex: String = "#F7F8FA"
13 13  
14 14 ///CNliveDownSlideModel Type
... ... @@ -16,6 +16,8 @@ let SlideModelTypeRecommend4: String = &quot;4&quot;//4一排两个 推荐课程&amp;推荐活
16 16 let SlideModelTypeTodayRecommend74: String = "74"//74今日推荐
17 17 let SlideModelTypeAllCourse12: String = "12"//12列表全部课程
18 18 let SlideModelTypeOneCourse75: String = "75"//75单课程大图
  19 +let SlideModelTypeTwoDuanJu5: String = "5"//5竖版短剧 一排两个
  20 +let SlideModelTypeRealHotList7: String = "7"//7实时热榜
19 21  
20 22 class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{
21 23  
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
... ... @@ -3,7 +3,7 @@
3 3 // metaCode
4 4 //
5 5 // Created by zx on 2023/10/16.
6   -// 单课程大图专辑 | 全部课程列表 | 我的课程列表
  6 +// 单课程大图专辑 | 全部课程列表 | 我的课程列表 | 短剧竖图一排2个 | 实时热榜
7 7  
8 8  
9 9 import Foundation
... ... @@ -46,8 +46,12 @@ let DownSlideSingleCourseImgH: CGFloat = 345
46 46 let DownSlideSingleCourseMoreH: CGFloat = 60
47 47 ///单节课程 宽度
48 48 let DownSlideSingleCourseW: CGFloat = KSreenWidth - DownSlideRecommendLeftGap*2
  49 +//竖版短剧 副标题与底部间距
  50 +let DownSlideTwoDuanJuBottomYGap: CGFloat = 25
  51 +///竖版短剧标题左间距
  52 +let DownSlideTwoDuanJuLeftGap: CGFloat = 10
49 53  
50   -class CNDownSlideSingleCourseCell: UITableViewCell {
  54 +class CNDownSlideSingleCourseCell: UITableViewCell, UICollectionViewDelegate, UICollectionViewDataSource {
51 55  
52 56 let bgBackView = UIView()
53 57 let bgImageView = UIImageView()
... ... @@ -76,6 +80,26 @@ class CNDownSlideSingleCourseCell: UITableViewCell {
76 80 }
77 81 }
78 82  
  83 + //实时热榜的列表
  84 + lazy var realHotArr: NSMutableArray = {
  85 + var realHotArr = NSMutableArray()
  86 + return realHotArr
  87 + }()
  88 + let kRealHotListCollectionViewCellIdentifier = "kRealHotListCollectionViewCellIdentifier"
  89 + lazy var realHotCollectionView: UICollectionView = {
  90 + let layout = UICollectionViewFlowLayout()
  91 + layout.scrollDirection = .horizontal
  92 + layout.itemSize = CGSizeMake(69, 100+24)
  93 + layout.sectionInset = .init(top: 0, left: 0, bottom: 0, right: 0)
  94 + layout.minimumLineSpacing = 6
  95 + let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)
  96 + cv.delegate = self
  97 + cv.dataSource = self
  98 + cv.backgroundColor = .white
  99 + cv.register(CNLiveDownSlideRealHotListCell.self, forCellWithReuseIdentifier: kRealHotListCollectionViewCellIdentifier)
  100 + return cv
  101 + }()
  102 +
79 103 override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
80 104 super.init(style: style, reuseIdentifier: reuseIdentifier)
81 105 self.selectionStyle = .none
... ... @@ -243,9 +267,175 @@ class CNDownSlideSingleCourseCell: UITableViewCell {
243 267 moreImgView.left = moreLabel.right
244 268 moreImgView.centerY = moreLabel.centerY
245 269 singleCourseBottomView.addSubview(moreImgView)
  270 + }else if model.type == SlideModelTypeTwoDuanJu5 {
  271 + //竖版短剧 1排2个
  272 + contentView.addSubview(bgBackView)
  273 +
  274 + bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:CGFloat(model.cellH)-DownSlideRecommendLeftGap)
  275 + // 设置阴影效果
  276 + bgBackView.layer.masksToBounds = false
  277 + //定义view的阴影颜色
  278 + bgBackView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor
  279 + //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的
  280 + bgBackView.layer.shadowOpacity = 1
  281 + //定义view的阴影宽度,模糊计算的半径
  282 + bgBackView.layer.shadowRadius = 10.0
  283 + //阴影偏移量
  284 + bgBackView.layer.shadowOffset = CGSize(width: 0, height: 0)
  285 + bgBackView.layer.cornerRadius = 12
  286 + bgBackView.backgroundColor = .white
  287 +
  288 + var titleTop:CGFloat = DownSlideRecommendLeftGap
  289 + if model.blockSubTitle.count > 0{
  290 + let subtitleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 17))
  291 + subtitleLbl.text = model.blockSubTitle
  292 + subtitleLbl.font = Font_12
  293 + subtitleLbl.textColor = HexColor("#999999")
  294 + bgBackView.addSubview(subtitleLbl)
  295 + titleTop = DownSlideRecommendLeftGap+17+1
  296 + }
  297 + let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: titleTop, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30))
  298 + titleLbl.text = model.blockName
  299 + titleLbl.font = BoldFont_21
  300 + titleLbl.textColor = HexColor("#333333")
  301 + bgBackView.addSubview(titleLbl)
  302 +
  303 + //总块数
  304 + let contentsNum = model.contents.count
  305 + //model行数
  306 + let row = model.rowNum
  307 + //总显示块数
  308 + var totalNum = (contentsNum >= row*2) ? row*2 : contentsNum
  309 + if row == 0{//row为0 , contents全部显示
  310 + totalNum = contentsNum
  311 + }
  312 + //lieIndex 当前是contents的第0列还是第1列
  313 + var lieIndex = 0
  314 + //hangIndex 当前是第几行,1...n
  315 + var hangIndex = 1
  316 +
  317 + for i in 0..<totalNum{//i是第几行
  318 + var contentMdl = model.contents[i]
  319 + var imageX:CGFloat = 0
  320 + var imageY:CGFloat = 0
  321 +
  322 + if lieIndex == 0{
  323 + //显示左边的块
  324 + contentMdl = model.contents[(hangIndex-1)*2+(lieIndex)]
  325 + imageX = DownSlideRecommendLeftGap
  326 + imageY = titleLbl.bottom+DownSlideRecommendLeftGap+CGFloat(hangIndex-1)*(DownSlideTwoDuanJuImageH+DownSlideAllCourseRowTopYGap+56+DownSlideTwoDuanJuBottomYGap)
  327 + lieIndex = 1
  328 + }else{
  329 + //lieIndex==1显示右边的块
  330 + contentMdl = model.contents[(hangIndex-1)*2+(lieIndex)]
  331 + imageX = CGFloat(DownSlideRecommendLeftGap*2)+CGFloat(DownSlideTwoDuanJuImageW)
  332 + imageY = titleLbl.bottom+DownSlideRecommendLeftGap+CGFloat(hangIndex-1)*(DownSlideTwoDuanJuImageH+DownSlideAllCourseRowTopYGap+56+DownSlideTwoDuanJuBottomYGap)
  333 + lieIndex = 0
  334 + hangIndex += 1
  335 + }
  336 + let imageView = UIImageView(frame: CGRectMake(imageX, imageY, CGFloat(DownSlideTwoDuanJuImageW), CGFloat(DownSlideTwoDuanJuImageH)))
  337 + imageView.kf.setImage(with: URL(string:contentMdl.poster ))
  338 + let path = UIBezierPath.init(roundedRect: CGRect(x: 0, y: 0, width: imageView.width, height:imageView.height ), byRoundingCorners: [.topLeft,.topRight], cornerRadii: CGSizeMake(10, 10))
  339 + let masklayer = CAShapeLayer()
  340 + masklayer.path = path.cgPath
  341 + imageView.layer.mask = masklayer
  342 + imageView.clipsToBounds = true
  343 + imageView.tag = i
  344 + imageView.contentMode = .scaleAspectFill
  345 + imageView.isUserInteractionEnabled = true
  346 + imageView.addGestureRecognizer(UITapGestureRecognizer.init(target: self, action: #selector(pushWebAction)))
  347 + bgBackView.addSubview(imageView)
  348 +
  349 +
  350 + let grayBgView = UIView(frame: CGRect(x: imageView.left, y: imageView.bottom, width: imageView.width, height: 0))
  351 + grayBgView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex)
  352 + bgBackView.addSubview(grayBgView)
  353 + grayBgView.snp.makeConstraints { make in
  354 + make.left.equalTo(imageView.snp.left)
  355 + make.top.equalTo(imageView.snp.bottom)
  356 + make.width.equalTo(imageView.snp.width)
  357 + make.bottom.equalToSuperview().offset(-DownSlideRecommendLeftGap)
  358 + }
  359 +
  360 + let titleLbl = UILabel(frame: CGRect(x: imageView.left+DownSlideTwoDuanJuLeftGap, y: imageView.bottom+DownSlideTwoDuanJuLeftGap, width:imageView.width-2*DownSlideTwoDuanJuLeftGap, height: 20))
  361 + titleLbl.text = contentMdl.title
  362 + titleLbl.font = Font_14
  363 + titleLbl.textColor = HexColor("#333333")
  364 + bgBackView.addSubview(titleLbl)
  365 +
  366 + let subTitleLbl = UILabel(frame: CGRect(x: titleLbl.left, y:titleLbl.bottom+3 , width: titleLbl.width, height: 33))
  367 + subTitleLbl.text = contentMdl.subTitle
  368 + subTitleLbl.font = Font_12
  369 + subTitleLbl.textColor = HexColor("#999999")
  370 + subTitleLbl.sizeToFit()
  371 + let subLblWidth = subTitleLbl.bounds.size.width
  372 + if subLblWidth > titleLbl.width{
  373 + subTitleLbl.numberOfLines = 2
  374 + subTitleLbl.width = titleLbl.width
  375 + subTitleLbl.height = 33
  376 + }else{
  377 + subTitleLbl.numberOfLines = 1
  378 + subTitleLbl.width = titleLbl.width
  379 + subTitleLbl.height = subTitleLbl.bounds.size.height
  380 + }
  381 + bgBackView.addSubview(subTitleLbl)
  382 +
  383 + }
  384 + }else if model.type == SlideModelTypeRealHotList7 {
  385 + //实时热榜
  386 + contentView.addSubview(bgBackView)
  387 +
  388 + bgBackView.frame = CGRect(x: DownSlideRecommendLeftGap, y: 0,width:DownSlideSingleCourseW , height:CGFloat(model.cellH))
  389 + // 设置阴影效果
  390 + bgBackView.layer.masksToBounds = false
  391 + //定义view的阴影颜色
  392 + bgBackView.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor
  393 + //定义view的阴影透明度,注意:如果view没有设置背景色阴影也是不会显示的
  394 + bgBackView.layer.shadowOpacity = 1
  395 + //定义view的阴影宽度,模糊计算的半径
  396 + bgBackView.layer.shadowRadius = 10.0
  397 + //阴影偏移量
  398 + bgBackView.layer.shadowOffset = CGSize(width: 0, height: 0)
  399 + bgBackView.layer.cornerRadius = 12
  400 + bgBackView.backgroundColor = .white
  401 +
  402 + let imageView = UIImageView(frame: CGRectMake(0, 0, bgBackView.width, CGFloat(bgBackView.width*140/345.0)))
  403 + imageView.kf.setImage(with: URL(string:model.background))
  404 + let path = UIBezierPath.init(roundedRect: CGRect(x: 0, y: 0, width: imageView.width, height:imageView.height), byRoundingCorners: [.topLeft,.topRight], cornerRadii: CGSizeMake(10, 10))
  405 + let masklayer = CAShapeLayer()
  406 + masklayer.path = path.cgPath
  407 + imageView.layer.mask = masklayer
  408 + imageView.clipsToBounds = true
  409 + imageView.contentMode = .scaleAspectFill
  410 + bgBackView.addSubview(imageView)
  411 +
  412 + bgBackView.addSubview(self.realHotCollectionView)
  413 + self.realHotCollectionView.frame = CGRect(x: DownSlideRecommendLeftGap, y: imageView.bottom, width: imageView.width-2*DownSlideRecommendLeftGap, height: bgBackView.height-imageView.height)
  414 + self.realHotArr = NSMutableArray(array: model.contents)
  415 + self.realHotCollectionView.reloadData()
246 416 }
247 417 }
248 418  
  419 + // MARK: - 实时热榜里横向列表
  420 + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
  421 + self.realHotArr.count
  422 + }
  423 +
  424 + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  425 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kRealHotListCollectionViewCellIdentifier, for: indexPath) as! CNLiveDownSlideRealHotListCell
  426 + cell.num = indexPath.row+1
  427 + // 加载和设置图片到 cell.imageView
  428 + cell.contentsModel = self.realHotArr[indexPath.row] as? CNLiveDownSlideContentsModel
  429 + return cell
  430 +
  431 + }
  432 + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  433 + if let contentMdl = self.realHotArr[indexPath.row] as? CNLiveDownSlideContentsModel{
  434 + CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil)
  435 + }
  436 + }
  437 +
  438 +
249 439 func setupMyCurriculumUI(model:CNLiveAlbumBaseModel){
250 440 contentView.subviews.forEach { view in
251 441 view.removeFromSuperview()
... ... @@ -334,4 +524,10 @@ class CNDownSlideSingleCourseCell: UITableViewCell {
334 524 CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: contentMdl?.model ?? "", contentId: contentMdl?.contentId ?? "", pid: contentMdl?.pid ?? "", shareUrl: contentMdl?.shareUrl ?? "", thirdUrl: contentMdl?.thirdUrl ?? "", title: contentMdl?.title ?? "", s_to: contentMdl?.s_to ?? "",trailerId: contentMdl?.trailerId ?? "", controller: nil)
335 525 }
336 526 }
  527 + @objc func pushWebAction(ges: UITapGestureRecognizer){
  528 + let imageView = ges.view as! UIImageView
  529 + let i = imageView.tag
  530 + let contentMdl = (self.slideModel?.contents[i])!
  531 + CNLiveDownSlideTool.pushWebVCWithContentsMdl(model: contentMdl.model , contentId: contentMdl.contentId , pid: contentMdl.pid , shareUrl: contentMdl.shareUrl , thirdUrl: contentMdl.thirdUrl , title: contentMdl.title , s_to: contentMdl.s_to ,trailerId: contentMdl.trailerId , controller: nil)
  532 + }
337 533 }
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNLiveDownSlideRealHotListCell.swift 0 → 100644
  1 +//
  2 +// CNLiveDownSlideRealHotListCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2024/5/11.
  6 +// 实时热榜里的 水平列表cell
  7 +
  8 +import Foundation
  9 +import Kingfisher
  10 +
  11 +class CNLiveDownSlideRealHotListCell: UICollectionViewCell {
  12 +
  13 + //是前三
  14 + var num = 0//第几
  15 +
  16 + //contentsModel
  17 + var _contentsModel : CNLiveDownSlideContentsModel?
  18 + var contentsModel : CNLiveDownSlideContentsModel? {
  19 + get{
  20 + _contentsModel
  21 + }
  22 + set{
  23 + _contentsModel = newValue!
  24 + setupNewUI(model: _contentsModel!)
  25 + }
  26 + }
  27 +
  28 + lazy var iconImgView :UIImageView = {
  29 + let iconImgView = UIImageView(frame: CGRect(x: 0, y: 0, width: 69, height: 100))
  30 + iconImgView.contentMode = .scaleAspectFill
  31 + iconImgView.clipsToBounds = true
  32 + return iconImgView
  33 + }()
  34 +
  35 + lazy var titleLabel: UILabel = {
  36 + let titleLabel = UILabel.init(frame: CGRectMake(0, self.iconImgView.bottom+5, self.iconImgView.width, 19))
  37 + titleLabel.textColor = HexColor("#333333")
  38 + titleLabel.textAlignment = .left
  39 + titleLabel.font = BoldFont_13
  40 + return titleLabel
  41 + }()
  42 +
  43 + //第一第二第三角标
  44 + lazy var firstIconView :UIImageView = {
  45 + let layerView = UIImageView()
  46 + layerView.frame = CGRect(x: 5, y: 0, width: 20, height: 17)
  47 + return layerView
  48 + }()
  49 +
  50 + override init(frame: CGRect) {
  51 + super.init(frame: frame)
  52 + self.contentView.addSubview(self.iconImgView)
  53 + self.contentView.addSubview(self.titleLabel)
  54 + self.contentView.addSubview(self.firstIconView)
  55 + self.firstIconView.isHidden = true
  56 + }
  57 +
  58 + required init?(coder: NSCoder) {
  59 + fatalError("init(coder:) has not been implemented")
  60 + }
  61 +
  62 + func setupNewUI(model:CNLiveDownSlideContentsModel){
  63 + self.iconImgView.kf.setImage(with: URL(string:model.poster))
  64 + self.titleLabel.text = model.title
  65 + if self.num == 1{
  66 + self.firstIconView.isHidden = false
  67 + self.firstIconView.image = UIImage(named: "")
  68 + }else if self.num == 2{
  69 + self.firstIconView.isHidden = false
  70 + self.firstIconView.image = UIImage(named: "")
  71 + }else if self.num == 3{
  72 + self.firstIconView.isHidden = false
  73 + self.firstIconView.image = UIImage(named: "")
  74 + }else{
  75 + self.firstIconView.isHidden = true
  76 + }
  77 + }
  78 +}
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNLiveDownSlideRecommendCell.swift
... ... @@ -11,6 +11,15 @@ import Foundation
11 11 let DownSlideRecommendLeftGap: CGFloat = 15
12 12 ///推荐课程宽高
13 13 let DownSlideRecommendWH: CGFloat = (KSreenWidth-DownSlideRecommendLeftGap*3)*0.5
  14 +///type5 竖版短剧图片的高
  15 +let DownSlideTwoDuanJuImageH: CGFloat = 217/150.0*DownSlideRecommendWH
  16 +///type5 竖版短剧图片的宽
  17 +let DownSlideTwoDuanJuImageW: CGFloat = (KSreenWidth-DownSlideRecommendLeftGap*5)*0.5
  18 +///type5 竖版短剧cell的高
  19 +let DownSlideTwoDuanJuH: CGFloat = 15+17+30+15+217/150.0*DownSlideRecommendWH+10+20+3+33+25+10
  20 +///type7 实时热榜的高
  21 +let DownSlideRealHotListH: CGFloat = CGFloat(DownSlideSingleCourseW*140/345.0)+154
  22 +
14 23  
15 24  
16 25 class CNLiveDownSlideRecommendCell: UITableViewCell {
... ...
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
... ... @@ -787,6 +787,11 @@ class CNFrontMainView : UIView{
787 787  
788 788 //弹出弹窗
789 789 func show17Alert(index:Int){
  790 +
  791 + //test
  792 + navigationViewController().pushViewController(CNLiveDigitalAuthController(), animated: true)
  793 +
  794 +
790 795 delegate.window?.addSubview(self.alertBgView)
791 796 delegate.window?.addSubview(self.alertBgImgView)
792 797 alertBgImgView.snp.makeConstraints { make in
... ...
metaCode/Classes/Main/HomePages/Controller/HomeController/CNLiveAuthViewController.swift
... ... @@ -8,21 +8,14 @@
8 8 import Foundation
9 9 import MJRefresh
10 10 class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITableViewDataSource{
11   -
12   - //下滑tableview背景颜色 浅灰色
13   - let kCNDownSlideBackgroundColorHex: String = "#F7F8FA"
14   -
15   - ///CNliveDownSlideModel Type
16   - let SlideModelTypeRecommend4: String = "4"//4一排两个 推荐课程&推荐活动
17   - let SlideModelTypeTodayRecommend74: String = "74"//74今日推荐
18   - let SlideModelTypeAllCourse12: String = "12"//12列表全部课程
19   - let SlideModelTypeOneCourse75: String = "75"//75单课程大图
20   -
  11 +
21 12 let kCNLiveDownSlideAllCourseCellIdentifier = "kCNLiveDownSlideAllCourseCellIdentifier"
22 13 let kCNLiveDownSlideRecommendCellIdentifier = "kCNLiveDownSlideRecommendCellIdentifier"
23 14 let kCNLiveDownSlideTodayRecommendCellIdentifier = "kCNLiveDownSlideTodayRecommendCellIdentifier"
24 15 let kCNLiveDownSlideSingleCourseCellIdentifier = "kCNLiveDownSlideSingleCourseCellIdentifier"
25 16 let kCNLiveHomePageDuanJuCellIdentifier = "kCNLiveHomePageDuanJuCellIdentifier"
  17 + let kCNLiveDownSlideTwoDuanJuCellIdentifier = "kCNLiveDownSlideTwoDuanJuCellIdentifier"
  18 + let kCNLiveDownSlideRealHotListCellIdentifier = "kCNLiveDownSlideRealHotListCellIdentifier"
26 19  
27 20 var isHaveDuanJU = false//是否有在追短剧
28 21 var totolNum = 0//一共显示多少行cell
... ... @@ -80,6 +73,10 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa
80 73 tableView.register(CNLiveDownSlideTodayRecommendCell.self, forCellReuseIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier)
81 74 tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideAllCourseCellIdentifier)
82 75 tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier:kCNLiveDownSlideSingleCourseCellIdentifier)
  76 +
  77 + tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier:kCNLiveDownSlideTwoDuanJuCellIdentifier)
  78 + tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier:kCNLiveDownSlideRealHotListCellIdentifier)
  79 +
83 80 tableView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex)
84 81 return tableView
85 82 }()
... ... @@ -164,6 +161,22 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa
164 161 }
165 162 cell.slideModel = slideModel
166 163 return cell
  164 + }else if slideModel.type == SlideModelTypeTwoDuanJu5{
  165 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideTwoDuanJuCellIdentifier) as? CNDownSlideSingleCourseCell
  166 + else {
  167 + let cell = CNDownSlideSingleCourseCell()
  168 + return cell
  169 + }
  170 + cell.slideModel = slideModel
  171 + return cell
  172 + }else if slideModel.type == SlideModelTypeRealHotList7{
  173 + guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideRealHotListCellIdentifier) as? CNDownSlideSingleCourseCell
  174 + else {
  175 + let cell = CNDownSlideSingleCourseCell()
  176 + return cell
  177 + }
  178 + cell.slideModel = slideModel
  179 + return cell
167 180 }else{
168 181 return UITableViewCell()
169 182 }
... ... @@ -346,7 +359,12 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa
346 359 if let model = slideModel as? CNLiveDownSlideModel{
347 360  
348 361 let layout = CNLiveDownSlideModelLayout.init(model: model)
349   - newDataArray.addObjects(from: [layout.getCellHModel()])
  362 + let cellModel = layout.getCellHModel()
  363 + if cellModel.blockId == "11939"{
  364 + newDataArray.insert(cellModel, at: 0)
  365 + }else{
  366 + newDataArray.addObjects(from: [cellModel])
  367 + }
350 368 }
351 369 }
352 370 self.dataArray.addObjects(from: newDataArray as! [Any])
... ...
metaCode/Classes/Main/HomePages/Model/CNLiveAlbumMsgModel.swift
... ... @@ -24,7 +24,7 @@ class CNLiveAlbumMsgModel:BaseModel{
24 24 var episodeAll = ""
25 25 var subscriptions = ""
26 26 var subscribe = false
27   - var episodeLast = ""
28   - var contentIdLast = ""
  27 + var episodeLast = 1//上次播放集数
  28 + var contentIdLast = ""//上次播放集的id
29 29 var collection = false //是否追剧
30 30 }
... ...
metaCode/Classes/Main/Model/CNLiveDownSlideModelLayout.swift
... ... @@ -58,9 +58,22 @@ class CNLiveDownSlideModelLayout:NSObject{
58 58 }else if(_slideModel?.type == SlideModelTypeOneCourse75){//单节课程
59 59  
60 60 _slideModel?.cellH = Float(DownSlideSingleCourseImgH + DownSlideSingleCourseMoreH+DownSlideRecommendLeftGap)
  61 + }else if(_slideModel?.type == SlideModelTypeTwoDuanJu5){//竖版短剧 一排2个
  62 +
  63 + //总显示块数/循环数
  64 + var totalNum = (contentsNum >= row*2) ? row*2 : contentsNum
  65 + if row == 0{//row为0 , contents全部显示
  66 + totalNum = contentsNum
  67 + }
  68 + _slideModel?.cellH = Float(ceil(CGFloat(totalNum)*0.5)*(DownSlideTwoDuanJuH))
  69 + }else if(_slideModel?.type == SlideModelTypeRealHotList7){//7实时热榜
  70 +
  71 + _slideModel?.cellH = Float(DownSlideRealHotListH)//+Float(DownSlideRecommendLeftGap)
61 72 }else{
62 73 _slideModel?.cellH = 0
63 74 }
  75 +
  76 +
64 77 }
65 78 func getCellHModel()->CNLiveDownSlideModel{
66 79 return _slideModel!
... ...
metaCode/Classes/Main/Util/CNLiveDownSlideTool.swift
... ... @@ -83,7 +83,6 @@ class CNLiveDownSlideTool:NSObject{
83 83 navigationViewController().visibleViewController?.navigationController?.pushViewController(webVC, animated: pushAnimated)
84 84 }
85 85 }else if (model == kCNDownSlideContentsModelModelAlbum_ugc){
86   -
87 86 //短剧-跳转短剧播放页
88 87 navigationViewController().visibleViewController?.navigationController?.pushViewController(CNLiveShortVideoViewController(aid: contentId), animated: pushAnimated)
89 88 }else if model == kCNDownSlideContentsModelModelServing{
... ...
metaCode/Classes/Main/VideoPage/Controller/CNLiveShortVideoViewController.swift
... ... @@ -74,9 +74,9 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele
74 74  
75 75  
76 76 var aid: String! = ""
77   - var pageNum: NSInteger! = 1
  77 + var pageNum: NSInteger! = 1//页数
78 78 var isSelectable: Bool! = false
79   - var currentIndex: NSInteger! = 0
  79 + var currentIndex: NSInteger! = 0//播放集数
80 80 var pickerView: CNLiveShortVideoContentListView!
81 81 var footerRefreshView: CNLiveFooterRefresh!
82 82 // var playerManager = ZFIJKPlayerManager.init()
... ... @@ -109,6 +109,18 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele
109 109 super.init(nibName:nil, bundle:nil)
110 110 }
111 111  
  112 + /// 初始化播放器,第多少集
  113 + /// - Parameter aid: 专辑 id ,第多少集
  114 + init(aid: String,currentIndex: NSInteger) {
  115 + self.aid = aid
  116 + self.isSelectable = false
  117 + self.currentIndex = currentIndex
  118 + super.init(nibName:nil, bundle:nil)
  119 + let page = self.roundUpToNearestTen(currentIndex)
  120 + self.pageNum = page/10
  121 +
  122 + }
  123 +
112 124 override func viewWillAppear(_ animated: Bool) {
113 125 super.viewWillAppear(animated)
114 126 if self.dataArray.count > 0 && self.isSelectable {
... ... @@ -323,6 +335,17 @@ class CNLiveShortVideoViewController : CNLiveBaseViewController, UITableViewDele
323 335 controlView.resetControlView()
324 336 controlView.showCoverView(withUrl: data.poster)
325 337 }
  338 + //10倍数向上取整
  339 + func roundUpToNearestTen(_ number: Int) -> Int {
  340 + // 如果余数为0,则已经是10的倍数
  341 + if number % 10 == 0 {
  342 + return number
  343 + } else {
  344 + // 否则,向上取整到最近的10的倍数
  345 + // 可以通过除以10,向上取整,然后再乘以10来得到结果
  346 + return ((number + 9) / 10) * 10
  347 + }
  348 + }
326 349  
327 350 deinit {
328 351 NotificationCenter.default.removeObserver(self)
... ...
metaCode/Supporting Files/Assets.xcassets/AuthPage/Contents.json 0 → 100644
  1 +{
  2 + "info" : {
  3 + "author" : "xcode",
  4 + "version" : 1
  5 + }
  6 +}
... ...
metaCode/Supporting Files/Assets.xcassets/AuthPage/auth_blueBg.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "auth_blueBg@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "filename" : "auth_blueBg@3x.png",
  14 + "idiom" : "universal",
  15 + "scale" : "3x"
  16 + }
  17 + ],
  18 + "info" : {
  19 + "author" : "xcode",
  20 + "version" : 1
  21 + }
  22 +}
... ...
metaCode/Supporting Files/Assets.xcassets/AuthPage/auth_blueBg.imageset/auth_blueBg@2x.png 0 → 100644

513 KB

metaCode/Supporting Files/Assets.xcassets/AuthPage/auth_blueBg.imageset/auth_blueBg@3x.png 0 → 100644

1.16 MB