BUG
无故事王国
2023-11-17 e97b863bfafb2fc0fd870abc933276aa96a17a45
BUG
32个文件已修改
570 ■■■■■ 已修改文件
WanPai/AppDelegate.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/VC/CommonScanQRCodeVC.swift 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Common/View/CommonAlertView.swift 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/Def.swift 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Config/Enums.swift 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Model/CommonModels.swift 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/NetworkRequest.swift 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Network/Services.swift 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Activity/VC/ActivityDetailApplyVC.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Activity/VC/ActivitySignupDetailVC.swift 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/CourseBookingTCell.swift 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/TCell/CourseBookingTCell.xib 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseDetailApplyVC.swift 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseInfoVC.swift 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseInfoVC.xib 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/VC/CourseListVC.swift 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Course/View/CourseUnAssignView.swift 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/CCell/CouponCCell.swift 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/VC/PaymentResultVC.swift 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Other/VC/ProfileVC.swift 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.swift 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.xib 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchStoreDetailVC.swift 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Search/VC/SearchStoreListVC.swift 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/TCell/BillInfoTCell.swift 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/TCell/WelfareCouponsTCell.swift 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/RechargeRecordVC.swift 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareRedeemGoodsDetailVC.swift 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareWeeklyDetailVC.swift 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Welfare/VC/WelfareWeeklyDetailVC.xib 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Yard/VC/YardBookingDetailVC.swift 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/Root/Yard/VC/YardDetailVC.swift 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WanPai/AppDelegate.swift
@@ -117,6 +117,7 @@
    func needLogin(){
        UserViewModel.clearToken()
        UserDefaults.standard.setValue(nil, forKey: "currentStuId")
        if JQ_currentViewController() is LoginVC{return}
        let loginNav = LoginNav(rootViewController: LoginVC())
        loginNav.modalPresentationStyle = .fullScreen
WanPai/Common/VC/CommonScanQRCodeVC.swift
@@ -63,44 +63,116 @@
            }
        }
        if(!checkCameraAuth()){
            let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
            let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
                self.navigationController?.popViewController(animated: true)
            })
            let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
                let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
                if UIApplication.shared.canOpenURL(settingUrl as URL){
                    if #available(iOS 10.0, *) {
                        UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
                    } else {
                        UIApplication.shared.openURL(settingUrl as URL)
                    }
        let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video)
        if authStatus == AVAuthorizationStatus.notDetermined {
            AVCaptureDevice.requestAccess(for: AVMediaType.video) { (granted) in
                if granted{
                    self.limitSuccess()
                }else{
                    self.limitFaild()
                }
            })
            alertController.addAction(cancelAction)
            alertController.addAction(okAction)
            self.present(alertController, animated: true, completion: nil)
        }
        setupCaptureSession()
        addSubviews()
        scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(startAnimation), userInfo: nil, repeats: true)
    }
    public override func viewWillAppear(_ animated: Bool) {
        firstResult = true
        if let session = self.session {
            let queue = DispatchQueue(label: "startRun")
            queue.async {
                session.startRunning()
            }
        } else if authStatus == AVAuthorizationStatus.restricted || authStatus == AVAuthorizationStatus.denied {
            limitFaild()
        } else {
            limitSuccess()
        }
        scanTimer?.fireDate = NSDate.distantPast
//        if(!checkCameraAuth()){
//
//            let authStatus = AVCaptureDevice.authorizationStatus(for: AVMediaType.video)
//            if authStatus == AVAuthorizationStatus.notDetermined {
//                AVCaptureDevice.requestAccess(for: AVMediaType.video) {[weak self] (granted) in
//                    if granted{
//                        self?.setupCaptureSession()
//                        self?.addSubviews()
//                        self?.scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(startAnimation), userInfo: nil, repeats: true)
//                    }
//                }
//            } else if authStatus == AVAuthorizationStatus.restricted || authStatus == AVAuthorizationStatus.denied {
//                let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
//                let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
//                    self.navigationController?.popViewController(animated: true)
//                })
//
//                let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
//                    let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
//                    if UIApplication.shared.canOpenURL(settingUrl as URL){
//                        if #available(iOS 10.0, *) {
//                            UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
//                        } else {
//                            UIApplication.shared.openURL(settingUrl as URL)
//                        }
//                    }
//                })
//
//                alertController.addAction(cancelAction)
//                alertController.addAction(okAction)
//                self.present(alertController, animated: true, completion: nil)
//            } else {
//
//            }
//
//        }else{
//            setupCaptureSession()
//            addSubviews()
//            scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(startAnimation), userInfo: nil, repeats: true)
//        }
    }
    private func limitSuccess(){
        setupCaptureSession()
        DispatchQueue.main.async {
            self.addSubviews()
            self.scanTimer = Timer.scheduledTimer(timeInterval: 3.0, target: self, selector: #selector(self.startAnimation), userInfo: nil, repeats: true)
            self.firstResult = true
            if let session = self.session {
                let queue = DispatchQueue(label: "startRun")
                queue.async {
                    session.startRunning()
                }
            }
            self.scanTimer?.fireDate = NSDate.distantPast
        }
    }
    private func limitFaild(){
        let alertController = UIAlertController(title: nil,message: "请在iphone的“设置-隐私-相机”选项中,允许应用访问你的相机", preferredStyle: .alert)
        let cancelAction = UIAlertAction(title: "取消", style: .cancel, handler: { action in
            self.navigationController?.popViewController(animated: true)
        })
        let okAction = UIAlertAction(title: "前往", style: .default, handler: {action in
            let settingUrl = NSURL(string: UIApplication.openSettingsURLString)!
            if UIApplication.shared.canOpenURL(settingUrl as URL){
                if #available(iOS 10.0, *) {
                    UIApplication.shared.open(settingUrl as URL, options: [:], completionHandler: nil)
                } else {
                    UIApplication.shared.openURL(settingUrl as URL)
                }
            }
        })
        alertController.addAction(cancelAction)
        alertController.addAction(okAction)
        self.present(alertController, animated: true, completion: nil)
    }
