New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "bt_private @2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "bt_private @3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launchScreen" translatesAutoresizingMaskIntoConstraints="NO" id="MTa-Il-dP2"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="备案号:1231231231123" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zWJ-TH-NSU"> |
| | | <rect key="frame" x="106.00000000000001" y="793.66666666666663" width="181.33333333333337" height="19.333333333333371"/> |
| | | <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="zWJ-TH-NSU" secondAttribute="bottom" constant="5" id="6gC-B5-qpe"/> |
| | | <constraint firstItem="MTa-Il-dP2" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="6qP-PH-xn1"/> |
| | | <constraint firstAttribute="bottom" secondItem="MTa-Il-dP2" secondAttribute="bottom" id="8PC-Kf-lOK"/> |
| | | <constraint firstItem="zWJ-TH-NSU" firstAttribute="centerX" secondItem="MTa-Il-dP2" secondAttribute="centerX" id="aEe-8n-eho"/> |
| | | <constraint firstItem="MTa-Il-dP2" firstAttribute="trailing" secondItem="6Tk-OE-BBY" secondAttribute="trailing" id="cbw-XJ-Oln"/> |
| | | <constraint firstItem="MTa-Il-dP2" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="gMR-H3-3Yf"/> |
| | | </constraints> |
| | |
| | | switch self { |
| | | case .man:return "男" |
| | | case .woman:return "女" |
| | | case .encrypt:return "" |
| | | case .encrypt:return "保密" |
| | | } |
| | | } |
| | | |
| | |
| | | @discardableResult |
| | | static func replaceLaunchImage(_ replacementImage: UIImage?) -> Bool { |
| | | guard let image = replacementImage else {return false} |
| | | return self.replaceLaunchImage(replacementImage: image, compressionQuality: 0.8, customValidation: nil) |
| | | return self.replaceLaunchImage(replacementImage: image, compressionQuality: 1.0, customValidation: nil) |
| | | } |
| | | |
| | | @discardableResult |
| | |
| | | <autoresizingMask key="autoresizingMask"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课程介绍" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lg9-70-w3n"> |
| | | <rect key="frame" x="21.666666666666668" y="5" width="59.666666666666657" height="20"/> |
| | | <rect key="frame" x="21.666666666666668" y="10" width="59.666666666666657" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="8dQ-Gi-hJh"/> |
| | | </constraints> |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WYV-JQ-E3S"> |
| | | <rect key="frame" x="21.666666666666657" y="44.666666666666657" width="458" height="280.33333333333337"/> |
| | | <rect key="frame" x="21.666666666666657" y="49.666666666666657" width="458" height="275.33333333333337"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="hfa-qQ-TpS"/> |
| | | <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="10" id="hfa-qQ-TpS"/> |
| | | </constraints> |
| | | <wkWebViewConfiguration key="configuration"> |
| | | <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/> |
| | |
| | | </wkWebView> |
| | | </subviews> |
| | | <constraints> |
| | | <constraint firstItem="Lg9-70-w3n" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="4D5-on-wj2"/> |
| | | <constraint firstItem="Lg9-70-w3n" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="4D5-on-wj2"/> |
| | | <constraint firstItem="WYV-JQ-E3S" firstAttribute="top" secondItem="Lg9-70-w3n" secondAttribute="bottom" constant="19.5" id="Ar0-7c-kQM"/> |
| | | <constraint firstItem="Lg9-70-w3n" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="21.5" id="dJv-7a-n9J"/> |
| | | <constraint firstItem="WYV-JQ-E3S" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="21.5" id="m6n-62-uuK"/> |
| | |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | guard sceneDelegate!.checkisLoginState() else{return} |
| | | let vc = PaymentOrderVC(courseItemModel: m,type: .course,giftToOther: true,showType: .horizontal) |
| | | let vc = PaymentOrderVC(courseItemModel: m,type: .course,giftToOther: false,showType: .horizontal) |
| | | JQ_currentViewController().jq_push(vc:vc) |
| | | } |
| | | } |
| | |
| | | weakSelf.img_cusomter.sd_setImage(with: URL(string: m.wxQrCode.jq_urlEncoded())) |
| | | |
| | | if m.detailUrl.jq_isVideo{ |
| | | weakSelf.videoView = VideoView(url: m.detailUrl.jq_urlEncoded(),autoPlay: false,needFirstImage: true, delegate: self!) |
| | | // weakSelf.videoView!.player.play() |
| | | weakSelf.videoView = VideoView(url: m.detailUrl.jq_urlEncoded(),autoPlay: true,needFirstImage: true, delegate: self!) |
| | | weakSelf.view_video.isHidden = false |
| | | weakSelf.view_video.addSubview(weakSelf.videoView!) |
| | | weakSelf.videoView!.snp.makeConstraints { make in |
| | |
| | | pageMenu.trackerWidth = 27.5 |
| | | pageMenu.setTrackerHeight(11, cornerRadius:0) |
| | | pageMenu.trackerFollowingMode = .always |
| | | pageMenu.contentInset = UIEdgeInsets(top: 0, left: 19.5, bottom: 15, right: 19.5) |
| | | pageMenu.contentInset = UIEdgeInsets(top: 0, left: 10.5, bottom: 15, right: 19.5) |
| | | pageMenu.setItems(["简介","章节","相关推荐"], selectedItemIndex: 0) |
| | | pageMenu.backgroundColor = UIColor(hexString: "#F6F6F6") |
| | | pageMenu.tracker.image = UIImage(named: "icon_unline") |
| | |
| | | tableView!.delegate = self |
| | | tableView!.dataSource = self |
| | | tableView!.showsVerticalScrollIndicator = false |
| | | if #available(iOS 15.0, *) { |
| | | if #available(iOS 16.0, *) { |
| | | tableView!.sectionHeaderTopPadding = 0 |
| | | } |
| | | tableView!.backgroundColor = UIColor(hexString: "#f6f6f6") |
| | |
| | | make.height.equalTo(84) |
| | | } |
| | | |
| | | if courseDetailModel?.chargeType == .payment{ |
| | | if courseDetailModel?.chargeType == .payment || courseDetailModel?.chargeType == .free{ |
| | | let giftBtn = QMUIButton(type: .custom) |
| | | giftBtn.imagePosition = .left |
| | | giftBtn.spacingBetweenImageAndTitle = 7.5 |
| | |
| | | @objc func handleAction(_ btn:QMUIButton){ |
| | | |
| | | if let m = courseDetailModel{ |
| | | if m.chargeType == .free || (m.chargeType == .vipFree && UserViewModel.getAvatarInfo().checkVip()) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | guard m.list.count != 0 else { |
| | | alertError(msg: "该课程暂未添加章节");return |
| | | } |
| | | let vc = CourseDetialVideoVC(items: m.list, selectIndex: IndexPath(row: 0, section: 0)) |
| | | push(vc: vc);return |
| | | } |
| | | guard m.list.count > 0 else {alert(msg: "当前课程未配置章节");return} |
| | | |
| | | let vc = PaymentOrderVC(courseItemModel: m, type: .course,showType:.horizontal) |
| | | if m.chargeType == .free || (m.chargeType == .vipFree && m.isVip == .yes) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | let vc = CourseDetialVideoVC(items: m.list, selectIndex: IndexPath(row: 0, section: 0)) |
| | | push(vc: vc) |
| | | }else{ |
| | | let vc = PaymentOrderVC(courseItemModel: m, type: .course, giftToOther: false, showType: .horizontal) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | let item = items[selectIndex.row] |
| | | |
| | | guard secondLook > 0 else {return} |
| | | |
| | | if !isOver{ |
| | | Services.watchClouse(chapterId: item.id, isOver: isOver, secondLook: secondLook).subscribe(onNext: { _ in |
| | | |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "课程详情" |
| | | |
| | | videoView = VideoView(url: items[selectIndex.row].videoUrl.jq_urlEncoded(),delegate: self) |
| | | videoView?.player.play() |
| | | videoView = VideoView(url: items[selectIndex.row].videoUrl.jq_urlEncoded(),autoPlay: true,delegate: self) |
| | | view_bg_video.addSubview(videoView!) |
| | | videoView!.snp.makeConstraints { make in |
| | | make.edges.equalToSuperview() |
| | |
| | | func didPlayToEnd(in player: CLPlayer) { |
| | | isOver = true |
| | | print("视频播放进度:【完成】") |
| | | items[selectIndex.row].isOver = .yes |
| | | Services.watchClouse(chapterId: items[selectIndex.row].id, isOver: true, secondLook: items[selectIndex.row].duration).subscribe(onNext: { _ in |
| | | |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | override func layoutSubviews() { |
| | | super.layoutSubviews() |
| | | btn_known.localGradientColor(cornerRadius: 20) |
| | | btn_known.localGradientColor(cornerRadius: 20,bounds: CGRect(x: 0, y: 0, width: JQ_ScreenW - 62 * 2, height: 40)) |
| | | } |
| | | |
| | | |
| | |
| | | image_free.isHidden = true |
| | | } |
| | | |
| | | |
| | | if model.paymentStatus == .yes{ |
| | | label_waitPrice.attributedText = AttributedStringbuilder.build().add(string: "待支付|", withFont: .systemFont(ofSize: 10), withColor: .white).add(string: "¥", withFont: UIFont(name: "DIN-Bold", size: 7.11) ?? UIFont.systemFont(ofSize: 7, weight: .bold), withColor: .white).add(string: model.iosPrice.jq_formatFloat, withFont: UIFont(name: "DIN-Bold", size: 11.62) ?? UIFont.systemFont(ofSize: 11.62, weight: .bold), withColor: .white).mutableAttributedString |
| | | } |
| | | |
| | | |
| | | view_waitPay.isHidden = model.paymentStatus == .no |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "¥", withFont: .systemFont(ofSize: 7.2, weight: .bold), withColor: .white).add(string: model.generalPrice.jq_formatFloat, withFont: .systemFont(ofSize: 11), withColor: .white).mutableAttributedString |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "¥", withFont: .systemFont(ofSize: 7.2, weight: .bold), withColor: .white).add(string: model.iosPrice.jq_formatFloat, withFont: .systemFont(ofSize: 11), withColor: .white).mutableAttributedString |
| | | } |
| | | |
| | | func setMeditationModel(_ model:MeditationModel){ |
| | |
| | | setChargePrice(model.chargeType, price: model.iosPrice) |
| | | |
| | | view_waitPay.isHidden = model.paymentStatus == .no |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "¥", withFont: .systemFont(ofSize: 7.2, weight: .bold), withColor: .white).add(string: model.generalPrice.jq_formatFloat, withFont: .systemFont(ofSize: 11), withColor: .white).mutableAttributedString |
| | | label_price.attributedText = AttributedStringbuilder.build().add(string: "¥", withFont: .systemFont(ofSize: 7.2, weight: .bold), withColor: .white).add(string: model.iosPrice.jq_formatFloat, withFont: .systemFont(ofSize: 11), withColor: .white).mutableAttributedString |
| | | } |
| | | |
| | | private func setChargePrice(_ type:ChargeType,price:Double){ |
| | |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | | <objects> |
| | |
| | | <rect key="frame" x="7.0000000000000018" y="5" width="28.666666666666671" height="25"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KaS-j6-dko"> |
| | | <rect key="frame" x="0.0" y="0.0" width="28.666666666666664" height="25"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="28.666666666666668" height="25"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="11"/> |
| | | <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="8" y="7" width="34" height="18"/> |
| | | </imageView> |
| | | <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YMY-eC-fwJ"> |
| | | <rect key="frame" x="7" y="6" width="72" height="19.666666666666668"/> |
| | | <rect key="frame" x="6.9999999999999982" y="6" width="24.333333333333329" height="19.666666666666668"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kBI-mA-VCH"> |
| | | <rect key="frame" x="47" y="1.9999999999999991" width="1" height="14.666666666666664"/> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="1" id="u0p-Di-Lfe"/> |
| | | </constraints> |
| | | </view> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="待支付" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="y3v-m1-NFl"> |
| | | <rect key="frame" x="12" y="3.6666666666666661" width="30" height="12"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="30" id="fw1-fA-fkr"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" pointSize="10"/> |
| | | <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PHh-bn-ZWL"> |
| | | <rect key="frame" x="54.666666666666664" y="0.0" width="10.333333333333336" height="19.666666666666668"/> |
| | | <rect key="frame" x="7" y="0.0" width="10.333333333333336" height="19.666666666666668"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="17"/> |
| | | <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <color key="backgroundColor" red="0.8901960784313725" green="0.70196078431372544" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="19.5" id="6DB-9g-xbb"/> |
| | | <constraint firstItem="y3v-m1-NFl" firstAttribute="leading" secondItem="YMY-eC-fwJ" secondAttribute="leading" constant="12" id="Dtt-NR-dBw"/> |
| | | <constraint firstAttribute="trailing" secondItem="PHh-bn-ZWL" secondAttribute="trailing" constant="7" id="HAa-Du-CzN"/> |
| | | <constraint firstItem="PHh-bn-ZWL" firstAttribute="top" secondItem="YMY-eC-fwJ" secondAttribute="top" id="L41-FV-9iR"/> |
| | | <constraint firstItem="y3v-m1-NFl" firstAttribute="centerY" secondItem="YMY-eC-fwJ" secondAttribute="centerY" id="LCS-Qy-brQ"/> |
| | | <constraint firstItem="PHh-bn-ZWL" firstAttribute="leading" secondItem="kBI-mA-VCH" secondAttribute="trailing" constant="6.5" id="VS2-Fy-SHm"/> |
| | | <constraint firstAttribute="bottom" secondItem="kBI-mA-VCH" secondAttribute="bottom" constant="3" id="r3F-1o-hcV"/> |
| | | <constraint firstItem="kBI-mA-VCH" firstAttribute="leading" secondItem="y3v-m1-NFl" secondAttribute="trailing" constant="5" id="sPV-Eu-s1T"/> |
| | | <constraint firstAttribute="bottom" secondItem="PHh-bn-ZWL" secondAttribute="bottom" id="tqb-zF-2Uz"/> |
| | | <constraint firstItem="kBI-mA-VCH" firstAttribute="top" secondItem="YMY-eC-fwJ" secondAttribute="top" constant="2" id="xBk-yf-Y9j"/> |
| | | <constraint firstItem="PHh-bn-ZWL" firstAttribute="leading" secondItem="YMY-eC-fwJ" secondAttribute="leading" constant="7" id="zMA-HG-aUl"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | |
| | | <image name="icon_offline" width="34" height="18"/> |
| | | <image name="icon_use_small_s" width="9" height="9"/> |
| | | <image name="icon_vip" width="25.666666030883789" height="25.666666030883789"/> |
| | | <systemColor name="systemBackgroundColor"> |
| | | <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | </systemColor> |
| | | </resources> |
| | | </document> |
| | |
| | | func setMeditationModel(_ model:MeditationModel,showType:DisplayType){ |
| | | self.showType = showType |
| | | |
| | | if model.id == 0{ |
| | | cover_bgImage.image = UIImage(named: "bt_private");return |
| | | } |
| | | view_shadow.isHidden = model.id == 0 |
| | | |
| | | label_title.text = model.meditationTitle |
| | | label_subTitle.text = model.coverDescription |
| | | |
| | | |
| | | if model.id == 0{ |
| | | cover_bgImage.image = UIImage(named: "bt_private") |
| | | cover_bgImage.backgroundColor = .red |
| | | }else{ |
| | | let imgUrls = model.coverUrl.jq_urlEncoded().components(separatedBy: ",") |
| | | if showType == .horizontal{ |
| | | cover_bgImage.sd_setImage(with: URL(string: imgUrls.first)) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | <constraint firstAttribute="height" constant="9.5" id="wsl-qN-1LP"/> |
| | | </constraints> |
| | | </view> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ajx-e3-nPT"> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bt_private" translatesAutoresizingMaskIntoConstraints="NO" id="ajx-e3-nPT"> |
| | | <rect key="frame" x="0.0" y="0.0" width="413" height="255.66666666666666"/> |
| | | </imageView> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="all-AA-1bU"> |
| | |
| | | <constraint firstAttribute="width" constant="14.5" id="cuz-Sz-rLa"/> |
| | | </constraints> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tDO-qY-aGP"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tDO-qY-aGP"> |
| | | <rect key="frame" x="43" y="53.333333333333343" width="360" height="20.333333333333329"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> |
| | | <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="can be switched on" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NTV-9E-3YX"> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NTV-9E-3YX"> |
| | | <rect key="frame" x="43" y="77.666666666666686" width="360" height="12"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="10"/> |
| | | <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | |
| | | </collectionViewCell> |
| | | </objects> |
| | | <resources> |
| | | <image name="bt_private" width="390" height="205.66667175292969"/> |
| | | <image name="icon_pay_s" width="14.666666984558105" height="18.666666030883789"/> |
| | | </resources> |
| | | </document> |
| | |
| | | import CoreTelephony |
| | | |
| | | let SetBGMSuccess_Noti = Notification.Name.init("SetBGMSuccess_Noti") |
| | | let ToShowTree_Noti = Notification.Name.init("ToShowTree_Noti") |
| | | let ReloadData_Noti = Notification.Name.init("ReloadData_Noti") |
| | | |
| | | struct TitleItem{ |
| | | var id = 0 |
| | |
| | | class HomeViewModel{ |
| | | var homeTopMenuItems = [HomeTopMenuItem]() |
| | | var homeBottomMenuItems = [HomeTopMenuItem]() |
| | | var todyModel:MeditationModel? |
| | | var todyModel:ToDayMeditationModel? |
| | | var privateTodyModels = [MeditationModel]() |
| | | var meditationList = [MeditationListModel]() |
| | | } |
| | |
| | | private var titleItems = [TitleItem]() |
| | | private var viewModel = HomeViewModel() |
| | | private var timer:Timer? |
| | | private var needPopToTree:Bool = false //是否需要跳转到树苗 |
| | | |
| | | private var cellularData:CTCellularData! |
| | | |
| | |
| | | |
| | | //获取用户信息 |
| | | if !(UserViewModel.getLoginInfo()?.accessToken.isEmpty ?? true){ |
| | | Services.getUserDetail().subscribe(onNext: {data in |
| | | Services.isFirst().subscribe(onNext: {[weak self]data in |
| | | if data.data == true{ |
| | | self?.navigationController?.tabBarController?.selectedIndex = 2 |
| | | var viewModel = UserDefaultSettingViewModel.getSetting() |
| | | viewModel?.userFirstOpenTreeTask = true |
| | | UserDefaultSettingViewModel.saveSetting(viewModel!) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.getUserDetail(showProgress: false).subscribe(onNext: {data in |
| | | if let m = data.data{UserViewModel.saveAvatarInfo(m)} |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true |
| | | |
| | | if needPopToTree{ |
| | | navigationController?.tabBarController?.selectedIndex = 2 |
| | | } |
| | | |
| | | if AudioPlayer.getSharedInstance().scenePlayer?.timeControlStatus == .paused && UserDefaultSettingViewModel.getSetting()?.bgm != nil{ |
| | | AudioPlayer.getSharedInstance().playSceneAt(UserDefaultSettingViewModel.getSetting()!.bgm!.audioFile) |
| | | } |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | |
| | | if !state{ |
| | | exit(0) |
| | | }else{ |
| | | |
| | | if var m = UserDefaultSettingViewModel.getSetting(){ |
| | | m.userFirstLaunch = false |
| | | UserDefaultSettingViewModel.saveSetting(m) |
| | | } |
| | | |
| | | //跳转计划引导 |
| | | let nav = BaseNav(rootViewController: PlanGuideVC(isFromFist: true)) |
| | | nav.modalPresentationStyle = .fullScreen |
| | |
| | | |
| | | NotificationCenter.default.rx.notification(PlantGuideQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.getData() |
| | | |
| | | Services.isFirst().subscribe(onNext: {data in |
| | | if data.data == true{ |
| | | weakSelf.navigationController?.tabBarController?.selectedIndex = 2 |
| | | let viewModel = UserDefaultSettingViewModel.getSetting() |
| | | // viewModel?.userFirstOpenTreeTask = false |
| | | UserDefaultSettingViewModel.saveSetting(viewModel!) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | weakSelf.needPopToTree = data.object as? Bool ?? false |
| | | weakSelf.getData() |
| | | |
| | | }).disposed(by: disposeBag) |
| | | |
| | |
| | | |
| | | NotificationCenter.default.rx.notification(LoginQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {data in |
| | | self.getData() |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | NotificationCenter.default.rx.notification(ReloadData_Noti).take(until: self.rx.deallocated).subscribe(onNext: {data in |
| | | self.tableView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.getTopdayMedita().subscribe(onNext: { data in |
| | | self.viewModel.todyModel = data.data?.clientMeditationVO |
| | | self.viewModel.todyModel = data.data |
| | | self.tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | let m = MeditationModel() |
| | | m.id = 0 |
| | | self.viewModel.privateTodyModels = [m] |
| | | if !(UserViewModel.getLoginInfo()?.accessToken.isEmpty ?? true){ |
| | | Services.getPersonalityPlan().subscribe(onNext: { data in |
| | | if let m = data.data{ |
| | | if m.count > 0{ |
| | | self.viewModel.privateTodyModels = m |
| | | }else{ |
| | | let m = MeditationModel() |
| | | m.id = 0 |
| | | self.viewModel.privateTodyModels = [m] |
| | | } |
| | | self.tableView.reloadRows(at: [IndexPath(row: 1, section: 0)], with: .none) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | }else{ |
| | | self.tableView.reloadData() |
| | | } |
| | | |
| | | Services.getMeditationAndCateList().subscribe(onNext: { data in |
| | |
| | | @objc func autoUpdate(){ |
| | | print("--->") |
| | | Services.getTopdayMedita().subscribe(onNext: { data in |
| | | self.viewModel.todyModel = data.data?.clientMeditationVO |
| | | self.viewModel.todyModel = data.data |
| | | self.tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | |
| | | if indexPath.section == 0{ |
| | | if let m = viewModel.todyModel{ |
| | | Services.getMeditationDetail(id: m.id).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | 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 |
| | | } |
| | | DispatchQueue.main.asyncAfter(delay: 0.4) { |
| | | self.tableView.reloadData() |
| | | } |
| | | }else{ |
| | | //游客模式都能播放 |
| | | Services.getMeditationDetail(id: detailId).subscribe(onNext: {[weak self]data in |
| | | if let m = data.data{ |
| | | |
| | | if AudioPlayer.getSharedInstance().meditationModel?.id == m.id && AudioPlayer.getSharedInstance().bgmPlayer?.timeControlStatus == .playing{ |
| | | return |
| | | } |
| | | |
| | | AudioPlayer.getSharedInstance().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() |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | }else{ |
| | | alert(msg: "平台暂未设置今日疗愈") |
| | | } |
| | |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | if indexPath.section == 0{ |
| | | if indexPath.section == 0 && indexPath.row == 0{ |
| | | //每日疗愈 |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_1_TCell") as! Home_Style_1_TCell |
| | | if viewModel.todyModel?.id != 0{ |
| | | cell.model = viewModel.todyModel |
| | | cell.view_data.isHidden = false |
| | | cell.img_play.isHidden = AudioPlayer.getSharedInstance().meditationModel?.id == viewModel.todyModel?.id |
| | | |
| | | }else{ |
| | | cell.img_cover.image = UIImage(named: "bg_today") |
| | | cell.view_data.isHidden = true |
| | | } |
| | | |
| | | print("--->\(cell)") |
| | | |
| | | cell.setplaying() |
| | | return cell |
| | | }else if indexPath.section == 1{ |
| | | }else if indexPath.section == 1 && indexPath.row == 0{ |
| | | //私人定制 |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_4_TCell") as! Home_Style_4_TCell |
| | | cell.style = .style1 |
| | | cell.setModels(viewModel.privateTodyModels,showType: .horizontal) |
| | | return cell |
| | | }else if indexPath.section == 2{ |
| | | }else if indexPath.section == 2 && indexPath.row == 0{ |
| | | // 新手冥想指南 |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_Home_Style_2_TCell") as! Home_Style_2_TCell |
| | | cell.imgView.image = UIImage(named: "bg_guide_home") |
| | |
| | | |
| | | class Home_Style_1_TCell: UITableViewCell { |
| | | |
| | | var model:MeditationModel?{ |
| | | var model:ToDayMeditationModel?{ |
| | | didSet{ |
| | | if let m = model{ |
| | | |
| | |
| | | view_data.isHidden = true |
| | | }else{ |
| | | view_data.isHidden = false |
| | | img_cover.sd_setImage(with: URL(string: m.coverUrl.jq_urlEncoded())) |
| | | img_cover.sd_setImage(with: URL(string: m.imageUrl.jq_urlEncoded())) |
| | | |
| | | let turple = Date.jq_formateToTime_tuple(m.time) |
| | | let minute = (turple.hour * 60 + turple.minute) |
| | | let second = turple.second |
| | | |
| | | label_title.text = "\(m.meditationTitle) | \(String(format: "%.2ld:%.2ld", minute,second))" |
| | | label_joinNum.text = "\(m.realLearnedNum + m.virtualLearnedNum)人已参加学习" |
| | | label_title.text = "\(m.clientMeditationVO!.meditationTitle) | \(String(format: "%.2ld:%.2ld", minute,second))" |
| | | label_joinNum.text = "\(m.clientMeditationVO!.realLearnedNum + m.clientMeditationVO!.virtualLearnedNum)人已参加学习" |
| | | } |
| | | } |
| | | } |
| | |
| | | selectionStyle = .none |
| | | } |
| | | |
| | | func setplaying(){ |
| | | img_play.image = AudioPlayer.getSharedInstance().bgmPlayer?.timeControlStatus == .playing ? UIImage(named: "btn_pause"):UIImage(named: "icon_play") |
| | | } |
| | | |
| | | } |
| | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let item = meditationModels[indexPath.row] |
| | | |
| | | if (item.chargeType == .payment || item.chargeType == .vipFree || item.id == 0) && (UserViewModel.getLoginInfo()?.token.isEmpty ?? true){ |
| | | sceneDelegate?.checkisLoginState() |
| | | return |
| | | } |
| | | |
| | | Services.getMeditationDetail(id: item.id).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | if let m = data.data{ |
| | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | |
| | | let item = meditationModels[indexPath.row] |
| | | guard item.id != 0 else{ |
| | | alert(msg: "平台暂未设置私人定制");return |
| | | if (item.chargeType == .payment || item.chargeType == .vipFree || item.id == 0) && (UserViewModel.getLoginInfo()?.token.isEmpty ?? true){ |
| | | sceneDelegate?.checkisLoginState() |
| | | return |
| | | } |
| | | |
| | | Services.getMeditationDetail(id: item.id).subscribe(onNext: {[weak self]data in |
| | |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | |
| | | // let isVip = UserViewModel.getAvatarInfo().checkVip() |
| | | // if m.chargeType == .free || (m.chargeType == .vipFree && isVip) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | // let detailVC = HomeItemDetailVC(id: meditationModels[indexPath.row].id) |
| | | // JQ_currentViewController().jq_push(vc: detailVC) |
| | | // }else{ |
| | | // if m.chargeType == .vipFree{ |
| | | // let vc = VIPCenterVC() |
| | | // JQ_currentViewController().jq_push(vc: vc) |
| | | // }else{ |
| | | // guard sceneDelegate!.checkisLoginState() else{return} |
| | | // let vc = PaymentOrderVC(museItemModel: m,type: .muse,showType: .horizontal) |
| | | // JQ_currentViewController().jq_push(vc:vc) |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { |
| | |
| | | |
| | | yy_popBlock = { [weak self] in |
| | | if self?.needPopRoot ?? false{ |
| | | if JQ_currentNavigationController().viewControllers.first is PlanGuideVC{ |
| | | NotificationCenter.default.post(name: PlantGuideQuit_Noti, object: nil, userInfo: nil) |
| | | }else{ |
| | | self?.navigationController?.popViewController(animated: true) |
| | | } |
| | | }else{ |
| | | self?.navigationController?.popViewController(animated: true) |
| | | } |
| | |
| | | |
| | | needPopRoot = true |
| | | NotificationCenter.default.post(name: SetBGMSuccess_Noti, object: items[index.row]) |
| | | DispatchQueue.main.asyncAfter(delay: 0.6) { |
| | | self.navigationController?.popViewController() |
| | | } |
| | | // DispatchQueue.main.asyncAfter(delay: 0.6) { |
| | | // self.navigationController?.popViewController() |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private var collect_bitem:UIBarButtonItem! |
| | | private var audioPlayer:AudioPlayer = AudioPlayer.getSharedInstance() |
| | | private var id:Int! |
| | | private var timeLook:Int = 0 //观看时间记录 |
| | | private var settingViewModel = UserDefaultSettingViewModel.getSetting() |
| | | |
| | |
| | | private var totalInterval:TimeInterval = 0 |
| | | |
| | | private var model:MeditationModel? |
| | | |
| | | // init(id:Int) { |
| | | // super.init(nibName: nil, bundle: nil) |
| | | // self.id = id |
| | | // } |
| | | |
| | | init(model:MeditationModel) { |
| | | super.init(nibName: nil, bundle: nil) |
| | |
| | | self.collect_bitem.image = m.favorite == .yes ? UIImage(named: "btn_collect_1_s"):UIImage(named: "btn_collect_1") |
| | | self.collect_bitem.tintColor = m.favorite == .yes ? UIColor(hexString: "fe5b60"):.white |
| | | self.img_background.sd_setImage(with: URL(string: m.backgroundUrl.jq_urlEncoded())) |
| | | |
| | | |
| | | if audioPlayer.meditationModel?.id == m.id{ |
| | | audioPlayer.delegate = self |
| | | let value = ((audioPlayer.bgmPlayer?.currentTime().seconds)! / 100.0) * (audioPlayer.bgmPlayer?.currentItem?.duration.seconds)! |
| | | if self.audioPlayer.bgmPlayer?.timeControlStatus == .paused{ |
| | | self.audioPlayer.setBGMRate(value: value) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @IBAction func playAction(_ sender: UIButton) { |
| | | sender.isSelected = !sender.isSelected |
| | | showHUD() |
| | | if let m = model{ |
| | | if sender.isSelected{ |
| | | if audioPlayer.meditationModel != nil{ |
| | | if audioPlayer.meditationModel?.id != m.id{ |
| | | audioPlayer.playBGMAt(firstPlayIndex: 0, model: m, delegate: self,coverImage: img_background.image) |
| | | PayMusicVC.updateStatus(.playing) |
| | | }else{ |
| | | audioPlayer.bgmPlayer?.play() |
| | | audioPlayer.masterPlayer?.play() |
| | | PayMusicVC.updateStatus(.playing) |
| | | } |
| | | |
| | | }else{ |
| | | audioPlayer.playBGMAt(firstPlayIndex: 0, model: m, delegate: self,coverImage: img_background.image) |
| | | PayMusicVC.updateStatus(.playing) |
| | | } |
| | | }else{ |
| | | audioPlayer.bgmPlayer?.pause() |
| | | audioPlayer.masterPlayer?.pause() |
| | | PayMusicVC.updateStatus(.pause) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @objc func collectionAction(){ |
| | | guard let id = model?.id else {return} |
| | | Services.meditationFavorite(id: id).subscribe(onNext: {data in |
| | | self.model?.favorite.troggle() |
| | | if self.model?.favorite == .yes{ |
| | |
| | | |
| | | func playState(_ state:PlayMusicState){ |
| | | print("music:当前状态:\(state)") |
| | | hiddenHUD() |
| | | |
| | | guard audioPlayer.meditationModel?.id == model?.id else {return} |
| | | |
| | | btn_play.isSelected = self.audioPlayer.bgmPlayer?.timeControlStatus == .playing |
| | | |
| | | switch state { |
| | | case .playing: |
| | | PayMusicVC.show(model: model!) |
| | | if btn_play.isHidden == false {btn_play.isHidden = true} |
| | | hiddenHUD() |
| | | case .paurse:btn_play.isHidden = false |
| | | case .paurse:break |
| | | case .end:break |
| | | case .next:break |
| | | } |
| | |
| | | </constraints> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" image="btn_play"/> |
| | | <state key="selected" image="btn_pause"/> |
| | | <connections> |
| | | <action selector="playAction:" destination="-1" eventType="touchUpInside" id="DT7-8R-5nM"/> |
| | | </connections> |
| | |
| | | <resources> |
| | | <image name="btn_comment" width="18.666666030883789" height="19"/> |
| | | <image name="btn_list" width="17" height="13.666666984558105"/> |
| | | <image name="btn_pause" width="65.666664123535156" height="65.666664123535156"/> |
| | | <image name="btn_play" width="65.666664123535156" height="65.666664123535156"/> |
| | | <image name="btn_roll" width="22.666666030883789" height="19.666666030883789"/> |
| | | <image name="btn_roll_loop" width="22.666666030883789" height="19.666666030883789"/> |
| | |
| | | |
| | | import UIKit |
| | | import QMUIKit |
| | | import JQTools |
| | | |
| | | let Refreh_PaymentWallet_Noti = Notification.Name.init("Refreh_PaymentWallet_Noti") |
| | | |
| | |
| | | private var balance:Double = 0 |
| | | private var type:PaymentOrderType! |
| | | private var showType:DisplayType! |
| | | private var businessId:Int? |
| | | |
| | | init(museItemModel:MeditationModel? = nil,courseItemModel:CourseModel? = nil,type:PaymentOrderType,giftToOther:Bool = false,showType:DisplayType!) { |
| | | init(museItemModel:MeditationModel? = nil,courseItemModel:CourseModel? = nil,type:PaymentOrderType,giftToOther:Bool = false,showType:DisplayType!,businessId:Int? = nil) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.museItemModel = museItemModel |
| | | self.courseItemModel = courseItemModel |
| | | self.giftToOther = giftToOther |
| | | self.type = type |
| | | self.showType = showType |
| | | self.businessId = businessId |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | |
| | | |
| | | getBalance() |
| | | |
| | | let btn = UIButton(type: .custom) |
| | | btn.setTitle("取消订单", for: .normal) |
| | | btn.setTitleColor(UIColor(hexString: "#353535"), for: .normal) |
| | | btn.titleLabel?.font = .systemFont(ofSize: 15) |
| | | btn.addTarget(self, action: #selector(cancelAction), for: .touchUpInside) |
| | | |
| | | if type == .course{ |
| | | if self.businessId != nil{ |
| | | self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn) |
| | | } |
| | | |
| | | Services.getCourseDetail(courseId: courseItemModel!.id).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | self.courseModel = m |
| | |
| | | } |
| | | |
| | | if type == .muse{ |
| | | if self.businessId != nil{ |
| | | self.navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn) |
| | | } |
| | | |
| | | Services.getMeditationDetail(id: museItemModel!.id).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | self.museModel = m |
| | |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @objc private func cancelAction(){ |
| | | if businessId != nil{ |
| | | CommonAlertView.show(title: "提示", content: "是否取消订单") {[weak self] state in |
| | | guard let weakSelf = self else { return } |
| | | if state{ |
| | | Services.cancelOrder(id: weakSelf.businessId!).subscribe(onNext: {data in |
| | | alertSuccess(msg: "订单已取消") |
| | | for vc in weakSelf.navigationController?.viewControllers ?? []{ |
| | | if vc is WatchHistoryVC{ |
| | | weakSelf.navigationController?.popToViewController(vc, animated: true) |
| | | NotificationCenter.default.post(name: WatchHistory_Noti, object: nil, userInfo: nil) |
| | | break |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private func getBalance(){ |
| | | Services.getUserBalance().subscribe(onNext: {data in |
| | | self.balance = data.data ?? 0 |
| | |
| | | |
| | | @IBAction func invateRegisterAction(_ sender: UIButton) { |
| | | |
| | | let string = String(format: "%@%@?userId=%ld",ShareUrl,"/register/register",UserViewModel.getAvatarInfo().id) |
| | | ShareView.show(URL(string: string)!, title: "心泉疗愈", desc: "心泉疗愈1",hasSave: false) { |
| | | // alertSuccess(msg: "已保存至相册") |
| | | } |
| | | } |
| | | |
| | | @IBAction func searchUserAction(_ sender: UIButton) { |
| | | tf_phone.resignFirstResponder() |
| | | guard !tf_phone.text!.isEmpty else { |
| | | alertError(msg: tf_phone.placeholder ?? "请输入好友手机号");return |
| | | } |
| | |
| | | Services.searchUserByPhone(tf_phone.text!).subscribe(onNext: { data in |
| | | self.view_searchUserResult.isHidden = false |
| | | if let m = data.data,m.id != 0{ |
| | | self.giftUserId = m.userId |
| | | self.giftUserId = m.id |
| | | self.image_avatar.sd_setImage(with: URL(string: m.avatar)) |
| | | self.label_userName.text = m.nickname |
| | | self.label_userPhone.text = m.cellPhone |
| | | self.label_searchInfo.isHidden = true |
| | | self.btn_invate.isHidden = true |
| | | }else{ |
| | | self.image_avatar.isHidden = false |
| | | self.label_userName.isHidden = false |
| | | self.label_userPhone.isHidden = false |
| | | self.btn_invate.isHidden = true |
| | | } |
| | | },onError: { _ in |
| | | self.view_searchUserResult.isHidden = false |
| | | self.image_avatar.isHidden = true |
| | | self.label_userName.isHidden = true |
| | | self.label_userPhone.isHidden = true |
| | | self.label_searchInfo.isHidden = false |
| | | self.btn_invate.isHidden = false |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | |
| | | id = m.id |
| | | } |
| | | |
| | | |
| | | guard btn_isRead.isSelected else { |
| | | alertError(msg: "请先阅读并同意《课程/疗愈音频购买协议》");return |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | if businessId != nil{ |
| | | Services.gvieCourseAgain(orderForm: type, id: businessId!).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | self?.museItemModel?.isBuy = .yes |
| | | self?.courseItemModel?.isBuy = .yes |
| | | self?.museModel?.isBuy = .yes |
| | | self?.courseModel?.isBuy = .yes |
| | | let vc = PaymentOrderResultVC(type: weakSelf.type, id: id, price: money) |
| | | self?.push(vc: vc) |
| | | }).disposed(by: disposeBag) |
| | | return |
| | | } |
| | | |
| | | |
| | | Services.gvieCourse(orderForm: type, targetId: id,receiverId: giftUserId).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | self?.museItemModel?.isBuy = .yes |
| | |
| | | self.push(vc: vc) |
| | | } |
| | | }else{ |
| | | Popup_1_View.show(state: .fail, title: "验证失败", subtitle:"手机号验证失败") { |
| | | Popup_1_View.show(state: .fail, title: "验证失败", subtitle:"验证码错误") { |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | @IBAction func userResigerAgreementAction(_ sender: Any) { |
| | | let vc = WebVC(type: .user) |
| | | vc.title = "用户注册协议" |
| | | push(vc: vc) |
| | | let vc = LoginTreatyVC() |
| | | vc.topIndex = 0 |
| | | vc.clickHandle {[unowned self] state in |
| | | self.btn_isRead.isSelected = state |
| | | } |
| | | vc.modalPresentationStyle = .custom |
| | | present(vc, animated: true) |
| | | } |
| | | |
| | | |
| | | @IBAction func userPrivateAgreementAction(_ sender: Any) { |
| | | let vc = WebVC(type: .privacy) |
| | | vc.title = "用户隐私协议" |
| | | push(vc: vc) |
| | | let vc = LoginTreatyVC() |
| | | vc.topIndex = 1 |
| | | vc.clickHandle {[unowned self] state in |
| | | self.btn_isRead.isSelected = state |
| | | } |
| | | vc.modalPresentationStyle = .custom |
| | | present(vc, animated: true) |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @objc func rankAction(){ |
| | | guard sceneDelegate!.checkisLoginState() else {return} |
| | | let vc = WebVC(url: ShareUrl + "/ranking/ranking?userId=\(UserViewModel.getAvatarInfo().id)") |
| | | let vc = WebVC(url: ShareUrl + "/ranking/ranking?userId=\(UserViewModel.getAvatarInfo().id)",showHelp: true) |
| | | vc.title = "爱心榜单" |
| | | push(vc: vc) |
| | | } |
| | |
| | | @IBAction func shareAction(_ sender: QMUIButton) { |
| | | guard sceneDelegate!.checkisLoginState() else {return} |
| | | let vc = InviteVC() |
| | | vc.title = "推广活动" |
| | | push(vc: vc) |
| | | } |
| | | } |
| | |
| | | override func setUI() { |
| | | view.backgroundColor = UIColor(hexString: "f6f6f6") |
| | | |
| | | btn_add.localGradientColor(cornerRadius: 20) |
| | | btn_add.localGradientColor(cornerRadius: 20,bounds: CGRect(x: 0, y: 0, width: JQ_ScreenW - 45 * 2, height: 40)) |
| | | } |
| | | |
| | | @IBAction func addhandleAction(_ sender: UIButton) { |
| | |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="请输入" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="BaQ-Md-hAN" customClass="QMUITextField"> |
| | | <textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="银行预留手机号" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="BaQ-Md-hAN" customClass="QMUITextField"> |
| | | <rect key="frame" x="90" y="14.666666666666686" width="265" height="21"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="16"/> |
| | | <textInputTraits key="textInputTraits" keyboardType="numberPad"/> |
| | |
| | | @IBOutlet weak var label_role: UILabel! |
| | | @IBOutlet weak var img_qrCode: UIImageView! |
| | | @IBOutlet weak var img_poster: UIImageView! |
| | | @IBOutlet weak var view_bottomImage: UIView! |
| | | @IBOutlet weak var img_footerqrCode: UIImageView! |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "推广活动" |
| | | |
| | | self.view_bottomImage.isHidden = true |
| | | Services.getCommissionRule().subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | self.img_footerqrCode.sd_setImage(with: URL(string: m.qrCode)) |
| | | self.img_qrCode.sd_setImage(with: URL(string: m.qrCode)) |
| | | self.img_poster.sd_setImage(with: URL(string: m.poster)) |
| | | self.label_role.attributedText = NSAttributedString.convertHtml(m.rules) |
| | |
| | | |
| | | let string = String(format: "%@%@?userId=%ld", ShareUrl,"/poster/poster",UserViewModel.getAvatarInfo().id) |
| | | ShareView.show(URL(string: string)!, title: "心泉疗愈", desc: "心泉疗愈1",hasSave: true) {[weak self] in |
| | | self?.scrollView.jq_captureAsLongImage(saveToAlbum: true) |
| | | self?.view_role.isHidden = true |
| | | self?.btn_share.isHidden = true |
| | | self?.img_qrCode.isHidden = true |
| | | self?.view_bottomImage.isHidden = false |
| | | self?.view.jq_captureToImage(true) |
| | | self?.img_qrCode.isHidden = false |
| | | self?.view_role.isHidden = false |
| | | self?.btn_share.isHidden = false |
| | | self?.view_bottomImage.isHidden = true |
| | | |
| | | // self?.scrollView.jq_captureAsLongImage(saveToAlbum: true) |
| | | alertSuccess(msg: "已保存至相册") |
| | | } |
| | | } |
| | |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="InviteVC" customModule="XQMuse" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="btn_share" destination="XbP-tV-8pd" id="0YX-oc-VDx"/> |
| | | <outlet property="img_footerqrCode" destination="TAD-Ax-Dge" id="GzX-8L-xdy"/> |
| | | <outlet property="img_poster" destination="IZY-Nj-jD0" id="hnL-OL-dhs"/> |
| | | <outlet property="img_qrCode" destination="bff-wn-eyk" id="FV9-RT-3rK"/> |
| | | <outlet property="label_role" destination="PXe-Ef-0Zn" id="E0d-R5-kBO"/> |
| | | <outlet property="label_title" destination="oFE-SE-88r" id="C2L-3T-B60"/> |
| | | <outlet property="scrollView" destination="Kj8-pf-QQp" id="30y-rn-UUc"/> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | | <outlet property="view_bottomImage" destination="Boi-rd-9ge" id="bGC-MH-3XL"/> |
| | | <outlet property="view_role" destination="nfc-1h-yql" id="FWd-fZ-91R"/> |
| | | </connections> |
| | | </placeholder> |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_invite" translatesAutoresizingMaskIntoConstraints="NO" id="IZY-Nj-jD0"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="483.66666666666669"/> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="top" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_invite" translatesAutoresizingMaskIntoConstraints="NO" id="IZY-Nj-jD0"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> |
| | | </imageView> |
| | | <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Kj8-pf-QQp"> |
| | | <rect key="frame" x="0.0" y="59" width="393" height="759"/> |
| | |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="PXe-Ef-0Zn" secondAttribute="trailing" constant="20" id="50t-3i-mW2"/> |
| | | <constraint firstAttribute="bottom" secondItem="PXe-Ef-0Zn" secondAttribute="bottom" constant="20" id="9Xa-Zo-T2i"/> |
| | |
| | | <constraint firstItem="fRO-Jr-RG3" firstAttribute="leading" secondItem="Kj8-pf-QQp" secondAttribute="leading" id="g3X-lW-OHt"/> |
| | | </constraints> |
| | | </scrollView> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Boi-rd-9ge"> |
| | | <rect key="frame" x="283" y="705" width="96" height="96"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="TAD-Ax-Dge"> |
| | | <rect key="frame" x="0.0" y="0.0" width="96" height="96"/> |
| | | </imageView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="TAD-Ax-Dge" firstAttribute="leading" secondItem="Boi-rd-9ge" secondAttribute="leading" id="0zA-ho-kTu"/> |
| | | <constraint firstItem="TAD-Ax-Dge" firstAttribute="top" secondItem="Boi-rd-9ge" secondAttribute="top" id="SG2-Zk-4QW"/> |
| | | <constraint firstAttribute="trailing" secondItem="TAD-Ax-Dge" secondAttribute="trailing" id="WzN-RF-ZAJ"/> |
| | | <constraint firstAttribute="height" constant="96" id="Y6b-nW-p3s"/> |
| | | <constraint firstAttribute="bottom" secondItem="TAD-Ax-Dge" secondAttribute="bottom" id="hFq-3e-T71"/> |
| | | <constraint firstAttribute="width" constant="96" id="q69-Wm-x6Z"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | | <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Boi-rd-9ge" secondAttribute="bottom" constant="17" id="9s3-Dw-jox"/> |
| | | <constraint firstItem="Kj8-pf-QQp" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="IMW-r4-OkS"/> |
| | | <constraint firstItem="IZY-Nj-jD0" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="PQ2-Ha-kPM"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="Kj8-pf-QQp" secondAttribute="bottom" id="TFq-oj-nHs"/> |
| | | <constraint firstItem="IZY-Nj-jD0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="TH6-Zy-Z3J"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Kj8-pf-QQp" secondAttribute="trailing" id="YAi-5i-Bes"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="IZY-Nj-jD0" secondAttribute="trailing" id="cef-7x-EhS"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Boi-rd-9ge" secondAttribute="trailing" constant="14" id="gak-ro-R2Q"/> |
| | | <constraint firstItem="Kj8-pf-QQp" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="p90-x8-H82"/> |
| | | <constraint firstAttribute="bottom" secondItem="IZY-Nj-jD0" secondAttribute="bottom" id="wJW-aB-hUa"/> |
| | | </constraints> |
| | | <point key="canvasLocation" x="139.69465648854961" y="20.422535211267608"/> |
| | | </view> |
| | |
| | | title = "系统消息" |
| | | label_title.text = model.title |
| | | label_content.text = model.content |
| | | label_date.text = model.publishTime |
| | | label_date.text = model.time |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "回复消息" |
| | | let avartarImageUrl = model.iconUrl.components(separatedBy: ",").first?.jq_urlEncoded() |
| | | let avartarImageUrl = model.iconUrl.components(separatedBy: ",").last?.jq_urlEncoded() |
| | | image_avartar.sd_setImage(with: URL(string: avartarImageUrl)) |
| | | label_name.text = model.meditationTitle |
| | | label_content.text = model.coverDescription |
| | |
| | | |
| | | class SpendingDetailInfoVC: BaseVC { |
| | | |
| | | @IBOutlet weak var label_price_title: UILabel! |
| | | |
| | | @IBOutlet weak var label_price: UILabel! |
| | | @IBOutlet weak var label_incomeType: UILabel! |
| | | @IBOutlet weak var label_incomeType_title: UILabel! |
| | | |
| | | |
| | | @IBOutlet weak var label_datetime: UILabel! |
| | | @IBOutlet weak var label_datetime_title: UILabel! |
| | | @IBOutlet weak var label_orderNum: UILabel! |
| | | @IBOutlet weak var label_subUserName: UILabel! |
| | | @IBOutlet weak var image_subUserAvartar: UIImageView! |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "收入详情" |
| | | // title = "收入详情" |
| | | navigationController?.navigationBar.scrollEdgeAppearance?.backgroundColor = .white |
| | | |
| | | view_incomeType.isHidden = true |
| | |
| | | Services.balanceDetail(id: id).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | |
| | | if m.changeType == .increase{ |
| | | self.title = "收入详情" |
| | | }else{ |
| | | self.title = "支出详情" |
| | | self.label_price_title.text = "交易金额" |
| | | self.label_incomeType_title.text = "交易类型" |
| | | self.label_datetime_title.text = "交易时间" |
| | | } |
| | | |
| | | self.view_incomeType.isHidden = false |
| | | self.view_datetime.isHidden = false |
| | | self.view_orderNum.isHidden = false |
| | | self.view_orderNum.isHidden = !m.type.contains("充值") |
| | | self.view_remark.isHidden = false |
| | | |
| | | if m.changeType == .increase{ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/> |
| | | <capability name="Safe area layout guides" minToolsVersion="9.0"/> |
| | | <capability name="System colors in document resources" minToolsVersion="11.0"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | |
| | | <connections> |
| | | <outlet property="image_subUserAvartar" destination="Xrs-Ns-uus" id="BWY-Ym-dbP"/> |
| | | <outlet property="label_datetime" destination="Cv1-Z7-VpI" id="dAs-uh-cnZ"/> |
| | | <outlet property="label_datetime_title" destination="2ep-Yl-gTQ" id="uN7-kR-dpm"/> |
| | | <outlet property="label_incomeType" destination="Vch-45-s0U" id="Fka-TJ-wqx"/> |
| | | <outlet property="label_incomeType_title" destination="c50-FX-5d4" id="bPy-Dw-ReC"/> |
| | | <outlet property="label_orderNum" destination="fQy-0x-TJ9" id="Nea-dJ-cM9"/> |
| | | <outlet property="label_price" destination="5gW-lj-8Uk" id="U1G-mZ-ph0"/> |
| | | <outlet property="label_price_title" destination="Czb-wC-0GY" id="BmH-53-dg5"/> |
| | | <outlet property="label_remakr" destination="3JX-nJ-8Mi" id="gVL-aU-3ws"/> |
| | | <outlet property="label_subUserName" destination="lLV-Rs-74K" id="48c-Ll-e0R"/> |
| | | <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> |
| | |
| | | <rect key="frame" x="14" y="68" width="365" height="234"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="余额" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Czb-wC-0GY"> |
| | | <rect key="frame" x="10" y="17" width="32.666666666666664" height="14"/> |
| | | <rect key="frame" x="10" y="17" width="32" height="14"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="14" id="7Tc-45-Re5"/> |
| | | </constraints> |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="345" height="17"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收入类型" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c50-FX-5d4"> |
| | | <rect key="frame" x="0.0" y="1.3333333333333437" width="49.333333333333336" height="14.333333333333336"/> |
| | | <rect key="frame" x="0.0" y="1.3333333333333437" width="48" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="31" width="345" height="17"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="时间" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2ep-Yl-gTQ"> |
| | | <rect key="frame" x="0.0" y="1.3333333333333437" width="24.666666666666668" height="14.333333333333336"/> |
| | | <rect key="frame" x="0.0" y="1.3333333333333437" width="24" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="62" width="345" height="17"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="流水单号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4Zm-gu-UT7"> |
| | | <rect key="frame" x="0.0" y="1.3333333333333437" width="49.333333333333336" height="14.333333333333336"/> |
| | | <rect key="frame" x="0.0" y="1.3333333333333437" width="48" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="93" width="345" height="28"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="下级用户" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BoT-97-SXQ"> |
| | | <rect key="frame" x="0.0" y="7.0000000000000009" width="49.333333333333336" height="14.333333333333336"/> |
| | | <rect key="frame" x="0.0" y="7.0000000000000009" width="48" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | <rect key="frame" x="0.0" y="135" width="345" height="17"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="备注" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="S3M-IX-Tpo"> |
| | | <rect key="frame" x="0.0" y="1.3333333333333153" width="24.666666666666668" height="14.333333333333336"/> |
| | | <rect key="frame" x="0.0" y="1.3333333333333153" width="24" height="14.333333333333336"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="12"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | modelId = datas?.courseList[indexPath.row].id |
| | | } |
| | | |
| | | if indexPath.section == 0{ |
| | | if indexPath.section == 1{ |
| | | guard datas?.freeCourseList.count != 0 else{return} |
| | | modelId = datas?.freeCourseList[indexPath.row].id |
| | | } |
| | |
| | | }else{ |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBanner_2_1_CCell", for: indexPath) as! HomeRelaxBanner_2_1_CCell |
| | | cell.setCourseModel(datas!.courseList[indexPath.row]) |
| | | cell.view_price.isHidden = true |
| | | cell.view_waitPay.isHidden = true |
| | | cell.image_free.isHidden = true |
| | | cell.img_vip.isHidden = true |
| | | return cell |
| | | } |
| | | }else{ |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_HomeRelaxBanner_2_1_CCell", for: indexPath) as! HomeRelaxBanner_2_1_CCell |
| | | cell.setCourseModel(datas!.freeCourseList[indexPath.row]) |
| | | cell.view_price.isHidden = true |
| | | cell.view_waitPay.isHidden = true |
| | | cell.image_free.isHidden = true |
| | | cell.img_vip.isHidden = true |
| | | return cell |
| | | } |
| | | } |
| | |
| | | tf_nickName.text = UserViewModel.getAvatarInfo().nickname |
| | | tf_realName.text = UserViewModel.getAvatarInfo().realname |
| | | tf_sign.text = UserViewModel.getAvatarInfo().signature |
| | | tf_gender.text = UserViewModel.getAvatarInfo().gender.rawTitle |
| | | tf_gender.text = UserViewModel.getAvatarInfo().gender?.rawTitle ?? "" |
| | | tf_birthday.text = UserViewModel.getAvatarInfo().birthday |
| | | tf_degree.text = UserViewModel.getAvatarInfo().education |
| | | tf_industry.text = UserViewModel.getAvatarInfo().industry |
| | |
| | | import JQTools |
| | | import StoreKit |
| | | import WebKit |
| | | import SwiftyStoreKit |
| | | import RxSwift |
| | | |
| | | class VIPCenterVC: BaseVC { |
| | | |
| | |
| | | |
| | | private var productList = Set<String>() |
| | | private var products = [SKProduct]() |
| | | private var timeLoopDisposeBag = DisposeBag() |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "会员中心" |
| | | |
| | | productList.insert("com.XQMuse.VIP.month.0") |
| | | productList.insert("com.XQMuse.VIP.semester.0") |
| | | productList.insert("com.XQMuse.VIP.year.0") |
| | | productList.insert("com.XQMuse.VIP.year.renewing.0") |
| | | productList.insert("com.XQmuse.Non.renewing.year.1") |
| | | productList.insert("com.XQmuse.Non.renewing.half.year.1") |
| | | productList.insert("com.XQmuse.Non.renewing.month.1") |
| | | |
| | | collectionView.delegate = self |
| | | collectionView.dataSource = self |
| | |
| | | alert(msg: "请先阅读并同意《会员用户协议》");return |
| | | } |
| | | |
| | | showHUD("正在进行内购买") |
| | | guard products.count != 0 else {return} |
| | | let oldVipExpireTime = UserViewModel.getAvatarInfo().vipExpireTime |
| | | |
| | | let product = products[selectIndex] |
| | | let userId = UserViewModel.getAvatarInfo().userId.string |
| | | InPurchaseManager.purchaseProduct(ID: product.productIdentifier, applicationUsername: userId) {[weak self]result in |
| | | guard let weakSelf = self else { return } |
| | | if result.status == 0{ |
| | | hiddenHUD() |
| | | let transactionId = result.receipt?.in_app.first?.original_transaction_id ?? "" |
| | | |
| | | InPurchaseManager.purchaseProduct(ID: product.productIdentifier, applicationUsername: "") { m in |
| | | |
| | | showHUD("正在查询购买结果") |
| | | Services.placeOrderApple(amount: product.price.doubleValue, balanceFlag: .no, orderFrom: 3, transactionIdentifier: transactionId, vipType: weakSelf.selectIndex + 1).subscribe(onNext: { data in |
| | | showHUD("正在查询购买结果") |
| | | let observable = Observable<Int>.interval(RxTimeInterval.seconds(5), scheduler: MainScheduler.instance) |
| | | observable.subscribe { event in |
| | | if event.element == 10{ |
| | | alertError(msg: "订单异常") |
| | | weakSelf.timeLoopDisposeBag = DisposeBag() |
| | | return |
| | | } |
| | | Services.getUserDetail(showProgress: false).subscribe(onNext: {data in |
| | | if data.data?.vipExpireTime != oldVipExpireTime{ |
| | | hiddenHUD() |
| | | alertSuccess(msg: "购买成功") |
| | | weakSelf.timeLoopDisposeBag = DisposeBag() |
| | | NotificationCenter.default.post(name: UpdateUserProfile_Noti, object: nil, userInfo: nil) |
| | | DispatchQueue.main.asyncAfter(delay: 1.0) { |
| | | weakSelf.navigationController?.popViewController() |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }.disposed(by: weakSelf.timeLoopDisposeBag) |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } errorClouse: { error in |
| | | alertError(msg: error.localizedDescription) |
| | | } |
| | |
| | | |
| | | func isSelect(_ state:Bool,product:SKProduct){ |
| | | label_title.text = product.localizedTitle |
| | | let priorDayPrice = product.price.doubleValue / 365.0 |
| | | |
| | | var priorDayPrice:Double = 0 |
| | | switch product.productIdentifier { |
| | | case "com.XQmuse.Non.renewing.year.1": |
| | | priorDayPrice = product.price.doubleValue / 365.0 |
| | | case "com.XQmuse.Non.renewing.half.year.1": |
| | | priorDayPrice = product.price.doubleValue / 180.0 |
| | | case "com.XQmuse.Non.renewing.month.1": |
| | | priorDayPrice = product.price.doubleValue / 30.0 |
| | | default: |
| | | priorDayPrice = product.price.doubleValue |
| | | } |
| | | |
| | | |
| | | |
| | | lable_priorDay.text = String(format:"%@%@/天", product.priceLocale.currencySymbol!,priorDayPrice.jq_formatFloat) |
| | | if state{ |
| | | contentView.backgroundColor = UIColor(hexString: "#A6C586") |
| | |
| | | import UIKit |
| | | import JQTools |
| | | import StoreKit |
| | | import RxSwift |
| | | |
| | | class WalletRechargeVC: BaseVC { |
| | | |
| | |
| | | private let cellH:Double = 35 |
| | | private var productList = Set<String>() |
| | | private var products = [SKProduct]() |
| | | private var oldPrice:Double = 0 |
| | | private var timeLoopDisposeBag = DisposeBag() |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | |
| | | let h = ceil(4.0 / 4.0) * cellH + floor((4.0 - 1) / 4.0) * 27.0 |
| | | cons_collectionHei.constant = h |
| | | view.layoutIfNeeded() |
| | | |
| | | Services.myWallet().subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | self.oldPrice = m.recharge |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | InPurchaseManager.instance().setProductList(productList) { products in |
| | | self.products = Array(products) |
| | |
| | | sceneDelegate?.needLogin() |
| | | return} |
| | | |
| | | showHUD("正在进行内购买") |
| | | let product = products[selectIndexPath.row] |
| | | InPurchaseManager.purchaseProduct(ID: product.productIdentifier, applicationUsername: userId.string) { model in |
| | | if model.status == 0{ |
| | | //需要后端监听推送后,才会更新金额,可能延迟 |
| | | NotificationCenter.default.post(name: Refreh_PaymentWallet_Noti, object: nil) |
| | | InPurchaseManager.purchaseProduct(ID: product.productIdentifier, applicationUsername: userId.string) {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if result.status == 0{ |
| | | let transactionId = result.receipt?.in_app.first?.original_transaction_id ?? "" |
| | | Services.placeOrderApple(amount: product.price.doubleValue, balanceFlag: .no, orderFrom: 4, transactionIdentifier: transactionId, vipType: nil).subscribe(onNext: { data in |
| | | showHUD("正在查询购买结果") |
| | | let observable = Observable<Int>.interval(RxTimeInterval.seconds(5), scheduler: MainScheduler.instance) |
| | | observable.subscribe { event in |
| | | Services.myWallet().subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | if m.recharge != weakSelf.oldPrice{ |
| | | hiddenHUD() |
| | | alertSuccess(msg: "购买成功") |
| | | weakSelf.timeLoopDisposeBag = DisposeBag() |
| | | NotificationCenter.default.post(name: WithDrawReply_Noti, object: nil) |
| | | DispatchQueue.main.asyncAfter(delay: 1.0) { |
| | | weakSelf.navigationController?.popViewController() |
| | | } |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }.disposed(by: weakSelf.timeLoopDisposeBag) |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } errorClouse: { error in |
| | | alertError(msg: error.localizedDescription) |
| | |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_WalletCCell", for: indexPath) as! WalletCCell |
| | | cell.selectAt(indexPath == selectIndexPath) |
| | | let product = products[indexPath.row] |
| | | cell.lable_title.text = product.localizedTitle |
| | | cell.lable_title.text = product.price.stringValue |
| | | |
| | | btn_handle.isEnabled = true |
| | | btn_handle.alpha = 1.0 |
| | |
| | | import RxRelay |
| | | import RxSwift |
| | | |
| | | let WatchHistory_Noti = Notification.Name.init("WatchHistory_Noti") |
| | | |
| | | class WatchHistoryViewModel:RefreshModel<CourseModel>{ |
| | | |
| | | let state = BehaviorRelay<Int>(value: 1) |
| | |
| | | viewModel.configure(collectionView) |
| | | viewModel.beginRefresh() |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(WatchHistory_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] _ in |
| | | self?.viewModel.beginRefresh() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | |
| | | extension WatchHistoryDetailVC:UICollectionViewDelegate & UICollectionViewDataSource{ |
| | |
| | | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | |
| | | let m = viewModel.dataSource.value[indexPath.row] |
| | | let item = viewModel.dataSource.value[indexPath.row] |
| | | |
| | | if m.paymentStatus == .yes{ |
| | | //todo |
| | | |
| | | if viewModel.state.value == 1{ |
| | | //待支付 |
| | | if item.paymentStatus == .yes{ |
| | | Services.getMeditationDetail(id: item.businessId).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | let vc = PaymentOrderVC(museItemModel: m, type: .muse, giftToOther: false, showType: .horizontal,businessId: item.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | return |
| | | } |
| | | |
| | | |
| | | if viewModel.state.value == 1{ |
| | | Services.getMeditationDetail(id: m.businessId).subscribe(onNext: {data in |
| | | Services.getMeditationDetail(id: item.businessId).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | let vc = HomeItemDetailVC(model: m) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | }else{ |
| | | if m.courseType == .online{ |
| | | // let vc = CourseDetialVC(courseId: m.businessId) |
| | | // JQ_currentViewController().jq_push(vc: vc) |
| | | Services.getCourseDetail(courseId: m.businessId).subscribe(onNext: {data in |
| | | if item.courseType == .online{ |
| | | |
| | | //待支付 |
| | | if item.paymentStatus == .yes{ |
| | | Services.getCourseDetail(courseId: item.businessId).subscribe(onNext: { data in |
| | | if let m = data.data{ |
| | | let vc = PaymentOrderVC(courseItemModel: m, type: .course, giftToOther: false, showType: .horizontal,businessId: item.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | return |
| | | } |
| | | |
| | | |
| | | Services.getCourseDetail(courseId: item.businessId).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | if m.isVip == .no && m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: m.businessId) |
| | | let vc = CourseDetialOfflineVC(courseId: item.businessId) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | |
| | | var imageUrl: String = "" |
| | | var meditationId: Int = 0 |
| | | var startPlayTime: String = "" |
| | | var time:Int = 0 |
| | | |
| | | var playAtMe:Bool = false |
| | | } |
| | | |
| | | struct MeditationListModel:HandyJSON{ |
| | |
| | | var paymentStatus:ConditionType = .no //支付状态 1待支付 2已支付 |
| | | var isVip:ConditionType = .no |
| | | var time:Int = 0 |
| | | var imageUrl:String = "" |
| | | |
| | | required init(){} |
| | | } |
| | |
| | | var paymentStatus:ConditionType = .no //支付状态 1待支付 2已支付 |
| | | var coverDescription:String = "" |
| | | |
| | | var courseId:Int? |
| | | var list2 = [CourseModel]() |
| | | var list = [CourseItemModel]() |
| | | |
| | | required init(){} |
| | | } |
| | | |
| | | struct CourseItemModel:HandyJSON{ |
| | | class CourseItemModel:HandyJSON{ |
| | | var chapterTitle:String = "" |
| | | var courseId: Int = 0 |
| | | var createBy:String = "" |
| | |
| | | var updateTime:String = "" |
| | | var videoUrl:String = "" |
| | | var virtualLearnedNum: Int = 0 |
| | | |
| | | required init(){} |
| | | } |
| | | |
| | | |
| | |
| | | var email: String = "" |
| | | var freezingOperator: String = "" |
| | | var freezingReason: String = "" |
| | | var gender: GenderType = .encrypt |
| | | var gender: GenderType? |
| | | var hometown: String = "" |
| | | var id: Int = 0 |
| | | var income: Int = 0 |
| | |
| | | sharedSessionManager.request(params.url.absoluteString, method: method, parameters:params.done(), encoding: newEncoding, headers:headers).validate().responseData{response in |
| | | LogInfo("请求地址:\(params.url)") |
| | | LogInfo("请求参数:\(params.params)") |
| | | if progress{ |
| | | hiddenHUD(0.5) |
| | | } |
| | | |
| | | guard response.error == nil else { |
| | | LogError("\(response.error!)") |
| | |
| | | |
| | | #if DEBUG |
| | | 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" |
| | |
| | | .append(key: "receiverId", value: receiverId) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func gvieCourseAgain(orderForm:PaymentOrderVC.PaymentOrderType,id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/order/client/order/order/payOrder") |
| | | .append(key: "id", value: id) |
| | | .append(key: "type", value: 2) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func cancelOrder(id:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/order/mgt/order/order/cancel") |
| | | .append(key: "uid", value: id) |
| | | return NetworkRequest.request(params: params, method: .get, progress: true) |
| | | } |
| | | |
| | | |
| | | /// 苹果支付 |
| | | /// - Parameters: |
| | | /// - amount: 购买会员的金额/充值金额 |
| | | /// - balanceFlag: 是否使用余额抵扣 1=是 2=否 |
| | | /// - orderFrom: 订单来源 1=冥想音频 2=课程 3=购买会员 4充值 |
| | | /// - transactionIdentifier: 苹果订单id |
| | | /// - vipType: 订单类型为会员时 必传 会员类型 1月度 2季度 3年度 |
| | | class func placeOrderApple(amount:Double,balanceFlag:ConditionType,orderFrom:Int,transactionIdentifier:String,vipType:Int?)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/order/client/order/order/placeOrderApple") |
| | | .append(key: "amount", value: amount) |
| | | .append(key: "balanceFlag", value: balanceFlag.rawValue) |
| | | .append(key: "orderFrom", value: orderFrom) |
| | | .append(key: "transactionIdentifier", value: transactionIdentifier) |
| | | .append(key: "vipType", value: vipType) |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | } |
| | | |
| | | /// 疗愈馆 |
| | |
| | | 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) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true) |
| | | } |
| | | |
| | | /// 获取用户信息 |
| | | class func getUserDetail()->Observable<BaseResponse<UserInfoModel>>{ |
| | | class func getUserDetail(showProgress:Bool = true)->Observable<BaseResponse<UserInfoModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/user/client/app-user/getUserDetail") |
| | | .append(key: "apipost_id", value: "2fc350e9799588") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | return NetworkRequest.request(params: params, method: .post, progress: showProgress,ignoreAlert: true) |
| | | } |
| | | |
| | | /// 获取用户信息 |
| | |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | | class func myWallet()->Observable<BaseResponse<WalletModel>>{ |
| | | class func myWallet(showprogress: Bool = false)->Observable<BaseResponse<WalletModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | params.interface(url: "/user/client/app-user/wallet") |
| | | .append(key: "apipost_id", value: "3518e3f0b99420") |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | return NetworkRequest.request(params: params, method: .post, progress: showprogress,ignoreAlert: true) |
| | | } |
| | | |
| | | class func getMyBankList()->Observable<BaseResponse<[BankInfoModel]>>{ |
| | |
| | | @IBAction func customReduceAction(_ sender: Any) { |
| | | userCustomer() |
| | | var t = tf_input.text?.int ?? 1 |
| | | t -= 1 |
| | | t = max(1,t) |
| | | status = .choose(t) |
| | | tf_input.text = t.string |
| | |
| | | player.url = Url |
| | | |
| | | if needFirstImage{ |
| | | URL.jq_splitVideoFileUrlFps(splitFileUrl: Url, fps: 1) {[weak self] state, images in |
| | | URL.jq_splitVideoFileUrlFps(splitFileUrl: Url, fps: 30) {[weak self] state, images in |
| | | if let first = images.first{ |
| | | DispatchQueue.main.async { |
| | | self?.addPlaceHoderView(firstFPSImage: first) |
| | |
| | | private(set) var url:String? |
| | | private(set) var htmlText:String? |
| | | private(set) var baseUrl:URL? |
| | | private var showHelp = false |
| | | private var progressView = UIProgressView() |
| | | private let jsCode = """ |
| | | var meta = document.createElement('meta');" |
| | |
| | | public var tintColor = UIColor.blue |
| | | private var subVC:Bool = false |
| | | |
| | | public convenience init(url:String) { |
| | | public convenience init(url:String,showHelp:Bool = false) { |
| | | self.init() |
| | | self.url = url |
| | | self.showHelp = showHelp |
| | | } |
| | | |
| | | public convenience init(type:AgreementType,subVC:Bool = false){ |
| | |
| | | |
| | | public override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | |
| | | if showHelp{ |
| | | let btn = UIButton(type: .custom) |
| | | btn.setTitle("我的助力", for: .normal) |
| | | btn.setTitleColor(UIColor(hexString: "#353535"), for: .normal) |
| | | btn.titleLabel?.font = .systemFont(ofSize: 15) |
| | | btn.addTarget(self, action: #selector(myHelpAction), for: .touchUpInside) |
| | | navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn) |
| | | } |
| | | |
| | | |
| | | let config = WKWebViewConfiguration() |
| | | let userScript = WKUserScript(source: jsCode, injectionTime: .atDocumentStart, forMainFrameOnly: true) |
| | |
| | | } |
| | | } |
| | | |
| | | @objc func myHelpAction(){ |
| | | let vc = WebVC(url: ShareUrl + "/ranking/recommend?userId=\(UserViewModel.getAvatarInfo().id)") |
| | | vc.title = "我的助力" |
| | | push(vc: vc) |
| | | } |
| | | |
| | | deinit { |
| | | webView?.removeObserver(self, forKeyPath: "estimatedProgress") |
| | | } |
| | |
| | | |
| | | @objc func showDetailAction(){ |
| | | if let id = meditationModel?.id{ |
| | | |
| | | Services.getMeditationDetail(id: id).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | if let m = data.data{ |
| | |
| | | self.startRunloopAni() |
| | | PayMusicVC.updateStatus(.playing) |
| | | } |
| | | DispatchQueue.main.asyncAfter(delay: 0.4) { |
| | | NotificationCenter.default.post(name: ReloadData_Noti, object: nil, userInfo: nil) |
| | | } |
| | | } |
| | | |
| | | @objc func closeAction(_ btn:UIButton){ |
| | |
| | | if UserDefaultSettingViewModel.getSetting()?.bgm != nil{ |
| | | AudioPlayer.getSharedInstance().playSceneAt(UserDefaultSettingViewModel.getSetting()!.bgm!.audioFile) |
| | | } |
| | | |
| | | DispatchQueue.main.asyncAfter(delay: 0.4) { |
| | | NotificationCenter.default.post(name: ReloadData_Noti, object: nil, userInfo: nil) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | private var timer:Timer? |
| | | private(set) var times = BehaviorRelay<Int?>(value: nil) //倒计时定时器 |
| | | private static var _sharedInstance: AudioPlayer? |
| | | private(set) var meditationModel:MeditationModel? //疗愈音频 |
| | | var meditationModel:MeditationModel? //疗愈音频 |
| | | var lisenMuseTime:Int = 0 //听疗愈时间记录 |
| | | |
| | | weak var delegate:PayMusicDelegate? |
| | |
| | | |
| | | if let m = weakSelf.meditationModel{ |
| | | var dic = [String:Any]() |
| | | dic[MPMediaItemPropertyTitle] = m |
| | | dic[MPMediaItemPropertyTitle] = m.meditationTitle |
| | | dic[MPMediaItemPropertyArtist] = "泉疗愈" |
| | | dic[MPMediaItemPropertyDiscNumber] = 1 |
| | | dic[MPNowPlayingInfoPropertyElapsedPlaybackTime] = loadTime |
| | |
| | | } |
| | | } |
| | | |
| | | self.bgmPlayer?.currentItem?.rx.observe(AVPlayerItem.Status.self,"status").subscribe(onNext: { _ in |
| | | self.bgmPlayer?.rx.observe(AVPlayer.TimeControlStatus.self,"timeControlStatus").subscribe(onNext: { state in |
| | | DispatchQueue.main.asyncAfter(delay: 1.0) { |
| | | if state == .paused{ |
| | | print("----》暂停") |
| | | PayMusicVC.updateStatus(.pause) |
| | | }else if state == .playing{ |
| | | print("----》播放") |
| | | PayMusicVC.updateStatus(.playing) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | |
| | | self.bgmPlayer?.currentItem?.rx.observe(AVPlayerItem.Status.self,"status").subscribe(onNext: { _ in |
| | | print("---MasterStatus1: \(self.masterPlayer?.status.rawValue ?? 0)") |
| | | print("---bgmStatus1: \(self.bgmPlayer?.status.rawValue ?? 0)") |
| | | if self.bgmPlayer?.status == .readyToPlay && self.masterPlayer?.status == .readyToPlay{ |
| | | self.bgmPlayer?.play() |
| | | self.masterPlayer?.play() |
| | |
| | | |
| | | self.masterPlayer?.currentItem?.rx.observe(AVPlayerItem.Status.self,"status").subscribe(onNext: { _ in |
| | | print("---MasterStatus: \(self.masterPlayer?.status.rawValue ?? 0)") |
| | | print("---bgmStatus: \(self.bgmPlayer?.status.rawValue ?? 0)") |
| | | if self.bgmPlayer?.status == .readyToPlay && self.masterPlayer?.status == .readyToPlay{ |
| | | self.bgmPlayer?.play() |
| | | self.masterPlayer?.play() |
| | |
| | | AudioPlayer.getSharedInstance().bgmPlayer?.play() |
| | | AudioPlayer.getSharedInstance().masterPlayer?.play() |
| | | PayMusicVC.updateStatus(.playing) |
| | | }else if UserDefaultSettingViewModel.getSetting()?.bgm != nil{ |
| | | }else if UserDefaultSettingViewModel.getSetting()?.bgm != nil && !(JQ_currentNavigationController().viewControllers.first is PlanGuideVC){ |
| | | AudioPlayer.getSharedInstance().playSceneAt(UserDefaultSettingViewModel.getSetting()!.bgm!.audioFile) |
| | | } |
| | | } |
| | |
| | | let vc = PlanGuide_1_VC() |
| | | self?.jq_push(vc: vc) |
| | | case .toSeting: |
| | | // self?.dismiss(animated: true) { |
| | | let vc = BackgroundVoiceVC(isFromFist: self?.isFromFist ?? false) |
| | | vc.hidesBottomBarWhenPushed = true |
| | | JQ_currentNavigationController().pushViewController(vc) |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @IBAction func backAction(_ sender: UIButton) { |
| | | NotificationCenter.default.post(name: PlantGuideQuit_Noti, object: nil) |
| | | if var m = UserDefaultSettingViewModel.getSetting(){ |
| | | m.userFirstLaunch = false |
| | | UserDefaultSettingViewModel.saveSetting(m) |
| | | } |
| | | } |
| | | |
| | | @IBAction func answerAction(_ sender: UIButton) { |
| | |
| | | Services.treeInfo().subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | self.taskListView.setTreeInfoModel(m) |
| | | |
| | | //检查hash,进行同步 |
| | | // if m.toJSON()?.jq_hash() != self.treeInfoModel?.toJSON()?.jq_hash(){ |
| | | self.treeInfoModel = m |
| | | self.updateTreeInfo() |
| | | self.updateAni(false) |
| | | try? self.cacheTreeInfoModel.save(m) |
| | | // } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | |
| | | private func updateTreeInfo(){ |
| | | btn_seedingAgain.isHidden = treeInfoModel!.treeLevelType != .level_10 |
| | | |
| | | // if treeLevel.rawValue != treeInfoModel?.treeLevelType.rawValue{ |
| | | // treeLevel = treeInfoModel!.treeLevelType |
| | | // } |
| | | icon_energy.text = String(format: "当前能量值:%ld", treeInfoModel!.energyValue) |
| | | setProgress(current: treeInfoModel!.growthValue, total: treeInfoModel!.nextLevel) |
| | | } |
| | |
| | | if let m = data.data{ |
| | | sender.isUserInteractionEnabled = true |
| | | if m.isNext{ |
| | | let type = weakSelf.treeInfoModel?.treeLevelType ?? .level_1 |
| | | weakSelf.treeInfoModel!.treeLevelType = m.treeLevelType |
| | | |
| | | let h = (JQ_ScreenW - 90) * 0.7729 |
| | |
| | | weakSelf.voicePlayer.replaceCurrentItem(with: AVPlayerItem(url: soundURL)) |
| | | weakSelf.voicePlayer.play() |
| | | } |
| | | } |
| | | |
| | | weakSelf.updateAni() |
| | | weakSelf.getTreeData() |
| | | return |
| | | } |
| | | |
| | | weakSelf.treeInfoModel?.growthValue = m.growthValue |
| | | weakSelf.treeInfoModel?.energyValue = 0 |
| | |
| | | |
| | | extension TreeTeskVC:CAAnimationDelegate{ |
| | | func animationDidStart(_ anim: CAAnimation) { |
| | | print("开始动画") |
| | | treeImage.isUserInteractionEnabled = false |
| | | } |
| | | |
| | | func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { |
| | | print("结束动画") |
| | | if anim.value(forKey: "customType") as! String == "ani_flower"{ |
| | | |
| | | |
| | | } |
| | | // print("结束动画") |
| | | // if anim.value(forKey: "customType") as! String == "ani_flower"{ |
| | | // |
| | | // |
| | | // } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //判断是否需要登录 |
| | | @discardableResult |
| | | func checkisLoginState()->Bool{ |
| | | if UserViewModel.getLoginInfo()?.accessToken.isEmpty ?? true{ |
| | | sceneDelegate?.needLogin() |
| | |
| | | }else{ |
| | | WXApi.handleOpen(URLContexts.first!.url, delegate: self) |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |