Commit c3d07420 by pierce

直播間信用評分

parent 914f9077
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "视聊-小星-半星@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "视聊-小星-亮@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "视聊-小星-暗@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -91,12 +91,13 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -91,12 +91,13 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
// 是否能点击at按钮 // 是否能点击at按钮
@property (nonatomic, assign) BOOL enableAtBtn; @property (nonatomic, assign) BOOL enableAtBtn;
//#pragma mark - 评分 #pragma mark - 评分
// credit // credit
//@property (nonatomic, strong) UILabel *creditLabel; @property (nonatomic, strong) UIView *creditView;
//@property (nonatomic, strong) UILabel *remarkLabel; @property (nonatomic, strong) UILabel *creditLabel;
//@property (nonatomic, strong) UIView *starBgView; @property (nonatomic, strong) UILabel *remarkLabel;
//@property (nonatomic, strong) NSMutableArray *starImageViews; @property (nonatomic, strong) UIView *starBgView;
@property (nonatomic, strong) NSMutableArray *starImageViews;
#pragma mark - Tags #pragma mark - Tags
// tagView的列表 // tagView的列表
...@@ -300,7 +301,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -300,7 +301,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
[self fus_initLevLabel]; [self fus_initLevLabel];
[self fus_initSignLabel]; [self fus_initSignLabel];
[self fus_initBottomBgView]; [self fus_initBottomBgView];
// [self fus_initCreditUI]; [self fus_initCreditUI];
[self.bgView fusrtl_setSubViewsToRTL]; [self.bgView fusrtl_setSubViewsToRTL];
...@@ -743,7 +744,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -743,7 +744,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
[self fus_updateBtnsWithModel:model]; [self fus_updateBtnsWithModel:model];
// [self fus_setCreditInfoWithCurrentModel]; [self fus_setCreditInfoWithCurrentModel];
[self fus_resetTagWithModel:model]; [self fus_resetTagWithModel:model];
[self fus_updateControlViewWithModel:model]; [self fus_updateControlViewWithModel:model];
[[FUSLiveHelper shareInstance].currentFunctionView addSubview:self]; [[FUSLiveHelper shareInstance].currentFunctionView addSubview:self];
...@@ -1108,6 +1109,133 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -1108,6 +1109,133 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
if (_didClickUserInfoViewBtnBlock) _didClickUserInfoViewBtnBlock (FUSUserInfoViewBtnTypeUserHead, _currentModel); if (_didClickUserInfoViewBtnBlock) _didClickUserInfoViewBtnBlock (FUSUserInfoViewBtnTypeUserHead, _currentModel);
} }
#pragma mark - 视讯评分相关的逻辑
- (void)fus_initCreditUI {
self.creditView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 117, 37)];
self.creditView.layer.cornerRadius = 6;
self.creditView.layer.masksToBounds = YES;
self.creditView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2];
[self.clearBgView insertSubview:self.creditView belowSubview:self.bgView];
self.creditView.centerY = self.bgView.y;
self.creditLabel = [[UILabel alloc] init];
self.creditLabel.font = [UIFont fus_themeMediumFont:8];
self.creditLabel.text = [NSString fus_localString:@"私房信用:"];
self.creditLabel.textColor = [UIColor whiteColor];
[self.creditLabel sizeToFit];
[self.creditView addSubview:self.creditLabel];
_remarkLabel = [[UILabel alloc] init];
_remarkLabel.font = [UIFont fus_themeBoldFont:8];
_remarkLabel.textColor = [UIColor colorWithHex:@"#53B9F3"];
[self.creditView addSubview:_remarkLabel];
_starBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 8)];
[self.creditView addSubview:_starBgView];
_starImageViews = [NSMutableArray array];
for (int i = 0; i < 5; i ++) {
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((_starBgView.height+2)*i, 0, _starBgView.height, _starBgView.height)];
imageView.contentMode = UIViewContentModeScaleAspectFit;
[_starBgView addSubview:imageView];
[_starImageViews addObject:imageView];
}
_starBgView.width = _starBgView.height*5 + 2*4;
[_starBgView fusrtl_setSubViewsToRTL];
}
- (void)fus_setCreditInfoWithCurrentModel {
if (FUSConfig.sharedInstanced.devConfigs.appStatus) {
self.creditView.hidden = YES;
return;
}
self.creditView.hidden = NO;
[self.creditLabel sizeToFit];
self.creditLabel.x = 7;
self.creditLabel.centerY = self.creditView.height / 4.0f;
if (self.currentModel.chatWith.avgLevel > 0 && !FUSConfig.sharedInstanced.devConfigs.appStatus) {//设置评分
self.starBgView.hidden = NO;
[self fus_setStarCountWithMark:self.currentModel.chatWith.avgLevel];
self.remarkLabel.text = [NSString stringWithFormat:@"%.1lf", self.currentModel.chatWith.avgLevel];
[self.remarkLabel sizeToFit];
self.remarkLabel.centerY = self.creditLabel.centerY;
self.remarkLabel.x = self.creditLabel.right;
self.starBgView.x = self.remarkLabel.right + 3;
self.starBgView.centerY = self.creditLabel.centerY;
self.remarkLabel.textColor = [UIColor colorWithHex:@"#53B9F3"];
self.creditView.width = self.starBgView.right + 7;
self.creditView.x = self.width - self.creditView.width - 7;
[self.creditLabel fusrtl_resetFrameToFitRTL];
[self.starBgView fusrtl_resetFrameToFitRTL];
[self.remarkLabel fusrtl_resetFrameToFitRTL];
} else {
self.starBgView.hidden = YES;
self.remarkLabel.text = [NSString fus_localString:@"暂无评分"];
[self.remarkLabel sizeToFit];
self.remarkLabel.x = self.creditLabel.right;
self.remarkLabel.centerY = self.creditLabel.centerY;
self.remarkLabel.textColor = [UIColor colorWithHex:@"#DDDDDD"];
self.creditView.width = self.remarkLabel.right + 7;
self.creditView.x = self.width - self.creditView.width - 7;
[self.creditLabel fusrtl_resetFrameToFitRTL];
[self.remarkLabel fusrtl_resetFrameToFitRTL];
}
[self.creditView fusrtl_resetFrameToFitRTL];
}
- (void)fus_setStarCountWithMark:(CGFloat )mark {
if (mark > 0.0) {
self.creditLabel.hidden = NO;
_starBgView.hidden = NO;
_remarkLabel.hidden = NO;
}else{
self.creditLabel.hidden = YES;
_starBgView.hidden = YES;
_remarkLabel.hidden = YES;
return;
}
//整数
NSInteger integer = floor(mark);
//余数
CGFloat remainder = mark - integer;
if (remainder < 0.5) {
remainder = 0;
}
for (int i = 0; i < _starImageViews.count; i++) {
UIImageView *imageView = _starImageViews[i];
if (i < integer) {
imageView.image = [UIImage imageNamed:@"live_user_video_remark_star_light"];
}else{
imageView.image = [UIImage imageNamed:@"live_user_video_remark_star_whole_gray"];
}
}
if (remainder != 0 && integer < _starImageViews.count) {
UIImageView *imageView = _starImageViews[integer];
imageView.image = [[UIImage imageNamed:@"live_user_video_remark_star_half"] fusrtl_imageFlippedForRightToLeftLayoutDirection];
}
}
#pragma mark - 标签信息相关的逻辑 #pragma mark - 标签信息相关的逻辑
- (void)fus_resetTagWithModel:(FUSRoomUserInfoModel *)model { - (void)fus_resetTagWithModel:(FUSRoomUserInfoModel *)model {
for (UIView *tagView in self.tagViewList) { for (UIView *tagView in self.tagViewList) {
......
...@@ -2192,3 +2192,5 @@ ...@@ -2192,3 +2192,5 @@
"发送验证码" = "獲取驗證碼"; "发送验证码" = "獲取驗證碼";
"私房信用:" = "私房信用:";
...@@ -2192,3 +2192,4 @@ ...@@ -2192,3 +2192,4 @@
"发送验证码" = "獲取驗證碼"; "发送验证码" = "獲取驗證碼";
"私房信用:" = "私房信用:";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment