Commit 31e264ee authored by yqz's avatar yqz

Merge branch 'develop-taorui' into yQz0710

* develop-taorui:
  feat: 数据页面代码提交
  feat :首页UI

# Conflicts:
#	SpeakEasyLearnEnglish/SpeakEasyLearnEnglish/Classes/AppDelegate/AppDelegate.swift
#	SpeakEasyLearnEnglish/SpeakEasyLearnEnglish/Classes/Pages/HomePage/SpeakEleHomeViewCtr.swift
#	SpeakEasyLearnEnglish/SpeakEasyLearnEnglish/Classes/Pages/HomePage/SpeakEleHomeViewCtr.xib
parents 889b5118 06999bdc
{
"images" : [
{
"filename" : "sp-home-Back-Top.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-Back-Top@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-Back-Top@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-Start-Blue.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-Start-Blue@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-Start-Blue@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-Start-Green.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-Start-Green@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-Start-Green@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-Start-Red.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-Start-Red@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-Start-Red@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-Start-Yellow.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-Start-Yellow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-Start-Yellow@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-blue.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-blue@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-blue@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-gray.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-gray@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-gray@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-green.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-green@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-green@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-orange.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-orange@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-orange@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-red.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-red@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-red@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-xyellow.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-xyellow@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-xyellow@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-book.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-book@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-book@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-clock.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-clock@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-clock@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-fire.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-fire@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-fire@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-flag.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-fresh.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-fresh@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-fresh@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-headerivar.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-pro.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-pro@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-pro@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-xuxianL.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-xuxianL@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-xuxianL@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-home-xuxianR.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-home-xuxianR@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-home-xuxianR@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-progress-Check.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-progress-Check@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-progress-Check@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-progress-Lfire.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-progress-Lfire@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-progress-Lfire@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "sp-progress-Mfire.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "sp-progress-Mfire@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sp-progress-Mfire@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -17,7 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -17,7 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
initData() initData()
// SpeakElePublicManager.share.PublicData.state = .home SpeakElePublicManager.share.PublicData.state = .home
#if DEBUG #if DEBUG
// // 获取所有可用字体家族名称 // // 获取所有可用字体家族名称
// let fontFamilyNames = UIFont.familyNames // let fontFamilyNames = UIFont.familyNames
......
...@@ -46,9 +46,17 @@ class SpeakEleTabbarViewCtr: UIViewController { ...@@ -46,9 +46,17 @@ class SpeakEleTabbarViewCtr: UIViewController {
self.addChild(setvc) self.addChild(setvc)
contentStack.addArrangedSubview(setvc.view) contentStack.addArrangedSubview(setvc.view)
let pro = TabbarButton(title: "Progress", normalImage: nil, selectImage: nil)
let provc = SpeakEleProgressViewCtr()
self.addChild(provc)
contentStack.addArrangedSubview(provc.view)
tabBarItems = [ tabBarItems = [
home, home,
set set,
pro
] ]
for (i,btn) in tabBarItems.enumerated() { for (i,btn) in tabBarItems.enumerated() {
btn.tag = i btn.tag = i
......
...@@ -39,3 +39,28 @@ public func Print(_ items: Any..., ...@@ -39,3 +39,28 @@ public func Print(_ items: Any...,
#else #else
#endif #endif
} }
/// 状态栏高度
var statusBarHeight: CGFloat {
// UIApplication.shared.statusBarFrame.height
UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0.00
}
/// 导航栏高度
var naviBarHeight: CGFloat {
UINavigationController().navigationBar.frame.size.height
}
/// Tabbar高度
var tabbarHeight: CGFloat {
49.0 + tabbarSpace
}
/// Tabbar安全区域高度
var tabbarSpace: CGFloat {
isIphoneNotch ? 34 : 0
}
/// 是否刘海屏
var isIphoneNotch: Bool {
statusBarHeight > 20
}
...@@ -6,36 +6,123 @@ ...@@ -6,36 +6,123 @@
// //
import UIKit import UIKit
import SnapKit
class SpeakEleHomeViewCtr: SpeakEleBaseViewCtr { class SpeakEleHomeViewCtr: SpeakEleBaseViewCtr {
@IBOutlet weak var PlayerView: UIView! @IBOutlet weak var headerBoard: UIView!
lazy var mainScrollview: UIScrollView = {
let sView = UIScrollView()
sView.isUserInteractionEnabled = true
sView.isScrollEnabled = true
return sView
}()
lazy var levellb: UILabel = {
let lLabel = UILabel()
lLabel.text = "Entry-level"
lLabel.font = UIFont.montserrat(.regular ,size: 16)
lLabel.textColor = UIColor.init(with: "#000000", alpha: 0.4)
return lLabel
}()
lazy var leftline: UIView = {
let lineView = UIView()
lineView.backgroundColor = UIColor.init(with: "#000000", alpha: 0.4)
return lineView
}()
lazy var rightline: UIView = {
let lineV = UIView()
lineV.backgroundColor = UIColor.init(with: "#000000", alpha: 0.4)
return lineV
}()
lazy var topButton: UIButton = {
let button = UIButton.init(type: .custom)
button.setImage(UIImage(named: "sp-home-Back-Top"), for: .normal)
return button
}()
@IBOutlet weak var inputText: UITextField!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
makeUI()
makeLessonUI()
Print("输出状态栏高度\(statusBarHeight)")
} }
var index = 4
var lessonIndex = 9
func makeUI() {
self.view.insertSubview(mainScrollview, belowSubview: headerBoard)
self.view.addSubview(topButton)
mainScrollview.addSubview(levellb)
mainScrollview.addSubview(leftline)
mainScrollview.addSubview(rightline)
@IBAction func voice(_ sender: Any) { mainScrollview.snp.makeConstraints { make in
self.view.layoutIfNeeded() make.top.equalTo(statusBarHeight + 137.0)
let sss = ["Practice Sanfu in summer and Sanjiu in winter, but on hot and humid Sanfu days, a slight movement can cause sweating and discomfort to the body.So what are the recommendations for exercising during the dog days when you want to maintain your health but don't want to sweat too much?","Hello, let's start learning the first lesson"] make.left.equalTo(24)
make.right.equalTo(-24)
make.bottom.equalTo(-100)
}
let i = 0 levellb.snp.makeConstraints { make in
let text = sss[i]//inputText.text ?? "" make.centerX.equalToSuperview()
make.top.equalTo(24)
}
let playerLayer = SpeakVideoPlayer.share.playerLayers leftline.snp.makeConstraints { make in
playerLayer?.frame = PlayerView.bounds make.centerY.equalTo(levellb)
PlayerView.layer.addSublayer(playerLayer ?? CALayer()) make.right.equalTo(levellb.snp.left).offset(-8)
make.left.equalTo(16)
make.height.equalTo(0.6)
}
let sb = [15.07,2.65] rightline.snp.makeConstraints { make in
let secend = sb[i] make.left.equalTo(levellb.snp.right).offset(8)
let num = ceil(secend / 4.3) make.centerY.equalTo(levellb)
let rate = (num * 4.3) / secend make.right.equalTo(self.view.snp.right).offset(-40)
SpeakVideoPlayer.share.videoPlayer(rate,playCount: Int(num)) make.height.equalTo(0.6)
SpeakSpeechSynthesizer.share.speakText(text)
} }
topButton.snp.makeConstraints { make in
make.bottom.equalTo(-(tabbarHeight + 26))
make.right.equalTo(self.view.snp.right).offset(-16)
make.width.height.equalTo(48)
}
}
func makeLessonUI() {
let btnW = 96, btnH = 176
mainScrollview.contentSize = CGSize(width: mainScrollview.bounds.width, height: 1000)
for num in 0...index {
let bx = num % 2 == 0 ? -160 : -20
let backV = UIImageView(frame: CGRect(x: Int((Dev.screenW))/2 + bx, y: num * 158 + 100, width: 141, height: 162))
let iname = num % 2 == 0 ? "sp-home-xuxianL" : "sp-home-xuxianR"
backV.image = UIImage(named: iname)
mainScrollview.addSubview(backV)
}
for num in 0...lessonIndex {
let lview = SpeakEleLessionView()
lview.setColor(type: num)
if num == 0 {
lview.frame = CGRect(x: Int((Dev.screenW))/2-70, y: 55, width: btnW, height: btnH)
} else if num == 1{
lview.frame = CGRect(x: Int((Dev.screenW))/2-70, y: 55 + 56 + 96, width: btnW, height: btnH)
} else if num % 4 == 0{
lview.frame = CGRect(x: Int((Dev.screenW))/2-195, y: 120 + num * 80, width: btnW, height: btnH)
} else if num % 2 == 0{
lview.frame = CGRect(x: Int((Dev.screenW))/2+61, y: 120 + num * 80, width: btnW, height: btnH)
} else {
lview.frame = CGRect(x: Int((Dev.screenW))/2-70, y: 120 + num * 80, width: btnW, height: btnH)
}
mainScrollview.addSubview(lview)
}
}
} }
...@@ -5,14 +5,12 @@ ...@@ -5,14 +5,12 @@
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
<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>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SpeakEleHomeViewCtr" customModule="SpeakEasyLearnEnglish" customModuleProvider="target"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SpeakEleHomeViewCtr" customModule="SpeakEasyLearnEnglish" customModuleProvider="target">
<connections> <connections>
<outlet property="PlayerView" destination="jZl-V1-ZlM" id="NAM-XZ-wEr"/> <outlet property="headerBoard" destination="REb-HE-Vml" id="lGL-iY-VAQ"/>
<outlet property="inputText" destination="W3R-0H-fep" id="HP3-d9-aiS"/>
<outlet property="view" destination="Ia2-3z-Nib" id="Fy8-sN-P1j"/> <outlet property="view" destination="Ia2-3z-Nib" id="Fy8-sN-P1j"/>
</connections> </connections>
</placeholder> </placeholder>
...@@ -21,49 +19,194 @@ ...@@ -21,49 +19,194 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="bezel" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="W3R-0H-fep"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KYz-Od-c9d">
<rect key="frame" x="23" y="521" width="347" height="55"/> <rect key="frame" x="24" y="61" width="345" height="32"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="4/15" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1hR-HR-b4Q">
<rect key="frame" x="153.66666666666666" y="6" width="38" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="38" id="57i-mX-BL7"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.40000000000000002" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="14"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sp-home-book" translatesAutoresizingMaskIntoConstraints="NO" id="ZYV-ly-QrE">
<rect key="frame" x="127.66666666666666" y="6" width="20" height="20"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="55" id="S4g-gl-gR4"/> <constraint firstAttribute="width" constant="20" id="2CW-Hf-zyG"/>
<constraint firstAttribute="height" constant="20" id="Aze-eo-bYF"/>
</constraints> </constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sp-home-fire" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7m4-Wx-5Q0">
<rect key="frame" x="219.66666666666666" y="6" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="lIT-V0-uxe"/>
<constraint firstAttribute="width" constant="20" id="otG-Wl-FT5"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CUh-Zu-Er0">
<rect key="frame" x="245.66666666666669" y="6" width="8.6666666666666572" height="20"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <color key="textColor" red="1" green="0.46666666666666667" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</textField> <nil key="highlightedColor"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jZl-V1-ZlM"> </label>
<rect key="frame" x="0.0" y="118" width="393" height="393"/> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sp-home-pro" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6i4-DD-Z6D">
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <rect key="frame" x="266" y="0.0" width="79" height="32"/>
<constraints>
<constraint firstAttribute="width" constant="79" id="3Yf-aD-41E"/>
<constraint firstAttribute="height" constant="32" id="tPz-5F-LSa"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleAspectFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sJj-EU-5LT">
<rect key="frame" x="0.0" y="0.0" width="32" height="32"/>
<constraints> <constraints>
<constraint firstAttribute="width" secondItem="jZl-V1-ZlM" secondAttribute="height" id="fYx-ZS-O6I"/> <constraint firstAttribute="height" constant="32" id="5nB-t9-hQQ"/>
<constraint firstAttribute="width" constant="32" id="eEK-Xw-XF9"/>
</constraints> </constraints>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" image="sp-home-flag"/>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="6i4-DD-Z6D" secondAttribute="trailing" id="1aW-NL-GBr"/>
<constraint firstItem="7m4-Wx-5Q0" firstAttribute="centerY" secondItem="KYz-Od-c9d" secondAttribute="centerY" id="AE3-YR-JQu"/>
<constraint firstItem="CUh-Zu-Er0" firstAttribute="firstBaseline" secondItem="1hR-HR-b4Q" secondAttribute="firstBaseline" id="IYK-WU-6hL"/>
<constraint firstItem="sJj-EU-5LT" firstAttribute="top" secondItem="KYz-Od-c9d" secondAttribute="top" id="MSf-08-mAE"/>
<constraint firstItem="7m4-Wx-5Q0" firstAttribute="leading" secondItem="1hR-HR-b4Q" secondAttribute="trailing" constant="28" id="Nv2-Ko-NWv"/>
<constraint firstItem="CUh-Zu-Er0" firstAttribute="centerY" secondItem="7m4-Wx-5Q0" secondAttribute="centerY" id="RXv-HS-6gA"/>
<constraint firstItem="1hR-HR-b4Q" firstAttribute="centerY" secondItem="ZYV-ly-QrE" secondAttribute="centerY" id="UX5-zd-GWs"/>
<constraint firstItem="1hR-HR-b4Q" firstAttribute="top" secondItem="ZYV-ly-QrE" secondAttribute="top" id="VGK-UZ-OIR"/>
<constraint firstItem="1hR-HR-b4Q" firstAttribute="leading" secondItem="ZYV-ly-QrE" secondAttribute="trailing" constant="6" id="Zkt-UH-J7s"/>
<constraint firstItem="sJj-EU-5LT" firstAttribute="leading" secondItem="KYz-Od-c9d" secondAttribute="leading" id="ha0-pM-OHF"/>
<constraint firstItem="CUh-Zu-Er0" firstAttribute="leading" secondItem="7m4-Wx-5Q0" secondAttribute="trailing" constant="6" id="pUv-yc-xQf"/>
<constraint firstAttribute="height" constant="32" id="qdI-ox-YhX"/>
<constraint firstItem="1hR-HR-b4Q" firstAttribute="centerX" secondItem="KYz-Od-c9d" secondAttribute="centerX" id="tUm-2k-Mmi"/>
<constraint firstAttribute="bottom" secondItem="sJj-EU-5LT" secondAttribute="bottom" id="uDt-QJ-E48"/>
<constraint firstItem="ZYV-ly-QrE" firstAttribute="centerY" secondItem="KYz-Od-c9d" secondAttribute="centerY" id="v9c-Dw-pQJ"/>
<constraint firstItem="6i4-DD-Z6D" firstAttribute="centerY" secondItem="KYz-Od-c9d" secondAttribute="centerY" id="xZB-Yz-zyg"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y0g-g8-kpr"> <view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="REb-HE-Vml">
<rect key="frame" x="23" y="599" width="347" height="35"/> <rect key="frame" x="24" y="119" width="345" height="79"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sp-home-headerivar" translatesAutoresizingMaskIntoConstraints="NO" id="pAk-N9-Dv6">
<rect key="frame" x="16" y="16" width="48" height="48"/>
<constraints>
<constraint firstAttribute="height" constant="48" id="BJn-Tb-506"/>
<constraint firstAttribute="width" constant="48" id="Wrc-M6-xgP"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="24"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Amelia" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GO5-4q-Wtk">
<rect key="frame" x="80" y="16" width="157" height="28"/>
<constraints>
<constraint firstAttribute="width" constant="157" id="E3l-ne-8RJ"/>
<constraint firstAttribute="height" constant="28" id="cL9-ye-uFi"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Lde-SU-5MS">
<rect key="frame" x="59.999999999999986" y="49" width="186.66666666666663" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="iK8-oc-A1D"/>
</constraints>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Button"/> <state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button"/> <buttonConfiguration key="configuration" style="plain" image="sp-home-fresh" title="Change characters"/>
<connections> <userDefinedRuntimeAttributes>
<action selector="voice:" destination="-1" eventType="touchUpInside" id="9ht-YX-XRD"/> <userDefinedRuntimeAttribute type="number" keyPath="fontSize">
</connections> <real key="value" value="12"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tji-S9-nFP">
<rect key="frame" x="240" y="23.666666666666657" width="87" height="32"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="87" id="ayL-fl-zR2"/>
<constraint firstAttribute="height" constant="32" id="wdd-1h-oC8"/>
</constraints>
<color key="tintColor" red="0.41960784313725491" green="0.44313725490196076" blue="0.8901960784313725" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" image="sp-home-clock" title="5:00">
<fontDescription key="titleFontDescription" type="system" pointSize="14"/>
</buttonConfiguration>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
</subviews>
<color key="backgroundColor" red="0.41960784313725491" green="0.44313725490196076" blue="0.8901960784313725" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="tji-S9-nFP" secondAttribute="trailing" constant="18" id="12u-v5-UR0"/>
<constraint firstItem="pAk-N9-Dv6" firstAttribute="top" secondItem="REb-HE-Vml" secondAttribute="top" constant="16" id="3rQ-4P-EMq"/>
<constraint firstItem="GO5-4q-Wtk" firstAttribute="top" secondItem="REb-HE-Vml" secondAttribute="top" constant="16" id="A1E-De-Cde"/>
<constraint firstItem="tji-S9-nFP" firstAttribute="centerY" secondItem="REb-HE-Vml" secondAttribute="centerY" id="Al5-9M-UVy"/>
<constraint firstItem="pAk-N9-Dv6" firstAttribute="leading" secondItem="REb-HE-Vml" secondAttribute="leading" constant="16" id="OLG-nC-Uwh"/>
<constraint firstAttribute="bottom" secondItem="pAk-N9-Dv6" secondAttribute="bottom" constant="15" id="ha2-7J-HlX"/>
<constraint firstItem="GO5-4q-Wtk" firstAttribute="leading" secondItem="pAk-N9-Dv6" secondAttribute="trailing" constant="16" id="oEO-ct-0Se"/>
<constraint firstItem="Lde-SU-5MS" firstAttribute="top" secondItem="GO5-4q-Wtk" secondAttribute="bottom" constant="5" id="sX5-26-eCn"/>
<constraint firstItem="Lde-SU-5MS" firstAttribute="leading" secondItem="REb-HE-Vml" secondAttribute="leading" constant="60" id="u9D-Ci-Oaa"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="rqH-oW-agY"/> <viewLayoutGuide key="safeArea" id="rqH-oW-agY"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstItem="rqH-oW-agY" firstAttribute="trailing" secondItem="jZl-V1-ZlM" secondAttribute="trailing" id="0C1-Qf-cu5"/> <constraint firstItem="REb-HE-Vml" firstAttribute="leading" secondItem="rqH-oW-agY" secondAttribute="leading" constant="24" id="Cvh-VK-8kb"/>
<constraint firstItem="y0g-g8-kpr" firstAttribute="top" secondItem="W3R-0H-fep" secondAttribute="bottom" constant="23" id="AbR-Sa-G7K"/> <constraint firstItem="REb-HE-Vml" firstAttribute="top" secondItem="KYz-Od-c9d" secondAttribute="bottom" constant="26" id="FHQ-WP-3fM"/>
<constraint firstItem="jZl-V1-ZlM" firstAttribute="leading" secondItem="rqH-oW-agY" secondAttribute="leading" id="IDT-H0-Hha"/> <constraint firstItem="KYz-Od-c9d" firstAttribute="top" secondItem="Ia2-3z-Nib" secondAttribute="top" constant="61" id="ISI-vx-5CZ"/>
<constraint firstItem="rqH-oW-agY" firstAttribute="trailing" secondItem="W3R-0H-fep" secondAttribute="trailing" constant="23" id="OSJ-Zq-Ndc"/> <constraint firstAttribute="trailing" secondItem="KYz-Od-c9d" secondAttribute="trailing" constant="24" id="KEg-YG-8N8"/>
<constraint firstItem="jZl-V1-ZlM" firstAttribute="top" secondItem="rqH-oW-agY" secondAttribute="top" id="U55-vL-hVd"/> <constraint firstItem="KYz-Od-c9d" firstAttribute="leading" secondItem="Ia2-3z-Nib" secondAttribute="leading" constant="24" id="Kv8-Bt-b6l"/>
<constraint firstItem="W3R-0H-fep" firstAttribute="leading" secondItem="rqH-oW-agY" secondAttribute="leading" constant="23" id="Wcy-5C-4HJ"/> <constraint firstItem="REb-HE-Vml" firstAttribute="trailing" secondItem="KYz-Od-c9d" secondAttribute="trailing" id="jtp-1f-Njw"/>
<constraint firstItem="y0g-g8-kpr" firstAttribute="leading" secondItem="rqH-oW-agY" secondAttribute="leading" constant="23" id="Y5w-Ks-aOc"/>
<constraint firstItem="W3R-0H-fep" firstAttribute="top" secondItem="jZl-V1-ZlM" secondAttribute="bottom" constant="10" id="dff-yJ-XwP"/>
<constraint firstItem="rqH-oW-agY" firstAttribute="trailing" secondItem="y0g-g8-kpr" secondAttribute="trailing" constant="23" id="jzE-Ji-lv1"/>
</constraints> </constraints>
<point key="canvasLocation" x="519.84732824427476" y="-37.323943661971832"/> <point key="canvasLocation" x="539.69465648854964" y="-51.408450704225352"/>
</view> </view>
</objects> </objects>
<resources> <resources>
<systemColor name="systemBackgroundColor"> <image name="sp-home-book" width="20" height="20"/>
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <image name="sp-home-clock" width="20" height="20"/>
</systemColor> <image name="sp-home-fire" width="20" height="20"/>
<image name="sp-home-flag" width="47" height="26"/>
<image name="sp-home-fresh" width="18" height="18"/>
<image name="sp-home-headerivar" width="522" height="465"/>
<image name="sp-home-pro" width="79" height="32"/>
</resources> </resources>
</document> </document>
//
// SpeakEleLessionView.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/15.
//
import UIKit
enum buttonColorType : String {
case red = "sp-home-red"
case blue = "sp-home-blue"
case yellow = "sp-home-xyellow"
case green = "sp-home-green"
case gray = "sp-home-gray"
case orange = "sp-home-orange"
}
class SpeakEleLessionView: UIView {
lazy var button: UIButton = {
let button = UIButton.init(type: .custom)
return button
}()
lazy var backView: UIView = {
let bView = UIView()
bView.backgroundColor = .white
return bView
}()
lazy var nameLb: UILabel = {
let nlb = UILabel()
nlb.font = UIFont.montserrat(.medium ,size: 14)
nlb.textColor = .black
nlb.text = "Music Prefences"
nlb.numberOfLines = 0
nlb.textAlignment = .center
return nlb
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.isUserInteractionEnabled = true
setupUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setColor(type: Int) {
let colorArr: [buttonColorType] = [.blue,.orange,.green,.yellow,.red,.gray,.gray,.gray,.gray,.gray,.gray,.gray,.gray,.gray,.gray,.gray,.gray,.gray]
button.setImage(UIImage(named: colorArr[type].rawValue), for: .normal)
}
private func setupUI() {
self.addSubview(backView)
backView.addSubview(button)
self.addSubview(nameLb)
backView.snp.makeConstraints { make in
make.width.height.equalTo(96)
make.top.left.right.equalTo(0)
}
nameLb.snp.makeConstraints { make in
make.top.equalTo(backView.snp.bottom).offset(5)
make.left.right.equalTo(0)
}
button.snp.makeConstraints { make in
make.top.equalTo(5)
make.left.equalTo(6)
make.right.equalTo(-6)
make.bottom.equalTo(-8)
}
backView.corners = 48
backView.borderWidth = 4
backView.borderColor = UIColor.init(with: "#000000", alpha: 0.18)
}
}
//
// SpeakEleProgressViewCtr.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/15.
//
import UIKit
class SpeakEleProgressViewCtr: SpeakEleBaseViewCtr {
lazy var tableView: UITableView = {
let tV = UITableView()
tV.tableHeaderView = headerV
tV.backgroundColor = .clear
tV.separatorStyle = .none
tV.showsVerticalScrollIndicator = false
tV.register(SpeakEleDailyCell.self, forCellReuseIdentifier: SpeakEleDailyCell.className())
tV.register(SpeakEleChooseCell.self, forCellReuseIdentifier: SpeakEleChooseCell.className())
tV.register(SpeakEleLtimeCell.self, forCellReuseIdentifier: SpeakEleLtimeCell.className())
tV.register(SpeakEleReviewCell.self, forCellReuseIdentifier: SpeakEleReviewCell.className())
tV.register(SpeakEleOtherCell.self, forCellReuseIdentifier: SpeakEleOtherCell.className())
tV.delegate = self
tV.dataSource = self
return tV
}()
let headerV = SpeakEleProgressHeaderView(frame: CGRect(x: 0, y: 0, width: Dev.screenW, height: 40))
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.init(with: "#F6F7F9")
makeUI()
}
func makeUI() {
self.view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(statusBarHeight + 20)
make.left.right.equalTo(0)
make.bottom.equalTo(-tabbarHeight)
}
}
}
extension SpeakEleProgressViewCtr: UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: SpeakEleDailyCell.className(), for: indexPath) as! SpeakEleDailyCell
return cell
} else if indexPath.row == 1 {
let cell = tableView.dequeueReusableCell(withIdentifier: SpeakEleChooseCell.className(), for: indexPath) as! SpeakEleChooseCell
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: SpeakEleChooseCell.className(), for: indexPath) as! SpeakEleChooseCell
return cell
}
}
//
// SpeakEleChooseCell.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakEleChooseCell: UITableViewCell {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
// 创建UI方法
creatUI()
// bindViewModel()
}
// 这个方法也是必须要实现的,和重写初始化方法在一起实现。
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
func creatUI() {
}
}
//
// SpeakEleDailyCell.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakEleDailyCell: UITableViewCell {
lazy var backView: UIView = {
let bView = UIView()
bView.backgroundColor = .white
bView.isUserInteractionEnabled = true
return bView
}()
lazy var imgView: UIImageView = {
let bView = UIImageView()
bView.image = UIImage(named: "sp-progress-Lfire")
return bView
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .black
label.font = UIFont.montserrat(.bold ,size: 20)
label.text = "Cumulative Streak:5"
return label
}()
lazy var line: UIView = {
let lineView = UIView()
lineView.backgroundColor = UIColor.init(with: "#000000", alpha: 0.12)
return lineView
}()
lazy var subTitleLabel: UILabel = {
let label = UILabel()
label.textColor = .black
label.font = UIFont.montserrat(.bold ,size: 20)
label.text = "Daily learning"
return label
}()
lazy var tipLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.init(with: "#000000", alpha: 0.54)
label.font = UIFont.montserrat(.bold ,size: 14)
label.text = "Maste more know edge every day"
return label
}()
lazy var scView: SpeakElePCView = {
let layout = UICollectionViewFlowLayout()
let collectionView = SpeakElePCView(frame: CGRect.zero, collectionViewLayout: layout)
layout.scrollDirection = .horizontal
collectionView.backgroundColor = .clear
return collectionView
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
// 创建UI方法
creatUI()
// bindViewModel()
}
// 这个方法也是必须要实现的,和重写初始化方法在一起实现。
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
func creatUI() {
self.contentView.addSubview(backView)
backView.addSubview(imgView)
backView.addSubview(titleLabel)
backView.addSubview(line)
backView.addSubview(subTitleLabel)
backView.addSubview(tipLabel)
backView.addSubview(scView)
backView.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(18)
make.bottom.equalTo(-24)
make.height.equalTo(268)
}
backView.corners = 16
imgView.snp.makeConstraints { make in
make.width.height.equalTo(32)
make.left.equalTo(24)
make.top.equalTo(16)
}
titleLabel.snp.makeConstraints { make in
make.height.equalTo(28)
make.left.equalTo(imgView.snp.right).offset(8)
make.centerY.equalTo(imgView)
}
line.snp.makeConstraints { make in
make.height.equalTo(0.6)
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(titleLabel.snp.bottom).offset(18)
}
subTitleLabel.snp.makeConstraints { make in
make.height.equalTo(28)
make.left.equalTo(imgView.snp.left)
make.right.equalTo(-24)
make.top.equalTo(line.snp.bottom).offset(16)
}
tipLabel.snp.makeConstraints { make in
make.height.equalTo(20)
make.left.equalTo(imgView.snp.left)
make.right.equalTo(-24)
make.top.equalTo(subTitleLabel.snp.bottom).offset(16)
}
scView.snp.makeConstraints { make in
make.height.equalTo(100)
make.left.equalTo(imgView.snp.left)
make.right.equalTo(-24)
make.top.equalTo(tipLabel.snp.bottom).offset(14)
}
}
}
//
// SpeakEleLtimeCell.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakEleLtimeCell: UITableViewCell {
lazy var backView: UIView = {
let bView = UIView()
bView.backgroundColor = .white
bView.isUserInteractionEnabled = true
return bView
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
// 创建UI方法
creatUI()
// bindViewModel()
}
// 这个方法也是必须要实现的,和重写初始化方法在一起实现。
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
func creatUI() {
self.contentView.addSubview(backView)
backView.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(18)
make.bottom.equalTo(-24)
make.height.equalTo(323)
}
backView.corners = 16
}
}
//
// SpeakEleOtherCell.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakEleOtherCell: UITableViewCell {
lazy var backView: UIView = {
let bView = UIView()
bView.backgroundColor = .white
bView.isUserInteractionEnabled = true
return bView
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
// 创建UI方法
creatUI()
// bindViewModel()
}
// 这个方法也是必须要实现的,和重写初始化方法在一起实现。
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
func creatUI() {
self.contentView.addSubview(backView)
backView.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(18)
make.bottom.equalTo(-24)
make.height.equalTo(288)
}
backView.corners = 16
}
}
//
// SpeakElePCCollectionViewCell.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakElePCCollectionViewCell: UICollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
lazy var backView: UIView = {
let bView = UIView()
bView.backgroundColor = UIColor.init(with: "#000000", alpha: 0.08)
bView.isUserInteractionEnabled = true
self.contentView.addSubview(bView)
return bView
}()
private lazy var iconImageView: UIImageView = {
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.backgroundColor = UIColor.clear
imageView.contentMode = .scaleAspectFit
// imageView.isUserInteractionEnabled = false
self.contentView.addSubview(imageView)
return imageView
}()
private lazy var titleLabel:UILabel = {
let label = UILabel()
label.textColor = .white
label.font = UIFont(name: "Microsoft YaHei", size:10)
self.contentView.addSubview(label)
return label
}()
}
extension SpeakElePCCollectionViewCell {
func setupUI() {
backView.snp.remakeConstraints { (make) in
make.left.equalTo(0)
make.right.equalTo(0)
make.top.equalTo(0)
make.bottom.equalTo(0)
}
backView.corners = 8
iconImageView.snp.remakeConstraints { (make) in
make.centerY.equalToSuperview().offset(-10)
make.centerX.equalToSuperview()
make.width.height.equalTo(18)
// make.height.equalTo(FITSCALE(num: 19))
}
titleLabel.snp.remakeConstraints { (make) in
// make.bottom.equalTo(-20)
make.top.equalTo(iconImageView.snp.bottom).offset(5)
make.centerX.equalToSuperview()
// make.height.equalTo(FITSCALE(num: 19))
}
}
func setImage(_ imgName:String) {
iconImageView.image = UIImage(named: imgName)
}
func setTitle(_ title:String) {
titleLabel.text = title
}
}
//
// SpeakElePCView.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakElePCView: UICollectionView,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
7
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: SpeakElePCCollectionViewCell.className() , for: indexPath) as! SpeakElePCCollectionViewCell
cell.setImage("sp-progress-Check")
return cell
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 60, height: 80)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 0, left: 12, bottom: 0, right: 12)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 5
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public override init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
super.init(frame: frame, collectionViewLayout: layout)
// layout.scrollDirection = .horizontal
self.backgroundColor = .clear
self.showsVerticalScrollIndicator = false
self.showsHorizontalScrollIndicator = false
self.scrollsToTop = false
self.dataSource = self
self.delegate = self
self.register(SpeakElePCCollectionViewCell.self, forCellWithReuseIdentifier: SpeakElePCCollectionViewCell.className())
}
deinit {
self.dataSource = nil
self.delegate = nil
}
}
//
// SpeakEleProgressHeaderView.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakEleProgressHeaderView: UIView {
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = .black
label.font = UIFont.montserrat(.bold ,size: 28)
label.text = "Progress"
return label
}()
lazy var signBtn: UIButton = {
let back = UIButton(type: .custom)
back.setImage(UIImage(named: "sp-progress-Mfire"), for: .normal)
back.titleLabel?.font = UIFont.montserrat(.medium ,size: 14)
back.setTitle("3", for: .normal)
back.setTitleColor(UIColor.init(with: "#FFB200"), for: .normal)
return back
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = .clear
setupUI()
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setupUI() {
addSubview(titleLabel)
addSubview(signBtn)
titleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(24)
make.top.equalTo(0)
}
signBtn.snp.makeConstraints { make in
make.height.equalTo(32)
make.right.equalTo(-24)
make.width.equalTo(55)
make.centerY.equalTo(titleLabel)
}
}
}
//
// SpeakEleReviewCell.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import UIKit
class SpeakEleReviewCell: UITableViewCell {
lazy var backView: UIView = {
let bView = UIView()
bView.backgroundColor = .white
bView.isUserInteractionEnabled = true
return bView
}()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.contentView.backgroundColor = .clear
self.backgroundColor = .clear
// 创建UI方法
creatUI()
// bindViewModel()
}
// 这个方法也是必须要实现的,和重写初始化方法在一起实现。
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
}
func creatUI() {
self.contentView.addSubview(backView)
backView.snp.makeConstraints { make in
make.left.equalTo(24)
make.right.equalTo(-24)
make.top.equalTo(18)
make.bottom.equalTo(-24)
make.height.equalTo(202)
}
backView.corners = 16
}
}
//
// NSObject+.swift
// SpeakEasyLearnEnglish
//
// Created by mac on 2025/7/16.
//
import Foundation
extension NSObject {
class func className() -> String {
return NSStringFromClass(self)
}
}
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