This commit is contained in:
lianxiang
2018-10-18 17:02:29 +08:00
parent 94ce6d3e14
commit 52222aa995
16 changed files with 103 additions and 75 deletions
+19 -17
View File
@@ -192,6 +192,9 @@
// NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
NSString *wechatCode = [GiGaUserDefault getWeiXinCode];
if (wechatCode==nil) {
wechatCode = @"";
}
NSDictionary *params = nil;
params = @{
@"mobile":self.acountTextField.text,
@@ -313,44 +316,43 @@
if ([responseDict[@"code"] integerValue] == 0) {
[self userloginSussecess:responseDict];
}else if([responseDict[@"code"] integerValue] == 500){
//登录流程待定
//[self.view makeToast:responseDict[@"msg"] duration:2.0 position:CSToastPositionCenter];
[self jxt_showAlertWithTitle:@"温馨提示" message:responseDict[@"msg"] appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionCancelTitle(@"知道了");
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
}];
}else{
[self.view makeToast:responseDict[@"msg"] duration:2.0 position:CSToastPositionCenter];
}
}else{
[self.view makeToast:@"用户信息提交异常"];
GILog(@"上传微信用户信息error:\n%@",error.localizedDescription);
}
}];
}
//请求用户数据
-(void)userloginSussecess:(NSDictionary *)resDic{
//token 登陆标志
[GiGaUserDefault saveToken:resDic[@"token"]];
//埋点
[MobClick endEvent:MobClick_UserLogin];
GIGA_WIndowTost(@"登录成功!");
//请求用户数据
weakify(self);
[[GiGaUserManager shareUser] synsisUserInfo:^(GiGaUser *user) {
GILog(@"user.userId:%@",user.userId);
//埋点
[MobClick endEvent:MobClick_UserLogin];
GIGA_WIndowTost(@"登录成功!");
NC_POST_NAME_OBJECT(kUserLoginSuccessNoti, nil);
[weakSelf dismissViewControllerAnimated:YES completion:nil];
} userErrorMsgBlock:^(NSDictionary *errorCodemsg) {
if (errorCodemsg) {
NSString *msg = errorCodemsg[@"msg"];
if (msg) {
GIGA_ShowToast(msg);
}
}
}];
[self dismissViewControllerAnimated:YES completion:nil];
}
//接收注册成功通知
@@ -108,7 +108,9 @@
cell.minuteLab.text = [NSString stringWithFormat:@"%@min",self.model.minute];
cell.timeLable.text = [NSString stringWithFormat:@"这是您敷面膜的第:%@张",self.model.monthMaskNum];
if (self.model.productImgUrl && ![self.model.productImgUrl isKindOfClass:[NSNull class]]) {
[cell.holdImagView sd_setImageWithURL:[NSURL URLWithString:self.model.productImgUrl]];
//[cell.holdImagView sd_setImageWithURL:[NSURL URLWithString:self.model.productImgUrl]];
[cell.holdImagView sd_setImageWithURL:[NSURL URLWithString:self.model.productImgUrl] placeholderImage:[UIImage imageNamed:@"img_product"]];
}
}
@@ -257,7 +257,7 @@
[self setUpNav];
[self initUI];
[self addNotify];
//[self creatBackGroundMusic];
[self creatBackGroundMusic];
[self creatMaskTimeSatrtMusic];
}
@@ -266,7 +266,7 @@
-(void)maskupSwipeGesture{
[self animaMask];
}
#pragma mark 点击手势结束面膜时间
#pragma mark 点击手势面膜时间
-(void)maskTapAction{
[self animaMask];
}
@@ -284,18 +284,17 @@
} actionsBlock:^(NSInteger buttonIndex, UIAlertAction * _Nonnull action, JXTAlertController * _Nonnull alertSelf) {
if (buttonIndex == 1) {
[self.cicleProgressView stop];
//手动结束时结束peding通知
[[GiGaLocalNotificationManager localNotifiationCenter] cancelAllLocalNoitification];
[self maskTimeEnd];
}
}];
}
#pragma mark - 开始面膜时间动画 合并
-(void)animaMask{
self.swipeGaurdimagView.hidden = YES;
self.startMaskButton.hidden = YES;
[self.view layoutIfNeeded];
@@ -506,7 +505,7 @@
}
delegate.isMasking = YES;
[_startMaskMusic play];
//[_musicPalyer play];
[_musicPalyer play];
// [self setBackGroundPlayingInfo];//锁屏音频信息
//总时间隔 s
@@ -568,13 +567,12 @@
//面膜时间结束时设置 全局变量 不再发送本地通知 提醒
AppDelegate *delegate =(AppDelegate *) [[UIApplication sharedApplication] delegate];
delegate.isMasking = NO;
//[_musicPalyer stop];
[_musicPalyer stop];
//震动 需用户手动开启震动模式
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
//复原动画
[self endMaskAnimation];
}
#pragma mark 开始测试
@@ -744,8 +742,11 @@
-(void)refreshUserIcon:(NSString *)imageUrl{
NSURL *url = [NSURL URLWithString:imageUrl];
[self.rightNavUserBtn sd_setImageWithURL:url forState:UIControlStateNormal];
// [self.rightNavUserBtn sd_setImageWithURL:url forState:UIControlStateNormal];
[self.rightNavUserBtn sd_setImageWithURL:url forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"nav_circle_avatar"] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
}];
}
#pragma mark 消息 action
@@ -870,8 +871,10 @@
BOOL isUserLogin = [GiGaUserDefault isUserLogin];
if (isUserLogin) {
NSTimeInterval timeInterVal = [GiGaUserDefault getUserMaskeTime];
NSString *minute = [NSString stringWithFormat:@"%.f",timeInterVal /60];
NSString *minute = [NSString stringWithFormat:@"%.1f",timeInterVal / 60];
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:KApiBeginMaskTime method:RequestPostMethod parms:@{@"minute":minute}];
[api requstDataWithResult:^(GiGaAPIResult *result) {
if (result.success) {
@@ -141,8 +141,7 @@
}
}
return cell;
}
else if (indexPath.row == 2){
}else if (indexPath.row == 2){
MaskShareBoootomViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MaskShareBoootomViewCell"];
if (!cell) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"MaskShareBoootomViewCell" owner:self options:nil] lastObject];
@@ -403,7 +402,9 @@
}
}
return _viewControllers;
}
@end
@@ -25,7 +25,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OSF-Gb-h1M">
<rect key="frame" x="6" y="12" width="329" height="217"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="bg_logo" translatesAutoresizingMaskIntoConstraints="NO" id="iJy-9p-48y">
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="img_product" translatesAutoresizingMaskIntoConstraints="NO" id="iJy-9p-48y">
<rect key="frame" x="8" y="8" width="313" height="175"/>
<constraints>
<constraint firstAttribute="height" constant="175" id="0Jj-uy-CDT"/>
@@ -107,7 +107,7 @@
</tableViewCell>
</objects>
<resources>
<image name="bg_logo" width="88" height="88"/>
<image name="img_product" width="164" height="121"/>
<image name="masktie_clock" width="20" height="19"/>
</resources>
</document>
@@ -18,8 +18,8 @@
@interface GiMaskTimeHistoryVC ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong) NSMutableArray *dataArr;
@property(nonatomic) NSUInteger currentPage;
@property(nonatomic,assign) NSInteger totalMinute;
@property(nonatomic) int currentPage;
@property(nonatomic,copy) NSString *totalMinute;
@property(nonatomic,assign) NSInteger ranking;
@property(nonatomic,assign) NSUInteger totalPage;
//@property(nonatomic,strong) MaskHistryRecordlist *record;
@@ -35,7 +35,7 @@
[super viewDidLoad];
self.dataArr = [[NSMutableArray alloc] init];
_currentPage = 1;
_totalMinute = 0;
_totalMinute = @"0.0";
_ranking = 0;
_isFreshing = NO;
[self addNavTitile:@"历史记录"];
@@ -53,7 +53,7 @@
self.tableView.rowHeight = UITableViewAutomaticDimension;
[self creatRefreshView];
[self loadDataWtih:[NSString stringWithFormat:@"%ld",_currentPage] isFresh:YES];
[self loadDataWtih:[NSString stringWithFormat:@"%d",_currentPage] isFresh:YES];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
@@ -84,7 +84,7 @@
}
cell.timeLabe.text = [NSString stringWithFormat:@"%ld",(long)self.totalMinute];
cell.timeLabe.text = [NSString stringWithFormat:@"%@",self.totalMinute];
if (self.exquisitePercent) {
NSString *text = [NSString stringWithFormat:@"本月超过%@用户",self.exquisitePercent];
@@ -111,7 +111,6 @@
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (section == 0) {
return 1;
@@ -154,7 +153,7 @@
NSDictionary *reDic =result.dic;
self.ranking = [[reDic valueForKey:@"ranking"] integerValue];
self.totalMinute = [[reDic valueForKey:@"totalMinute"] integerValue] ;
self.totalMinute = [reDic valueForKey:@"totalMinute"];
self.exquisitePercent = [reDic valueForKey:@"exquisitePercent"];
self.guizeUrl = [reDic valueForKey:@"ruleUrl"];
@@ -220,10 +219,9 @@
return;
}
if (_currentPage < _totalPage) {
_currentPage ++;
[self loadDataWtih:[NSString stringWithFormat:@"%ld",self.currentPage] isFresh:NO];
[self loadDataWtih:[NSString stringWithFormat:@"%d",self.currentPage] isFresh:NO];
}
}
+2 -1
View File
@@ -31,6 +31,7 @@
@property(nonatomic,assign) int sexCode;
@property(nonatomic,copy) NSString *sexName;
@property(nonatomic,copy) NSString *weixin;
@property(nonatomic) int minute;
@property(nonatomic) float minute;
@end