//    public override func viewWillAppear(_ animated: Bool) {
//        firstResult = true
//        if let session = self.session {
//            let queue = DispatchQueue(label: "startRun")
//            queue.async {
//                session.startRunning()
//            }
//        }
//        scanTimer?.fireDate = NSDate.distantPast
//    }
    func checkCameraAuth() -> Bool {
        let status = AVCaptureDevice.authorizationStatus(for: .video)
        return  status == .authorized;
WanPai/Common/View/CommonAlertView.swift
@@ -28,11 +28,22 @@
    }
    
    
    static func show(title:String,content:String,isSingle:Bool = false, clouse:@escaping (Bool)->Void){
    static func show(title:String,content:String,cancelStr:String? = nil,completeStr:String? = nil,isSingle:Bool = false, clouse:@escaping (Bool)->Void){
        let alertView = CommonAlertView.jq_loadNibView()
        alertView.label_title.text = title
        alertView.label_content.text = content
        alertView.btn_cancel.isHidden = isSingle
        if cancelStr != nil{
            alertView.btn_cancel.setTitle(cancelStr!, for: .normal)
        }
        if completeStr != nil{
            alertView.btn_complete.setTitle(completeStr!, for: .normal)
        }
        alertView.clouse = clouse
        alertView.frame = sceneDelegate?.window?.frame ?? .zero
        sceneDelegate?.window?.addSubview(alertView)
WanPai/Config/Def.swift
@@ -267,7 +267,7 @@
        case "探索玩湃":
            if page == "门店列表"{
//                let vc = SearchStoreListVC()
//                let vc = SearchStoreListVC(id: id ?? 0)
//                JQ_currentViewController().jq_push(vc: vc)
                JQ_currentViewController().navigationController?.popToRootViewController(animated: true)
                DispatchQueue.main.asyncAfter(deadline: .now()+0.5) {
WanPai/Config/Enums.swift
@@ -145,11 +145,13 @@
enum SortType:String{
    case asc = "asc"
    case desc = "desc"
    case def = "icon_sort_normal"
    var img:UIImage{
        switch self{
            case .asc:return UIImage(named: "icon_asc")!
            case .desc:return UIImage(named: "icon_desc")!
            case .def:return UIImage(named: "icon_sort_normal")!
        }
    }
}
WanPai/Model/CommonModels.swift
@@ -143,6 +143,18 @@
    var useCondition: String = ""
}
struct CouponInfo_1_Model:HandyJSON{
        ///有效时间
    var effectiveTime: String = ""
        /// 优惠
    var favorable: String = ""
    var id: Int = 0
    var name: String = ""
    var type:CouponType = .none
        /// 使用条件
    var useCondition: String = ""
}
struct PaymentModel:HandyJSON{
    var orderString = ""
    var returnId = 0
@@ -301,6 +313,7 @@
    var detailDrawing = ""
    var holiTime:String = ""
    var type = 1 // 1:常规课,2:假期课
    var payType:PaymentType = .cashCoin
}
struct SiteItemModel:HandyJSON{
@@ -419,12 +432,14 @@
    var periodOfValidity = ""
    var isAble = 0
    var id = 0
    var courseType = 0 //1:常规,2:假期
}
struct StartClouseVideoListModel:HandyJSON {
    var videoCoverImgUrl: String = ""
    var videoName: String = ""
    var videoUrl: String = ""
    var videoId = 0
}
struct StartClouseReportModel:HandyJSON{
@@ -479,7 +494,7 @@
struct SearchStoreDetailCourseModel:HandyJSON{
    var applicantsNumber: Int = 0
    var classHours: Int = 0
    var classHours = [Int]()
    var classStartTime:String?
    var courseId: Int = 0
    var coverDrawing: String = ""
@@ -549,10 +564,11 @@
}
struct BillingModel:HandyJSON{
    var consumeAmount:Double = 0
    var consumeAmount = ""
    var consumeName = ""
    var consumeTime = ""
    var type:DetailType = .positive //1扣减 2增加
    var type:DetailType?//1扣减 2增加
    var recordId:Int?
//    mutating func mapping(mapper: HelpingMapper) {
//        mapper <<<
@@ -752,6 +768,7 @@
    var num = 0
    var money:Double = 0
    var isType = 0 //1不能请假,0:可以请假
    var courseType = 0 // 1:常规,2:假期课
    required init(){}
}
WanPai/Network/NetworkRequest.swift
@@ -222,7 +222,9 @@
                    if let code = response.error?.responseCode{
                        errorString.append("\n【错误码:\(code)】")
                    }
                    alert(msg: errorString)
                    if !ignoreAlert{
                        alert(msg: errorString)
                    }
                    ob.onError(response.error!)
                    return
                }
WanPai/Network/Services.swift
@@ -231,7 +231,7 @@
        /// 成为会员获取优惠券
        /// - Parameter menthod: 1=积分购买,2=注册赠送
    static func queryMemberCoupon(menthod:Int)->Observable<BaseResponse<[CouponInfoModel]>>{
    static func queryMemberCoupon(menthod:Int)->Observable<BaseResponse<[CouponInfo_1_Model]>>{
        let params = ParamsAppender.build(url: All_Url)
            .interface(url: "/activity/api/coupon/queryCouponList")
            .append(key: "distributionMethod", value: menthod)
@@ -838,7 +838,7 @@
            .append(key: "payType", value: payType?.rawValue)
            .append(key: "stuIds", value: stuIds)
            .append(key: "storeId", value: storeId)
        return NetworkRequest.request(params: params, method: .post, progress: true)
        return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true)
    }
        /// 积分商城-实体、门票、优惠券为默认门店|课包为默认学员
@@ -1146,7 +1146,7 @@
            .append(key: "ids", value: userIds)
            .append(key: "payType", value: payType.rawValue)
            .append(key: "coursePaymentId", value: coursePaymentId)
        return NetworkRequest.request(params: params, method: .post, progress: true)
        return NetworkRequest.request(params: params, method: .post, progress: true,ignoreAlert: true)
    }
        /// 查询已报名赛事详情
WanPai/Root/Activity/VC/ActivityDetailApplyVC.swift
@@ -191,6 +191,7 @@
    private func payment(type:PayType,paymentId:Int? = nil){
        let ids = students.map({"\($0.id)"}).joined(separator: ",")
        Services.paymentCompetition(id: activityDetailModel.id, userIds: ids, payType: type,coursePaymentId: paymentId).subscribe(onNext: {[weak self] data in
            NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
            if let m = data.data{
                switch type {
                    case .aliPay:
WanPai/Root/Activity/VC/ActivitySignupDetailVC.swift
@@ -165,8 +165,10 @@
            if status{
                Services.cancelMyCOmpetition(id: weakSelf.id).subscribe(onNext: { data in
                    alertSuccess(msg: "取消成功")
                    self?.btn_cancel.isHidden = true
                    self?.btn_cancel.setTitle("已取消", for: .normal)
                    self?.btn_cancel.backgroundColor = UIColor(hexStr: "#C0C0C0")
                    NotificationCenter.default.post(name: CancelActivitySingup_Noti, object: nil)
                    NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
                }).disposed(by: weakSelf.disposeBag)
            }
        }
WanPai/Root/Course/TCell/CourseBookingTCell.swift
@@ -36,6 +36,8 @@
                btn_handle.backgroundColor = UIColor(hexStr: "#C0C0C0")
            }
            btn_handle.isHidden = (weeklyCourseItemModel.courseType == 2 && weeklyCourseItemModel.type == 2)
        }
    }
    @IBOutlet weak var label_title: UILabel!
WanPai/Root/Course/TCell/CourseBookingTCell.xib
@@ -28,10 +28,10 @@
                        <nil key="highlightedColor"/>
                    </label>
                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="nxc-Xp-QTZ">
                        <rect key="frame" x="124" y="32.666666666666664" width="100" height="30"/>
                        <rect key="frame" x="124" y="32.666666666666664" width="123" height="30"/>
                        <subviews>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00:00-00:00" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wnJ-m8-Cn6">
                                <rect key="frame" x="0.0" y="0.0" width="100" height="14"/>
                                <rect key="frame" x="0.0" y="0.0" width="123" height="14"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="14" id="cLS-sG-TFB"/>
                                </constraints>
@@ -40,7 +40,7 @@
                                <nil key="highlightedColor"/>
                            </label>
                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="¥0/会员扣0学时" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="trU-MW-rOB">
                                <rect key="frame" x="0.0" y="16" width="100" height="14"/>
                                <rect key="frame" x="0.0" y="16" width="123" height="14"/>
                                <constraints>
                                    <constraint firstAttribute="height" constant="14" id="xMb-Hp-9za"/>
                                </constraints>
@@ -88,7 +88,7 @@
                    <constraint firstItem="nxc-Xp-QTZ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="124" id="Vc3-ne-itC"/>
                    <constraint firstAttribute="trailing" secondItem="rYv-E4-9YK" secondAttribute="trailing" id="YX2-bP-Zhd"/>
                    <constraint firstItem="ca5-70-BBW" firstAttribute="centerY" secondItem="uBt-D3-uxa" secondAttribute="centerY" id="ZCf-Ly-7o6"/>
                    <constraint firstItem="hxG-tv-maw" firstAttribute="leading" secondItem="nxc-Xp-QTZ" secondAttribute="trailing" constant="28" id="dWM-Zg-Czb"/>
                    <constraint firstItem="hxG-tv-maw" firstAttribute="leading" secondItem="nxc-Xp-QTZ" secondAttribute="trailing" constant="5" id="dWM-Zg-Czb"/>
                    <constraint firstAttribute="bottom" secondItem="rYv-E4-9YK" secondAttribute="bottom" constant="7" id="eul-GW-mkI"/>
                    <constraint firstItem="rYv-E4-9YK" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="gBy-DK-aYi"/>
                    <constraint firstItem="nxc-Xp-QTZ" firstAttribute="centerY" secondItem="uBt-D3-uxa" secondAttribute="centerY" id="u6a-AJ-52h"/>
WanPai/Root/Course/VC/CourseDetailApplyVC.swift
@@ -278,11 +278,11 @@
    private func changePrice(_ index:Int){
        if let subM = detailModel?.list[index]{
            var studentCount:Double = 0
            var studentCount:Int = 0
            if studentModels.count == 0{
                studentCount = 1
            }else{
                studentCount = Double(studentModels.count)
                studentCount = studentModels.count
            }
@@ -299,7 +299,7 @@
                        //玩湃币
                    label_coin.attributedText = AttributedStringbuilder.build()
                        .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                        .add(string: "\(subM.playPaiCoin * studentModels.count)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                        .add(string: "\(subM.playPaiCoin * studentCount)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                case .cash:
                    label_coin.isHidden = true;fallthrough
@@ -317,7 +317,7 @@
                        .add(string: "\(subM.playPaiCoin * studentModels.count)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                        //原价
                    let attribute = AttributedStringbuilder.build().add(string: (subM.originalPrice * studentCount).currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58))
                    let attribute = AttributedStringbuilder.build().add(string: (subM.originalPrice * Double(studentCount)).currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58))
                    label_originPrice.attributedText = attribute.mutableAttributedString
                    if UserInfoModel.get()?.isVip == 1{
@@ -326,14 +326,14 @@
                                //会员
                            label_vipPrice.isHidden = true
                            if subM.paymentPrice < subM.vipPrice && subM.paymentPrice != 0{
                                label_price.text = (subM.paymentPrice * studentCount - (selectCouponModel?.favorable ?? 0)).currency()
                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.vipPrice < subM.paymentPrice && subM.vipPrice != 0{
                                label_price.text = (subM.vipPrice * studentCount - (selectCouponModel?.favorable ?? 0)).currency()
                                label_price.text = (subM.vipPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.vipPrice != 0 &&  subM.paymentPrice != 0{
                                let price = min(subM.vipPrice, subM.paymentPrice)
                                label_price.text = (price * studentCount - (selectCouponModel?.favorable ?? 0)).currency()
                                label_price.text = (price *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else{
                                label_price.text = (subM.paymentPrice * studentCount - (selectCouponModel?.favorable ?? 0)).currency()
                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }
                        }
@@ -343,20 +343,20 @@
                            label_vipPrice.isHidden = subM.vipPrice == 0 || subM.vipPrice == subM.paymentPrice
                            let vipAttribute = AttributedStringbuilder.build()
                                .add(string: "会员价:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                                .add(string: (subM.vipPrice * studentCount).currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313"))
                                .add(string: (subM.vipPrice *  Double(studentCount)).currency(), withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313"))
                            label_vipPrice.attributedText = vipAttribute.mutableAttributedString
                            if subM.originalPrice != 0 && subM.paymentPrice == 0{
                                label_price.text = (subM.originalPrice * studentCount - (selectCouponModel?.favorable ?? 0)).currency()
                                label_price.text = (subM.originalPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.originalPrice == 0 && subM.paymentPrice != 0{
                                label_price.text = (subM.paymentPrice * studentCount - (selectCouponModel?.favorable ?? 0)).currency()
                                label_price.text = (subM.paymentPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }else if subM.originalPrice != 0 && subM.paymentPrice != 0{
                                var money = min(subM.originalPrice,subM.paymentPrice)
                                money = money - (selectCouponModel?.favorable ?? 0)
                                label_price.text = (money * studentCount).currency()
                                label_price.text = (money *  Double(studentCount)).currency()
                            }else{
                                label_price.text = (subM.originalPrice * studentCount - (selectCouponModel?.favorable ?? 0)).currency()
                                label_price.text = (subM.originalPrice *  Double(studentCount) - (selectCouponModel?.favorable ?? 0)).currency()
                            }
                        }
                    }
WanPai/Root/Course/VC/CourseInfoVC.swift
@@ -40,6 +40,7 @@
    @IBOutlet weak var stack_courseExercise: UIStackView!
    @IBOutlet weak var view_exerciseTitle: UIView!
    @IBOutlet weak var view_footer: UIView!
    @IBOutlet weak var view_menuDetail: UIView!
    private var updateProdDate:Date?
@@ -315,7 +316,7 @@
        let index = pageMenu.selectedItemIndex
        let models = startClouseHomeModel!.courseList
        let studentModel = StudentSimpleProfileModel(stuId: startClouseHomeModel!.stuId, stuName: startClouseHomeModel!.stuName, stuImage: startClouseHomeModel!.stuImg)
        let vc = StudentCourseDetailVC(models: models,defaultIndex: index,studentModel: studentModel)
        let vc = StudentCourseDetailVC(models: models.filter({$0.courseType == 1}),defaultIndex: index,studentModel: studentModel)
        push(vc: vc)
    }
@@ -523,7 +524,8 @@
            let vc = StudentMentalListVC(stuId: stuId)
            push(vc: vc)
        }else{
            let vc = CourseVideoDetailVC(id: 0)
            let model = startClouseHomeModel?.exerciseVideoList[indexPath.row]
            let vc = CourseVideoDetailVC(id: model!.videoId)
            vc.title = "课后练习"
            push(vc: vc)
        }
@@ -591,6 +593,8 @@
            label_totalNums.text = "总课时数\( m.totalNums)"
            label_deductedNums.text = "已扣课时数\( m.deductedNums)"
            label_remainingNums.text = "剩余课时数\( m.remainingNums)"
            view_menuDetail.isHidden = startClouseHomeModel?.courseList[index].courseType == 2
        }
    }
}
WanPai/Root/Course/VC/CourseInfoVC.xib
@@ -36,6 +36,7 @@
                <outlet property="view_exerciseTitle" destination="KR4-hI-8vp" id="3ph-Lh-15K"/>
                <outlet property="view_footer" destination="a77-hD-aIq" id="RXN-X9-IH0"/>
                <outlet property="view_menu" destination="DRH-pO-upo" id="4sa-Yf-4nH"/>
                <outlet property="view_menuDetail" destination="wDl-8F-uHt" id="Xga-kL-mVj"/>
                <outlet property="view_schedule" destination="UMv-8K-vwR" id="2rT-1C-945"/>
            </connections>
        </placeholder>
WanPai/Root/Course/VC/CourseListVC.swift
@@ -91,7 +91,6 @@
        tableView.separatorStyle = .none
        tf_search.delegate = self
        viewModel.configure(tableView,needMore: false)
//        tableView.jq_setEmptyView()
        btn_stores.setTitle(viewModel.selectStore.value?.name ?? "所在门店", for: .normal)
    }
@@ -191,7 +190,7 @@
        //复原距离
        viewModel.distanceSort.accept(nil)
        btn_distance.isSelected = false
        btn_distance.setImage(SortType.def.img, for: .normal)
        viewModel.beginRefresh()
    }
@@ -207,6 +206,7 @@
        //复原销量
        viewModel.salesRanking.accept(nil)
        btn_sales.isSelected = false
        btn_sales.setImage(SortType.def.img, for: .normal)
        viewModel.beginRefresh()
    }
WanPai/Root/Course/View/CourseUnAssignView.swift
@@ -67,6 +67,7 @@
                self.alpha = 0
            } completion: { _ in
                self.removeFromSuperview()
                NotificationCenter.default.post(name: StudentRefresh_Nofi, object: nil)
            }
        }) { error in
WanPai/Root/Other/CCell/CouponCCell.swift
@@ -46,23 +46,27 @@
        }
    }
    var couponInfoModel:CouponInfoModel!{
    var couponInfoModel:CouponInfo_1_Model!{
        didSet{
            if let m = couponInfoModel{
                label_name.text = m.name
                switch m.type {
                    case .discount: //满减券
                        label_fullMinus.isHidden = true
                        label_money.text = "\(m.favorable)元"
                        label_useCity.text = m.useCondition
                    case .voucher: //代金券
                        label_fullMinus.isHidden = true
                        label_money.text = "\(m.favorable)元"
                        label_useCity.isHidden = true
                    case .experience: //体验券
                        label_fullMinus.isHidden = true
                        label_money.text = m.favorable
                        label_useCity.isHidden = true
                    case .none:
                        label_fullMinus.isHidden = true
                }
                label_vaildTime.text = String(format: "有效期至%@", couponInfoModel.effectiveTime)
                label_vaildTime.text = String(format: "有效期:%@", couponInfoModel.effectiveTime)
            }
        }
    }
WanPai/Root/Other/VC/PaymentResultVC.swift
@@ -83,7 +83,7 @@
                        self.btn_back.setTitle("返回", for: .normal)
                        self.btn_again.setTitle("再次支付", for: .normal)
                        label_content.text = string
                        if code == 3{btn_again.setTitle("去充值", for: .normal)}
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                    case .none:break
                }
