新功能:反馈页
This commit is contained in:
eggmanQQQ
2024-07-03 21:22:40 +08:00
parent 1b9c86d66f
commit 0544a6b8d0
19 changed files with 1232 additions and 5 deletions

View File

@@ -527,6 +527,9 @@
545831A62C2C085C00364026 /* ArabMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 545831A52C2C085C00364026 /* ArabMicroView.m */; };
545888332C1AFFB500897585 /* XPRoomPKPanelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 545888322C1AFFB500897585 /* XPRoomPKPanelView.m */; };
545888362C1C306B00897585 /* XPRoomPKPaneAvatarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 545888352C1C306B00897585 /* XPRoomPKPaneAvatarView.m */; };
5458EC1F2C341C3F009D9757 /* FeedBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5458EC1D2C341C3F009D9757 /* FeedBackViewController.m */; };
5458EC202C341C3F009D9757 /* FeedBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5458EC1E2C341C3F009D9757 /* FeedBackViewController.xib */; };
5458EC232C352D9C009D9757 /* FeedBackConfigModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 5458EC222C352D9C009D9757 /* FeedBackConfigModel.m */; };
547853A12C258F2A00F45E60 /* XPMineUserViewHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */; };
54C3895C2C215F5100FD47B1 /* XPHomeMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895B2C215F5100FD47B1 /* XPHomeMineViewController.m */; };
54C3895F2C2189DD00FD47B1 /* XPHomeMinePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895E2C2189DD00FD47B1 /* XPHomeMinePresenter.m */; };
@@ -2588,6 +2591,11 @@
545888322C1AFFB500897585 /* XPRoomPKPanelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPKPanelView.m; sourceTree = "<group>"; };
545888342C1C306B00897585 /* XPRoomPKPaneAvatarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPKPaneAvatarView.h; sourceTree = "<group>"; };
545888352C1C306B00897585 /* XPRoomPKPaneAvatarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPKPaneAvatarView.m; sourceTree = "<group>"; };
5458EC1C2C341C3F009D9757 /* FeedBackViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedBackViewController.h; sourceTree = "<group>"; };
5458EC1D2C341C3F009D9757 /* FeedBackViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedBackViewController.m; sourceTree = "<group>"; };
5458EC1E2C341C3F009D9757 /* FeedBackViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FeedBackViewController.xib; sourceTree = "<group>"; };
5458EC212C352D9C009D9757 /* FeedBackConfigModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FeedBackConfigModel.h; sourceTree = "<group>"; };
5458EC222C352D9C009D9757 /* FeedBackConfigModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FeedBackConfigModel.m; sourceTree = "<group>"; };
5478539F2C258F2A00F45E60 /* XPMineUserViewHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserViewHeader.h; sourceTree = "<group>"; };
547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserViewHeader.m; sourceTree = "<group>"; };
54C3895A2C215F5100FD47B1 /* XPHomeMineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMineViewController.h; sourceTree = "<group>"; };
@@ -5061,6 +5069,9 @@
E824543426F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m */,
23B2AEC32A6516C200543D17 /* LoginForgetPasswordViewController.h */,
23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */,
5458EC1C2C341C3F009D9757 /* FeedBackViewController.h */,
5458EC1D2C341C3F009D9757 /* FeedBackViewController.m */,
5458EC1E2C341C3F009D9757 /* FeedBackViewController.xib */,
);
path = View;
sourceTree = "<group>";
@@ -10401,6 +10412,8 @@
E81C27AA26EF2D920031E639 /* ThirdUserInfo.m */,
E818DD1D2A48974300F163F7 /* LoginAreaModel.h */,
E818DD1E2A48974300F163F7 /* LoginAreaModel.m */,
5458EC212C352D9C009D9757 /* FeedBackConfigModel.h */,
5458EC222C352D9C009D9757 /* FeedBackConfigModel.m */,
);
path = Model;
sourceTree = "<group>";
@@ -11148,6 +11161,7 @@
E80EC83228ACD84000D133C5 /* emoji_00@2x.png in Resources */,
E80EC89C28ACD84000D133C5 /* emoji_50@2x.png in Resources */,
E80EC87A28ACD84000D133C5 /* emoji_113@2x.png in Resources */,
5458EC202C341C3F009D9757 /* FeedBackViewController.xib in Resources */,
23FF25622ABAE6310064E904 /* pi_room_game_fine_love.svga in Resources */,
23FF42672AA5CFBB0055733C /* home_sound_wave.gif in Resources */,
E80EC88A28ACD84000D133C5 /* emoji_25@2x.png in Resources */,
@@ -12444,6 +12458,7 @@
E852D74428633A08001465ED /* MonentsCommentModel.m in Sources */,
238B37C42AC55A2C00BFC9D5 /* XPTreasureFairyBallContentView.m in Sources */,
E8C1CD6D27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m in Sources */,
5458EC1F2C341C3F009D9757 /* FeedBackViewController.m in Sources */,
E8C1CD7627D8AE3D00376F83 /* XPRoomFacePresenter.m in Sources */,
E85E7B362A4EB0D300B6D00A /* XPClanRoomCollectionViewCell.m in Sources */,
18F4043A275E20D900A6C548 /* TRTCRtcImpl.m in Sources */,
@@ -12573,6 +12588,7 @@
23E9EB152A84D02400B792F2 /* XPMineUserInfoEditPickView.m in Sources */,
9BA812D628BF52E100783EA7 /* XPRoomSendRedPacketViewController.m in Sources */,
E86E79D328A4E94E006DAF48 /* SessionRiskView.m in Sources */,
5458EC232C352D9C009D9757 /* FeedBackConfigModel.m in Sources */,
E85E7B1F2A4EB0D300B6D00A /* XPMineGuildIncomeStatisViewController.m in Sources */,
E85E7B412A4EB0D300B6D00A /* XPMineGuildEmptyTableViewCell.m in Sources */,
E8133916273E532D00708B66 /* XPGiftItemCollectionViewCell.m in Sources */,

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_custom_servise@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "login_feedback_add_photo@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

