New file |
| | |
| | | { |
| | | "images" : [ |
| | | { |
| | | "idiom" : "universal", |
| | | "scale" : "1x" |
| | | }, |
| | | { |
| | | "filename" : "btn_add_large_2@2x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "2x" |
| | | }, |
| | | { |
| | | "filename" : "btn_add_large_2@3x.png", |
| | | "idiom" : "universal", |
| | | "scale" : "3x" |
| | | } |
| | | ], |
| | | "info" : { |
| | | "author" : "xcode", |
| | | "version" : 1 |
| | | } |
| | | } |
| | |
| | | @IBOutlet weak var webView: WKWebView! |
| | | @IBOutlet weak var cons_webHeight: NSLayoutConstraint! |
| | | @IBOutlet weak var view_btns: UIView! |
| | | private var needBackBtn:Bool? |
| | | private var needBackBtn:Bool! |
| | | |
| | | init(type:AgreentType,customTitle:String? = nil,content:String? = nil,needBackBtn:Bool? = nil) { |
| | | init(type:AgreentType,customTitle:String? = nil,content:String? = nil,needBackBtn:Bool = false) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.type = type |
| | | self.content = content |
| | |
| | | view_btns.isHidden = false |
| | | if needBackBtn == false{ |
| | | navigationItem.leftBarButtonItem = UIBarButtonItem() |
| | | }else{ |
| | | view_btns.isHidden = true |
| | | } |
| | | default: |
| | | view_btns.isHidden = true |
| | |
| | | |
| | | @IBOutlet weak var img_QRCode: UIImageView! |
| | | @IBOutlet weak var btn_close: UIButton! |
| | | @IBOutlet weak var label_title: UILabel! |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | alpha = 0 |
| | | label_title.isHidden = true |
| | | img_QRCode.transform = CGAffineTransform(scaleX: 0.1, y: 0.1) |
| | | btn_close.alpha = 0 |
| | | layoutIfNeeded() |
| | | } |
| | | |
| | | static func show(_ text:String){ |
| | | static func show(_ text:String,title:String? = nil){ |
| | | let preView = QRPreview.jq_loadNibView() |
| | | preView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | preView.img_QRCode.image = QRCodeImage(string: text, size: (JQ_ScreenW - 88) * sceneDelegate!.window!.screen.scale) |
| | | preView.label_title.text = title |
| | | |
| | | |
| | | sceneDelegate?.window?.addSubview(preView) |
| | | |
| | | UIView.animate(withDuration: 0.5) { |
| | | preView.alpha = 1 |
| | | if title == nil{ |
| | | preView.label_title.isHidden = true |
| | | preView.img_QRCode.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) |
| | | }else{ |
| | | preView.label_title.isHidden = false |
| | | preView.img_QRCode.transform = CGAffineTransform(scaleX: 0.9, y: 0.9) |
| | | } |
| | | preView.layoutIfNeeded() |
| | | } completion: { complete in |
| | | if complete{ |
| | |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/> |
| | | <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="0.0" y="0.0" width="393" height="852"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6HX-Cl-1DV"> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TVQ-se-KCE"> |
| | | <rect key="frame" x="44" y="273.66666666666669" width="305" height="305.00000000000006"/> |
| | | <subviews> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="omp-OX-ywi"> |
| | | <rect key="frame" x="0.0" y="0.0" width="305" height="305"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="--" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ezD-1O-ihZ"> |
| | | <rect key="frame" x="0.0" y="0.0" width="305" height="46"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="46" id="4Ei-5X-kUi"/> |
| | | </constraints> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="21"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6HX-Cl-1DV"> |
| | | <rect key="frame" x="0.0" y="46" width="305" height="259"/> |
| | | <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" secondItem="6HX-Cl-1DV" secondAttribute="height" multiplier="1:1" id="qZS-VY-glI"/> |
| | | </constraints> |
| | | </imageView> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uua-ww-qMC"> |
| | | <rect key="frame" x="175.66666666666666" y="619.66666666666663" width="42" height="42"/> |
| | | </subviews> |
| | | </stackView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="42" id="VB4-al-dnO"/> |
| | | <constraint firstAttribute="height" constant="42" id="fYE-6n-Jdz"/> |
| | | <constraint firstItem="omp-OX-ywi" firstAttribute="leading" secondItem="TVQ-se-KCE" secondAttribute="leading" id="MQf-so-2YR"/> |
| | | <constraint firstAttribute="width" secondItem="TVQ-se-KCE" secondAttribute="height" multiplier="1:1" id="eEW-WY-qk5"/> |
| | | <constraint firstAttribute="trailing" secondItem="omp-OX-ywi" secondAttribute="trailing" id="sum-wH-Hz6"/> |
| | | <constraint firstItem="omp-OX-ywi" firstAttribute="top" secondItem="TVQ-se-KCE" secondAttribute="top" id="wi4-8G-1DX"/> |
| | | <constraint firstAttribute="bottom" secondItem="omp-OX-ywi" secondAttribute="bottom" id="z5X-IE-asj"/> |
| | | </constraints> |
| | | </view> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uua-ww-qMC"> |
| | | <rect key="frame" x="175.66666666666666" y="619.66666666666663" width="42" height="43"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <state key="normal" image="btn_close_1"/> |
| | | <connections> |
| | |
| | | </subviews> |
| | | <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.90000000000000002" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstAttribute="trailing" secondItem="6HX-Cl-1DV" secondAttribute="trailing" constant="44" id="97i-gB-Zk8"/> |
| | | <constraint firstItem="Uua-ww-qMC" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Hsf-NB-MIA"/> |
| | | <constraint firstItem="6HX-Cl-1DV" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="44" id="KmT-Q0-pyD"/> |
| | | <constraint firstItem="6HX-Cl-1DV" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="UGF-9N-bzH"/> |
| | | <constraint firstItem="Uua-ww-qMC" firstAttribute="top" secondItem="6HX-Cl-1DV" secondAttribute="bottom" constant="41" id="fgE-fX-MS9"/> |
| | | <constraint firstItem="6HX-Cl-1DV" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="uEH-Zs-7cc"/> |
| | | <constraint firstItem="Uua-ww-qMC" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="06a-BT-uko"/> |
| | | <constraint firstItem="TVQ-se-KCE" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="LOt-mN-q8V"/> |
| | | <constraint firstItem="TVQ-se-KCE" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="iu0-Vj-rEP"/> |
| | | <constraint firstItem="Uua-ww-qMC" firstAttribute="top" secondItem="TVQ-se-KCE" secondAttribute="bottom" constant="41" id="k8O-8x-dRQ"/> |
| | | <constraint firstItem="TVQ-se-KCE" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="44" id="odi-8W-l92"/> |
| | | <constraint firstAttribute="trailing" secondItem="TVQ-se-KCE" secondAttribute="trailing" constant="44" id="s3J-kY-3ER"/> |
| | | </constraints> |
| | | <connections> |
| | | <outlet property="btn_close" destination="Uua-ww-qMC" id="0hz-tc-D5t"/> |
| | | <outlet property="img_QRCode" destination="6HX-Cl-1DV" id="3vh-6u-afq"/> |
| | | <outlet property="label_title" destination="ezD-1O-ihZ" id="GcM-gS-NdK"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="54" y="21"/> |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | | <image name="btn_close_1" width="42" height="43"/> |
| | | <systemColor name="systemBackgroundColor"> |
| | | <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
| | | </systemColor> |
| | | </resources> |
| | | </document> |
| | |
| | | enum ItemType{ |
| | | case course |
| | | case activity |
| | | case worldCup |
| | | } |
| | | |
| | | /// 获取短信验证码类型 |
| | |
| | | var orderString = "" |
| | | var returnId = 0 |
| | | var siteBooking:Int = 0 |
| | | |
| | | var appid = "" |
| | | var noncestr = "" |
| | | var package = "" |
| | | var partnerid = "" |
| | | var prepayid = "" |
| | | var sign = "" |
| | | var timestamp:TimeInterval = 0 |
| | | |
| | | } |
| | | |
| | | struct StoreWalfareModel:HandyJSON{ |
| | |
| | | var height:Double = 0 |
| | | var weight:Double = 0 |
| | | var isStudent = 0 // 1:是学员, 0:否 |
| | | var headImg = "" |
| | | var avatar = "" |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /// 编辑参赛人员信息 |
| | | class func editParticipant(id:Int,height:Int,weight:Int,phone:String?,isStudent:Int)->Observable<BaseResponse<SimpleModel>>{ |
| | | class func editParticipant(id:Int,height:Int,weight:Int,phone:String?,isStudent:Int,headImg:String)->Observable<BaseResponse<SimpleModel>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/editParticipant") |
| | | .append(key: "id", value: id) |
| | |
| | | .append(key: "weight", value: weight) |
| | | .append(key: "phone", value: phone) |
| | | .append(key: "isStudent", value: isStudent) |
| | | .append(key: "headImg", value: headImg) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | |
| | | .interface(url: "/competition/api/participant/editParticipant") |
| | | .append(key: "id", value: model.id) |
| | | .append(key: "idcard", value: model.idcard) |
| | | .append(key: "headImg",value: model.headImg) |
| | | return NetworkRequest.request(params: params, method: .post, progress: true) |
| | | } |
| | | |
| | |
| | | extension Services{ |
| | | static func startNetworkMonitor(){ |
| | | let manager = NetworkReachabilityManager(host: All_Url) |
| | | manager?.startListening(onUpdatePerforming: { status in |
| | | switch status { |
| | | case .notReachable:alertError(msg: "当前网络不可用") |
| | | case .reachable(let type): |
| | | switch type{ |
| | | case .ethernetOrWiFi:alert(msg: "当前为Wi-Fi网络") |
| | | case .cellular:alert(msg: "当前为移动网络") |
| | | } |
| | | default:break |
| | | } |
| | | }) |
| | | // manager?.startListening(onUpdatePerforming: { status in |
| | | // switch status { |
| | | // case .notReachable:alertError(msg: "当前网络不可用") |
| | | // case .reachable(let type): |
| | | // switch type{ |
| | | // case .ethernetOrWiFi:alert(msg: "当前为Wi-Fi网络") |
| | | // case .cellular:alert(msg: "当前为移动网络") |
| | | // } |
| | | // default:break |
| | | // } |
| | | // }) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: Any) { |
| | | let vc = AddStudentVC(type: .activity) |
| | | let vc = AddStudentVC(type: .activity,activityDetailPartModel: nil) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | |
| | | let StudentUpdate_Nofi = Notification.Name.init("StudentUpdate_Nofi") |
| | | class StudentUpdateInfoView: UIView,JQNibView{ |
| | | |
| | | @IBOutlet weak var img_profile: UIImageView! |
| | | @IBOutlet weak var view_profile: UIView! |
| | | @IBOutlet weak var view_container: UIView! |
| | | @IBOutlet weak var cons_bottom: NSLayoutConstraint! |
| | | @IBOutlet weak var tf_height: QMUITextField! |
| | |
| | | @IBOutlet weak var tf_phone: QMUITextField! |
| | | |
| | | private var model:ActivityDetailPartModel? |
| | | private var updateUserProfile:Bool = false |
| | | private let disposeBag = DisposeBag() |
| | | private var profileImg:UIImage? |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | cons_bottom.constant = -(JQ_ScreenW / 2) |
| | | alpha = 0 |
| | | layoutIfNeeded() |
| | | |
| | | let tap = UITapGestureRecognizer(target: self, action: #selector(userImgUploadAction)) |
| | | img_profile.isUserInteractionEnabled = true |
| | | img_profile.addGestureRecognizer(tap) |
| | | |
| | | NotificationCenter.default.rx.notification(UIApplication.keyboardWillHideNotification).subscribe(onNext: {noti in |
| | | if let userInfo = noti.userInfo{ |
| | |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | static func show(_ model:ActivityDetailPartModel){ |
| | | static func show(_ model:ActivityDetailPartModel,updateUserProfile:Bool = false){ |
| | | let storesView = StudentUpdateInfoView.jq_loadNibView() |
| | | storesView.model = model |
| | | storesView.updateUserProfile = updateUserProfile |
| | | storesView.view_profile.isHidden = !updateUserProfile |
| | | storesView.frame = sceneDelegate?.window?.frame ?? .zero |
| | | sceneDelegate?.window?.addSubview(storesView) |
| | | storesView.cons_bottom.constant = 0 |
| | |
| | | storesView.tf_height.text = "\(model.height.int)" |
| | | storesView.tf_weight.text = "\(model.weight.int)" |
| | | |
| | | if updateUserProfile{ |
| | | storesView.img_profile.sd_setImage(with: URL(string: model.headImg),placeholderImage: UIImage(named: "btn_add_large_2")) |
| | | } |
| | | |
| | | UIView.animate(withDuration: 0.4) { |
| | | storesView.alpha = 1 |
| | | storesView.layoutIfNeeded() |
| | | } |
| | | } |
| | | |
| | | @objc func userImgUploadAction(){ |
| | | JQ_ImagePickerTool.getSharedInstance().singleImage({ [weak self] image in |
| | | self?.img_profile.image = image |
| | | self?.profileImg = image |
| | | }, clipSize: CGSize(width: JQ_ScreenW, height: JQ_ScreenW)) |
| | | } |
| | | |
| | | |
| | |
| | | guard tf_height.text!.int != 0 else {alertError(msg: "请输入正确的身高");return} |
| | | guard tf_weight.text!.int != 0 else {alertError(msg: "请输入正确的体重");return} |
| | | |
| | | guard profileImg != nil || !(model?.headImg.isEmpty ?? true) else { |
| | | alertError(msg: "请上传头像");return |
| | | } |
| | | |
| | | self.endEditing(true) |
| | | Services.editParticipant(id: model!.id, height: tf_height.text!.int ?? 0, weight: tf_weight.text!.int ?? 0, phone: tf_phone.text,isStudent: model!.isStudent).subscribe(onNext: {data in |
| | | |
| | | if profileImg != nil{ |
| | | showHUD("正在上传头像") |
| | | profileImg!.uploadImgToService().subscribe(onNext: { [weak self] imgUrl in |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.model?.headImg = imgUrl |
| | | hiddenHUD() |
| | | weakSelf.saveEdit() |
| | | }, onError: { error in |
| | | hiddenHUD() |
| | | alertError(msg: error.localizedDescription) |
| | | }).disposed(by: disposeBag) |
| | | }else{ |
| | | saveEdit() |
| | | } |
| | | } |
| | | |
| | | private func saveEdit(){ |
| | | Services.editParticipant(id: model!.id, height: tf_height.text!.int ?? 0, weight: tf_weight.text!.int ?? 0, phone: tf_phone.text,isStudent: model!.isStudent,headImg: model!.headImg).subscribe(onNext: {data in |
| | | alertSuccess(msg: "修改成功") |
| | | DispatchQueue.main.asyncAfter(deadline: .now()+1) { |
| | | NotificationCenter.default.post(name: StudentUpdate_Nofi, object: nil) |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> |
| | | <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"> |
| | | <device id="retina6_12" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/> |
| | | <capability name="Named colors" 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"/> |
| | |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FQP-Da-djy"> |
| | | <rect key="frame" x="0.0" y="560.66666666666663" width="393" height="291.33333333333337"/> |
| | | <rect key="frame" x="0.0" y="420.66666666666674" width="393" height="431.33333333333326"/> |
| | | <subviews> |
| | | <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="V13-39-Dea"> |
| | | <rect key="frame" x="0.0" y="16" width="393" height="151.33333333333334"/> |
| | | <rect key="frame" x="0.0" y="16" width="393" height="291.33333333333331"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Whm-kp-4GP"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="140"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="btn_add_large_2" translatesAutoresizingMaskIntoConstraints="NO" id="bj7-gH-bLI"> |
| | | <rect key="frame" x="145.66666666666666" y="19" width="102" height="102"/> |
| | | <constraints> |
| | | <constraint firstAttribute="width" constant="102" id="dAb-dt-iR0"/> |
| | | <constraint firstAttribute="height" constant="102" id="qdQ-fr-ZOH"/> |
| | | </constraints> |
| | | <userDefinedRuntimeAttributes> |
| | | <userDefinedRuntimeAttribute type="boolean" keyPath="ld_maskToBoundsXIB" value="YES"/> |
| | | <userDefinedRuntimeAttribute type="number" keyPath="ld_cornerRadiusXIB"> |
| | | <real key="value" value="51"/> |
| | | </userDefinedRuntimeAttribute> |
| | | </userDefinedRuntimeAttributes> |
| | | </imageView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | | <constraint firstItem="bj7-gH-bLI" firstAttribute="centerY" secondItem="Whm-kp-4GP" secondAttribute="centerY" id="Cj3-JO-u5V"/> |
| | | <constraint firstAttribute="height" constant="140" id="VZw-jM-bvY"/> |
| | | <constraint firstItem="bj7-gH-bLI" firstAttribute="centerX" secondItem="Whm-kp-4GP" secondAttribute="centerX" id="Vee-F2-jZH"/> |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cId-Io-SsC"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="50.666666666666664"/> |
| | | <rect key="frame" x="0.0" y="139.99999999999994" width="393" height="50.666666666666657"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_item_p" translatesAutoresizingMaskIntoConstraints="NO" id="3qc-L3-U16"> |
| | | <rect key="frame" x="15" y="19.333333333333371" width="12" height="12"/> |
| | |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sbO-PZ-2I4"> |
| | | <rect key="frame" x="0.0" y="50.666666666666742" width="393" height="50.333333333333343"/> |
| | | <rect key="frame" x="0.0" y="190.66666666666669" width="393" height="50.333333333333343"/> |
| | | <subviews> |
| | | <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_item_p" translatesAutoresizingMaskIntoConstraints="NO" id="4a2-W8-ZB1"> |
| | | <rect key="frame" x="15" y="19" width="12" height="12"/> |
| | |
| | | </constraints> |
| | | </view> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jhb-ug-p8L"> |
| | | <rect key="frame" x="0.0" y="101" width="393" height="50.333333333333343"/> |
| | | <rect key="frame" x="0.0" y="240.99999999999997" width="393" height="50.333333333333343"/> |
| | | <subviews> |
| | | <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NGC-Ss-4rN"> |
| | | <rect key="frame" x="14" y="50" width="365" height="0.3333333333333357"/> |
| | |
| | | </subviews> |
| | | </stackView> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lxt-la-hhb"> |
| | | <rect key="frame" x="41" y="192.33333333333337" width="146" height="40"/> |
| | | <rect key="frame" x="41" y="332.33333333333331" width="146" height="40"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="40" id="LMv-4a-nfN"/> |
| | | </constraints> |
| | |
| | | </connections> |
| | | </button> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Pdv-hP-j5u"> |
| | | <rect key="frame" x="207" y="192.33333333333337" width="146" height="40"/> |
| | | <rect key="frame" x="207" y="332.33333333333331" width="146" height="40"/> |
| | | <color key="backgroundColor" name="FE6E0D"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="40" id="ock-wd-iD8"/> |
| | |
| | | </constraints> |
| | | </view> |
| | | <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZAh-4X-KgY"> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="560.66666666666663"/> |
| | | <rect key="frame" x="0.0" y="0.0" width="393" height="420.66666666666669"/> |
| | | <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> |
| | | <connections> |
| | | <action selector="closeAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="HHa-Qh-d4t"/> |
| | |
| | | </constraints> |
| | | <connections> |
| | | <outlet property="cons_bottom" destination="Xfr-Bp-8jB" id="IZH-JX-BFj"/> |
| | | <outlet property="img_profile" destination="bj7-gH-bLI" id="GsX-Bs-0B2"/> |
| | | <outlet property="tf_height" destination="Zec-I5-pJT" id="48c-gi-8K9"/> |
| | | <outlet property="tf_phone" destination="Cui-v0-oxz" id="Twv-bl-sNA"/> |
| | | <outlet property="tf_weight" destination="U4X-od-m4c" id="3R1-09-4pq"/> |
| | | <outlet property="view_container" destination="FQP-Da-djy" id="v8l-GZ-ns8"/> |
| | | <outlet property="view_profile" destination="Whm-kp-4GP" id="8KG-BB-BrO"/> |
| | | </connections> |
| | | <point key="canvasLocation" x="-10" y="21"/> |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | | <image name="btn_add_large_2" width="112" height="112"/> |
| | | <image name="icon_item_p" width="12" height="12"/> |
| | | <namedColor name="FE6E0D"> |
| | | <color red="0.99199998378753662" green="0.53299999237060547" blue="0.0080000003799796104" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | |
| | | @IBOutlet weak var tf_weight: QMUITextField! |
| | | @IBOutlet weak var tf_phone: QMUITextField! |
| | | @IBOutlet weak var tf_birthday: UITextField! |
| | | @IBOutlet weak var img_idCardSingle: UIImageView! |
| | | |
| | | var profileImg:UIImage? |
| | | |
| | |
| | | var type:ItemType! |
| | | |
| | | var verifyIdCard:Bool = false |
| | | var identity:Bool = false //是否需要实名 |
| | | |
| | | init(type:ItemType,studentInfo:StudentProfile1Model? = nil) { |
| | | init(type:ItemType,studentInfo:StudentProfile1Model? = nil,identity:Bool = false) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.type = type |
| | | self.studentInfo = studentInfo |
| | | self.identity = identity |
| | | } |
| | | |
| | | init(activityDetailPartModel:ActivityDetailPartModel? = nil) { |
| | | init(type:ItemType,activityDetailPartModel:ActivityDetailPartModel? = nil,identity:Bool = false) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.type = .activity |
| | | self.type = type |
| | | self.activityDetailPartModel = activityDetailPartModel |
| | | self.identity = identity |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | img_idCardSingle.isHidden = !identity |
| | | |
| | | if type == .course{ |
| | | title = "添加运动营成员" |
| | | view_profile.isHidden = false |
| | |
| | | tf_idCard.placeholder = "请输入身份证号" |
| | | if let m = activityDetailPartModel{ |
| | | title = "编辑人员" |
| | | view_profile.isHidden = identity |
| | | tf_name.text = m.name |
| | | tf_idCard.text = m.idcard |
| | | tf_height.text = String(format: "%.0lf", m.height) |
| | |
| | | |
| | | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | | if studentInfo == nil{ |
| | | |
| | | if !view_profile.isHidden{ |
| | | guard profileImg != nil else { |
| | | |
| | | if type == .course{ |
| | |
| | | alertError(msg: "请上传人员头像"); |
| | | } |
| | | |
| | | return} |
| | | return |
| | | } |
| | | } |
| | | |
| | | guard !tf_name.text!.isEmpty else {alertError(msg: tf_name.placeholder!);return} |
| | |
| | | guard tf_phone.text!.jq_isPhone else {alertError(msg: "请输入正确的手机号");return} |
| | | } |
| | | |
| | | if !tf_idCard.isEmpty || activityDetailPartModel != nil{ |
| | | if !tf_idCard.isEmpty || identity{ |
| | | guard tf_idCard.text!.jq_idCard() else {alertError(msg: "请输入正确的身份证号码");return} |
| | | } |
| | | |
| | |
| | | <objects> |
| | | <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AddStudentVC" customModule="WanPai" customModuleProvider="target"> |
| | | <connections> |
| | | <outlet property="img_idCardSingle" destination="fvg-3w-ZtH" id="Jbe-zT-f6D"/> |
| | | <outlet property="img_profile" destination="5oh-CW-AiU" id="lde-3f-DOi"/> |
| | | <outlet property="tf_birthday" destination="Gwh-N7-mRQ" id="Xsk-gB-nJj"/> |
| | | <outlet property="tf_gender" destination="5l9-vJ-vil" id="Ch0-JK-GqD"/> |
| | |
| | | <constraint firstAttribute="height" constant="0.40000000000000002" id="i2J-rI-rHl"/> |
| | | </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="JjF-jS-GPH"> |
| | | <rect key="frame" x="14.000000000000004" y="16.666666666666629" width="57.333333333333343" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <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="LD0-ej-DmH"> |
| | | <rect key="frame" x="120" y="0.0" width="233" height="49.666666666666664"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <textInputTraits key="textInputTraits" keyboardType="numberPad"/> |
| | | </textField> |
| | | <stackView opaque="NO" contentMode="scaleToFill" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="5SC-hK-UA4"> |
| | | <rect key="frame" x="14.000000000000004" y="16.666666666666629" width="57.333333333333343" height="17"/> |
| | | <subviews> |
| | | <imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_item_p" translatesAutoresizingMaskIntoConstraints="NO" id="fvg-3w-ZtH"> |
| | | <rect key="frame" x="0.0" y="0.0" width="0.0" height="17"/> |
| | | </imageView> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="身份证号" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JjF-jS-GPH"> |
| | | <rect key="frame" x="0.0" y="0.0" width="57.333333333333329" height="17"/> |
| | | <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/> |
| | | <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.80000000000000004" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <nil key="highlightedColor"/> |
| | | </label> |
| | | </subviews> |
| | | </stackView> |
| | | </subviews> |
| | | <color key="backgroundColor" systemColor="systemBackgroundColor"/> |
| | | <constraints> |
| | |
| | | <constraint firstItem="LD0-ej-DmH" firstAttribute="top" secondItem="eXg-lM-iFa" secondAttribute="top" id="2K7-zV-OyA"/> |
| | | <constraint firstAttribute="bottom" secondItem="NlW-dD-gIp" secondAttribute="bottom" id="9Mu-Gg-yex"/> |
| | | <constraint firstItem="LD0-ej-DmH" firstAttribute="leading" secondItem="eXg-lM-iFa" secondAttribute="leading" constant="120" id="9U6-rD-Jfd"/> |
| | | <constraint firstItem="JjF-jS-GPH" firstAttribute="leading" secondItem="eXg-lM-iFa" secondAttribute="leading" constant="14" id="Im9-5F-1xr"/> |
| | | <constraint firstItem="NlW-dD-gIp" firstAttribute="leading" secondItem="eXg-lM-iFa" secondAttribute="leading" constant="14" id="Qir-9y-1mQ"/> |
| | | <constraint firstItem="5SC-hK-UA4" firstAttribute="leading" secondItem="eXg-lM-iFa" secondAttribute="leading" constant="14" id="ZKf-ks-ceU"/> |
| | | <constraint firstItem="5SC-hK-UA4" firstAttribute="centerY" secondItem="eXg-lM-iFa" secondAttribute="centerY" id="bmM-pj-ZpC"/> |
| | | <constraint firstAttribute="trailing" secondItem="NlW-dD-gIp" secondAttribute="trailing" constant="14" id="jSc-75-egP"/> |
| | | <constraint firstItem="NlW-dD-gIp" firstAttribute="top" secondItem="LD0-ej-DmH" secondAttribute="bottom" id="mxF-BK-Axi"/> |
| | | <constraint firstAttribute="height" constant="50" id="ngz-MT-wKh"/> |
| | | <constraint firstItem="JjF-jS-GPH" firstAttribute="centerY" secondItem="eXg-lM-iFa" secondAttribute="centerY" id="xph-Ep-7kc"/> |
| | | </constraints> |
| | | </view> |
| | | </subviews> |
| | |
| | | <constraint firstItem="d3m-we-29R" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Oq1-zv-ea2"/> |
| | | <constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="KyK-7A-Oi3" secondAttribute="trailing" constant="100" id="gh3-61-wYy"/> |
| | | </constraints> |
| | | <point key="canvasLocation" x="40" y="21"/> |
| | | <point key="canvasLocation" x="38.931297709923662" y="20.422535211267608"/> |
| | | </view> |
| | | </objects> |
| | | <resources> |
| | |
| | | weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87) |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | } needAddClouse: { [weak self] () in |
| | | let vc = AddStudentVC(type: .course) |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | Services.courcePayment(conponId: weakSelf.selectCouponModel?.id, courseConfigId: model.id, id: weakSelf.detailModel!.id, price: resultPayPrice, payType: payType, stuId: weakSelf.studentModels.map({$0.id}),orderId: weakSelf.signUpModel?.coursePayId).subscribe(onNext: { data in |
| | | if let m = data.data{ |
| | | if data.code == 200{ |
| | | switch payType { |
| | | case .aliPay: |
| | |
| | | } |
| | | } |
| | | case .wechat: |
| | | self?.navigationController?.popViewController(animated: false) |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) { [weak self] result in |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.isExtend = self?.signUpModel?.payStatus == .paymented |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "已取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | break |
| | | case .coin: |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | |
| | | }else{ |
| | | alertError(msg: data.msg) |
| | | } |
| | | } |
| | | |
| | | },onError: { error in |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | | let vc = AddStudentVC(type: .course) |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil) |
| | | push(vc: vc) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | | let addstudentVC = AddStudentVC(type: .course) |
| | | let addstudentVC = AddStudentVC(type: .course,studentInfo: nil) |
| | | push(vc: addstudentVC) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: UIButton) { |
| | | let studentVC = AddStudentVC(type: .course) |
| | | let studentVC = AddStudentVC(type: .course,studentInfo: nil) |
| | | push(vc: studentVC) |
| | | } |
| | | |
| | |
| | | PaymentView.show(enumType:.game,money: (ali: weakSelf.gameListModel.cash, wx: weakSelf.gameListModel.cash, coin: weakSelf.gameListModel.playCoin, course: nil,integral:weakSelf.gameListModel.integral)) { [weak self] payType in |
| | | guard let weakSelf = self else { return } |
| | | Services.payGame(configId: weakSelf.gameListModel.id, gameId: weakSelf.gameListModel.gameId, spaceId: weakSelf.storeId, sutuId: weakSelf.sutuId, type: payType).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | switch payType { |
| | | case .wechat:break |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) { result in |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .games) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | case .cancel:alert(msg: "支付已取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .games) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | case .aliPay: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data?.orderString ?? "")) { result in |
| | | switch result { |
| | |
| | | let vc = PaymentResultVC(result: .success, objType: .games) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | }) { error in |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |
| | |
| | | var name: String = "" |
| | | var nationalRank: Int = 0 |
| | | var win: Int = 0 |
| | | var winRate: Int = 0 |
| | | var winRate: Double = 0 |
| | | } |
| | | |
| | | struct WorldCupMatchRecordModel:HandyJSON{ |
| | |
| | | |
| | | PaymentView.show(enumType: .joinMember, money: (ali:price,wx:price,coin:nil,course:nil,integral:nil)) { type in |
| | | Services.enrollMember(paytype: type).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | switch type { |
| | | case .aliPay: |
| | | if let orderString = data.data?.orderString{ |
| | |
| | | } |
| | | } |
| | | } |
| | | case .wechat:break |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .member, handleVC: nil, courseConfigId: nil, againClouse: nil) |
| | | weakSelf.push(vc: vc) |
| | | case .cancel: |
| | | let vc = PaymentResultVC(result: .fail("已取消支付", 0), objType: .member, handleVC: nil, courseConfigId: nil, againClouse: nil) |
| | | weakSelf.push(vc: vc) |
| | | case .failure(let error): |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |
| | | case .Other(let code,let string): |
| | | let vc = PaymentResultVC(result: .fail(string,code), objType: .member) |
| | | weakSelf.push(vc: vc) |
| | | default: |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .member) |
| | | weakSelf.push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | default:break |
| | | } |
| | | } |
| | | |
| | | }).disposed(by: self.disposeBag) |
| | | } |
| | | } |
| | |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | | |
| | | btn_hot.isSelected = true |
| | | btn_point.spacingBetweenImageAndTitle = 5 |
| | | btn_condition.spacingBetweenImageAndTitle = 5 |
| | | btn_hot.spacingBetweenImageAndTitle = 5 |
| | |
| | | } |
| | | |
| | | @IBAction func editAction(_ sender: UIButton) { |
| | | StudentUpdateInfoView.show(activityDetailPartModel) |
| | | StudentUpdateInfoView.show(activityDetailPartModel,updateUserProfile: true) |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func verifyAction(_ sender: UIButton) { |
| | | let vc = AddStudentVC(activityDetailPartModel: activityDetailPartModel) |
| | | let vc = AddStudentVC(type:.activity,activityDetailPartModel: activityDetailPartModel,identity: true) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | |
| | | |
| | | @objc func showQRAction(){ |
| | | if let qrCode = WorldCupUserInfoQRCodel(id: activityDetailPartModel.id, isStudent: activityDetailPartModel.isStudent).toJSONString(){ |
| | | QRPreview.show(qrCode) |
| | | QRPreview.show(qrCode,title: activityDetailPartModel.name) |
| | | } |
| | | } |
| | | |
| | | @IBAction func editAction(_ sender: UIButton) { |
| | | StudentUpdateInfoView.show(activityDetailPartModel) |
| | | StudentUpdateInfoView.show(activityDetailPartModel,updateUserProfile: true) |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func verifyAction(_ sender: UIButton) { |
| | | let vc = AddStudentVC(activityDetailPartModel: activityDetailPartModel) |
| | | let vc = AddStudentVC(type:.worldCup,activityDetailPartModel: activityDetailPartModel,identity: true) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | |
| | |
| | | @IBOutlet weak var view_vipExpired: UIView! |
| | | |
| | | private var profileImg:UIImage? |
| | | private var model:UserInfoModel? |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | |
| | | self?.label_vipDutime.text = model.memberLifespan |
| | | self?.btn_userProfile.sd_setImage(with: URL(string: model.userImage), for: .normal,placeholderImage: UIImage(named: "btn_userProfile")) |
| | | self?.view_vipExpired.isHidden = model.isVip == 0 |
| | | self?.model = model |
| | | |
| | | |
| | | self?.tf_username.isEnabled = model.userName.isEmpty |
| | | self?.tf_gender.isEnabled = model.sex.isEmpty |
| | | self?.tf_birthday.isEnabled = model.birthday.isEmpty |
| | | // self?.tf_username.isEnabled = model.userName.isEmpty |
| | | // self?.tf_gender.isEnabled = model.sex.isEmpty |
| | | // self?.tf_birthday.isEnabled = model.birthday.isEmpty |
| | | } |
| | | |
| | | }).disposed(by: disposeBag) |
| | |
| | | alertError(msg: "请输入用户名称");return |
| | | } |
| | | |
| | | guard weakSelf.tf_username.text != weakSelf.model?.userName else {return} |
| | | Services.updateInfo(birthday: nil, gender: nil, name: weakSelf.tf_username.text).subscribe(onNext: {[weak self] data in |
| | | self?.updateUserInfo() |
| | | }).disposed(by: weakSelf.disposeBag) |
| | |
| | | |
| | | |
| | | Services.queryProtocol(.useStore, progress: false).subscribe(onNext: {[weak self] text in |
| | | self?.label_content.text = (text.data ?? "").jq_filterFromHTML_1() |
| | | self?.label_content.attributedText = AttributedStringbuilder.build().add(string: (text.data ?? ""), withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6), lineSpace: 5).mutableAttributedString |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: Any) { |
| | | let vc = AddStudentVC(type: .activity) |
| | | let vc = AddStudentVC(type: .activity,activityDetailPartModel: nil,identity:true) |
| | | push(vc: vc) |
| | | } |
| | | } |
| | |
| | | self?.cons_tableHei.constant = Double(self?.students.count ?? 0) * 100 |
| | | self?.tableView.reloadData() |
| | | } needAddClouse: {[weak self] () in |
| | | let vc = ActivityStudentListVC() |
| | | let vc = AddStudentVC(type: .worldCup,activityDetailPartModel: nil,identity: true) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | |
| | | Services.worldCupPayment(id: detailModel.id, ids: result.jq_toJson1(), payType: payType, uid: nil).subscribe(onNext: {[weak self]data in |
| | | if let m = data.data{ |
| | | switch payType { |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) { result in |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .worldCup) |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "交易取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .worldCup){[weak self] () in |
| | | self?.showPaymentView() |
| | | } |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | case .aliPay: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: m.orderString)) { result in |
| | | switch result { |
| | |
| | | } |
| | | |
| | | if let endDate = model.registrationClosingTime{ |
| | | let endDateTimeInterval = Date.jq_StringToTimeInterval(endDate, "yyyy-MM-dd HH:mm") |
| | | let endDateTimeInterval = Date.jq_StringToTimeInterval(model.startTime, "yyyy-MM-dd HH:mm") |
| | | |
| | | if Date.jq_CalByDays(startDate: Date(), endDate: Date(timeIntervalSince1970: endDateTimeInterval)) <= 1{ |
| | | self?.btn_enroll.setTitle("取消", for: .normal) |
| | |
| | | } |
| | | |
| | | extension WorldCupContentDetailVC:UITableViewDelegate{ |
| | | |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let model = detailModel!.participants[indexPath.row] |
| | | if let qrCode = WorldCupUserInfoQRCodel(id: model.id, isStudent: model.isStudent).toJSONString(){ |
| | | QRPreview.show(qrCode,title: model.name) |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension WorldCupContentDetailVC:UITableViewDataSource{ |
| | |
| | | |
| | | setProvince(rank: 0) |
| | | setCity(cityName: "", rank: 0) |
| | | |
| | | let tap = UITapGestureRecognizer(target: self, action: #selector(showBigPicAction)) |
| | | img_QR.isUserInteractionEnabled = true |
| | | img_QR.addGestureRecognizer(tap) |
| | | } |
| | | |
| | | override func setRx() { |
| | |
| | | self?.setCity(cityName: model.cityName, rank: model.cityRank) |
| | | self?.label_winNum.text = "\(model.win)" |
| | | self?.label_loseNum.text = "\(model.lose)" |
| | | self?.label_winRate.text = "\(model.winRate)%" |
| | | self?.label_winRate.text = String(format: "%.1lf%%", model.winRate) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | |
| | | label_provinceRank.attributedText = AttributedStringbuilder.build().add(string: "全国排名 ", withFont: .systemFont(ofSize: 14), withColor: .white).add(string: "\(rank)", withFont: .systemFont(ofSize: 28, weight: .semibold), withColor: .white).mutableAttributedString |
| | | } |
| | | |
| | | @objc private func showBigPicAction(){ |
| | | |
| | | if let model = partModel?.value{ |
| | | if let qrCode = WorldCupUserInfoQRCodel(id: model.id, isStudent: model.isStudent).toJSONString(){ |
| | | QRPreview.show(qrCode,title: model.name) |
| | | } |
| | | } |
| | | } |
| | | |
| | | private func setCity(cityName:String,rank:Int){ |
| | | label_cityRank.attributedText = AttributedStringbuilder.build().add(string: "\(cityName)排名 ", withFont: .systemFont(ofSize: 14), withColor: .white).add(string: "\(rank)", withFont: .systemFont(ofSize: 28, weight: .semibold), withColor: .white).mutableAttributedString |
| | | } |
| | |
| | | private let provinceBtn = UIButton(type: .custom) |
| | | private var tableView:UITableView! |
| | | var superScrollView:UIScrollView? |
| | | |
| | | var flowCell:WorldCupRankTCell? |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | view.backgroundColor = .clear |
| | | // if let model = currentPartModel{ |
| | | // viewModel.id.accept(model.id) |
| | | // viewModel.isStudent.accept(model.isStudent) |
| | | // Services.getEntrantRank(id: model.id, isStudent: model.isStudent).subscribe(onNext: {[weak self] data in |
| | | // if let model = data.data{ |
| | | // self?.worldCupRankModel = model |
| | | // self?.cityBtn.setTitle(model.cityName, for: .normal) |
| | | // self?.cityBtn.layoutIfNeeded() |
| | | // self?.cityBtn.layoutSubviews() |
| | | // } |
| | | // }).disposed(by: disposeBag) |
| | | // } |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | if let m = model{ |
| | | self?.viewModel.id.accept(m.id) |
| | | self?.viewModel.isStudent.accept(m.isStudent) |
| | | self?.viewModel.beginRefresh() |
| | | |
| | | Services.getEntrantRank(id: m.id, isStudent: m.isStudent).subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | |
| | | } |
| | | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Observable.combineLatest(superScrollView!.rx.contentOffset, tableView.rx.contentOffset).subscribe { v1,v2 in |
| | | //获取rankTCell是否出现在屏幕内 |
| | | if let cell = self.flowCell{ |
| | | let rect = cell.convert(cell.bounds, to: app.window) |
| | | if rect.origin.y < 0 || rect.origin.y > self.view.height{ |
| | | NotificationCenter.default.post(name: ShowOrHiddenFlowImage_Noti, object: false) |
| | | }else{ |
| | | NotificationCenter.default.post(name: ShowOrHiddenFlowImage_Noti, object: true) |
| | | } |
| | | } |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | @objc func radiusAction(btn:UIButton){ |
| | |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "rankTCell") as! WorldCupRankTCell |
| | | cell.indexPath = indexPath |
| | | cell.model = viewModel.dataSource.value[indexPath.row] |
| | | |
| | | if viewModel.dataSource.value[indexPath.row].oneself == 1{ |
| | | cell.borderColor = UIColor(hexString: "#FC743A") |
| | | cell.borderWidth = 1 |
| | | }else{ |
| | | cell.borderWidth = 0 |
| | | } |
| | | |
| | | cell.addLine(UIColor(hexStr: "#E1E1E1"), false, true, false, true, 0.4) |
| | | return cell |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { |
| | | if let rankTCell = cell as? WorldCupRankTCell{ |
| | | if viewModel.dataSource.value[indexPath.row].oneself == 1{ |
| | | flowCell = rankTCell |
| | | NotificationCenter.default.post(name: FlowImage_Noti, object: rankTCell.jq_captureToImage()) |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | | if indexPath.section == 0{ |
| | | return 32 |
| | |
| | | if let m = model{ |
| | | self?.viewModel.studentId.accept(m.id) |
| | | self?.viewModel.isStudent.accept(m.isStudent) |
| | | self?.viewModel.beginRefresh() |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | |
| | | import RxDataSources |
| | | import ReplayKit |
| | | |
| | | let FlowImage_Noti = Notification.Name.init("FlowImage_Noti") |
| | | let ShowOrHiddenFlowImage_Noti = Notification.Name.init("FlowImage_Noti") |
| | | |
| | | class WorldCupVC: BaseVC { |
| | | |
| | | private var partModels = [ActivityDetailPartModel]() |
| | | private var partModel = BehaviorRelay<ActivityDetailPartModel?>(value:nil) |
| | | private var toPage:Int? |
| | | |
| | | lazy var headerVC:WorldCupHeaderVC = { |
| | | let vc = WorldCupHeaderVC() |
| | | vc.partModel = partModel |
| | |
| | | vc.menuHeight = 50 |
| | | vc.style = .subRefresh |
| | | return vc |
| | | }() |
| | | |
| | | lazy var flowImageView:UIImageView = { |
| | | let i = UIImageView() |
| | | i.tag = 1001 |
| | | return i |
| | | }() |
| | | |
| | | lazy var pageVC:FFPageViewController = { |
| | |
| | | } |
| | | |
| | | override func setRx() { |
| | | // partModel.subscribe(onNext: { data in |
| | | // |
| | | // |
| | | // }).disposed(by: disposeBag) |
| | | NotificationCenter.default.rx.notification(FlowImage_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: { noti in |
| | | if let img = noti.object as? UIImage{ |
| | | if let imag = self.view.viewWithTag(1001) as? UIImageView{ |
| | | imag.image = img |
| | | }else{ |
| | | self.flowImageView.image = img |
| | | self.flowImageView.frame = CGRect(x: 15, y: JQ_ScreenH - UIDevice.jq_safeEdges.bottom - 45, width: JQ_ScreenW-30, height: 45) |
| | | self.view.addSubview(self.flowImageView) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(ShowOrHiddenFlowImage_Noti, object: nil).take(until: self.rx.deallocated).subscribe(onNext: { noti in |
| | | |
| | | if let hidden = noti.object as? Bool, self.pageVC.currentPage == 3{ |
| | | self.flowImageView.isHidden = hidden |
| | | } |
| | | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | func pageViewController(_ pageViewController: FFPageViewController, currentPageChanged currentPage: Int) { |
| | | menuVC.pageMenu.selectedItemIndex = currentPage |
| | | flowImageView.isHidden = currentPage != 3 |
| | | } |
| | | } |
| | | |
| | | extension WorldCupVC:SPPageMenuDelegate{ |
| | | func pageMenu(_ pageMenu: SPPageMenu, didSelectedItem index: Int) { |
| | | pageVC.scroll(toPage: index, animation: true) |
| | | flowImageView.isHidden = index != 3 |
| | | } |
| | | |
| | | func pageMenu(_ pageMenu: SPPageMenu, itemSelectedAt index: Int) { |
| | |
| | | alertError(msg: error.localizedDescription) |
| | | } |
| | | } |
| | | case .wechat:break |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) {[weak self] result in |
| | | switch result { |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | let vc = PaymentResultVC(result: .success, objType: .recharge) |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "交易已取消") |
| | | case .failure(let error): |
| | | alertError(msg: error.localizedDescription) |
| | | } |
| | | } |
| | | default:break |
| | | } |
| | | } |
| | |
| | | self?.studentModels = studs as! [CourseDetailStudentModel] |
| | | self?.updateStudenTable() |
| | | } needAddClouse: { [weak self] in |
| | | let vc = AddStudentVC(type: .course) |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | } |
| | | } |
| | | case .wechat:break |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .exchange) |
| | | vc.otherInfo = ["id":m.returnId,"goodsType":weakSelf.exchangeGoodsModel!.goodType.rawValue] |
| | | self?.push(vc: vc) |
| | | self?.exchangeSuccessUI() |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | case .cancel: |
| | | alert(msg: "已取消兑换") |
| | | case .failure(let error): |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |
| | | case .Other(let code,let string): |
| | | let vc = PaymentResultVC(result: .fail(string,code), objType: .exchange) |
| | | weakSelf.push(vc: vc) |
| | | default: |
| | | let vc = PaymentResultVC(result: .fail("兑换失败",0), objType: .exchange) |
| | | weakSelf.push(vc: vc) |
| | | } |
| | | } |
| | | self?.exchangeSuccessUI() |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | } |
| | | } |
| | | case .coin: |
| | | let vc = PaymentResultVC(result: .success, objType: .exchange) |
| | | vc.otherInfo = ["id":m.returnId,"goodsType":weakSelf.exchangeGoodsModel!.goodType.rawValue] |
| | |
| | | Services.continuePayment(id: weakSelf.yardBookingModel.id, payType: paytype).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | switch paytype { |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) { result in |
| | | switch result { |
| | | case .success: |
| | | NotificationCenter.default.post(name: RefreshBooking_Noti, object: weakSelf.indexPath) |
| | | let vc = PaymentResultVC(result: .success, objType: .activityApply) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "交易取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("交易失败",0), objType: .activityApply) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | case .aliPay: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: m.orderString)) { result in |
| | | switch result { |
| | |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | case .wechat,.integral:break |
| | | case .integral:break |
| | | case .coin,.free: |
| | | NotificationCenter.default.post(name: RefreshBooking_Noti, object: weakSelf.indexPath) |
| | | let vc = PaymentResultVC(result: .success, objType: .activityApply) |
| | |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | case .wechat:break |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) { result in |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .activityApply) |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "交易取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("交易失败",0), objType: .activityApply) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | case .coin,.free: |
| | | let vc = PaymentResultVC(result: .success, objType: .activityApply) |
| | | self?.push(vc: vc) |
| | |
| | | } |
| | | } |
| | | |
| | | case .wechat,.integral:break |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) { result in |
| | | switch result { |
| | | case .success: |
| | | NotificationCenter.default.post(name: UpdateDetailDate_Noti, object: nil) |
| | | let vc = YardBookingDetailVC(siteBookingId: m.siteBooking) |
| | | weakSelf.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "交易取消") |
| | | let vc = YardBookingListVC(page: 5) |
| | | weakSelf.push(vc: vc) |
| | | NotificationCenter.default.post(name: UpdateDetailDate_Noti, object: nil) |
| | | case .failure(_): |
| | | NotificationCenter.default.post(name: UpdateDetailDate_Noti, object: nil) |
| | | let vc = PaymentResultVC(result: .fail("交易失败",0), objType: .yard,handleVC: nil) |
| | | weakSelf.push(vc: vc) |
| | | } |
| | | } |
| | | |
| | | case .integral:break |
| | | case .coin,.free: |
| | | NotificationCenter.default.post(name: UpdateDetailDate_Noti, object: nil) |
| | | let vc = YardBookingDetailVC(siteBookingId: m.siteBooking) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private func showPaymentView(){ |
| | | |
| | | } |