123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455 |
- import 'package:flutter/material.dart';
- enum XYPkBattlingStatus {
- XYPkBattlingStatusLeftDefault,//表示显示左边头像
- XYPkBattlingStatusRightDefault,//表示显示右边新增邀请按钮
- XYPkBattlingStatusWait,//等待加入
- XYPkBattlingStatusBattling,//PK 中
- XYPkBattlingStatusPunish,//惩罚
- XYPkBattlingStatusOver,//结束
- }
- class LiveRoomMessageInfo {
- //消息类型
- String? type;
- /// 消息时间戳
- String? timestamp;
- /// 用户配置信息字符串 通过截取字段
- String? profileString;
- /// 发送者用户id
- // String? senderId;
- /// 发送者用户名
- String? senderNickname;
- /// 发送者头像url
- String? senderAvatarUrl;
- /// 接收者用户id
- String? reciveId;
- /// 接收者用户id
- String? reciveNickname;
- /// 接收者的头像url
- String? reciveAvatarUrl;
- /// 主播的用户id
- String? anchorUserId;
- /// 用户等级
- int? grageNum;
- /// 主播等级
- int? anchorGrageNum;
- /// 贵族等级
- int? nobility;
- /// 官方
- int? isOfficial;
- /// 房主
- int? isHouseOwer;
- /// 房管
- int? isHouseManager;
- /// 主持人
- int? isHost;
- /// 性别 1男 2女
- int? userSex;
- /// 年龄
- String? userAge;
- ///聊天用户标签(等级、靓号、官方等)+ 用户名字AWRichText
- // @property (nonatomic, strong) AWRichText userMarkRichText;
- // ///聊天、礼物文字
- // @property (nonatomic, strong) AWRichText textRichText;
- // ///飘屏通知AWRichText
- // @property (nonatomic, strong) AWRichText noticeRichText;
- /// 内容标识
- String? contentText1;
- String? contentText2;
- String? contentText3;
- ///聊天列表总高度
- num? cellHeight;
- ///聊天列表需要显示的宽度
- num? cellShadowWidth;
- ///聊天列表用户标签高度
- num? cellUserMarkHeight;
- /// 礼物对应的动画资源id
- String? giftAnimationId;
- /// 是否为贴纸
- String? giftIsSticker;
- /// 贴纸名字
- String? giftStickerName;
- /// 贴纸路径url
- String? giftStickerPath;
- /// 贴纸显示时间
- String? giftStickerDuration;
- /// 礼物id
- String? giftId;
- /// 礼物数量
- String? giftQuantity;
- /// 礼物价格
- String? giftPrice;
- /// 1 - 购买的 2 - 从背包送的 3 - 百变礼盒开出
- String? giftSourceType;
- /// 礼物连击次数
- String? giftCombo;
- /// 礼物连击标识
- String? comboKeyHash;
- /// 礼物图片url
- String? giftImageUrl;
- /// 是否聊天列表显示
- bool? showInComment;
- /// 是否弹幕显示 isComboTimeout = true 时 标识这是一条连击结束的消息,只在弹幕中构造
- bool? isComboTimeout;
- /// 是否连击banner显示
- bool? isCombo;
- /// 礼物连击等级
- int? comboValueLevel;
- /// 礼物连击倒计时秒数
- int? comboPeriodSec;
- /// 礼物连击banner背景动画id
- String? giftBannerAnimationId;
- /// 礼物连击时全区通知的背景动画id
- String? floatScreenAnimationId;
- /// 礼物连击时全区通知的停留的时间
- num? floatScreenStayTime;
- /// 头饰动效id
- String? headWearAnimationId;
- /// 汽泡动效id
- String? bubbleId;
- /// 礼物名字
- String? giftName;
- /// 中奖金额
- String? winAmount;
- /// 中奖倍数
- String? winMultiple;
- /// 中奖最大倍数
- String? winMultipleMax;
- /// 热度
- String? heatNum;
- /// 观看人数
- String? watchNum;
- /// 直播状态
- String? liveStatus;
- /// 直播流状态
- String? streamStatus;
- /// 推流地址
- String? pullUrl;
- /// 房管
- int? userMasterAction;
- /// 神秘人
- String? anonymousGift;
- /// 目标类型
- // String? targetType;
- /// 用户角色
- String? userRole;
- /// 主播收入改变
- String? scoreValue;
- /// 官方
- String? offical;
- /// 11weath财富 21charm魅力
- String? scoreType;
- /// 主播魅力值
- String? glamorousNum;
- /// 主播收入
- String? incomeAmount;
- /// 是否为活动消息(太空旅行、幸运礼物/等)一排
- bool? isActivity;
- /// 是否为房间提示消息(进房,上下麦,房间上锁等)一排
- bool? isAlert;
- /// 是否为礼物或者聊天文字消,两排
- bool? isTextOrGift;
- /// 活动图片url
- String? activityIcon;
- /// 活动跳转链接
- String? activityUrl;
- /// 靓号
- String? niceNo;
- /// 靓号等级
- int? niceLevel;
- /// 坐骑id
- String? mountsId;
- /// 坐骑名字
- String? mountsName;
- /// 坐骑动画id
- String? mountsAnimationId;
- /// 勋章显示时间
- int? nobleTime;
- /// 勋章等级
- String? nobleValue;
- /// vip等级
- String? vipValue;
- /// 星耀等级
- String? starLevel;
- /// 勋章ID
- String? medalId;
- //1v1视频剩余可用时间
- String? minutesRemain;
- //通话计费时长
- String? hisMinutes;
- //通话费用
- String? hisAmount;
- //pk
- String? pkToken;
- String? pkBattleId;
- ////0拒绝 1同意
- String? pkDecision;
- int? pkProceedTime;
- int? pkPunishTime;
- int? pkChangeValue;
- String? pkUserId;
- List<dynamic>? pkTopGivers;
- ///battlingStatus 1等待加入 2PK中 3惩罚 4结束
- XYPkBattlingStatus? pkBattlingStatus;
- ///battleRole 1 红方 2 蓝方
- int? pkRole;
- ///battleResult 0 打平 1 红方胜 2 蓝方胜
- int? pkResult;
- int? pkRankIndex;
- ///battleResult 0 打平 1胜 2败
- int? pkRankResult;
- ///临时类型标识
- int? tempType;
- /// noticeType : 0 无消息 , 1 聊天框显示 , 2顶部显示 , 3都显示
- int? noticeType;
- /// 语音房消息
- /// 聊天室房间id
- String? roomId;
- /// 麦位
- int? seatNo;
- /// 上麦下麦用户id
- String? userId;
- /// 表情id
- String? expId;
- /// 表情url
- String? expUrl;
- /// 表情播放时间
- int? playTimes;
- /// 表情最后帧数
- int? finalFrame;
- /// 通知类型
- String? noticestyle;
- //用户信息实体
- XYLiveUserModel? userInfo;
- String? _groupId;
- SenderProfile? _senderProfile;
- int? _targetType;
- Msg? _msg;
- int? _senderId;
- String? get groupId => _groupId;
- SenderProfile? get senderProfile => _senderProfile;
- int? get targetType => _targetType;
- Msg? get msg => _msg;
- int? get senderId => _senderId;
- LiveRoomMessageInfo({
- String? groupId,
- SenderProfile? senderProfile,
- int? targetType,
- Msg? msg,
- int? senderId}){
- _groupId = groupId;
- _senderProfile = senderProfile;
- _targetType = targetType;
- _msg = msg;
- _senderId = senderId;
- }
- LiveRoomMessageInfo.fromJson(dynamic json) {
- _groupId = json['groupId'];
- _senderProfile = json['senderProfile'] != null ? SenderProfile.fromJson(json['senderProfile']) : null;
- _targetType = json['targetType'];
- _msg = json['msg'] != null ? Msg.fromJson(json['msg']) : null;
- _senderId = json['senderId'];
- userInfo = XYLiveUserModel();
- userInfo!.setPro(json["senderProfile"]["profileString"]);
- //这里是消息类型
- //1, 用户进入直播间
- if(_msg!.type == ""){
- }
- //2,
- }
- Map<String, dynamic> toJson() {
- var map = <String, dynamic>{};
- map['groupId'] = _groupId;
- if (_senderProfile != null) {
- map['senderProfile'] = _senderProfile?.toJson();
- }
- map['targetType'] = _targetType;
- if (_msg != null) {
- map['msg'] = _msg?.toJson();
- }
- map['senderId'] = _senderId;
- return map;
- }
- }
- class XYLiveUserModel {
- //粉丝等级
- int? fansLevel;
- /// 会员等级
- int? vipLevel;
- /// 守护等级
- int? guardLevel;
- /// 勋章 id
- String? medalIds;
- /// 是否房管 1观众 2房管 3主播
- int? userRole;
- /// 附加信息
- String? profileString;
- /// 是否新人 webscoket解析用户信息使用
- bool? isNew;
- /// 用户id
- String? userId;
- /// 用户头像
- String? userAvatar;
- /// 用户名字
- String? userName;
- /// 靓号 不是每个人都有
- String? niceNo;
- ///靓号等级
- int? niceLevel;
- /// 用户等级(财富等级)
- int? wealthLevel;
- ///星耀等级
- int? starLevel;
- /// 贵族等级
- int? nobleLevel;
- /// 是否正在直播
- bool? isLive;
- int? userSex;
- int? userAge;
- /// ID
- String? userNo;
- /// 在线状态
- int? isOnline;
- /// 是否实名认证
- bool? isAuth;
- /// 是否在房间 0不在 1在
- bool? isInRoom;
- /// tag
- String? userTag;
- void setPro(String profileString){
- if(profileString.length > 9){
- this.wealthLevel = int.parse(profileString.substring(0,3));
- this.nobleLevel = int.parse(profileString.substring(3,4));
- this.guardLevel = int.parse(profileString.substring(4,5));
- this.vipLevel = int.parse(profileString.substring(5,6));
- this.fansLevel = int.parse(profileString.substring(6,8));
- }
- this.niceLevel = int.parse(profileString.substring(9,10));
- if(profileString.length > 19){
- this.niceNo = (profileString.substring(10,20));
- }
- if (int.parse(profileString.substring(8,9)) == 0) {
- this.isNew = false;
- } else {
- this.isNew = true;
- }
- }
- }
- class Msg {
- String? _type;
- int? _timestamp;
- String? get type => _type;
- int? get timestamp => _timestamp;
- Msg({
- String? type,
- int? timestamp}){
- _type = type;
- _timestamp = timestamp;
- }
- Msg.fromJson(dynamic json) {
- _type = json['type'];
- _timestamp = json['timestamp'];
- }
- Map<String, dynamic> toJson() {
- var map = <String, dynamic>{};
- map['type'] = _type;
- map['timestamp'] = _timestamp;
- return map;
- }
- }
- /// userNo : 10811379
- /// userAvatar : "http://user.qn.timichat.net/avatar/162116510154752/1631951244395.png"
- /// userRole : 1
- /// profileString : "00110000000000000000"
- /// userId : 162116510154752
- /// userName : "好好66"
- class SenderProfile {
- int? _userNo;
- String? _userAvatar;
- int? _userRole;
- String? _profileString;
- int? _userId;
- String? _userName;
- int? get userNo => _userNo;
- String? get userAvatar => _userAvatar;
- int? get userRole => _userRole;
- String? get profileString => _profileString;
- int? get userId => _userId;
- String? get userName => _userName;
- SenderProfile({
- int? userNo,
- String? userAvatar,
- int? userRole,
- String? profileString,
- int? userId,
- String? userName}){
- _userNo = userNo;
- _userAvatar = userAvatar;
- _userRole = userRole;
- _profileString = profileString;
- _userId = userId;
- _userName = userName;
- }
- SenderProfile.fromJson(dynamic json) {
- _userNo = json['userNo'];
- _userAvatar = json['userAvatar'];
- _userRole = json['userRole'];
- _profileString = json['profileString'];
- _userId = json['userId'];
- _userName = json['userName'];
- }
- Map<String, dynamic> toJson() {
- var map = <String, dynamic>{};
- map['userNo'] = _userNo;
- map['userAvatar'] = _userAvatar;
- map['userRole'] = _userRole;
- map['profileString'] = _profileString;
- map['userId'] = _userId;
- map['userName'] = _userName;
- return map;
- }
- }
|