View File

@@ -79,6 +79,16 @@ NS_ASSUME_NONNULL_BEGIN
/// @param complection 完成
+(void)bindAuthorizationCode:(HttpRequestHelperCompletion)complection authCode:(NSString *)authCode;
///反馈
+ (void)loadFeedbackConfig:(HttpRequestHelperCompletion)completion;
+ (void)commitFeedback:(HttpRequestHelperCompletion)completion
type:(NSString *)type
desc:(NSString *)desc
screenUrl:(NSString *)screenUrl
contact:(NSString *)contact;
@end
NS_ASSUME_NONNULL_END

View File

@@ -84,4 +84,20 @@
+(void)bindAuthorizationCode:(HttpRequestHelperCompletion)complection authCode:(NSString *)authCode{
[self makeRequest:@"phone/auth/bound" method:HttpRequestHelperMethodPOST completion:complection, __FUNCTION__,authCode, nil];
}
///
+ (void)loadFeedbackConfig:(HttpRequestHelperCompletion)completion {
[self makeRequest:@"feedback/getConfig" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
+ (void)commitFeedback:(HttpRequestHelperCompletion)completion
type:(NSString *)type
desc:(NSString *)desc
screenUrl:(NSString *)screenUrl
contact:(NSString *)contact {
[self makeRequest:@"feedback/commit"
method:HttpRequestHelperMethodPOST
completion:completion, __FUNCTION__, type, desc, screenUrl, contact, nil];
}
@end

View File

@@ -0,0 +1,23 @@
//
// FeedBackConfigModel.h
// YuMi
//
// Created by P on 2024/7/3.
//
#import "PIBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface FeedBackTypeModel : PIBaseModel
@property (nonatomic, copy) NSString *desc;
@property (nonatomic, copy) NSString *type;
@end
@interface FeedBackConfigModel : PIBaseModel
@property (nonatomic, copy) NSDictionary *customContactMap;
@property (nonatomic, copy) NSArray <FeedBackTypeModel *>*typeEnumList;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,20 @@
//
// FeedBackConfigModel.m
// YuMi
//
// Created by P on 2024/7/3.
//
#import "FeedBackConfigModel.h"
@implementation FeedBackTypeModel
@end
@implementation FeedBackConfigModel
+ (NSDictionary *)objectClassInArray{
return @{
@"typeEnumList":FeedBackTypeModel.class
};
}
@end

View File

@@ -10,6 +10,9 @@
#import <GoogleSignIn/GoogleSignIn.h>
#import <GoogleSignIn/GIDGoogleUser.h>
#import <GoogleSignIn/GoogleSignIn-umbrella.h>
@class FeedBackConfigModel;
NS_ASSUME_NONNULL_BEGIN
@interface LoginPresenter : BaseMvpPresenter
@@ -42,6 +45,16 @@ NS_ASSUME_NONNULL_BEGIN
/// @param password 验证码
- (void)loginWithPhone:(NSString *)phone password:(NSString *)password;
///反馈
- (void)loadFeedbackConfig:(void(^)(FeedBackConfigModel *model))success
failure:(void(^)(NSString *errorMessage))failure;
- (void)submitFeedback:(void(^)(void))success
failure:(void(^)(NSString *errorMessage))failure
type:(NSString *)type
desc:(NSString *)desc
photoURLString:(nullable NSString *)photoURLString
contact:(nullable NSString *)contact;
@end
NS_ASSUME_NONNULL_END

View File

@@ -24,6 +24,7 @@
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import "YuMi-swift.h"
#import "FeedBackConfigModel.h"
@implementation LoginPresenter
- (void)dealloc{
@@ -33,13 +34,12 @@
self = [super init];
if(self){
@weakify(self);
// @weakify(self);
[[NSNotificationCenter defaultCenter] addObserverForName:FBSDKProfileDidChangeNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:
^(NSNotification *notification) {
if ([FBSDKProfile currentProfile]) {
//
[FBSDKProfile loadCurrentProfileWithCompletion:
@@ -47,7 +47,6 @@
if (profile) {
[AccountInfoStorage instance].thirdUserInfo.userName = profile.name;
[AccountInfoStorage instance].thirdUserInfo.avatarUrl = profile.imageURL.absoluteString;
}
}];
}
@@ -302,4 +301,44 @@
} errorToast:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
}
///
- (void)loadFeedbackConfig:(void(^)(FeedBackConfigModel *model))success
failure:(void(^)(NSString *errorMessage))failure {
[Api loadFeedbackConfig:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
FeedBackConfigModel *model =[FeedBackConfigModel modelWithDictionary:data.data];
if (success) {
success(model);
}
} else {
if (failure) {
failure(msg);
}
}
}];
}
- (void)submitFeedback:(void(^)(void))success
failure:(void(^)(NSString *errorMessage))failure
type:(NSString *)type
desc:(NSString *)desc
photoURLString:(nullable NSString *)photoURLString
contact:(nullable NSString *)contact {
[Api commitFeedback:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
if (success) {
success();
}
} else {
if (failure) {
failure(msg);
}
}
}
type:type
desc:desc
screenUrl:photoURLString ? photoURLString : @""
contact:contact ? contact : @""];
}
@end

View File

