| | |
| | | 131C030B2C0D564000EA4C25 /* MarketTagCCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131C03082C0D564000EA4C25 /* MarketTagCCell.swift */; }; |
| | | 131C030D2C0D6A4800EA4C25 /* CommonBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131C030C2C0D6A4800EA4C25 /* CommonBannerView.swift */; }; |
| | | 131C03112C0DA5D500EA4C25 /* CityAddressPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131C03102C0DA5D500EA4C25 /* CityAddressPickerView.swift */; }; |
| | | 132D19482C25287000B66A18 /* ArchiveTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 132D19472C25287000B66A18 /* ArchiveTool.swift */; }; |
| | | 133386382C007E91002EE788 /* HomeListenFight_lesson_2_VC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 133386372C007E91002EE788 /* HomeListenFight_lesson_2_VC.swift */; }; |
| | | 13397D962C05EA9D003440F9 /* ListenFight_Game_CCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13397D942C05EA9D003440F9 /* ListenFight_Game_CCell.swift */; }; |
| | | 13397D972C05EA9D003440F9 /* ListenFight_Game_CCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13397D952C05EA9D003440F9 /* ListenFight_Game_CCell.xib */; }; |
| | |
| | | 131C03092C0D564000EA4C25 /* MarketTagCCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarketTagCCell.xib; sourceTree = "<group>"; }; |
| | | 131C030C2C0D6A4800EA4C25 /* CommonBannerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommonBannerView.swift; sourceTree = "<group>"; }; |
| | | 131C03102C0DA5D500EA4C25 /* CityAddressPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CityAddressPickerView.swift; sourceTree = "<group>"; }; |
| | | 132D19472C25287000B66A18 /* ArchiveTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveTool.swift; sourceTree = "<group>"; }; |
| | | 133386372C007E91002EE788 /* HomeListenFight_lesson_2_VC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeListenFight_lesson_2_VC.swift; sourceTree = "<group>"; }; |
| | | 13397D942C05EA9D003440F9 /* ListenFight_Game_CCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListenFight_Game_CCell.swift; sourceTree = "<group>"; }; |
| | | 13397D952C05EA9D003440F9 /* ListenFight_Game_CCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ListenFight_Game_CCell.xib; sourceTree = "<group>"; }; |
| | |
| | | 1302783E2BFD978900DDCE81 /* Config.swift */, |
| | | 1302783F2BFD978900DDCE81 /* Enums.swift */, |
| | | 13812B9B2C0F02B600905CCE /* VoicePlayer.swift */, |
| | | 132D19472C25287000B66A18 /* ArchiveTool.swift */, |
| | | ); |
| | | path = Config; |
| | | sourceTree = "<group>"; |
| | |
| | | 1319B0272C0818460052F889 /* HomeListenStory_1_VC.swift in Sources */, |
| | | 130278792BFD9ED600DDCE81 /* ExchangeResultVC.swift in Sources */, |
| | | 1302788D2BFD9F4200DDCE81 /* CoinRecordHistoryVC.swift in Sources */, |
| | | 132D19482C25287000B66A18 /* ArchiveTool.swift in Sources */, |
| | | 13A049FF2C058B1400F1F52E /* HomeListenFight_lesson_5_VC.swift in Sources */, |
| | | 1302785A2BFD985E00DDCE81 /* CommonAlertView.swift in Sources */, |
| | | 13CD3AC92C0886E5007E1065 /* RefreshModel.swift in Sources */, |
| | |
| | | "@executable_path/Frameworks", |
| | | ); |
| | | MARKETING_VERSION = 1.0; |
| | | OTHER_LDFLAGS = ( |
| | | "$(inherited)", |
| | | "-l\"WechatOpenSDK\"", |
| | | "-l\"c++\"", |
| | | "-l\"sqlite3.0\"", |
| | | "-l\"swiftCoreGraphics\"", |
| | | "-l\"z\"", |
| | | "-framework", |
| | | "\"AVFoundation\"", |
| | | "-framework", |
| | | "\"Alamofire\"", |
| | | "-framework", |
| | | "\"CFNetwork\"", |
| | | "-framework", |
| | | "\"CoreGraphics\"", |
| | | "-framework", |
| | | "\"CoreImage\"", |
| | | "-framework", |
| | | "\"CoreMedia\"", |
| | | "-framework", |
| | | "\"CoreServices\"", |
| | | "-framework", |
| | | "\"CryptoSwift\"", |
| | | "-framework", |
| | | "\"Differentiator\"", |
| | | "-framework", |
| | | "\"EmptyDataSet_Swift\"", |
| | | "-framework", |
| | | "\"FFPage\"", |
| | | "-framework", |
| | | "\"Foundation\"", |
| | | "-framework", |
| | | "\"HandyJSON\"", |
| | | "-framework", |
| | | "\"IQKeyboardManager\"", |
| | | "-framework", |
| | | "\"IQKeyboardManagerSwift\"", |
| | | "-framework", |
| | | "\"ImageIO\"", |
| | | "-framework", |
| | | "\"JQTools\"", |
| | | "-framework", |
| | | "\"Lantern\"", |
| | | "-framework", |
| | | "\"MJRefresh\"", |
| | | "-framework", |
| | | "\"ObjcExceptionBridging\"", |
| | | "-framework", |
| | | "\"ObjectMapper\"", |
| | | "-framework", |
| | | "\"Photos\"", |
| | | "-framework", |
| | | "\"PhotosUI\"", |
| | | "-framework", |
| | | "\"QMUIKit\"", |
| | | "-framework", |
| | | "\"QuartzCore\"", |
| | | "-framework", |
| | | "\"RxCocoa\"", |
| | | "-framework", |
| | | "\"RxDataSources\"", |
| | | "-framework", |
| | | "\"RxRelay\"", |
| | | "-framework", |
| | | "\"RxSwift\"", |
| | | "-framework", |
| | | "\"SDWebImage\"", |
| | | "-framework", |
| | | "\"SPPageMenu\"", |
| | | "-framework", |
| | | "\"SVProgressHUD\"", |
| | | "-framework", |
| | | "\"Security\"", |
| | | "-framework", |
| | | "\"SnapKit\"", |
| | | "-framework", |
| | | "\"SwifterSwift\"", |
| | | "-framework", |
| | | "\"TZImagePickerController\"", |
| | | "-framework", |
| | | "\"UIKit\"", |
| | | "-framework", |
| | | "\"UserDefaultsStore\"", |
| | | "-framework", |
| | | "\"VTMagic\"", |
| | | "-framework", |
| | | "\"WebKit\"", |
| | | "-framework", |
| | | "\"XCGLogger\"", |
| | | "-ObjC", |
| | | "-all_load", |
| | | ); |
| | | PRODUCT_BUNDLE_IDENTIFIER = com.sinata.dollearn.test; |
| | | PRODUCT_NAME = "$(TARGET_NAME)"; |
| | | PROVISIONING_PROFILE_SPECIFIER = ""; |
| | |
| | | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| | | CLANG_ENABLE_MODULES = YES; |
| | | CODE_SIGN_ENTITLEMENTS = DolphinEnglishLearnStudent/DolphinEnglishLearnStudent.entitlements; |
| | | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; |
| | | CODE_SIGN_STYLE = Manual; |
| | | CURRENT_PROJECT_VERSION = 1; |
| | | DEVELOPMENT_TEAM = ""; |
| | | "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 5ZV937VB25; |
| | | ENABLE_USER_SCRIPT_SANDBOXING = NO; |
| | | GENERATE_INFOPLIST_FILE = YES; |
| | | INFOPLIST_FILE = DolphinEnglishLearnStudent/Info.plist; |
| | |
| | | "@executable_path/Frameworks", |
| | | ); |
| | | MARKETING_VERSION = 1.0; |
| | | PRODUCT_BUNDLE_IDENTIFIER = com.sinata.dollearn; |
| | | OTHER_LDFLAGS = ( |
| | | "$(inherited)", |
| | | "-l\"WechatOpenSDK\"", |
| | | "-l\"c++\"", |
| | | "-l\"sqlite3.0\"", |
| | | "-l\"swiftCoreGraphics\"", |
| | | "-l\"z\"", |
| | | "-framework", |
| | | "\"AVFoundation\"", |
| | | "-framework", |
| | | "\"Alamofire\"", |
| | | "-framework", |
| | | "\"CFNetwork\"", |
| | | "-framework", |
| | | "\"CoreGraphics\"", |
| | | "-framework", |
| | | "\"CoreImage\"", |
| | | "-framework", |
| | | "\"CoreMedia\"", |
| | | "-framework", |
| | | "\"CoreServices\"", |
| | | "-framework", |
| | | "\"CryptoSwift\"", |
| | | "-framework", |
| | | "\"Differentiator\"", |
| | | "-framework", |
| | | "\"EmptyDataSet_Swift\"", |
| | | "-framework", |
| | | "\"FFPage\"", |
| | | "-framework", |
| | | "\"Foundation\"", |
| | | "-framework", |
| | | "\"HandyJSON\"", |
| | | "-framework", |
| | | "\"IQKeyboardManager\"", |
| | | "-framework", |
| | | "\"IQKeyboardManagerSwift\"", |
| | | "-framework", |
| | | "\"ImageIO\"", |
| | | "-framework", |
| | | "\"JQTools\"", |
| | | "-framework", |
| | | "\"Lantern\"", |
| | | "-framework", |
| | | "\"MJRefresh\"", |
| | | "-framework", |
| | | "\"ObjcExceptionBridging\"", |
| | | "-framework", |
| | | "\"ObjectMapper\"", |
| | | "-framework", |
| | | "\"Photos\"", |
| | | "-framework", |
| | | "\"PhotosUI\"", |
| | | "-framework", |
| | | "\"QMUIKit\"", |
| | | "-framework", |
| | | "\"QuartzCore\"", |
| | | "-framework", |
| | | "\"RxCocoa\"", |
| | | "-framework", |
| | | "\"RxDataSources\"", |
| | | "-framework", |
| | | "\"RxRelay\"", |
| | | "-framework", |
| | | "\"RxSwift\"", |
| | | "-framework", |
| | | "\"SDWebImage\"", |
| | | "-framework", |
| | | "\"SPPageMenu\"", |
| | | "-framework", |
| | | "\"SVProgressHUD\"", |
| | | "-framework", |
| | | "\"Security\"", |
| | | "-framework", |
| | | "\"SnapKit\"", |
| | | "-framework", |
| | | "\"SwifterSwift\"", |
| | | "-framework", |
| | | "\"TZImagePickerController\"", |
| | | "-framework", |
| | | "\"UIKit\"", |
| | | "-framework", |
| | | "\"UserDefaultsStore\"", |
| | | "-framework", |
| | | "\"VTMagic\"", |
| | | "-framework", |
| | | "\"WebKit\"", |
| | | "-framework", |
| | | "\"XCGLogger\"", |
| | | "-ObjC", |
| | | "-all_load", |
| | | ); |
| | | PRODUCT_BUNDLE_IDENTIFIER = com.sinata.dollearn.test; |
| | | PRODUCT_NAME = "$(TARGET_NAME)"; |
| | | PROVISIONING_PROFILE_SPECIFIER = ""; |
| | | "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = adhoc_dollearn; |
| | | SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; |
| | | SUPPORTS_MACCATALYST = NO; |
| | | SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; |
| | |
| | | |
| | | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { |
| | | // Override point for customization after application launch. |
| | | |
| | | if WXApi.isWXAppInstalled(){ |
| | | WXApi.registerApp(WeChatAPPID, universalLink: "https://dollearn/app/") |
| | | } |
| | | return true |
| | | } |
| | | |
| | |
| | | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. |
| | | } |
| | | |
| | | func application(_ application: UIApplication, handleOpen url: URL) -> Bool { |
| | | return WXApi.handleOpen(url, delegate: self) |
| | | } |
| | | |
| | | func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool { |
| | | return WXApi.handleOpen(url, delegate: self) |
| | | } |
| | | } |
| | | |
| | | extension AppDelegate:WXApiDelegate{ |
| | | func onReq(_ req: BaseReq) { |
| | | |
| | | } |
| | | |
| | | func onResp(_ resp: BaseResp) { |
| | | |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | // |
| | | // ArchiveTool.swift |
| | | // DolphinEnglishLearnStudent |
| | | // |
| | | // Created by 无故事王国 on 2024/6/21. |
| | | // |
| | | |
| | | import Foundation |
| | | import HandyJSON |
| | | import JQTools |
| | | |
| | | class ArchiveTool{ |
| | | |
| | | /// 缓存数据 |
| | | /// - Parameters: |
| | | /// - model: HandJSON模型 |
| | | /// - force: 是否强制写入 |
| | | |
| | | @discardableResult |
| | | static func archive(model:HandyJSON,force:Bool = false)->Bool{ |
| | | guard let json = model.toJSON() else {return false} |
| | | guard let className = String(describing: model.self).components(separatedBy: "(").first else {return false} |
| | | guard var filePath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first else {return false} |
| | | filePath = filePath + "/archive" |
| | | |
| | | if FileManager.default.fileExists(atPath: filePath) && !force{return true} |
| | | |
| | | do { |
| | | try FileManager.default.createDirectory(at:URL(fileURLWithPath: filePath), withIntermediateDirectories: true) |
| | | }catch { |
| | | return false |
| | | } |
| | | filePath = filePath + "/\(className.jq_md5String()).archive" |
| | | |
| | | guard let data = try? NSKeyedArchiver.archivedData(withRootObject: json, requiringSecureCoding: true) else {return false} |
| | | do{ |
| | | try data.write(to: URL(fileURLWithPath: filePath)) |
| | | return true |
| | | }catch _ { |
| | | return false |
| | | } |
| | | } |
| | | |
| | | static func archive(models:[HandyJSON],force:Bool = false)->Bool{ |
| | | let jsonString = models.jq_toJson1() |
| | | guard let className = String(describing: models.self).components(separatedBy: "(").first else {return false} |
| | | guard var filePath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first else {return false} |
| | | filePath = filePath + "/archive" |
| | | |
| | | if FileManager.default.fileExists(atPath: filePath) && !force{return true} |
| | | |
| | | do { |
| | | try FileManager.default.createDirectory(at:URL(fileURLWithPath: filePath), withIntermediateDirectories: true) |
| | | }catch { |
| | | return false |
| | | } |
| | | filePath = filePath + "/\(className.jq_md5String()).archive" |
| | | |
| | | guard let data = try? NSKeyedArchiver.archivedData(withRootObject: jsonString, requiringSecureCoding: true) else {return false} |
| | | do{ |
| | | try data.write(to: URL(fileURLWithPath: filePath)) |
| | | return true |
| | | }catch _ { |
| | | return false |
| | | } |
| | | } |
| | | |
| | | static func unarchive(model:HandyJSON.Type)->HandyJSON?{ |
| | | guard let className = String(describing: model.self).components(separatedBy: "(").first else {return nil} |
| | | let encryptName = className.jq_md5String() |
| | | |
| | | guard var filePath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first else {return nil} |
| | | filePath = filePath + "/archive/" + encryptName + ".archive" |
| | | |
| | | let data = try? Data(contentsOf: URL(fileURLWithPath: filePath)) |
| | | |
| | | if let dict = NSKeyedUnarchiver.unarchiveObject(with: data!) as? Dictionary<String, Any>{ |
| | | print(dict) |
| | | let model = model.deserialize(from: dict) |
| | | return model |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | static func unarchive(models:[HandyJSON].Type)->[HandyJSON]?{ |
| | | guard let className = String(describing: models.self).components(separatedBy: "(").first else {return nil} |
| | | let encryptName = className.jq_md5String() |
| | | |
| | | guard var filePath = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true).first else {return nil} |
| | | filePath = filePath + "/archive/" + encryptName + ".archive" |
| | | |
| | | let data = try? Data(contentsOf: URL(fileURLWithPath: filePath)) |
| | | |
| | | if let dict = NSKeyedUnarchiver.unarchiveObject(with: data!) as? Dictionary<String, Any>{ |
| | | print(dict) |
| | | let model = models.deserialize(from: dict) |
| | | return model |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| | | <plist version="1.0"> |
| | | <dict/> |
| | | <dict> |
| | | <key>com.apple.developer.associated-domains</key> |
| | | <array> |
| | | <string>applinks:https://dollearn/app/</string> |
| | | </array> |
| | | </dict> |
| | | </plist> |
| | |
| | | <key>LSApplicationQueriesSchemes</key> |
| | | <array> |
| | | <string>weixin</string> |
| | | <string>weixinAPI</string> |
| | | <string>weixinULAPI</string> |
| | | <string>weixinURLParamsAPI</string> |
| | | </array> |
| | | <key>Localization native development region</key> |
| | |
| | | var updateBy: String = "" |
| | | var updateTime: String = "" |
| | | var userId: Int = 0 |
| | | var orderId:Int = 0 |
| | | } |
| | | |
| | | struct AddressTreeModel:HandyJSON{ |
| | |
| | | var insertTime: String = "" |
| | | var integral: Int = 0 |
| | | var orderNumber: String = "" |
| | | var orderId:Int = 0 |
| | | var state: Int = 0 //订单状态1待发货2已发货3已完成 |
| | | var updateBy: String = "" |
| | | var updateTime: String = "" |
| | |
| | | var updateBy: String = "" |
| | | var updateTime: String = "" |
| | | } |
| | | |
| | | struct ShareInfoModel:HandyJSON{ |
| | | var title = "" |
| | | var phone = "" |
| | | var img = "" |
| | | |
| | | } |
| | |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="YbH-L3-L1g"> |
| | | <rect key="frame" x="0.0" y="0.0" width="243" height="316"/> |
| | | <color key="backgroundColor" red="0.61960784310000006" green="0.54117647059999996" blue="0.85882352939999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" secondItem="YbH-L3-L1g" secondAttribute="height" multiplier="1:1.3" id="K9A-Ng-kLe"/> |
| | | </constraints> |
| | |
| | | |
| | | Services.promptVoice().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | // ArchiveTool.archive(model: model,force: true) |
| | | // |
| | | // if let v = ArchiveTool.unarchive(model: PromptVoiceModel.self){ |
| | | // |
| | | // } |
| | | |
| | | let voice = UserDefaults.standard.object(forKey: "promptVoiceDate") as? String |
| | | if model.updateTime != voice{ |
| | | VoicePlayer.share().donwloadPromoteVoice(successVoice: model.correct, failVoice: model.error,updateTime: model.updateTime) |
| | |
| | | |
| | | @IBAction func playAction(_ sender: UIButton) { |
| | | if let m = model{ |
| | | btn_play.isHidden = true |
| | | // btn_play.isHidden = true |
| | | VoicePlayer.share().playerAt(url: m.correct) |
| | | playAtIndexClouse?(indexPath) |
| | | VoicePlayer.share().playEnd { |
| | | self.btn_play.isHidden = false |
| | | } |
| | | // VoicePlayer.share().playEnd { |
| | | // self.btn_play.isHidden = false |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | case .story1,.story2: |
| | | if let dict = noti.object as? Dictionary<String,Any>{ |
| | | weakSelf.storyComplete(storyId: dict["storyId"] as! Int, integral: dict["storyIntegral"] as! Int) |
| | | let type = weakSelf.viewModel.listenType.value == .story1 ? 1:0 |
| | | let accracy = Int(Double(weakSelf.viewModel.correctNum) / Double(weakSelf.viewModel.correctNum + weakSelf.viewModel.errorNum) * 100) |
| | | weakSelf.storyComplete(storyId: dict["storyId"] as! Int, accuracy: accracy, studyTime: weakSelf.viewModel.times, type: type, integral: dict["storyIntegral"] as! Int) |
| | | } |
| | | } |
| | | return |
| | |
| | | |
| | | viewModel.currentPage.subscribe(onNext: {[weak self]currentPage in |
| | | guard let weakSelf = self else { return } |
| | | self?.btn_forward.isHidden = currentPage <= 0 |
| | | self?.setPages() |
| | | weakSelf.btn_forward.isHidden = currentPage <= 0 |
| | | weakSelf.setPages() |
| | | }).disposed(by: disposeBag) |
| | | |
| | | viewModel.answerCount.subscribe(onNext: {[weak self] count in |
| | |
| | | label_pageNum.text = "已完成:\(viewModel.currentPage.value + 1)/\((data as! ListenNewModel).subjectList.count)" |
| | | case .lesson4: |
| | | //两题为一组:需要/2 |
| | | label_pageNum.text = "已完成:\(viewModel.answerCount.value)/\((data as! ListenNewModel).subjectList.flatMap({$0}).count / 2)" |
| | | label_pageNum.text = "已完成:\(viewModel.currentPage.value + 1)/\((data as! ListenNewModel).subjectList.count)" |
| | | case .game1,.game2: |
| | | btn_forward.isHidden = true |
| | | label_pageNum.isHidden = true |
| | |
| | | let count = (data as! Listen1Model).storyList.count |
| | | viewModel.maxPage.accept(count) |
| | | label_pageNum.text = "已完成:\(viewModel.currentPage.value + 1)/\(count)" |
| | | default:break |
| | | } |
| | | } |
| | | |
| | |
| | | /// - Parameter ignorePush: 是否忽略跳转(未完成答题 :true) |
| | | private func studyComplete(){ |
| | | var toalIntegral:Int = 0 |
| | | var ids:String = "" |
| | | |
| | | let ids:String = viewModel.answerItems_1.keys.sorted().joined(separator: ",") |
| | | switch viewModel.listenType.value { |
| | | case .lesson1,.lesson2,.lesson3,.lesson4,.lesson5: |
| | | let data = (data as! ListenNewModel).data |
| | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | timer.invalidate() |
| | | |
| | | toalIntegral = floor(Double(toalIntegral) * (Double(accracy) / 100.0)).int |
| | | |
| | | let vc = HomeStudyCompleteVC(correctNum: viewModel.correctNum, errorNum: viewModel.errorNum, totalCoin: toalIntegral, listenType: viewModel.listenType.value) |
| | | vc.title = viewModel.listenType.value.rawTitle |
| | |
| | | push(vc: vc) |
| | | } |
| | | |
| | | private func storyComplete(storyId:Int,integral:Int){ |
| | | private func storyComplete(storyId:Int,accuracy:Int,studyTime:Int,type:Int,integral:Int){ |
| | | timer.invalidate() |
| | | |
| | | Services.completeStory(storyId: storyId, integral: integral).subscribe(onNext: {data in |
| | | Services.completeStory(storyId: storyId, accuracy: accuracy, studyTime: studyTime, type: type).subscribe(onNext: {data in |
| | | NotificationCenter.default.post(name: Refresh_ListenSchedule_Noti, object: nil) |
| | | }).disposed(by: disposeBag) |
| | | |
| | |
| | | if btn_exit.titleLabel?.text == "完成"{ |
| | | if viewModel.listenType.value == .story2{ |
| | | let v = data as! Listen1Model |
| | | storyComplete(storyId: v.data!.id, integral: v.data!.lookIntegral) |
| | | let accuracy = Int(Double(viewModel.correctNum) / Double(viewModel.correctNum + viewModel.errorNum) * 100) |
| | | storyComplete(storyId: v.data!.id, accuracy: accuracy, studyTime: viewModel.times, type: 1, integral: v.data!.lookIntegral) |
| | | } |
| | | }else{ |
| | | CommonAlertView.show(content: "未完成全部答题,确认退出吗?") {[weak self] () in |
| | |
| | | let topicIds = weakSelf.viewModel.answerItems_1.keys.sorted() |
| | | let temIds = weakSelf.viewModel.answerItems_1.values.flatMap({$0}).map({"\($0)"}) |
| | | |
| | | var schedule:Int = 0 |
| | | switch weakSelf.viewModel.listenType.value{ |
| | | case .lesson1,.lesson2,.lesson5:schedule = weakSelf.viewModel.answerCount.value |
| | | case .lesson3:schedule = weakSelf.viewModel.currentPage.value + 1 |
| | | case .lesson4:schedule = weakSelf.viewModel.currentPage.value + 1 |
| | | default:break |
| | | } |
| | | |
| | | switch weakSelf.viewModel.listenType.value{ |
| | | case .lesson1,.lesson2,.lesson3,.lesson4,.lesson5: |
| | | if temIds.count > 0 && topicIds.count > 0{ |
| | | let totalNum = weakSelf.viewModel.correctNum + weakSelf.viewModel.errorNum |
| | | Services.exitLearning(type:weakSelf.viewModel.listenType.value.rawValue,week: weakSelf.viewModel.week.value!, day: weakSelf.viewModel.day.value!, teamIds: temIds, topicIds: topicIds,answerNumber: totalNum,correctNumber:weakSelf.viewModel.correctNum,studyTime:weakSelf.viewModel.times).subscribe(onNext: { data in |
| | | Services.exitLearning(type:weakSelf.viewModel.listenType.value.rawValue,week: weakSelf.viewModel.week.value!, day: weakSelf.viewModel.day.value!, teamIds: temIds, topicIds: topicIds,answerNumber: totalNum,correctNumber:weakSelf.viewModel.correctNum,studyTime:weakSelf.viewModel.times,schedule: schedule).subscribe(onNext: { data in |
| | | |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | |
| | | class HomeListenFight_lesson_4_VC: BaseVC { |
| | | |
| | | private var viewModel = FightAnswerViewModel() |
| | | |
| | | private var listenNewModel:ListenNewModel! |
| | | private var page:Int! |
| | | var rootViewModel:HomeListenFightViewModel! |
| | | |
| | | private var answerIndex:IndexPath? //答案的Index |
| | | private var answerCount:Int = 0 //回答计数 |
| | | private var answerIndexs = Set<IndexPath>() //回答过的Index集合 |
| | | private var filterItems = [[Listen1SubModel]]() //此类型特殊,需要数据清理 |
| | | // private var isPlayedAnsterSet = Set<Int>() //已经播放了的 |
| | | |
| | | private lazy var stackView:UIStackView = { |
| | | let sta = UIStackView() |
| | |
| | | |
| | | func restore(){ |
| | | answerIndexs.removeAll() |
| | | answerCount = 0 |
| | | answerIndex = nil |
| | | for subView in view.subviews{ |
| | | if subView is Lesson_4_AnswerView{ |
| | |
| | | let answerId = answerModel!.id |
| | | self.rootViewModel.insertCorrectAnswer(teamId: teamId, answerId: answerId) |
| | | |
| | | |
| | | DispatchQueue.main.asyncAfter(deadline: .now()+2) { |
| | | self.voicePlayer.playerAt(url: tempSubV!.voiceUrl) |
| | | } |
| | | |
| | | //防止重复答题造成计数错误的问题 |
| | | if !answerIndexs.contains(answerIndex!){ |
| | | answerCount += 1 |
| | | rootViewModel.correctNum += 1 |
| | | let v = rootViewModel.answerCount.value + 1 |
| | | rootViewModel.answerCount.accept(v) |
| | |
| | | v.removeFromSuperview() |
| | | } |
| | | self.stackView.layoutIfNeeded() |
| | | |
| | | //回答完成,下一答题 |
| | | if self.answerIndexs.count == 2{ |
| | | let v = self.rootViewModel.answerCount.value + 1 |
| | | self.rootViewModel.answerCount.accept(v) |
| | | // self.rootViewModel.answerItems[self.page] = self.listenNewModel.subjectList[self.page] |
| | | self.voicePlayer.playerEnd() |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: nil) |
| | | self.voicePlayer.playerEnd() |
| | | return |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | extension HomeListenFight_lesson_4_VC:VoicePlayerDelegate{ |
| | | func playComplete() { |
| | | self.view.isUserInteractionEnabled = true |
| | | |
| | | //回答完成,下一答题 |
| | | if answerIndexs.count == 2{ |
| | | voicePlayer.playerEnd() |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: nil) |
| | | return |
| | | } |
| | | } |
| | | |
| | | func playing() { |
| | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = dataItems[selectIndexPath.row][indexPath.row] |
| | | |
| | | guard model.canStudy == 1 else { |
| | | CommonAlertView.show(isSinple: true, content: "请先完成上一周练习") |
| | | return |
| | | } |
| | | // 暂时关闭,上线时开启 |
| | | // guard model.canStudy == 1 else { |
| | | // CommonAlertView.show(isSinple: true, content: "请先完成上一周练习") |
| | | // return |
| | | // } |
| | | |
| | | Services.studySchedule(week: model.week).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | if let model = data.data{ |
| | | let quarter = weakSelf.selectIndexPath.row + 1 //季度 |
| | | let week = model.week //周 |
| | | let vc = HomeListenVC(quarter: quarter, week: week,studyScheduleModel: model) |
| | | weakSelf.push(vc: vc) |
| | | var studyScheduleModel = StudyScheduleModel() |
| | | if let m = data.data{ |
| | | studyScheduleModel = m |
| | | } |
| | | let quarter = weakSelf.selectIndexPath.row + 1 //季度 |
| | | let week = studyScheduleModel.week //周 |
| | | let vc = HomeListenVC(quarter: quarter, week: model.week,studyScheduleModel: studyScheduleModel) |
| | | weakSelf.push(vc: vc) |
| | | |
| | | |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | |
| | | private var tableView:UITableView! |
| | | private var studyScheduleModel:StudyScheduleModel? |
| | | |
| | | required init(page:Int,quarter:Int,week:Int) { |
| | | required init(page:Int,quarter:Int,week:Int,studyScheduleModel:StudyScheduleModel) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.page = page |
| | | self.quarter = quarter |
| | | self.week = week |
| | | self.studyScheduleModel = studyScheduleModel |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | navigationItem.titleView = UIView() |
| | | getData() |
| | | // getData() |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | } |
| | | |
| | | func pageViewController(_ pageViewConteoller: FFPageViewController, controllerForPage page: Int) -> UIViewController { |
| | | return HomeListenSubVC(page: page,quarter: quarter,week: week) |
| | | return HomeListenSubVC(page: page,quarter: quarter,week: week,studyScheduleModel: studyScheduleModel) |
| | | } |
| | | } |
| | |
| | | extension AwardListView:UICollectionViewDelegate{ |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | |
| | | |
| | | // UIView.animate(withDuration: 0.4) { |
| | | // self.alpha = 0 |
| | | // self.view_container.transform = .init(scaleX: 0.1, y: 0.1) |
| | | // } completion: { _ in |
| | | // self.removeFromSuperview() |
| | | // let item = self.items[indexPath.row] |
| | | // self.clickClouse(item) |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | <rect key="frame" x="144" y="100" width="892" height="624"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="可兑换商品" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D5s-Ls-BXc"> |
| | | <rect key="frame" x="405" y="25" width="82" height="18"/> |
| | | <rect key="frame" x="400" y="25" width="92" height="18"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="18" id="Z5F-Lg-och"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/> |
| | | <nil key="textColor"/> |
| | | <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="calibratedRGB"/> |
| | | <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="hKD-mg-1cZ"> |
| | |
| | | } |
| | | |
| | | @IBAction func lookOrderAction(_ sender: UIButton) { |
| | | self.navigationController?.popViewController(animated: true, { |
| | | let vc = ExchangeRecordHistoryVC() |
| | | vc.title = "兑换记录" |
| | | JQ_currentNavigationController().pushViewController(vc) |
| | | }) |
| | | let vc = ExchangeRecordHistoryVC() |
| | | vc.title = "兑换记录" |
| | | JQ_currentNavigationController().pushViewController(vc) |
| | | } |
| | | |
| | | } |
| | |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VxI-3j-WUN"> |
| | | <rect key="frame" x="99" y="43" width="826" height="1323"/> |
| | | <rect key="frame" x="234" y="43" width="556" height="1213"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WIa-7P-Bf1"> |
| | | <rect key="frame" x="375.5" y="30" width="75" height="75"/> |
| | | <rect key="frame" x="240.5" y="30" width="75" height="75"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="75" id="KLa-7i-28e"/> |
| | | <constraint firstAttribute="width" constant="75" id="uco-r2-Ki1"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="O5B-wn-Esz"> |
| | | <rect key="frame" x="405" y="134" width="16.5" height="25"/> |
| | | <rect key="frame" x="270" y="134" width="16.5" height="25"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="25" id="BJ3-sF-4No"/> |
| | | </constraints> |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <stackView opaque="NO" contentMode="scaleToFill" spacing="94" translatesAutoresizingMaskIntoConstraints="NO" id="aqw-2Q-ccA"> |
| | | <rect key="frame" x="242" y="274" width="342" height="39.5"/> |
| | | <rect key="frame" x="107" y="274" width="342" height="39.5"/> |
| | | <subviews> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nyx-Nz-by6"> |
| | | <rect key="frame" x="0.0" y="0.0" width="124" height="39.5"/> |
| | |
| | | </subviews> |
| | | </stackView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lpP-CH-CdV"> |
| | | <rect key="frame" x="406.5" y="169" width="13.5" height="20"/> |
| | | <rect key="frame" x="271.5" y="169" width="13.5" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="hmc-cj-PH2"/> |
| | | </constraints> |
| | |
| | | <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="VxI-3j-WUN" secondAttribute="trailing" constant="99" id="Iat-hg-uhk"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="VxI-3j-WUN" secondAttribute="trailing" constant="234" id="Iat-hg-uhk"/> |
| | | <constraint firstItem="VxI-3j-WUN" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="23" id="R5c-zV-QAE"/> |
| | | <constraint firstItem="VxI-3j-WUN" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="99" id="aNF-ge-CLX"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="VxI-3j-WUN" secondAttribute="bottom" id="pWe-V4-eqI"/> |
| | | <constraint firstItem="VxI-3j-WUN" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="234" id="aNF-ge-CLX"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="VxI-3j-WUN" secondAttribute="bottom" constant="110" id="pWe-V4-eqI"/> |
| | | </constraints> |
| | | <point key="canvasLocation" x="98" y="21"/> |
| | | </view> |
| | |
| | | import UIKit |
| | | import WebKit |
| | | import RxRelay |
| | | import JQTools |
| | | |
| | | class MarketContentViewModel{ |
| | | //购买数量 |
| | |
| | | @IBOutlet weak var label_costCoin: UILabel! |
| | | @IBOutlet weak var cons_footHei: NSLayoutConstraint! |
| | | @IBOutlet weak var webViewHeiCons: NSLayoutConstraint! |
| | | @IBOutlet weak var label_originPrice: UILabel! |
| | | |
| | | private var viewModel = MarketContentViewModel() |
| | | |
| | |
| | | self?.label_info.text = info_Array.joined(separator: "|") |
| | | self?.webView.loadHTMLString(m.good?.detail.jq_wrapHtml() ?? "", baseURL: nil) |
| | | self?.viewModel.detailModel.accept(m) |
| | | |
| | | self?.label_originPrice.isHidden = m.good!.price <= 0 |
| | | |
| | | if !(self?.label_originPrice.isHidden ?? false){ |
| | | self?.label_originPrice.attributedText = AttributedStringbuilder.build().add(string: "¥\(m.good!.price)", withFont: UIFont.init(name: "Impact", size: 14) ?? .systemFont(ofSize: 14, weight: .medium), withColor: UIColor(hexString: "#9A9A9A")!).delLine(color: UIColor(hexString: "#9A9A9A")!).mutableAttributedString |
| | | } |
| | | } |
| | | |
| | | }).disposed(by: disposeBag) |
| | |
| | | <outlet property="label_coin" destination="yrU-ab-vv9" id="4UT-Q9-CO3"/> |
| | | <outlet property="label_costCoin" destination="Br9-rb-zWu" id="Qyp-x1-Ff0"/> |
| | | <outlet property="label_info" destination="kR5-RX-1Ha" id="cvV-F1-x1p"/> |
| | | <outlet property="label_originPrice" destination="F3F-sS-O6l" id="DK7-Yc-kdj"/> |
| | | <outlet property="label_surplusCoin" destination="sQy-qj-ems" id="FaO-3K-U3Z"/> |
| | | <outlet property="label_title" destination="PgE-zX-EIu" id="FWi-qa-sK0"/> |
| | | <outlet property="scrollView" destination="loc-rm-BZe" id="xqU-OW-GgJ"/> |
| | |
| | | <color key="textColor" red="0.60392156860000001" green="0.60392156860000001" blue="0.60392156860000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <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="F3F-sS-O6l"> |
| | | <rect key="frame" x="64" y="333.5" width="14.5" height="17.5"/> |
| | | <fontDescription key="fontDescription" name="Impact" family="Impact" pointSize="14"/> |
| | | <color key="textColor" red="0.60392156860000001" green="0.60392156860000001" blue="0.60392156860000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | |
| | | <constraint firstAttribute="trailing" secondItem="3WZ-Jf-leh" secondAttribute="trailing" constant="13" id="gDs-iU-l4D"/> |
| | | <constraint firstAttribute="trailing" secondItem="lUx-IV-YIU" secondAttribute="trailing" id="i5N-By-Pa9"/> |
| | | <constraint firstItem="vy4-mb-8lB" firstAttribute="centerX" secondItem="3V0-GL-Fmn" secondAttribute="centerX" id="idm-OK-nPX"/> |
| | | <constraint firstItem="F3F-sS-O6l" firstAttribute="leading" secondItem="LtS-Mg-aeT" secondAttribute="trailing" constant="3" id="ivC-qz-RPX"/> |
| | | <constraint firstItem="ZOY-ws-sjP" firstAttribute="leading" secondItem="3V0-GL-Fmn" secondAttribute="leading" constant="14" id="k11-lO-F1N"/> |
| | | <constraint firstItem="SHM-HW-3QJ" firstAttribute="top" secondItem="PgE-zX-EIu" secondAttribute="bottom" constant="7" id="kjs-SE-QJz"/> |
| | | <constraint firstItem="F3F-sS-O6l" firstAttribute="centerY" secondItem="yrU-ab-vv9" secondAttribute="centerY" id="lBs-YY-P5B"/> |
| | | <constraint firstItem="3WZ-Jf-leh" firstAttribute="leading" secondItem="3V0-GL-Fmn" secondAttribute="leading" constant="13" id="msq-Yj-Hkl"/> |
| | | <constraint firstItem="PgE-zX-EIu" firstAttribute="top" secondItem="yrU-ab-vv9" secondAttribute="bottom" constant="7" id="tro-c3-NxF"/> |
| | | <constraint firstItem="PgE-zX-EIu" firstAttribute="leading" secondItem="3V0-GL-Fmn" secondAttribute="leading" constant="14" id="upN-6F-Xy0"/> |
| | |
| | | } |
| | | |
| | | if let first = result.data?.filter({$0.isDefault == 1}).first{ |
| | | self?.label_address.text = first.address |
| | | self?.label_address.text = String(format: "%@%@%@",first.province,first.city,first.address) |
| | | self?.label_address_info.text = first.recipient + "|" + first.recipientPhone |
| | | self?.recipientId = first.id |
| | | }else{ |
| | |
| | | return |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | CommonAlertView.show(content: "确认兑换当前商品吗?") { |
| | | let goodsId = self.viewModel.detailModel.value!.good!.id |
| | | let num = self.viewModel.number.value |
| | |
| | | let vc = ExchangeResultVC(resultType: .success) |
| | | vc.title = "商品详情" |
| | | self.push(vc: vc) |
| | | }, onError: { error in |
| | | if let e = error as? NetworkRequest.NetRequestError{ |
| | | switch e { |
| | | case .Other(_,let msg): |
| | | let vc = ExchangeResultVC(resultType: .fail(msg)) |
| | | vc.title = "商品详情" |
| | | self.push(vc: vc) |
| | | default:break |
| | | } |
| | | } |
| | | }).disposed(by: self.disposeBag) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func shareAction(_ sender: QMUIButton) { |
| | | if WXApi.isWXAppSupportStateAPI(){ |
| | | if WXApi.isWXAppInstalled(){ |
| | | ShareView.show() |
| | | }else{ |
| | | let urlStr = "https://dollearn.com/" |
| | |
| | | |
| | | var addressModel:AddressModel!{ |
| | | didSet{ |
| | | label_address.text = addressModel.address |
| | | label_address.text = String(format: "%@%@%@", addressModel.province,addressModel.city,addressModel.address) |
| | | label_addressInfo.text = addressModel.recipient + "|" + addressModel.recipientPhone |
| | | isDefault(addressModel.isDefault == 1) |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func handleAction(_ sender: UIButton) { |
| | | let vc = AddressManageVC(type: .handle) |
| | | vc.title = "修改地址" |
| | | vc.chooseAddress { m in |
| | | CommonAlertView.show(content: "确认修改当前收货地址吗?") {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | if weakSelf.exchangeRecordModel?.consigneeAddress == m.address && weakSelf.exchangeRecordModel?.consigneeName == m.recipient && weakSelf.exchangeRecordModel?.consigneePhone == m.recipientPhone{ |
| | | alertError(msg: "修改地址信息与原地址信息相同");return |
| | | } |
| | | |
| | | Services.updateOrderAddress(orderId: weakSelf.exchangeRecordModel!.goodsId, recipientId: m.id).subscribe(onNext: {data in |
| | | alertSuccess(msg: "修改成功") |
| | | |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | switch exchangeRecordModel!.state{ |
| | | case 1: |
| | | let vc = AddressManageVC(type: .handle) |
| | | vc.title = "修改地址" |
| | | vc.chooseAddress { m in |
| | | CommonAlertView.show(content: "确认修改当前收货地址吗?") {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | if weakSelf.exchangeRecordModel?.consigneeAddress == m.address && weakSelf.exchangeRecordModel?.consigneeName == m.recipient && weakSelf.exchangeRecordModel?.consigneePhone == m.recipientPhone{ |
| | | alertError(msg: "修改地址信息与原地址信息相同");return |
| | | } |
| | | |
| | | Services.updateOrderAddress(orderId: weakSelf.exchangeRecordModel!.orderId, recipientId: m.id).subscribe(onNext: {data in |
| | | alertSuccess(msg: "修改成功") |
| | | NotificationCenter.default.post(name: Refresh_MarketExchange_Noti, object: nil) |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | case 2: |
| | | CommonAlertView.show(isSinple: false, content: "确认已收到货吗?") {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | Services.confirmStudy(id: weakSelf.exchangeRecordModel!.orderId).subscribe(onNext: {data in |
| | | NotificationCenter.default.post(name: Refresh_MarketExchange_Noti, object: nil) |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | default:break |
| | | } |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool { |
| | | view.endEditing(true) |
| | | CityAddressPickerView.show(title: "选择省市区") {[weak self] province, city, country in |
| | | CityAddressPickerView.show(title: "所在城市") {[weak self] province, city, country in |
| | | self?.viewModel.provinceModel.accept(province) |
| | | self?.viewModel.cityModel.accept(city) |
| | | self?.viewModel.countryModel.accept(country) |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | viewModel.configure(tableView) |
| | | viewModel.configure(tableView,needMore: false) |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | |
| | | tableView.jq_addShadows(shadowColor: UIColor(hexStr: "#D9D9D9"), corner: 0, radius: 20, offset: CGSize(width: 0, height: 2), opacity: 1) |
| | | view.addSubview(tableView) |
| | | tableView.snp.makeConstraints { make in |
| | | make.top.equalTo(self.view.safeAreaLayoutGuide).offset(27) |
| | | make.top.equalTo(self.view.safeAreaLayoutGuide).offset(0) |
| | | make.left.equalTo(239) |
| | | make.right.equalTo(-239) |
| | | make.height.equalTo(47) |
| | |
| | | |
| | | viewModel.configure(tableView,needMore: false) |
| | | viewModel.beginRefresh() |
| | | |
| | | yy_popBlock = {[weak self] () in |
| | | self?.navigationController?.popToRootViewController(animated: true) |
| | | } |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | import UIKit |
| | | import JQTools |
| | | import QMUIKit |
| | | import RxSwift |
| | | |
| | | class ShareView: UIView,JQNibView{ |
| | | |
| | |
| | | @IBOutlet weak var cons_bottom: NSLayoutConstraint! |
| | | @IBOutlet weak var btn_wx: QMUIButton! |
| | | @IBOutlet weak var btn_wxFri: QMUIButton! |
| | | @IBOutlet weak var img_cover: UIImageView! |
| | | @IBOutlet weak var label_info: UILabel! |
| | | private var disposeBag = DisposeBag() |
| | | private var shareModel:ShareInfoModel? |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | view_content.transform = .init(scaleX: 0.1, y: 0.1) |
| | | view_content.alpha = 0 |
| | | btn_wx.imagePosition = .top |
| | | btn_wxFri.imagePosition = .top |
| | | btn_wx.spacingBetweenImageAndTitle = 8 |
| | |
| | | cons_bottom.constant = -JQ_ScreenW |
| | | alpha = 0 |
| | | layoutIfNeeded() |
| | | |
| | | Services.shareInfo().subscribe(onNext: { data in |
| | | if let m = data.data{ |
| | | self.shareModel = m |
| | | self.label_info.text = m.title |
| | | self.img_cover.sd_setImage(with: URL(string: m.img)) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | static func show(){ |
| | |
| | | UIView.animate(withDuration: 0.4) { |
| | | shareView.layoutIfNeeded() |
| | | shareView.alpha = 1 |
| | | |
| | | } |
| | | UIView.animate(withDuration: 0.4, delay: 0.4) { |
| | | shareView.view_content.transform = .init(scaleX: 1.0, y: 1.0) |
| | | shareView.view_content.alpha = 1 |
| | | } |
| | | } |
| | | |
| | |
| | | self.removeFromSuperview() |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @IBAction func shareAction(_ sender: QMUIButton) { |
| | | guard let m = shareModel else {alertError(msg: "分享失败");return} |
| | | var scene:WXScene! |
| | | if sender.tag == 10{ |
| | | scene = WXSceneSession |
| | | }else{ |
| | | scene = WXSceneTimeline |
| | | } |
| | | |
| | | WeChatTools.shareText("12312") |
| | | // WeChatTools.sharePic(img_cover.image!, thumb: UIImage(named: "logo")!, scale: 1.0, scene: scene) |
| | | } |
| | | } |
| | |
| | | <stackView opaque="NO" contentMode="scaleToFill" spacing="195" translatesAutoresizingMaskIntoConstraints="NO" id="QCL-dY-yrF"> |
| | | <rect key="frame" x="398.5" y="97.5" width="383" height="51"/> |
| | | <subviews> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yhD-N5-Thb" customClass="QMUIButton"> |
| | | <button opaque="NO" tag="10" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yhD-N5-Thb" customClass="QMUIButton"> |
| | | <rect key="frame" x="0.0" y="0.0" width="100" height="51"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="微信好友" image="share_wx"> |
| | | <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | </state> |
| | | <connections> |
| | | <action selector="shareAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="bin-Bb-NJx"/> |
| | | </connections> |
| | | </button> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pdf-iF-s8i" customClass="QMUIButton"> |
| | | <button opaque="NO" tag="11" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pdf-iF-s8i" customClass="QMUIButton"> |
| | | <rect key="frame" x="295" y="0.0" width="88" height="51"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="朋友圈" image="share_wxFri"> |
| | | <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | </state> |
| | | <connections> |
| | | <action selector="shareAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="hsN-HA-Js5"/> |
| | | </connections> |
| | | </button> |
| | | </subviews> |
| | | </stackView> |
| | |
| | | <constraint firstAttribute="width" secondItem="FYo-U3-DCE" secondAttribute="height" multiplier="1:0.1972" id="hji-FF-fZU"/> |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9NU-dC-vCn"> |
| | | <rect key="frame" x="350.5" y="160.5" width="479" height="377"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_login" translatesAutoresizingMaskIntoConstraints="NO" id="QBd-oU-bQt"> |
| | | <rect key="frame" x="21" y="19" width="156" height="62"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="62" id="4Ex-gt-hVM"/> |
| | | <constraint firstAttribute="width" constant="156" id="4R7-c1-eC7"/> |
| | | </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="Hww-QI-7F9"> |
| | | <rect key="frame" x="195" y="39" width="147" height="21.5"/> |
| | | <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="calibratedRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gaN-AI-OWd"> |
| | | <rect key="frame" x="0.0" y="140" width="479" height="237"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="----" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="d4J-5c-Qcj"> |
| | | <rect key="frame" x="21" y="102" width="437" height="21.5"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="18"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.57999999999999996" colorSpace="custom" customColorSpace="calibratedRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="d4J-5c-Qcj" firstAttribute="top" secondItem="QBd-oU-bQt" secondAttribute="bottom" constant="21" id="51s-w4-Xn9"/> |
| | | <constraint firstItem="Hww-QI-7F9" firstAttribute="leading" secondItem="QBd-oU-bQt" secondAttribute="trailing" constant="18" id="CoS-sK-oyV"/> |
| | | <constraint firstAttribute="width" constant="479" id="FGl-3V-oPs"/> |
| | | <constraint firstItem="QBd-oU-bQt" firstAttribute="top" secondItem="9NU-dC-vCn" secondAttribute="top" constant="19" id="GBT-f5-bcc"/> |
| | | <constraint firstAttribute="trailing" secondItem="gaN-AI-OWd" secondAttribute="trailing" id="GhA-tY-dNN"/> |
| | | <constraint firstItem="d4J-5c-Qcj" firstAttribute="leading" secondItem="9NU-dC-vCn" secondAttribute="leading" constant="21" id="Hng-iI-3gW"/> |
| | | <constraint firstItem="Hww-QI-7F9" firstAttribute="centerY" secondItem="QBd-oU-bQt" secondAttribute="centerY" id="RWU-qR-eaR"/> |
| | | <constraint firstAttribute="bottom" secondItem="gaN-AI-OWd" secondAttribute="bottom" id="VhV-mg-OnB"/> |
| | | <constraint firstAttribute="trailing" secondItem="d4J-5c-Qcj" secondAttribute="trailing" constant="21" id="Vve-wI-iDn"/> |
| | | <constraint firstItem="gaN-AI-OWd" firstAttribute="leading" secondItem="9NU-dC-vCn" secondAttribute="leading" id="fvy-37-GdS"/> |
| | | <constraint firstItem="QBd-oU-bQt" firstAttribute="leading" secondItem="9NU-dC-vCn" secondAttribute="leading" constant="21" id="gMf-KN-9KM"/> |
| | | <constraint firstAttribute="height" constant="377" id="i0z-Yi-hHX"/> |
| | | <constraint firstItem="gaN-AI-OWd" firstAttribute="top" secondItem="9NU-dC-vCn" secondAttribute="top" constant="140" id="oWm-E7-EGX"/> |
| | | </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> |
| | | <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/> |
| | | <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstItem="FYo-U3-DCE" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Fy2-3W-zW7"/> |
| | | <constraint firstItem="9NU-dC-vCn" firstAttribute="centerX" secondItem="vUN-kp-3ea" secondAttribute="centerX" id="Qjs-cB-et4"/> |
| | | <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="FYo-U3-DCE" secondAttribute="trailing" id="cpO-Bd-3jx"/> |
| | | <constraint firstItem="FYo-U3-DCE" firstAttribute="top" secondItem="9NU-dC-vCn" secondAttribute="bottom" constant="50" id="k8T-1g-KiS"/> |
| | | <constraint firstAttribute="bottom" secondItem="FYo-U3-DCE" secondAttribute="bottom" id="tjg-FW-AJg"/> |
| | | </constraints> |
| | | <connections> |
| | | <outlet property="btn_wx" destination="yhD-N5-Thb" id="Ifz-R6-fvq"/> |
| | | <outlet property="btn_wxFri" destination="pdf-iF-s8i" id="JMT-Tz-Qey"/> |
| | | <outlet property="cons_bottom" destination="tjg-FW-AJg" id="DkR-pm-WBb"/> |
| | | <outlet property="view_content" destination="FYo-U3-DCE" id="TtL-FL-nv8"/> |
| | | <outlet property="img_cover" destination="gaN-AI-OWd" id="9pY-vW-tJp"/> |
| | | <outlet property="label_info" destination="d4J-5c-Qcj" id="RVb-YG-Ytb"/> |
| | | <outlet property="view_content" destination="9NU-dC-vCn" id="5iY-jd-AdJ"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="56.949152542372886" y="19.756097560975608"/> |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | | <image name="bg_login" width="296" height="129"/> |
| | | <image name="btn_close_circle" width="26" height="26"/> |
| | | <image name="share_wx" width="50" height="50"/> |
| | | <image name="share_wxFri" width="51" height="51"/> |
| | |
| | | } |
| | | |
| | | private func setUI(){ |
| | | var items = Array<String>() |
| | | items.append("省") |
| | | items.append("市") |
| | | items.append("区") |
| | | |
| | | let stackView = UIStackView() |
| | | stackView.axis = .horizontal |
| | | stackView.distribution = .fillEqually |
| | | stackView.spacing = 133 |
| | | view_content.addSubview(stackView) |
| | | stackView.snp.makeConstraints { make in |
| | | make.top.equalTo(label_title.snp.bottom).offset(27) |
| | | make.height.equalTo(25) |
| | | make.centerX.equalToSuperview() |
| | | } |
| | | |
| | | for (_,v) in items.enumerated(){ |
| | | let label = UILabel() |
| | | label.text = v |
| | | label.font = UIFont.systemFont(ofSize: 18, weight: .medium) |
| | | label.textColor = .black.withAlphaComponent(0.8) |
| | | label.textAlignment = .center |
| | | stackView.addArrangedSubview(label) |
| | | } |
| | | |
| | | view_content.addSubview(btn_complete) |
| | | btn_complete.snp.makeConstraints { make in |
| | | make.bottom.equalToSuperview().offset(-UIDevice.jq_safeEdges.bottom) |
| | | make.centerX.equalToSuperview() |
| | | make.width.equalTo(JQ_ScreenW * 0.1487) |
| | | make.width.equalTo(316) |
| | | make.height.equalTo(47) |
| | | } |
| | | |
| | |
| | | make.top.equalTo(label_title.snp.bottom).offset(50) |
| | | make.bottom.equalTo(btn_complete.snp.top) |
| | | make.centerX.equalToSuperview() |
| | | make.width.equalTo(500) |
| | | make.width.equalTo(350) |
| | | } |
| | | |
| | | btn_complete.addTarget(self, action: #selector(completeAction), for: .touchUpInside) |
| | |
| | | pickerView.clouse = clouse |
| | | sceneDelegate?.window?.addSubview(pickerView) |
| | | pickerView.setUI() |
| | | pickerView.label_title.text = title |
| | | |
| | | UIView.animate(withDuration: 0.35) { |
| | | pickerView.backgroundColor = UIColor.black.withAlphaComponent(0.7) |
| | |
| | | pickerView.layoutIfNeeded() |
| | | }completion: { _ in |
| | | Services.addressTree().subscribe(onNext: {data in |
| | | pickerView.items = data.data ?? [] |
| | | pickerView.picker.reloadAllComponents() |
| | | if let datas = data.data{ |
| | | pickerView.items = datas |
| | | pickerView.picker.reloadAllComponents() |
| | | } |
| | | }).disposed(by: pickerView.disposeBag) |
| | | } |
| | | } |
| | |
| | | extension CityAddressPickerView:UIPickerViewDelegate & UIPickerViewDataSource{ |
| | | func numberOfComponents(in pickerView: UIPickerView) -> Int { |
| | | if items.count > 0{ |
| | | return 3 |
| | | return 2 |
| | | } |
| | | return 0 |
| | | |
| | |
| | | resultLabel!.font = UIFont.systemFont(ofSize: 18, weight: .semibold) |
| | | resultLabel!.textColor = UIColor(hexStr: "#3C3C3C") |
| | | resultLabel!.textAlignment = .center |
| | | resultLabel!.adjustsFontSizeToFitWidth = true |
| | | } |
| | | |
| | | if component == 0{ |
| | |
| | | func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { |
| | | if component == 0{ |
| | | pickerView.reloadComponent(1) |
| | | pickerView.reloadComponent(2) |
| | | } |
| | | |
| | | if component == 1{ |
| | | pickerView.reloadComponent(2) |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | let commonAlertView = CommonAlertView.jq_loadNibView() |
| | | sceneDelegate?.window?.addSubview(commonAlertView) |
| | | commonAlertView.label_content.text = content |
| | | commonAlertView.label_content.numberOfLines = 0 |
| | | commonAlertView.label_content.textAlignment = .center |
| | | commonAlertView.clouse = clouse |
| | | commonAlertView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | |
| | | if isSinple{ |
| | | commonAlertView.btn_complete.isHidden = true |
| | | commonAlertView.cons_btnClose.constant = 219 * Config.RatioW |
| | | commonAlertView.cons_btnClose.constant = 219 |
| | | commonAlertView.btn_close.backgroundColor = Config.ThemeColor |
| | | commonAlertView.btn_close.jq_borderWidth = 0 |
| | | commonAlertView.btn_close.setTitleColor(.white, for: .normal) |
| | |
| | | private var selectClouse:((CommonBannerModel)->Void)? |
| | | private var autoRoll:Bool = true |
| | | private var currentPage:Int = 0 |
| | | private var timeInterval:Int = 5 |
| | | private var timeInterval:Int = 3 |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | |
| | | needLogin();return |
| | | } |
| | | loginSuccess() |
| | | |
| | | if WXApi.isWXAppInstalled(){ |
| | | WeChatTools.sendAuthRequest() |
| | | } |
| | | } |
| | | |
| | | func sceneDidDisconnect(_ scene: UIScene) { |
| | |
| | | // Use this method to save data, release shared resources, and store enough scene-specific state information |
| | | // to restore the scene back to its current state. |
| | | } |
| | | |
| | | func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { |
| | | |
| | | |
| | | } |
| | | |
| | | func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { |
| | | WXApi.handleOpenUniversalLink(userActivity, delegate: self) |
| | | } |
| | | |
| | | } |
| | | |
| | | extension SceneDelegate:WXApiDelegate{ |
| | | func onReq(_ req: BaseReq) { |
| | | |
| | | } |
| | | |
| | | func onResp(_ resp: BaseResp) { |
| | | |
| | | } |
| | | } |
| | | |
| | | extension SceneDelegate{ |
| | |
| | | if let next = BaseResponse<T>.deserialize(from: jsonString){ |
| | | switch next.code{ |
| | | case 200:ob.onNext(next) |
| | | case 504: //登录设备最大限制 |
| | | break |
| | | case 503: //登录被冻结 |
| | | case 506: |
| | | ob.onError(NetRequestError.Other(next.code,next.msg)) |
| | | case 503,502: //登录被冻结 |
| | | CommonAlertView.show(isSinple: true, content: next.msg) |
| | | // case 501: |
| | | // CommonAlertView.show(title: "提示", content: next.msg,isSingle: true) { _ in |
| | |
| | | import JQTools |
| | | |
| | | #if DEBUG |
| | | let All_Url = "http://192.168.110.237:9000" |
| | | //let All_Url = "http://1.95.15.237:9000" |
| | | //let All_Url = "http://192.168.110.237:9000" |
| | | let All_Url = "http://1.95.15.237:9000" |
| | | #else |
| | | let All_Url = "http://1.95.15.237:9000" |
| | | #endif |
| | |
| | | return NetworkRequest.request(params: params, method: .get, progress: true) |
| | | } |
| | | |
| | | class func completeStory(storyId:Int,integral:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | class func completeStory(storyId:Int,accuracy:Int,studyTime:Int,type:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/study/base/study/completeStory") |
| | | params.append(key: "storyId", value: storyId) |
| | | params.append(key: "integral", value: integral) |
| | | params.append(key: "accuracy", value: accuracy) |
| | | params.append(key: "studyTime", value: studyTime) |
| | | params.append(key: "type", value: type) |
| | | return NetworkRequest.request(params: params, method: .get, progress: true) |
| | | } |
| | | |
| | |
| | | return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding.default, progress: true) |
| | | } |
| | | |
| | | class func exitLearning(type:Int,week:Int,day:Int,teamIds:[String],topicIds:[String],answerNumber:Int,correctNumber:Int,studyTime:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | class func exitLearning(type:Int,week:Int,day:Int,teamIds:[String],topicIds:[String],answerNumber:Int,correctNumber:Int,studyTime:Int,schedule:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/study/base/study/exitLearning") |
| | | .append(key: "week", value: week) |
| | |
| | | .append(key: "answerNumber", value: answerNumber) |
| | | .append(key: "correctNumber", value: correctNumber) |
| | | .append(key: "studyTime", value: studyTime) |
| | | .append(key: "schedule", value: schedule) |
| | | return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding.default, progress: true) |
| | | } |
| | | |
| | |
| | | params.interface(url: "/study/base/study/giveIntegral") |
| | | return NetworkRequest.request(params: params, method: .get, progress: false) |
| | | } |
| | | |
| | | class func confirmStudy(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/goods/base/goods/confirmStudy") |
| | | .append(key: "id", value: id) |
| | | return NetworkRequest.request(params: params, method: .get, progress: false) |
| | | } |
| | | |
| | | class func shareInfo()->Observable<BaseResponse<ShareInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/study/base/user/shareInfo") |
| | | return NetworkRequest.request(params: params, method: .get, progress: false) |
| | | } |
| | | } |
| | | |
| | | extension Services{ |