航海结果弹框
@@ -711,6 +711,8 @@
|
||||
E8A88D3027E85EEA00CA8837 /* RoomPKInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A88D2F27E85EEA00CA8837 /* RoomPKInfoModel.m */; };
|
||||
E8AA6EEF27DF1E6B009B4C2B /* XPRoomTopicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AA6EEE27DF1E6B009B4C2B /* XPRoomTopicViewController.m */; };
|
||||
E8AA6EF227DF1E97009B4C2B /* XPRoomTopicPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AA6EF127DF1E97009B4C2B /* XPRoomTopicPresenter.m */; };
|
||||
E8AB633328AE51470023B0D2 /* XPSailingPrizeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AB633228AE51470023B0D2 /* XPSailingPrizeView.m */; };
|
||||
E8AB633628AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AB633528AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.m */; };
|
||||
E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC720F26F43955007D6E91 /* UIImageConstant.m */; };
|
||||
E8AC721326F46ADD007D6E91 /* XPMineSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC721226F46ADD007D6E91 /* XPMineSettingViewController.m */; };
|
||||
E8AC721626F46B06007D6E91 /* XPMineSettingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC721526F46B06007D6E91 /* XPMineSettingTableViewCell.m */; };
|
||||
@@ -2345,6 +2347,10 @@
|
||||
E8AA6EF027DF1E97009B4C2B /* XPRoomTopicPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicPresenter.h; sourceTree = "<group>"; };
|
||||
E8AA6EF127DF1E97009B4C2B /* XPRoomTopicPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTopicPresenter.m; sourceTree = "<group>"; };
|
||||
E8AA6EF327DF1EB6009B4C2B /* XPRoomTopicProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTopicProtocol.h; sourceTree = "<group>"; };
|
||||
E8AB633128AE51470023B0D2 /* XPSailingPrizeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSailingPrizeView.h; sourceTree = "<group>"; };
|
||||
E8AB633228AE51470023B0D2 /* XPSailingPrizeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSailingPrizeView.m; sourceTree = "<group>"; };
|
||||
E8AB633428AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSailingPrizeCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
E8AB633528AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSailingPrizeCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
E8AC720E26F43955007D6E91 /* UIImageConstant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIImageConstant.h; sourceTree = "<group>"; };
|
||||
E8AC720F26F43955007D6E91 /* UIImageConstant.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIImageConstant.m; sourceTree = "<group>"; };
|
||||
E8AC721126F46ADD007D6E91 /* XPMineSettingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSettingViewController.h; sourceTree = "<group>"; };
|
||||
@@ -5419,6 +5425,8 @@
|
||||
E8751E6228A646400056EF44 /* XPSailingRankView.m */,
|
||||
E8751E6428A6465A0056EF44 /* XPSailingRankSubView.h */,
|
||||
E8751E6528A6465A0056EF44 /* XPSailingRankSubView.m */,
|
||||
E8AB633128AE51470023B0D2 /* XPSailingPrizeView.h */,
|
||||
E8AB633228AE51470023B0D2 /* XPSailingPrizeView.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -5461,6 +5469,8 @@
|
||||
E8751E6A28A64C6E0056EF44 /* XPSailingRankTableViewCell.m */,
|
||||
E8751E6C28A64F990056EF44 /* XPSailingEmptyTableViewCell.h */,
|
||||
E8751E6D28A64F990056EF44 /* XPSailingEmptyTableViewCell.m */,
|
||||
E8AB633428AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.h */,
|
||||
E8AB633528AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.m */,
|
||||
);
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
@@ -7615,6 +7625,7 @@
|
||||
E8664ED027E42238000171BA /* XPRoomPKTimePickerView.m in Sources */,
|
||||
E824544826F5945300BE8163 /* XPMinePayPwdProtocol.h in Sources */,
|
||||
9BFB10162897AAB300B3985E /* XPNewUserRechargeSucessView.m in Sources */,
|
||||
E8AB633628AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.m in Sources */,
|
||||
E824543A26F5880E00BE8163 /* XPLoginVerifBindPhoneProtocol.h in Sources */,
|
||||
E8E20BE2281695800033B688 /* XPMineLoginPasswordViewController.m in Sources */,
|
||||
E86E79D628A4EA0C006DAF48 /* SessionRiskCache.m in Sources */,
|
||||
@@ -7784,6 +7795,7 @@
|
||||
E8A1E45B27620F4900B294CA /* XPRoomHalfWebView.m in Sources */,
|
||||
9BFE992E288142FD009DA429 /* RoomClassifyModel.m in Sources */,
|
||||
E8A88D3027E85EEA00CA8837 /* RoomPKInfoModel.m in Sources */,
|
||||
E8AB633328AE51470023B0D2 /* XPSailingPrizeView.m in Sources */,
|
||||
E8A86E0527BA38DB001C21F9 /* NSString+RW.m in Sources */,
|
||||
E800162C2803FE4900D6D17A /* GuildIncomeRecordModel.m in Sources */,
|
||||
9BE01ACE28925F7D00B50299 /* XPMineNewUserRechargeView.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_prize_more.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_more@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_more@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 159 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_prize_one.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_one@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_prize_one@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_prize_one.imageset/room_sailing_prize_one@2x.png
vendored
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_prize_one.imageset/room_sailing_prize_one@3x.png
vendored
Normal file
After Width: | Height: | Size: 163 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_rank_first.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_rank_first@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_rank_first@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_rank_second.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_rank_second@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_rank_second@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.4 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_rank_third.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_rank_third@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_rank_third@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 3.7 KiB |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_tips_normal.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_tips_normal@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_tips_normal@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 277 B |
22
xplan-ios/Assets.xcassets/Room/Sailing/room_sailing_tips_select.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_tips_select@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_sailing_tips_select@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 289 B |
After Width: | Height: | Size: 466 B |
@@ -47,9 +47,9 @@ NSString * const URLWithType(URLType type) {
|
||||
@(kNewWeekStarURL) : @"modules/weekStar/newWeekStar.html", ///周星礼物-周星榜
|
||||
@(kLicenseHourRankURL) : @"modules/room_rank/hourRankLicense.html",///牌照房小时榜礼物
|
||||
@(kLuckyGiftPlayRuleURL) : @"modules/rule/luckyGiftRule.html?giftID=%@",///幸运礼物玩法说明
|
||||
@(kSailingActivityURL) : @"activity/radish/index.html", ///航海活动地址
|
||||
@(kSailingPlayDescdURL) : @"modules/rule/radishRule.html", ///航海玩法规则
|
||||
@(kSailingRecordURL) : @"modules/rank/index.html#/RadishRecord", ///航海中奖记录
|
||||
@(kSailingActivityURL) : @"activity/act-sail/more.html", ///航海活动地址
|
||||
@(kSailingPlayDescdURL) : @"activity/act-sail/play_explain.html", ///航海玩法规则
|
||||
@(kSailingRecordURL) : @"activity/act-sail/win_record.html", ///航海中奖记录
|
||||
@(kNetworkRenovateURL) : @"activity/activemodel/index.html?code=ZBGG"///网络整治乱象
|
||||
};
|
||||
NSString * url = [dic objectForKey:@(type)];
|
||||
|
@@ -13,6 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,copy) NSString *url;
|
||||
///房间uid
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
|
||||
///是否是航海
|
||||
@property (nonatomic,assign) BOOL isSailing;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -116,6 +116,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setIsSailing:(BOOL)isSailing {
|
||||
_isSailing = isSailing;
|
||||
if (_isSailing) {
|
||||
self.webVC.webview.scrollView.backgroundColor = [UIColor clearColor];
|
||||
self.webVC.webview.opaque = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
|
@@ -24,7 +24,7 @@
|
||||
/// @param completion 完成
|
||||
/// @param uid 用户的uid
|
||||
+ (void)getSailingInfo:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
|
||||
[self makeRequest:@"linearlyPool/userkey" method:HttpRequestHelperMethodGET completion:completion, uid, nil];
|
||||
[self makeRequest:@"linearlyPool/userkey" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, uid, nil];
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
/// @param sendMessage 是否发消息
|
||||
/// @param roomUid 房间的uid
|
||||
+ (void)openSailing:(HttpRequestHelperCompletion)completion uid:(NSString *)uid keyNum:(NSString *)keyNum sendMessage:(NSString *)sendMessage roomUid:(NSString *)roomUid {
|
||||
[self makeRequest:@"" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, uid, keyNum, sendMessage, roomUid, nil];
|
||||
[self makeRequest:@"linearlyPool/draw" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, uid, keyNum, sendMessage, roomUid, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPSailingPrizeCollectionViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomSailingPrizeModel;
|
||||
@interface XPSailingPrizeCollectionViewCell : UICollectionViewCell
|
||||
@property (nonatomic,strong) RoomSailingPrizeModel *prizeModel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// XPSailingPrizeCollectionViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/18.
|
||||
//
|
||||
|
||||
#import "XPSailingPrizeCollectionViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "NetImageView.h"
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
|
||||
@interface XPSailingPrizeCollectionViewCell ()
|
||||
@property (nonatomic,strong) NetImageView *logoImageView;
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPSailingPrizeCollectionViewCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.contentView.backgroundColor = [UIColor clearColor];
|
||||
[self.contentView addSubview:self.logoImageView];
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(42, 42));
|
||||
make.top.centerX.mas_equalTo(self.self.contentView);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.logoImageView);
|
||||
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(5);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPrizeModel:(RoomSailingPrizeModel *)prizeModel {
|
||||
_prizeModel = prizeModel;
|
||||
if (_prizeModel) {
|
||||
self.logoImageView.imageUrl = _prizeModel.prizeImgUrl;
|
||||
self.titleLabel.text = [NSString stringWithFormat:@"%@*%d", _prizeModel.prizeName, _prizeModel.prizeNum];
|
||||
}
|
||||
}
|
||||
|
||||
- (NetImageView *)logoImageView {
|
||||
if (!_logoImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_logoImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_logoImageView.layer.masksToBounds = YES;
|
||||
_logoImageView.layer.cornerRadius = 8;
|
||||
}
|
||||
return _logoImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
_titleLabel.textColor = UIColorFromRGB(0xA08161);
|
||||
_titleLabel.numberOfLines = 2;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -8,9 +8,9 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class RoomSailingRankModel;
|
||||
@interface XPSailingRankTableViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic,strong) RoomSailingRankModel *rankInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -11,6 +11,8 @@
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "NetImageView.h"
|
||||
///Model
|
||||
#import "RoomSailingRankModel.h"
|
||||
|
||||
@interface XPSailingRankTableViewCell ()
|
||||
///背景
|
||||
@@ -70,8 +72,8 @@
|
||||
}];
|
||||
|
||||
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right);
|
||||
make.centerY.mas_equalTo(self.nickLabel);
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(5);
|
||||
make.centerY.mas_equalTo(self.avatarImageView);
|
||||
make.right.mas_lessThanOrEqualTo(self.diamondImageView.mas_left).offset(-5);
|
||||
}];
|
||||
|
||||
@@ -90,6 +92,28 @@
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setRankInfo:(RoomSailingRankModel *)rankInfo {
|
||||
_rankInfo = rankInfo;
|
||||
if (_rankInfo) {
|
||||
self.avatarImageView.imageUrl = _rankInfo.avatar;
|
||||
self.nickLabel.text = _rankInfo.nick;
|
||||
self.coinLabel.text = _rankInfo.amount.stringValue;
|
||||
if (_rankInfo.ranking.integerValue == 1) {
|
||||
[self.rankButton setImage:[UIImage imageNamed:@"room_sailing_rank_first"] forState:UIControlStateNormal];
|
||||
[self.rankButton setTitle:@"" forState:UIControlStateNormal];
|
||||
} else if(_rankInfo.ranking.integerValue == 2) {
|
||||
[self.rankButton setImage:[UIImage imageNamed:@"room_sailing_rank_second"] forState:UIControlStateNormal];
|
||||
[self.rankButton setTitle:@"" forState:UIControlStateNormal];
|
||||
} else if(_rankInfo.ranking.integerValue == 3) {
|
||||
[self.rankButton setImage:[UIImage imageNamed:@"room_sailing_rank_third"] forState:UIControlStateNormal];
|
||||
[self.rankButton setTitle:@"" forState:UIControlStateNormal];
|
||||
} else {
|
||||
[self.rankButton setTitle:_rankInfo.ranking forState:UIControlStateNormal];
|
||||
[self.rankButton setImage:nil forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (UIView *)backView {
|
||||
if (!_backView) {
|
||||
_backView = [[UIView alloc] init];
|
||||
|
16
xplan-ios/Main/Room/View/Sailing/View/XPSailingPrizeView.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPSailingPrizeView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/18.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class RoomSailingPrizeModel;
|
||||
@interface XPSailingPrizeView : UIView
|
||||
@property (nonatomic,strong) NSArray<RoomSailingPrizeModel *> *prizeItemList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
166
xplan-ios/Main/Room/View/Sailing/View/XPSailingPrizeView.m
Normal file
@@ -0,0 +1,166 @@
|
||||
//
|
||||
// XPSailingPrizeView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/18.
|
||||
//
|
||||
|
||||
#import "XPSailingPrizeView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
///Model
|
||||
#import "RoomSailingPrizeModel.h"
|
||||
///View
|
||||
#import "XPSailingPrizeCollectionViewCell.h"
|
||||
|
||||
@interface XPSailingPrizeView ()<UICollectionViewDelegate, UICollectionViewDataSource>
|
||||
|
||||
///背景
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
///提示
|
||||
@property (nonatomic,strong) UIStackView *tipsStackView;
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *boxButton;
|
||||
///
|
||||
@property (nonatomic,strong) UILabel *tipLabel;
|
||||
@end
|
||||
|
||||
|
||||
@implementation XPSailingPrizeView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
[self.backImageView addSubview:self.collectionView];
|
||||
[self.backImageView addSubview:self.tipsStackView];
|
||||
|
||||
[self.tipsStackView addArrangedSubview:self.boxButton];
|
||||
[self.tipsStackView addArrangedSubview:self.tipLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.backImageView).offset(75);
|
||||
make.left.right.mas_equalTo(self.backImageView);
|
||||
make.bottom.mas_equalTo(self.tipsStackView.mas_top).offset(-10);
|
||||
}];
|
||||
|
||||
[self.tipsStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
make.bottom.mas_equalTo(self.backImageView).offset(-16.5);
|
||||
make.height.mas_equalTo(10);
|
||||
}];
|
||||
|
||||
[self.boxButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(10);
|
||||
}];
|
||||
}
|
||||
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.prizeItemList.count;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPSailingPrizeCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPSailingPrizeCollectionViewCell class]) forIndexPath:indexPath];
|
||||
cell.prizeModel = [self.prizeItemList objectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)boxButtonAction:(UIButton *)sender {
|
||||
sender.selected = !sender.selected;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPrizeItemList:(NSArray<RoomSailingPrizeModel *> *)prizeItemList {
|
||||
_prizeItemList = prizeItemList;
|
||||
[self.collectionView reloadData];
|
||||
if (_prizeItemList.count == 1) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_one"];
|
||||
} else {
|
||||
if (_prizeItemList.count > 5) {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_one"];
|
||||
} else {
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_sailing_prize_more"];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 21, 0, 21);
|
||||
layout.itemSize = CGSizeMake(42, 47 + 21);
|
||||
layout.minimumLineSpacing = 7;
|
||||
layout.minimumInteritemSpacing = 7;
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPSailingPrizeCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPSailingPrizeCollectionViewCell class])];
|
||||
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
- (UIStackView *)tipsStackView {
|
||||
if (!_tipsStackView) {
|
||||
_tipsStackView = [[UIStackView alloc] init];
|
||||
_tipsStackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_tipsStackView.distribution = UIStackViewDistributionFill;
|
||||
_tipsStackView.alignment = UIStackViewAlignmentFill;
|
||||
_tipsStackView.spacing = 5;
|
||||
}
|
||||
return _tipsStackView;
|
||||
}
|
||||
|
||||
- (UIButton *)boxButton {
|
||||
if (!_boxButton) {
|
||||
_boxButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_boxButton setImage:[UIImage imageNamed:@"room_sailing_tips_normal"] forState:UIControlStateNormal];
|
||||
[_boxButton setImage:[UIImage imageNamed:@"room_sailing_tips_select"] forState:UIControlStateSelected];
|
||||
[_boxButton addTarget:self action:@selector(boxButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _boxButton;
|
||||
}
|
||||
|
||||
- (UILabel *)tipLabel {
|
||||
if (!_tipLabel) {
|
||||
_tipLabel = [[UILabel alloc] init];
|
||||
_tipLabel.font = [UIFont systemFontOfSize:10];
|
||||
_tipLabel.textColor = UIColorFromRGB(0xE9C57B);
|
||||
_tipLabel.text = @"下次不用提示";
|
||||
}
|
||||
return _tipLabel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -127,6 +127,7 @@
|
||||
if (cell == nil) {
|
||||
cell = [[XPSailingRankTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPSailingRankTableViewCell class])];
|
||||
}
|
||||
cell.rankInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
XPSailingEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPSailingEmptyTableViewCell class])];
|
||||
|
@@ -21,6 +21,7 @@
|
||||
///View
|
||||
#import "XPSailingRankView.h"
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPSailingPrizeView.h"
|
||||
///P
|
||||
#import "XPSailingPresenter.h"
|
||||
#import "XPSailingProtocol.h"
|
||||
@@ -59,6 +60,8 @@
|
||||
@property (nonatomic,strong) RoomSailingInfoModel *sailingInfo;
|
||||
///房主的uid
|
||||
@property (nonatomic,strong) NSString *roomUid;
|
||||
///
|
||||
@property (nonatomic,strong) NSArray<NSString *> *levelArray;
|
||||
@end
|
||||
|
||||
@implementation XPSailingViewController
|
||||
@@ -81,13 +84,15 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self.presenter getSailingInfo];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.exploreCount = 1;
|
||||
self.levelArray = @[@"1", @"10", @"50", @"100"];
|
||||
self.exploreCount = 0;
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.topView];
|
||||
[self.view addSubview:self.backImageView];
|
||||
@@ -197,6 +202,17 @@
|
||||
NSString * fuleStr = [NSString stringWithFormat:@"%ld", self.sailingInfo.keyNum];
|
||||
[self.fuleButton setTitle:fuleStr forState:UIControlStateNormal];
|
||||
self.exploreButton.userInteractionEnabled = YES;
|
||||
if (model.prizeItemList.count > 0) {
|
||||
CGFloat height = 180;
|
||||
if (model.prizeItemList.count> 5) {
|
||||
height = height + 70 + 10;
|
||||
}
|
||||
XPSailingPrizeView * prizeView = [[XPSailingPrizeView alloc] initWithFrame:CGRectMake(0, 0, 283, height)];
|
||||
prizeView.prizeItemList = model.prizeItemList;
|
||||
[TTPopup popupView:prizeView style:TTPopupStyleAlert];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)openSailingFail:(NSString *)message {
|
||||
@@ -216,29 +232,36 @@
|
||||
- (void)getFuleButtonAction:(UIButton *)sender {
|
||||
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
|
||||
webView.url = URLWithType(kSailingActivityURL);
|
||||
webView.isSailing = YES;
|
||||
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
|
||||
}
|
||||
|
||||
- (void)recordButtonAction:(UIButton *)sender {
|
||||
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
|
||||
webView.url = URLWithType(kSailingRecordURL);
|
||||
webView.isSailing = YES;
|
||||
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
|
||||
}
|
||||
|
||||
- (void)descriptionButtonAction:(UIButton *)sender {
|
||||
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
|
||||
webView.isSailing = YES;
|
||||
webView.url = URLWithType(kSailingPlayDescdURL);
|
||||
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
|
||||
}
|
||||
|
||||
- (void)addButtonAction:(UIButton *)sender {
|
||||
self.exploreCount ++;
|
||||
self.textField.text= [NSString stringWithFormat:@"%ld", self.exploreCount];
|
||||
if (self.exploreCount >= self.levelArray.count) {
|
||||
self.exploreCount = 3;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reduButtonAction:(UIButton *)sender {
|
||||
self.exploreCount --;
|
||||
self.textField.text= [NSString stringWithFormat:@"%ld", self.exploreCount];
|
||||
if (self.exploreCount <= 0) {
|
||||
self.exploreCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)exploreButtonAction:(UIButton *)sender {
|
||||
@@ -255,24 +278,11 @@
|
||||
}];
|
||||
} else {
|
||||
NSString * roomUid = [NSString stringWithFormat:@""];
|
||||
[self.presenter openSailing:roomUid sendMessage:YES keyNum:self.exploreCount];
|
||||
[self.presenter openSailing:roomUid sendMessage:YES keyNum:self.textField.text.integerValue];
|
||||
self.exploreButton.userInteractionEnabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)textFiledDidChange:(UITextField *)textFiled {
|
||||
if (textFiled.text.integerValue <= 0) {
|
||||
textFiled.text = @"1";
|
||||
self.exploreCount = 1;
|
||||
}
|
||||
|
||||
if (textFiled.text.integerValue > 200) {
|
||||
textFiled.text = @"200";
|
||||
self.exploreCount = 200;
|
||||
[self showErrorToast:@"一次性最多只能探索200次"];
|
||||
}
|
||||
self.exploreCount = textFiled.text.integerValue;
|
||||
}
|
||||
|
||||
#pragma mark - NIMSystemNotificationManagerDelegate
|
||||
- (void)onReceiveCustomSystemNotification:(NIMCustomSystemNotification *)notification {
|
||||
@@ -289,17 +299,18 @@
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setExploreCount:(NSInteger)exploreCount {
|
||||
_exploreCount = exploreCount;
|
||||
if (_exploreCount == 1) {
|
||||
if (_exploreCount == 0) {
|
||||
self.reduButton.enabled = NO;
|
||||
} else {
|
||||
self.reduButton.enabled = YES;
|
||||
}
|
||||
|
||||
if (_exploreCount == 200) {
|
||||
if (_exploreCount == 3) {
|
||||
self.addButton.enabled = NO;
|
||||
} else {
|
||||
self.addButton.enabled = YES;
|
||||
}
|
||||
self.textField.text = [self.levelArray objectAtIndex:_exploreCount];
|
||||
}
|
||||
|
||||
- (UIView *)topView {
|
||||
@@ -405,9 +416,8 @@
|
||||
_textField.layer.masksToBounds = YES;
|
||||
_textField.layer.cornerRadius = 11;
|
||||
_textField.text = @"1";
|
||||
_textField.enabled = NO;
|
||||
_textField.textAlignment = NSTextAlignmentCenter;
|
||||
[_textField addTarget:self action:@selector(textFiledDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
}
|
||||
return _textField;
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPWebViewController : BaseViewController
|
||||
|
||||
@property (strong, nonatomic,readonly) WKWebView *webview;
|
||||
//TODO: 先这样传进来 等修改了保存房间信息的manager 之后在修改
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
|
||||
|