@@ -0,0 +1,40 @@
//
// FeedBackViewController.h
// YuMi
//
// Created by P on 2024/7/2.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface FeedBackViewController : MvpViewController
@property (nonatomic, strong) IBOutlet UIScrollView *scrollView;
@property (nonatomic, strong) IBOutlet UIView *scrollContentView;
@property (nonatomic, weak) IBOutlet UIButton *closeKeyboardButton;
@property (nonatomic, weak) IBOutlet UILabel *title_1;
@property (nonatomic, weak) IBOutlet UILabel *title_2;
@property (nonatomic, weak) IBOutlet UILabel *title_3;
@property (nonatomic, weak) IBOutlet UILabel *title_4;
@property (nonatomic, weak) IBOutlet UICollectionView *typeCollectionView;
@property (nonatomic, weak) IBOutlet UITextView *feedbackTextView;
@property (nonatomic, weak) IBOutlet UILabel *feedbackPlaceholderLabel;
@property (nonatomic, weak) IBOutlet UILabel *feedbackCharCountLabel;
@property (nonatomic, weak) IBOutlet UILabel *feedbackCharLimitLabel;
@property (nonatomic, weak) IBOutlet UIButton *uploadImageButton;
@property (weak, nonatomic) IBOutlet UIImageView *uploadImageView;
@property (nonatomic, weak) IBOutlet UITextField *contactTextField;
@property (nonatomic, weak) IBOutlet UIButton *submitButton;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,776 @@
//
// FeedBackViewController.m
// YuMi
//
// Created by P on 2024/7/2.
//
#import "FeedBackViewController.h"
#import "LoginPresenter.h"
#import "UploadFile.h"
#import "FeedBackConfigModel.h"
@interface FeedBackContactPopUpCell : UICollectionViewCell
@property (nonatomic, strong) UILabel *content;
@property (nonatomic, strong) UIImageView *icon;
//@
@end
@implementation FeedBackContactPopUpCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
_content = [UILabel labelInitWithText:@""
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
textColor:UIColorFromRGB(0x333333)];
_icon = [[UIImageView alloc] initWithImage:kImage(@"user_card_copy_id1")];
[self.contentView addSubview:_content];
[self.contentView addSubview:_icon];
[_content mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(0);
}];
[_icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(12);
make.centerY.mas_equalTo(self.content);
make.left.mas_equalTo(self.content.mas_right).offset(2);
}];
}
return self;
}
@end
@interface FeedBackContactPopUp : UIView<UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@property (nonatomic, copy) NSArray *contactArray;
@property (nonatomic, strong) UICollectionView *collectionView;
@end
@implementation FeedBackContactPopUp
+ (CGFloat)popUpHeight:(NSDictionary *)dataSource {
return 32 + 75 + 14 * dataSource.count + 18 * dataSource.count;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self setup];
}
return self;
}
- (void)setup {
self.backgroundColor = [UIColor whiteColor];
self.layer.cornerRadius = 15.5;
self.clipsToBounds = YES;
self.layer.masksToBounds = YES;
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
b.layer.cornerRadius = 19;
b.layer.masksToBounds = YES;
[b setTitle:YMLocalizedString(@"XPRoomViewController16") forState:UIControlStateNormal];
[b setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x57e193),UIColorFromRGB(0x14d2a6)]
gradientType:GradientTypeLeftToRight
imgSize:CGSizeMake(120, 38)]
forState:UIControlStateNormal];
[b addTarget:self action:@selector(didTapButton) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:b];
[b mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.bottom.mas_equalTo(self).offset(-16);
make.height.mas_equalTo(38);
}];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.backgroundColor = [UIColor clearColor];
_collectionView.scrollEnabled = NO;
_collectionView.delegate = self;
_collectionView.dataSource = self;
[_collectionView registerClass:[FeedBackContactPopUpCell class] forCellWithReuseIdentifier:@"cell"];
[self addSubview:_collectionView];
[_collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self).insets(UIEdgeInsetsMake(32, 0, 75, 0));
}];
}
- (void)setContactDic:(NSDictionary *)contactDic {
NSMutableArray *tempArr = @[].mutableCopy;
[contactDic enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
[tempArr addObject:@[key, obj]];
}];
_contactArray = tempArr;
[self.collectionView reloadData];
}
- (void)didTapButton {
[TTPopup dismiss];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.contactArray.count;
}
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout *)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
CGFloat padding = 24.0;
CGFloat totalPadding = padding * 2; // +
CGFloat availableWidth = collectionView.frame.size.width - totalPadding;
NSArray *subArray = [self.contactArray xpSafeObjectAtIndex:indexPath.row];
return CGSizeMake(availableWidth, subArray.count > 1 ? 14 : 0);
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
return 18.0;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
return 18.0;
}
// cell
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
FeedBackContactPopUpCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
NSArray *subArray = [self.contactArray xpSafeObjectAtIndex:indexPath.row];
if (subArray.count > 1) {
cell.content.text = [NSString stringWithFormat:@"%@: %@", [subArray firstObject], [subArray lastObject]];
}
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
NSArray *subArray = [self.contactArray xpSafeObjectAtIndex:indexPath.row];
if (subArray.count > 1) {
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
[pasteboard setString:[subArray lastObject]];
[XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"XPShareView0")];
}
}
@end
@interface TypeCollectionCell : UICollectionViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation TypeCollectionCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.contentView.userInteractionEnabled = YES;
_titleLabel = [UILabel labelInitWithText:@""
font:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0x22252c)];
_titleLabel.layer.cornerRadius = 15.5;
_titleLabel.layer.masksToBounds = YES;
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.backgroundColor = UIColorFromRGB(0xf3f5fa);
_titleLabel.userInteractionEnabled = NO;
_titleLabel.minimumScaleFactor = 0.7;
_titleLabel.numberOfLines = 2;
[self.contentView addSubview:_titleLabel];
[_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
}
return self;
}
- (void)setSelected:(BOOL)selected {
if (selected) {
self.titleLabel.backgroundColor = UIColorFromRGB(0x85f6d3);
} else {
self.titleLabel.backgroundColor = UIColorFromRGB(0xf3f5fa);
}
}
@end
@interface FeedBackViewController ()<UITextViewDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@property (nonatomic, strong) UIView *fakeTopBar;
@property (nonatomic, copy) NSString *uploadPhotoURLString;
@property (nonatomic, strong) UIImage *selectedImage;
@property (nonatomic, strong) FeedBackConfigModel *configModel;
@property (nonatomic, strong) FeedBackTypeModel *selectTypeModel;
@end
@implementation FeedBackViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setup];
[self customLayout];
[self loadFeedbackConfig];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self addNavigationItemWithImageNames:@[@"login_custom_servise"]
isLeft:NO
target:self
action:@selector(rightButtonTapped) tags:nil];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}
- (LoginPresenter *)createPresenter {
return [[LoginPresenter alloc] init];
}
- (BOOL)isHiddenNavBar {
return YES;
}
- (void)setup {
self.title = YMLocalizedString(@"XPMineFeedbackViewController0");
self.view.backgroundColor = [UIColor whiteColor];
[self setupFakeTopBar];
[self.closeKeyboardButton setTitle:@"" forState:UIControlStateNormal];
self.typeCollectionView.delegate = self;
self.typeCollectionView.dataSource = self;
self.typeCollectionView.allowsSelection = YES;
[self.typeCollectionView registerClass:[TypeCollectionCell class] forCellWithReuseIdentifier:@"cell"];
self.feedbackTextView.delegate = self;
self.feedbackTextView.textContainerInset = UIEdgeInsetsMake(8, 8, 20, 8);
self.title_1.textColor = [UIColor blackColor];
self.title_2.textColor = [UIColor blackColor];
self.title_3.textColor = [UIColor blackColor];
self.title_4.textColor = [UIColor blackColor];
self.title_2.text = YMLocalizedString(@"FeedBackViewController2");
NSAttributedString *redMark = [[NSAttributedString alloc] initWithString:@"* "
attributes:@{NSForegroundColorAttributeName: UIColorFromRGB(0xeb5c2c),
NSFontAttributeName: [UIFont systemFontOfSize:16 weight:UIFontWeightBold]}];
NSDictionary *defaultAttributes = @{NSForegroundColorAttributeName: UIColorFromRGB(0x000000),
NSFontAttributeName: [UIFont systemFontOfSize:16 weight:UIFontWeightBold]};
NSMutableAttributedString *attributedTitle_1 = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"FeedBackViewController0") attributes:defaultAttributes];
[attributedTitle_1 insertAttributedString:redMark atIndex:0];
NSMutableAttributedString *attributedTitle_2 = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"FeedBackViewController1") attributes:defaultAttributes];
[attributedTitle_2 insertAttributedString:redMark atIndex:0];
NSMutableAttributedString *attributedTitle_4 = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"FeedBackViewController3") attributes:defaultAttributes];
[attributedTitle_4 insertAttributedString:redMark atIndex:0];
self.title_1.attributedText = attributedTitle_1;
self.title_2.attributedText = attributedTitle_2;
self.title_4.attributedText = attributedTitle_4;
self.feedbackPlaceholderLabel.text = YMLocalizedString(@"FeedBackViewController4");
self.feedbackCharCountLabel.text = @"0";
if (isMSRTL()) {
self.feedbackCharCountLabel.textAlignment = NSTextAlignmentRight;
self.feedbackCharLimitLabel.textAlignment = NSTextAlignmentRight;
self.feedbackCharLimitLabel.text = @"300/";
} else {
self.feedbackCharCountLabel.textAlignment = NSTextAlignmentLeft;
self.feedbackCharLimitLabel.textAlignment = NSTextAlignmentLeft ;
self.feedbackCharLimitLabel.text = @"/300";
}
[self.uploadImageButton setTitle:@"" forState:UIControlStateNormal];
UIColor *placeholderColor = UIColorFromRGB(0xacb0b7);
self.contactTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"FeedBackViewController5")
attributes:@{NSForegroundColorAttributeName: placeholderColor}];
[self.submitButton setTitle:YMLocalizedString(@"LoginForgetPasswordViewController6") forState:UIControlStateNormal];
[self.submitButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xa5eec8),UIColorFromRGB(0xabf5e3)]
gradientType:GradientTypeTopToBottom
imgSize:CGSizeMake(300, 50)]
forState:UIControlStateNormal];
[self.submitButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorRGBAlpha(0x57e193, 0.5),UIColorRGBAlpha(0x1402a6, 0.5)]
gradientType:GradientTypeTopToBottom
imgSize:CGSizeMake(300, 50)]
forState:UIControlStateSelected];
}
- (void)setupFakeTopBar {
UIView *fakeTopBar = [[UIView alloc] init];
fakeTopBar.backgroundColor = UIColorFromRGB(0xebecf3);
[self.view addSubview:fakeTopBar];
_fakeTopBar = fakeTopBar;
CGFloat navigationBarHeight = self.navigationController.navigationBar.frame.size.height + [UIApplication sharedApplication].keyWindow.safeAreaInsets.top;
[fakeTopBar mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view.mas_top);
make.left.equalTo(self.view.mas_left);
make.right.equalTo(self.view.mas_right);
make.height.mas_equalTo(navigationBarHeight);
}];
UILabel *title = [UILabel labelInitWithText:YMLocalizedString(@"XPMineFeedbackViewController0")
font:[UIFont systemFontOfSize:17 weight:UIFontWeightMedium]
textColor:UIColorFromRGB(0x010101)];
[fakeTopBar addSubview:title];
[title mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-16);
make.centerX.mas_equalTo(0);
}];
UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom];
[back enlargeTouchArea:UIEdgeInsetsMake(10, 10, 10, 10)];
[back.imageView setContentMode:UIViewContentModeScaleAspectFill];
[back setImage:kImage(@"room_info_back") forState:UIControlStateNormal];
[back addTarget:self
action:@selector(didTapBackButton)
forControlEvents:UIControlEventTouchUpInside];
if (isMSRTL()) {
back.imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0);
}
[fakeTopBar addSubview:back];
[back mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(title);
make.width.height.mas_equalTo(15);
if (isMSRTL()) {
make.right.mas_equalTo(-16);
} else {
make.left.mas_equalTo(16);
}
}];
UIButton *cs = [UIButton buttonWithType:UIButtonTypeCustom];
[cs enlargeTouchArea:UIEdgeInsetsMake(10, 10, 10, 10)];
[cs setImage:kImage(@"login_custom_servise") forState:UIControlStateNormal];
[cs addTarget:self
action:@selector(rightButtonTapped)
forControlEvents:UIControlEventTouchUpInside];
[fakeTopBar addSubview:cs];
[cs mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(title);
make.width.height.mas_equalTo(18);
if (isMSRTL()) {
make.left.mas_equalTo(fakeTopBar).offset(16);
} else {
make.right.mas_equalTo(fakeTopBar).offset(-16);
}
}];
}
- (void)customLayout {
[self.submitButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.view).offset(-40);
make.left.mas_equalTo(36);
make.right.mas_equalTo(-36);
make.height.mas_equalTo(49);
}];
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.fakeTopBar.mas_bottom).offset(0);
make.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.submitButton.mas_top).offset(-8);
}];
[self.scrollContentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.scrollView);
}];
[self.title_1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.scrollContentView).offset(30);
if (isMSRTL()) {
make.right.mas_equalTo(self.scrollContentView).offset(-16);
} else {
make.left.mas_equalTo(self.scrollContentView).offset(16);
}
}];
[self.typeCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.title_1.mas_bottom).offset(18);
make.left.mas_equalTo(self.scrollContentView).offset(16);
make.right.mas_equalTo(self.scrollContentView).offset(-16);
make.height.mas_equalTo(31);
make.width.mas_equalTo(KScreenWidth - 32);
}];
[self.closeKeyboardButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.typeCollectionView.mas_bottom);
make.bottom.left.right.mas_equalTo(self.scrollContentView);
}];
[self.title_2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.typeCollectionView.mas_bottom).offset(31);
if (isMSRTL()) {
make.right.mas_equalTo(self.scrollContentView).offset(-16);
} else {
make.left.mas_equalTo(self.scrollContentView).offset(16);
}
}];
[self.feedbackTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.title_2.mas_bottom).offset(18);
make.left.mas_equalTo(self.scrollContentView).offset(16);
make.right.mas_equalTo(self.scrollContentView).offset(-16);
make.height.mas_equalTo(150);
}];
[self.feedbackPlaceholderLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.feedbackTextView).offset(8);
if (isMSRTL()) {
make.right.mas_equalTo(self.feedbackTextView).offset(-8);
} else {
make.left.mas_equalTo(self.feedbackTextView).offset(8);
}
}];
[self.feedbackCharLimitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.feedbackTextView).offset(-8);
make.width.mas_equalTo(40);
if (isMSRTL()) {
make.left.mas_equalTo(self.feedbackTextView).offset(8);
} else {
make.right.mas_equalTo(self.feedbackTextView).offset(-8);
}
}];
[self.feedbackCharCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.feedbackTextView).offset(-8);
if (isMSRTL()) {
make.left.mas_equalTo(self.feedbackCharLimitLabel.mas_right).offset(0);
} else {
make.right.mas_equalTo(self.feedbackCharLimitLabel.mas_left).offset(0);
}
}];
[self.title_3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.feedbackTextView.mas_bottom).offset(31);
if (isMSRTL()) {
make.right.mas_equalTo(self.scrollContentView).offset(-16);
} else {
make.left.mas_equalTo(self.scrollContentView).offset(16);
}
}];
[self.uploadImageButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.title_3.mas_bottom).offset(18);
make.width.height.mas_equalTo(76);
if (isMSRTL()) {
make.right.mas_equalTo(self.scrollContentView).offset(-16);
} else {
make.left.mas_equalTo(self.scrollContentView).offset(16);
}
}];
[self.uploadImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.uploadImageButton);
}];
[self.title_4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.uploadImageButton.mas_bottom).offset(31);
if (isMSRTL()) {
make.right.mas_equalTo(self.scrollContentView).offset(-16);
} else {
make.left.mas_equalTo(self.scrollContentView).offset(16);
}
}];
[self.contactTextField mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.scrollContentView).offset(16);
make.right.mas_equalTo(self.scrollContentView).offset(-16);
make.top.mas_equalTo(self.title_4.mas_bottom).offset(17.5);
make.bottom.mas_equalTo(self.scrollContentView).offset (-30);
make.height.mas_equalTo(43.5);
}];
}
- (void)updateSubmitButtonStatus {
if (self.selectTypeModel == nil) {
[self.submitButton setSelected:NO];
} else if(self.feedbackTextView.text.length == 0) {
[self.submitButton setSelected:NO];
} else if(self.contactTextField.text.length == 0) {
[self.submitButton setSelected:NO];
} else {
[self.submitButton setSelected:YES];
}
}
- (void)showPhotoSelectionSheet {
@kWeakify(self);
TTActionSheetConfig *cameraConfig = [TTActionSheetConfig normalTitle:YMLocalizedString(@"XPMineUserInfoEditViewController1") clickAction:^{
[YYUtility checkCameraAvailable:^{
@kStrongify(self);
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.allowsEditing = NO;
[self presentViewController:imagePicker animated:YES completion:NULL];
} denied:^{
@kStrongify(self);
[self showNotPhoto:YMLocalizedString(@"XPMineUserInfoEditViewController2") content:YMLocalizedString(@"XPMineUserInfoEditViewController3")];
} restriction:^{
@kStrongify(self);
[self showNotPhoto:YMLocalizedString(@"XPMineUserInfoEditViewController4") content:YMLocalizedString(@"XPMineUserInfoEditViewController5")];
}];
}];
TTActionSheetConfig *photoLibrayConfig = [TTActionSheetConfig normalTitle:YMLocalizedString(@"XPMineUserInfoEditViewController6") clickAction:^{
[YYUtility checkAssetsLibrayAvailable:^{
@kStrongify(self);
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.modalPresentationCapturesStatusBarAppearance = YES;
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.allowsEditing = NO;
[self presentViewController:imagePicker animated:YES completion:NULL];
} denied:^{
@kStrongify(self);
[self showNotPhoto:YMLocalizedString(@"XPMineUserInfoEditViewController7") content:YMLocalizedString(@"XPMineUserInfoEditViewController8")];
} restriction:^{
@kStrongify(self);
[self showNotPhoto:YMLocalizedString(@"XPMineUserInfoEditViewController9") content:YMLocalizedString(@"XPMineUserInfoEditViewController10")];
}];
}];
[TTPopup actionSheetWithItems:@[cameraConfig, photoLibrayConfig]];
}
- (void)showNotPhoto:(NSString *)title content:(NSString *)content {
TTAlertConfig *config = [[TTAlertConfig alloc] init];
config.title = title;
config.message = content;
[TTPopup alertWithConfig:config confirmHandler:^{
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
}];
}
} cancelHandler:^{
}];
}
#pragma mark - UX Actions
- (void)didTapBackButton {
[self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)didTapUploadImageButton:(id)sender {
[self showPhotoSelectionSheet];
}
- (IBAction)didTapSubmitButton:(id)sender {
if (self.submitButton.isSelected) {
[self uploadAvatar];
}
}
- (IBAction)didTapCloseKeyboardButton:(id)sender {
[self.view endEditing:YES];
}
- (void)rightButtonTapped {
FeedBackContactPopUp *popUp = [[FeedBackContactPopUp alloc] initWithFrame:CGRectMake(0,
0,
290,
[FeedBackContactPopUp popUpHeight:self.configModel.customContactMap])];
[popUp setContactDic:self.configModel.customContactMap];
[TTPopup popupView:popUp style:TTPopupStyleAlert];
}
#pragma mark - API
- (void)loadFeedbackConfig {
[self showLoading];
@kWeakify(self);
[self.presenter loadFeedbackConfig:^(FeedBackConfigModel * _Nonnull model) {
@kStrongify(self);
[self hideHUD];
self.configModel = model;
[self.typeCollectionView reloadData];
[self updateCollectionViewHeight];
} failure:^(NSString * _Nonnull errorMessage) {
@kStrongify(self);
[self hideHUD];
[TTPopup alertWithMessage:errorMessage confirmHandler:^{
} cancelHandler:^{
}];
}];
}
- (void)uploadAvatar {
[self showLoading];
if (self.selectedImage) {
@kWeakify(self);
NSData *data = UIImageJPEGRepresentation(self.selectedImage, 0.5);
NSString *format = [UIImage getImageTypeWithImageData:data];
NSString *name = [NSString stringWithFormat:@"image/%@.%@",[NSString createUUID],format];
[[UploadFile share]QCloudUploadImage:data named:name success:^(NSString * _Nonnull key, NSDictionary * _Nonnull resp) {
@kStrongify(self);
self.uploadPhotoURLString = key;
[self submitFeedBack];
} failure:^(NSNumber * _Nonnull resCode, NSString * _Nonnull message) {
@kStrongify(self);
[self showErrorToast:message];
}];
} else {
[self submitFeedBack];
}
}
- (void)submitFeedBack {
@kWeakify(self);
dispatch_async(dispatch_get_main_queue(), ^{
@kStrongify(self);
@kWeakify(self);
[self.presenter submitFeedback:^{
@kStrongify(self);
[self showSuccessToast:YMLocalizedString(@"XPMineFeedbackViewController1")];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.navigationController popViewControllerAnimated:YES];
});
} failure:^(NSString * _Nonnull errorMessage) {
@kStrongify(self);
[self showErrorToast:errorMessage];
}
type:self.selectTypeModel.type
desc:self.feedbackTextView.text
photoURLString:self.uploadPhotoURLString
contact:self.contactTextField.text];
});
}
#pragma mark - UICollectionView Delegate & DataSource
- (void)updateCollectionViewHeight {
[self.typeCollectionView layoutIfNeeded];
CGSize contentSize = self.typeCollectionView.collectionViewLayout.collectionViewContentSize;
[self.typeCollectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(contentSize.height);
}];
}
// section item
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.configModel.typeEnumList.count; //
}
- (CGSize)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout*)collectionViewLayout
sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
CGFloat padding = 24.0;
CGFloat totalPadding = padding * 2 + padding * 2; // +
CGFloat availableWidth = collectionView.frame.size.width - totalPadding;
CGFloat itemWidth = availableWidth / 3;
return CGSizeMake(itemWidth, 31);
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
return 14.0;
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
return 24.0;
}
// cell
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
TypeCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
cell.contentView.layer.cornerRadius = 15.5;
cell.contentView.layer.masksToBounds = YES;
FeedBackTypeModel *model = [self.configModel.typeEnumList xpSafeObjectAtIndex:indexPath.row];
if (model) {
cell.titleLabel.text = model.desc;
}
return cell;
}
// cell
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
TypeCollectionCell *cell = (TypeCollectionCell *)[collectionView cellForItemAtIndexPath:indexPath];
[cell setSelected:YES];
// cell
for (NSIndexPath *visibleIndexPath in [collectionView indexPathsForVisibleItems]) {
if (![visibleIndexPath isEqual:indexPath]) {
[collectionView deselectItemAtIndexPath:visibleIndexPath animated:NO];
TypeCollectionCell *otherCell = (TypeCollectionCell *)[collectionView cellForItemAtIndexPath:visibleIndexPath];
[otherCell setSelected:NO];
}
}
FeedBackTypeModel *model = [self.configModel.typeEnumList xpSafeObjectAtIndex:indexPath.row];
if (model) {
self.selectTypeModel = model;
[self updateSubmitButtonStatus];
}
}
// cell
- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath {
TypeCollectionCell *cell = (TypeCollectionCell *)[collectionView cellForItemAtIndexPath:indexPath];
[cell setSelected:NO];
}
#pragma mark - UIImagePickerControllerDelegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *selectedPhoto = [info objectForKey:UIImagePickerControllerOriginalImage];
if (selectedPhoto) {
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
UIImageWriteToSavedPhotosAlbum(selectedPhoto, nil, nil, nil);
}
self.selectedImage = selectedPhoto;
self.uploadImageView.hidden = NO;
self.uploadImageView.image = selectedPhoto;
// [self.uploadImageButton setBackgroundImage:selectedPhoto forState:UIControlStateNormal];
// [self.uploadImageButton setImage:selectedPhoto forState:UIControlStateNormal];
}
[picker dismissViewControllerAnimated:YES
completion:^{}];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
[picker dismissViewControllerAnimated:YES
completion:^{}];
}
#pragma mark - UITextViewDelegate
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
NSString *newText = [textView.text stringByReplacingCharactersInRange:range withString:text];
self.feedbackCharCountLabel.text = [NSString stringWithFormat:@"%ld", (unsigned long)newText.length];
self.feedbackPlaceholderLabel.hidden = newText.length > 0;
self.feedbackCharCountLabel.textColor = newText.length > 0 ?
UIColorFromRGB(0x3fddac) : UIColorFromRGB(0xa7acb3);
[self updateSubmitButtonStatus];
if (newText.length > 300) {
return NO;
}
return YES;
}
@end

