Commit 27a29ba16d476ff3d4af1090330d40df38697e17

Authored by 左丞
1 parent 4f6c7b0b
Exists in newLive

no message

YouerLiveVideo/YouerLiveVideo.xcodeproj/project.pbxproj
... ... @@ -29,6 +29,7 @@
29 29 5989394B1ED3CFF4005DA462 /* AppSettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5989394A1ED3CFF4005DA462 /* AppSettingViewController.swift */; };
30 30 5989394D1ED4016D005DA462 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5989394C1ED4016D005DA462 /* HistoryViewController.swift */; };
31 31 598939501ED41C44005DA462 /* ChangePassWordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5989394F1ED41C44005DA462 /* ChangePassWordViewController.swift */; };
  32 + 598939521ED818A7005DA462 /* AllMyResourceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 598939511ED818A7005DA462 /* AllMyResourceViewController.swift */; };
32 33 598A0E531E51941300273AB8 /* libNIMSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598A0E4D1E51941300273AB8 /* libNIMSDK.a */; };
33 34 598A0E541E51941300273AB8 /* libaacplus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598A0E4F1E51941300273AB8 /* libaacplus.a */; };
34 35 598A0E551E51941300273AB8 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 598A0E501E51941300273AB8 /* libcrypto.a */; };
... ... @@ -254,6 +255,7 @@
254 255 5989394A1ED3CFF4005DA462 /* AppSettingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppSettingViewController.swift; sourceTree = "<group>"; };
255 256 5989394C1ED4016D005DA462 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
256 257 5989394F1ED41C44005DA462 /* ChangePassWordViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChangePassWordViewController.swift; sourceTree = "<group>"; };
  258 + 598939511ED818A7005DA462 /* AllMyResourceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AllMyResourceViewController.swift; sourceTree = "<group>"; };
257 259 598A0E121E51941300273AB8 /* NIMChatroom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIMChatroom.h; sourceTree = "<group>"; };
258 260 598A0E131E51941300273AB8 /* NIMChatroomEnterRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIMChatroomEnterRequest.h; sourceTree = "<group>"; };
259 261 598A0E141E51941300273AB8 /* NIMChatroomMember.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NIMChatroomMember.h; sourceTree = "<group>"; };
... ... @@ -1225,6 +1227,7 @@
1225 1227 598939481ED3CFD8005DA462 /* UserEditViewController.swift */,
1226 1228 5989394A1ED3CFF4005DA462 /* AppSettingViewController.swift */,
1227 1229 5989394C1ED4016D005DA462 /* HistoryViewController.swift */,
  1230 + 598939511ED818A7005DA462 /* AllMyResourceViewController.swift */,
1228 1231 5989394E1ED41C31005DA462 /* Setting */,
1229 1232 BFBB83DA1ECC445D008B404B /* UserCenter */,
1230 1233 );
... ... @@ -1598,6 +1601,7 @@
1598 1601 59AE3DFD1ECED5B1003E2C62 /* MoivePlayerViewController.swift in Sources */,
1599 1602 BF25DFF01DDAA36A003EC0C1 /* SessionDelegate.swift in Sources */,
1600 1603 BF7723051ED5667500226D44 /* FilterListViewController.swift in Sources */,
  1604 + 598939521ED818A7005DA462 /* AllMyResourceViewController.swift in Sources */,
