123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- //
- // YOUPAILZApplyRefundWindow.m
- // VQU
- //
- // Created by CY on 2021/4/29.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAILZApplyRefundWindow.h"
- @interface YOUPAILZApplyRefundWindow ()
- @property (nonatomic,weak) ZCLiveTextView *youpaiptextView;
- @property (nonatomic,assign) CGFloat youpaipbgV_y;
- @property (nonatomic,weak) UIView *youpaipbgV;
- @end
- @implementation YOUPAILZApplyRefundWindow
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.baseView.hidden = YES;
-
- [self youpaifinitUI];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youpaifkeyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youpaifkeyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
- }
- - (void)youpaifinitUI{
-
- UIView *bgV = [[UIView alloc] init];
- bgV.backgroundColor = [UIColor whiteColor];
- bgV.layer.cornerRadius = 16.0f;
- bgV.clipsToBounds = YES;
- [self.view addSubview:bgV];
- self.youpaipbgV = bgV;
- [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(32.0f);
- make.right.offset(-32.0f);
- make.centerY.equalTo(self.view);
- }];
-
- UILabel *titleL = [[UILabel alloc] init];
- titleL.font = LCBoldFont(19.0f);
- titleL.textColor = HexColorFromRGB(0x333333);
- titleL.textAlignment = NSTextAlignmentCenter;
- titleL.text = @"请输入退款原因";
- [bgV addSubview:titleL];
- [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.offset(30.0f);
- make.left.offset(14.0f);
- make.right.offset(-14.0f);
- }];
-
- ZCLiveTextView* textView = [[ZCLiveTextView alloc]initWithFrame:CGRectMake(20.0f, 72.0f, KScreenWidth-104.0f, 96.0f) TopMargin:5 LeftMargin:14];
- textView.backgroundColor = [HexColorFromRGB(0xEEEEEE) colorWithAlphaComponent:0.43f];
- textView.textLength = 100;
- textView.placeholder = @"请输入退款原因…";
- textView.placeholderColor = HexColorFromRGB(0x999999);
- textView.timeoutAlertColor = LCRedColor;
- textView.layer.cornerRadius = 8.0;
- self.youpaiptextView = textView;
- [bgV addSubview:textView];
- [textView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(20.0f);
- make.right.offset(-20.0f);
- make.top.offset(72.0f);
- make.height.offset(96.0f);
- }];
- UIButton *confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- confirmBtn.layer.cornerRadius = 24.0f;
- confirmBtn.clipsToBounds = YES;
- [confirmBtn setBackgroundColor:ZYPinkColor];
- [confirmBtn setTitle:@"提交" forState:UIControlStateNormal];
- [confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- confirmBtn.titleLabel.font = LCFont(20.0f);
- [confirmBtn addTarget:self action:@selector(youpaifconfirmBtnClick) forControlEvents:UIControlEventTouchUpInside];
- [bgV addSubview:confirmBtn];
- [confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.offset(40.0f);
- make.right.offset(-40.0f);
- make.top.equalTo(textView.mas_bottom).offset(35.0f);
- make.bottom.offset(-35.0f);
- make.height.offset(48.0f);
- }];
- [self.view layoutIfNeeded];
- self.youpaipbgV_y = self.youpaipbgV.mj_y;
- }
- - (void)youpaifconfirmBtnClick{
- if (self.confirmClickBlock) {
- self.confirmClickBlock(self.youpaiptextView.textView.text);
- }
- [self dismissViewControllerAnimated:YES completion:nil];
- }
- //键盘即将隐藏
- - (void)youpaifkeyboardWillHide:(NSNotification *)note{
- [self.view layoutIfNeeded];
- [UIView animateWithDuration:0.25 animations:^{
- self.youpaipbgV.mj_y = self.youpaipbgV_y + 100.0f;
- }];
-
- }
- //键盘即将弹出
- - (void)youpaifkeyboardWillShow:(NSNotification *)note{
- [self.view layoutIfNeeded];
- [UIView animateWithDuration:0.25 animations:^{
- self.youpaipbgV.mj_y = self.youpaipbgV_y - 100.0f;
- }];
-
- }
- @end
|