View File

@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FeedBackViewController">
<connections>
<outlet property="closeKeyboardButton" destination="iJX-Jh-gxM" id="dDw-EH-2Hq"/>
<outlet property="contactTextField" destination="CwH-vq-rQN" id="Fdw-OK-Cq6"/>
<outlet property="feedbackCharCountLabel" destination="wIP-nU-aNV" id="v90-TN-xil"/>
<outlet property="feedbackCharLimitLabel" destination="nWM-qE-tbI" id="1IP-2E-kph"/>
<outlet property="feedbackPlaceholderLabel" destination="Z6i-tU-MrX" id="RCE-xw-MjT"/>
<outlet property="feedbackTextView" destination="YGp-Kx-326" id="Xf1-Ua-ntM"/>
<outlet property="scrollContentView" destination="TUB-kp-u7C" id="egi-HU-3QE"/>
<outlet property="scrollView" destination="X79-6C-RwG" id="v1E-AO-hDK"/>
<outlet property="submitButton" destination="Hcn-lY-KSw" id="oDJ-Nx-q2c"/>
<outlet property="title_1" destination="lZI-L0-Qej" id="VVs-Js-70L"/>
<outlet property="title_2" destination="2Xf-Na-4Rp" id="4rH-8E-n8G"/>
<outlet property="title_3" destination="uUv-rc-eS9" id="ec1-Wq-YPq"/>
<outlet property="title_4" destination="coA-sV-qbQ" id="Jrj-zU-XsM"/>
<outlet property="typeCollectionView" destination="dW4-hu-tVt" id="z0i-uB-f1O"/>
<outlet property="uploadImageButton" destination="E5N-xB-GCN" id="du5-p5-kiN"/>
<outlet property="uploadImageView" destination="c7Q-Mf-HYy" id="Wsm-eG-pCC"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="390" height="844"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" id="X79-6C-RwG">
<rect key="frame" x="0.0" y="0.0" width="390" height="844"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" id="TUB-kp-u7C">
<rect key="frame" x="0.0" y="-91" width="390" height="844"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iJX-Jh-gxM">
<rect key="frame" x="183" y="415" width="24" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain"/>
<connections>
<action selector="didTapCloseKeyboardButton:" destination="-1" eventType="touchUpInside" id="bL1-HI-yzv"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="手机号或邮箱" textAlignment="natural" minimumFontSize="17" id="CwH-vq-rQN">
<rect key="frame" x="14" y="405" width="361" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.95294117649999999" green="0.96078431369999995" blue="0.98039215690000003" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.13333333333333333" green="0.14509803921568626" blue="0.17254901960784313" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="问题描述" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2Xf-Na-4Rp">
<rect key="frame" x="14" y="411" width="361" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="YGp-Kx-326">
<rect key="frame" x="14" y="347" width="361" height="150"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.95294117647058818" green="0.96078431372549022" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.13333333333333333" green="0.14509803921568626" blue="0.17254901960784313" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</textView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="上传截图" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uUv-rc-eS9">
<rect key="frame" x="162" y="411" width="65.333333333333314" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="联系方式" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="coA-sV-qbQ">
<rect key="frame" x="162" y="411" width="66" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="E5N-xB-GCN">
<rect key="frame" x="157" y="384" width="76" height="76"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.95294117647058818" green="0.96078431372549022" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" image="login_feedback_add_photo"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="didTapUploadImageButton:" destination="-1" eventType="touchUpInside" id="IbE-Gs-4hv"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" insetsLayoutMarginsFromSafeArea="NO" text="选择问题类型" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="lZI-L0-Qej">
<rect key="frame" x="14" y="411" width="361" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="请输入..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Z6i-tU-MrX">
<rect key="frame" x="167" y="413" width="56" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.67450980392156867" green="0.69019607843137254" blue="0.71764705882352942" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="0/300" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wIP-nU-aNV">
<rect key="frame" x="175" y="413" width="40" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.65490196078431373" green="0.67450980392156867" blue="0.70196078431372544" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="0/300" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nWM-qE-tbI">
<rect key="frame" x="175" y="413" width="40" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.65490196079999996" green="0.67450980390000004" blue="0.70196078429999997" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="c7Q-Mf-HYy">
<rect key="frame" x="157" y="384" width="76" height="76"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" keyboardDismissMode="interactive" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="dW4-hu-tVt">
<rect key="frame" x="14" y="379" width="361" height="85"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="14" minimumInteritemSpacing="24" id="oac-gt-EMe">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<connections>
<outlet property="dataSource" destination="-1" id="oe9-lT-67h"/>
<outlet property="delegate" destination="-1" id="Jtp-9s-WHI"/>
</connections>
</collectionView>
</subviews>
<viewLayoutGuide key="safeArea" id="Ybz-OB-v6o"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="iUq-aP-DL2"/>
<viewLayoutGuide key="contentLayoutGuide" id="4zX-dN-GkU"/>
<viewLayoutGuide key="frameLayoutGuide" id="8LH-Ya-NsS"/>
</scrollView>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Hcn-lY-KSw">
<rect key="frame" x="43" y="397" width="303" height="49"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="didTapSubmitButton:" destination="-1" eventType="touchUpInside" id="tuh-v2-tJm"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<gestureRecognizers/>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<point key="canvasLocation" x="-373.28244274809157" y="-64.08450704225352"/>
</view>
</objects>
<resources>
<image name="login_feedback_add_photo" width="16" height="16"/>
</resources>
</document>