1601 1605 BF25DFE31DDAA36A003EC0C1 /* Alamofire.swift in Sources */,
1602 1606 BF25DFEC1DDAA36A003EC0C1 /* Response.swift in Sources */,
1603 1607 BF7B75961E305A6D0011D5C7 /* MJRefreshAutoFooter.m in Sources */,
... ...
YouerLiveVideo/YouerLiveVideo/controllers/User/AllMyResourceViewController.swift 0 → 100644
... ... @@ -0,0 +1,98 @@
  1 +//
  2 +// AllMyResourceViewController.swift
  3 +// YouerLiveVideo
  4 +//
  5 +// Created by 左丞 on 2017/5/26.
  6 +// Copyright © 2017年 左丞. All rights reserved.
  7 +//
  8 +
  9 +import UIKit
  10 +
  11 +class AllMyResourceViewController: UIViewController {
  12 + var myDataSet:[TVStationSubject] = []
  13 + var type:Int = 0// 资源类型 1-资源 0-微课
  14 + @IBOutlet weak var collectionView: UICollectionView!
  15 +
  16 + override func viewDidLoad() {
  17 + super.viewDidLoad()
  18 + AppDelegate.instance().httpServer.getMyAllResources(parameters: ["f_ResourceType":type as AnyObject,"pageIndex":1 as AnyObject]) { (str, error) in
  19 + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
  20 + for item in json.contentData()["resultData"].arrayValue{
  21 + self.myDataSet.append(TVStationSubject(json: item))
  22 + }
  23 + self.collectionView.reloadData()
  24 + }, failHandler: { (error) in
  25 +
  26 + })
  27 + }
  28 +
  29 + // Do any additional setup after loading the view.
  30 + }
  31 +
  32 + override func didReceiveMemoryWarning() {
  33 + super.didReceiveMemoryWarning()
  34 + // Dispose of any resources that can be recreated.
  35 + }
  36 +
  37 + override func viewWillAppear(_ animated: Bool) {
  38 + super.viewWillAppear(animated)
  39 + self.tabBarController?.tabBar.isHidden = true
  40 + }
  41 +
  42 + override func viewWillDisappear(_ animated: Bool) {
  43 + super.viewWillDisappear(animated)
  44 + self.tabBarController?.hidesBottomBarWhenPushed = false
  45 + }
  46 +
  47 + /*
  48 + // MARK: - Navigation
  49 +
  50 + // In a storyboard-based application, you will often want to do a little preparation before navigation
  51 + override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  52 + // Get the new view controller using segue.destinationViewController.
  53 + // Pass the selected object to the new view controller.
  54 + }
  55 + */
  56 +
  57 +}
  58 +
  59 +
  60 +extension AllMyResourceViewController:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
  61 +
  62 + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  63 +
  64 + }
  65 +
  66 + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  67 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! MyResourceCell
  68 + let item = myDataSet[indexPath.row]
  69 + cell.model = item
  70 + return cell
  71 + }
  72 +
  73 + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
  74 + return myDataSet.count
  75 + }
  76 +
  77 + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
  78 + return CGSize(width: (getScreenWidth()-30)/2, height: 200)
  79 + }
  80 +
  81 +
  82 + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
  83 + return UIEdgeInsetsMake(10, 10, 10, 10)
  84 + }
  85 +
  86 +}
  87 +
  88 +class MyResourceCell: UICollectionViewCell {
  89 +
  90 + @IBOutlet weak var name: UILabel!
  91 + @IBOutlet weak var photo: UIImageView!
  92 + var model:TVStationSubject?{
  93 + didSet{
  94 + name.text = model!.f_Title
  95 + photo.sd_setImage(with: URL(string:model!.f_Img), placeholderImage: #imageLiteral(resourceName: "placeholder"))
  96 + }
  97 + }
  98 +}
... ...
YouerLiveVideo/YouerLiveVideo/controllers/User/HistoryViewController.swift
... ... @@ -13,36 +13,22 @@ class HistoryViewController: UIViewController {
13 13 @IBOutlet weak var collectionView: UICollectionView!
14 14  
15 15 var datatSet:[HistoryView] = []
16   - var type:Int = 0// 资源类型 0-微课 1-资源
17   - var isHistory:Int = 0
  16 + var type:Int = 0// 资源类型 1-资源 0-微课
18 17 override func viewDidLoad() {
19 18 super.viewDidLoad()
20   - if isHistory == 0{
21   - AppDelegate.instance().httpServer.getHistroyView(parameters: ["f_ViewType":type as AnyObject,"pageIndex":1 as AnyObject]) { (str, error) in
22   - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
23   - for item in json.contentData()["resultData"].arrayValue{
24   - self.datatSet.append(HistoryView(json: item))
25   - }
26   - self.collectionView.reloadData()
27   - }, failHandler: { (error) in
28   -
29   - })
30   - }
31   - }else{
32   - AppDelegate.instance().httpServer.getHistroyView(parameters: ["f_ViewType":type as AnyObject,"pageIndex":1 as AnyObject]) { (str, error) in
33   - httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
34   - for item in json.contentData()["resultData"].arrayValue{
35   - self.datatSet.append(HistoryView(json: item))
36   - }
37   - self.collectionView.reloadData()
38   - }, failHandler: { (error) in
39   -
40   - })
41   - }
  19 + AppDelegate.instance().httpServer.getHistroyView(parameters: ["f_ViewType":type as AnyObject,"pageIndex":1 as AnyObject]) { (str, error) in
  20 + httpJsonResule(jsonString: str, error: error, successHandler: { (json) in
  21 + for item in json.contentData()["resultData"].arrayValue{
  22 + self.datatSet.append(HistoryView(json: item))
  23 + }
  24 + self.collectionView.reloadData()
  25 + }, failHandler: { (error) in
  26 +
  27 + })
42 28 }
43 29 // Do any additional setup after loading the view.
44 30 }
45   -
  31 +
