| | |
| | | var storeName: String = "" |
| | | var storeInfos = [ActivityDetailStoreModel]() |
| | | var hasPass = 0 // 0:正常,1:截止 |
| | | var isReal:Int = 0 |
| | | } |
| | | |
| | | struct ActivityDetailStoreModel:HandyJSON{ |
| | |
| | | |
| | | /// 获取参赛人员列表 |
| | | class func queryParticipantList(isAuth:Int? = nil)->Observable<BaseResponse<[ActivityDetailPartModel]>>{ |
| | | let params = ParamsAppender.build(url: All_Url) |
| | | var params = ParamsAppender.build(url: All_Url) |
| | | .interface(url: "competition/api/participant/queryParticipantList") |
| | | .append(key: "isPre", value: isAuth) |
| | | if isAuth == 1{ |
| | | params.append(key: "isPre", value: isAuth) |
| | | } |
| | | return NetworkRequest.request(params: params, method: .post, progress: false) |
| | | } |
| | | |
| | |
| | | var activityListModel:ActivityListModel?{ |
| | | didSet{ |
| | | if let m = activityListModel{ |
| | | img_profile.sd_setImage(with: URL(string: m.coverDrawing)!,placeholderImage: UIImage(named: "placeholder_1")) |
| | | img_profile.sd_setImage(with: URL(string: m.coverDrawing),placeholderImage: UIImage(named: "placeholder_1")) |
| | | label_title.text = m.name |
| | | |
| | | var temp = [String]() |
| | |
| | | } |
| | | |
| | | @IBAction func addStudentAction(_ sender: QMUIButton) { |
| | | StudentChooseView.show(itemType: .activity, defaultStu: students) { [weak self] studs in |
| | | StudentChooseView.show(itemType: .activity, defaultStu: students,isAuth: activityDetailModel.isReal) { [weak self] studs in |
| | | self?.students = studs as! [ActivityDetailPartModel] |
| | | self?.cons_tableHei.constant = Double(self?.students.count ?? 0) * 100 |
| | | self?.tableView.reloadData() |
| | |
| | | label_price.isHidden = true |
| | | label_originPrice.isHidden = true |
| | | label_vipPrice.isHidden = true |
| | | |
| | | label_coin.isHidden = false |
| | | //纯玩湃币没有优惠券项 |
| | | btn_hasCoupon.isHidden = true |
| | | |
| | | label_coin.isHidden = false |
| | | //玩湃币 |
| | | label_coin.attributedText = AttributedStringbuilder.build() |
| | | .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | |
| | | label_originPrice.isHidden = false |
| | | } |
| | | // label_originPrice.isHidden = (subM.paymentPrice == subM.originalPrice && subM.paymentPrice != 0 && subM.originalPrice != 0) |
| | | |
| | | label_coin.isHidden = false |
| | | //玩湃币 |
| | | label_coin.attributedText = AttributedStringbuilder.build() |
| | | .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | |
| | | label_originPrice.attributedText = attribute.mutableAttributedString |
| | | |
| | | if UserInfoModel.get()?.isVip == 1{ |
| | | |
| | | if subM.payType != .coin{ |
| | | //会员 |
| | | label_vipPrice.isHidden = true |
| | | if subM.paymentPrice < subM.vipPrice && subM.paymentPrice != 0{ |
| | |
| | | }else{ |
| | | label_price.text = (subM.paymentPrice * studentCount - (selectCouponModel?.favorable ?? 0)).currency() |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | if subM.payType != .coin{ |
| | | //非会员 |
| | | label_vipPrice.isHidden = subM.vipPrice == 0 || subM.vipPrice == subM.paymentPrice |
| | | let vipAttribute = AttributedStringbuilder.build() |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if detailModel?.type == .experience{ |
| | | |
| | | if subM.paymentPrice != 0{ |
| | | label_price.text = subM.paymentPrice.currency() |
| | | label_price.isHidden = false |
| | | } |
| | | |
| | | view_teach.isHidden = true |
| | | label_originPrice.isHidden = true |
| | | label_vipPrice.isHidden = true |
| | | } |
| | | |
| | | if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{ |
| | | label_coin.alpha = 0 |
| | | } |
| | | // if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{ |
| | | // label_coin.alpha = 0 |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | label_price.isHidden = true |
| | | label_originPrice.isHidden = true |
| | | label_vipPrice.isHidden = true |
| | | |
| | | label_coin.isHidden = false |
| | | //玩湃币 |
| | | label_coin.attributedText = AttributedStringbuilder.build() |
| | | .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | |
| | | }else{ |
| | | label_originPrice.isHidden = false |
| | | } |
| | | label_coin.isHidden = false |
| | | //玩湃币 |
| | | label_coin.attributedText = AttributedStringbuilder.build() |
| | | .add(string: "玩湃币:", withFont: UIFont.systemFont(ofSize: 14, weight: .semibold), withColor: UIColor(hexStr: "#3F3F3F")) |
| | |
| | | label_originPrice.attributedText = attribute.mutableAttributedString |
| | | |
| | | if UserInfoModel.get()?.isVip == 1{ |
| | | if subM.payType != .coin{ |
| | | //会员 |
| | | label_vipPrice.isHidden = true |
| | | //优惠价比会员价更优惠 |
| | |
| | | }else{ |
| | | label_price.text = subM.paymentPrice.currency() |
| | | } |
| | | } |
| | | }else{ |
| | | if subM.payType != .coin{ |
| | | //非会员 |
| | | label_vipPrice.isHidden = subM.vipPrice == 0 || subM.vipPrice == subM.paymentPrice |
| | | let vipAttribute = AttributedStringbuilder.build() |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if m.type == .experience{ |
| | | label_price.text = (m.list.first?.paymentPrice ?? 0).currency() |
| | | |
| | | if m.list.first?.paymentPrice != 0{ |
| | | label_price.text = (m.list.first!.paymentPrice).currency() |
| | | label_price.isHidden = false |
| | | } |
| | | |
| | | label_vaildTime.text = "购买当天有效" |
| | | label_originPrice.isHidden = true |
| | | label_vipPrice.isHidden = true |
| | | view_listen.isHidden = true |
| | | label_price.isHidden = (m.list.first?.paymentPrice ?? 0) == 0 |
| | | // label_price.isHidden = (m.list.first?.paymentPrice ?? 0) == 0 |
| | | } |
| | | |
| | | //体验课,假期课不展示 |
| | |
| | | cons_handleHei.constant = 0 |
| | | } |
| | | |
| | | if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{ |
| | | label_coin.alpha = 0 |
| | | } |
| | | // if label_originPrice.isHidden && label_vipPrice.isHidden && label_coin.isHidden{ |
| | | // label_coin.alpha = 0 |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | override func setUI() { |
| | | cons_menuHeight.constant = 0 |
| | | scrollView.contentInset = UIEdgeInsets( top: 265 - JQ_NavBarHeight, left: 0, bottom: 0, right: 0) |
| | | scrollView.contentInset = UIEdgeInsets( top: UIDevice.jq_safeEdges.top + 158, left: 0, bottom: 0, right: 0) |
| | | scrollView.delegate = self |
| | | scrollView.bringSubviewToFront(img_header) |
| | | |
| | |
| | | var sort:Int = 0 |
| | | var backgroundImage:String = "" |
| | | var cellHeight:Double = 270 |
| | | |
| | | |
| | | } |
| | | |
| | | class HomeStoreTopBannerModel:HandyJSON{ |
| | |
| | | var type:String = "" //类型 |
| | | var turnId:Int? |
| | | var model = "" |
| | | |
| | | |
| | | var sort = 0 |
| | | var cellHeight:Double = 270 |
| | | } |
| | | |
| | |
| | | import RxCocoa |
| | | import SDWebImage |
| | | |
| | | //http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 |
| | | //http://vjs.zencdn.net/v/oceans.mp4 |
| | | //https://media.w3.org/2010/05/sintel/trailer.mp4 |
| | | |
| | | let ChooseHomeStore_Noti = Notification.Name.init("ChooseHomeStore_Noti") |
| | | let UpdateCurrentStore_Noti = Notification.Name.init("UpdateCurrentStore_Noti") |
| | | |
| | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | Services.bannerList(position: .homeTop).subscribe(onNext: {[weak self] data in |
| | | guard let weakSelf = self else { return } |
| | | if let models = data.data{ |
| | | var bannerResources = [CommonBannerModel]() |
| | | for (i,item) in models.enumerated() { |
| | |
| | | |
| | | private func getStoreItemList(){ |
| | | |
| | | // showHUD() |
| | | items.removeAll() |
| | | |
| | | Services.homeStoreConfig(storeId: storeId!).subscribe(onNext: {[weak self] data in |
| | |
| | | } |
| | | |
| | | group.notify(queue: .main) { |
| | | self.items = self.items.sorted { v1, v2 in |
| | | var v1Sort = 0 |
| | | var v2Sort = 0 |
| | | |
| | | v1Sort = (v1 as? HomeStoreConfigModel)?.sort ?? 0 |
| | | v2Sort = (v2 as? HomeStoreConfigModel)?.sort ?? 0 |
| | | |
| | | v1Sort = (v1 as? HomeStoreTopBannerModel)?.sort ?? 0 |
| | | v2Sort = (v2 as? HomeStoreTopBannerModel)?.sort ?? 0 |
| | | |
| | | return v1Sort < v2Sort |
| | | } |
| | | self.layout.collectionView?.reloadData() |
| | | self.collectionView.reloadData() |
| | | } |
| | |
| | | } |
| | | |
| | | class ActivityViewModel:RefreshModel<ActivityDetailPartModel>{ |
| | | var isAuth = BehaviorRelay<Int?>.init(value: nil) |
| | | override func api() -> (Observable<BaseResponse<[ActivityDetailPartModel]>>)? { |
| | | return Services.queryParticipantList(isAuth: 1) |
| | | return Services.queryParticipantList(isAuth: isAuth.value) |
| | | } |
| | | |
| | | } |
| | |
| | | setRx() |
| | | } |
| | | |
| | | static func show(itemType:ItemType,defaultStu:[Any]? = nil,clickClouse:@escaping ([Any])->Void,needAddClouse:@escaping ()->Void){ |
| | | static func show(itemType:ItemType,defaultStu:[Any]? = nil,isAuth:Int? = nil,clickClouse:@escaping ([Any])->Void,needAddClouse:@escaping ()->Void){ |
| | | let studentChooseView = StudentChooseView.jq_loadNibView() |
| | | if defaultStu != nil{ |
| | | studentChooseView.selectStudents = defaultStu! |
| | |
| | | studentChooseView.stuViewModel.beginRefresh() |
| | | }else{ |
| | | studentChooseView.actViewModel.configure(studentChooseView.tableView,needMore: false) |
| | | studentChooseView.actViewModel.isAuth.accept(isAuth) |
| | | studentChooseView.actViewModel.beginRefresh() |
| | | studentChooseView.cons_tableLeading.constant = 0 |
| | | studentChooseView.cons_tableTrailing.constant = 0 |
| | |
| | | |
| | | switch exchangeGoodsModel!.exchangeType{ |
| | | case .cash: |
| | | attribute.add(string: (exchangeGoodsModel!.cash * Double(num)).currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .medium), withColor: UIColor(hexStr: "#E41818").withAlphaComponent(0.8)) |
| | | attribute.add(string: (exchangeGoodsModel!.cash * Double(studentModels.count) * Double(num)).currency(), withFont: UIFont.systemFont(ofSize: 16, weight: .medium), withColor: UIColor(hexStr: "#E41818").withAlphaComponent(0.8)) |
| | | case .cashAndCoin: |
| | | attribute.add(string: String(format: "%ld积分和%@", exchangeGoodsModel!.integral * num,(exchangeGoodsModel!.cash * Double(num)).currency()), withFont: UIFont.systemFont(ofSize: 16, weight: .medium), withColor: UIColor(hexStr: "#E41818").withAlphaComponent(0.8)) |
| | | attribute.add(string: String(format: "%ld积分和%@", exchangeGoodsModel!.integral * num * studentModels.count,(exchangeGoodsModel!.cash * Double(num) * Double(studentModels.count)).currency()), withFont: UIFont.systemFont(ofSize: 16, weight: .medium), withColor: UIColor(hexStr: "#E41818").withAlphaComponent(0.8)) |
| | | case .coin: |
| | | attribute.add(string: "\(exchangeGoodsModel!.integral * num)积分", withFont: UIFont.systemFont(ofSize: 16, weight: .medium), withColor: UIColor(hexStr: "#E41818").withAlphaComponent(0.8)) |
| | | attribute.add(string: "\(exchangeGoodsModel!.integral * num * studentModels.count)积分", withFont: UIFont.systemFont(ofSize: 16, weight: .medium), withColor: UIColor(hexStr: "#E41818").withAlphaComponent(0.8)) |
| | | } |
| | | |
| | | attribute.add(string: "兑换此商品吗?", withFont: UIFont.systemFont(ofSize: 16, weight: .medium), withColor: .black.withAlphaComponent(0.9)) |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "运动营详情" |
| | | label_vip.isHidden = true |
| | | |
| | | Services.weekBenefitDetail(id: id).subscribe(onNext: {[weak self] data in |
| | | guard let weakSelf = self else { return } |
| | |
| | | weakSelf.label_attendWeeks.text = model.weekTime |
| | | weakSelf.label_datetime.text = model.time |
| | | weakSelf.label_distance.text = String(format: "距离我%.2lfkm", model.distance) |
| | | weakSelf.label_vip.isHidden = model.discountPrice == 0 |
| | | 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_price.text = model.discountPrice.currency() |
| | | |
| | | weakSelf.img_intro.sd_setImage(with: URL(string: model.detailDrawing)) {[weak self] image, error, type, url in |
| | | if let img = image{ |
| | | self?.img_intro.image = img |
| | |
| | | <constraint firstAttribute="height" constant="1" id="Ctc-XK-pWb"/> |
| | | </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="IWq-FM-yEj"> |
| | | <rect key="frame" x="14" y="14" width="86" height="20"/> |
| | | <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="IWq-FM-yEj"> |
| | | <rect key="frame" x="14" y="14" width="71.666666666666671" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="Vgb-AO-v9r"/> |
| | | </constraints> |
| | |
| | | <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="mQE-9m-7Uc"> |
| | | <rect key="frame" x="105" y="14" width="37.333333333333343" height="20"/> |
| | | <rect key="frame" x="90.666666666666671" y="14" width="37.333333333333329" height="20"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="20" id="y12-6z-YGI"/> |
| | | </constraints> |