View File

@@ -31,6 +31,7 @@
#import "XPLoginAraeViewController.h"
#import "XPForgetPwdViewController.h"
#import "PISwitchingEnvironmentVC.h"
#import "FeedBackViewController.h"
UIKIT_EXTERN NSString * const kYouMiNumberCountKey;
NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
@@ -491,7 +492,8 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}
- (void)didTapFeedback {
FeedBackViewController *vc = [[FeedBackViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
#pragma mark - LoginProtocol
@@ -905,12 +907,14 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
- (UIButton *)feedBackButton {
if (!_feedBackButton) {
_feedBackButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_feedBackButton setTitle:@"反馈" forState:UIControlStateNormal];
// [_feedBackButton setBackgroundImage:kImage(@"login_custom_servise") forState:UIControlStateNormal];
[_feedBackButton setTitle:YMLocalizedString(@"XPMineFeedbackViewController0") forState:UIControlStateNormal];
[_feedBackButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
_feedBackButton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
[_feedBackButton addTarget:self
action:@selector(didTapFeedback)
forControlEvents:UIControlEventTouchUpInside];
[_feedBackButton enlargeTouchArea:UIEdgeInsetsMake(10, 10, 10, 10)];
}
return _feedBackButton;
}

View File

@@ -3852,3 +3852,12 @@ ineHeadView12" = "الحمل";
"XPRoomTypeSelectionViewController3" = "بعد الإعداد، ستتم إزالة الأعضاء الذين يتجاوزون خارج الترتيب علي المايك ؛ هل تريد تأكيد الإعداد ؟";
"XPRoomTypeSelectionViewController4" = "نوع الغرفة";
"XPRoomTypeSelectionViewController5" = "قيد الاستخدام";
"FeedBackViewController0" = "اختر نوع المشكلة";
"FeedBackViewController1" = "صف المشكلة";
"FeedBackViewController2" = "تحميل لقطة شاشة";
"FeedBackViewController3" = "وسيلة تواصل";
"FeedBackViewController4" = "من فضلك ادخل";
"FeedBackViewController5" = " رقم الهاتف او البريد الالكتروني";

View File

@@ -3652,3 +3652,10 @@
"XPRoomTypeSelectionViewController3" = "After the setting is completed, members who are out of the microphone order will be removed. Do you confirm the setting?";
"XPRoomTypeSelectionViewController4" = "Room type";
"XPRoomTypeSelectionViewController5" = "Using";
"FeedBackViewController0" = "choose the problem type";
"FeedBackViewController1" = "describe the problem";
"FeedBackViewController2" = "upload screenshot";
"FeedBackViewController3" = "contact information";
"FeedBackViewController4" = "Please enter...";
"FeedBackViewController5" = "Mobile phone number or email";

View File

@@ -3315,3 +3315,11 @@
"XPRoomTypeSelectionViewController3" = "设置后将移除超出麦序的成员,确认设置?";
"XPRoomTypeSelectionViewController4" = "房間類型";
"XPRoomTypeSelectionViewController5" = "使用中";
"FeedBackViewController0" = "選擇問題類型";
"FeedBackViewController1" = "問題描述";
"FeedBackViewController2" = "上傳截圖";
"FeedBackViewController3" = "聯係方式";
"FeedBackViewController4" = "請輸入…";
"FeedBackViewController5" = "手機號或郵箱";

View File

@@ -3305,3 +3305,10 @@
"XPRoomTypeSelectionViewController3" = "设置后将移除超出麦序的成员,确认设置?";
"XPRoomTypeSelectionViewController4" = "房間類型";
"XPRoomTypeSelectionViewController5" = "使用中";
"FeedBackViewController0" = "選擇問題類型";
"FeedBackViewController1" = "問題描述";
"FeedBackViewController2" = "上傳截圖";
"FeedBackViewController3" = "聯係方式";
"FeedBackViewController4" = "請輸入…";
"FeedBackViewController5" = "手機號或郵箱";