| | |
| | | 1302789A2BFD9FBF00DDCE81 /* AddressManageTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 130278942BFD9FBF00DDCE81 /* AddressManageTCell.swift */; }; |
| | | 1302789B2BFD9FBF00DDCE81 /* GoodsItemTCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 130278952BFD9FBF00DDCE81 /* GoodsItemTCell.swift */; }; |
| | | 130A2C812C07075B008463B2 /* ListenFight_Game_Pocket_CCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 130A2C7F2C07075B008463B2 /* ListenFight_Game_Pocket_CCell.swift */; }; |
| | | 130E97772C329E2700205207 /* VIPCenterVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 130E97762C329E2700205207 /* VIPCenterVC.xib */; }; |
| | | 130E97782C329E2700205207 /* VIPCenterVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 130E97752C329E2700205207 /* VIPCenterVC.swift */; }; |
| | | 1316A22E2C05CE5900BE6CAA /* GameBeginTipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1316A22D2C05CE5900BE6CAA /* GameBeginTipView.swift */; }; |
| | | 1316A2302C05CE6100BE6CAA /* GameBeginTipView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1316A22F2C05CE6100BE6CAA /* GameBeginTipView.xib */; }; |
| | | 1319B0272C0818460052F889 /* HomeListenStory_1_VC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1319B0262C0818460052F889 /* HomeListenStory_1_VC.swift */; }; |
| | |
| | | 130278942BFD9FBF00DDCE81 /* AddressManageTCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddressManageTCell.swift; sourceTree = "<group>"; }; |
| | | 130278952BFD9FBF00DDCE81 /* GoodsItemTCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GoodsItemTCell.swift; sourceTree = "<group>"; }; |
| | | 130A2C7F2C07075B008463B2 /* ListenFight_Game_Pocket_CCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListenFight_Game_Pocket_CCell.swift; sourceTree = "<group>"; }; |
| | | 130E97752C329E2700205207 /* VIPCenterVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VIPCenterVC.swift; sourceTree = "<group>"; }; |
| | | 130E97762C329E2700205207 /* VIPCenterVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VIPCenterVC.xib; sourceTree = "<group>"; }; |
| | | 1316A22D2C05CE5900BE6CAA /* GameBeginTipView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameBeginTipView.swift; sourceTree = "<group>"; }; |
| | | 1316A22F2C05CE6100BE6CAA /* GameBeginTipView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GameBeginTipView.xib; sourceTree = "<group>"; }; |
| | | 1319B0262C0818460052F889 /* HomeListenStory_1_VC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeListenStory_1_VC.swift; sourceTree = "<group>"; }; |
| | |
| | | 130278842BFD9F2A00DDCE81 /* AddressManageHandleVC.swift */, |
| | | 130278852BFD9F2A00DDCE81 /* AddressManageHandleVC.xib */, |
| | | 130278862BFD9F2A00DDCE81 /* AddressManageVC.swift */, |
| | | 130E97752C329E2700205207 /* VIPCenterVC.swift */, |
| | | 130E97762C329E2700205207 /* VIPCenterVC.xib */, |
| | | ); |
| | | path = VC; |
| | | sourceTree = "<group>"; |
| | |
| | | 13EEB8A52BFF353C002996FC /* HomeListen_process_TCell.xib in Resources */, |
| | | 13A830FA2C043A0600BB2F23 /* Lesson_3_AnswerView.xib in Resources */, |
| | | 1302785D2BFD985E00DDCE81 /* CommonInputView.xib in Resources */, |
| | | 130E97772C329E2700205207 /* VIPCenterVC.xib in Resources */, |
| | | 1302787A2BFD9ED600DDCE81 /* ExchangeResultVC.xib in Resources */, |
| | | 130278362BFD957300DDCE81 /* Base in Resources */, |
| | | 13397D972C05EA9D003440F9 /* ListenFight_Game_CCell.xib in Resources */, |
| | |
| | | 1302782A2BFD957100DDCE81 /* AppDelegate.swift in Sources */, |
| | | 130278762BFD9ED600DDCE81 /* MarketCCell.swift in Sources */, |
| | | 1316A22E2C05CE5900BE6CAA /* GameBeginTipView.swift in Sources */, |
| | | 130E97782C329E2700205207 /* VIPCenterVC.swift in Sources */, |
| | | 13397D962C05EA9D003440F9 /* ListenFight_Game_CCell.swift in Sources */, |
| | | 13EEB8A42BFF353C002996FC /* HomeListen_process_TCell.swift in Sources */, |
| | | 130278782BFD9ED600DDCE81 /* MarketVC.swift in Sources */, |
| | |
| | | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { |
| | | // Override point for customization after application launch. |
| | | sleep(2) |
| | | if WXApi.isWXAppInstalled(){ |
| | | WXApi.registerApp(WeChatAPPID, universalLink: "https://dollearn/app/") |
| | | } |
| | | return true |
| | | } |
| | | |
| | |
| | | <dict> |
| | | <key>com.apple.developer.associated-domains</key> |
| | | <array> |
| | | <string>applinks:https://dollearn/app/</string> |
| | | <string>applinks:www.dollearn/app</string> |
| | | <string>webcredentials:www.dollearn/app</string> |
| | | </array> |
| | | </dict> |
| | | </plist> |
| | |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override var preferredStatusBarStyle: UIStatusBarStyle{ |
| | | return .darkContent |
| | | } |
| | | } |
| | |
| | | </connections> |
| | | </button> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="我已阅读并同意" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Npo-Be-a3K"> |
| | | <rect key="frame" x="462" y="372" width="86" height="14.5"/> |
| | | <rect key="frame" x="462" y="370" width="86" height="14.5"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Knm-yq-p47"> |
| | | <rect key="frame" x="553" y="365.5" width="62" height="27"/> |
| | | <rect key="frame" x="553" y="363.5" width="62" height="27"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="《隐私协议》"> |
| | |
| | | </connections> |
| | | </button> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G1I-su-UhY"> |
| | | <rect key="frame" x="625" y="365.5" width="62" height="27"/> |
| | | <rect key="frame" x="625" y="363.5" width="62" height="27"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" title="《用户协议》"> |
| | |
| | | </connections> |
| | | </button> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="X9q-qw-Sc1"> |
| | | <rect key="frame" x="432" y="486.5" width="316" height="47"/> |
| | | <rect key="frame" x="432" y="484.5" width="316" height="47"/> |
| | | <color key="backgroundColor" red="0.25490196079999999" green="0.63529411759999999" blue="0.92156862750000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="47" id="Fae-u5-7uD"/> |
| | |
| | | <constraint firstItem="zkX-mZ-xif" firstAttribute="top" secondItem="5aU-uW-fH7" secondAttribute="bottom" constant="17" id="Oa1-Da-W5X"/> |
| | | <constraint firstItem="5aU-uW-fH7" firstAttribute="top" secondItem="2PL-Tz-O9m" secondAttribute="bottom" constant="19" id="W1L-8z-2UP"/> |
| | | <constraint firstItem="2PL-Tz-O9m" firstAttribute="top" secondItem="rqd-Xo-f9G" secondAttribute="bottom" constant="64" id="XTa-78-dDJ"/> |
| | | <constraint firstItem="Npo-Be-a3K" firstAttribute="centerY" secondItem="zkX-mZ-xif" secondAttribute="centerY" id="duz-aL-bOk"/> |
| | | <constraint firstItem="Npo-Be-a3K" firstAttribute="centerY" secondItem="zkX-mZ-xif" secondAttribute="centerY" constant="-2" id="duz-aL-bOk"/> |
| | | <constraint firstItem="X9q-qw-Sc1" firstAttribute="leading" secondItem="2PL-Tz-O9m" secondAttribute="leading" id="eEa-iQ-ozX"/> |
| | | <constraint firstItem="Knm-yq-p47" firstAttribute="leading" secondItem="Npo-Be-a3K" secondAttribute="trailing" constant="5" id="eS2-b7-UQk"/> |
| | | <constraint firstItem="G1I-su-UhY" firstAttribute="leading" secondItem="Knm-yq-p47" secondAttribute="trailing" constant="10" id="gn2-Be-fVb"/> |
| | | <constraint firstItem="Knm-yq-p47" firstAttribute="centerY" secondItem="zkX-mZ-xif" secondAttribute="centerY" id="iba-cz-icy"/> |
| | | <constraint firstItem="Knm-yq-p47" firstAttribute="centerY" secondItem="zkX-mZ-xif" secondAttribute="centerY" constant="-2" id="iba-cz-icy"/> |
| | | <constraint firstItem="X9q-qw-Sc1" firstAttribute="top" secondItem="Knm-yq-p47" secondAttribute="bottom" constant="94" id="kEm-5T-0op"/> |
| | | <constraint firstItem="5aU-uW-fH7" firstAttribute="centerX" secondItem="fnl-2z-Ty3" secondAttribute="centerX" id="mMU-RV-beK"/> |
| | | <constraint firstItem="rqd-Xo-f9G" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="42" id="mp4-y4-ZCr"/> |
| | | <constraint firstItem="G1I-su-UhY" firstAttribute="centerY" secondItem="zkX-mZ-xif" secondAttribute="centerY" id="r29-ab-IDV"/> |
| | | <constraint firstItem="G1I-su-UhY" firstAttribute="centerY" secondItem="zkX-mZ-xif" secondAttribute="centerY" constant="-2" id="r29-ab-IDV"/> |
| | | </constraints> |
| | | <point key="canvasLocation" x="139.83050847457628" y="19.756097560975608"/> |
| | | </view> |
| | |
| | | |
| | | override func layoutSubviews() { |
| | | super.layoutSubviews() |
| | | image_awar.jq_addShadows(shadowColor: UIColor(hexStr: "#B9B9B9").withAlphaComponent(0.5), corner: 8, radius: 4, offset: CGSize(width: 0, height: 2), opacity: 1) |
| | | // image_awar.jq_addShadows(shadowColor: UIColor(hexStr: "#B9B9B9").withAlphaComponent(0.5), corner: 8, radius: 4, offset: CGSize(width: 0, height: 2), opacity: 1) |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func listenAction(_ sender: UIButton) { |
| | | let listenMenuVC = HomeListenMenuVC() |
| | | listenMenuVC.title = "第一年学习周目选择" |
| | | push(vc: listenMenuVC) |
| | | |
| | | Services.goodRecommend().subscribe(onNext: { data in |
| | | AwardListView.show(items: data.data ?? []) { _ in |
| | | let listenMenuVC = HomeListenMenuVC() |
| | | listenMenuVC.title = "第一年学习周目选择" |
| | | self.push(vc: listenMenuVC) |
| | | }closeClouse: { () in |
| | | let listenMenuVC = HomeListenMenuVC() |
| | | listenMenuVC.title = "第一年学习周目选择" |
| | | self.push(vc: listenMenuVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | </connections> |
| | | </button> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_success" translatesAutoresizingMaskIntoConstraints="NO" id="dMD-2P-QwE"> |
| | | <rect key="frame" x="49.5" y="74" width="56" height="56"/> |
| | | <rect key="frame" x="49.5" y="92" width="56" height="56"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="56" id="StM-MP-u9g"/> |
| | | <constraint firstAttribute="width" constant="56" id="Y6Z-pZ-azs"/> |
| | |
| | | <constraint firstItem="Mmn-Bf-5Vy" firstAttribute="top" secondItem="YTs-C9-W1k" secondAttribute="top" id="1Sn-gn-FxE"/> |
| | | <constraint firstItem="dMD-2P-QwE" firstAttribute="centerX" secondItem="qVZ-4r-nXX" secondAttribute="centerX" id="4uB-mE-grS"/> |
| | | <constraint firstAttribute="trailing" secondItem="Mmn-Bf-5Vy" secondAttribute="trailing" id="5Nt-bJ-JBK"/> |
| | | <constraint firstItem="dMD-2P-QwE" firstAttribute="centerY" secondItem="qVZ-4r-nXX" secondAttribute="centerY" id="Ker-Ja-SCC"/> |
| | | <constraint firstAttribute="trailing" secondItem="NUh-6J-pQi" secondAttribute="trailing" id="LIg-1l-i3u"/> |
| | | <constraint firstAttribute="trailing" secondItem="qVZ-4r-nXX" secondAttribute="trailing" id="PZ7-rB-ouR"/> |
| | | <constraint firstItem="dMD-2P-QwE" firstAttribute="centerX" secondItem="qVZ-4r-nXX" secondAttribute="centerX" id="Pzl-qF-UtV"/> |
| | | <constraint firstItem="Mmn-Bf-5Vy" firstAttribute="leading" secondItem="YTs-C9-W1k" secondAttribute="leading" id="bJw-qs-aXN"/> |
| | | <constraint firstItem="qVZ-4r-nXX" firstAttribute="top" secondItem="Mmn-Bf-5Vy" secondAttribute="bottom" id="grT-zb-2jJ"/> |
| | | <constraint firstItem="qVZ-4r-nXX" firstAttribute="leading" secondItem="YTs-C9-W1k" secondAttribute="leading" id="sxq-IC-gv7"/> |
| | | <constraint firstAttribute="bottom" secondItem="qVZ-4r-nXX" secondAttribute="bottom" id="vUB-b9-xLp"/> |
| | | <constraint firstAttribute="bottom" secondItem="NUh-6J-pQi" secondAttribute="bottom" id="vgf-mV-ruR"/> |
| | | <constraint firstItem="dMD-2P-QwE" firstAttribute="top" secondItem="Mmn-Bf-5Vy" secondAttribute="bottom" constant="34" id="yju-Cd-yGg"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | |
| | | contentVoiceView.jq_cornerRadius = 8 |
| | | voice_view.addSubview(contentVoiceView) |
| | | contentVoiceView.snp.makeConstraints { make in |
| | | make.left.equalTo(40) |
| | | make.right.equalTo(-40) |
| | | make.top.equalTo(55) |
| | | make.bottom.equalTo(-55) |
| | | // make.left.equalTo(40) |
| | | // make.right.equalTo(-40) |
| | | // make.top.equalTo(55) |
| | | // make.bottom.equalTo(-55) |
| | | make.center.equalToSuperview() |
| | | make.width.equalTo(self.width * 0.66) |
| | | make.height.equalTo(self.height * 0.32) |
| | | } |
| | | |
| | | contentVoiceView.addSubview(img1) |
| | | img1.snp.makeConstraints { make in |
| | | make.left.equalTo(23) |
| | | make.width.height.equalTo(32) |
| | | make.width.height.equalTo(self.width * 0.133) |
| | | make.centerY.equalToSuperview() |
| | | } |
| | | |
| | |
| | | var listenFightLine:ListenFightLine = .none |
| | | var data:Any? |
| | | |
| | | private var notiObject:Dictionary<String,Any>? |
| | | |
| | | private lazy var label_pageNum:UILabel = { |
| | | let label = UILabel() |
| | | label.font = .systemFont(ofSize: 14, weight: .medium) |
| | |
| | | case .lesson1,.lesson2,.lesson3,.lesson4,.lesson5: |
| | | weakSelf.studyComplete() |
| | | case .game1,.game2: |
| | | if let dict = noti.object as? Dictionary<String,Any>{ |
| | | weakSelf.gamesComplete(gameId: dict["gameId"] as! Int,integral: dict["gameIntegral"] as! Int) |
| | | weakSelf.notiObject = noti.object as? Dictionary<String,Any> |
| | | weakSelf.timer.invalidate() |
| | | |
| | | if let isComplete = weakSelf.notiObject?["complete"] as? Bool{ |
| | | if isComplete{ |
| | | weakSelf.btn_exit.setTitle("提交", for: .normal) |
| | | }else{ |
| | | weakSelf.gamesComplete(gameId: weakSelf.notiObject!["gameId"] as! Int,integral: weakSelf.notiObject!["gameIntegral"] as! Int) |
| | | } |
| | | } |
| | | case .story1,.story2: |
| | | if let dict = noti.object as? Dictionary<String,Any>{ |
| | |
| | | |
| | | Services.completeLearing(type: viewModel.listenType.value.rawValue, studyTime: viewModel.times, studyIds: ids, quarter: viewModel.quarter.value!, week: viewModel.week.value!, day: viewModel.day.value!, accracy: accracy).subscribe(onNext: {data in |
| | | NotificationCenter.default.post(name: Refresh_ListenSchedule_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudyCompleteCoinUpdate_Noti, object: data.data ?? 0) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | timer.invalidate() |
| | |
| | | }else{ |
| | | name = "超级记忆" |
| | | let v = viewModel.answerItems.first?.value as! Listen1Model |
| | | //11887:完成答题页,总题目、错误题目 数量计算逻辑错误(只要是没有答对的题目就算错误题目,不管是否答,相当于错误题目就是总题目减去正确题目) |
| | | totalNum = Double(v.photoList.count) |
| | | if totalNum > 0 && viewModel.correctNum > 0 && viewModel.errorNum > 0{ |
| | | accuracy = Int(Double(viewModel.correctNum) / Double(viewModel.correctNum + viewModel.errorNum) * 100) |
| | | accuracy = Int(Double(viewModel.correctNum) / Double(totalNum) * 100) |
| | | } |
| | | |
| | | viewModel.errorNum = Int(totalNum) - viewModel.correctNum |
| | | |
| | | toalIntegral = floor(Double(integral) * (Double(accuracy) / 100.0)).int |
| | | } |
| | | |
| | | Services.completeGames(gameId: gameId, gameName: name, difficulty: viewModel.gameLevel.value, accuracy: accuracy, useTime: viewModel.times).subscribe(onNext: {data in |
| | | NotificationCenter.default.post(name: Refresh_ListenSchedule_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudyCompleteCoinUpdate_Noti, object: data.data ?? 0) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | timer.invalidate() |
| | |
| | | timer.invalidate() |
| | | Services.completeStory(storyId: storyId, accuracy: accuracy, studyTime: studyTime, type: type).subscribe(onNext: {data in |
| | | NotificationCenter.default.post(name: Refresh_ListenSchedule_Noti, object: nil) |
| | | NotificationCenter.default.post(name: StudyCompleteCoinUpdate_Noti, object: data.data ?? 0) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | let vc = HomeStudyCompleteVC(totalCoin: integral,viewModel: viewModel,studyScheduleModel: studyScheduleModel!) |
| | |
| | | if viewModel.listenType.value == .story2{ |
| | | |
| | | if isPop{ |
| | | self.navigationController?.popViewController();return |
| | | CommonAlertView.show(content: "未完成全部答题,确认退出吗?") {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | for vc in weakSelf.navigationController?.viewControllers ?? []{ |
| | | if vc.isKind(of: HomeListenMenuVC.self){ |
| | | weakSelf.navigationController?.popToViewController(vc, animated: true);break |
| | | } |
| | | |
| | | if vc.isKind(of: HomeListenVC.self){ |
| | | weakSelf.navigationController?.popToViewController(vc, animated: true);break |
| | | } |
| | | } |
| | | } |
| | | return |
| | | } |
| | | |
| | | guard (pageVC.currentController as! HomeListenStory_2_VC).isPlayEnd else { |
| | |
| | | let accuracy = 100 |
| | | storyComplete(storyId: v.data!.id, accuracy: accuracy, studyTime: viewModel.times, type: viewModel.listenType.value == .story1 ? 1:2, integral: v.data!.integral) |
| | | } |
| | | }else{ |
| | | }else if btn_exit.titleLabel?.text == "提交"{ |
| | | if viewModel.listenType.value == .game1 || viewModel.listenType.value == .game2{ |
| | | if let dict = notiObject{ |
| | | gamesComplete(gameId: dict["gameId"] as! Int,integral: dict["gameIntegral"] as! Int) |
| | | } |
| | | } |
| | | } else{ |
| | | CommonAlertView.show(content: "未完成全部答题,确认退出吗?") {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | |
| | |
| | | } |
| | | |
| | | @objc func beforeAction(){ |
| | | |
| | | guard (pageVC.currentController as! HomeListenStory_2_VC).isPlayEnd else { |
| | | alert(msg: "请听完");return |
| | | } |
| | | |
| | | listenFightLine = .before |
| | | let beforePage = max(0, viewModel.currentPage.value - 1) |
| | | switch viewModel.listenType.value { |
| | |
| | | isListen = false |
| | | |
| | | viewModel.selectIndex.accept(indexPath) |
| | | guard playVoiceAt != nil else {return} |
| | | |
| | | let answer = listenNewModel.subjectList[page][playVoiceAt!] |
| | | let selectAnswer = listenNewModel.subjectList[page][indexPath.row] |
| | |
| | | |
| | | }() |
| | | |
| | | private let view_class_title = UIView() |
| | | |
| | | private lazy var label_hint:UILabel = { |
| | | let label = UILabel() |
| | | label.textColor = UIColor(hexStr: "#EE1111") |
| | |
| | | |
| | | private lazy var collectionView:UICollectionView = { |
| | | let flowLayout = UICollectionViewFlowLayout() |
| | | let w = (JQ_ScreenW - 35 * 2 - 12) / 4.0 |
| | | flowLayout.itemSize = CGSize(width: w, height: w * 0.73) |
| | | flowLayout.minimumInteritemSpacing = 3 |
| | | flowLayout.minimumLineSpacing = 13 |
| | | flowLayout.minimumLineSpacing = 3 |
| | | flowLayout.scrollDirection = .vertical |
| | | let collection = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) |
| | | collection.contentInset = UIEdgeInsets(top: 0, left: 35, bottom: 0, right: 35) |
| | |
| | | super.viewDidLoad() |
| | | |
| | | if listen1Model != nil{ |
| | | times = listen1Model?.data?.time ?? 10 |
| | | times = (listen1Model?.data?.time ?? 10) + 1 |
| | | collectionView.reloadData() |
| | | label_hint.isHidden = false |
| | | label_hint.text = "准备听题" |
| | |
| | | override func setUI() { |
| | | super.setUI() |
| | | |
| | | let view_class_title = UIView() |
| | | |
| | | view_class_title.jq_cornerRadius = 16 |
| | | view_class_title.backgroundColor = UIColor(hexStr: "#FBCF0F") |
| | | view.addSubview(view_class_title) |
| | |
| | | view.layoutIfNeeded() |
| | | } |
| | | |
| | | override func viewDidLayoutSubviews() { |
| | | super.viewDidLayoutSubviews() |
| | | if let res = Array<Any>.CalmulateCell(listen1Model.subjectList.count){ |
| | | let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout |
| | | let w = (JQ_ScreenW - (collectionView.contentInset.left * 2) - (CGFloat(res.0) - 1.0) * layout.minimumInteritemSpacing) / Double(res.0) |
| | | let h = (collectionView.frame.height - (layout.minimumLineSpacing * (Double(res.1) - 1.0))) / Double(res.1) |
| | | |
| | | if layout.itemSize != CGSize(width: w, height: h){ |
| | | layout.itemSize = CGSize(width: w, height: h) |
| | | collectionView.reloadData() |
| | | } |
| | | } |
| | | } |
| | | |
| | | func startTimer(){ |
| | | if timer == nil{ |
| | |
| | | answerSet.remove(c) |
| | | } |
| | | currentAnswer = answerSet.randomElement() //随机 |
| | | times = listen1Model?.data?.time ?? 0 |
| | | times = (listen1Model?.data?.time ?? 0) + 1 |
| | | timer?.fireDate = .distantPast |
| | | totalCount += 1 |
| | | rootViewModel.errorNum += 1 |
| | |
| | | } |
| | | switch answerType { |
| | | case .success: |
| | | timer?.fireDate = .distantFuture |
| | | viewModel.answerType.accept(.success) |
| | | collectionView.reloadData() |
| | | if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_ListenFight_Game_CCell", for: viewModel.selectIndex.value!) as? ListenFight_Game_CCell{ |
| | |
| | | } completion: { _ in |
| | | DispatchQueue.main.asyncAfter(deadline: .now()+0.5) { |
| | | self.voicePlayer.playerAt(url: self.currentAnswer?.correct) |
| | | self.timer?.fireDate = .distantFuture |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | collectionView.reloadData() |
| | | DispatchQueue.main.asyncAfter(deadline: .now()+3) { |
| | | self.times = self.listen1Model?.data?.time ?? 10 |
| | | self.times = (self.listen1Model?.data?.time ?? 10) + 1 |
| | | self.currentAnswer = self.answerSet.randomElement() |
| | | } |
| | | case .none: |
| | |
| | | |
| | | private func completeQuestion(){ |
| | | print("答题完成") |
| | | self.label_hint.text = "答题完成" |
| | | self.label_hint.text = "已完成全部答题" |
| | | self.label_hint.snp.makeConstraints { make in |
| | | make.centerX.equalToSuperview() |
| | | make.centerY.equalTo(view_class_title) |
| | | make.height.equalTo(20) |
| | | } |
| | | |
| | | view_class_title.isHidden = true |
| | | view_studyHandleView.isHidden = true |
| | | |
| | | self.timer?.invalidate() |
| | | self.rootViewModel.answerItems[0] = self.listen1Model |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: ["gameId":listen1Model.data!.id,"gameIntegral":listen1Model.data!.integral]) |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: ["gameId":listen1Model.data!.id,"gameIntegral":listen1Model.data!.integral,"complete":true]) |
| | | } |
| | | } |
| | | |
| | | extension HomeListenGame_1_VC:UICollectionViewDelegate{ |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = listen1Model!.subjectList[indexPath.row] |
| | | if answerSet.contains(model){ |
| | | // _ = listen1Model!.subjectList[indexPath.row] |
| | | viewModel.selectIndex.accept(indexPath) |
| | | answerQuestion() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | extension HomeListenGame_1_VC:VoicePlayerDelegate{ |
| | | func playComplete() { |
| | | view.isUserInteractionEnabled = true |
| | | |
| | | //防止再次播放时,误操作计算了正确率 |
| | | if viewModel.answerType.value == .none{ |
| | | view.isUserInteractionEnabled = true |
| | | } |
| | | |
| | | timer?.fireDate = .distantPast ////播放中,恢复计时 |
| | | |
| | | view_studyHandleView.resetView() |
| | | |
| | | self.label_hint.text = "准备听题" |
| | | |
| | | if viewModel.answerType.value == .success{ |
| | | self.label_hint.text = "准备请听下一题" |
| | | timer?.fireDate = .distantFuture |
| | | DispatchQueue.main.asyncAfter(deadline: .now()+3) { |
| | | self.times = self.listen1Model?.data?.time ?? 10 |
| | | self.times = (self.listen1Model?.data?.time ?? 10) + 1 |
| | | self.totalCount += 1 |
| | | self.rootViewModel.correctNum += 1 |
| | | self.label_class.text = "\(self.totalCount)" |
| | | self.answerSet.remove(self.currentAnswer!) |
| | | |
| | | if let currentA = self.currentAnswer{ |
| | | self.answerSet.remove(currentA) |
| | | } |
| | | |
| | | self.currentAnswer = self.answerSet.randomElement() |
| | | self.viewModel.answerType.accept(.none) |
| | | print("--->下一题:\(self.currentAnswer?.id ?? 0) 剩余\(self.answerSet.count) 计数:\(self.totalCount)") |
| | |
| | | func playing() { |
| | | view.isUserInteractionEnabled = false |
| | | view_studyHandleView.playing() |
| | | timer?.fireDate = .distantFuture //播放中,暂停计时 |
| | | label_hint.text = "播放中" |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private lazy var collectionView:UICollectionView = { |
| | | let flowLayout = UICollectionViewFlowLayout() |
| | | let w = (JQ_ScreenW - 40 * 2 - 50) / 5.0 |
| | | flowLayout.itemSize = CGSize(width: w, height: w * 0.675) |
| | | |
| | | flowLayout.minimumInteritemSpacing = 10 |
| | | flowLayout.minimumLineSpacing = 20 |
| | | flowLayout.minimumLineSpacing = 10 |
| | | flowLayout.scrollDirection = .vertical |
| | | let collection = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) |
| | | collection.contentInset = UIEdgeInsets(top: 101, left: 40, bottom: 0, right: 40) |
| | | collection.contentInset = UIEdgeInsets(top: 0, left: 40, bottom: 0, right: 40) |
| | | collection.register(ListenFight_Game_Pocket_CCell.self, forCellWithReuseIdentifier: "_ListenFight_Game_Pocket_CCell") |
| | | collection.isScrollEnabled = false |
| | | collection.masksToBounds = false |
| | | return collection |
| | | }() |
| | | |
| | |
| | | collectionView.backgroundColor = .clear |
| | | view.addSubview(collectionView) |
| | | collectionView.snp.makeConstraints { make in |
| | | make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top) |
| | | make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(101) |
| | | make.left.right.equalToSuperview() |
| | | make.bottom.equalToSuperview() |
| | | } |
| | |
| | | |
| | | @objc private func runloopTime(){ |
| | | times -= 1 |
| | | label_time.text = "\(max(1,times))s" |
| | | label_time.text = "\(times)s" |
| | | |
| | | if times == 0{ |
| | | timer?.fireDate = .distantFuture |
| | | DispatchQueue.main.asyncAfter(deadline: .now()+3) { |
| | | CommonAlertView.showSimple(content: "答题时间已结束,停止作答", completeTitle: "查看成绩") { |
| | | self.rootViewModel.answerItems[0] = self.listen1Model |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: ["gameId":self.listen1Model.data!.id,"gameIntegral":self.listen1Model.data!.answerIntegral]) |
| | | } |
| | | CommonAlertView.showSimple(content: "答题时间已结束,停止作答!", completeTitle: "查看成绩") { |
| | | self.rootViewModel.answerItems[0] = self.listen1Model |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: ["gameId":self.listen1Model.data!.id,"gameIntegral":self.listen1Model.data!.answerIntegral,"complete":false]) |
| | | } |
| | | } |
| | | } |
| | |
| | | firstM!.model.isOpen = true |
| | | lastM?.model.isOpen = true |
| | | selectModels.removeAll() |
| | | print("相同") |
| | | self.rootViewModel.insertCorrectAnswer(teamId: "\(listen1Model.data!.id)", answerId: firstM!.model.id) |
| | | viewModel.answerType.accept(.success) |
| | | rootViewModel.correctNum += 1 |
| | |
| | | } |
| | | |
| | | }else{ |
| | | print("不相同") |
| | | viewModel.answerType.accept(.fail) |
| | | rootViewModel.errorNum += 1 |
| | | let firstIndex = firstM!.indexPath |
| | |
| | | let surplusListCount = datas.filter({$0.isOpen == false}).count |
| | | if surplusListCount == 0{ |
| | | rootViewModel.answerItems[0] = self.listen1Model |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: ["gameId":listen1Model.data!.id,"gameIntegral":listen1Model.data!.answerIntegral]) |
| | | NotificationCenter.default.post(name: NextLession_Noti, object: ["gameId":listen1Model.data!.id,"gameIntegral":listen1Model.data!.answerIntegral,"complete":true]) |
| | | timer?.invalidate() |
| | | } |
| | | print("剩余:\(surplusListCount)") |
| | | } |
| | | |
| | | override func viewDidLayoutSubviews() { |
| | | super.viewDidLayoutSubviews() |
| | | let count = listen1Model.photoList.count + listen1Model.voiceList.count |
| | | if let res = Array<Any>.CalmulateCell(count){ |
| | | let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout |
| | | let w = (JQ_ScreenW - (collectionView.contentInset.left * 2) - (CGFloat(res.0) - 1.0) * layout.minimumInteritemSpacing) / Double(res.0) |
| | | let h = (collectionView.frame.height - (layout.minimumLineSpacing * (Double(res.1) - 1.0))) / Double(res.1) |
| | | |
| | | if layout.itemSize != CGSize(width: w, height: h){ |
| | | layout.itemSize = CGSize(width: w, height: h) |
| | | collectionView.reloadData() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension HomeListenGame_2_VC:UICollectionViewDelegate{ |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | getData() |
| | | Services.goodRecommend().subscribe(onNext: { data in |
| | | AwardListView.show(items: data.data ?? []) { _ in |
| | | |
| | | }closeClouse: { () in |
| | | |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | |
| | |
| | | UIView.animate(withDuration: 0.5) { |
| | | handleView.btn_state.alpha = 1 |
| | | } |
| | | |
| | | UIView.animate(withDuration: 0.5, delay: 3) { |
| | | handleView.btn_state.alpha = 0 |
| | | } |
| | | |
| | | weakSelf.voicePlayer.playerAt(url: handleView.vioceSoundUrl) |
| | | let copyView = handleView.copyView() |
| | | copyView.btn_choose.alpha = 0 |
| | | copyView.listenType = .lesson2 |
| | | copyView.resetView() |
| | | copyView.isplaying() |
| | | let newRect = handleView.convert(handleView.bounds, to: weakSelf.view) |
| | | weakSelf.view.addSubview(copyView) |
| | | copyView.snp.makeConstraints { make in |
| | |
| | | } |
| | | |
| | | let handleView = VoiceHandleView() |
| | | DispatchQueue.main.asyncAfter(wallDeadline: .now()+2){ |
| | | handleView.playUrl = self.listen1Model.storyList[self.page].correct |
| | | } |
| | | |
| | | handleView.playUrl = listen1Model.storyList[page].correct |
| | | handleView.snp.makeConstraints { make in |
| | | make.height.equalTo(52) |
| | | make.width.greaterThanOrEqualTo(221) |
| | | } |
| | | stackView.addArrangedSubview(handleView) |
| | | |
| | | DispatchQueue.main.asyncAfter(wallDeadline: .now()+2){ |
| | | handleView.playingAction() |
| | | } |
| | | } |
| | | |
| | | func restore(){ |
| | |
| | | extension HomeListenStory_2_VC:UICollectionViewDataSource{ |
| | | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_SimpleImageCCell", for: indexPath) as! SimpleImageCCell |
| | | let m = listen1Model.storyList[page] |
| | | let m = listen1Model.storyList[page] |
| | | cell.img_cover.sd_setImage(with: URL(string: m.img)) |
| | | cell.jq_cornerRadius = 10 |
| | | return cell |
| | |
| | | isPlayEnd = true |
| | | view.isUserInteractionEnabled = true |
| | | } |
| | | |
| | | |
| | | func playing() { |
| | | view.isUserInteractionEnabled = false |
| | | } |
| | |
| | | let fightVC = HomeListenFightVC(listenType: .game2,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.game2.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | |
| | | let fightVC = HomeListenFightVC(listenType: .story1,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.story1.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | |
| | | let fightVC = HomeListenFightVC(listenType: .story2,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.story2.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | |
| | | case 0: |
| | | cell.label_title.text = "自主学习1-听音选图" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | if (studyScheduleModel?.day ?? 0) > (page + 1){ |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.listen ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: studyScheduleModel?.listen ?? 0) |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | |
| | | case 1: |
| | | cell.label_title.text = "自主学习2-看图选音" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | if (studyScheduleModel?.day ?? 0) > (page + 1){ |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.look ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: studyScheduleModel?.look ?? 0) |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 2: |
| | | cell.label_title.text = "自主学习3-归纳排除" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#28C8C5") |
| | | if (studyScheduleModel?.day ?? 0) > (page + 1){ |
| | | |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.induction ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: studyScheduleModel?.induction ?? 0) |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 3: |
| | | cell.label_title.text = "自主学习4-有问有答" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#F8A169") |
| | | if (studyScheduleModel?.day ?? 0) > (page + 1){ |
| | | |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.answer ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: studyScheduleModel?.answer ?? 0) |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 4: |
| | | cell.label_title.text = "自主学习5-音图相配" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#92CADB") |
| | | if (studyScheduleModel?.day ?? 0) > (page + 1){ |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.pair ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: studyScheduleModel?.pair ?? 0) |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | default:break |
| | | } |
| | |
| | | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(Refresh_ListenSchedule_Noti).take(until: self.rx.deallocated).subscribe(onNext: {_ in |
| | | Services.studySchedule(week: self.week).subscribe(onNext: {data in |
| | | self.studyScheduleModel = data.data |
| | | NotificationCenter.default.rx.notification(Refresh_ListenSchedule_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] _ in |
| | | guard let weakSelf = self else { return } |
| | | Services.studySchedule(week: weakSelf.week).subscribe(onNext: {[weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.studyScheduleModel = data.data |
| | | |
| | | for subVC in self.pageVC.children as! [HomeListenSubVC]{ |
| | | subVC.studyScheduleModel = self.studyScheduleModel |
| | | for subVC in weakSelf.pageVC.children as! [HomeListenSubVC]{ |
| | | subVC.studyScheduleModel = weakSelf.studyScheduleModel |
| | | subVC.tableView.reloadData() |
| | | } |
| | | }).disposed(by: self.disposeBag) |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | |
| | | import UIKit |
| | | |
| | | let StudyCompleteNextLession_Noti = Notification.Name.init("StudyCompleteNextLession_Noti") |
| | | let StudyCompleteCoinUpdate_Noti = Notification.Name.init("StudyCompleteCoinUpdate_Noti") |
| | | |
| | | class HomeStudyCompleteVC: BaseVC { |
| | | @IBOutlet weak var label_coin: UILabel! |
| | |
| | | label_correctNum.text = "\(viewModel.correctNum)次" |
| | | label_errorNum.text = "\(viewModel.errorNum)次" |
| | | label_totalNum.text = "\(viewModel.correctNum + viewModel.errorNum)次" |
| | | label_ratioNum.text = String(format: "正确率:%.0lf%%", Double(viewModel.correctNum) / Double(viewModel.correctNum + viewModel.errorNum) * 100) |
| | | |
| | | if viewModel.correctNum + viewModel.errorNum == 0{ |
| | | label_ratioNum.text = String(format: "正确率:0%%") |
| | | }else{ |
| | | label_ratioNum.text = String(format: "正确率:%.0lf%%", Double(viewModel.correctNum) / Double(viewModel.correctNum + viewModel.errorNum) * 100) |
| | | } |
| | | |
| | | if totalNum != nil && viewModel.listenType.value == .game2{ |
| | | label_title_totalNum.text = "总题目:" |
| | |
| | | label_errorNum.text = "\(viewModel.errorNum)" |
| | | } |
| | | |
| | | |
| | | btn_next.isHidden = viewModel.listenType.value == .lesson5 |
| | | |
| | | switch viewModel.listenType.value{ |
| | | case .lesson5,.game1,.game2,.story1,.story2:btn_next.isHidden = true |
| | | default:btn_next.isHidden = false |
| | | } |
| | | |
| | | stackView.isHidden = viewModel.listenType.value == .story2 |
| | | label_ratioNum.isHidden = viewModel.listenType.value == .story2 |
| | |
| | | super.setUI() |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(StudyCompleteCoinUpdate_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | |
| | | if let coin = data.object as? Int{ |
| | | switch weakSelf.viewModel.listenType.value { |
| | | case .game2:weakSelf.label_coin.text = "恭喜您,已完成游戏!获得\(coin)积分!" |
| | | default:weakSelf.label_coin.text = "恭喜您,已完成全部答题!获得\(coin)积分!" |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func backHomeAction(_ sender: UIButton) { |
| | | backAction() |
| | | } |
| | |
| | | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { |
| | | |
| | | if collectionView == menu_collectView{ |
| | | return CGSize(width: 100, height: 41) |
| | | return CGSize(width: String.jq_getWidth(text: viewModel.menuTypes.value[indexPath.row].name, height: 41, font: 16) + 35, height: 41) |
| | | } |
| | | |
| | | return CGSize(width: cellW, height: cellW * 1.09) |
| | |
| | | @IBAction func exchangeAction(_ sender: UIButton) { |
| | | |
| | | |
| | | guard viewModel.detailModel.value?.residueNumber != 0 else { |
| | | CommonAlertView.show(isSinple: true, content: "兑换失败,当前剩余数量不足!") { |
| | | |
| | | } |
| | | return |
| | | } |
| | | |
| | | guard viewModel.detailModel.value?.good?.userCount != 0 else { |
| | | CommonAlertView.show(isSinple: true, content: "兑换失败,当前可换数量不足!") { |
| | | |
| | | } |
| | | return |
| | | } |
| | | // guard viewModel.detailModel.value?.residueNumber != 0 else { |
| | | // CommonAlertView.show(isSinple: true, content: "兑换失败,当前剩余数量不足!") { |
| | | // |
| | | // } |
| | | // return |
| | | // } |
| | | // |
| | | // guard viewModel.detailModel.value?.good?.userCount != 0 else { |
| | | // CommonAlertView.show(isSinple: true, content: "兑换失败,当前可换数量不足!") { |
| | | // |
| | | // } |
| | | // return |
| | | // } |
| | | |
| | | guard (viewModel.detailModel.value?.good?.integral ?? 0) < viewModel.surplusCoin.value else { |
| | | CommonAlertView.show(isSinple: true, content: "兑换失败,当前剩余积分不足!") { |
| | |
| | | return |
| | | } |
| | | |
| | | let vc = AddressManageVC(type: .handle) |
| | | let vc = AddressManageVC(type: .choose) |
| | | vc.title = "地址管理" |
| | | vc.chooseAddress {[weak self] m in |
| | | self?.label_address.text = m.address |
| | |
| | | } |
| | | |
| | | if isLast{ |
| | | contentView.jq_addCorners(corner: [.bottomLeft,.bottomLeft], radius: 10) |
| | | contentView.jq_addCorners(corner: [.bottomLeft,.bottomRight], radius: 10) |
| | | } |
| | | |
| | | if isFist && isLast{ |
| | |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | | <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="95" id="KGk-i7-Jjw" customClass="AddressManageTCell" customModule="DolphinEnglishLearnStudent" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="447" height="95"/> |
| | | <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="114" id="KGk-i7-Jjw" customClass="AddressManageTCell" customModule="DolphinEnglishLearnStudent" customModuleProvider="target"> |
| | | <rect key="frame" x="0.0" y="0.0" width="447" height="114"/> |
| | | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> |
| | | <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM"> |
| | | <rect key="frame" x="0.0" y="0.0" width="447" height="95"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="447" height="114"/> |
| | | <autoresizingMask key="autoresizingMask"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qjx-I2-glv"> |
| | | <rect key="frame" x="14" y="17" width="343" height="20"/> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="LabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qjx-I2-glv"> |
| | | <rect key="frame" x="14" y="17" width="343" height="50.5"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="pSh-9D-wSG"/> |
| | | <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="pSh-9D-wSG"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ezc-re-P3r"> |
| | | <rect key="frame" x="375" y="18.5" width="58" height="17"/> |
| | | <rect key="frame" x="375" y="34" width="58" height="17"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="17" id="0Kf-PA-7Or"/> |
| | | <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="42" id="4RT-3H-dH2"/> |
| | |
| | | </connections> |
| | | </button> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="-- | --" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g9x-qe-0Me"> |
| | | <rect key="frame" x="14" y="42" width="42" height="17"/> |
| | | <rect key="frame" x="14" y="72.5" width="42" height="17"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="17" id="04w-Er-l9A"/> |
| | | </constraints> |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sjj-oO-GNP"> |
| | | <rect key="frame" x="0.0" y="92" width="447" height="3"/> |
| | | <rect key="frame" x="0.0" y="111" width="447" height="3"/> |
| | | <color key="backgroundColor" red="0.8901960784313725" green="0.97254901960784312" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="3" id="oGW-Do-Mb7"/> |
| | | </constraints> |
| | | </view> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WFf-ch-GdK"> |
| | | <rect key="frame" x="417" y="65" width="22" height="22"/> |
| | | <rect key="frame" x="417" y="84" width="22" height="22"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="22" id="MYR-Gw-7HP"/> |
| | | </constraints> |
| | |
| | | </connections> |
| | | </button> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a8n-tE-gqa"> |
| | | <rect key="frame" x="387" y="65" width="22" height="22"/> |
| | | <rect key="frame" x="387" y="84" width="22" height="22"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="22" id="O11-LV-N1c"/> |
| | | </constraints> |
| | |
| | | </connections> |
| | | </button> |
| | | <imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_more_gray" translatesAutoresizingMaskIntoConstraints="NO" id="Qav-bf-Mlo"> |
| | | <rect key="frame" x="427" y="42.5" width="6" height="10"/> |
| | | <rect key="frame" x="427" y="52" width="6" height="10"/> |
| | | </imageView> |
| | | </subviews> |
| | | <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | |
| | | <constraint firstItem="Sjj-oO-GNP" firstAttribute="top" secondItem="WFf-ch-GdK" secondAttribute="bottom" constant="5" id="19d-dy-g3v"/> |
| | | <constraint firstAttribute="trailing" secondItem="ezc-re-P3r" secondAttribute="trailing" constant="14" id="3We-3h-tgl"/> |
| | | <constraint firstAttribute="trailing" secondItem="Qav-bf-Mlo" secondAttribute="trailing" constant="14" id="5CH-E8-JHk"/> |
| | | <constraint firstItem="Sjj-oO-GNP" firstAttribute="top" secondItem="g9x-qe-0Me" secondAttribute="bottom" constant="21.5" id="5Kz-HF-kaT"/> |
| | | <constraint firstItem="g9x-qe-0Me" firstAttribute="top" secondItem="Qjx-I2-glv" secondAttribute="bottom" constant="5" id="IXI-3H-V1L"/> |
| | | <constraint firstAttribute="bottom" secondItem="Sjj-oO-GNP" secondAttribute="bottom" id="Iij-PX-IvL"/> |
| | | <constraint firstItem="Sjj-oO-GNP" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="Jw5-AC-vFm"/> |
| | |
| | | <outlet property="label_address" destination="Qjx-I2-glv" id="iwX-fL-7LK"/> |
| | | <outlet property="label_addressInfo" destination="g9x-qe-0Me" id="cZT-hR-szg"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="202.29007633587784" y="49.647887323943664"/> |
| | | <point key="canvasLocation" x="201.58536585365854" y="54.406779661016955"/> |
| | | </tableViewCell> |
| | | </objects> |
| | | <resources> |
| | |
| | | |
| | | Services.updateOrderAddress(orderId: weakSelf.exchangeRecordModel!.orderId, recipientId: m.id).subscribe(onNext: {data in |
| | | alertSuccess(msg: "修改成功") |
| | | NotificationCenter.default.post(name: Refresh_MarketExchange_Noti, object: nil) |
| | | DispatchQueue.main.asyncAfter(delay: 1.8) { |
| | | NotificationCenter.default.post(name: Refresh_MarketExchange_Noti, object: nil) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } |
| | |
| | | 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) |
| | | DispatchQueue.main.asyncAfter(delay: 1.8) { |
| | | NotificationCenter.default.post(name: Refresh_MarketExchange_Noti, object: nil) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | default:break |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="vd5-iK-Ujb"> |
| | | <rect key="frame" x="173" y="95.5" width="609" height="70"/> |
| | | <rect key="frame" x="173" y="95.5" width="609" height="61"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="商品数量:-" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PlF-D7-xZD"> |
| | | <rect key="frame" x="0.0" y="0.0" width="609" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="ima-Vh-7Ak"/> |
| | | </constraints> |
| | | <rect key="frame" x="0.0" y="0.0" width="609" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/> |
| | | <color key="textColor" red="0.082352941176470587" green="0.086274509803921567" blue="0.094117647058823528" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收获信息:-" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qnF-SM-ngM"> |
| | | <rect key="frame" x="0.0" y="25" width="609" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="SzN-h8-eUd"/> |
| | | </constraints> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收获信息:-" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qnF-SM-ngM"> |
| | | <rect key="frame" x="0.0" y="22" width="609" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/> |
| | | <color key="textColor" red="0.08235294118" green="0.086274509799999996" blue="0.094117647060000004" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="发货信息:-" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cSS-lo-Yba"> |
| | | <rect key="frame" x="0.0" y="50" width="609" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="mDC-DF-Wc3"/> |
| | | </constraints> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="发货信息:-" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cSS-lo-Yba"> |
| | | <rect key="frame" x="0.0" y="44" width="609" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/> |
| | | <color key="textColor" red="0.08235294118" green="0.086274509799999996" blue="0.094117647060000004" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | </subviews> |
| | | </stackView> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xwt-lH-fyW"> |
| | | <rect key="frame" x="703" y="157" width="124" height="40"/> |
| | | <rect key="frame" x="703" y="209" width="124" height="40"/> |
| | | <color key="backgroundColor" red="0.25490196079999999" green="0.63529411759999999" blue="0.92156862750000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="124" id="3Ct-u1-c4s"/> |
| | |
| | | <constraint firstItem="vd5-iK-Ujb" firstAttribute="leading" secondItem="UdI-oe-WSO" secondAttribute="leading" id="CRk-D7-Sa0"/> |
| | | <constraint firstItem="9oA-7x-in6" firstAttribute="top" secondItem="EWl-m5-3O9" secondAttribute="top" constant="19" id="Kd6-sy-ai0"/> |
| | | <constraint firstAttribute="trailing" secondItem="nMG-SO-H2Z" secondAttribute="trailing" constant="11" id="NXe-Od-1mg"/> |
| | | <constraint firstAttribute="bottom" secondItem="HZS-Oe-5LR" secondAttribute="bottom" priority="250" constant="18" id="OY7-J0-JEH"/> |
| | | <constraint firstItem="UdI-oe-WSO" firstAttribute="top" secondItem="HZS-Oe-5LR" secondAttribute="top" id="ZyM-TK-6FN"/> |
| | | <constraint firstAttribute="trailing" secondItem="viA-yT-ZWk" secondAttribute="trailing" id="d0F-tv-fNn"/> |
| | | <constraint firstItem="viA-yT-ZWk" firstAttribute="top" secondItem="UdI-oe-WSO" secondAttribute="bottom" id="fFu-Xa-Vst"/> |
| | | <constraint firstAttribute="bottom" secondItem="xwt-lH-fyW" secondAttribute="bottom" constant="18" id="h2F-rW-tSx"/> |
| | | <constraint firstItem="vd5-iK-Ujb" firstAttribute="top" secondItem="viA-yT-ZWk" secondAttribute="bottom" constant="7" id="kmP-P0-Yhd"/> |
| | | <constraint firstAttribute="bottom" secondItem="vd5-iK-Ujb" secondAttribute="bottom" priority="250" constant="101.5" id="lGT-yn-Kw9"/> |
| | | <constraint firstItem="nMG-SO-H2Z" firstAttribute="centerY" secondItem="UdI-oe-WSO" secondAttribute="centerY" id="ne0-kd-EzF"/> |
| | | <constraint firstItem="HZS-Oe-5LR" firstAttribute="top" secondItem="9oA-7x-in6" secondAttribute="bottom" constant="13" id="nvs-xY-hiH"/> |
| | | <constraint firstItem="xwt-lH-fyW" firstAttribute="bottom" secondItem="HZS-Oe-5LR" secondAttribute="bottom" id="pao-1d-gzt"/> |
| | | <constraint firstItem="HZS-Oe-5LR" firstAttribute="leading" secondItem="EWl-m5-3O9" secondAttribute="leading" constant="8" id="u6c-56-glh"/> |
| | | <constraint firstAttribute="trailing" secondItem="vd5-iK-Ujb" secondAttribute="trailing" constant="56" id="ucU-JO-6dg"/> |
| | | <constraint firstAttribute="trailing" secondItem="UdI-oe-WSO" secondAttribute="trailing" constant="90" id="z0n-ib-Q7m"/> |
| | |
| | | cell.img_more.isHidden = addressManageType != .choose |
| | | cell.btn_default.isHidden = addressManageType == .choose |
| | | |
| | | cell.layoutSubviews() |
| | | |
| | | return cell |
| | | } |
| | | |
| | |
| | | return viewModel.dataSource.value.count |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | | return 78 |
| | | } |
| | | // func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | | // return 78 |
| | | // } |
| | | } |
| | |
| | | tableView.separatorStyle = .none |
| | | tableView.register(UINib(nibName: "GoodsItemTCell", bundle: nil), forCellReuseIdentifier: "_GoodsItemTCell") |
| | | view.addSubview(tableView) |
| | | tableView.snp.makeConstraints { make in |
| | | tableView.snp.makeConstraints {[weak self] make in |
| | | guard let weakSelf = self else { return } |
| | | make.left.equalTo(159 * Config.RatioW) |
| | | make.right.equalTo(-159 * Config.RatioW) |
| | | make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(27 * Config.RatioW) |
| | | make.bottom.equalTo(self.view.safeAreaLayoutGuide.snp.bottom).offset(-5) |
| | | make.top.equalTo(weakSelf.view.safeAreaLayoutGuide.snp.top).offset(27 * Config.RatioW) |
| | | make.bottom.equalTo(weakSelf.view.safeAreaLayoutGuide.snp.bottom).offset(-5) |
| | | } |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(Refresh_MarketExchange_Noti).take(until: self.rx.deallocated).subscribe(onNext: {_ in |
| | | self.viewModel.beginRefresh() |
| | | NotificationCenter.default.rx.notification(Refresh_MarketExchange_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] _ in |
| | | self?.viewModel.beginRefresh() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | return viewModel.dataSource.value.count |
| | | } |
| | | |
| | | // func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | | //// return 215 |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | // |
| | | // VIPCenterVC.swift |
| | | // DolphinEnglishLearnStudent |
| | | // |
| | | // Created by 无故事王国 on 2024/7/1. |
| | | // |
| | | |
| | | import UIKit |
| | | |
| | | class VIPCenterVC: BaseVC { |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | yy_popBlock = {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | var toVC:UIViewController? |
| | | for subVC in weakSelf.navigationController?.viewControllers ?? []{ |
| | | if subVC.isKind(of: HomeListenVC.self){ |
| | | toVC = subVC;break |
| | | } |
| | | } |
| | | |
| | | if toVC != nil{ |
| | | weakSelf.navigationController?.popToViewController(toVC!, animated: true) |
| | | }else{ |
| | | weakSelf.navigationController?.popViewController(animated: true) |
| | | } |
| | | } |
| | | } |
| | | |
| | | override func setUI() { |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <dependencies> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/> |
| | | <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VIPCenterVC" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | | </connections> |
| | | </placeholder> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> |
| | | <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> |
| | | <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> |
| | | <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> |
| | | </view> |
| | | </objects> |
| | | </document> |
| | |
| | | btn_close.addTarget(self, action: #selector(closeAction), for: .touchUpInside) |
| | | btn_close.snp.makeConstraints { make in |
| | | make.top.equalTo(10) |
| | | make.right.equalTo(-11) |
| | | make.right.equalTo(-65) |
| | | make.width.height.equalTo(23) |
| | | } |
| | | |
| | |
| | | |
| | | view_content.addSubview(btn_complete) |
| | | btn_complete.snp.makeConstraints { make in |
| | | make.bottom.equalToSuperview().offset(-UIDevice.jq_safeEdges.bottom) |
| | | make.bottom.equalToSuperview().offset(-17) |
| | | make.centerX.equalToSuperview() |
| | | make.width.equalTo(316) |
| | | make.height.equalTo(47) |
| | |
| | | commonAlertView.label_content.numberOfLines = 0 |
| | | commonAlertView.label_content.textAlignment = .center |
| | | commonAlertView.cancelClouse = cancelClouse |
| | | commonAlertView.btn_close.setTitle(completeTitle, for: .normal) |
| | | commonAlertView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | |
| | | commonAlertView.btn_complete.isHidden = true |
| | |
| | | } |
| | | } |
| | | |
| | | static func show(content:String,completeTitle:String? = nil,completeClouse:@escaping()->Void,cancelClouse:@escaping (()->Void)){ |
| | | 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.cancelClouse = cancelClouse |
| | | commonAlertView.btn_complete.setTitle(completeTitle, for: .normal) |
| | | commonAlertView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | |
| | | commonAlertView.clouse = completeClouse |
| | | |
| | | |
| | | |
| | | UIView.animate(withDuration: 0.4) { |
| | | commonAlertView.alpha = 1 |
| | | commonAlertView.view_container.transform = .init(translationX: 1.0, y: 1.0) |
| | | commonAlertView.layoutIfNeeded() |
| | | } |
| | | } |
| | | |
| | | @IBAction func closeAction(_ sender: UIButton) { |
| | | UIView.animate(withDuration: 0.4) { |
| | | self.alpha = 0 |
| | |
| | | } |
| | | } |
| | | |
| | | @IBAction func payAction(_ sender: UIButton) { |
| | | guard let v = vioceSoundUrl else {return} |
| | | voicePlayer.playerAt(url: v) |
| | | playAtClouse?(self.tag) |
| | | func isplaying(){ |
| | | switch listenType { |
| | | case .lesson1,.lesson5,.game1: |
| | | UIView.animate(withDuration: 0.25) { |
| | |
| | | } |
| | | } |
| | | |
| | | @IBAction func payAction(_ sender: UIButton) { |
| | | guard let v = vioceSoundUrl else {return} |
| | | voicePlayer.playerAt(url: v) |
| | | playAtClouse?(self.tag) |
| | | isplaying() |
| | | |
| | | } |
| | | |
| | | @IBAction func chooseAction(_ sender: UIButton) { |
| | | sender.isSelected = !sender.isSelected |
| | | clouse?(sender) |
| | |
| | | private func setUI(){ |
| | | backgroundColor = UIColor(hexString: "#41A2EB") |
| | | jq_cornerRadius = 8 |
| | | addSubview(img_hint) |
| | | img_hint.snp.makeConstraints { make in |
| | | make.left.equalTo(25) |
| | | make.centerY.equalToSuperview() |
| | | make.width.equalTo(27) |
| | | make.height.equalTo(27) |
| | | } |
| | | |
| | | addSubview(img_hint_playing) |
| | | addSubview(img_hint) |
| | | addSubview(btn_play) |
| | | |
| | | img_hint_playing.snp.makeConstraints { make in |
| | | make.center.equalToSuperview() |
| | | make.width.equalTo(45) |
| | | make.height.equalTo(31) |
| | | } |
| | | |
| | | addSubview(btn_play) |
| | | btn_play.isUserInteractionEnabled = false |
| | | btn_play.snp.makeConstraints { make in |
| | | make.right.equalTo(-23) |
| | | make.left.equalTo(img_hint_playing.snp.right).offset(0) |
| | | make.centerY.equalToSuperview() |
| | | make.width.equalTo(32) |
| | | make.height.equalTo(32) |
| | | } |
| | | |
| | | img_hint.snp.makeConstraints { make in |
| | | make.right.equalTo(img_hint_playing.snp.left).offset(0) |
| | | make.centerY.equalToSuperview() |
| | | make.width.equalTo(27) |
| | | make.height.equalTo(27) |
| | | } |
| | | |
| | | playBtn.addTarget(self, action: #selector(playingAction), for: .touchUpInside) |
| | | addSubview(playBtn) |
| | | playBtn.snp.makeConstraints { make in |
| | |
| | | window?.overrideUserInterfaceStyle = .light |
| | | } |
| | | |
| | | if WXApi.isWXAppInstalled(){ |
| | | WXApi.registerApp(WeChatAPPID, universalLink: "https://www.dollearn/app/") |
| | | } |
| | | |
| | | SVProgressHUD.setMaximumDismissTimeInterval(1.5) |
| | | SVProgressHUD.setDefaultMaskType(.custom) |
| | | |
| | |
| | | ob.onError(NetRequestError.Other(next.code,next.msg)) |
| | | case 502: //登录被冻结 |
| | | CommonAlertView.show(isSinple: true, content: next.msg) |
| | | case 501: |
| | | CommonAlertView.show(content: next.msg, completeTitle: "成为会员") { |
| | | let vc = VIPCenterVC() |
| | | vc.title = "会员中心" |
| | | JQ_currentNavigationController().pushViewController(vc) |
| | | |
| | | } cancelClouse: { |
| | | |
| | | } |
| | | case 401,505,600: |
| | | if !ignoreAlert{ |
| | | alertError(msg: "登录失效,请重新登录");ob.onError(NetRequestError.InvaildSession) |
| | |
| | | } |
| | | |
| | | /// 完成学习 |
| | | class func completeLearing(type:Int,studyTime:Int,studyIds:String,quarter:Int,week:Int,day:Int,accracy:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | class func completeLearing(type:Int,studyTime:Int,studyIds:String,quarter:Int,week:Int,day:Int,accracy:Int)->Observable<BaseResponse<Int>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/study/base/study/completeLearning") |
| | | .append(key: "type", value: type) |
| | |
| | | } |
| | | |
| | | /// 完成游戏 |
| | | class func completeGames(gameId:Int,gameName:String,difficulty:Int,accuracy:Int,useTime:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | class func completeGames(gameId:Int,gameName:String,difficulty:Int,accuracy:Int,useTime:Int)->Observable<BaseResponse<Int>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/study/base/study/gameAchievement") |
| | | .append(key: "gameId", value: gameId) |
| | |
| | | return NetworkRequest.request(params: params, method: .get, progress: true) |
| | | } |
| | | |
| | | class func completeStory(storyId:Int,accuracy:Int,studyTime:Int,type:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | class func completeStory(storyId:Int,accuracy:Int,studyTime:Int,type:Int)->Observable<BaseResponse<Int>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/study/base/study/completeStory") |
| | | params.append(key: "storyId", value: storyId) |
| | |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/study/base/study/exitGameOrStory") |
| | | .append(key: "studyTime", value: studyTime) |
| | | return NetworkRequest.request(params: params, method: .get,encoding: JSONEncoding.default, progress: false) |
| | | return NetworkRequest.request(params: params, method: .get, progress: false) |
| | | } |
| | | |
| | | class func updateOrderAddress(orderId:Int,recipientId:Int)->Observable<BaseResponse<SimpleModel>>{ |