XQMuse/Root/Course/CCell/CourseOfficialItemCCell.xib | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
XQMuse/Root/Home/HomeVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
XQMuse/Root/Home/VC/PaymentOrderVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
XQMuse/Root/Login/VC/UpdatePhoneVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
XQMuse/Root/Network/Services.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
XQMuse/Root/Plans/PlanGuideVC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
XQMuse/Root/Plans/PlanGuide_3_VC.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
XQMuse/SceneDelegate.swift | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
XQMuse/Root/Course/CCell/CourseOfficialItemCCell.xib
@@ -17,11 +17,11 @@ <rect key="frame" x="0.0" y="0.0" width="114" height="109"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="course_1" translatesAutoresizingMaskIntoConstraints="NO" id="D7q-iI-B0n"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="course_1" translatesAutoresizingMaskIntoConstraints="NO" id="D7q-iI-B0n"> <rect key="frame" x="39.666666666666664" y="29" width="34.999999999999993" height="31.666666666666671"/> <constraints> <constraint firstAttribute="width" relation="lessThanOrEqual" constant="35" id="A6U-Ns-BoS"/> <constraint firstAttribute="height" relation="lessThanOrEqual" constant="31.5" id="xu0-nX-9PR"/> <constraint firstAttribute="width" relation="lessThanOrEqual" constant="43" id="A6U-Ns-BoS"/> <constraint firstAttribute="height" relation="lessThanOrEqual" constant="50" id="xu0-nX-9PR"/> </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="eyG-jG-ONh"> XQMuse/Root/Home/HomeVC.swift
@@ -39,7 +39,7 @@ private var titleItems = [TitleItem]() private var viewModel = HomeViewModel() private var timer:Timer? private var needPopToTree:Bool = false //是否需要跳转到树苗 private var needPopToTree:Bool = false //是否需跳转到树苗 private var cellularData:CTCellularData! @@ -344,13 +344,14 @@ @objc func autoUpdate(){ guard !(viewModel.todyModel?.endPlayTime.isEmpty ?? true) else {return} guard let endPlayTime = viewModel.todyModel?.endPlayTime, !endPlayTime.isEmpty else { return } let todayEndDay = Date().jq_format("yyyy-MM-dd") + " \(viewModel.todyModel!.endPlayTime)" let todayEndDay = Date().jq_format("yyyy-MM-dd") + " \(endPlayTime)" let endDayInterval = Date.jq_StringToTimeInterval(todayEndDay,"yyyy-MM-dd HH:mm:ss") if Date().timeIntervalSince1970 > endDayInterval{ Services.getTopdayMedita().subscribe(onNext: { data in Services.getTopdayMedita().subscribe(onNext: { [weak self] data in guard let self = self else { return } self.viewModel.todyModel = data.data self.tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none) }).disposed(by: disposeBag) @@ -384,6 +385,15 @@ } } } deinit { // 使定时器失效 timer?.invalidate() // 移除通知中心观察者 NotificationCenter.default.removeObserver(self) } } extension HomeVC:UITableViewDelegate & UITableViewDataSource{ @@ -391,41 +401,45 @@ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if indexPath.section == 0{ if let m = viewModel.todyModel,let detailId = m.clientMeditationVO?.id{ if AudioPlayer.getSharedInstance().meditationModel?.id == m.meditationId{ if AudioPlayer.getSharedInstance().bgmPlayer?.timeControlStatus == .paused{ AudioPlayer.getSharedInstance().bgmPlayer?.play() AudioPlayer.getSharedInstance().masterPlayer?.play() PayMusicVC.updateStatus(.playing) self.viewModel.todyModel?.playAtMe = true }else{ AudioPlayer.getSharedInstance().bgmPlayer?.pause() AudioPlayer.getSharedInstance().masterPlayer?.pause() PayMusicVC.updateStatus(.pause) self.viewModel.todyModel?.playAtMe = false guard let m = viewModel.todyModel, let detailId = m.clientMeditationVO?.id else { alert(msg: "平台暂未设置今日疗愈") return } DispatchQueue.main.asyncAfter(delay: 0.4) { let audioPlayer = AudioPlayer.getSharedInstance() let isSameMeditation = audioPlayer.meditationModel?.id == m.meditationId let isPaused = audioPlayer.bgmPlayer?.timeControlStatus == .paused if isSameMeditation { if isPaused { audioPlayer.bgmPlayer?.play() audioPlayer.masterPlayer?.play() PayMusicVC.updateStatus(.playing) viewModel.todyModel?.playAtMe = true } else { audioPlayer.bgmPlayer?.pause() audioPlayer.masterPlayer?.pause() PayMusicVC.updateStatus(.pause) viewModel.todyModel?.playAtMe = false } DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) { self.tableView.reloadData() } }else{ //游客模式都能播放 Services.getMeditationDetail(id: detailId).subscribe(onNext: {[weak self]data in if let m = data.data{ guard let self = self, let m = data.data else { return } if AudioPlayer.getSharedInstance().meditationModel?.id == m.id && AudioPlayer.getSharedInstance().bgmPlayer?.timeControlStatus == .playing{ if audioPlayer.meditationModel?.id == m.id && audioPlayer.bgmPlayer?.timeControlStatus == .playing { return } AudioPlayer.getSharedInstance().playBGMAt(firstPlayIndex: 0, model: m, delegate: self) audioPlayer.playBGMAt(firstPlayIndex: 0, model: m, delegate: self) PayMusicVC.show(model: m,isHidden: false) self?.viewModel.todyModel?.playAtMe = true DispatchQueue.main.asyncAfter(delay: 1.0) { self?.tableView.reloadData() } self.viewModel.todyModel?.playAtMe = true DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { self.tableView.reloadData() } }).disposed(by: disposeBag) } }else{ alert(msg: "平台暂未设置今日疗愈") } } @@ -535,7 +549,6 @@ } return headerView } } XQMuse/Root/Home/VC/PaymentOrderVC.swift
@@ -172,7 +172,7 @@ alertError(msg: "请输入正确的手机号");return } Services.searchUserByPhone(tf_phone.text!).subscribe(onNext: { data in Services.searchUserByPhone(tf_phone.text!,ignoreAlert: false).subscribe(onNext: { data in self.view_searchUserResult.isHidden = false if let m = data.data,m.id != 0{ self.giftUserId = m.id @@ -229,6 +229,10 @@ if let m = museModel{ money = m.iosPrice id = m.id guard id != UserViewModel.getAvatarInfo().id else { alertError(msg: "不能赠送给自己");return } } guard btn_isRead.isSelected else { XQMuse/Root/Login/VC/UpdatePhoneVC.swift
@@ -119,11 +119,20 @@ } Services.confirmByApple(cellPhone: tf_phone.text!, captcha: tf_code.text!, loginType: threePlantformLoginType, wxOrAppleId: unionId,name: formatName, mail: credential!.email).subscribe(onNext: {data in Services.confirmByApple(cellPhone: tf_phone.text!, captcha: tf_code.text!, loginType: threePlantformLoginType, wxOrAppleId: unionId,name: formatName, mail: credential?.email).subscribe(onNext: {data in if var model = data.data{ if threePlantformLoginType == .apple{ model.loginByAppleToken = String(data: self.credential!.identityToken!, encoding: .utf8) model.accessToken = model.accessToken model.appleId = self.credential!.user } if threePlantformLoginType == .wechat{ model.wechatOpenId = unionId } model.accessToken = model.accessToken UserViewModel.saveLoginInfo(model) Services.getUserInfo().subscribe(onNext: {data in XQMuse/Root/Network/Services.swift
@@ -13,8 +13,8 @@ import CoreLocation #if DEBUG //let All_Url = "https://xq.xqzhihui.com/api" let All_Url = "http://192.168.110.64:9000" let All_Url = "https://xq.xqzhihui.com/api" //let All_Url = "http://192.168.110.64:9000" //let All_Url = "https://mock.apipost.net/mock/31b303c60464000" #else let All_Url = "https://xq.xqzhihui.com/api" @@ -416,12 +416,12 @@ ///用户相关 extension Services{ class func searchUserByPhone(_ phone:String)->Observable<BaseResponse<UserInfoModel>>{ class func searchUserByPhone(_ phone:String,ignoreAlert:Bool)->Observable<BaseResponse<UserInfoModel>>{ let params = ParamsAppender.build(url: All_Url) params.interface(url: "/user/client/app-user/getUserByPhone") .append(key: "phone", value: phone) .append(key: "apipost_id", value: "2e763463799135") return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: ignoreAlert) } /// 获取用户信息 @@ -499,11 +499,12 @@ return NetworkRequest.request(params: params, method: .get, progress: true) } class func saveUserAnswers(_ model:ResponseUserAnswerModel)->Observable<BaseResponse<SimpleModel>>{ class func saveUserAnswers(_ model:ResponseUserAnswerModel,device:String)->Observable<BaseResponse<SimpleModel>>{ let params = ParamsAppender.build(url: All_Url) params.interface(url: "/user/client/app-user/saveUserAnswers") .append(dic: model.toJSON()!) .append(key: "apipost_id", value: "25c3dab9f0e025") .append(key: "device", value: device) return NetworkRequest.request(params: params, method: .post,encoding: JSONEncoding(), progress: true) } XQMuse/Root/Plans/PlanGuideVC.swift
@@ -98,7 +98,7 @@ label_title.font = Def_FlyFlowerSong(fontSize: 35) label_title.textColor = .white label_subTitle.attributedText = AttributedStringbuilder.build().add(string: "亲爱的家人,温暖喜悦问候您\n我是心泉老师\n欢迎来到泉疗愈空间\n愿这一方空间为您带来\n平和 喜悦 放松 宁静", withFont: Def_SourceHanSerif_Regular(fontSize: 17), withColor: .white,lineSpace: 10).mutableAttributedString label_subTitle.attributedText = AttributedStringbuilder.build().add(string: "亲爱的家人,温暖喜悦问候您\n我是心泉老师\n欢迎来到泉疗愈空间\n愿这一方空间为您带来\n放松 平和 宁静 与喜悦", withFont: Def_SourceHanSerif_Regular(fontSize: 17), withColor: .white,lineSpace: 10).mutableAttributedString label_subTitle.textAlignment = .center XQMuse/Root/Plans/PlanGuide_3_VC.swift
@@ -70,10 +70,17 @@ @IBAction func nextAction(_ sender: UIButton) { responseUserAnswerModel.tagIds = selectModels.map({"\($0.id)"}).joined(separator: ",") Services.saveUserAnswers(responseUserAnswerModel).subscribe(onNext: { data in if UserViewModel.getLoginInfo()?.accessToken.isEmpty ?? true{ UserDefaults.standard.set(responseUserAnswerModel.toJSONString(), forKey: "saveUserAnswers") UserDefaults.standard.synchronize() NotificationCenter.default.post(name: PlantGuideQuit_Noti, object: true) }else{ Services.saveUserAnswers(responseUserAnswerModel, device: UserViewModel.DeviceUUID).subscribe(onNext: { data in NotificationCenter.default.post(name: PlantGuideQuit_Noti, object: true) }).disposed(by: disposeBag) } } @IBAction func previousAction(_ sender: UIButton) { NotificationCenter.default.post(name: AnswerAgain_Noti, object: nil) XQMuse/SceneDelegate.swift
@@ -87,6 +87,15 @@ func loginSuccess(){ NotificationCenter.default.post(name: LoginSuccess_Noti, object: nil) if let jsonString = UserDefaults.standard.value(forKey: "saveUserAnswers") as? String{ if let model = ResponseUserAnswerModel.deserialize(from: jsonString){ Services.saveUserAnswers(model, device: UserViewModel.DeviceUUID).subscribe(onNext: { data in UserDefaults.standard.set(nil, forKey: "saveUserAnswers") NotificationCenter.default.post(name: LoginSuccess_Noti, object: nil, userInfo: nil) }).disposed(by: JQ_disposeBag) } } } func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { @@ -114,6 +123,7 @@ Services.getUserInfo().subscribe(onNext: {data in if let model = data.data{ UserViewModel.saveAvatarInfo(model) sceneDelegate?.loginSuccess() } }).disposed(by: JQ_disposeBag) }else{