@@ -127,7 +127,7 @@
                btn_again.setTitle("再次支付", for: .normal)
                btn_back.setTitle("返回", for: .normal)
                label_content.text = str
                    if code == 3{btn_again.setTitle("去充值", for: .normal)}
                    if code == 2{btn_again.setTitle("去充值", for: .normal)}
            case .success:
                btn_again.setTitle("立即预约", for: .normal)
                btn_back.setTitle("返回首页", for: .normal)
@@ -148,7 +148,7 @@
                        btn_again.setTitle("再次支付", for: .normal)
                        btn_back.setTitle("返回", for: .normal)
                        label_content.text = str
                        if code == 3{btn_again.setTitle("去充值", for: .normal)}
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                    case .success:
                        btn_again.setTitle("立即预约", for: .normal)
                        btn_back.setTitle("返回首页", for: .normal)
@@ -163,7 +163,7 @@
                case .fail(let str, let code):
                btn_back.setTitle("返回", for: .normal)
                label_content.text = str
                    if code == 3{btn_again.setTitle("去充值", for: .normal)}
                    if code == 2{btn_again.setTitle("去充值", for: .normal)}
            case .success:
                btn_again.setTitle("查看报名", for: .normal)
                btn_back.setTitle("返回首页", for: .normal)
@@ -179,7 +179,7 @@
                        label_content.text = str
                    btn_again.setTitle("再次支付", for: .normal)
                    btn_back.setTitle("返回", for: .normal)
                    if code == 3{btn_again.setTitle("去充值", for: .normal)}
                    if code == 2{btn_again.setTitle("去充值", for: .normal)}
                case .success:
                    btn_again.setTitle("查看预约", for: .normal)
                    btn_back.setTitle("返回首页", for: .normal)
