Commit 39a7f3be83147d6646e14eddd7facc28d7432fdd

Authored by 张旭
1 parent 81b032f8

商家上滑页搭建

Showing 26 changed files with 697 additions and 86 deletions
... ... @@ -43,7 +43,9 @@ target 'metaCode' do
43 43 pod 'JXSegmentedView', :git => 'https://gitee.com/mirrors/JXSegmentedView.git'
44 44 pod 'JXPagingView/Paging'
45 45 #轮播图
46   - pod 'FSPagerView', '~> 0.8.3'
  46 + pod 'FSPagerView', '0.8.3'
  47 +# pod 'SDCycleScrollView', '~> 1.82'
  48 +
47 49 #应用调试工具
48 50 # pod 'FWDebug', :configurations => ['Debug']
49 51  
... ...
metaCode.xcodeproj/project.pbxproj
... ... @@ -12,6 +12,10 @@
12 12 192336EB2AD9224300D47CD4 /* CNUpSlideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192336EA2AD9224300D47CD4 /* CNUpSlideViewController.swift */; };
13 13 1926C28F2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */; };
14 14 1926C2912AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */; };
  15 + 19565EC02AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */; };
  16 + 19565EC22AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */; };
  17 + 19565EC52AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */; };
  18 + 19565EC72AF8AD38007D6727 /* CNLiveShopNewProductController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19565EC62AF8AD38007D6727 /* CNLiveShopNewProductController.swift */; };
15 19 19BB1FDF2AEA3A450094D962 /* CNSlideBaseNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FDE2AEA3A450094D962 /* CNSlideBaseNavigationController.swift */; };
16 20 19BB1FE12AEB5C220094D962 /* CNLiveShopConsoleController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */; };
17 21 19BB1FE32AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */; };
... ... @@ -146,6 +150,10 @@
146 150 192336EA2AD9224300D47CD4 /* CNUpSlideViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNUpSlideViewController.swift; sourceTree = "<group>"; };
147 151 1926C28E2AE0D76C00C71DC3 /* CNLiveDownSlideViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideViewModel.swift; sourceTree = "<group>"; };
148 152 1926C2902AE0FD4500C71DC3 /* CNLiveDownSlideModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDownSlideModel.swift; sourceTree = "<group>"; };
  153 + 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailBtnsCell.swift; sourceTree = "<group>"; };
  154 + 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopDetailOrderAssetCell.swift; sourceTree = "<group>"; };
  155 + 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopProductManagerController.swift; sourceTree = "<group>"; };
  156 + 19565EC62AF8AD38007D6727 /* CNLiveShopNewProductController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopNewProductController.swift; sourceTree = "<group>"; };
149 157 19BB1FDE2AEA3A450094D962 /* CNSlideBaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNSlideBaseNavigationController.swift; sourceTree = "<group>"; };
150 158 19BB1FE02AEB5C220094D962 /* CNLiveShopConsoleController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopConsoleController.swift; sourceTree = "<group>"; };
151 159 19BB1FE22AEB8B7C0094D962 /* CNLiveShopConsoleViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopConsoleViewModel.swift; sourceTree = "<group>"; };
... ... @@ -295,6 +303,15 @@
295 303 /* End PBXFrameworksBuildPhase section */
296 304  
297 305 /* Begin PBXGroup section */
  306 + 19565EC32AF8ACC2007D6727 /* 商品管理 */ = {
  307 + isa = PBXGroup;
  308 + children = (
  309 + 19565EC42AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift */,
  310 + 19565EC62AF8AD38007D6727 /* CNLiveShopNewProductController.swift */,
  311 + );
  312 + path = "商品管理";
  313 + sourceTree = "<group>";
  314 + };
