add weixinapi
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#import "LXCountTimer.h"
|
||||
#import "GiGaHelper.h"
|
||||
#import <MediaPlayer/MediaPlayer.h>
|
||||
#import "GiGaMeViewController.h"
|
||||
|
||||
@interface GiGaMaskTaskViewController ()
|
||||
{
|
||||
@@ -56,7 +57,7 @@
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self startMaskTime];
|
||||
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
@@ -139,14 +140,15 @@
|
||||
-(void)startMaskTime{
|
||||
|
||||
AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate];
|
||||
if (delegate.isMasking) {
|
||||
return;
|
||||
}
|
||||
delegate.isMasking = YES;
|
||||
[_musicPalyer play];
|
||||
|
||||
[self setBackGroundPlayingInfo];//锁屏音频信息
|
||||
|
||||
//总时间隔 s
|
||||
NSTimeInterval timeInterVal = 58;
|
||||
|
||||
NSString *timeformat = [GiGaHelper stringWithNSTimerinterval:timeInterVal];
|
||||
NSArray *timesArr = [timeformat componentsSeparatedByString:@":"];
|
||||
NSString *hour = timesArr[0];
|
||||
@@ -161,8 +163,7 @@
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 设置后台锁屏样式 无效??
|
||||
|
||||
#pragma mark 设置后台锁屏音频信息
|
||||
-(void)setBackGroundPlayingInfo{
|
||||
|
||||
MPMediaItemArtwork *arwork = [[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:@"MaskTime.png"]];
|
||||
@@ -181,6 +182,7 @@
|
||||
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
|
||||
|
||||
}
|
||||
|
||||
- (void) remoteControlReceivedWithEvent: (UIEvent *) receivedEvent {
|
||||
|
||||
if (receivedEvent.type == UIEventTypeRemoteControl) {
|
||||
@@ -216,15 +218,12 @@
|
||||
#pragma mark 开始测试
|
||||
-(void)testBtnAcion:(UIButton *)btn{
|
||||
|
||||
AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate];
|
||||
if (delegate.isMasking) {
|
||||
return;
|
||||
}
|
||||
|
||||
[self startMaskTime];
|
||||
|
||||
return ;
|
||||
|
||||
|
||||
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
|
||||
|
||||
if (isUserLogin) {
|
||||
|
||||
//GIGA_ShowToast(@"userLogin!");
|
||||
@@ -260,7 +259,6 @@
|
||||
|
||||
GiGaAdDetailViewController *detailVC=[[GiGaAdDetailViewController alloc] init];
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 新手引导消失
|
||||
@@ -298,11 +296,13 @@
|
||||
userGuardVC.view.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
|
||||
[self presentViewController:userGuardVC animated:NO completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark App引导页
|
||||
-(void)showAPPappGaurdView{
|
||||
GiGaAppGaurdVC *gaurdVC = [[GiGaAppGaurdVC alloc] init];
|
||||
[self presentViewController:gaurdVC animated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark - setUpNav
|
||||
-(void)setUpNav{
|
||||
|
||||
@@ -320,11 +320,11 @@
|
||||
[rightBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
|
||||
[rightBtn addTarget:self action:@selector(rightBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
|
||||
|
||||
}
|
||||
#pragma mark 消息 action
|
||||
|
||||
#pragma mark 消息 action
|
||||
-(void)leftBtnAction{
|
||||
|
||||
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
|
||||
if (isUserLogin) {
|
||||
|
||||
@@ -342,6 +342,9 @@
|
||||
#pragma mark 个人中心 action
|
||||
-(void)rightBtnAction{
|
||||
|
||||
GiGaMeViewController *meVC= [[GiGaMeViewController alloc] init];
|
||||
[self.navigationController pushViewController:meVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -bottomView
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
-(void)setquestionArray{
|
||||
NSArray *array = @[
|
||||
@{@"questionid" : @"1", @"totalCount" : @"5", @"question" : @"如果昨天是明天的话就好了,这样今天就周五了。真实的今天可能是星期几?", @"questiontype" : @"1", @"questiontype_text" : @"单选题", @"questionselectnumber" : @"3", @"questiondescribe" : @"星期三:理想今天是星期五,昨天是星期四,真实明天是理想的昨天是星期四,真实的今天是星期三。\n星期日:理想今天是星期五,明天是星期六,真实昨天是理想的明天是星期六,真实的今天是星期日。", @"trueanswer" : @"A", @"userAnswer" : @[], @"tkselect" : @[@"A:星期三", @"B:星期四", @"C:星期五"]},
|
||||
@{@"questionid" : @"1", @"totalCount" : @"5", @"question" : @"如果昨天是明天的话就好了,这样今天就周五了。真实的今天可能是星期几?", @"questiontype" : @"1", @"questiontype_text" : @"单选题", @"questionselectnumber" : @"3", @"questiondescribe" : @"星期三:理想今天是星期五,昨天是星期四,真实明天是理想的昨天是星期四,真实的今天是星期三。\n星期日:理想今天是星期五,明天是星期六,真实昨天是理想的明天是星期六,真实的今天是星期日。", @"trueanswer" : @"A", @"userAnswer" : @[], @"tkselect" : @[@"A:星期三星期三星期三星期三星期三星期三星期三", @"B:星期四", @"C:星期五星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三星期三"]},
|
||||
@{@"questionid" : @"2", @"totalCount" : @"5", @"question" : @"这里是问题,这道题的答案是AC。这里是问题,这道题的答案是AC。这里是问题,这道题的答案是AC。", @"questiontype" : @"1", @"questiontype_text" : @"多选题", @"questionselectnumber" : @"5", @"questiondescribe" : @"这里是答案解析,这里可以很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长很长的。", @"trueanswer" : @"AC", @"userAnswer" : @[], @"tkselect" : @[@"A:这个选项是正确的。这个选项是正确的。这个选项是正确的。", @"B:这个选项是错误的。这个选项是错误的。这个选项是错误的。", @"C:这个选项是正确的。这个选项是正确的。这个选项是正确的。", @"D:这个选项是错误的。这个选项是错误的。这个选项是错误的。", @"E:这个选项是错误的。这个选项是错误的。这个选项是错误的。"]},
|
||||
@{@"questionid" : @"3", @"totalCount" : @"5", @"question" : @"以下哪个牌子不是化妆品?", @"questiontype" : @"1", @"questiontype_text" : @"单选题", @"questionselectnumber" : @"3", @"questiondescribe" : @"化妆品,化妆品化妆品化妆品化妆品化妆品化妆品化妆品。", @"trueanswer" : @"A", @"userAnswer" : @[], @"tkselect" : @[@"A:化妆品", @"B:化妆品", @"C:星期五"]},
|
||||
@{@"questionid" : @"4", @"totalCount" : @"5", @"question" : @"如果昨天是明天的话就好了,这样今天就周五了。真实的今天可能是星期几?", @"questiontype" : @"1", @"questiontype_text" : @"单选题", @"questionselectnumber" : @"3", @"questiondescribe" : @"真实昨天是理想的明天是星期六,真实的今天是星期日?", @"trueanswer" : @"A", @"userAnswer" : @[], @"tkselect" : @[@"A:星三", @"B:星", @"C:期"]},
|
||||
@@ -80,9 +80,8 @@
|
||||
|
||||
[self.view layoutIfNeeded];//必加
|
||||
//刷新答案相关数据
|
||||
[_questionView reloadViewWithFrame:CGRectMake(0, CGRectGetMaxY(_questionlabel.frame) + 15, KMainW, 0) style:[_currentModel.questiontype intValue] - 1 answerArray:_currentModel.tkselect userAnswers:_currentModel.userAnswer];
|
||||
|
||||
|
||||
[_questionView reloadViewWithFrame:CGRectMake(30, CGRectGetMaxY(_questionlabel.frame) + 15, KMainW - 30*2, 0) style:[_currentModel.questiontype intValue] - 1 answerArray:_currentModel.tkselect userAnswers:_currentModel.userAnswer];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark 创建控件
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
{
|
||||
if (!_view) {
|
||||
UIView *view = [[UIView alloc] init];
|
||||
//view.backgroundColor = [UIColor blueColor];
|
||||
view.backgroundColor = [UIColor blueColor];
|
||||
[self addSubview:view];
|
||||
_view = view;
|
||||
}
|
||||
@@ -77,13 +77,15 @@
|
||||
NSString *labelText = _answerArr[i];
|
||||
labelText = [labelText stringByReplacingOccurrencesOfString:@"\r" withString:@""];
|
||||
labelText = [labelText stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
|
||||
|
||||
//内容高度
|
||||
CGFloat labelH = [GiGaHelper sizeWithText:labelText font:font maxSize:CGSizeMake(KMainW - 50, MAXFLOAT)].height;
|
||||
//CGFloat labelH = [GiGaHelper sizeWithText:labelText font:font maxSize:CGSizeMake(frame.size.width - btnH - 5, MAXFLOAT)].height;
|
||||
CGFloat labelH = [GiGaHelper getSpaceLabelHeight:labelText withFont:font maxSize:CGSizeMake(frame.size.width - btnH - 5, MAXFLOAT)];
|
||||
|
||||
//选项标签
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(btnH + 5, labelY + 4, KMainW - 50, labelH)];
|
||||
label.text = labelText;
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(btnH + 5, labelY + 4,frame.size.width - btnH - 5, labelH)];
|
||||
[GiGaHelper setLabelSpace:label withValue:labelText withFont:font] ;
|
||||
label.font = font;
|
||||
label.numberOfLines = 0;
|
||||
label.textColor = GIGAUIColorFromRGBA(0x616161);
|
||||
@@ -112,18 +114,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
self.view.frame = CGRectMake(10, 0, KMainW - 20, labelY - padding);
|
||||
self.view.frame = CGRectMake(0,0,frame.size.width, labelY - padding);
|
||||
frame.size.height = labelY - padding;
|
||||
self.frame = frame;
|
||||
|
||||
[self setNeedsUpdateConstraints];
|
||||
[self mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.superview.mas_top).offset(frame.origin.y + 10);
|
||||
make.left.mas_equalTo(self.superview.mas_left).offset(30);
|
||||
make.height.mas_equalTo(frame.size.height);
|
||||
make.width.mas_equalTo(frame.size.width - 30*2);
|
||||
}];
|
||||
|
||||
// [self setNeedsUpdateConstraints];
|
||||
// [self mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
// make.top.mas_equalTo(self.superview.mas_top).offset(frame.origin.y + 10);
|
||||
// make.left.mas_equalTo(self.superview.mas_left).offset(30);
|
||||
// make.height.mas_equalTo(frame.size.height);
|
||||
// make.width.mas_equalTo(frame.size.width - 30*2);
|
||||
// }];
|
||||
}
|
||||
|
||||
- (void)btnOnClick:(UIButton *)btn
|
||||
|
||||
Reference in New Issue
Block a user