@@ -195,7 +195,7 @@
                        btn_again.setTitle("再次支付", for: .normal)
                        btn_back.setTitle("返回", for: .normal)
                        label_content.text = str
                        if code == 3{btn_again.setTitle("去充值", for: .normal)}
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                    case .success:
                        btn_again.isHidden = true
                        btn_back.setTitleColor(.white, for: .normal)
@@ -216,7 +216,7 @@
                        btn_again.setTitle("再次支付", for: .normal)
                        btn_back.setTitle("返回", for: .normal)
                        label_content.text = msg
                        if code == 3{btn_again.setTitle("去充值", for: .normal)}
                        if code == 2{btn_again.setTitle("去充值", for: .normal)}
                    case .none:break
                }
@@ -253,7 +253,7 @@
                    })
                }
                if objType == .recharge{
                if objType == .recharge || objType == .yard{
                    navigationController?.popViewController()
                }
@@ -342,7 +342,7 @@
            cell.courseCouponModel = m
        }
        if let m = model as? CouponInfoModel{
        if let m = model as? CouponInfo_1_Model{
            cell.couponInfoModel = m
        }
WanPai/Root/Other/VC/ProfileVC.swift
@@ -68,7 +68,7 @@
    }
    @IBAction func logoutAction(_ sender: UIButton) {
        CommonAlertView.show(title: "提示", content: "确认退出当前账号?") { status in
        CommonAlertView.show(title: "提示", content: "确认退出当前账号?",cancelStr: "关闭",completeStr: nil,isSingle: false) { status in
            if status{
                UserViewModel.clearToken()
                app.needLogin()
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.swift
@@ -26,7 +26,11 @@
                btn_price.setTitle(price, for: .normal)
            }
            label_hasNum.attributedText = AttributedStringbuilder.build().add(string: "包含课时数:", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#737373")).add(string: "\(detailCourseModel.classHours)课时", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#F11010")).mutableAttributedString
            let num = detailCourseModel.classHours.map({"\($0)"}).joined(separator: "、").filter({$0 != "0"})
            stack_hasNum.isHidden = num.isEmpty
            label_hasNum.attributedText = AttributedStringbuilder.build().add(string: "包含课时数:", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#737373")).add(string: "\(detailCourseModel.classHours.map({"\($0)"}).joined(separator: ","))课时", withFont: UIFont.systemFont(ofSize: 14), withColor: UIColor(hexStr: "#F11010")).mutableAttributedString
            stack_teachTime.isHidden = detailCourseModel.classStartTime?.isEmpty ?? true
        }
    }
@@ -34,7 +38,9 @@
    @IBOutlet weak var label_title: UILabel!
    @IBOutlet weak var label_teachTime: UILabel!
    @IBOutlet weak var label_hasNum: UILabel!
    @IBOutlet weak var label_enrollNum: UILabel!
    @IBOutlet weak var stack_teachTime: UIStackView!
    @IBOutlet weak var stack_hasNum: UIStackView!
    @IBOutlet weak var label_enrollNum: UILabel!
    @IBOutlet weak var btn_price: UIButton!
WanPai/Root/Search/TCell/SearchStoreDetail_1_TCell.xib
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<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">
    <device id="retina6_12" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
        <capability name="Named colors" minToolsVersion="9.0"/>
        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
        <capability name="System colors in document resources" minToolsVersion="11.0"/>
@@ -148,6 +148,8 @@
                <outlet property="label_hasNum" destination="pVH-xx-Gth" id="0f1-qh-dXX"/>
                <outlet property="label_teachTime" destination="cOf-iE-VAe" id="Fd0-fd-Xov"/>
                <outlet property="label_title" destination="oRx-lW-o8z" id="CQn-v1-5eT"/>
                <outlet property="stack_hasNum" destination="y0n-rD-lkk" id="P3g-LR-028"/>
                <outlet property="stack_teachTime" destination="sg8-2M-iFr" id="CI0-UG-0Kx"/>
            </connections>
            <point key="canvasLocation" x="217.55725190839695" y="69.718309859154928"/>
        </tableViewCell>
WanPai/Root/Search/VC/SearchStoreDetailVC.swift
@@ -54,29 +54,9 @@
        super.viewDidLoad()
        title = "门店详情"
//        DispatchQueue.main.async {
//            self.headView.layoutIfNeeded()
//            self.headView.layoutSubviews()
//            let height = self.headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height
//            self.headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: height)
//            self.tableView.tableHeaderView = self.headView
//        }
        Services.exploreStoreDetail(storeId: id).subscribe(onNext: {[weak self] data in
            if let model = data.data{
                self?.searchStoreDetailModel = model
//                DispatchQueue.main.async {
//                    self?.headView.layoutIfNeeded()
//                    self?.headView.layoutSubviews()
//                    let height = self!.headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).height
//                    self?.headView.frame = CGRect(x: 0, y: 0, width: JQ_ScreenW, height: height)
//                    self?.tableView.tableHeaderView = self!.headView
//                }
//                    DispatchQueue.main.asyncAfter(deadline: .now()+1.5){
//                        self?.tableView.tableHeaderView?.height = 500
//                }
            }
        }).disposed(by: disposeBag)
WanPai/Root/Search/VC/SearchStoreListVC.swift
@@ -16,6 +16,7 @@
    @IBOutlet weak var btn_limits: QMUIButton!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var stackView: UIStackView!
    private var id:Int!
    override func viewDidLoad() {
        super.viewDidLoad()
@@ -40,6 +41,15 @@
        tableView.register(UINib(nibName: "SearchStoreTCell", bundle: nil), forCellReuseIdentifier: "_SearchStoreTCell")
    }
    init(id:Int) {
        super.init(nibName: nil, bundle: nil)
        self.id = id
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    @IBAction func cityAction(_ sender: QMUIButton) {
        guard !sender.isSelected else {return}
        sender.isSelected = true
WanPai/Root/Welfare/TCell/BillInfoTCell.swift
@@ -14,14 +14,27 @@
        didSet{
            label_title.text = billingModel.consumeName
            label_datetime.text = billingModel.consumeTime
            label_price.text = billingModel.consumeAmount.currency()
            if billingModel.type == .positive{
                label_price.text = billingModel.consumeAmount.jq_formatFloat
                label_price.textColor = UIColor(hexStr: "#FD2A02")
            }else{
                label_price.text = "+" + billingModel.consumeAmount.jq_formatFloat
                label_price.textColor = UIColor(hexStr: "#2AA60B")
            }
            if billingModel.type != nil{
                if billingModel.type == .positive{
                    label_price.text = billingModel.consumeAmount
                    label_price.textColor = UIColor(hexStr: "#FD2A02")
                }else{
                    label_price.text = billingModel.consumeAmount
                    label_price.textColor = UIColor(hexStr: "#2AA60B")
                }
            }
            if billingModel.recordId != nil{
                if billingModel.recordId == 1{
                    label_price.text = billingModel.consumeAmount
                    label_price.textColor = UIColor(hexStr: "#FD7302")
                }else{
                    label_price.text = billingModel.consumeAmount
                    label_price.textColor = UIColor(hexStr: "#FD2A02")
                }
            }
        }
    }
WanPai/Root/Welfare/TCell/WelfareCouponsTCell.swift
@@ -62,7 +62,7 @@
                    img_footer.image = UIImage(named: "icon_coupon_footer")?.withTintColor(UIColor(hexStr: "#BEBEBE"),renderingMode: .alwaysOriginal)
            }
            btn_detail.isHidden = couponModel.useCondition != .nationwide
            btn_detail.isHidden = couponModel.useCondition == .nationwide
            label_info.text = couponModel.instructionsForUse
            switch couponModel.type {
WanPai/Root/Welfare/VC/RechargeRecordVC.swift
@@ -136,14 +136,6 @@
        let model = viewModel.dataSource.value[indexPath.row]
        let cell = tableView.dequeueReusableCell(withIdentifier: "_BillInfoTCell") as! BillInfoTCell
        cell.billingModel = model
        if viewModel.subType.value == .coin{
            if model.type == .positive{
                cell.label_price.textColor = UIColor(hexStr: "#FD7302")
            }else{
                cell.label_price.textColor = UIColor(hexStr: "#FD2A02")
            }
        }
        return cell
    }
WanPai/Root/Welfare/VC/WelfareRedeemGoodsDetailVC.swift
@@ -73,20 +73,7 @@
        view_selectStore.isHidden = true
        view_selectStoreHei.constant = 0
        if let type = goodsType{
            Services.UseBenefitDetail(goodsId: id, goodsType: type).subscribe(onNext: {[weak self] data in
                if let model = data.data{
                    self?.updateData(model)
                }
            }).disposed(by: disposeBag)
        }else{
            Services.UseBenefitDetailOne(goodsId: id).subscribe(onNext: {[weak self] data in
                if let model = data.data{
                    self?.updateData(model)
                }
            }).disposed(by: disposeBag)
        }
        updateStudenTable()
        getData()
    }
    override func setUI() {
@@ -108,6 +95,23 @@
            make.edges.equalToSuperview()
        }
    }
    private func getData(){
        if let type = goodsType{
            Services.UseBenefitDetail(goodsId: id, goodsType: type).subscribe(onNext: {[weak self] data in
                if let model = data.data{
                    self?.updateData(model)
                }
            }).disposed(by: disposeBag)
        }else{
            Services.UseBenefitDetailOne(goodsId: id).subscribe(onNext: {[weak self] data in
                if let model = data.data{
                    self?.updateData(model)
                }
            }).disposed(by: disposeBag)
        }
        updateStudenTable()
    }
    override func setRx() {
        self.webView.scrollView.rx.observe(CGSize.self, "contentSize").map { (size) -> CGFloat? in
@@ -186,7 +190,7 @@
            self?.studentModels = studs as! [CourseDetailStudentModel]
            self?.updateStudenTable()
        } needAddClouse: { [weak self] in
            let vc = ActivityStudentListVC()
            let vc = AddStudentVC(type: .course)
            self?.push(vc: vc)
        }
    }
@@ -207,7 +211,7 @@
    @IBAction func exchangeAction(_ sender: UIButton) {
        guard exchangeGoodsModel != nil else {return}
        guard exchangeGoodsModel!.residueNum != 0 else {alert(msg: "已兑换光啦");return}
        guard exchangeGoodsModel!.redeemedNum != exchangeGoodsModel!.perLimit else {alert(msg: "您已兑换光啦");return}
//        guard exchangeGoodsModel!.redeemedNum != exchangeGoodsModel!.perLimit else {alert(msg: "您已兑换光啦");return}
        if exchangeGoodsModel!.goodType == .course{
            guard studentModels.count != 0 else {alert(msg: "请选择运动营成员");return}
        }
@@ -232,9 +236,10 @@
        var coin = 0
        var cash:Double = 0
        var totalNum = num * studentModels.count
        if exchangeGoodsModel?.goodType == .course{
            coin = exchangeGoodsModel!.integral * num * studentModels.count
            cash = (exchangeGoodsModel!.cash * Double(num) * Double(studentModels.count))
            coin = exchangeGoodsModel!.integral * totalNum
            cash = (exchangeGoodsModel!.cash * Double(totalNum))
        }else{
            coin = exchangeGoodsModel!.integral * num
            cash = (exchangeGoodsModel!.cash * Double(num))
@@ -254,8 +259,14 @@
            guard state else {return}
            guard let weakSelf = self else { return }
            var n = num
            if weakSelf.exchangeGoodsModel?.goodType == .course{
                n = num * weakSelf.studentModels.count
            }
            if weakSelf.exchangeGoodsModel!.exchangeType == .coin{
                Services.exchangeOperation(exchangeType: .coin, goodsId: weakSelf.exchangeGoodsModel!.goodId, goodsType: weakSelf.exchangeGoodsModel!.goodType, num: num, payType: nil, stuIds: weakSelf.studentModels.map({"\($0.id)"}).joined(separator: ","),storeId: weakSelf.selectStoreModel?.storeId).subscribe(onNext: {[weak self] data in
                Services.exchangeOperation(exchangeType: .coin, goodsId: weakSelf.exchangeGoodsModel!.goodId, goodsType: weakSelf.exchangeGoodsModel!.goodType, num: n, payType: nil, stuIds: weakSelf.studentModels.map({"\($0.id)"}).joined(separator: ","),storeId: weakSelf.selectStoreModel?.storeId).subscribe(onNext: {[weak self] data in
                    guard let weakSelf = self else { return }
                    let vc = PaymentResultVC(result: .success, objType: .exchange)
                    vc.otherInfo = ["id":data.data?.returnId ?? 0,"goodsType":weakSelf.exchangeGoodsModel!.goodType.rawValue]
@@ -277,10 +288,9 @@
                    }
                }).disposed(by: weakSelf.disposeBag)
            }else {
                    //支付金额
                let cash = weakSelf.exchangeGoodsModel!.cash * Double(num)
                //支付金额
                PaymentView.show(money: (ali:cash,wx:cash,coin:nil,course:nil,integral:nil)) { payType in
                    Services.exchangeOperation(exchangeType: weakSelf.exchangeGoodsModel!.exchangeType, goodsId: weakSelf.exchangeGoodsModel!.goodId, goodsType: weakSelf.exchangeGoodsModel!.goodType, num: num, payType: payType, stuIds: weakSelf.studentModels.map({"\($0.id)"}).joined(separator: ","), storeId: weakSelf.selectStoreModel?.storeId).subscribe(onNext: {[weak self] data in
                    Services.exchangeOperation(exchangeType: weakSelf.exchangeGoodsModel!.exchangeType, goodsId: weakSelf.exchangeGoodsModel!.goodId, goodsType: weakSelf.exchangeGoodsModel!.goodType, num: n, payType: payType, stuIds: weakSelf.studentModels.map({"\($0.id)"}).joined(separator: ","), storeId: weakSelf.selectStoreModel?.storeId).subscribe(onNext: {[weak self] data in
                        if let m = data.data{
                            switch payType {
                                case .aliPay:
@@ -334,10 +344,11 @@
    }
    private func exchangeSuccessUI(){
        btn_exchange.setTitle("已兑换", for: .normal)
        btn_exchange.isEnabled = false
        label_redeemedNum.text = "\(exchangeGoodsModel!.redeemedNum + 1)"
        label_residueNum.text = "\(exchangeGoodsModel!.residueNum - 1)"
//        btn_exchange.setTitle("已兑换", for: .normal)
//        btn_exchange.isEnabled = false
//        label_redeemedNum.text = "\(exchangeGoodsModel!.redeemedNum + 1)"
//        label_residueNum.text = "\(exchangeGoodsModel!.residueNum - 1)"
        getData()
    }
}
WanPai/Root/Welfare/VC/WelfareWeeklyDetailVC.swift
@@ -47,6 +47,7 @@
        super.viewDidLoad()
        title = "运动营详情"
        label_vip.isHidden = true
        label_originPrice.isHidden = true
        Services.weekBenefitDetail(id: id).subscribe(onNext: {[weak self] data in
            guard let weakSelf = self else { return }
@@ -61,10 +62,11 @@
                weakSelf.label_attendWeeks.text = model.weekTime
                weakSelf.label_datetime.text = model.time
                weakSelf.label_distance.text = String(format: "距离我%.2lfkm", model.distance)
                weakSelf.label_coin.isHidden = model.wanpaiGold == 0
                weakSelf.label_originPrice.isHidden = model.costPrice == 0
                weakSelf.label_originPrice.attributedText = AttributedStringbuilder.build().add(string: model.costPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).mutableAttributedString
//                weakSelf.label_coin.isHidden = model.wanpaiGold == 0
//                weakSelf.label_coin.text = String(format: "玩湃币:%ld", model.wanpaiGold)
//                weakSelf.label_originPrice.isHidden = model.costPrice == 0
//
//                weakSelf.label_originPrice.attributedText = AttributedStringbuilder.build().add(string: model.costPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).mutableAttributedString
                weakSelf.label_price.text = model.discountPrice.currency()
                weakSelf.label_periodOfValidity.text = model.holiTime
@@ -84,6 +86,44 @@
                    items.append(CommonBannerModel(index: index,resource: img,mediaType: .imageUrl))
                }
                self?.view_banner.setItems(items: items)
                switch model.payType {
                    case .cash:
                        weakSelf.label_coin.isHidden = true
                        weakSelf.label_price.text = model.discountPrice.currency()
                        if model.costPrice != 0 && model.costPrice > model.discountPrice{
                            weakSelf.label_originPrice.isHidden = false
                            weakSelf.label_originPrice.attributedText = AttributedStringbuilder.build().add(string: model.costPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).mutableAttributedString
                        }else{
                            weakSelf.label_originPrice.isHidden = true
                        }
                        if model.costPrice > 0 && model.discountPrice < model.costPrice{
                            weakSelf.label_originPrice.attributedText = AttributedStringbuilder.build().add(string: model.costPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).mutableAttributedString
                        }
                    case .cashCoin:
                        weakSelf.label_coin.isHidden = false
                        weakSelf.label_coin.attributedText = AttributedStringbuilder.build()
                            .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                            .add(string: "\(model.wanpaiGold)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                        weakSelf.label_price.text = model.discountPrice.currency()
                        if model.costPrice > 0 && model.discountPrice < model.costPrice{
                            weakSelf.label_originPrice.attributedText = AttributedStringbuilder.build().add(string: model.costPrice.currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).delLine(color: UIColor(hexStr: "#3F3F3F").withAlphaComponent(0.58)).mutableAttributedString
                        }
                    case .coin:
                        weakSelf.label_originPrice.isHidden = true
                        weakSelf.label_price.isHidden = true
                        weakSelf.label_coin.attributedText = AttributedStringbuilder.build()
                            .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F"))
                            .add(string: "\(model.wanpaiGold)币", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#F21313")).mutableAttributedString
                }
            }
        }).disposed(by: disposeBag)
        
WanPai/Root/Welfare/VC/WelfareWeeklyDetailVC.xib
@@ -150,52 +150,11 @@
                                        <constraint firstItem="Gaj-iR-oGe" firstAttribute="top" secondItem="hIw-tK-g98" secondAttribute="bottom" constant="14" id="omw-rU-fgZ"/>
                                    </constraints>
                                </view>
                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sMM-yC-Gqf">
                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="He4-gs-Axl">
                                    <rect key="frame" x="0.0" y="361.33333333333331" width="393" height="49"/>
                                    <subviews>
                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i8f-Rx-ml6">
                                            <rect key="frame" x="13" y="48" width="380" height="1"/>
                                            <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="1" id="9ns-BZ-SIf"/>
                                            </constraints>
                                        </view>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课包有效期:" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Meb-ED-QHf">
                                            <rect key="frame" x="14" y="14" width="86" height="20"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="20" id="O44-OU-6MS"/>
                                            </constraints>
                                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                            <nil key="textColor"/>
                                            <nil key="highlightedColor"/>
                                        </label>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0课时" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bVb-n2-hDd">
                                            <rect key="frame" x="105" y="14" width="37.333333333333343" height="20"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="20" id="OET-lZ-XDM"/>
                                            </constraints>
                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                            <color key="textColor" red="0.87450980389999999" green="0.062745098040000002" blue="0.062745098040000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                            <nil key="highlightedColor"/>
                                        </label>
                                    </subviews>
                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                    <constraints>
                                        <constraint firstItem="Meb-ED-QHf" firstAttribute="leading" secondItem="sMM-yC-Gqf" secondAttribute="leading" constant="14" id="6FL-YT-46k"/>
                                        <constraint firstAttribute="trailing" secondItem="i8f-Rx-ml6" secondAttribute="trailing" id="9r3-oO-rC4"/>
                                        <constraint firstAttribute="bottom" secondItem="i8f-Rx-ml6" secondAttribute="bottom" id="ICN-1Z-M1O"/>
                                        <constraint firstItem="bVb-n2-hDd" firstAttribute="centerY" secondItem="Meb-ED-QHf" secondAttribute="centerY" id="geO-q7-eO9"/>
                                        <constraint firstItem="i8f-Rx-ml6" firstAttribute="leading" secondItem="sMM-yC-Gqf" secondAttribute="leading" constant="13" id="hpx-ga-ebC"/>
                                        <constraint firstItem="Meb-ED-QHf" firstAttribute="top" secondItem="sMM-yC-Gqf" secondAttribute="top" constant="14" id="iwY-JH-2Jf"/>
                                        <constraint firstItem="i8f-Rx-ml6" firstAttribute="top" secondItem="Meb-ED-QHf" secondAttribute="bottom" constant="14" id="oZA-KO-Zzv"/>
                                        <constraint firstItem="bVb-n2-hDd" firstAttribute="leading" secondItem="Meb-ED-QHf" secondAttribute="trailing" constant="5" id="q6T-vh-MBA"/>
                                    </constraints>
                                </view>
                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="He4-gs-Axl">
                                    <rect key="frame" x="0.0" y="410.33333333333331" width="393" height="49"/>
                                    <subviews>
                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Q7u-VG-gsT">
                                            <rect key="frame" x="13" y="48.000000000000057" width="380" height="1"/>
                                            <rect key="frame" x="13" y="48" width="380" height="1"/>
                                            <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="1" id="Ctc-XK-pWb"/>
@@ -233,10 +192,10 @@
                                    </constraints>
                                </view>
                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hQc-bT-aln">
                                    <rect key="frame" x="0.0" y="459.33333333333337" width="393" height="86"/>
                                    <rect key="frame" x="0.0" y="410.33333333333331" width="393" height="86"/>
                                    <subviews>
                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hrq-r5-1M6">
                                            <rect key="frame" x="13" y="73" width="380" height="1"/>
                                            <rect key="frame" x="13" y="73.000000000000057" width="380" height="1"/>
                                            <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="1" id="ahK-DF-ojc"/>
@@ -284,6 +243,47 @@
                                        <constraint firstAttribute="trailing" secondItem="oZw-he-MSe" secondAttribute="trailing" constant="5" id="vro-n9-BeA"/>
                                    </constraints>
                                </view>
                                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sMM-yC-Gqf">
                                    <rect key="frame" x="0.0" y="496.33333333333337" width="393" height="49"/>
                                    <subviews>
                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i8f-Rx-ml6">
                                            <rect key="frame" x="13" y="48" width="380" height="1"/>
                                            <color key="backgroundColor" red="0.59215686270000001" green="0.59215686270000001" blue="0.59215686270000001" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="1" id="9ns-BZ-SIf"/>
                                            </constraints>
                                        </view>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="运动营有效期:" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Meb-ED-QHf">
                                            <rect key="frame" x="14" y="14" width="100" height="20"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="20" id="O44-OU-6MS"/>
                                            </constraints>
                                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
                                            <nil key="textColor"/>
                                            <nil key="highlightedColor"/>
                                        </label>
                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0课时" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bVb-n2-hDd">
                                            <rect key="frame" x="118.99999999999999" y="14" width="37.333333333333329" height="20"/>
                                            <constraints>
                                                <constraint firstAttribute="height" constant="20" id="OET-lZ-XDM"/>
                                            </constraints>
                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                            <color key="textColor" red="0.87450980389999999" green="0.062745098040000002" blue="0.062745098040000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                            <nil key="highlightedColor"/>
                                        </label>
                                    </subviews>
                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                    <constraints>
                                        <constraint firstItem="Meb-ED-QHf" firstAttribute="leading" secondItem="sMM-yC-Gqf" secondAttribute="leading" constant="14" id="6FL-YT-46k"/>
                                        <constraint firstAttribute="trailing" secondItem="i8f-Rx-ml6" secondAttribute="trailing" id="9r3-oO-rC4"/>
                                        <constraint firstAttribute="bottom" secondItem="i8f-Rx-ml6" secondAttribute="bottom" id="ICN-1Z-M1O"/>
                                        <constraint firstItem="bVb-n2-hDd" firstAttribute="centerY" secondItem="Meb-ED-QHf" secondAttribute="centerY" id="geO-q7-eO9"/>
                                        <constraint firstItem="i8f-Rx-ml6" firstAttribute="leading" secondItem="sMM-yC-Gqf" secondAttribute="leading" constant="13" id="hpx-ga-ebC"/>
                                        <constraint firstItem="Meb-ED-QHf" firstAttribute="top" secondItem="sMM-yC-Gqf" secondAttribute="top" constant="14" id="iwY-JH-2Jf"/>
                                        <constraint firstItem="i8f-Rx-ml6" firstAttribute="top" secondItem="Meb-ED-QHf" secondAttribute="bottom" constant="14" id="oZA-KO-Zzv"/>
                                        <constraint firstItem="bVb-n2-hDd" firstAttribute="leading" secondItem="Meb-ED-QHf" secondAttribute="trailing" constant="5" id="q6T-vh-MBA"/>
                                    </constraints>
                                </view>
                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="9fb-wg-pcf">
                                    <rect key="frame" x="0.0" y="545.33333333333337" width="393" height="100"/>
                                    <constraints>
WanPai/Root/Yard/VC/YardBookingDetailVC.swift
@@ -66,6 +66,9 @@
        yy_popBlock = {[weak self] () in
            guard let weakSelf = self else { return }
            var popToVc:UIViewController?
            if weakSelf.navigationController!.viewControllers.contains(where: {$0 is YardBookingListVC}){
                weakSelf.navigationController?.popViewController();return
            }
            for vc in weakSelf.navigationController!.viewControllers{
                if vc is YardListVC{popToVc = vc;break}
            }
WanPai/Root/Yard/VC/YardDetailVC.swift
@@ -274,7 +274,8 @@
    @IBAction func halfYardTypeAction(_ sender: QMUIButton) {
        btn_fullYard.isSelected = sender.tag == 200
        btn_halfYard.isSelected = sender.tag == 201
        selectCouponModel = nil
        btn_coupon.setTitle("去选择", for: .normal)
        if btn_fullYard.isSelected{
            halfIndex = nil
        }else{
@@ -372,8 +373,10 @@
            guard let weakSelf = self else { return }
            if status{
                let a = YardDetailDateManager.shared().dates.value.values.first!
                let price = Double(a.count) * weakSelf.siteDetailModel.cashPrice - (weakSelf.selectCouponModel?.favorable ?? 0)
                let coin = a.count * weakSelf.siteDetailModel.playPaiCoin
                let cashPrice = weakSelf.btn_halfYard.isSelected ? weakSelf.siteDetailModel.cashPriceOne:weakSelf.siteDetailModel.cashPrice
                let coinPrice = weakSelf.btn_halfYard.isSelected ? weakSelf.siteDetailModel.playPaiCoinOne : weakSelf.siteDetailModel.playPaiCoin
                let price = Double(a.count) * cashPrice - (weakSelf.selectCouponModel?.favorable ?? 0)
                let coin = a.count * coinPrice
                var datetimes = [String]()
                let key = YardDetailDateManager.shared().dates.value.keys.first!