XYVocieRoomCommonMethod.m 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // XYVocieRoomCommonMethod.m
  3. // Starbuds
  4. //
  5. // Created by 翟玉磊 on 2020/7/7.
  6. // Copyright © 2020 翟玉磊. All rights reserved.
  7. //
  8. #import "XYVocieRoomCommonMethod.h"
  9. @implementation XYVocieRoomCommonMethod
  10. /// 根据角色类型获取该类型的文本
  11. + (NSString *)getVoiceRoomRoleTextWithRole:(XYVoiceRoomRole)role {
  12. NSString *text = @"";
  13. switch (role) {
  14. case XYVoiceRoomRoleAudience:
  15. text = kLocalizedString(@"观众");
  16. break;
  17. case XYVoiceRoomRoleMaster:
  18. text = kLocalizedString(@"房管");
  19. break;
  20. case XYVoiceRoomRoleHost:
  21. text = kLocalizedString(@"主持人");
  22. break;
  23. case XYVoiceRoomRoleAdmin:
  24. text = kLocalizedString(@"房主");
  25. break;
  26. case XYVoiceRoomRoleSuper:
  27. text = kLocalizedString(@"超管");
  28. break;
  29. case XYVoiceRoomRoleOfficial:
  30. text = kLocalizedString(@"官方");
  31. break;
  32. }
  33. return text;
  34. }
  35. /// 根据类型获取相亲房进程文本
  36. + (NSString *)getLoveProgressTextWithStage:(XYVoiceRoomLoveStage)stage {
  37. NSString *text = @"";
  38. switch (stage) {
  39. case XYVoiceRoomLoveStageReady:
  40. text = kLocalizedString(@"嘉宾上座");
  41. break;
  42. case XYVoiceRoomLoveStageIntro:
  43. text = kLocalizedString(@"自我介绍");
  44. break;
  45. case XYVoiceRoomLoveStageStandard:
  46. text = kLocalizedString(@"择偶标准");
  47. break;
  48. case XYVoiceRoomLoveStageQuestion:
  49. text = kLocalizedString(@"真爱问答");
  50. break;
  51. case XYVoiceRoomLoveStageChoose:
  52. text = kLocalizedString(@"心动选人");
  53. break;
  54. case XYVoiceRoomLoveStageMatch:
  55. text = kLocalizedString(@"公布心动");
  56. break;
  57. }
  58. return text;
  59. }
  60. /// 获取相亲进程数组 numberYES则带序号1.~
  61. + (NSArray *)getLoveProgressTitleArrayWithNumber:(BOOL)number {
  62. if (number) {
  63. return @[[self getLoveProgressTextWithStage:XYVoiceRoomLoveStageReady],
  64. [NSString stringWithFormat:@"1.%@", [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageIntro]],
  65. [NSString stringWithFormat:@"2.%@", [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageStandard]],
  66. [NSString stringWithFormat:@"3.%@", [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageQuestion]],
  67. [NSString stringWithFormat:@"4.%@", [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageChoose]],
  68. [NSString stringWithFormat:@"5.%@", [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageMatch]]];
  69. }
  70. return @[[self getLoveProgressTextWithStage:XYVoiceRoomLoveStageReady],
  71. [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageIntro],
  72. [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageStandard],
  73. [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageQuestion],
  74. [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageChoose],
  75. [self getLoveProgressTextWithStage:XYVoiceRoomLoveStageMatch]];
  76. }
  77. @end