58个文件已修改
2个文件已删除
24个文件已添加
| | |
| | | /* Begin PBXBuildFile section */ |
| | | 1300BD3B2C6DFB1C000BCA5E /* VIPCenterVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1300BD3A2C6DFB1C000BCA5E /* VIPCenterVC.xib */; }; |
| | | 1300BD3C2C6DFB1C000BCA5E /* VIPCenterVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1300BD392C6DFB1C000BCA5E /* VIPCenterVC.swift */; }; |
| | | 1302F9A22CDB19C90066AF22 /* CourseDetialOfflineVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1302F9A12CDB19C90066AF22 /* CourseDetialOfflineVC.xib */; }; |
| | | 1302F9A32CDB19C90066AF22 /* CourseDetialOfflineVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1302F9A02CDB19C90066AF22 /* CourseDetialOfflineVC.swift */; }; |
| | | 1302F9A52CDB46000066AF22 /* CourseDetialCustomerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1302F9A42CDB46000066AF22 /* CourseDetialCustomerView.swift */; }; |
| | | 1302F9A72CDB460B0066AF22 /* CourseDetialCustomerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1302F9A62CDB460B0066AF22 /* CourseDetialCustomerView.xib */; }; |
| | | 1304526A2CB4CA310049FB3A /* XQMuseStoreKit.storekit in Resources */ = {isa = PBXBuildFile; fileRef = 130452692CB4CA310049FB3A /* XQMuseStoreKit.storekit */; }; |
| | | 1304526C2CB4CB210049FB3A /* StoreKitTestCertificate.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1304526B2CB4CB210049FB3A /* StoreKitTestCertificate.cer */; }; |
| | | 1304526F2CB4FF280049FB3A /* InPurchaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1304526E2CB4FF280049FB3A /* InPurchaseManager.swift */; }; |
| | |
| | | /* Begin PBXFileReference section */ |
| | | 1300BD392C6DFB1C000BCA5E /* VIPCenterVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VIPCenterVC.swift; sourceTree = "<group>"; }; |
| | | 1300BD3A2C6DFB1C000BCA5E /* VIPCenterVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VIPCenterVC.xib; sourceTree = "<group>"; }; |
| | | 1302F9A02CDB19C90066AF22 /* CourseDetialOfflineVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetialOfflineVC.swift; sourceTree = "<group>"; }; |
| | | 1302F9A12CDB19C90066AF22 /* CourseDetialOfflineVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseDetialOfflineVC.xib; sourceTree = "<group>"; }; |
| | | 1302F9A42CDB46000066AF22 /* CourseDetialCustomerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetialCustomerView.swift; sourceTree = "<group>"; }; |
| | | 1302F9A62CDB460B0066AF22 /* CourseDetialCustomerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CourseDetialCustomerView.xib; sourceTree = "<group>"; }; |
| | | 130452692CB4CA310049FB3A /* XQMuseStoreKit.storekit */ = {isa = PBXFileReference; lastKnownFileType = text; path = XQMuseStoreKit.storekit; sourceTree = "<group>"; }; |
| | | 1304526B2CB4CB210049FB3A /* StoreKitTestCertificate.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = StoreKitTestCertificate.cer; sourceTree = "<group>"; }; |
| | | 1304526D2CB4D1190049FB3A /* XQMuse.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = XQMuse.entitlements; sourceTree = "<group>"; }; |
| | |
| | | 13FB6D862C6EF9DE00A0685D /* CourseDetialVC.swift */, |
| | | 130AA4A62C72F71700F20944 /* CourseDetialVideoVC.swift */, |
| | | 130AA4A72C72F71700F20944 /* CourseDetialVideoVC.xib */, |
| | | 1302F9A02CDB19C90066AF22 /* CourseDetialOfflineVC.swift */, |
| | | 1302F9A12CDB19C90066AF22 /* CourseDetialOfflineVC.xib */, |
| | | ); |
| | | path = VC; |
| | | sourceTree = "<group>"; |
| | |
| | | 13FB6D8B2C6EFB5400A0685D /* CourseDetailHeaderView.xib */, |
| | | 1333DC7B2C72E78F00D8ACAE /* CourseSendGiftView.swift */, |
| | | 1333DC7D2C72E7A500D8ACAE /* CourseSendGiftView.xib */, |
| | | 1302F9A42CDB46000066AF22 /* CourseDetialCustomerView.swift */, |
| | | 1302F9A62CDB460B0066AF22 /* CourseDetialCustomerView.xib */, |
| | | ); |
| | | path = View; |
| | | sourceTree = "<group>"; |
| | |
| | | 130C07092C76D51900ADB098 /* SpendingDetailHeaderVC.xib in Resources */, |
| | | 138995412C943AA700BC7F78 /* static-level-5.png in Resources */, |
| | | 1327C6832C81D107005DA44B /* PlanGuide_3_VC.xib in Resources */, |
| | | 1302F9A22CDB19C90066AF22 /* CourseDetialOfflineVC.xib in Resources */, |
| | | 1302F9A72CDB460B0066AF22 /* CourseDetialCustomerView.xib in Resources */, |
| | | 138FE0DF2C757B2A00A964E8 /* BindPhone_1_VC.xib in Resources */, |
| | | 138995402C943AA700BC7F78 /* static-level-3.png in Resources */, |
| | | 13FB6D842C6EEFE900A0685D /* MenuListTCell.xib in Resources */, |
| | |
| | | 137ABE382C6B6641003A91C5 /* WebVC.swift in Sources */, |
| | | 135C2A6C2C7F033300CC2A67 /* CLPlayerContentViewDelegate.swift in Sources */, |
| | | 13985DB12C69B7B00046B6DC /* BaseVC.swift in Sources */, |
| | | 1302F9A32CDB19C90066AF22 /* CourseDetialOfflineVC.swift in Sources */, |
| | | 13985DD52C69FC1F0046B6DC /* Home_Style_1_TCell.swift in Sources */, |
| | | 132EB01C2C6B32B200990429 /* RegisterVC.swift in Sources */, |
| | | 134803DC2C7707BA00F4FDDA /* ContactCustomerVC.swift in Sources */, |
| | |
| | | 135D091C2C91674700658880 /* TreeTeskDetailListVC.swift in Sources */, |
| | | 134803D32C76E29E00F4FDDA /* MyCommentListVC.swift in Sources */, |
| | | 13DC34EE2C913E77007E1B61 /* TreeTeskFirstRuleView.swift in Sources */, |
| | | 1302F9A52CDB46000066AF22 /* CourseDetialCustomerView.swift in Sources */, |
| | | 1377768D2C6AFD25004FF994 /* LoginVC.swift in Sources */, |
| | | 13FB6D852C6EEFE900A0685D /* MenuListTCell.swift in Sources */, |
| | | 134803D92C76ED6400F4FDDA /* WatchHistoryDetailVC.swift in Sources */, |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "btn_customer@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "btn_customer@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "btn_pause@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "btn_pause@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "btn_play@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "btn_play@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "icon_empty.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "icon_local_1@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "icon_local_1@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "icon_vip@2x.png", |
| | | "filename" : "组 5@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "icon_vip@3x.png", |
| | | "filename" : "组 5@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "mini_logo@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "mini_logo@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | |
| | | |
| | | /// 需要透明Nav的VC |
| | | private var lucencyVCs = [LoginVC.self] |
| | | private var whiteStyleVCs = [HomeItemDetailVC.self,CourseDetialVC.self,CourseDetialVideoVC.self,PavilionDetailVC.self] |
| | | private var whiteStyleVCs = [HomeItemDetailVC.self,CourseDetialVC.self,CourseDetialOfflineVC.self,CourseDetialVideoVC.self,PavilionDetailVC.self] |
| | | |
| | | open override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | |
| | | |
| | | viewControllers = [home_nav,course_nav,tree_nav,pavilion_nav,me_nav] |
| | | setValue(customBar, forKey: "tabBar") |
| | | customBar.unselectedItemTintColor = UIColor(hexStr: "#4E4E4E") |
| | | |
| | | if #available(iOS 15.0, *) { |
| | | let bar = UITabBarAppearance() |
| | |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var webView: WKWebView! |
| | | @IBOutlet weak var cons_webHei: NSLayoutConstraint! |
| | | |
| | | private var disposeBag = DisposeBag() |
| | | |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | |
| | | webView.scrollView.isScrollEnabled = false |
| | | webView.scrollView.backgroundColor = .clear |
| | | webView.isOpaque = false |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | | <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_CourseDetail_1_TCell" rowHeight="183" id="KGk-i7-Jjw" customClass="CourseDetail_1_TCell" customModule="XQMuse" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="501" height="183"/> |
| | | <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="_CourseDetail_1_TCell" rowHeight="325" id="KGk-i7-Jjw" customClass="CourseDetail_1_TCell" customModule="XQMuse" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="501" height="325"/> |
| | | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
| | | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> |
| | | <rect key="frame" x="0.0" y="0.0" width="501" height="183"/> |
| | | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> |
| | | <rect key="frame" x="0.0" y="0.0" width="501" height="325"/> |
| | | <autoresizingMask key="autoresizingMask"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课程介绍" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lg9-70-w3n"> |
| | | <rect key="frame" x="21.666666666666668" y="35" width="61.333333333333329" height="20"/> |
| | | <rect key="frame" x="21.666666666666668" y="5" width="59.666666666666657" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="8dQ-Gi-hJh"/> |
| | | </constraints> |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WYV-JQ-E3S"> |
| | | <rect key="frame" x="0.0" y="74.666666666666671" width="501" height="100.00000000000001"/> |
| | | <rect key="frame" x="0.0" y="44.666666666666657" width="501" height="280.33333333333337"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="100" id="hfa-qQ-TpS"/> |
| | | <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="hfa-qQ-TpS"/> |
| | | </constraints> |
| | | <wkWebViewConfiguration key="configuration"> |
| | | <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> |
| | |
| | | </wkWebView> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstItem="Lg9-70-w3n" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="35" id="4D5-on-wj2"/> |
| | | <constraint firstItem="Lg9-70-w3n" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="4D5-on-wj2"/> |
| | | <constraint firstItem="WYV-JQ-E3S" firstAttribute="top" secondItem="Lg9-70-w3n" secondAttribute="bottom" constant="19.5" id="Ar0-7c-kQM"/> |
| | | <constraint firstAttribute="trailing" secondItem="WYV-JQ-E3S" secondAttribute="trailing" id="BSc-yJ-F5G"/> |
| | | <constraint firstItem="WYV-JQ-E3S" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Mbt-TS-KCB"/> |
| | |
| | | <outlet property="label_title" destination="Lg9-70-w3n" id="NPf-Sa-PgL"/> |
| | | <outlet property="webView" destination="WYV-JQ-E3S" id="wJi-nk-vgm"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="200.76335877862596" y="68.661971830985919"/> |
| | | <point key="canvasLocation" x="200.76335877862596" y="118.66197183098592"/> |
| | | </tableViewCell> |
| | | </objects> |
| | | </document> |
| | |
| | | } |
| | | |
| | | func setModel(_ item:CourseItemModel,index:IndexPath){ |
| | | let tuple = Date.jq_formateToTime_tuple(item.duration) |
| | | label_index.text = "\(index.row + 1)" |
| | | label_title.text = item.chapterTitle |
| | | label_time.text = Date.jq_formateToTime(item.duration) |
| | | label_time.text = String(format: "%02ld:%02ld", tuple.hour * 60 + tuple.minute,tuple.second) |
| | | label_people.text = "\(item.realLearnedNum + item.virtualLearnedNum)" |
| | | } |
| | | |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | |
| | | <autoresizingMask key="autoresizingMask"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课程目录" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EsS-2x-ooJ"> |
| | | <rect key="frame" x="21.666666666666668" y="35" width="61.333333333333329" height="114"/> |
| | | <rect key="frame" x="21.666666666666668" y="25" width="59.666666666666657" height="124"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="jlv-rk-giE"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/> |
| | | <color key="textColor" red="0.15686274510000001" green="0.15686274510000001" blue="0.15686274510000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | </tableView> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstItem="EsS-2x-ooJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="35" id="Hlp-1k-lzl"/> |
| | | <constraint firstItem="EsS-2x-ooJ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="25" id="Hlp-1k-lzl"/> |
| | | <constraint firstItem="EsS-2x-ooJ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="21.5" id="jO0-ZH-hJ9"/> |
| | | <constraint firstItem="Rxb-3O-BKc" firstAttribute="top" secondItem="EsS-2x-ooJ" secondAttribute="bottom" constant="30" id="jV2-gZ-CKK"/> |
| | | <constraint firstAttribute="bottom" secondItem="Rxb-3O-BKc" secondAttribute="bottom" id="mI0-cL-zMy"/> |
| | |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = items[indexPath.row] |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | // |
| | | // CourseDetialOfflineVC.swift |
| | | // XQMuse |
| | | // |
| | | // Created by 无故事王国 on 2024/11/6. |
| | | // |
| | | |
| | | import UIKit |
| | | import WebKit |
| | | import JQTools |
| | | |
| | | class CourseDetialOfflineVC: BaseVC { |
| | | @IBOutlet weak var scrollView: UIScrollView! |
| | | @IBOutlet weak var img_cover: UIImageView! |
| | | @IBOutlet weak var view_video: UIView! |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var label_tutor: UILabel! |
| | | @IBOutlet weak var label_address: UILabel! |
| | | @IBOutlet weak var webView: WKWebView! |
| | | @IBOutlet weak var cons_webHei: NSLayoutConstraint! |
| | | @IBOutlet weak var img_cusomter: UIImageView! |
| | | @IBOutlet weak var view_customer: UIView! |
| | | |
| | | private var videoView:VideoView? |
| | | private var barStyle:UIStatusBarStyle = .lightContent |
| | | private var courseId:Int! |
| | | private var courseDetailModel:CourseModel? |
| | | private var collect_bitem:UIBarButtonItem! |
| | | private var share_bitem:UIBarButtonItem! |
| | | private var section0Height:Double = 0 |
| | | |
| | | init(courseId:Int) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.courseId = courseId |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewWillAppear(_ animated: Bool) { |
| | | super.viewWillAppear(animated) |
| | | (navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.white), for: .normal) |
| | | navigationController?.navigationBar.scrollEdgeAppearance?.backgroundColor = .clear |
| | | navigationController?.navigationBar.standardAppearance.backgroundColor = .clear |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "课程详情" |
| | | |
| | | getData() |
| | | } |
| | | |
| | | override func setUI() { |
| | | scrollView.delegate = self |
| | | collect_bitem = UIBarButtonItem(image: UIImage(named: "btn_collect"), style: .plain, target: self, action: #selector(collectionAction)) |
| | | collect_bitem.tintColor = .white |
| | | share_bitem = UIBarButtonItem(image: UIImage(named: "btn_share"), style: .plain, target: self, action: #selector(shareAction)) |
| | | share_bitem.tintColor = .white |
| | | share_bitem.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 15) |
| | | navigationItem.rightBarButtonItems = [share_bitem,collect_bitem] |
| | | |
| | | webView.scrollView.isScrollEnabled = false |
| | | webView.scrollView.backgroundColor = .clear |
| | | webView.isOpaque = false |
| | | view_customer.jq_cornerRadius = 10 |
| | | scrollView.contentInsetAdjustmentBehavior = .never |
| | | |
| | | let customerBtn = UIButton(type: .custom) |
| | | customerBtn.setImage(UIImage(named: "btn_customer"), for: .normal) |
| | | customerBtn.addTarget(self, action: #selector(showCustomerAction), for: .touchUpInside) |
| | | view.addSubview(customerBtn) |
| | | customerBtn.snp.makeConstraints { make in |
| | | make.right.equalToSuperview() |
| | | make.centerY.equalToSuperview() |
| | | } |
| | | } |
| | | |
| | | override func setRx() { |
| | | webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in |
| | | if let size = size{ |
| | | return size.height |
| | | } |
| | | return nil |
| | | }.subscribe(onNext: { [weak self](height) in |
| | | if let height = height{ |
| | | if height > self?.section0Height ?? 0{ |
| | | self?.section0Height = height |
| | | self?.cons_webHei.constant = height |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func getData(){ |
| | | Services.getCourseDetail(courseId: courseId).subscribe(onNext: {[weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | if let m = data.data{ |
| | | weakSelf.courseDetailModel = m |
| | | weakSelf.collect_bitem.image = m.isCollect == .yes ? UIImage(named: "btn_collect_1_s"):UIImage(named: "btn_collect") |
| | | weakSelf.collect_bitem.tintColor = m.isCollect == .yes ? UIColor(hexString: "#fe5b60"):.white |
| | | |
| | | weakSelf.label_title.text = m.courseTitle |
| | | weakSelf.label_tutor.text = "导师 " + m.tutor |
| | | weakSelf.label_address.text = m.address + m.addressDetail |
| | | weakSelf.img_cover.sd_setImage(with: URL(string: m.coverUrl)) |
| | | weakSelf.webView.loadHTMLString(m.briefIntroduction.jq_wrapHtml(edge: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5)), baseURL: nil) |
| | | |
| | | weakSelf.img_cusomter.sd_setImage(with: URL(string: m.wxQrCode)) |
| | | |
| | | if m.detailUrl.jq_isVideo{ |
| | | weakSelf.videoView = VideoView(url: m.detailUrl.jq_urlEncoded(),autoPlay: false, placeHoderImageUrl: m.coverUrl.jq_urlEncoded(), delegate: self!) |
| | | // weakSelf.videoView!.player.play() |
| | | weakSelf.view_video.addSubview(weakSelf.videoView!) |
| | | weakSelf.videoView!.snp.makeConstraints { make in |
| | | make.edges.equalToSuperview() |
| | | } |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @objc func showCustomerAction(){ |
| | | if let image = img_cusomter.image{ |
| | | CourseDetialCustomerView.show(customerImage: image) |
| | | } |
| | | } |
| | | |
| | | |
| | | @objc func collectionAction(){ |
| | | Services.clouseFavorite(id: courseId).subscribe(onNext: {[weak self]data in |
| | | self?.courseDetailModel?.isCollect.troggle() |
| | | if self?.courseDetailModel?.isCollect == .yes{ |
| | | alertSuccess(msg: "收藏成功") |
| | | self?.collect_bitem.image = UIImage(named: "btn_collect_1_s") |
| | | self?.collect_bitem.tintColor = UIColor(hexString: "fe5b60") |
| | | }else{ |
| | | alertSuccess(msg: "已取消收藏") |
| | | self?.collect_bitem.image = UIImage(named: "btn_collect") |
| | | self?.collect_bitem.tintColor = .white |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @objc func shareAction(){ |
| | | guard let m = courseDetailModel else{return} |
| | | |
| | | let path = courseDetailModel!.courseType == .offline ? "/courseDetail/offLine":"/courseDetail/onLine" |
| | | let string = String(format: "%@%@?courseId=%ld", ShareUrl,path,m.id) |
| | | ShareView.show(URL(string: string)!,title: m.courseTitle,desc: m.description) |
| | | } |
| | | |
| | | override var preferredStatusBarStyle: UIStatusBarStyle{ |
| | | return barStyle |
| | | } |
| | | } |
| | | |
| | | extension CourseDetialOfflineVC:UIScrollViewDelegate{ |
| | | |
| | | func scrollViewDidScroll(_ scrollView: UIScrollView) { |
| | | |
| | | let v = min(scrollView.contentOffset.y / JQ_NavBarHeight, 1) |
| | | navigationController?.navigationBar.standardAppearance.backgroundColor = .white.withAlphaComponent(v) |
| | | |
| | | if v > 0{ |
| | | (navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.black.withAlphaComponent(v)), for: .normal) |
| | | |
| | | (navigationItem.rightBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.black.withAlphaComponent(v)), for: .normal) |
| | | collect_bitem.tintColor = .black |
| | | share_bitem.tintColor = .black |
| | | |
| | | self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor:Def_NavFontColor.withAlphaComponent(v),.font:Def_NavFont] |
| | | barStyle = .darkContent |
| | | |
| | | }else{ |
| | | collect_bitem.tintColor = self.courseDetailModel?.isCollect == .yes ? UIColor(hexString: "#fe5b60"):.white |
| | | share_bitem.tintColor = .white |
| | | |
| | | (navigationItem.leftBarButtonItem?.customView as? UIButton)?.setImage(UIImage(named: "btn_back")?.withTintColor(.white), for: .normal) |
| | | self.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor:UIColor.white,.font:Def_NavFont] |
| | | } |
| | | |
| | | if v == 1{ |
| | | barStyle = .darkContent |
| | | setNeedsStatusBarAppearanceUpdate() |
| | | }else{ |
| | | barStyle = .lightContent |
| | | setNeedsStatusBarAppearanceUpdate() |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension CourseDetialOfflineVC:CLPlayerDelegate{ |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CourseDetialOfflineVC" customModule="XQMuse" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="cons_webHei" destination="daa-AS-pyV" id="CO6-bA-ZYo"/> |
| | | <outlet property="img_cover" destination="UEf-YH-aLK" id="Rs1-0g-vML"/> |
| | | <outlet property="img_cusomter" destination="zlO-OX-u5S" id="7Ui-X5-Hz8"/> |
| | | <outlet property="label_address" destination="C98-ml-jRI" id="4rj-KK-xfC"/> |
| | | <outlet property="label_title" destination="QJB-dH-vTR" id="wSy-Rp-wMW"/> |
| | | <outlet property="label_tutor" destination="Rfd-fp-6pw" id="DuZ-vX-lcI"/> |
| | | <outlet property="scrollView" destination="4KE-wb-44W" id="H7r-e1-ifF"/> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | | <outlet property="view_customer" destination="i03-rW-DQq" id="YZZ-n9-ewh"/> |
| | | <outlet property="view_video" destination="hDw-D7-a6I" id="9hf-mx-O4w"/> |
| | | <outlet property="webView" destination="UmN-R4-VrQ" id="AYI-9T-gMS"/> |
| | | </connections> |
| | | </placeholder> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | | <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4KE-wb-44W"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lz1-9S-TY8"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="805"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hDw-D7-a6I"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="314.33333333333331"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="UEf-YH-aLK"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="314.33333333333331"/> |
| | | </imageView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="UEf-YH-aLK" firstAttribute="leading" secondItem="hDw-D7-a6I" secondAttribute="leading" id="3Zx-Uu-0ja"/> |
| | | <constraint firstAttribute="trailing" secondItem="UEf-YH-aLK" secondAttribute="trailing" id="69R-e0-330"/> |
| | | <constraint firstAttribute="bottom" secondItem="UEf-YH-aLK" secondAttribute="bottom" id="GaK-gZ-9ly"/> |
| | | <constraint firstItem="UEf-YH-aLK" firstAttribute="top" secondItem="hDw-D7-a6I" secondAttribute="top" id="Hpq-h5-YmU"/> |
| | | <constraint firstAttribute="width" secondItem="hDw-D7-a6I" secondAttribute="height" multiplier="1:0.8" id="NJP-Xx-lgz"/> |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="itL-Yu-biN"> |
| | | <rect key="frame" x="0.0" y="314.33333333333331" width="393" height="99.666666666666686"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" text="导师 --" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rfd-fp-6pw"> |
| | | <rect key="frame" x="334" y="26.999999999999996" width="38.666666666666686" height="14.333333333333332"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <color key="textColor" red="0.27058823529411763" green="0.27058823529411763" blue="0.27058823529411763" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QJB-dH-vTR"> |
| | | <rect key="frame" x="20.666666666666657" y="25" width="303.33333333333337" height="23"/> |
| | | <fontDescription key="fontDescription" type="boldSystem" pointSize="19"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_local_1" translatesAutoresizingMaskIntoConstraints="NO" id="hGs-kS-EWt"> |
| | | <rect key="frame" x="20.666666666666668" y="69" width="9.6666666666666679" height="12"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="12" id="aKR-KK-x9Z"/> |
| | | <constraint firstAttribute="width" constant="9.6699999999999999" id="mVa-VF-gle"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="C98-ml-jRI"> |
| | | <rect key="frame" x="36.333333333333343" y="69" width="350.66666666666663" height="12"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="10"/> |
| | | <color key="textColor" red="0.80392156862745101" green="0.80392156862745101" blue="0.80392156862745101" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="hGs-kS-EWt" firstAttribute="top" secondItem="QJB-dH-vTR" secondAttribute="bottom" constant="21" id="1te-rE-wb5"/> |
| | | <constraint firstAttribute="trailing" secondItem="C98-ml-jRI" secondAttribute="trailing" constant="6" id="4Hx-aZ-Nva"/> |
| | | <constraint firstItem="hGs-kS-EWt" firstAttribute="leading" secondItem="QJB-dH-vTR" secondAttribute="leading" id="6Db-id-Dyt"/> |
| | | <constraint firstItem="Rfd-fp-6pw" firstAttribute="top" secondItem="itL-Yu-biN" secondAttribute="top" constant="27" id="8IL-fr-X8t"/> |
| | | <constraint firstAttribute="height" constant="99.5" id="CJ9-R7-jch"/> |
| | | <constraint firstItem="C98-ml-jRI" firstAttribute="leading" secondItem="hGs-kS-EWt" secondAttribute="trailing" constant="6" id="JO5-t8-awj"/> |
| | | <constraint firstItem="C98-ml-jRI" firstAttribute="centerY" secondItem="hGs-kS-EWt" secondAttribute="centerY" id="KEh-Pn-Qbh"/> |
| | | <constraint firstItem="QJB-dH-vTR" firstAttribute="leading" secondItem="itL-Yu-biN" secondAttribute="leading" constant="20.5" id="Nbs-UY-vlZ"/> |
| | | <constraint firstItem="QJB-dH-vTR" firstAttribute="top" secondItem="itL-Yu-biN" secondAttribute="top" constant="25" id="ZtU-Nw-puN"/> |
| | | <constraint firstAttribute="trailing" secondItem="Rfd-fp-6pw" secondAttribute="trailing" constant="20.5" id="me8-5a-oym"/> |
| | | <constraint firstItem="Rfd-fp-6pw" firstAttribute="leading" secondItem="QJB-dH-vTR" secondAttribute="trailing" constant="10" id="t31-5e-UUE"/> |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SHG-A0-P8Y"> |
| | | <rect key="frame" x="0.0" y="414" width="393" height="391"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="简介" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7hg-kN-gqy"> |
| | | <rect key="frame" x="22" y="39" width="30" height="18"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="18" id="wWl-0I-sFw"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UmN-R4-VrQ"> |
| | | <rect key="frame" x="10" y="76.333333333333314" width="373" height="100"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="100" id="daa-AS-pyV"/> |
| | | </constraints> |
| | | <wkWebViewConfiguration key="configuration"> |
| | | <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> |
| | | <wkPreferences key="preferences"/> |
| | | </wkWebViewConfiguration> |
| | | </wkWebView> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i03-rW-DQq"> |
| | | <rect key="frame" x="137.66666666666666" y="211.33333333333337" width="117.66666666666666" height="144.66666666666663"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zlO-OX-u5S"> |
| | | <rect key="frame" x="10" y="10" width="97.666666666666671" height="97.666666666666671"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" secondItem="zlO-OX-u5S" secondAttribute="height" multiplier="1:1" id="s2S-ez-cbK"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xfl-IA-8RW"> |
| | | <rect key="frame" x="19" y="117.66666666666663" width="79.666666666666671" height="24"/> |
| | | <string key="text">添加助教老师微信 |
| | | 了解详情</string> |
| | | <fontDescription key="fontDescription" type="system" pointSize="10"/> |
| | | <color key="textColor" red="0.47450980392156861" green="0.47450980392156861" blue="0.47450980392156861" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" secondItem="i03-rW-DQq" secondAttribute="height" multiplier="1:1.23" id="58K-8U-RIV"/> |
| | | <constraint firstItem="zlO-OX-u5S" firstAttribute="leading" secondItem="i03-rW-DQq" secondAttribute="leading" constant="10" id="Cj3-tR-bTf"/> |
| | | <constraint firstAttribute="trailing" secondItem="zlO-OX-u5S" secondAttribute="trailing" constant="10" id="GvU-Oj-We6"/> |
| | | <constraint firstItem="Xfl-IA-8RW" firstAttribute="top" secondItem="zlO-OX-u5S" secondAttribute="bottom" constant="10" id="WvR-C0-f6R"/> |
| | | <constraint firstAttribute="width" constant="117.5" id="dMh-nw-j5I"/> |
| | | <constraint firstItem="Xfl-IA-8RW" firstAttribute="centerX" secondItem="i03-rW-DQq" secondAttribute="centerX" id="tzt-Kd-i7R"/> |
| | | <constraint firstItem="zlO-OX-u5S" firstAttribute="top" secondItem="i03-rW-DQq" secondAttribute="top" constant="10" id="uK2-L2-0LK"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | | <color key="backgroundColor" red="0.96470588235294119" green="0.96470588235294119" blue="0.96470588235294119" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="bottomMargin" secondItem="i03-rW-DQq" secondAttribute="bottom" constant="27" id="05h-sZ-B6g"/> |
| | | <constraint firstItem="7hg-kN-gqy" firstAttribute="leading" secondItem="SHG-A0-P8Y" secondAttribute="leading" constant="22" id="3GA-vl-BWj"/> |
| | | <constraint firstItem="UmN-R4-VrQ" firstAttribute="top" secondItem="7hg-kN-gqy" secondAttribute="bottom" constant="19.5" id="Egk-vS-HfY"/> |
| | | <constraint firstItem="i03-rW-DQq" firstAttribute="top" secondItem="UmN-R4-VrQ" secondAttribute="bottom" constant="35" id="Ewn-Db-3aO"/> |
| | | <constraint firstItem="7hg-kN-gqy" firstAttribute="top" secondItem="SHG-A0-P8Y" secondAttribute="top" constant="39" id="HOe-iO-2bP"/> |
| | | <constraint firstItem="UmN-R4-VrQ" firstAttribute="leading" secondItem="SHG-A0-P8Y" secondAttribute="leading" constant="10" id="RP6-OF-MMB"/> |
| | | <constraint firstItem="i03-rW-DQq" firstAttribute="centerX" secondItem="SHG-A0-P8Y" secondAttribute="centerX" id="cDU-Lm-sXe"/> |
| | | <constraint firstAttribute="trailing" secondItem="UmN-R4-VrQ" secondAttribute="trailing" constant="10" id="fOj-gF-2g4"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="hDw-D7-a6I" firstAttribute="leading" secondItem="lz1-9S-TY8" secondAttribute="leading" id="0mN-Fo-mZK"/> |
| | | <constraint firstAttribute="bottom" secondItem="SHG-A0-P8Y" secondAttribute="bottom" id="1Rg-BU-RUg"/> |
| | | <constraint firstItem="SHG-A0-P8Y" firstAttribute="top" secondItem="itL-Yu-biN" secondAttribute="bottom" id="6Vj-YI-r8v"/> |
| | | <constraint firstItem="itL-Yu-biN" firstAttribute="top" secondItem="hDw-D7-a6I" secondAttribute="bottom" id="8Kp-ew-YkB"/> |
| | | <constraint firstAttribute="trailing" secondItem="SHG-A0-P8Y" secondAttribute="trailing" id="H2A-Ro-NAo"/> |
| | | <constraint firstAttribute="trailing" secondItem="itL-Yu-biN" secondAttribute="trailing" id="Pid-wb-6gd"/> |
| | | <constraint firstAttribute="trailing" secondItem="hDw-D7-a6I" secondAttribute="trailing" id="Utc-n1-bfU"/> |
| | | <constraint firstItem="itL-Yu-biN" firstAttribute="leading" secondItem="lz1-9S-TY8" secondAttribute="leading" id="V4t-oq-1Ah"/> |
| | | <constraint firstItem="hDw-D7-a6I" firstAttribute="top" secondItem="lz1-9S-TY8" secondAttribute="top" id="t0r-Ir-cV2"/> |
| | | <constraint firstItem="SHG-A0-P8Y" firstAttribute="leading" secondItem="lz1-9S-TY8" secondAttribute="leading" id="xFo-88-xVp"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="lz1-9S-TY8" secondAttribute="trailing" id="7KE-Lx-IvF"/> |
| | | <constraint firstItem="lz1-9S-TY8" firstAttribute="leading" secondItem="4KE-wb-44W" secondAttribute="leading" id="Cbm-CQ-9IT"/> |
| | | <constraint firstAttribute="bottom" secondItem="lz1-9S-TY8" secondAttribute="bottom" id="YEL-In-TvY"/> |
| | | <constraint firstItem="lz1-9S-TY8" firstAttribute="centerX" secondItem="4KE-wb-44W" secondAttribute="centerX" id="Zwt-e5-4Pm"/> |
| | | <constraint firstItem="lz1-9S-TY8" firstAttribute="top" secondItem="4KE-wb-44W" secondAttribute="top" id="nXF-Q2-0xj"/> |
| | | </constraints> |
| | | </scrollView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="4KE-wb-44W" secondAttribute="trailing" id="LXY-D6-QCg"/> |
| | | <constraint firstItem="4KE-wb-44W" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="ihN-jr-zqy"/> |
| | | <constraint firstItem="4KE-wb-44W" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="r2w-8v-ZZG"/> |
| | | <constraint firstAttribute="bottom" secondItem="4KE-wb-44W" secondAttribute="bottom" id="x0Q-YS-Trw"/> |
| | | </constraints> |
| | | <point key="canvasLocation" x="-22.137404580152669" y="20.422535211267608"/> |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | | <image name="icon_local_1" width="9.6666669845581055" height="12"/> |
| | | <systemColor name="systemBackgroundColor"> |
| | | <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | </systemColor> |
| | | </resources> |
| | | </document> |
| | |
| | | share_bitem.tintColor = .white |
| | | share_bitem.imageInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 15) |
| | | navigationItem.rightBarButtonItems = [share_bitem,collect_bitem] |
| | | |
| | | section0TCell.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in |
| | | if let size = size{ |
| | | return size.height |
| | | } |
| | | return nil |
| | | }.subscribe(onNext: { [weak self](height) in |
| | | if let height = height{ |
| | | if height > self?.section0Height ?? 0{ |
| | | self?.section0Height = height |
| | | self?.section0TCell.cons_webHei.constant = height |
| | | self?.tableView?.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func getData(){ |
| | |
| | | } |
| | | |
| | | if needPayment{ |
| | | let attribute = AttributedStringbuilder.build().add(string: " 疗愈币", withFont: .systemFont(ofSize: 12,weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: "\(m.iosPrice.jq_formatFloat)", withFont: .systemFont(ofSize: 21.71, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: " 立即购买 ", withFont: .systemFont(ofSize: 16, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).mutableAttributedString |
| | | let attribute = AttributedStringbuilder.build().add(string: " 疗愈币", withFont: .systemFont(ofSize: 12,weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: "\(m.iosPrice.jq_formatFloat)", withFont: .systemFont(ofSize: 21.71, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).add(string: " 立即购买 ", withFont: .systemFont(ofSize: 16, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).mutableAttributedString |
| | | weakSelf.studyBtn.setAttributedTitle(attribute, for: .normal) |
| | | }else{ |
| | | let attribute = AttributedStringbuilder.build().add(string: " 立即学习 ", withFont: .systemFont(ofSize: 16, weight: .bold), withColor: UIColor(hexString: "#F6F6F6")!).mutableAttributedString |
| | |
| | | } |
| | | |
| | | override func setRx() { |
| | | section0TCell.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in |
| | | if let size = size{ |
| | | return size.height |
| | | } |
| | | return nil |
| | | }.subscribe(onNext: { [weak self](height) in |
| | | if let height = height{ |
| | | if height > self?.section0Height ?? 0{ |
| | | self?.section0Height = height |
| | | self?.tableView?.reloadData() |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(CourseRefresh_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]data in |
| | | self?.getData() |
| | |
| | | // |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | |
| | | class CourseDetialVideoVC: BaseVC { |
| | | |
| | |
| | | let item = items[selectIndex.row] |
| | | |
| | | guard secondLook > 0 else {return} |
| | | |
| | | Services.watchClouse(chapterId: item.id, isOver: isOver, secondLook: secondLook).subscribe(onNext: { _ in |
| | | |
| | | }).disposed(by: disposeBag) |
| | |
| | | super.viewDidLoad() |
| | | title = "课程详情" |
| | | |
| | | videoView = VideoView(url: items[selectIndex.row].videoUrl,delegate: self) |
| | | videoView = VideoView(url: items[selectIndex.row].videoUrl.jq_urlEncoded(),delegate: self) |
| | | videoView?.player.play() |
| | | view_bg_video.addSubview(videoView!) |
| | | videoView!.snp.makeConstraints { make in |
| | |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | import EmptyDataSet_Swift |
| | | |
| | | class CourseMenuVC: BaseVC { |
| | | |
| | |
| | | make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(18) |
| | | make.bottom.equalTo(tableView) |
| | | } |
| | | |
| | | collectionView.emptyDataSetSource = self |
| | | collectionView.emptyDataSetDelegate = self |
| | | // collectionView.emptyDataSetView { v in |
| | | // let v = UIView() |
| | | // v.backgroundColor = .red |
| | | // |
| | | // return |
| | | // } |
| | | } |
| | | |
| | | func setTitleItem(_ items:[TitleItem],defaultSelectIndex:Int = 0){ |
| | |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value!.list[indexPath.row] |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { |
| | |
| | | return CGSize(width: w, height: w * 1.313) |
| | | } |
| | | } |
| | | |
| | | extension CourseMenuVC:EmptyDataSetSource{ |
| | | func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? { |
| | | return UIImage(named: "icon_empty") |
| | | } |
| | | |
| | | func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? { |
| | | return AttributedStringbuilder.build().add(string: "暂无数据", withFont: .systemFont(ofSize: 12, weight: .medium), withColor: .gray).mutableAttributedString |
| | | } |
| | | |
| | | func verticalOffset(forEmptyDataSet scrollView: UIScrollView) -> CGFloat { |
| | | return 300 |
| | | } |
| | | |
| | | func spaceHeight(forEmptyDataSet scrollView: UIScrollView) -> CGFloat { |
| | | return 200 |
| | | } |
| | | } |
| | | |
| | | extension CourseMenuVC:EmptyDataSetDelegate{ |
| | | |
| | | } |
| | |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = viewModel.dataSource.value!.list[indexPath.row] |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | |
| | | // let isVip = UserViewModel.getAvatarInfo().isVip == .yes |
| | | // if model.isBuy == .yes || model.chargeType == .free || (model.chargeType == .vipFree && isVip){ |
| | | // |
| | | // return |
| | | // }else{ |
| | | // let vc = CourseDetialVC(courseId: model.id) |
| | | // JQ_currentViewController().jq_push(vc: vc) |
| | | // } |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { |
| | | if section == 0{ |
| | | return .zero |
| | | } |
| | | return CGSize(width: JQ_ScreenW, height: 80.5) |
| | | } |
| | | } |
| | |
| | | import UIKit |
| | | import JQTools |
| | | |
| | | let CourseVCTeacherSpecial_Update = Notification.Name.init("CourseVCTeacherSpecial_Update") |
| | | |
| | | class CourseVCTeacherSpecialVC: BaseVC { |
| | | private var tableView:UITableView? |
| | | private var headerView:VideoView! |
| | |
| | | self.headerView.updateVideoUrl(m.videoUrl,autoPlay: false,placeHoderImageUrl: m.coverUrl.jq_urlEncoded()) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | self.cell0?.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in |
| | | if let size = size{ |
| | | return size.height |
| | | } |
| | | return nil |
| | | }.subscribe(onNext: { [unowned self](height) in |
| | | if let height = height{ |
| | | if height > self.cell0?.cons_webHei.constant ?? 0{ |
| | | self.cell0?.cons_webHei.constant = height |
| | | self.tableView?.reloadData() |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | } |
| | | |
| | | override func setRx() { |
| | | self.cell0?.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in |
| | | if let size = size{ |
| | | return size.height |
| | | } |
| | | return nil |
| | | }.subscribe(onNext: { [unowned self](height) in |
| | | if let height = height{ |
| | | if height > self.cell0?.cons_webHei.constant ?? 0{ |
| | | self.cell0?.cons_webHei.constant = height |
| | | self.tableView?.reloadData() |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | |
| | | override var shouldAutorotate: Bool{ |
New file |
| | |
| | | // |
| | | // CourseDetialCustomerView.swift |
| | | // XQMuse |
| | | // |
| | | // Created by 无故事王国 on 2024/11/6. |
| | | // |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | |
| | | class CourseDetialCustomerView: UIView,JQNibView{ |
| | | |
| | | @IBOutlet weak var image_qrCode: UIImageView! |
| | | @IBOutlet weak var btn_known: UIButton! |
| | | @IBOutlet weak var view_container: UIView! |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | view_container.jq_cornerRadius = 10 |
| | | view_container.transform = .init(scaleX: 0.1, y: 0.1) |
| | | alpha = 0 |
| | | } |
| | | |
| | | static func show(customerImage:UIImage){ |
| | | let view = CourseDetialCustomerView.jq_loadNibView() |
| | | sceneDelegate?.window?.addSubview(view) |
| | | view.image_qrCode.image = customerImage |
| | | view.frame = sceneDelegate?.window?.frame ?? .zero |
| | | |
| | | UIView.animate(withDuration: 0.5, delay: 0.1, usingSpringWithDamping: 0.5, initialSpringVelocity: 1.0, options: .curveEaseIn) { |
| | | view.view_container.transform = .init(scaleX: 1.0, y: 1.0) |
| | | view.alpha = 1 |
| | | } completion: { _ in |
| | | |
| | | } |
| | | } |
| | | |
| | | override func layoutSubviews() { |
| | | super.layoutSubviews() |
| | | btn_known.localGradientColor(cornerRadius: 20) |
| | | } |
| | | |
| | | |
| | | @IBAction func closeAction(_ sender: UIButton) { |
| | | UIView.animate(withDuration: 0.3) { |
| | | self.view_container.transform = .init(scaleX: 0.1, y: 0.1) |
| | | self.alpha = 0 |
| | | } completion: { _ in |
| | | self.removeFromSuperview() |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | | <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="CourseDetialCustomerView" customModule="XQMuse" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="18z-bc-FIb"> |
| | | <rect key="frame" x="25" y="223.66666666666663" width="343" height="405"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="添加微信" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hph-HD-MEq"> |
| | | <rect key="frame" x="135.66666666666666" y="17" width="71.666666666666657" height="21"/> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | <userDefinedRuntimeAttributes> |
| | | <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> |
| | | <real key="value" value="10"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jka-lR-tvX"> |
| | | <rect key="frame" x="52" y="52.000000000000028" width="239" height="238.99999999999997"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" secondItem="jka-lR-tvX" secondAttribute="height" multiplier="1:1" id="Ev0-h2-etg"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="可添加助教微信,了解课程详情" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jvg-TG-dvH"> |
| | | <rect key="frame" x="74.333333333333329" y="300" width="194.66666666666669" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kpk-28-Amk"> |
| | | <rect key="frame" x="37" y="341" width="269" height="40"/> |
| | | <color key="backgroundColor" red="0.56470588239999997" green="0.65490196079999996" blue="0.48627450979999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="40" id="XyZ-FL-gye"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="知道了"/> |
| | | <userDefinedRuntimeAttributes> |
| | | <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> |
| | | <real key="value" value="20"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | <connections> |
| | | <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="haG-rI-iNF"/> |
| | | </connections> |
| | | </button> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="kpk-28-Amk" firstAttribute="top" secondItem="Jvg-TG-dvH" secondAttribute="bottom" constant="24" id="6yc-ZL-Exc"/> |
| | | <constraint firstItem="Jvg-TG-dvH" firstAttribute="top" secondItem="jka-lR-tvX" secondAttribute="bottom" constant="9" id="F8m-vL-hmJ"/> |
| | | <constraint firstAttribute="trailing" secondItem="kpk-28-Amk" secondAttribute="trailing" constant="37" id="GfC-EX-Zz4"/> |
| | | <constraint firstItem="jka-lR-tvX" firstAttribute="top" secondItem="hph-HD-MEq" secondAttribute="bottom" constant="14" id="Mya-VC-XTg"/> |
| | | <constraint firstItem="hph-HD-MEq" firstAttribute="top" secondItem="18z-bc-FIb" secondAttribute="top" constant="17" id="W5K-LK-P1H"/> |
| | | <constraint firstItem="jka-lR-tvX" firstAttribute="leading" secondItem="18z-bc-FIb" secondAttribute="leading" constant="52" id="WlJ-nj-HPf"/> |
| | | <constraint firstItem="kpk-28-Amk" firstAttribute="leading" secondItem="18z-bc-FIb" secondAttribute="leading" constant="37" id="ZxO-A9-YLd"/> |
| | | <constraint firstAttribute="bottom" secondItem="kpk-28-Amk" secondAttribute="bottom" constant="24" id="cHL-9X-Qka"/> |
| | | <constraint firstItem="hph-HD-MEq" firstAttribute="centerX" secondItem="18z-bc-FIb" secondAttribute="centerX" id="iFf-s4-Rai"/> |
| | | <constraint firstAttribute="trailing" secondItem="jka-lR-tvX" secondAttribute="trailing" constant="52" id="ngt-lg-cI7"/> |
| | | <constraint firstItem="Jvg-TG-dvH" firstAttribute="centerX" secondItem="18z-bc-FIb" secondAttribute="centerX" id="weG-Tk-jiP"/> |
| | | </constraints> |
| | | <userDefinedRuntimeAttributes> |
| | | <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> |
| | | <real key="value" value="10"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | </view> |
| | | </subviews> |
| | | <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstItem="18z-bc-FIb" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="1Dh-Kh-yoj"/> |
| | | <constraint firstItem="18z-bc-FIb" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="99i-tH-2hN"/> |
| | | <constraint firstItem="18z-bc-FIb" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="25" id="mtD-0k-fhX"/> |
| | | <constraint firstAttribute="trailing" secondItem="18z-bc-FIb" secondAttribute="trailing" constant="25" id="wO6-IB-6uo"/> |
| | | </constraints> |
| | | <connections> |
| | | <outlet property="btn_known" destination="kpk-28-Amk" id="NLI-7a-nps"/> |
| | | <outlet property="image_qrCode" destination="jka-lR-tvX" id="n5y-r8-ibA"/> |
| | | <outlet property="view_container" destination="18z-bc-FIb" id="SWz-lK-Rdd"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="-24" y="21"/> |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | | <systemColor name="systemBackgroundColor"> |
| | | <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | </systemColor> |
| | | </resources> |
| | | </document> |
| | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | // Initialization code |
| | | jq_cornerRadius = 25 |
| | | jq_cornerRadius = 15 |
| | | view_price.jq_cornerRadius = 12.55 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | func setCourseModel(_ model:CourseModel){ |
| | | img_cover.sd_setImage(with: URL(string: model.coverUrl.jq_urlEncoded())) |
| | | |
| | | let imgUrl = model.coverUrl.components(separatedBy: ",").last! |
| | | img_cover.sd_setImage(with: URL(string: imgUrl.jq_urlEncoded())) |
| | | label_title.text = model.courseTitle |
| | | label_subTitle.text = model.briefIntroduction |
| | | label_num.text = "\(model.count)" |
| | |
| | | </constraints> |
| | | </view> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_vip" translatesAutoresizingMaskIntoConstraints="NO" id="qF4-sn-dec"> |
| | | <rect key="frame" x="14.000000000000002" y="15.000000000000002" width="21.666666666666671" height="21.666666666666671"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="21.5" id="Ng1-iW-jL8"/> |
| | | <constraint firstAttribute="height" constant="21.5" id="xz7-i6-Qq3"/> |
| | | </constraints> |
| | | <rect key="frame" x="14.000000000000002" y="15.000000000000002" width="25.666666666666671" height="25.666666666666671"/> |
| | | </imageView> |
| | | </subviews> |
| | | </view> |
| | |
| | | <image name="icon_offline" width="34" height="18"/> |
| | | <image name="icon_play" width="46" height="46"/> |
| | | <image name="icon_use_small" width="10" height="10.666666984558105"/> |
| | | <image name="icon_vip" width="21.666666030883789" height="21.666666030883789"/> |
| | | <image name="icon_vip" width="25.666666030883789" height="25.666666030883789"/> |
| | | </resources> |
| | | </document> |
| | |
| | | // Initialization code |
| | | |
| | | |
| | | jq_cornerRadius = 10 |
| | | jq_cornerRadius = 15 |
| | | view_price.jq_cornerRadius = 12.55 |
| | | let blurEffect = UIBlurEffect(style: .light) |
| | | let visualEffectView = UIVisualEffectView(effect: blurEffect) |
| | |
| | | super.awakeFromNib() |
| | | // Initialization code |
| | | |
| | | jq_cornerRadius = 10 |
| | | jq_cornerRadius = 15 |
| | | |
| | | let blurEffect = UIBlurEffect(style: .light) |
| | | let visualEffectView = UIVisualEffectView(effect: blurEffect) |
| | |
| | | func setCourseModel(_ model:CourseModel){ |
| | | img_cover.sd_setImage(with: URL(string: model.coverUrl.jq_urlEncoded().components(separatedBy: ",").last)) |
| | | label_title.text = model.courseTitle |
| | | label_subTitle.text = model.briefIntroduction |
| | | label_subTitle.text = model.briefIntroduction.jq_filterFromHTML_1() |
| | | label_num.text = "\(model.count)" |
| | | img_vip.isHidden = model.isVip != .yes |
| | | |
| | |
| | | <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z5u-My-91l"> |
| | | <rect key="frame" x="20" y="34.666666666666686" width="10.666666666666664" height="10.333333333333336"/> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z5u-My-91l"> |
| | | <rect key="frame" x="20" y="34.666666666666686" width="106" height="10.333333333333336"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="Fam-ne-FM1"/> |
| | | <constraint firstAttribute="height" constant="10.57" id="epJ-Xi-ukn"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" pointSize="11"/> |
| | |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_use_small" translatesAutoresizingMaskIntoConstraints="NO" id="hE1-AV-t8f"> |
| | | <rect key="frame" x="136" y="34.666666666666686" width="10" height="10.333333333333336"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JaY-19-IAL"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JaY-19-IAL"> |
| | | <rect key="frame" x="148" y="33" width="7" height="13.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="11"/> |
| | | <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> |
| | |
| | | <constraint firstItem="hE1-AV-t8f" firstAttribute="centerY" secondItem="z5u-My-91l" secondAttribute="centerY" id="lIq-lg-iPk"/> |
| | | <constraint firstAttribute="height" constant="65" id="mM2-ih-U9T"/> |
| | | <constraint firstItem="z5u-My-91l" firstAttribute="leading" secondItem="byc-Ar-sJL" secondAttribute="leading" id="q6f-hc-Nga"/> |
| | | <constraint firstItem="hE1-AV-t8f" firstAttribute="leading" secondItem="z5u-My-91l" secondAttribute="trailing" constant="10" id="wgV-ti-lnF"/> |
| | | </constraints> |
| | | </view> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_vip" translatesAutoresizingMaskIntoConstraints="NO" id="yBF-fO-fwz"> |
| | | <rect key="frame" x="14.666666666666666" y="7.6666666666666661" width="21.333333333333336" height="21.333333333333336"/> |
| | | <rect key="frame" x="14.666666666666666" y="7.6666666666666661" width="25.666666666666671" height="25.666666666666671"/> |
| | | </imageView> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rmi-DQ-cp9"> |
| | | <rect key="frame" x="14.666666666666668" y="7.6666666666666679" width="38.666666666666657" height="25.000000000000004"/> |
| | |
| | | </constraints> |
| | | <size key="customSize" width="178" height="301"/> |
| | | <connections> |
| | | <outlet property="cons_maxSubTitle" destination="Fam-ne-FM1" id="L5X-GP-uev"/> |
| | | <outlet property="image_free" destination="deT-IZ-PtZ" id="kI7-7g-aIM"/> |
| | | <outlet property="img_cover" destination="cCC-0f-GSV" id="85x-ue-edy"/> |
| | | <outlet property="img_offline" destination="IJ3-94-7an" id="EYY-vi-GGP"/> |
| | |
| | | <image name="icon_freee" width="50" height="18"/> |
| | | <image name="icon_offline" width="34" height="18"/> |
| | | <image name="icon_use_small" width="10" height="10.666666984558105"/> |
| | | <image name="icon_vip" width="21.666666030883789" height="21.666666030883789"/> |
| | | <image name="icon_vip" width="25.666666030883789" height="25.666666030883789"/> |
| | | </resources> |
| | | </document> |
| | |
| | | // Initialization code |
| | | |
| | | |
| | | cover_bgImage.jq_cornerRadius = 10 |
| | | cover_bgImage.jq_cornerRadius = 15 |
| | | view_price.jq_cornerRadius = 12.55 |
| | | |
| | | let blurEffect = UIBlurEffect(style: .light) |
| | |
| | | titleItems.removeAll() |
| | | |
| | | titleItems.append(TitleItem(title: "每日疗愈", subTitle: "Daily Meditation")) |
| | | titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Meditation",hasMore: true)) |
| | | titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Customization",hasMore: true)) |
| | | titleItems.append(TitleItem(title: "新手冥想指南", subTitle: "Meditation guide")) |
| | | |
| | | if let setting = UserDefaultSettingViewModel.getSetting(){ |
| | |
| | | self.getData() |
| | | }) |
| | | |
| | | getData() |
| | | if let m = UserDefaultSettingViewModel.getSetting()?.bgm { |
| | | topMenuView.image_top.sd_setImage(with: URL(string: m.imageUrl)) |
| | | } |
| | | |
| | | // DispatchQueue.main.asyncAfter(delay: 3.0) { |
| | | // Popup_1_View.show(state: .success, title: "修改成功", subtitle: "您的密码已修改成功,快去登录账户吧") { |
| | | // self.navigationController?.popToRootViewController(animated: true) |
| | | // } |
| | | // } |
| | | getData() |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | self.viewModel.meditationList.removeAll() |
| | | self.titleItems.removeAll() |
| | | self.titleItems.append(TitleItem(title: "每日疗愈", subTitle: "Daily Meditation")) |
| | | self.titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Meditation",hasMore: true)) |
| | | self.titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Customization",hasMore: true)) |
| | | self.titleItems.append(TitleItem(title: "新手冥想指南", subTitle: "Meditation guide")) |
| | | |
| | | |
| | |
| | | if let m = model{ |
| | | img_cover.sd_setImage(with: URL(string: m.backgroundUrl)) |
| | | label_title.text = "\(m.meditationTitle) | 00:00" |
| | | label_joinNum.text = "\(m.realLearnedNum)人已参加学习" |
| | | label_joinNum.text = "\(m.realLearnedNum + m.virtualLearnedNum)人已参加学习" |
| | | } |
| | | } |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <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"/> |
| | |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Stl-8O-SW3"> |
| | | <rect key="frame" x="48.999999999999986" y="18.666666666666629" width="232.66666666666663" height="29"/> |
| | | <subviews> |
| | | <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="留下你的精彩评论吧" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="p6F-O6-dow" customClass="QMUITextField"> |
| | | <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入内容" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="p6F-O6-dow" customClass="QMUITextField"> |
| | | <rect key="frame" x="16" y="0.0" width="208.66666666666666" height="29"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="11"/> |
| | | <textInputTraits key="textInputTraits"/> |
| | |
| | | <rect key="frame" x="0.0" y="329" width="393" height="400"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0条提问" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tJL-SB-mev"> |
| | | <rect key="frame" x="169.66666666666666" y="24" width="54" height="17"/> |
| | | <rect key="frame" x="170.33333333333334" y="24" width="52.666666666666657" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/> |
| | | <color key="textColor" red="0.2196078431372549" green="0.2196078431372549" blue="0.2196078431372549" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | private var id:Int! |
| | | private var timeLook:Int = 0 //观看时间记录 |
| | | private var settingViewModel = UserDefaultSettingViewModel.getSetting() |
| | | |
| | | private var currentInterval:TimeInterval = 0 |
| | | private var totalInterval:TimeInterval = 0 |
| | | |
| | | |
| | | private var model:MeditationModel?{ |
| | | didSet{ |
| | | if let m = model{ |
| | |
| | | } |
| | | |
| | | }.disposed(by: disposeBag) |
| | | |
| | | |
| | | slider_voice.rx.value.changed.subscribe(onNext: {[weak self] v in |
| | | guard let weakSelf = self else { return } |
| | | let value = (v.double / 100.0) * weakSelf.totalInterval |
| | | self?.audioPlayer.setBGMRate(value: value) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func startMiniRunloop(){ |
| | |
| | | } |
| | | |
| | | @IBAction func playAction(_ sender: UIButton) { |
| | | sender.isSelected = !sender.isSelected |
| | | if let m = model{ |
| | | audioPlayer.playBGMAt(firstPlayIndex: 0, model: m, delegate: self) |
| | | |
| | | if sender.isSelected{ |
| | | audioPlayer.playBGMAt(firstPlayIndex: 0, model: m, delegate: self,coverImage: img_background.image) |
| | | }else{ |
| | | audioPlayer.bgmPlayer?.pause() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | guard !totalInterval.isNaN else {return} |
| | | guard !currentInterval.isNaN else {return} |
| | | |
| | | self.currentInterval = currentInterval |
| | | self.totalInterval = totalInterval |
| | | |
| | | timeLook += 1 |
| | | |
| | | let v = currentInterval / totalInterval * 100 |
| | | print("music:当前时间:\(currentInterval) ---- \(totalInterval) -- \(v)%") |
| | | self.slider_voice.value = Float(v) |
| | | |
| | | if !self.slider_voice.isTracking{ |
| | | self.slider_voice.value = Float(v) |
| | | } |
| | | |
| | | let current = Date.jq_formateToTime_tuple(Int(currentInterval)) |
| | | label_currentTime.text = String(format: "%02ld:%02ld", current.hour * 60 + current.minute,current.second) |
| | | |
| | |
| | | <constraint firstAttribute="width" constant="65.5" id="YnH-gC-sgS"/> |
| | | </constraints> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" image="icon_play"/> |
| | | <state key="normal" image="btn_play"/> |
| | | <connections> |
| | | <action selector="playAction:" destination="-1" eventType="touchUpInside" id="DT7-8R-5nM"/> |
| | | </connections> |
| | |
| | | <resources> |
| | | <image name="btn_comment" width="18.666666030883789" height="19"/> |
| | | <image name="btn_list" width="17" height="13.666666984558105"/> |
| | | <image name="btn_play" width="65.666664123535156" height="65.666664123535156"/> |
| | | <image name="btn_roll" width="22.666666030883789" height="19.666666030883789"/> |
| | | <image name="btn_roll_loop" width="22.666666030883789" height="19.666666030883789"/> |
| | | <image name="btn_time" width="20.666666030883789" height="20.666666030883789"/> |
| | | <image name="demo_bg" width="621" height="1064"/> |
| | | <image name="icon_play" width="46" height="46"/> |
| | | <image name="icon_time_3" width="16" height="16"/> |
| | | <systemColor name="systemBackgroundColor"> |
| | | <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | |
| | | switch type { |
| | | case .course: |
| | | let model = models[indexPath.row] as! CourseModel |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | push(vc: vc) |
| | | } |
| | | |
| | | case .muse: |
| | | let model = models[indexPath.row] as! MeditationModel |
| | | let vc = HomeItemDetailVC(id: model.id) |
| | |
| | | self.image_cover.sd_setImage(with: URL(string: m.coverUrl.jq_urlEncoded())) |
| | | self.label_courseName.text = m.courseTitle |
| | | self.label_price.text = "愈疗币\(m.iosPrice.jq_formatFloat)" |
| | | self.label_teacher.text = "导师\(m.tutor)" |
| | | self.label_paymentCount.text = "x\(m.count)" |
| | | self.label_teacher.text = "导师 \(m.tutor)" |
| | | self.label_paymentCount.text = "x\(m.count == 0 ? 1:m.count)" |
| | | self.label_orderPrice.text = "愈疗币\(m.iosPrice.jq_formatFloat)" |
| | | self.label_totalPrice.text = "愈疗币\(m.iosPrice.jq_formatFloat)" |
| | | } |
| | |
| | | case .course: |
| | | let m = courseViewModel!.dataSource.value!.list[indexPath.row] |
| | | if m.chargeType == .free || (m.chargeType == .vipFree && isVip == .yes) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | let vc = CourseDetialVC(courseId: m.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | |
| | | if m.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: m.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: m.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | }else{ |
| | | if m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | |
| | | } |
| | | |
| | | btn_belike = UIButton(type: .custom) |
| | | btn_belike.setImage(UIImage(named: "btn_good")?.withTintColor(UIColor(hexStr: "fe5b60")), for: .selected) |
| | | btn_belike.setImage(UIImage(named: "btn_good_1")?.withTintColor(UIColor(hexStr: "fe5b60")), for: .selected) |
| | | btn_belike.setImage(UIImage(named: "btn_good"), for: .normal) |
| | | btn_belike.addTarget(self, action: #selector(belike), for: .touchUpInside) |
| | | contentView.addSubview(btn_belike) |
| | |
| | | |
| | | func setCommentModel(_ model:CommentModel){ |
| | | self.model = model |
| | | img_userCover.sd_setImage(with: URL(string: model.nickname)) |
| | | img_userCover.sd_setImage(with: URL(string: model.avatar.jq_urlEncoded())) |
| | | label_content.text = model.content |
| | | label_userName.text = model.nickname |
| | | btn_belike.isSelected = model.like == .yes |
| | |
| | | label_subTitle.snp.makeConstraints { make in |
| | | make.left.equalTo(19) |
| | | make.top.equalTo(label_title.snp.bottom).offset(9) |
| | | make.height.equalTo(5.5) |
| | | } |
| | | |
| | | btn_more = UIButton(type: .custom) |
| | |
| | | func setPrice(type:PaymentOrderVC.PaymentOrderType,id:Int,price:Double){ |
| | | self.id = id |
| | | self.type = type |
| | | label_price.text = "\(price.jq_formatFloat)" |
| | | |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "疗愈币", withFont: .systemFont(ofSize: 18, weight: .semibold), withColor: UIColor(hexStr: "#FF9000")) |
| | | .add(string: String(format: "%.2lf", price), withFont: UIFont(name: "DIN Alternate", size: 30)!, withColor: UIColor(hexStr: "#FF9000")).mutableAttributedString |
| | | |
| | | switch type { |
| | | case .course:btn_lookCourse.setTitle("查看课程", for: .normal) |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="支付成功" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vka-pM-ru5"> |
| | | <rect key="frame" x="194.33333333333334" y="109" width="57.333333333333343" height="20"/> |
| | | <rect key="frame" x="195.33333333333334" y="109" width="55.666666666666657" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="SWT-Sd-K2H"/> |
| | | </constraints> |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hDa-VO-Vzk"> |
| | | <rect key="frame" x="213" y="165" width="20.333333333333343" height="37"/> |
| | | <rect key="frame" x="214.66666666666666" y="165" width="17" height="37"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="37" id="9iu-Ck-Y6k"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="boldSystem" pointSize="30"/> |
| | | <fontDescription key="fontDescription" name="HelveticaNeue-Bold" family="Helvetica Neue" pointSize="30"/> |
| | | <color key="textColor" red="1" green="0.56470588235294117" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "修改密码" |
| | | |
| | | yy_popBlock = {[weak self] in |
| | | guard let weakSelf = self else { return } |
| | | for vc in weakSelf.navigationController?.viewControllers ?? []{ |
| | | if vc is ForgotPasswordVC{ |
| | | weakSelf.navigationController?.popToViewController(vc, animated: true);break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | |
| | | import UIKit |
| | | |
| | | let BindWechat_Noti = Notification.Name.init("BindWechat_Noti") |
| | | |
| | | class BindAccountVC: BaseVC { |
| | | @IBOutlet weak var label_phone: UILabel! |
| | | @IBOutlet weak var label_wchatBindState: UILabel! |
| | |
| | | title = "账号绑定" |
| | | label_phone.text = UserViewModel.getAvatarInfo().cellPhone |
| | | label_wechatBind.text = UserViewModel.getAvatarInfo().wxOpenId.isEmpty ? "未绑定":"已绑定" |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(BindWechat_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] _ in |
| | | self?.label_wechatBind.text = UserViewModel.getAvatarInfo().wxOpenId.isEmpty ? "未绑定":"已绑定" |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func bindPhoneAction(_ sender: Any) { |
| | |
| | | let vc = ForgotPasswordVC() |
| | | push(vc: vc) |
| | | } |
| | | |
| | | |
| | | @IBAction func bindWechatAction(_ sender: TapBtn) { |
| | | WeChatTools.sendAuthRequest() |
| | | } |
| | | } |
| | |
| | | <constraint firstItem="rnP-eo-8fV" firstAttribute="centerY" secondItem="Wgk-EY-Mp1" secondAttribute="centerY" id="t59-mZ-wZl"/> |
| | | <constraint firstAttribute="bottom" secondItem="8Ba-ju-fm8" secondAttribute="bottom" id="zUS-gF-Qtl"/> |
| | | </constraints> |
| | | <connections> |
| | | <action selector="bindWechatAction:" destination="-1" eventType="touchUpInside" id="ghw-d3-txO"/> |
| | | </connections> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Dao-ey-Pqx" customClass="TapBtn" customModule="XQMuse" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="102" width="393" height="51"/> |
| | |
| | | |
| | | class InviteVC: BaseVC { |
| | | |
| | | @IBOutlet weak var scrollView: UIScrollView! |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var btn_share: UIButton! |
| | | @IBOutlet weak var view_role: UIView! |
| | |
| | | @IBAction func shareAction(_ sender: UIButton) { |
| | | |
| | | let string = String(format: "%@%@?userId=%ld", ShareUrl,"/poster/poster",UserViewModel.getAvatarInfo().id) |
| | | ShareView.show(URL(string: string)!, title: "心泉·疗愈", desc: "心泉疗愈1") |
| | | |
| | | ShareView.show(URL(string: string)!, title: "心泉·疗愈", desc: "心泉疗愈1",hasSave: true) {[weak self] in |
| | | self?.scrollView.jq_captureAsLongImage(saveToAlbum: true) |
| | | alertSuccess(msg: "已保存至相册") |
| | | } |
| | | } |
| | | } |
| | |
| | | <outlet property="img_qrCode" destination="bff-wn-eyk" id="FV9-RT-3rK"/> |
| | | <outlet property="label_role" destination="PXe-Ef-0Zn" id="E0d-R5-kBO"/> |
| | | <outlet property="label_title" destination="oFE-SE-88r" id="C2L-3T-B60"/> |
| | | <outlet property="scrollView" destination="Kj8-pf-QQp" id="30y-rn-UUc"/> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | | <outlet property="view_role" destination="nfc-1h-yql" id="FWd-fZ-91R"/> |
| | | </connections> |
| | |
| | | |
| | | if textField == tf_birthday{ |
| | | view.endEditing(true) |
| | | BitrhdayPickerView.show(title: "", type: .YMD) {[weak self] date in |
| | | |
| | | let date = tf_birthday.text?.date(withFormat: "yyyy-MM-dd") //默认回填 |
| | | |
| | | BitrhdayPickerView.show(title: "", type: .YMD,defaultYear: date?.year,defaultMonth: date?.month,defaultDay: date?.day) {[weak self] date in |
| | | self?.tf_birthday.text = date.jq_format("yyyy-MM-dd") |
| | | } |
| | | return false |
| | |
| | | import UIKit |
| | | import JQTools |
| | | import StoreKit |
| | | import WebKit |
| | | |
| | | class VIPCenterVC: BaseVC { |
| | | |
| | |
| | | @IBOutlet weak var collectionView: UICollectionView! |
| | | @IBOutlet weak var btn_isRead: UIButton! |
| | | @IBOutlet weak var label_expirtTime: UILabel! |
| | | @IBOutlet weak var webView: WKWebView! |
| | | @IBOutlet weak var webViewHeiCons: NSLayoutConstraint! |
| | | private var selectIndex = 0 |
| | | |
| | | private var productList = Set<String>() |
| | |
| | | self.label_vipHint.text = "升级为会员,解锁会员专属体验" |
| | | self.label_expirtTime.text = "你还未开通会员服务" |
| | | } |
| | | |
| | | Services.getVipContent(type: 1).subscribe(onNext: { data in |
| | | if let string = data.data{ |
| | | self.webView.loadHTMLString(string.jq_wrapHtml(), baseURL: nil) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setRx() { |
| | | webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in |
| | | if let size = size{ |
| | | return size.height |
| | | } |
| | | return nil |
| | | }.subscribe(onNext: { [unowned self](height) in |
| | | if let height = height{ |
| | | self.webViewHeiCons.constant = height |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | |
| | | <outlet property="label_expirtTime" destination="9TG-o4-3iP" id="gfB-ZZ-lSf"/> |
| | | <outlet property="label_vipHint" destination="teL-7U-G1S" id="PaY-O3-zF6"/> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | | <outlet property="webView" destination="a9D-PO-axc" id="gQy-Z6-lY3"/> |
| | | <outlet property="webViewHeiCons" destination="AWY-C0-cXO" id="PWS-gA-rpV"/> |
| | | </connections> |
| | | </placeholder> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_voice_top" translatesAutoresizingMaskIntoConstraints="NO" id="VLP-Hy-naC"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="297"/> |
| | | </imageView> |
| | | <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bkf-bh-gzu"> |
| | | <rect key="frame" x="0.0" y="59" width="393" height="759"/> |
| | | <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bkf-bh-gzu"> |
| | | <rect key="frame" x="0.0" y="59" width="393" height="656"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="L2t-aS-dfp"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="462.66666666666669"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="482.66666666666669"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h8a-aO-hri"> |
| | | <rect key="frame" x="14" y="54.666666666666679" width="365" height="113.33333333333331"/> |
| | |
| | | </collectionViewFlowLayout> |
| | | </collectionView> |
| | | <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="a9D-PO-axc"> |
| | | <rect key="frame" x="0.0" y="362.66666666666669" width="393" height="100"/> |
| | | <rect key="frame" x="0.0" y="382.66666666666669" width="393" height="100"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="100" id="AWY-C0-cXO"/> |
| | | </constraints> |
| | |
| | | </wkWebView> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstItem="a9D-PO-axc" firstAttribute="top" secondItem="Ue5-Zy-CjC" secondAttribute="bottom" id="15v-6A-0ji"/> |
| | | <constraint firstItem="a9D-PO-axc" firstAttribute="top" secondItem="Ue5-Zy-CjC" secondAttribute="bottom" constant="20" id="15v-6A-0ji"/> |
| | | <constraint firstItem="Ue5-Zy-CjC" firstAttribute="top" secondItem="yWI-Sm-wHz" secondAttribute="bottom" constant="12.5" id="8id-05-Hve"/> |
| | | <constraint firstItem="yWI-Sm-wHz" firstAttribute="top" secondItem="h8a-aO-hri" secondAttribute="bottom" constant="29" id="G5O-gM-Ih2"/> |
| | | <constraint firstAttribute="trailing" secondItem="h8a-aO-hri" secondAttribute="trailing" constant="14" id="Hkp-e9-iFe"/> |
| | |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Qa1-cj-VoU" secondAttribute="trailing" id="17Q-Ar-AY7"/> |
| | | <constraint firstItem="VLP-Hy-naC" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="DUD-QX-KBG"/> |
| | | <constraint firstItem="bkf-bh-gzu" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="GX4-yE-DfY"/> |
| | | <constraint firstItem="Qa1-cj-VoU" firstAttribute="top" secondItem="bkf-bh-gzu" secondAttribute="bottom" id="NdD-Eg-nQL"/> |
| | | <constraint firstAttribute="bottom" secondItem="Qa1-cj-VoU" secondAttribute="bottom" id="ORB-Sa-yIO"/> |
| | | <constraint firstItem="VLP-Hy-naC" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="TTg-Kg-sh0"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="bkf-bh-gzu" secondAttribute="trailing" id="bNU-bF-fJd"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="bkf-bh-gzu" secondAttribute="bottom" id="gKn-YZ-1jy"/> |
| | | <constraint firstItem="bkf-bh-gzu" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="kpV-5I-DMc"/> |
| | | <constraint firstItem="Qa1-cj-VoU" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="m1A-Bv-NWm"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="VLP-Hy-naC" secondAttribute="trailing" id="ul0-Xj-7Nb"/> |
| | |
| | | |
| | | let m = viewModel.dataSource.value[indexPath.row] |
| | | if viewModel.state.value == 1{ |
| | | let vc = CourseDetialVC(courseId: m.businessId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = HomeItemDetailVC(id: m.businessId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | if m.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: m.businessId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: m.businessId) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | .append(key: "cellPhone", value: cellPhone) |
| | | .append(key: "captcha", value: captcha) |
| | | .append(key: "inviteUserId", value: inviteUserId) |
| | | .append(key: "password", value: password.jq_md5String().uppercased()) |
| | | .append(key: "password", value: password.jq_md5String().lowercased()) |
| | | .append(key: "apipost_id", value: "246d7806b0e268") |
| | | return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: true) |
| | | } |
| | |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | | class func sowAgain()->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/user/client/app-user-tree/restart") |
| | | return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: true) |
| | | } |
| | | |
| | | //浇水 |
| | | class func watering()->Observable<BaseResponse<WateringModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | |
| | | .interface(url: "/system/system/page/getPage") |
| | | return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: false) |
| | | } |
| | | |
| | | /// 获取会员权益介绍-获取会员用户协议-获取续费管理说明 |
| | | /// - Parameter type: 内容类型 1=会员权益介绍 2=会员用户协议 3=续费管理说明 |
| | | class func getVipContent(type:Int)->Observable<BaseResponse<String>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "/system/system/vip-setting/getVipContent") |
| | | .append(key: "type", value: type) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | } |
| | |
| | | |
| | | tf_input.rx.text.orEmpty.subscribe(onNext: {[unowned self] text in |
| | | self.numberMinutes = text.int ?? 1 |
| | | self.status = .choose(self.numberMinutes) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | |
| | | btn_cancel.jq_gradientNibColor(colorArr: [UIColor(hexStr: "#8EA47A").cgColor,UIColor(hexStr: "#AFCA98").cgColor], cornerRadius: 18.5) |
| | | } |
| | | |
| | | |
| | | @IBAction func customReduceAction(_ sender: Any) { |
| | | userCustomer() |
| | | numberMinutes-=1 |
| | | |
| | | numberMinutes = max(1,numberMinutes) |
| | | tf_input.text = numberMinutes.string |
| | | } |
| | | |
| | | @IBAction func customAddAction(_ sender: Any) { |
| | | userCustomer() |
| | | numberMinutes+=1 |
| | | tf_input.text = numberMinutes.string |
| | | } |
| | | |
| | | @IBAction func cancelAction(_ sender: UIButton) { |
| | | endEditing(true) |
| | | |
| | | if case .choose(let v) = status { |
| | | clouse?(status) |
| | | } |
| | | |
| | | private func closeAni(){ |
| | | cons_bottom.constant = -JQ_ScreenH |
| | | UIView.animate(withDuration: 0.4) { |
| | | self.alpha = 0 |
| | | self.layoutIfNeeded() |
| | | } |
| | | } |
| | | |
| | | |
| | | @IBAction func customReduceAction(_ sender: Any) { |
| | | userCustomer() |
| | | var t = tf_input.text?.int ?? 1 |
| | | t = max(1,t) |
| | | status = .choose(t) |
| | | tf_input.text = t.string |
| | | } |
| | | |
| | | @IBAction func customAddAction(_ sender: Any) { |
| | | userCustomer() |
| | | var t = tf_input.text?.int ?? 1 |
| | | t += 1 |
| | | status = .choose(t) |
| | | tf_input.text = t.string |
| | | } |
| | | |
| | | @IBAction func closeAction(_ sender: UIButton) { |
| | | closeAni() |
| | | } |
| | | |
| | | @IBAction func cancelAction(_ sender: UIButton) { |
| | | endEditing(true) |
| | | clouse?(status) |
| | | closeAni() |
| | | } |
| | | |
| | | private func userCustomer(){ |
| | |
| | | status = .choose(numberMinutes) |
| | | default: |
| | | numberMinutes = text!.jq_filterNum().int ?? 0 |
| | | tf_input.text = numberMinutes.string |
| | | // tf_input.text = numberMinutes.string |
| | | status = .choose(numberMinutes) |
| | | } |
| | | }else{ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <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"/> |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="5分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R6N-pc-KFT"> |
| | | <rect key="frame" x="0.0" y="20.333333333333343" width="44.666666666666664" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333343" width="43.666666666666664" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="60.000000000000028" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="10分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4dF-XD-wTF"> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="52.333333333333336" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="51.333333333333336" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="120.00000000000003" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="15分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c3J-LT-iKQ"> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="52" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="51" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="180.00000000000003" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="30分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VZp-Te-BRo"> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="54.666666666666664" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="54" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="240" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="60分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MAb-Aa-TfD"> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="55" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333314" width="54" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="300" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="90分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yau-63-b2F"> |
| | | <rect key="frame" x="0.0" y="20.333333333333371" width="55" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333371" width="54" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="360" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="自定义" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="13t-bq-ZrI"> |
| | | <rect key="frame" x="0.0" y="20.333333333333371" width="49" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333371" width="47.666666666666664" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="分钟" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7t6-hs-qy2"> |
| | | <rect key="frame" x="305.33333333333331" y="20.333333333333371" width="32.666666666666686" height="19.333333333333329"/> |
| | | <rect key="frame" x="306" y="20.333333333333371" width="32" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pco-QS-K6g"> |
| | | <rect key="frame" x="183.33333333333334" y="13.333333333333371" width="111.00000000000003" height="33"/> |
| | | <rect key="frame" x="184" y="13.333333333333371" width="111" height="33"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nZz-b9-hm4"> |
| | | <rect key="frame" x="34.333333333333343" y="7" width="0.6666666666666643" height="19"/> |
| | |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gdb-Sf-7En"> |
| | | <rect key="frame" x="80.333333333333314" y="7" width="1" height="19"/> |
| | | <rect key="frame" x="80.333333333333343" y="7" width="1" height="19"/> |
| | | <color key="backgroundColor" red="0.74509803919999995" green="0.74509803919999995" blue="0.74509803919999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="0.90000000000000002" id="4Ak-wJ-Pn9"/> |
| | | </constraints> |
| | | </view> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3gc-AH-OlI"> |
| | | <rect key="frame" x="81.333333333333314" y="0.0" width="29.666666666666671" height="33"/> |
| | | <rect key="frame" x="81.333333333333343" y="0.0" width="29.666666666666671" height="33"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="+"> |
| | | <color key="titleColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | |
| | | <rect key="frame" x="0.0" y="420" width="338" height="60"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="关闭倒计时" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nEw-Jm-F5g"> |
| | | <rect key="frame" x="0.0" y="20.333333333333371" width="81.666666666666671" height="19.333333333333329"/> |
| | | <rect key="frame" x="0.0" y="20.333333333333371" width="79.666666666666671" height="19.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> |
| | | <color key="textColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <constraint firstAttribute="trailing" secondItem="Frj-KE-ITo" secondAttribute="trailing" constant="47.5" id="bYf-d0-Klo"/> |
| | | </constraints> |
| | | </view> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RIb-w0-AAo"> |
| | | <rect key="frame" x="0.0" y="58.999999999999986" width="393" height="166.66666666666663"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <connections> |
| | | <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="sJU-dJ-ta7"/> |
| | | </connections> |
| | | </button> |
| | | </subviews> |
| | | <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> |
| | | <color key="backgroundColor" red="0.36078431370000003" green="0.36078431370000003" blue="0.36078431370000003" alpha="0.14999999999999999" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstItem="RIb-w0-AAo" firstAttribute="top" secondItem="vUN-kp-3ea" secondAttribute="top" id="5p4-ej-zMc"/> |
| | | <constraint firstItem="USh-pc-rFX" firstAttribute="top" secondItem="RIb-w0-AAo" secondAttribute="bottom" id="EO7-Qd-AWU"/> |
| | | <constraint firstItem="USh-pc-rFX" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="WYh-EN-7oF"/> |
| | | <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="RIb-w0-AAo" secondAttribute="trailing" id="ZQn-HF-W3Y"/> |
| | | <constraint firstAttribute="bottom" secondItem="USh-pc-rFX" secondAttribute="bottom" id="ayY-u1-OKu"/> |
| | | <constraint firstItem="RIb-w0-AAo" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="id4-Yj-gvW"/> |
| | | <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="USh-pc-rFX" secondAttribute="trailing" id="qs6-ux-Wne"/> |
| | | </constraints> |
| | | <connections> |
| | |
| | | private var title:String! |
| | | private var desc:String! |
| | | |
| | | private var saveAction:(()->Void)? |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | |
| | |
| | | btn_save.isHidden = true |
| | | } |
| | | |
| | | static func show(_ content:Any,title:String,desc:String){ |
| | | static func show(_ content:Any,title:String,desc:String,hasSave:Bool = false,saveAction:(()->Void)? = nil){ |
| | | let shareView = ShareView.jq_loadNibView() |
| | | shareView.shareContent = content |
| | | shareView.title = title |
| | | shareView.desc = desc |
| | | shareView.saveAction = saveAction |
| | | shareView.btn_save.isHidden = !hasSave |
| | | sceneDelegate?.window?.addSubview(shareView) |
| | | shareView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | shareView.cons_bottom.constant = 0 |
| | |
| | | share() |
| | | } |
| | | |
| | | @IBAction func saveAction(_ sender: Any) { |
| | | saveAction?() |
| | | } |
| | | |
| | | |
| | | private func share(){ |
| | | if let text = shareContent as? String{ |
| | | WeChatTools.shareText(text) |
| | | } |
| | | |
| | | if let url = shareContent as? URL{ |
| | | WeChatTools.shareUrl(url.absoluteString, title: title, desc: desc, thumb:UIImage()) |
| | | WeChatTools.shareUrl(url.absoluteString, title: title, desc: desc, thumb:UIImage(named: "mini_logo")!,scene: scene) |
| | | } |
| | | } |
| | | } |
| | |
| | | <constraint firstItem="TFY-Ai-5mf" firstAttribute="top" secondItem="YWd-mA-5l0" secondAttribute="top" id="wSS-km-sdb"/> |
| | | <constraint firstItem="TFY-Ai-5mf" firstAttribute="leading" secondItem="YWd-mA-5l0" secondAttribute="leading" id="ysx-fS-W3X"/> |
| | | </constraints> |
| | | <connections> |
| | | <action selector="saveAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="4Ab-aC-JOh"/> |
| | | </connections> |
| | | </view> |
| | | </subviews> |
| | | <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | | <image name="btn_close" width="21.333333969116211" height="21.333333969116211"/> |
| | | <image name="btn_close" width="20" height="20"/> |
| | | <image name="btn_download" width="51" height="51"/> |
| | | <image name="btn_wechat_1" width="50" height="50"/> |
| | | <image name="btn_wechat_fri" width="51" height="51"/> |
| | |
| | | |
| | | class PayMusicVC: BaseVC{ |
| | | |
| | | enum PayMuiscState { |
| | | case playing |
| | | case pause |
| | | } |
| | | |
| | | private var coverImage:UIImageView! |
| | | private var label_name:UILabel! |
| | | private var btn_handle:UIButton! |
| | |
| | | private var meditationModel:MeditationModel?{ |
| | | didSet{ |
| | | if let m = meditationModel{ |
| | | coverImage.sd_setImage(with: URL(string: m.coverUrl.jq_urlEncoded()),placeholderImage: UIImage(named: "login_top_bg")) |
| | | coverImage.sd_setImage(with: URL(string: m.coverUrl.components(separatedBy: ",").first!.jq_urlEncoded()),placeholderImage: UIImage(named: "login_top_bg")) |
| | | label_name.text = m.meditationTitle |
| | | } |
| | | } |
| | |
| | | make.centerY.equalToSuperview() |
| | | } |
| | | |
| | | btn_handle = UIButton(type: .custom) |
| | | btn_handle.setImage(UIImage(named: "icon_play_purse"), for: .normal) |
| | | btn_handle.setImage(UIImage(named: "icon_play_small"), for: .selected) |
| | | btn_handle.addTarget(self, action: #selector(tapHandleAction), for: .touchUpInside) |
| | | view.addSubview(btn_handle) |
| | | |
| | | btn_handleClose = UIButton(type: .custom) |
| | | btn_handleClose.setImage(UIImage(named: "icon_play_close"), for: .normal) |
| | | btn_handleClose.addTarget(self, action: #selector(closeAction), for: .touchUpInside) |
| | | view.addSubview(btn_handleClose) |
| | | |
| | | let statckView = UIStackView(arrangedSubviews: [btn_handle,btn_handleClose]) |
| | | statckView.axis = .horizontal |
| | | statckView.distribution = .equalSpacing |
| | | statckView.spacing = 18 |
| | | view.addSubview(statckView) |
| | | statckView.snp.makeConstraints { make in |
| | | make.right.equalToSuperview().offset(-24.5) |
| | | make.centerY.equalToSuperview() |
| | | make.width.equalTo(73.5) |
| | | } |
| | | |
| | | label_name = UILabel() |
| | | label_name.text = "--" |
| | | label_name.font = .systemFont(ofSize: 14.8, weight: .bold) |
| | |
| | | label_name.snp.makeConstraints { make in |
| | | make.left.equalTo(self.coverImage.snp.right).offset(17.5) |
| | | make.centerY.equalToSuperview() |
| | | } |
| | | |
| | | btn_handle = UIButton(type: .custom) |
| | | btn_handle.setImage(UIImage(named: "icon_play_purse"), for: .normal) |
| | | btn_handle.setImage(UIImage(named: "icon_play_small"), for: .selected) |
| | | btn_handle.addTarget(self, action: #selector(tapHandleAction), for: .touchUpInside) |
| | | view.addSubview(btn_handle) |
| | | |
| | | btn_handleClose = UIButton(type: .custom) |
| | | btn_handleClose.setImage(UIImage(named: "icon_play_close"), for: .normal) |
| | | btn_handleClose.addTarget(self, action: #selector(closeAction), for: .touchUpInside) |
| | | view.addSubview(btn_handleClose) |
| | | |
| | | let statckView = UIStackView(arrangedSubviews: [btn_handle,btn_handleClose]) |
| | | statckView.axis = .horizontal |
| | | statckView.distribution = .equalSpacing |
| | | statckView.spacing = 18 |
| | | view.addSubview(statckView) |
| | | statckView.snp.makeConstraints { make in |
| | | make.right.equalToSuperview().offset(-24.5) |
| | | make.centerY.equalToSuperview() |
| | | make.right.equalTo(statckView.snp.left) |
| | | } |
| | | } |
| | | |
| | |
| | | make.bottom.equalToSuperview().offset(-(tabBarHeight)) |
| | | } |
| | | vc.startRunloopAni() |
| | | } |
| | | }else{ |
| | | PayMusicVC.updateStatus(.playing) |
| | | } |
| | | } |
| | | } |
| | | |
| | | static func updateStatus(_ state:PayMuiscState){ |
| | | if let tabBarVC = JQ_currentViewController().navigationController?.tabBarController as? BaseTabBarVC{ |
| | | if let vc = tabBarVC.children.filter({$0 is PayMusicVC}).first as? PayMusicVC{ |
| | | vc.btn_handle.isSelected = state == .pause |
| | | switch state { |
| | | case .playing: |
| | | MPNowPlayingInfoCenter.default().playbackState = .playing |
| | | case .pause: |
| | | MPNowPlayingInfoCenter.default().playbackState = .paused |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | static func hidden(){ |
| | | if let tabBarVC = JQ_currentViewController().navigationController?.tabBarController as? BaseTabBarVC{ |
| | |
| | | AudioPlayer.destroy() |
| | | vc.view.removeFromSuperview() |
| | | vc.removeFromParent() |
| | | MPNowPlayingInfoCenter.default().nowPlayingInfo = nil |
| | | } |
| | | } |
| | | } |
| | |
| | | self.audioPlayer.bgmPlayer?.pause() |
| | | self.audioPlayer.masterPlayer?.pause() |
| | | self.stopRunloopAni() |
| | | PayMusicVC.updateStatus(.pause) |
| | | }else{ |
| | | self.audioPlayer.bgmPlayer?.play() |
| | | self.audioPlayer.masterPlayer?.play() |
| | | self.audioPlayer.masterPlayer?.volume = Float(UserDefaultSettingViewModel.getSetting()?.masterVolume ?? 0.5) |
| | | self.startRunloopAni() |
| | | PayMusicVC.updateStatus(.playing) |
| | | } |
| | | } |
| | | |
| | |
| | | AudioPlayer.destroy() |
| | | } |
| | | |
| | | func playBGMAt(firstPlayIndex:Int,model:MeditationModel,delegate:PayMusicDelegate?){ |
| | | func playBGMAt(firstPlayIndex:Int,model:MeditationModel,delegate:PayMusicDelegate?,coverImage:UIImage? = nil){ |
| | | |
| | | //清除之前的 |
| | | self.urls.removeAll() |
| | | self.masterPlayer?.pause() |
| | | self.bgmPlayer?.pause() |
| | | self.masterPlayer = nil |
| | | self.bgmPlayer = nil |
| | | |
| | | self.delegate = delegate |
| | | self.playIndex = firstPlayIndex |
| | | self.meditationModel = model |
| | |
| | | self.bgmPlayer = AVPlayer(url: self.urls[firstPlayIndex]) |
| | | self.bgmPlayer?.play() |
| | | |
| | | |
| | | if masterUrl != nil{ |
| | | self.masterPlayer = AVPlayer(url: masterUrl!) |
| | | self.masterPlayer?.volume = Float(UserDefaultSettingViewModel.getSetting()?.masterVolume ?? 0.5) |
| | |
| | | weakSelf.next() |
| | | weakSelf.delegate?.playState(.next) |
| | | }else{ |
| | | weakSelf.delegate?.playState(.end) |
| | | PayMusicVC.hidden() |
| | | MPNowPlayingInfoCenter.default().nowPlayingInfo = nil |
| | | weakSelf.bgmPlayer?.pause() |
| | | weakSelf.playIndex = 0 |
| | | weakSelf.bgmPlayer?.replaceCurrentItem(with: AVPlayerItem(url: urls[0])) |
| | | weakSelf.bgmPlayer?.play() |
| | | |
| | | // weakSelf.delegate?.playState(.end) |
| | | // PayMusicVC.hidden() |
| | | // MPNowPlayingInfoCenter.default().nowPlayingInfo = nil |
| | | } |
| | | } |
| | | |
| | |
| | | let asset = weakSelf.bgmPlayer?.currentItem?.asset |
| | | dic[MPMediaItemPropertyPlaybackDuration] = CMTimeGetSeconds(asset!.duration) |
| | | dic[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: CGSize(width: 50, height: 50), requestHandler: { s in |
| | | return UIImage(named: "home_top_bg")! |
| | | |
| | | if let coverImage{ |
| | | return coverImage |
| | | }else{ |
| | | return UIImage(named: "home_top_bg")! |
| | | } |
| | | }) |
| | | MPNowPlayingInfoCenter.default().nowPlayingInfo = dic |
| | | } |
| | | } |
| | | |
| | | //播放完成 |
| | | // NotificationCenter.default.addObserver(self, selector: #selector(playbackEnd), name:NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil) |
| | | |
| | | setLockScreen() |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | func setBGMRate(value:CGFloat){ |
| | | if let v = bgmPlayer?.currentItem?.duration.timescale,v > 0{ |
| | | bgmPlayer?.seek(to: CMTime(seconds: value, preferredTimescale: v)) |
| | | } |
| | | } |
| | | |
| | | /// 播放场景音乐 |
| | | func playSceneAt(_ url:String){ |
| | | guard let URL = URL(string: url) else { return } |
| | |
| | | }else{ |
| | | scenePlayer?.replaceCurrentItem(with: AVPlayerItem(url: URL)) |
| | | } |
| | | DispatchQueue.main.asyncAfter(delay: 3.0) { |
| | | DispatchQueue.main.asyncAfter(delay: 0.5) { |
| | | self.scenePlayer?.play() |
| | | self.scenePlayer?.volume = Float(UserDefaultSettingViewModel.getSetting()?.volume ?? 0.5) |
| | | } |
| | | |
| | | //播放完成 |
| | | // NotificationCenter.default.addObserver(self, selector: #selector(playBGMbackEnd), name:NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil) |
| | | NotificationCenter.default.addObserver(self, selector: #selector(playBGMbackEnd), name:NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil) |
| | | } |
| | | |
| | | func dellocScene(){ |
| | |
| | | // 播放 |
| | | center.playCommand.addTarget {[unowned self] event in |
| | | self.bgmPlayer?.play() |
| | | PayMusicVC.updateStatus(.playing) |
| | | return .success |
| | | } |
| | | |
| | | // 暂停 |
| | | center.pauseCommand.addTarget {[unowned self] event in |
| | | self.bgmPlayer?.pause() |
| | | PayMusicVC.updateStatus(.pause) |
| | | return .success |
| | | } |
| | | |
| | |
| | | |
| | | override func viewWillAppear(_ animated: Bool) { |
| | | super.viewWillAppear(animated) |
| | | player.play() |
| | | bgplayer.play() |
| | | if player.actionAtItemEnd == .pause{ |
| | | player.play() |
| | | } |
| | | } |
| | | |
| | | override func viewDidDisappear(_ animated: Bool) { |
| | | super.viewDidDisappear(animated) |
| | | player.pause() |
| | | // bgplayer.pause() |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | image_cover.sd_setImage(with: URL(string: model.coverUrl.jq_urlEncoded())) |
| | | label_price.text = String(format: "奖品价值:¥%.2lf", model.worth) |
| | | label_energy.text = "所需能量值:\(model.energyValue)" |
| | | label_state.text = model.status == .yes ? "已领取":"待领取" |
| | | view_state.backgroundColor = model.status == .yes ? UIColor(hexString: "#B1CA99")! : UIColor(hexString: "#D0D0D0")! |
| | | label_state.text = model.status == .no ? "已领取":"待领取" |
| | | view_state.backgroundColor = model.status == .no ? UIColor(hexString: "#B1CA99")! : UIColor(hexString: "#D0D0D0")! |
| | | |
| | | view_code.isHidden = model.code.isEmpty || model.status == .yes |
| | | view_code.isHidden = model.code.isEmpty || model.status == .no |
| | | label_code.text = "领取验证码:\(model.code)" |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private func updateTreeInfo(){ |
| | | btn_seedingAgain.isHidden = treeInfoModel!.sowAgain == .no |
| | | btn_seedingAgain.isHidden = treeInfoModel!.treeLevelType != .level_10 |
| | | |
| | | // if treeLevel.rawValue != treeInfoModel?.treeLevelType.rawValue{ |
| | | // treeLevel = treeInfoModel!.treeLevelType |
| | |
| | | icon_energy.text = String(format: "当前能量值:%ld", treeInfoModel!.energyValue) |
| | | setProgress(current: treeInfoModel!.growthValue, total: treeInfoModel!.nextLevel) |
| | | } |
| | | |
| | | @IBAction func sowAgainAction(_ sender: UIButton) { |
| | | Services.sowAgain().subscribe(onNext: {[weak self] _ in |
| | | self?.getTreeData() |
| | | if let soundURL = URL(string:TreeLevel.level_1.sound){ |
| | | self?.voicePlayer.replaceCurrentItem(with: AVPlayerItem(url: soundURL)) |
| | | self?.voicePlayer.play() |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: nil, queue: nil) { [weak self] _ in |
| | |
| | | |
| | | // 0 - 100 |
| | | private func setProgress(current:Int,total:Int){ |
| | | guard total != 0 else { |
| | | self.label_progress.attributedText = AttributedStringbuilder.build().add(string: "0", withFont: .systemFont(ofSize: 12, weight: .bold), withColor: .white, indent: 0, lineSpace: 0).add(string: "\n/NAN", withFont: .systemFont(ofSize: 11,weight: .thin), withColor: .white).mutableAttributedString |
| | | return |
| | | } |
| | | |
| | | let pix = view_progressTotal.height / Double(total) |
| | | let px = Double(current) * pix |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <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"/> |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="35" height="35"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="礼品兑换" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u3e-Oh-9NT"> |
| | | <rect key="frame" x="38" y="9" width="57.333333333333343" height="17"/> |
| | | <rect key="frame" x="38" y="9" width="55.666666666666657" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | </connections> |
| | | </button> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fz4-8h-sWT" customClass="TapBtn" customModule="XQMuse" customModuleProvider="target"> |
| | | <rect key="frame" x="13.999999999999993" y="79" width="119.33333333333331" height="35"/> |
| | | <rect key="frame" x="14.000000000000007" y="79" width="117.66666666666669" height="35"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_energy" translatesAutoresizingMaskIntoConstraints="NO" id="HhA-mI-eXr"> |
| | | <rect key="frame" x="0.0" y="0.0" width="35" height="35"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="当前能量值:0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Xg-17-kuV"> |
| | | <rect key="frame" x="37.999999999999993" y="10.333333333333329" width="81.333333333333314" height="14.333333333333336"/> |
| | | <rect key="frame" x="38.000000000000007" y="10.333333333333329" width="79.666666666666686" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <color key="textColor" red="0.46274509800000002" green="0.5568627451" blue="0.37647058820000001" alpha="1" colorSpace="calibratedRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <real key="value" value="1"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | <connections> |
| | | <action selector="sowAgainAction:" destination="-1" eventType="touchUpInside" id="HBk-Se-NxL"/> |
| | | </connections> |
| | | </button> |
| | | </subviews> |
| | | <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> |
| | |
| | | viewModel.configure(tableView) |
| | | viewModel.beginRefresh() |
| | | |
| | | Services.getTotalEnergy().subscribe(onNext: {[weak self] data in |
| | | self?.viewModel.energyValue.accept(data.data ?? 0) |
| | | self?.label_energy.text = "\(data.data ?? 0)" |
| | | }).disposed(by: disposeBag) |
| | | getData() |
| | | |
| | | Services.getCustomerCode().subscribe(onNext: {[weak self] data in |
| | | self?.image_qrCode.sd_setImage(with: URL(string: data.data ?? "")) |
| | |
| | | tableView.separatorStyle = .none |
| | | tableView.register(UINib(nibName: "TreeTeskEnergyTCell", bundle: nil), forCellReuseIdentifier: "_TreeTeskEnergyTCell") |
| | | } |
| | | |
| | | private func getData(){ |
| | | Services.getTotalEnergy().subscribe(onNext: {[weak self] data in |
| | | self?.viewModel.energyValue.accept(data.data ?? 0) |
| | | self?.label_energy.text = "\(data.data ?? 0)" |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @objc func exchangeRecordAction(){ |
| | | let vc = TreeTeskEnergyExchangeRecordVC() |
| | |
| | | Services.exchangeGift(prizeId: m.id).subscribe(onNext: {data in |
| | | TreeTeskExchangeSuccessView.show(code: data.data ?? "",customerImage: self.image_qrCode.image ?? UIImage()) |
| | | self.viewModel.beginRefresh() |
| | | self.getData() |
| | | }).disposed(by: self.disposeBag) |
| | | } |
| | | } |
| | |
| | | @IBOutlet weak var view_container: UIView! |
| | | @IBOutlet weak var image_qrCode: UIImageView! |
| | | @IBOutlet weak var label_code: UILabel! |
| | | @IBOutlet weak var btn_known: UIButton! |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | |
| | | } |
| | | } |
| | | |
| | | override func layoutSubviews() { |
| | | super.layoutSubviews() |
| | | btn_known.localGradientColor(cornerRadius: 20) |
| | | } |
| | | |
| | | @objc private func longPressCopyAction(_ gesture:UILongPressGestureRecognizer){ |
| | | if gesture.state == .began{ |
| | | if let img = image_qrCode.image{ |
| | |
| | | <constraint firstItem="4ru-7s-yUN" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="zt7-Tt-vce"/> |
| | | </constraints> |
| | | <connections> |
| | | <outlet property="btn_known" destination="h25-4Z-I8T" id="Cms-nO-DiU"/> |
| | | <outlet property="image_qrCode" destination="GQk-cT-1IF" id="U2k-zg-3wi"/> |
| | | <outlet property="label_code" destination="psN-sL-6pq" id="IdT-sk-KdH"/> |
| | | <outlet property="view_container" destination="4ru-7s-yUN" id="C6v-VX-yVc"/> |
| | |
| | | if let m = model{ |
| | | WeChatTools.getUserInfo(access_token: m.access_token, openId: m.openid) { userInfoModel in |
| | | if let u = userInfoModel{ |
| | | Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid).subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | sceneDelegate?.loginSuccess() |
| | | JQ_currentViewController().dismiss(animated:true) |
| | | UserViewModel.saveLoginInfo(model) |
| | | if UserViewModel.getToken()?.isEmpty ?? true{ |
| | | Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid).subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | sceneDelegate?.loginSuccess() |
| | | JQ_currentViewController().dismiss(animated:true) |
| | | UserViewModel.saveLoginInfo(model) |
| | | |
| | | Services.getUserInfo().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | Services.getUserInfo().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | }else{ |
| | | |
| | | |
| | | // NotificationCenter.default.post(name: BindWechat_Noti, object: nil) |
| | | // let v = UserViewModel.getAvatarInfo() |
| | | // v.wxOpenId = u.openid |
| | | // UserViewModel.saveAvatarInfo(v) |
| | | } |
| | | }else{ |
| | | alertError(msg: "获取信息失败") |
| | | } |