首页UI首页UI
This commit is contained in:
@@ -89,11 +89,44 @@ class PlanetStarVC: BaseViewController,HiddenNavigationBarProtocol {
|
||||
let giftName = self?.giftModel?.giftName ?? ""
|
||||
let giftNum = self?.giftModel?.goldPrice ?? "0"
|
||||
let text = "确认赠送 \(giftName)(\(giftNum)钻石)给\(name)吗"
|
||||
let alert = UIAlertController.init(title: "提示", message:text , preferredStyle: .alert)
|
||||
alert.addAction(UIAlertAction.init(title: "取消", style: .cancel, handler: { action in
|
||||
|
||||
}))
|
||||
alert.addAction(UIAlertAction.init(title: "确认", style: .default, handler: {[weak self] action in
|
||||
|
||||
guard UserDefaults.standard.value(forKey: "kIsShowPopUp") == nil else{
|
||||
RequestGet(path: "special/gift/get", parma: ["targetId":_uid]) { data in
|
||||
self?.activityView.removeFromSuperview()
|
||||
if let _ = Deserialized<PlanetStarModel>.toModel(with: data) {
|
||||
HUDTool.show(with: "送礼成功")
|
||||
let imageView = UIImageView(frame: CGRect(x: ScreenWidth/2-50, y: -100, width: 0, height: 0))
|
||||
|
||||
Nuke.loadImage(with: self?.giftModel?.picUrl ?? "", into: imageView)
|
||||
self?.view.addSubview(imageView)
|
||||
UIView.animate(withDuration: 2) {
|
||||
imageView.frame = CGRect(x: ScreenWidth/2-50, y: ScreenHeight/3 * 2, width: 100, height: 100)
|
||||
|
||||
}completion: { isC in
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
|
||||
UIView.animate(withDuration: 1) {
|
||||
let x = self?.bgRadiusView.imageView.frame.origin.x ?? 0
|
||||
let y = self?.bgRadiusView.imageView.frame.origin.y ?? 0
|
||||
imageView.frame = CGRect(x: x + 50, y: y + 50, width: 10, height: 10)
|
||||
|
||||
}completion: { isC in
|
||||
imageView.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} fail: { code, data in
|
||||
self?.activityView.removeFromSuperview()
|
||||
if code == 31005{
|
||||
self?.showPayVC()
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
let popUpView = PlanetStarPopUpView.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight))
|
||||
self?.view.addSubview(popUpView)
|
||||
popUpView.textView.text = text
|
||||
popUpView.clickSendBlcok = {[weak self] in
|
||||
self?.view.addSubview(self!.activityView)
|
||||
RequestGet(path: "special/gift/get", parma: ["targetId":_uid]) { data in
|
||||
self?.activityView.removeFromSuperview()
|
||||
@@ -122,24 +155,31 @@ class PlanetStarVC: BaseViewController,HiddenNavigationBarProtocol {
|
||||
} fail: { code, data in
|
||||
self?.activityView.removeFromSuperview()
|
||||
if code == 31005{
|
||||
let alert = UIAlertController.init(title: "提示", message:"钻石余额不足" , preferredStyle: .alert)
|
||||
alert.addAction(UIAlertAction.init(title: "取消", style: .cancel, handler: { action in
|
||||
|
||||
}))
|
||||
alert.addAction(UIAlertAction.init(title: "确认", style: .default, handler: {[weak self] action in
|
||||
let vc = UserPayViewController()
|
||||
self?.navigationController?.pushViewController(vc, animated: true)
|
||||
}))
|
||||
self?.present(alert, animated: true)
|
||||
self?.showPayVC()
|
||||
}
|
||||
}
|
||||
}))
|
||||
self?.present(alert, animated: true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
func showPayVC(){
|
||||
let popUpView = PlanetStarPopUpView.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: ScreenHeight))
|
||||
self.view.addSubview(popUpView)
|
||||
popUpView.textView.text = "钻石余额不足"
|
||||
popUpView.senderView.setTitle("去充值", for: .normal)
|
||||
popUpView.bgPointView.isHidden = true
|
||||
popUpView.pointTextView.isHidden = true
|
||||
popUpView.clickSendBlcok = {[weak self] in
|
||||
let vc = UserPayViewController()
|
||||
self?.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
let activityView:UIActivityIndicatorView = UIActivityIndicatorView(style: .medium)
|
||||
var giftModel:PlanetStarModel?
|
||||
private lazy var backgroundView:UIImageView = {
|
||||
|
Reference in New Issue
Block a user