298 315 19BB1FE42AEB93850094D962 /* Model */ = {
299 316 isa = PBXGroup;
300 317 children = (
... ... @@ -641,10 +658,12 @@
641 658 19F1C2322AB5728B0083D06C /* CNIDCardView.swift */,
642 659 19FA20162AE22D3C001F7186 /* CNLiveDownSlideRecommendCell.swift */,
643 660 19FA20182AE22D98001F7186 /* CNLiveDownSlideTodayRecommendCell.swift */,
644   - 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */,
645 661 19CC4D4E2ADD0FC200308E2A /* CNUpSlideDetailScrollView.swift */,
646 662 19BB1FE92AEF7B4A0094D962 /* CNLiveShopConsoleCell.swift */,
647 663 19BB1FF12AF21A950094D962 /* CNLliveShopDetailBannerCell.swift */,
  664 + 19CC4D462ADD006600308E2A /* CNDownSlideSingleCourseCell.swift */,
  665 + 19565EBF2AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift */,
  666 + 19565EC12AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift */,
648 667 );
649 668 name = View;
650 669 path = HomePage/View;
... ... @@ -653,6 +672,7 @@
653 672 7CD6754D2A2840B9008354C1 /* Controller */ = {
654 673 isa = PBXGroup;
655 674 children = (
  675 + 19565EC32AF8ACC2007D6727 /* 商品管理 */,
656 676 19BB1FDE2AEA3A450094D962 /* CNSlideBaseNavigationController.swift */,
657 677 7CD6754E2A2840B9008354C1 /* CNMetaCodeHomePageController.swift */,
658 678 19123FC02ABC11170075C883 /* CNWebViewController.swift */,
... ... @@ -980,6 +1000,7 @@
980 1000 192336EB2AD9224300D47CD4 /* CNUpSlideViewController.swift in Sources */,
981 1001 7963989D2A260E6200D045EB /* CNLiveBaseViewController.swift in Sources */,
982 1002 798A44FB2A30999900815935 /* CNLiveAlertTool.swift in Sources */,
  1003 + 19565EC02AF4DE0E007D6727 /* CNLiveShopDetailBtnsCell.swift in Sources */,
983 1004 790D01A52A2DF65E00C5978D /* CNLiveLoginPickerView.swift in Sources */,
984 1005 79BA085D2AB18E8300D01875 /* CNLiveSaveAuthDB.swift in Sources */,
985 1006 79282A3C2A2EDC2500B5F8CF /* NSString+CNLiveExtensions.swift in Sources */,
... ... @@ -1012,6 +1033,7 @@
1012 1033 19CC4D472ADD006600308E2A /* CNDownSlideSingleCourseCell.swift in Sources */,
1013 1034 79E496E32AB9357000127BF8 /* UITableViewCell+CNLiveExtension.swift in Sources */,
1014 1035 7C83B4422A541EBF004BF4A4 /* CALayer+CNLiveExtensions.swift in Sources */,
  1036 + 19565EC72AF8AD38007D6727 /* CNLiveShopNewProductController.swift in Sources */,
1015 1037 798A44F72A3077ED00815935 /* CNLiveHotButton.swift in Sources */,
1016 1038 7CD6753D2A2740B0008354C1 /* CNMainView.swift in Sources */,
1017 1039 793CAF522A58FCA200882EF4 /* CNLiveMineExchangeViewController.swift in Sources */,
... ... @@ -1042,6 +1064,7 @@
1042 1064 7C2703302A36CBE30061EC50 /* CNCertificationView.swift in Sources */,
1043 1065 19CC4D542ADD163D00308E2A /* CNUpSlideCardPresentationController.swift in Sources */,
1044 1066 790D01A32A2DDBA300C5978D /* CNLiveConfigManager.swift in Sources */,
  1067 + 19565EC52AF8AD1F007D6727 /* CNLiveShopProductManagerController.swift in Sources */,
1045 1068 19CC4D492ADD06C500308E2A /* UITableView+Extension.swift in Sources */,
1046 1069 7C2703332A36CC660061EC50 /* CNLiveGlobalBlock.swift in Sources */,
1047 1070 7987BF3D2A497644000A1ABC /* CNLiveMineQuestViewController.swift in Sources */,
... ... @@ -1056,6 +1079,7 @@
1056 1079 790D018B2A2D8B3300C5978D /* CNLiveLoginViewController.swift in Sources */,
1057 1080 19CC4D562ADD19C200308E2A /* String+Extension.swift in Sources */,
1058 1081 7905BB492AB0588B0089BC50 /* CNLiveMineAuthResultViewController.swift in Sources */,
  1082 + 19565EC22AF616CA007D6727 /* CNLiveShopDetailOrderAssetCell.swift in Sources */,
1059 1083 798A44EC2A302DBE00815935 /* CNLiveMineAddInfoViewController.swift in Sources */,
1060 1084 7CD675422A2740F8008354C1 /* CNCustomIndexView.swift in Sources */,
1061 1085 790D01912A2DAC5E00C5978D /* CNLiveConfigFontMacro.swift in Sources */,
... ...
metaCode/Classes/Common/Util/CNLiveCommonBaseModel.swift
... ... @@ -12,12 +12,12 @@ import WCDBSwift
12 12  
13 13 class BaseModel: HandyJSON {
14 14  
15   - var database:Database
  15 +// var database:Database
16 16  
17 17 required init() {
18 18 //数据库地址
19   - let filePath = NSHomeDirectory() + "/Documents/DB/CNLiveBaseModel.db"
20   - database = Database(at: filePath)
  19 +// let filePath = NSHomeDirectory() + "/Documents/DB/CNLiveBaseModel.db"
  20 +// database = Database(at: filePath)
21 21  
22 22 // super.init()
23 23  
... ...
metaCode/Classes/Config/CNLiveConfigUserInfo.swift
... ... @@ -11,7 +11,7 @@ import HandyJSON
11 11  
12 12 class UserInfoModel: BaseModel {
13 13  
14   - required init() {}
  14 +// required init() {}
15 15  
16 16 var appId:String = ""
17 17 var appleUid:String = ""
... ... @@ -120,6 +120,63 @@ class UserInfoManager: NSObject {
120 120 }
121 121 }
122 122  
  123 +class DSUserInfoManager: NSObject{
  124 + static let shared = DSUserInfoManager()
  125 +
  126 + fileprivate var _dsUserInfo : CNLiveShopUserInfoModel?
  127 + private(set) var dsUserInfo: CNLiveShopUserInfoModel {
  128 +
  129 + set {
  130 + _dsUserInfo = newValue
  131 + }
  132 +
  133 + get {
  134 + if _dsUserInfo != nil && _dsUserInfo?.id != nil {
  135 + return _dsUserInfo!
  136 + }
  137 + return DSUserInfoManager.readDSUserInfo()
  138 + }
  139 + }
  140 +
  141 + private override init() {}
  142 +
  143 + /// 缓存电商用户数据
  144 + /// - Parameter dsuserInfo: 用户数据 存储字符串
  145 + static public func cacheDSUserInfo(dsUserInfo: CNLiveShopUserInfoModel) {
  146 + DSUserInfoManager.clearDSUserInfo()
  147 + DSUserInfoManager.shared._dsUserInfo = dsUserInfo
  148 + UserDefaults.standard.set(dsUserInfo.toJSONString(), forKey: "mateCode_dsUserInfo")
  149 + if UserDefaults.standard.synchronize() {
  150 + print("电商用户信息存储成功")
  151 + }
  152 + }
  153 +
  154 + /// 读取用户数据
  155 + /// - Returns: 用户数据
  156 + static public func readDSUserInfo() -> CNLiveShopUserInfoModel {
  157 + let dsUser_info = UserDefaults.standard.object(forKey: "mateCode_dsUserInfo")
  158 + if dsUser_info == nil {
  159 + print("获取电商用户信息失败")
  160 + return CNLiveShopUserInfoModel()
  161 + }
  162 + if (dsUser_info as! String).count == 0 {
  163 + print("获取电商用户信息失败")
  164 + return CNLiveShopUserInfoModel()
  165 + }
  166 + let dsUserInfo = jsonToModel(dsUser_info as! String, CNLiveShopUserInfoModel.self) as! CNLiveShopUserInfoModel
  167 + DSUserInfoManager.shared._dsUserInfo = dsUserInfo
  168 + return dsUserInfo
  169 + }
  170 +
  171 + static public func clearDSUserInfo() {
  172 + UserDefaults.standard.removeObject(forKey: "mateCode_dsUserInfo")
  173 + DSUserInfoManager.shared._dsUserInfo = nil
  174 + if UserDefaults.standard.synchronize() {
  175 + print("电商用户信息删除成功")
  176 + }
  177 + }
  178 +}
  179 +
123 180 class StandSortManager: NSObject {
124 181  
125 182 static let shared = StandSortManager()
... ...
metaCode/Classes/Main/HomePage/Controller/CNLiveDownShopDetailController.swift
... ... @@ -13,12 +13,47 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
13 13 let kCNLiveShopDetailHeaderViewID = "kCNLiveShopDetailHeaderViewID"
14 14  
15 15 let kCNLiveShopDetailBannerCellID = "kCNLiveShopDetailBannerCellID"
  16 + let kCNLiveShopDetailBtnsCellID = "kCNLiveShopDetailBtnsCellID"
  17 + let kCNLiveShopDetailOrderAssetCellID = "kCNLiveShopDetailOrderAssetCellID"
16 18  
17 19  
18 20 lazy var shopDetailModel: CNLiveShopDetailModel = {
19 21 let shopDetailModel = CNLiveShopDetailModel()
20 22 return shopDetailModel
21 23 }()
  24 + override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
  25 + let upSlideView = self.view.superview as! CNUpSlideView
  26 + let scrollView = upSlideView.superview as! UIScrollView
  27 + scrollView.setContentOffset(CGPoint(x: 0, y: scrollView.height), animated: true)
  28 + currentViewController()?.tabBarController?.tabBar.isHidden = false
  29 +
  30 + let metaVC = currentViewController() as! CNMetaCodeHomePageController
  31 + let index = metaVC.pageFlowView.currentPageIndex
  32 + let customIndexView = metaVC.pageFlowView.viewWithTag(100+index) as! CNCustomIndexView
  33 + customIndexView.superScrollView?.isScrollEnabled = true
  34 + }
  35 +// lazy var closeBtn: UIButton = {
  36 +// let closeBtn = UIButton(type: .custom)
  37 +// closeBtn.frame = CGRect(x: KSreenWidth-50, y: KStatusBarHeight, width: 50, height: KNavigationHeight-KStatusBarHeight)
  38 +// closeBtn.setImage(UIImage(named: "mine_header_icon_close"), for: .normal)
  39 +// closeBtn.addTarget(self, action: #selector(closeBtnAction), for: .touchUpInside)
  40 +// closeBtn.isUserInteractionEnabled = false
  41 +// return closeBtn
  42 +// }()
  43 +
  44 +// lazy var navView: UIView = {
  45 +// let closeBtn = UIView(frame: CGRect(x: 0, y: KStatusBarHeight, width: KSreenWidth-50, height: KNavigationHeight-KStatusBarHeight))
  46 +// closeBtn.backgroundColor = .yellow
  47 +// return closeBtn
  48 +// }()
  49 + lazy var closeBtn: UIImageView = {
  50 + let closeBtn = UIImageView(frame: CGRect(x: KSreenWidth-35, y: KStatusBarHeight+(KNavigationHeight-KStatusBarHeight-20)*0.5, width: 20, height: 20))
  51 + closeBtn.image = UIImage(named: "mine_header_icon_close")
  52 +// closeBtn.isUserInteractionEnabled = true
  53 +// let tap = UITapGestureRecognizer.init(target: self, action: #selector(closeBtnAction))
  54 +// closeBtn.addGestureRecognizer(tap)
  55 + return closeBtn
  56 + }()
22 57  
23 58 lazy var collectionView: UICollectionView = {
24 59 let layout = UICollectionViewFlowLayout.init()
... ... @@ -29,6 +64,8 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
29 64 // collectionView.register(CNLiveShopConsoleHeaderView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: kCNLiveShopConsoleCollectionReusableHeaderViewID)
30 65 collectionView.register(CNLliveShopDetailBannerCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailBannerCellID)
31 66 collectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailDefaultCellID)
  67 + collectionView.register(CNLiveShopDetailBtnsCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailBtnsCellID)
  68 + collectionView.register(CNLiveShopDetailOrderAssetCell.self, forCellWithReuseIdentifier: kCNLiveShopDetailOrderAssetCellID)
32 69  
33 70 return collectionView
34 71 }()
... ... @@ -36,12 +73,29 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
36 73 override func viewDidLoad() {
37 74 super.viewDidLoad()
38 75 self.getShopDetailApi()
39   -
40 76 self.view.addSubview(collectionView)
41 77 collectionView.snp.makeConstraints { make in
42 78 make.top.equalToSuperview().offset(KNavigationHeight)
43 79 make.left.bottom.right.equalToSuperview()
44 80 }
  81 + self.view.addSubview(closeBtn)
  82 +// self.view.addSubview(navView)
  83 +
  84 + }
  85 +
  86 + // MARK: BtnAction
  87 + @objc func closeBtnAction(){
  88 + let upSlideView = self.view.superview as! CNUpSlideView
  89 + let scrollView = upSlideView.superview as! UIScrollView
  90 + scrollView.setContentOffset(CGPoint(x: 0, y: scrollView.height), animated: true)
  91 + currentViewController()?.tabBarController?.tabBar.isHidden = false
  92 +
  93 + let metaVC = currentViewController() as! CNMetaCodeHomePageController
  94 + let index = metaVC.pageFlowView.currentPageIndex
  95 + let customIndexView = metaVC.pageFlowView.viewWithTag(100+index) as! CNCustomIndexView
  96 + customIndexView.superScrollView?.isScrollEnabled = true
  97 +// customIndexView.baseScrollView.setContentOffset(CGPoint(x: 0, y: customIndexView.baseScrollView.height), animated: true)
  98 +// currentViewController()?.tabBarController?.tabBar.isHidden = false
45 99 }
46 100  
47 101 // MARK: - UICollectionViewDelegate
... ... @@ -82,15 +136,40 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
82 136 // }
83 137 func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
84 138 switch indexPath.section {
85   - case 0:
  139 + case 0://banner轮播图
86 140 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailBannerCellID, for: indexPath) as! CNLliveShopDetailBannerCell
87   -
  141 +
88 142 cell.shopDetailModel = self.shopDetailModel
89 143 return cell
90   -// case 1:
91   -//
92   -// case 2:
93   -// case 3:
  144 + case 1://btn
  145 + if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
  146 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailBtnsCellID, for: indexPath) as! CNLiveShopDetailBtnsCell
  147 + cell.shopDetailModel = self.shopDetailModel
  148 + return cell
  149 + }else{
  150 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
  151 + return cell
  152 + }
  153 + case 2://我的订单
  154 + if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
  155 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailOrderAssetCellID, for: indexPath) as! CNLiveShopDetailOrderAssetCell
  156 + cell.displayType = .CNLiveShopDetailDisplayTypeOrder
  157 + cell.shopDetailModel = self.shopDetailModel
  158 + return cell
  159 + }else{
  160 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
  161 + return cell
  162 + }
  163 + case 3://我的资产
  164 + if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
  165 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailOrderAssetCellID, for: indexPath) as! CNLiveShopDetailOrderAssetCell
  166 + cell.displayType = .CNLiveShopDetailDisplayTypeAsset
  167 + cell.shopDetailModel = self.shopDetailModel
  168 + return cell
  169 + }else{
  170 + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
  171 + return cell
  172 + }
94 173 // case 4:
95 174 default:
96 175 let cell = collectionView.dequeueReusableCell(withReuseIdentifier: kCNLiveShopDetailDefaultCellID, for: indexPath)
... ... @@ -103,15 +182,15 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
103 182 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
104 183 if (self.shopDetailModel.is_seller != nil && self.shopDetailModel.is_seller == true) {
105 184 switch (indexPath.section) {
106   - case 0:
  185 + case 0://banner
107 186 return CGSize(width: KSreenWidth, height: CNLiveAdaptTool.adaptLength(length: 210))
108   - case 1:
109   - return CGSize(width: KSreenWidth, height: 50)
110   - case 2:
111   - return CGSize(width: KSreenWidth, height: 50)
112   - case 3:
113   - return CGSize(width: KSreenWidth, height: 50)
114   - case 4:
  187 + case 1://btn
  188 + return CGSize(width: KSreenWidth, height: 10+45+5+17+15)
  189 + case 2://我的订单
  190 + return CGSize(width: KSreenWidth, height: 10+25+15+CNLiveAdaptTool.adaptLength(length: 128-55)+15)
  191 + case 3://我的资产
  192 + return CGSize(width: KSreenWidth, height: 10+25+15+CNLiveAdaptTool.adaptLength(length: 128-55)+15)
  193 + case 4://
115 194 return CGSize(width: KSreenWidth, height: 50)
116 195 default:
117 196 return CGSizeZero
... ...
metaCode/Classes/Main/HomePage/Controller/CNLiveShopConsoleController.swift
... ... @@ -88,9 +88,10 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel
88 88 if itemModel.type == CNLiveShopConsoleType.XZSP.rawValue{
89 89 //商城新增商品
90 90  
  91 +
91 92 }else if itemModel.type == CNLiveShopConsoleType.SPGL.rawValue{
92 93 //商城商品管理
93   -
  94 + currentViewController()?.navigationController?.pushViewController(CNLiveShopProductManagerController.init(), animated: true)
94 95 }else if itemModel.type == CNLiveShopConsoleType.XZYHQ.rawValue{
95 96 //新增优惠券
96 97  
... ... @@ -122,7 +123,9 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel
122 123  
123 124 }else if itemModel.type == CNLiveShopConsoleType.OnManagerment.rawValue{
124 125 //直播管理
125   -
  126 + let webVC = CNWebViewController()
  127 + webVC.url = URL(string: "http://wjjh5.cnlive.com/apkdownloadShop.php")
  128 + currentViewController()?.navigationController?.pushViewController(webVC, animated: true)
126 129 }
127 130 }
128 131  
... ... @@ -135,6 +138,8 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel
135 138  
136 139 if status == .success{
137 140 let shopUserModel = result as! CNLiveShopUserInfoModel
  141 + DSUserInfoManager.cacheDSUserInfo(dsUserInfo: shopUserModel)
  142 +
138 143 if shopUserModel.type != "3"{
139 144 //type 1商家或者8达人
140 145 let shopConsoleModel = CNLiveShopConsoleModel()
... ...
metaCode/Classes/Main/HomePage/Controller/CNWebViewController.swift
... ... @@ -86,6 +86,14 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{
86 86 @available(iOS 13.0, *)
87 87 func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, preferences: WKWebpagePreferences, decisionHandler: @escaping (WKNavigationActionPolicy, WKWebpagePreferences) -> Void) {
88 88  
  89 + if navigationAction.navigationType == .other{
  90 + //跳转Appstore
  91 + let url = URL(string: "https://apps.apple.com/cn/app/%E7%BD%91%E5%AE%B6%E5%AE%B6%E5%95%86%E5%AE%B6%E7%89%88/id1337575497")
  92 + if url == navigationAction.request.url {
  93 + if UIApplication.shared.canOpenURL(url!) { UIApplication.shared.open(url!, options: [:], completionHandler: nil)
  94 + }
  95 + }
  96 + }
89 97 decisionHandler(.allow, preferences)
90 98 }
91 99 }
... ...
metaCode/Classes/Main/HomePage/Controller/商品管理/CNLiveShopNewProductController.swift 0 → 100644
  1 +//
  2 +// CNLiveShopNewProductController.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2023/11/6.
  6 +// 新增商品
  7 +
  8 +import Foundation
  9 +
  10 +class CNLiveShopNewProductController:CNLiveBaseViewController{
  11 +
  12 +}
... ...
metaCode/Classes/Main/HomePage/Controller/商品管理/CNLiveShopProductManagerController.swift 0 → 100644
  1 +//
  2 +// CNLiveShopProductManagerController.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2023/11/6.
  6 +// 商品管理
  7 +
  8 +import Foundation
  9 +
  10 +class CNLiveShopProductManagerController:CNLiveBaseViewController{
  11 +
  12 +// lazy var navView: UIView = {
  13 +// let navView = UIView(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: KNavigationHeight))
  14 +// navView.backgroundColor = .white
  15 +// return navView
  16 +// }()
  17 +// lazy var titleLbl: UILabel = {
  18 +// let titleLbl = UILabel(frame: CGRect(x: KSreenWidth*0.5-100, y: KStatusBarHeight, width: 200, height: KNavigationHeight-KStatusBarHeight))
  19 +// titleLbl.text = "商品管理"
  20 +// titleLbl.font = Font_18
  21 +// titleLbl.textAlignment = .center
  22 +// titleLbl.textColor = HexColor("#333333")
  23 +// return titleLbl
  24 +// }()
  25 +
  26 + lazy var addBtn: UIButton = {
  27 + let addBtn = UIButton(type: .custom)
  28 + addBtn.frame = CGRect(x: 0, y: 0, width: 100, height:KNavigationHeight-KStatusBarHeight )
  29 + addBtn.addTarget(self, action: #selector(addBtnAction), for: .touchUpInside)
  30 + addBtn.setTitle("新增商品", for: .normal)
  31 + addBtn.setTitleColor(HexColor("#666666"), for: .normal)
  32 + return addBtn
  33 + }()
  34 +
  35 + override func viewDidLoad() {
  36 + super.viewDidLoad()
  37 + self.setUI()
  38 + }
  39 + func setUI(){
  40 + navigationBarHidden = false
  41 + titleName = "商品管理"
  42 + rightNavBtns = [self.addBtn]
  43 + }
  44 +
  45 + // MARK: - BtnAction
  46 + @objc func addBtnAction(){
  47 +
  48 + }
  49 +}
... ...
metaCode/Classes/Main/HomePage/View/CNLiveShopDetailBtnsCell.swift 0 → 100644
  1 +//
  2 +// CNLiveShopDetailBtnsCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2023/11/3.
  6 +//
  7 +
  8 +import Foundation
  9 +
  10 +class CNLiveShopDetailBtnsCell: UICollectionViewCell {
  11 +
  12 + //shopDetailModel
  13 + var _shopDetailModel : CNLiveShopDetailModel?
  14 + var shopDetailModel : CNLiveShopDetailModel? {
  15 + get{
  16 + _shopDetailModel
  17 + }
  18 + set{
  19 + _shopDetailModel = newValue!
  20 +
  21 + }
  22 + }
  23 +
  24 + override init(frame: CGRect) {
  25 + super.init(frame: frame)
  26 + self.backgroundColor = .clear
  27 + self.setUI()
  28 + }
  29 +
  30 + required init?(coder: NSCoder) {
  31 + fatalError("init(coder:) has not been implemented")
  32 + }
  33 +
  34 + func setUI(){
  35 + self.backgroundColor = .white
  36 + var titlesArr:Array<String> = []
  37 + if DSUserInfoManager.shared.dsUserInfo.type != "3" {
  38 + titlesArr = ["发布动态", "商品管理", "订单管理", "交易记录"]
  39 + }else{
  40 + //健康餐桌 不处理
  41 + }
  42 + //替换icon
  43 + let icons = ["ds_Up_Btn", "ds_Up_Btn", "ds_Up_Btn", "ds_Up_Btn"]
  44 + if titlesArr.count > 0 {
  45 + for i in 0..<titlesArr.count {
  46 + let titleStr = titlesArr[i]
  47 + let iconStr = icons[i]
  48 + //icon
  49 + let imgWH = 45
  50 + let imgGap = (Int(KSreenWidth)-4*imgWH)/5
  51 +
  52 + let iconBtn = UIButton(type: .custom)
  53 + iconBtn.frame = CGRect(x: imgGap*(i+1)+imgWH*i, y: 10, width: imgWH, height: imgWH)
  54 + iconBtn.setBackgroundImage(UIImage(named: iconStr), for: .normal)
  55 + iconBtn.addTarget(self, action: #selector(iconBtnAction(_:)), for: .touchUpInside)
  56 + iconBtn.tag = i+100
  57 + iconBtn.layer.cornerRadius = 11.5
  58 + self.contentView.addSubview(iconBtn)
  59 +
  60 + let titleLbl = UILabel(frame: CGRect(x: iconBtn.left-5, y: iconBtn.bottom+5, width: iconBtn.width+10, height: 17))
  61 + titleLbl.text = titleStr
  62 + titleLbl.textAlignment = .center
  63 + titleLbl.font = Font_12
  64 + titleLbl.textColor = HexColor("#4A4A4A")
  65 + self.contentView.addSubview(titleLbl)
  66 + }
  67 + }
  68 + }
  69 +
  70 + @objc func iconBtnAction(_ sender: UIButton){
  71 + let tag = sender.tag
  72 + ///push VC
  73 + if tag == 100 {
  74 + //发布动态
  75 + }else if tag == 101 {
  76 + //商品管理
  77 + let webVC = CNWebViewController()
  78 + webVC.url = URL(string:"https://www.baidu.com")
  79 + currentViewController()?.navigationController?.pushViewController(webVC, animated: true)
  80 +
  81 + }else if tag == 102 {
  82 + //订单管理
  83 + }else if tag == 103 {
  84 + //交易记录
  85 + }
  86 +
  87 + }
  88 +}
... ...
metaCode/Classes/Main/HomePage/View/CNLiveShopDetailOrderAssetCell.swift 0 → 100644
  1 +//
  2 +// CNLiveShopDetailOrderAssetCell.swift
  3 +// metaCode
  4 +//
  5 +// Created by zx on 2023/11/4.
  6 +// 我的订单,我的资产
  7 +
  8 +import Foundation
  9 +enum CNLiveShopDetailDisplayType {
  10 + case CNLiveShopDetailDisplayTypeOrder
  11 + case CNLiveShopDetailDisplayTypeAsset
  12 +}
  13 +class CNLiveShopDetailOrderAssetCell:UICollectionViewCell{
  14 +
  15 + //订单,资产
  16 + var displayType: CNLiveShopDetailDisplayType?
  17 +
  18 + //shopDetailModel
  19 + var _shopDetailModel : CNLiveShopDetailModel?
  20 + var shopDetailModel : CNLiveShopDetailModel? {
  21 + get{
  22 + _shopDetailModel
  23 + }
  24 + set{
  25 + _shopDetailModel = newValue!
  26 + self.setNewUI()
  27 + }
  28 + }
  29 +
  30 + var navTitle = UILabel()
  31 + var navsubBtn = UIButton()
  32 + var bgImageView = UIImageView()
  33 +
  34 + override init(frame: CGRect) {
  35 + super.init(frame: frame)
  36 + self.backgroundColor = .clear
  37 + self.setUI()
  38 + }
  39 +
  40 + required init?(coder: NSCoder) {
  41 + fatalError("init(coder:) has not been implemented")
  42 + }
  43 +
  44 + func setUI(){
  45 + self.backgroundColor = .white
  46 + }
  47 + func setNewUI(){
  48 + self.navTitle = UILabel(frame: CGRect(x: 15, y: 10, width: 80, height: 25))
  49 + var navTitleText = ""
  50 + if self.displayType == .CNLiveShopDetailDisplayTypeOrder{
  51 + navTitleText = "我的订单"
  52 + }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{
  53 + navTitleText = "我的资产"
  54 + }
  55 + self.navTitle.text = navTitleText
  56 + self.navTitle.textAlignment = .left
  57 + self.navTitle.font = Font_18
  58 + self.navTitle.textColor = HexColor("#4A4A4A")
  59 + self.contentView.addSubview(self.navTitle)
  60 +
  61 + self.navsubBtn = UIButton(type: .custom)
  62 + self.navsubBtn.frame = CGRect(x: 0, y: 10, width: 80, height: 19)
  63 + self.navsubBtn.right = self.contentView.width - 15
  64 + self.navsubBtn.setImage(UIImage(named: "homepage_detail"), for: .normal)
  65 + self.navsubBtn.addTarget(self, action: #selector(navsubBtnAction(_:)), for: .touchUpInside)
  66 + self.navsubBtn.setTitleColor(HexColor("#999999"), for: .normal)
  67 + self.navsubBtn.titleLabel?.font = Font_13
  68 + self.navsubBtn.setTitle("订单明细", for: .normal)
  69 + self.navsubBtn.setupButtonImageAndTitlePossitionWith(padding: 4, style:.right)
  70 + self.contentView.addSubview(self.navsubBtn)
  71 +
  72 + var imgName = ""
  73 + if self.displayType == .CNLiveShopDetailDisplayTypeOrder{
  74 + imgName = "homepage_detail_order_bg"
  75 + }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{
  76 + imgName = "homepage_detail_asset_bg"
  77 + }
  78 + let imageView = UIImageView(frame: CGRect(x: 15, y: self.navTitle.bottom + 15, width: self.contentView.width - 30, height: CNLiveAdaptTool.adaptLength(length: 128)))
  79 + imageView.image = UIImage(named: imgName)
  80 + self.bgImageView = imageView
  81 + self.contentView.addSubview(self.bgImageView)
  82 +
  83 + var numbers:Array<String> = []
  84 + var titles:Array<String> = []
  85 + if self.displayType == .CNLiveShopDetailDisplayTypeOrder{
  86 + numbers = [_shopDetailModel?.seller_data?.day_order ?? "0", _shopDetailModel?.seller_data?.day_order_money ?? "0","0","0"]
  87 + titles = ["今日订单数", "今日订单金额", "店铺访客", "商品浏览量"]
  88 + }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{
  89 + numbers = [_shopDetailModel?.seller_data?.total_money ?? "0", _shopDetailModel?.seller_data?.shop_money ?? "0",_shopDetailModel?.seller_data?.daren_money ?? "0","0"]
  90 + titles = ["余额总计/¥", "电商余额/¥", "扫码余额/¥", "可结算金额/¥"]
  91 + }
  92 + let titleW = 70
  93 + let gap = Int((Int(self.contentView.width)-titleW*4)/5)
  94 + for i in 0..<4 {
  95 +
  96 + let titleLabel = UILabel(frame: CGRect(x: gap*(i+1)+i*titleW, y: Int(self.bgImageView.top)+15, width: titleW, height: 25))
  97 + titleLabel.text = numbers[i]
  98 + titleLabel.textAlignment = .center
  99 + titleLabel.font = Font_18
  100 + titleLabel.textColor = HexColor("#7A574A")
  101 + self.contentView.addSubview(titleLabel)
  102 +
  103 + let subTitleLabel = UILabel(frame: CGRect(x: gap*(i+1)+i*titleW, y: Int(titleLabel.bottom)+5, width: titleW, height: 14))
  104 + subTitleLabel.text = titles[i]
  105 + subTitleLabel.textAlignment = .center
  106 + subTitleLabel.font = Font_10
  107 + subTitleLabel.textColor = HexColor("#7A574A")
  108 + self.contentView.addSubview(subTitleLabel)
  109 +
  110 + let clickBtn = UIButton(type: .custom)
  111 + clickBtn.frame = CGRect(x: titleLabel.left, y: titleLabel.top, width: titleLabel.width, height: subTitleLabel.bottom-titleLabel.top)
  112 + clickBtn.addTarget(self, action: #selector(clickBtnAction(_:)), for: .touchUpInside)
  113 + clickBtn.tag = i+100
  114 + self.contentView.addSubview(clickBtn)
  115 +
  116 + }
  117 +
  118 + }
  119 +
  120 + @objc func navsubBtnAction(_ sender: UIButton){
  121 + if self.displayType == .CNLiveShopDetailDisplayTypeOrder{
  122 + //push订单VC
  123 + }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{
  124 + //push余额VC
  125 + }
  126 + }
  127 + @objc func clickBtnAction(_ sender: UIButton){
  128 + let tag = sender.tag
  129 + if tag == 100 {
  130 +
  131 + }else if tag == 101 {
  132 + print(tag)
  133 + }else if tag == 102 {
  134 +
  135 + }else if tag == 103 {
  136 +
  137 + }
  138 + }
  139 +}
... ...
metaCode/Classes/Main/HomePage/View/CNLliveShopDetailBannerCell.swift
... ... @@ -19,7 +19,7 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP
19 19 viewPager.delegate = self
20 20 viewPager.register(FSPagerViewCell.self, forCellWithReuseIdentifier: kCNLliveShopDetailBannerCellID)
21 21 //设置自动翻页事件间隔,默认值为0 (不自动翻页)
22   - viewPager.automaticSlidingInterval = 1.0
  22 + viewPager.automaticSlidingInterval = 0
23 23 //设置页面之间的间隔距离
24 24 viewPager.interitemSpacing = 8.0
25 25 //设置可以无限翻页,默认值为false,false时从尾部向前滚动到头部再继续循环滚动,true时可以无限滚动
... ... @@ -29,6 +29,22 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP
29 29 return viewPager
30 30 }()
31 31  
  32 + // 懒加载滚动图片浏下标
  33 + lazy var pagerControl:FSPageControl = {
  34 + let pageControl = FSPageControl(frame: CGRect(x: 20, y: self.contentView.height-24, width: self.contentView.width-40, height: 4))
  35 + //设置下标位置
  36 + pageControl.contentHorizontalAlignment = .right
  37 + //设置下标指示器颜色(选中状态和普通状态)
  38 + pageControl.setFillColor(HexColor("#FFFFFF"), for: .normal)
  39 + pageControl.setFillColor(HexColor("#65C368"), for: .selected)
  40 +
  41 + //绘制下标指示器的形状 (roundedRect绘制绘制圆角或者圆形)
  42 + pageControl.setPath(UIBezierPath.init(roundedRect: CGRect.init(x: 0, y: 0, width: 8, height: 4),cornerRadius: 2.0), for: .selected)
  43 + pageControl.setPath(UIBezierPath(ovalIn: CGRect(x: 0, y: 0, width: 4, height: 4)), for: .normal)
  44 + return pageControl
  45 +
  46 + }()
  47 +
32 48 //shopDetailModel
33 49 var _shopDetailModel : CNLiveShopDetailModel?
34 50 var shopDetailModel : CNLiveShopDetailModel? {
... ... @@ -37,7 +53,11 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP
37 53 }
38 54 set{
39 55 _shopDetailModel = newValue!
40   -
  56 + //设置下标的个数
  57 + self.pagerControl.numberOfPages = (_shopDetailModel?.banner.count)!
  58 + if _shopDetailModel?.banner.count == 1 {
  59 + self.viewPager.isInfinite = false
  60 + }
41 61 }
42 62 }
43 63  
... ... @@ -52,10 +72,13 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP
52 72 }
53 73  
54 74 func setUI(){
55   - self.backgroundColor = .red
  75 + self.backgroundColor = .white
56 76 self.contentView.addSubview(self.viewPager)
  77 + self.contentView.addSubview(self.pagerControl)
  78 +
57 79 }
58   -
  80 +
  81 +
59 82 // MARK: - FSPagerViewDataSource
60 83 func numberOfItems(in pagerView: FSPagerView) -> Int {
61 84 return (self.shopDetailModel?.banner.count)!
... ... @@ -64,6 +87,18 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP
64 87 let cell = pagerView.dequeueReusableCell(withReuseIdentifier: kCNLliveShopDetailBannerCellID, at: index)
65 88 let imgUrl = self.shopDetailModel?.banner[index].simg!
66 89 cell.imageView?.kf.setImage(with: URL(string: imgUrl!))
  90 + cell.imageView?.layer.cornerRadius = 9
67 91 return cell
68 92 }
  93 + func pagerView(_ pagerView: FSPagerView, willDisplay cell: FSPagerViewCell, forItemAt index: Int) {
  94 + self.pagerControl.currentPage = index
  95 +
  96 + }
  97 +
  98 + func pagerView(_ pagerView: FSPagerView, didSelectItemAt index: Int) {
  99 + let bannerMdl = self.shopDetailModel?.banner[index]
  100 + let webVC = CNWebViewController()
  101 + webVC.url = URL(string: bannerMdl?.url ?? "")
  102 + currentViewController()?.navigationController?.pushViewController(webVC, animated: true)
  103 + }
69 104 }
... ...
metaCode/Classes/Main/HomePage/View/CNUpSlideView.swift
... ... @@ -63,9 +63,15 @@ class CNUpSlideView:UIView{
63 63  
64 64 override init(frame: CGRect) {
65 65 super.init(frame: frame)
  66 + let tap = UITapGestureRecognizer.init(target: self, action: #selector(upSlideViewTap))
  67 + tap.cancelsTouchesInView = false
  68 + self.addGestureRecognizer(tap)
66 69 self.initUI()
67 70  
68 71 }
  72 + @objc func upSlideViewTap() {
  73 + print("upSlideViewTap")
  74 + }
69 75  
70 76 required init?(coder: NSCoder) {
71 77 fatalError("init(coder:) has not been implemented")
... ... @@ -73,6 +79,7 @@ class CNUpSlideView:UIView{
73 79  
74 80 func initUI()
75 81 {
  82 + self.isUserInteractionEnabled = true
76 83 self.backgroundColor = UIColor.clear
77 84 self.layer.cornerRadius = 20
78 85 }
... ...
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
... ... @@ -267,40 +267,40 @@ class CNLiveMineViewModel: NSObject {
267 267 if (errorCode == "0") {
268 268 let listModel = dictionaryToModel(resp as! [String : Any], StandListBaseModel.self,"data") as! StandListBaseModel
269 269 if page == 1 && listModel.list.count > 0 {
270   - CNLiveSaveStandDB.shared.insertObjects(objects: listModel.list)
  270 +// CNLiveSaveStandDB.shared.insertObjects(objects: listModel.list)
271 271 }
272 272 listModel.list = StandSortManager.sortAllListData(stands: listModel.list as NSArray) as! [StandListModel]
273 273 resultBlock(listModel,.success)
274 274 } else {
275   - let tempArray = CNLiveSaveStandDB.shared.searchAllObject()
276   - if tempArray.count > 0 {
277   - let listModel = StandListBaseModel.init()
278   - listModel.pageNum = page
279   - listModel.total = page
280   - listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel]
281   - resultBlock(listModel,.success)
282   - }else{
283   - showMessage(message: resp["errorMessage"] as! String)
284   - resultBlock(NSNull(),.failed)
285   - }
  275 +// let tempArray = CNLiveSaveStandDB.shared.searchAllObject()
  276 +// if tempArray.count > 0 {
  277 +// let listModel = StandListBaseModel.init()
  278 +// listModel.pageNum = page
  279 +// listModel.total = page
  280 +// listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel]
  281 +// resultBlock(listModel,.success)
  282 +// }else{
  283 +// showMessage(message: resp["errorMessage"] as! String)
  284 +// resultBlock(NSNull(),.failed)
  285 +// }
286 286 }
287 287 } else {
288   - let tempArray = CNLiveSaveStandDB.shared.searchAllObject()
289   - if tempArray.count > 0 {
290   - let listModel = StandListBaseModel.init()
291   - listModel.pageNum = page
292   - listModel.total = page
293   - listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel]
294   - resultBlock(listModel,.success)
295   - }else{
296   - if CNLiveNetworking.isNetworking() {
297   - showMessage(message: "获取失败")
298   - resultBlock(NSNull(),.failed)
299   - } else {
300   - showMessage(message: "似乎与网络断开链接")
301   - resultBlock(NSNull(),.noNetwork)
302   - }
303   - }
  288 +// let tempArray = CNLiveSaveStandDB.shared.searchAllObject()
  289 +// if tempArray.count > 0 {
  290 +// let listModel = StandListBaseModel.init()
  291 +// listModel.pageNum = page
  292 +// listModel.total = page
  293 +// listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel]
  294 +// resultBlock(listModel,.success)
  295 +// }else{
  296 +// if CNLiveNetworking.isNetworking() {
  297 +// showMessage(message: "获取失败")
  298 +// resultBlock(NSNull(),.failed)
  299 +// } else {
  300 +// showMessage(message: "似乎与网络断开链接")
  301 +// resultBlock(NSNull(),.noNetwork)
  302 +// }
  303 +// }
304 304 }
305 305 }
306 306 }
... ... @@ -325,40 +325,40 @@ class CNLiveMineViewModel: NSObject {
325 325 if (errorCode == "0" && !(resp["data"] is NSNull)) {
326 326 let listModel = dictionaryToModel(resp as! [String : Any], MineAuthListBaseModel.self,"data") as! MineAuthListBaseModel
327 327 if page == 1 && listModel.list.count > 0 {
328   - CNLiveSaveAuthDB.shared.insertObjects(objects: listModel.list)
  328 +// CNLiveSaveAuthDB.shared.insertObjects(objects: listModel.list)
329 329 }
330 330 listModel.list = StandSortManager.sortMyListData(auths: listModel.list as NSArray) as! [MineAuthListModel]
331 331 resultBlock(listModel,.success)
332 332 } else {
333   - let tempArray = CNLiveSaveAuthDB.shared.searchAllObject()
334   - if tempArray.count > 0 {
335   - let listModel = MineAuthListBaseModel.init()
336   - listModel.pageNum = page
337   - listModel.total = page
338   - listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel]
339   - resultBlock(listModel,.success)
340   - }else{
341   - showMessage(message: resp["errorMessage"] as! String)
342   - resultBlock(NSNull(),.failed)
343   - }
  333 +// let tempArray = CNLiveSaveAuthDB.shared.searchAllObject()
  334 +// if tempArray.count > 0 {
  335 +// let listModel = MineAuthListBaseModel.init()
  336 +// listModel.pageNum = page
  337 +// listModel.total = page
  338 +// listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel]
  339 +// resultBlock(listModel,.success)
  340 +// }else{
  341 +// showMessage(message: resp["errorMessage"] as! String)
  342 +// resultBlock(NSNull(),.failed)
  343 +// }
344 344 }
345 345 } else {
346   - let tempArray = CNLiveSaveAuthDB.shared.searchAllObject()
347   - if tempArray.count > 0 {
348   - let listModel = MineAuthListBaseModel.init()
349   - listModel.pageNum = page
350   - listModel.total = page
351   - listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel]
352   - resultBlock(listModel,.success)
353   - }else{
354   - if CNLiveNetworking.isNetworking() {
355   - showMessage(message: "获取失败")
356   - resultBlock(NSNull(),.failed)
357   - } else {
358   - showMessage(message: "似乎与网络断开链接")
359   - resultBlock(NSNull(),.noNetwork)
360   - }
361   - }
  346 +// let tempArray = CNLiveSaveAuthDB.shared.searchAllObject()
  347 +// if tempArray.count > 0 {
  348 +// let listModel = MineAuthListBaseModel.init()
  349 +// listModel.pageNum = page
  350 +// listModel.total = page
  351 +// listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel]
  352 +// resultBlock(listModel,.success)
  353 +// }else{
  354 +// if CNLiveNetworking.isNetworking() {
  355 +// showMessage(message: "获取失败")
  356 +// resultBlock(NSNull(),.failed)
  357 +// } else {
  358 +// showMessage(message: "似乎与网络断开链接")
  359 +// resultBlock(NSNull(),.noNetwork)
  360 +// }
  361 +// }
362 362 }
363 363 }
364 364 }
... ... @@ -614,9 +614,8 @@ class CNLiveMineViewModel: NSObject {
614 614 custom_param.setValue(APPKey_wjj, forKey: "appKey")
615 615 CNLiveNetworking.setAllowRequestDefaultArgument(true)
616 616 CNLiveNetworking.setupShowDataResult(false)
617   - CNLiveNetworking.setupDSRequest(true)
618 617 CNLiveNetworking.setupCustomParam(custom_param as? [String : String])
619   - CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjShopUrl+"/Api/Index3/myOrderCount", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
  618 + CNLiveNetworking.requestNetwork(with: .POST, urlString: APPBaseWjjBUrl+"/Api/Index3/myOrderCount", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in
620 619 hiddenLoading()
621 620 if (error == nil) {
622 621 let resp = result as! NSDictionary
... ...
metaCode/Classes/Main/Model/CNLiveShopDetailModel.swift
... ... @@ -73,7 +73,7 @@ class CNLiveShopDetailUserModel:BaseModel{
73 73  
74 74 class CNLiveShopDetailSellerDataModel:BaseModel{
75 75 ///每日订单数
76   - var day_order: Int = 0
  76 + var day_order: String?
77 77 ///每日订单金额
78 78 var day_order_money: String?
79 79 ///电商剩余金额
... ...
metaCode/Classes/Main/Model/CNLiveShopUserInfoModel.swift
... ... @@ -9,6 +9,7 @@ import Foundation
9 9  
10 10 //获取用户信息
11 11 class CNLiveShopUserInfoModel:BaseModel{
  12 +
12 13 ///darenid生成付款码时用到
13 14 var daren_id: String?
14 15 ///uid 用于请求老达人信息接口
... ... @@ -31,6 +32,7 @@ class CNLiveShopUserInfoModel:BaseModel{
31 32 var title: String?
32 33 ///商家logo
33 34 var logo: String?
  35 +
34 36 }
35 37 /**
36 38 Printing description of ((__NSDictionaryI *)0x000000010884eca0):
... ...
metaCode/Supporting Files/Assets.xcassets/Home/ds_Up_Btn.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "ds_Up_Btn@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "author" : "xcode",
  19 + "version" : 1
  20 + }
  21 +}
... ...
metaCode/Supporting Files/Assets.xcassets/Home/ds_Up_Btn.imageset/ds_Up_Btn@2x.png 0 → 100644

7.26 KB

metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "homepage_detail@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "author" : "xcode",
  19 + "version" : 1
  20 + }
  21 +}
... ...
metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail.imageset/homepage_detail@2x.png 0 → 100644

293 Bytes

metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail_asset_bg.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "homepage_detail_asset_bg@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "author" : "xcode",
  19 + "version" : 1
  20 + }
  21 +}
... ...
metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail_asset_bg.imageset/homepage_detail_asset_bg@2x.png 0 → 100644

56.3 KB

metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail_dongtai_bg.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "homepage_detail_dongtai_bg@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "author" : "xcode",
  19 + "version" : 1
  20 + }
  21 +}
... ...
metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail_dongtai_bg.imageset/homepage_detail_dongtai_bg@2x.png 0 → 100644

38.1 KB

metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail_order_bg.imageset/Contents.json 0 → 100644
  1 +{
  2 + "images" : [
  3 + {
  4 + "idiom" : "universal",
  5 + "scale" : "1x"
  6 + },
  7 + {
  8 + "filename" : "homepage_detail_order_bg@2x.png",
  9 + "idiom" : "universal",
  10 + "scale" : "2x"
  11 + },
  12 + {
  13 + "idiom" : "universal",
  14 + "scale" : "3x"
  15 + }
  16 + ],
  17 + "info" : {
  18 + "author" : "xcode",
  19 + "version" : 1
  20 + }
  21 +}
... ...
metaCode/Supporting Files/Assets.xcassets/Home/homepage_detail_order_bg.imageset/homepage_detail_order_bg@2x.png 0 → 100644

48.1 KB