46 32 override func didReceiveMemoryWarning() {
47 33 super.didReceiveMemoryWarning()
48 34 // Dispose of any resources that can be recreated.
... ...
YouerLiveVideo/YouerLiveVideo/controllers/User/User.storyboard
... ... @@ -650,6 +650,97 @@
650 650 </objects>
651 651 <point key="canvasLocation" x="776.79999999999995" y="550.97451274362822"/>
652 652 </scene>
  653 + <!--All My Resource View Controller-->
  654 + <scene sceneID="J64-gg-aGL">
  655 + <objects>
  656 + <viewController storyboardIdentifier="AllMyResourceViewControllerVC" id="4bq-tX-ySQ" customClass="AllMyResourceViewController" customModule="YouerLiveVideo" customModuleProvider="target" sceneMemberID="viewController">
  657 + <layoutGuides>
  658 + <viewControllerLayoutGuide type="top" id="x1L-q4-db6"/>
  659 + <viewControllerLayoutGuide type="bottom" id="O2S-gP-r2F"/>
  660 + </layoutGuides>
  661 + <view key="view" contentMode="scaleToFill" id="ZXr-P5-zbV">
  662 + <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
  663 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  664 + <subviews>
  665 + <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="EsI-2X-xCe">
  666 + <rect key="frame" x="0.0" y="20" width="375" height="647"/>
  667 + <color key="backgroundColor" red="0.93503493069999999" green="0.93562394380000002" blue="0.96585971120000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
  668 + <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="6Se-Kp-ANd">
  669 + <size key="itemSize" width="178" height="213"/>
  670 + <size key="headerReferenceSize" width="0.0" height="0.0"/>
  671 + <size key="footerReferenceSize" width="0.0" height="0.0"/>
  672 + <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
  673 + </collectionViewFlowLayout>
  674 + <cells>
  675 + <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="6uN-ZL-H4p" customClass="MyResourceCell" customModule="YouerLiveVideo" customModuleProvider="target">
  676 + <rect key="frame" x="0.0" y="0.0" width="178" height="213"/>
  677 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  678 + <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
  679 + <rect key="frame" x="0.0" y="0.0" width="178" height="213"/>
  680 + <autoresizingMask key="autoresizingMask"/>
  681 + <subviews>
  682 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="microCourse_default" translatesAutoresizingMaskIntoConstraints="NO" id="TsT-J7-xEF">
  683 + <rect key="frame" x="0.0" y="0.0" width="178" height="159"/>
  684 + <constraints>
  685 + <constraint firstAttribute="width" secondItem="TsT-J7-xEF" secondAttribute="height" multiplier="178:159" id="PRf-S2-mFr"/>
  686 + </constraints>
  687 + </imageView>
  688 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2y6-Nr-um8">
  689 + <rect key="frame" x="0.0" y="159" width="178" height="54"/>
  690 + <subviews>
  691 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LCD-Pj-jpb">
  692 + <rect key="frame" x="68" y="17" width="42" height="21"/>
  693 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
  694 + <nil key="textColor"/>
  695 + <nil key="highlightedColor"/>
  696 + </label>
  697 + </subviews>
  698 + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
  699 + <constraints>
  700 + <constraint firstItem="LCD-Pj-jpb" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="2y6-Nr-um8" secondAttribute="leading" constant="8" id="Yte-S6-ZR6"/>
  701 + <constraint firstItem="LCD-Pj-jpb" firstAttribute="centerY" secondItem="2y6-Nr-um8" secondAttribute="centerY" id="dum-gS-6zf"/>
  702 + <constraint firstItem="LCD-Pj-jpb" firstAttribute="centerX" secondItem="2y6-Nr-um8" secondAttribute="centerX" id="tfG-Nv-odD"/>
  703 + </constraints>
  704 + </view>
  705 + </subviews>
  706 + </view>
  707 + <constraints>
  708 + <constraint firstItem="2y6-Nr-um8" firstAttribute="top" secondItem="TsT-J7-xEF" secondAttribute="bottom" id="E3P-Fg-zHo"/>
  709 + <constraint firstAttribute="trailing" secondItem="2y6-Nr-um8" secondAttribute="trailing" id="XtL-3p-D1m"/>
  710 + <constraint firstItem="2y6-Nr-um8" firstAttribute="leading" secondItem="6uN-ZL-H4p" secondAttribute="leading" id="cHl-Ph-Mef"/>
  711 + <constraint firstItem="TsT-J7-xEF" firstAttribute="leading" secondItem="6uN-ZL-H4p" secondAttribute="leading" id="fJS-gZ-y8V"/>
  712 + <constraint firstAttribute="bottom" secondItem="2y6-Nr-um8" secondAttribute="bottom" id="kke-ce-UoD"/>
  713 + <constraint firstItem="TsT-J7-xEF" firstAttribute="top" secondItem="6uN-ZL-H4p" secondAttribute="top" id="l6x-ls-i9c"/>
  714 + <constraint firstAttribute="trailing" secondItem="TsT-J7-xEF" secondAttribute="trailing" id="zTg-hc-1z4"/>
  715 + </constraints>
  716 + <connections>
  717 + <outlet property="name" destination="LCD-Pj-jpb" id="M4Z-wm-if7"/>
  718 + <outlet property="photo" destination="TsT-J7-xEF" id="ZjK-mg-V5t"/>
  719 + </connections>
  720 + </collectionViewCell>
  721 + </cells>
  722 + <connections>
  723 + <outlet property="dataSource" destination="4bq-tX-ySQ" id="hGU-XO-Egz"/>
  724 + <outlet property="delegate" destination="4bq-tX-ySQ" id="1DC-Ox-a8J"/>
  725 + </connections>
  726 + </collectionView>
  727 + </subviews>
  728 + <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
  729 + <constraints>
  730 + <constraint firstItem="EsI-2X-xCe" firstAttribute="top" secondItem="x1L-q4-db6" secondAttribute="bottom" id="0WN-t4-HCG"/>
  731 + <constraint firstAttribute="trailing" secondItem="EsI-2X-xCe" secondAttribute="trailing" id="EaB-bU-CKP"/>
  732 + <constraint firstItem="EsI-2X-xCe" firstAttribute="leading" secondItem="ZXr-P5-zbV" secondAttribute="leading" id="Gb4-Bh-dBP"/>
  733 + <constraint firstItem="O2S-gP-r2F" firstAttribute="top" secondItem="EsI-2X-xCe" secondAttribute="bottom" id="L1C-Ae-qCU"/>
  734 + </constraints>
  735 + </view>
  736 + <connections>
  737 + <outlet property="collectionView" destination="EsI-2X-xCe" id="lDF-CB-919"/>
  738 + </connections>
  739 + </viewController>
  740 + <placeholder placeholderIdentifier="IBFirstResponder" id="xjh-a2-0Tr" userLabel="First Responder" sceneMemberID="firstResponder"/>
  741 + </objects>
  742 + <point key="canvasLocation" x="2237.5999999999999" y="-131.78410794602701"/>
  743 + </scene>
653 744 </scenes>
654 745 <resources>
655 746 <image name="microCourse_default" width="100" height="100"/>
... ...
YouerLiveVideo/YouerLiveVideo/controllers/User/UserEditViewController.swift
... ... @@ -23,7 +23,7 @@ class UserEditViewController: UIViewController ,UIImagePickerControllerDelegate,
23 23 }
24 24  
25 25 func setContentArr(){
26   - contentArr = [user.name(),user.phone(),getIdent(),user.schoolName()]
  26 + contentArr = [user.name(),user.id(),getIdent(),user.schoolName()]
27 27 }
28 28  
29 29 func getIdent()->String{
... ...
YouerLiveVideo/YouerLiveVideo/controllers/User/UserViewController.swift
... ... @@ -95,11 +95,19 @@ extension UserViewController:UITableViewDelegate,UITableViewDataSource{
95 95 AppDelegate.instance().window?.makeToast("请先登录")
96 96 return
97 97 }
98   - let vc = Story.instantiateViewControllerWithIdentifier("HistoryViewControllerVC", storyName: "User") as! HistoryViewController
99   - vc.type = indexPath.row
100   - vc.isHistory = indexPath.section
101   - vc.title = historyType[indexPath.row]
102   - self.navigationController?.pushViewController(vc, animated: true)
  98 + let type = 0 == indexPath.row ? 1 : 0
  99 + if indexPath.section == 0{
  100 + let vc = Story.instantiateViewControllerWithIdentifier("HistoryViewControllerVC", storyName: "User") as! HistoryViewController
  101 + vc.type = type
  102 + vc.title = historyType[indexPath.row]
  103 + self.navigationController?.pushViewController(vc, animated: true)
  104 + }else{
  105 + let vc = Story.instantiateViewControllerWithIdentifier("AllMyResourceViewControllerVC", storyName: "User") as! AllMyResourceViewController
  106 + vc.type = type
  107 + vc.title = historyType[indexPath.row]
  108 + self.navigationController?.pushViewController(vc, animated: true)
  109 +
  110 + }
103 111 }
104 112  
105 113 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
... ...