| | |
| | | GCC_PREFIX_HEADER = "Target Support Files/HandyJSON/HandyJSON-prefix.pch"; |
| | | INFOPLIST_FILE = "Target Support Files/HandyJSON/HandyJSON-Info.plist"; |
| | | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; |
| | | IPHONEOS_DEPLOYMENT_TARGET = 8.0; |
| | | IPHONEOS_DEPLOYMENT_TARGET = 10.0; |
| | | LD_RUNPATH_SEARCH_PATHS = ( |
| | | "$(inherited)", |
| | | "@executable_path/Frameworks", |
| | |
| | | PRODUCT_NAME = HandyJSON; |
| | | SDKROOT = iphoneos; |
| | | SKIP_INSTALL = YES; |
| | | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; |
| | | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; |
| | | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; |
| | | TARGETED_DEVICE_FAMILY = "1,2"; |
| | | VALIDATE_PRODUCT = YES; |
| | | VERSIONING_SYSTEM = "apple-generic"; |
| | |
| | | GCC_PREFIX_HEADER = "Target Support Files/HandyJSON/HandyJSON-prefix.pch"; |
| | | INFOPLIST_FILE = "Target Support Files/HandyJSON/HandyJSON-Info.plist"; |
| | | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; |
| | | IPHONEOS_DEPLOYMENT_TARGET = 8.0; |
| | | IPHONEOS_DEPLOYMENT_TARGET = 10.0; |
| | | LD_RUNPATH_SEARCH_PATHS = ( |
| | | "$(inherited)", |
| | | "@executable_path/Frameworks", |
| | |
| | | ENABLE_USER_SCRIPT_SANDBOXING = YES; |
| | | GCC_C_LANGUAGE_STANDARD = gnu17; |
| | | GCC_NO_COMMON_BLOCKS = YES; |
| | | GCC_OPTIMIZATION_LEVEL = 0; |
| | | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; |
| | | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; |
| | | GCC_WARN_UNDECLARED_SELECTOR = YES; |
| | |
| | | "$(inherited)", |
| | | "$(PROJECT_DIR)/XQMuse/Config/SDK", |
| | | ); |
| | | GCC_OPTIMIZATION_LEVEL = s; |
| | | GENERATE_INFOPLIST_FILE = YES; |
| | | INFOPLIST_FILE = XQMuse/Info.plist; |
| | | INFOPLIST_KEY_CFBundleDisplayName = "心泉冥想"; |
| | |
| | | "$(inherited)", |
| | | "$(PROJECT_DIR)/XQMuse/Config/SDK", |
| | | ); |
| | | GCC_OPTIMIZATION_LEVEL = s; |
| | | GENERATE_INFOPLIST_FILE = YES; |
| | | INFOPLIST_FILE = XQMuse/Info.plist; |
| | | INFOPLIST_KEY_CFBundleDisplayName = "心泉冥想"; |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "platform" : "ios", |
| | | "idiom" : "iphone", |
| | | "filename" : "icon-small.png", |
| | | "scale" : "1x", |
| | | "size" : "29x29" |
| | | }, |
| | | { |
| | | "idiom" : "iphone", |
| | | "scale" : "2x", |
| | | "filename" : "icon-small@2x.png", |
| | | "size" : "29x29" |
| | | }, |
| | | { |
| | | "scale" : "3x", |
| | | "idiom" : "iphone", |
| | | "filename" : "icon-small@3x.png", |
| | | "size" : "29x29" |
| | | }, |
| | | { |
| | | "scale" : "2x", |
| | | "idiom" : "iphone", |
| | | "size" : "40x40", |
| | | "filename" : "icon-40@2x.png" |
| | | }, |
| | | { |
| | | "size" : "40x40", |
| | | "idiom" : "iphone", |
| | | "filename" : "icon-40@3x.png", |
| | | "scale" : "3x" |
| | | }, |
| | | { |
| | | "scale" : "1x", |
| | | "size" : "57x57", |
| | | "filename" : "icon.png", |
| | | "idiom" : "iphone" |
| | | }, |
| | | { |
| | | "idiom" : "iphone", |
| | | "scale" : "2x", |
| | | "size" : "57x57", |
| | | "filename" : "icon@2x.png" |
| | | }, |
| | | { |
| | | "filename" : "icon-60@2x.png", |
| | | "idiom" : "iphone", |
| | | "scale" : "2x", |
| | | "size" : "60x60" |
| | | }, |
| | | { |
| | | "idiom" : "iphone", |
| | | "scale" : "3x", |
| | | "size" : "60x60", |
| | | "filename" : "icon-60@3x.png" |
| | | }, |
| | | { |
| | | "idiom" : "iphone", |
| | | "filename" : "notification-icon@2x.png", |
| | | "size" : "20x20", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "scale" : "3x", |
| | | "filename" : "notification-icon@3x.png", |
| | | "size" : "20x20", |
| | | "idiom" : "iphone" |
| | | }, |
| | | { |
| | | "scale" : "1x", |
| | | "idiom" : "ios-marketing", |
| | | "filename" : "ios-marketing.png", |
| | | "size" : "1024x1024" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | "version" : "4.1", |
| | | "author" : "AssetsGen" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @objc func shareAction(){ |
| | | // xqzhihui.com/courseOnline 线上课程详情 |
| | | // xqzhihui.com/courseOffOnline 线下课程详情 |
| | | ShareView.show(URL(string: "xqzhihui.com/courseOffOnline")!) |
| | | |
| | | |
| | | guard let m = courseDetailModel else{return} |
| | | |
| | | let path = courseDetailModel!.courseType == .offline ? "/courseDetail/offLine":"/courseDetail/onLine" |
| | | let string = String(format: "%@%@?courseId=%ld", ShareUrl,path,m.id) |
| | | ShareView.show(URL(string: string)!,title: m.courseTitle,desc: m.description) |
| | | } |
| | | |
| | | @objc func handleAction(_ btn:QMUIButton){ |
| | |
| | | super.awakeFromNib() |
| | | // Initialization code |
| | | jq_cornerRadius = 25 |
| | | view_price.jq_cornerRadius = 12.55 |
| | | } |
| | | |
| | | func setMeditationModel(_ model:MeditationModel){ |
| | |
| | | view_price.isHidden = true |
| | | img_vip.isHidden = true |
| | | return |
| | | } |
| | | |
| | | switch model.chargeType { |
| | | case .payment: |
| | | image_free.isHidden = true |
| | | view_price.isHidden = false |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "¥", withFont: UIFont(name: "DIN-Bold", size: 7.11) ?? UIFont.systemFont(ofSize: 7, weight: .bold), withColor: .white).add(string: "\(model.generalPrice.jq_formatFloat)", withFont: UIFont(name: "DIN-Bold", size: 11.44) ?? .systemFont(ofSize: 11,weight: .bold), withColor: .white).mutableAttributedString |
| | | default:break |
| | | }else{ |
| | | img_offine.isHidden = true |
| | | switch model.chargeType { |
| | | case .payment: |
| | | image_free.isHidden = true |
| | | view_price.isHidden = false |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "¥", withFont: UIFont(name: "DIN-Bold", size: 7.11) ?? UIFont.systemFont(ofSize: 7, weight: .bold), withColor: .white).add(string: "\(model.generalPrice.jq_formatFloat)", withFont: UIFont(name: "DIN-Bold", size: 11.44) ?? .systemFont(ofSize: 11,weight: .bold), withColor: .white).mutableAttributedString |
| | | default:break |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | func setMeditationModel(_ model:MeditationModel){ |
| | | img_cover.sd_setImage(with: URL(string: model.coverUrl)) |
| | | label_title.text = model.meditationTitle |
| | | label_subTitle.text = model.coverDescription |
| | | label_num.text = "\(model.realLearnedNum)" |
| | | |
| | | img_offline.isHidden = true |
| | | setChargePrice(model.chargeType, price: model.generalPrice) |
| | | } |
| | | |
| | | private func setChargePrice(_ type:ChargeType,price:Double){ |
| | | |
| | | image_free.isHidden = type != .free |
| | |
| | | Services.getMeditationAndCateList().subscribe(onNext: { data in |
| | | if let m = data.data{ |
| | | self.viewModel.meditationList.removeAll() |
| | | self.titleItems.removeAll() |
| | | self.titleItems.append(TitleItem(title: "每日疗愈", subTitle: "Daily Meditation")) |
| | | self.titleItems.append(TitleItem(title: "私人订制", subTitle: "Private Meditation",hasMore: true)) |
| | | self.titleItems.append(TitleItem(title: "新手冥想指南", subTitle: "Meditation guide")) |
| | | |
| | | |
| | | self.viewModel.meditationList = m |
| | | for v in self.viewModel.meditationList{ |
| | | if v.clientMeditationCategoryVO?.categoryName.isEmpty ?? true{continue} |
| | |
| | | } |
| | | |
| | | if m.chargeType == .payment && m.paidStatus == .no{ |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse,giftToOther: true) |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | return |
| | | } |
| | |
| | | let vc = VIPCenterVC() |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse,giftToOther: true) |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse) |
| | | JQ_currentViewController().jq_push(vc:vc) |
| | | } |
| | | } |
| | |
| | | |
| | | @objc func tapAction(_ btn:UIButton){ |
| | | let index = btn.tag - 1000 |
| | | let vc = HomeItemDetailVC(id: items[index].id) |
| | | |
| | | let vc = HomeItemListVC(topTitle: items[index].title, id: items[index].id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func timeAction(_ sender: UIButton) { |
| | | CountdownChooseListView.show {[weak self] times in |
| | | CountdownChooseListView.show {[weak self] status in |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.audioPlayer.setTimer(times: times * 60) |
| | | |
| | | switch status { |
| | | case .close: |
| | | weakSelf.audioPlayer.stopTimer() |
| | | case .choose(let times): |
| | | weakSelf.audioPlayer.setTimer(times: times * 60) |
| | | } |
| | | |
| | | |
| | | |
| | | // if times <= 0{ |
| | | // weakSelf.timer = nil |
| | |
| | | } |
| | | |
| | | @objc func shareAction(){ |
| | | ShareView.show(URL(string:"xqzhihui.com/meditation")!) |
| | | guard let m = model else {return} |
| | | |
| | | let string = String(format: "%@%@?id=%ld", ShareUrl,"/healDetail/healDetail",m.id) |
| | | ShareView.show(URL(string:string)!,title: m.meditationTitle,desc: m.detailDescription) |
| | | } |
| | | |
| | | override func viewDidLayoutSubviews() { |
| | |
| | | let vc = VIPCenterVC() |
| | | jq_push(vc: vc) |
| | | }else{ |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse,giftToOther: true) |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse) |
| | | jq_push(vc: vc) |
| | | } |
| | | } |
| | |
| | | |
| | | var collectionView:UICollectionView! |
| | | private let topView = PaymentOrderResultTopView.jq_loadNibView() |
| | | private var courseId:Int! |
| | | private var id:Int! |
| | | private var type:PaymentOrderVC.PaymentOrderType! |
| | | private var price:Double! |
| | | private var models = [CourseModel]() |
| | | private var models = [Any]() |
| | | |
| | | init(courseId:Int,price:Double) { |
| | | init(type:PaymentOrderVC.PaymentOrderType,id:Int,price:Double) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.courseId = courseId |
| | | self.id = id |
| | | self.type = type |
| | | self.price = price |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | topView.setPrice(courseId: courseId, price: price) |
| | | topView.setPrice(type: type, id: id, price: price) |
| | | |
| | | Services.paymentSuccess(courseId: courseId).subscribe(onNext: {data in |
| | | self.models = data.data ?? [] |
| | | self.collectionView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | if type == .course{ |
| | | Services.coursePaymentSuccess(courseId: id).subscribe(onNext: {data in |
| | | self.models = data.data ?? [] |
| | | self.collectionView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | if type == .muse{ |
| | | Services.musePaymentSuccess(meditationId: id).subscribe(onNext: {data in |
| | | self.models = data.data ?? [] |
| | | self.collectionView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = models[indexPath.row] |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | |
| | | switch type { |
| | | case .course: |
| | | let model = models[indexPath.row] as! CourseModel |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | case .muse: |
| | | let model = models[indexPath.row] as! MeditationModel |
| | | let vc = HomeItemDetailVC(id: model.id) |
| | | push(vc: vc) |
| | | case .none:break |
| | | } |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBanner_2_1_CCell", for: indexPath) as! HomeRelaxBanner_2_1_CCell |
| | | let model = models[indexPath.row] |
| | | cell.setCourseModel(model) |
| | | |
| | | if let m = model as? CourseModel{ |
| | | cell.setCourseModel(m) |
| | | } |
| | | |
| | | if let m = model as? MeditationModel{ |
| | | cell.setMeditationModel(m) |
| | | } |
| | | return cell |
| | | } |
| | | |
| | |
| | | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | | |
| | | guard let m = courseModel else {return} |
| | | |
| | | var money:Double = 0 |
| | | var id:Int = 0 |
| | | |
| | | if let m = courseModel{ |
| | | money = m.generalPrice |
| | | id = m.id |
| | | } |
| | | |
| | | if let m = museModel{ |
| | | money = m.generalPrice |
| | | id = m.id |
| | | } |
| | | |
| | | |
| | | guard btn_isRead.isSelected else { |
| | | alertError(msg: "请先阅读并同意《课程/疗愈音频购买协议》");return |
| | | } |
| | | |
| | | if giftToOther { |
| | | |
| | | guard !tf_phone.text!.isEmpty else { |
| | | alertError(msg: "请输入您要赠送人的手机号");return |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | guard balance > m.generalPrice else{ |
| | | guard balance > money else{ |
| | | CommonAlertView.show(title: "提示", content: "当前余额不足,请先充值", cancelStr: "暂不充值", completeStr: "去充值", isSingle: false) { state in |
| | | if state{ |
| | | |
| | |
| | | return |
| | | } |
| | | |
| | | let vc = PaymentOrderResultVC(courseId: id, price: m.generalPrice) |
| | | push(vc: vc) |
| | | Services.gvieCourse(orderForm: type, targetId: id,receiverId: giftUserId).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | let vc = PaymentOrderResultVC(type: weakSelf.type, id: id, price: money) |
| | | self?.push(vc: vc) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | |
| | | let vc = VIPCenterVC() |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse,giftToOther: true) |
| | | let vc = PaymentOrderVC(id: m.id,type: .muse) |
| | | JQ_currentViewController().jq_push(vc:vc) |
| | | } |
| | | } |
| | |
| | | |
| | | @IBOutlet weak var label_price: UILabel! |
| | | @IBOutlet weak var btn_lookCourse: UIButton! |
| | | private var courseId:Int! |
| | | private var id:Int! |
| | | private var type:PaymentOrderVC.PaymentOrderType! |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | } |
| | | |
| | | func setPrice(courseId:Int,price:Double){ |
| | | self.courseId = courseId |
| | | func setPrice(type:PaymentOrderVC.PaymentOrderType,id:Int,price:Double){ |
| | | self.id = id |
| | | self.type = type |
| | | label_price.text = "\(price.jq_formatFloat)" |
| | | |
| | | switch type { |
| | | case .course:btn_lookCourse.setTitle("查看课程", for: .normal) |
| | | case .muse:btn_lookCourse.setTitle("查看疗愈", for: .normal) |
| | | } |
| | | } |
| | | |
| | | @IBAction func backRootAction(_ sender: UIButton) { |
| | |
| | | } |
| | | |
| | | @IBAction func lookCourseAction(_ sender: UIButton) { |
| | | let vc = CourseDetialVC(courseId: courseId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | |
| | | if type == .course{ |
| | | let vc = CourseDetialVC(courseId: id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | |
| | | if type == .muse{ |
| | | let vc = HomeItemDetailVC(id: id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | if let model = data.data{ |
| | | sceneDelegate?.loginSuccess() |
| | | UserViewModel.saveAvatarInfo(model) |
| | | self.dismiss(animated: true) |
| | | } |
| | | }).disposed(by: self.disposeBag) |
| | | } |
| | |
| | | } |
| | | |
| | | @objc func rankAction(){ |
| | | let vc = WebVC() |
| | | let vc = WebVC(url: ShareUrl + "/ranking/ranking?userId=\(UserViewModel.getAvatarInfo().id)") |
| | | vc.title = "爱心榜单" |
| | | push(vc: vc) |
| | | } |
| | |
| | | @IBAction func shareAction(_ sender: QMUIButton) { |
| | | let vc = InviteVC() |
| | | push(vc: vc) |
| | | // ShareView.show(URL(string: "xqzhihui.com/commission")!) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func shareAction(_ sender: UIButton) { |
| | | ShareView.show("测试") |
| | | |
| | | let string = String(format: "%@%@?userId=%ld", ShareUrl,"/poster/poster",UserViewModel.getAvatarInfo().id) |
| | | ShareView.show(URL(string: string)!, title: "心泉疗愈", desc: "心泉疗愈1") |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | let m = viewModel.dataSource.value[indexPath.row] |
| | | if viewModel.state.value == 1{ |
| | | let vc = HomeItemDetailVC(id: m.businessId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | let vc = CourseDetialVC(courseId: m.businessId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialVC(courseId: m.businessId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | let vc = HomeItemDetailVC(id: m.businessId) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | |
| | | let All_Url = "http://192.168.110.64:9000" |
| | | //let All_Url = "https://mock.apipost.net/mock/31b303c60464000" |
| | | #else |
| | | let All_Url = "http://" //正式地址 |
| | | let All_Url = "http://192.168.110.64:9000" |
| | | #endif |
| | | |
| | | let ShareUrl = "http://113.45.158.158/share/#/pages" |
| | | |
| | | |
| | | class Services: NSObject { |
| | | |
| | |
| | | .append(key: "apipost_id", value: "2d2eb9d23993be") |
| | | return NetworkRequest.request(params: params, method: .get, progress: true) |
| | | } |
| | | |
| | | class func gvieCourse(orderForm:PaymentOrderVC.PaymentOrderType,targetId:Int,receiverId:Int? = nil)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/order/client/order/order/gvieCourse") |
| | | .append(key: "orderFrom", value: orderForm == .course ? 2:1) |
| | | .append(key: "payType", value: 2) |
| | | .append(key: "targetId", value: targetId) |
| | | .append(key: "receiverId", value: receiverId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | } |
| | | |
| | | /// 疗愈馆 |
| | |
| | | } |
| | | |
| | | /// 支付成功 |
| | | class func paymentSuccess(courseId:Int)->Observable<BaseResponse<[CourseModel]>>{ |
| | | class func coursePaymentSuccess(courseId:Int)->Observable<BaseResponse<[CourseModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/course/client/course/course/successOrder") |
| | | .append(key: "courseId", value: courseId) |
| | |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | /// 支付成功 |
| | | class func musePaymentSuccess(meditationId:Int)->Observable<BaseResponse<[MeditationModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/meditation/client/meditation/meditation/successOrder") |
| | | .append(key: "meditationId", value: meditationId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func getUserBalance()->Observable<BaseResponse<Double>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/user/client/app-user/getUserBalance") |
| | |
| | | @IBOutlet weak var cons_bottom: NSLayoutConstraint! |
| | | @IBOutlet weak var tf_input: UITextField! |
| | | private var disposeBag = DisposeBag() |
| | | private var clouse:((Int)->Void)? |
| | | private var clouse:((CountDownStatus)->Void)? |
| | | private var status:CountDownStatus = .close |
| | | |
| | | var numberMinutes = 1 |
| | |
| | | |
| | | } |
| | | |
| | | static func show(clouse:@escaping (Int)->Void){ |
| | | static func show(clouse:@escaping (CountDownStatus)->Void){ |
| | | let countdownChooseListView = CountdownChooseListView.jq_loadNibView() |
| | | countdownChooseListView.clouse = clouse |
| | | countdownChooseListView.frame = sceneDelegate?.window?.frame ?? .zero |
| | |
| | | endEditing(true) |
| | | |
| | | if case .choose(let v) = status { |
| | | clouse?(v) |
| | | clouse?(status) |
| | | } |
| | | |
| | | cons_bottom.constant = -JQ_ScreenH |
| | |
| | | |
| | | @IBAction func clickAction(_ sender: TapBtn) { |
| | | endEditing(true) |
| | | |
| | | |
| | | for subView in stackView.arrangedSubviews as! [TapBtn]{ |
| | | if subView.tag == sender.tag{ |
| | | for v in subView.subviews{ |
| | | if let label = v as? UILabel{ |
| | | label.textColor = UIColor(hexString: "#8AAE65") |
| | | |
| | | switch label.text { |
| | | case "关闭倒计时": |
| | | numberMinutes = -1 |
| | | status = .close |
| | | case "自定义","分钟": |
| | | numberMinutes = self.tf_input.text!.int ?? 1 |
| | | status = .choose(numberMinutes) |
| | | default: |
| | | numberMinutes = label.text?.jq_filterNum().int ?? 0 |
| | | self.tf_input.text = numberMinutes.string |
| | | status = .choose(numberMinutes) |
| | | } |
| | | } |
| | | var text:String? |
| | | for v in subView.subviews{ |
| | | if let label = v as? UILabel{ |
| | | label.textColor = UIColor(hexString: "#8AAE65") |
| | | text = label.text |
| | | break |
| | | } |
| | | } |
| | | |
| | | if let image = v as? UIImageView{ |
| | | image.image = UIImage(named: "icon_choose_small_s") |
| | | } |
| | | } |
| | | for v in subView.subviews{ |
| | | if let image = v as? UIImageView{ |
| | | image.image = UIImage(named: "icon_choose_small_s") |
| | | break |
| | | } |
| | | } |
| | | |
| | | |
| | | switch text! { |
| | | case "关闭倒计时": |
| | | numberMinutes = -1 |
| | | status = .close |
| | | case "自定义": |
| | | numberMinutes = self.tf_input.text!.int ?? 1 |
| | | status = .choose(numberMinutes) |
| | | default: |
| | | numberMinutes = text!.jq_filterNum().int ?? 0 |
| | | tf_input.text = numberMinutes.string |
| | | status = .choose(numberMinutes) |
| | | } |
| | | }else{ |
| | | for v in subView.subviews{ |
| | | if let label = v as? UILabel{ |
| | |
| | | @IBOutlet weak var btn_save: TapBtn! |
| | | private var shareContent:Any! |
| | | private var scene:WXScene! |
| | | private var title:String! |
| | | private var desc:String! |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | |
| | | btn_save.isHidden = true |
| | | } |
| | | |
| | | static func show(_ content:Any){ |
| | | static func show(_ content:Any,title:String,desc:String){ |
| | | let shareView = ShareView.jq_loadNibView() |
| | | shareView.shareContent = content |
| | | shareView.title = title |
| | | shareView.desc = desc |
| | | sceneDelegate?.window?.addSubview(shareView) |
| | | shareView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | shareView.cons_bottom.constant = 0 |
| | |
| | | } |
| | | |
| | | if let url = shareContent as? URL{ |
| | | WeChatTools.shareUrl(url.absoluteString, title: "疗愈", desc: "测", thumb:UIImage()) |
| | | WeChatTools.shareUrl(url.absoluteString, title: title, desc: desc, thumb:UIImage()) |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | masterPlayer.playBGMAt(firstPlayIndex: 0, model: MeditationModel(backgroundUrl:backgroundVoiceUrl), delegate: self) |
| | | |
| | | let tempModel = MeditationModel() |
| | | masterPlayer.playSceneAt(backgroundVoiceUrl) |
| | | } |
| | | |
| | | override func viewWillAppear(_ animated: Bool) { |
| | |
| | | |
| | | func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { |
| | | |
| | | if URLContexts.first?.url.scheme == WeChatAPPID,let code = URLContexts.first?.url.jq_params?["code"]{ |
| | | DispatchQueue.main.async { |
| | | hiddenHUD() |
| | | let resp = SendAuthResp() |
| | | resp.code = code |
| | | WeChatTools.getAccessToken(resp) { model in |
| | | if let m = model{ |
| | | WeChatTools.getUserInfo(access_token: m.access_token, openId: m.openid) { userInfoModel in |
| | | if let u = userInfoModel{ |
| | | Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid).subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | sceneDelegate?.loginSuccess() |
| | | JQ_currentViewController().dismiss(animated:true) |
| | | UserViewModel.saveLoginInfo(model) |
| | | if URLContexts.first?.url.scheme == WeChatAPPID{ |
| | | |
| | | Services.getUserInfo().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | }else{ |
| | | alertError(msg: "获取信息失败") |
| | | if let code = URLContexts.first?.url.jq_params?["code"]{ |
| | | DispatchQueue.main.async { |
| | | hiddenHUD() |
| | | let resp = SendAuthResp() |
| | | resp.code = code |
| | | WeChatTools.getAccessToken(resp) { model in |
| | | if let m = model{ |
| | | WeChatTools.getUserInfo(access_token: m.access_token, openId: m.openid) { userInfoModel in |
| | | if let u = userInfoModel{ |
| | | Services.loginByWechat(headImgUrl: u.headimgurl, nickname: u.nickname, sex: u.sex, wxOpenId: u.openid).subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | sceneDelegate?.loginSuccess() |
| | | JQ_currentViewController().dismiss(animated:true) |
| | | UserViewModel.saveLoginInfo(model) |
| | | |
| | | Services.getUserInfo().subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | } |
| | | }).disposed(by: JQ_disposeBag) |
| | | }else{ |
| | | alertError(msg: "获取信息失败") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | WXApi.handleOpen(URLContexts.first!.url, delegate: self) |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |