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

View File

@ -2,22 +2,4 @@
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GIGA/Modules/Mask/Controller/GIGaMaskShareViewController.m"
timestampString = "561021149.454651"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "224"
endingLineNumber = "224"
landmarkName = "-viewControllers"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -51,8 +51,24 @@
[GiGaBaseAPiRequest userTokenTimeOutGologinFromVC:self.window.rootViewController];
}
}];
}else{
// 
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:kUserDefaultMaskTime method:RequestPostMethod parms:nil];
[api requstDataWithResult:^(GiGaAPIResult *result) {
if (result.success) {
float minute = [result.dic[@"minute"] floatValue];
if (minute !=0) {
[GiGaUserDefault savaMaskeTime:minute*60];
}
}
}];
}
//
if ([[UIApplication sharedApplication] backgroundRefreshStatus] != UIBackgroundRefreshStatusAvailable ) {
[self.window.rootViewController jxt_showAlertWithTitle:@"温馨提示" message:@"为保证您正常使用面膜时间,需要您开启后台刷新,请在 设置->面膜时间->应用程序后台刷新 开启" appearanceProcess:^(JXTAlertController * _Nonnull alertMaker) {
alertMaker.addActionCancelTitle(@"下次");
@ -128,9 +144,9 @@
// [[GiGaLocalNotificationManager localNotifiationCenter] sendLocalNotification:@"闹钟提醒!" fireTimeInterval:2 alertAction:@"面膜时间已添加闹钟提醒!" withIdentifier:kLOCALNotifiID_APPTERMINAL];
//
[[GiGaLocalNotificationManager localNotifiationCenter] cancelAllLocalNoitification];
// [[GiGaLocalNotificationManager localNotifiationCenter] cancelAllLocalNoitification];
}
//[[GiGaLocalNotificationManager localNotifiationCenter] cancelAllLocalNoitification];
[[GiGaLocalNotificationManager localNotifiationCenter] cancelAllLocalNoitification];
}
-(void)remoteControlReceivedWithEvent:(UIEvent *)event

View File

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_product@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -18,7 +18,7 @@ NSString *const kGiGaToken = @"GiGatoken";
NSString *const kMaskeTime= @"userMaskeTime";
NSString *const kWeiXinCodeInfo = @"WeiXinCodeinfo";
NSString *const kShowUserTested = @"kShowUserTested";
#define MASKTIME_DEFAULT 20;
#define MASKTIME_DEFAULT 17.5;
@implementation GiGaUserDefault
@ -145,13 +145,12 @@ NSString *const kShowUserTested = @"kShowUserTested";
NSTimeInterval time = [UD_STADARDUD doubleForKey:kMaskeTime];
if (time == 0) {
//17.5
//17.5
time = 17.5 * 60;
//time = MASKTIME_DEFAULT;
}
//time = 5;
//time = 10;
return time;
}
+(void)saveUserTestFlag:(BOOL)tested{

View File

@ -69,7 +69,7 @@ const static NSInteger GIGADB_USER_VER = 0;//当前数据库版本号
}else{
if (errorCodeMsg) {
errorCodeMsg(requst.resultDict);
errorCodeMsg(result.dic);
}
}

View File

@ -73,5 +73,8 @@
//正式
#define kIMPRITNT @"http://app.mianmoshijian.com/imprint.html?device=ios"
//获取默认面膜时间
#define kUserDefaultMaskTime @"activity/maskuselog/v1/minute"
#endif /* ApiRequestConfig_h */

View File

@ -19,13 +19,14 @@
case 0://
{
[[NSUserDefaults standardUserDefaults] setValue:@"http://apiyts.s1.natapp.cc/v1/" forKey:@"MainUrl"];
[[NSUserDefaults standardUserDefaults] setValue:@"http://wsyts.s1.natapp.cc" forKey:@"gigasocketUrl"];
// [[NSUserDefaults standardUserDefaults] setValue:@"https://api.mianmoshijian.com/v1/" forKey:@"MainUrl"];
// [[NSUserDefaults standardUserDefaults] setValue:@"https://ws.mianmoshijian.com" forKey:@"gigasocketUrl"];
//
// [[NSUserDefaults standardUserDefaults] setValue:@"http://apiyts.s1.natapp.cc/v1/" forKey:@"MainUrl"];
// [[NSUserDefaults standardUserDefaults] setValue:@"http://wsyts.s1.natapp.cc" forKey:@"gigasocketUrl"];
[[NSUserDefaults standardUserDefaults] setValue:@"https://api.mianmoshijian.com/v1/" forKey:@"MainUrl"];
[[NSUserDefaults standardUserDefaults] setValue:@"https://ws.mianmoshijian.com" forKey:@"gigasocketUrl"];
}
break;
case 1: //
{
//https://api.mianmoshijian.com/v1/
@ -34,7 +35,6 @@
}
break;
default:
break;
}

View File

@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.6.3</string>
<string>1.6.5</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>

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];
}
//

View File

@ -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"]];
}
}

View File

@ -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) {

View File

@ -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

View File

@ -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>

View File

@ -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];
}
}

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