| | |
| | | self.getData() |
| | | self.queryNotice() |
| | | }).disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(LoginQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {data in |
| | | self.label_userName.text = "请先登录" |
| | | self.image_userAvatar.image = nil |
| | | self.label_phone.text = "" |
| | | self.label_totalDay.attributedText = AttributedStringbuilder.build().add(string: "0", withFont: UIFont.init(name: "PingFang-SC-Regular", size: 60)!, withColor: UIColor(hexString: "#152715")!).add(string: "天", withFont: .systemFont(ofSize: 16), withColor: UIColor(hexString: "#152715")!).mutableAttributedString |
| | | |
| | | self.image_medal.image = nil |
| | | |
| | | self.label_sustainDay.attributedText = AttributedStringbuilder.build().add(string: "0", withFont: .systemFont(ofSize: 23), withColor: UIColor(hexString: "#152715")!).add(string: "天", withFont: .systemFont(ofSize: 12), withColor: UIColor(hexString: "#152715")!).mutableAttributedString |
| | | |
| | | self.image_vipBg.image = UIImage(named: "bg_vip_u") |
| | | self.label_vipInfo.text = "升级为高级会员,解锁全部体验" |
| | | self.label_expirtTime.text = "你还未开通会员服务" |
| | | |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | private func getData(){ |
| | | Services.getUserInfo().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | |
| | | Services.getUserDetail().subscribe(onNext: {[weak self]data in |
| | | if let model = data.data{ |
| | | UserViewModel.saveAvatarInfo(model) |
| | | self?.setUserUI(model: model) |
| | | |
| | | } |
| | | },onError: {[weak self]error in |
| | | } |
| | | }) {[weak self] error in |
| | | let model = UserViewModel.getAvatarInfo() |
| | | if model.id > 0{ |
| | | self?.setUserUI(model: model) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func setUserUI(model:UserInfoModel){ |