Commit 8351c338370aefe52cf9a96c2c9321414acef574
1 parent
02236c18
百度小程序免责声明
Showing
3 changed files
with
67 additions
and
13 deletions
CNLiveCServiceModule/Assets/CNServiceBundle.bundle/serviceNote.txt
0 → 100644
| 1 | +1、 您理解并同意:为向您提供更加完善的服务,网家家APP平台特引入百度智能小程序,该小程序的开发运营者明确了解并同意,关于百度智能小程序服务网家家APP平台不提供任何种类的明示或暗示担保或条件,包括但不限于商业适售性、特定用途适用性等,开发者对本服务信息内容数据资料及其运营行为等方面的真实性、合法性及有效性承担全部责任。为此,您对通过网家家APP平台使用百度智能小程序的行为必须自行承担相应风险,您在使用百度智能小程序时与其产生的纠纷,应自行向该小程序的开发运营者或百度主张权利,与网家家APP平台无关。 2、 鉴于网络服务的特殊性,网家家APP平台的实际经营管理者有权在无需通知您的情况下根据网家家APP平台的整体运营情况或相关运营规范、规则等,可以随时变更、中止或终止部分或全部的服务,若由此给您造成损失的,您同意放弃追究网家家APP凭条及其实际经营管理者的责任。 3、 您理解并同意:为了向您提供更完善的服务,网家家APP平台的实际经营管理者有权定期或不定期地对提供本服务的平台或相关设备进行检修、维护、升级等,此类情况可能会造成相关服务在合理时间内中断或暂停的,若由此给您造成损失的,您同意放弃追究网家家APP平台及其实际经营管理者的责任。 4、 您理解并同意:网家家APP平台的服务是按照现有技术和条件所能达到的现状提供的。网家家APP平台会尽最大努力向您提供服务,确保服务的连贯性和安全性;但网家家APP平台及其实际经营管理者不能保证其所提供的服务毫无瑕疵,也无法随时预见和防范法律、技术以及其他风险,包括但不限于不可抗力、病毒、木马、黑客攻击、系统不稳定、第三方平台或小程序瑕疵、政府行为等原因可能导致的服务中断、数据丢失以及其他的损失和风险。所以您也同意:即使网家家APP平台提供的服务存在瑕疵,但上述瑕疵是当时行业技术水平所无法避免的,其将不被视为网家家APP平台及其实际经营管理者违约,同时,由此给您造成的数据或信息丢失等损失的,您同意放弃追究网家家APP平台及其实际经营管理者的责任。 5、 您理解并同意:在使用本服务的过程中,可能会遇到不可抗力等风险因素,使本服务发生中断。不可抗力是指不能预见、不能克服并不能避免且对一方或双方造成重大影响的客观事件,包括但不限于自然灾害如洪水、地震、瘟疫流行和风暴等以及社会事件如战争、动乱、政府行为等。出现上述情况时,网家家APP平台将努力在第一时间与相关单位配合,及时进行修复,若由此给您造成损失的,您同意放弃追究网家家APP平台及其实际经营管理者的责任。 6、 您理解并同意:若由于对以下情形导致的服务中断或受阻,给您造成损失的,您同意放弃追究网家家APP平台及其实际经营管理者的责任: (1)受到计算机病毒、木马或其他恶意程序、黑客攻击的破坏; (2)您或网家家APP平台及其实际经营管理者的电脑软件、系统、硬件和通信线路出现故障; (3)您操作不当; (4)您通过非网家家APP平台授权的方式使用本服务; (5)其他网家家APP平台及其实际经营管理者无法控制或合理预见的情形。 | ||
| 0 | \ No newline at end of file | 2 | \ No newline at end of file |
CNLiveCServiceModule/Classes/Manager/CNLiveCServiceManagerBridge.m
| @@ -33,8 +33,20 @@ static NSString *NeverShowTip = @"NeverShowTip"; | @@ -33,8 +33,20 @@ static NSString *NeverShowTip = @"NeverShowTip"; | ||
| 33 | 33 | ||
| 34 | + (void)jumpServiceController:(NSString *)serviceId type:(NSString *)type to:(NSString *)to shopType:(NSString *)shopType controller:(UIViewController *)controller | 34 | + (void)jumpServiceController:(NSString *)serviceId type:(NSString *)type to:(NSString *)to shopType:(NSString *)shopType controller:(UIViewController *)controller |
| 35 | { | 35 | { |
| 36 | + NSDate *beginDate = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithFormat:@"%@_%@",CNUserShareModelUid,serviceId]]; | ||
| 37 | + if ([type isEqualToString:@"104"] && ![[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"%@_%@_%@",NeverShowTip,CNUserShareModelUid,serviceId]] && (!beginDate || [CNLiveCServiceManagerBridge prepareBeginTime:beginDate andNowTime:[NSDate date]])) { | ||
| 38 | + [CNLiveAlertTipView showTipsInViewSureBlock:^(BOOL neverShow) { | ||
| 39 | + [[NSUserDefaults standardUserDefaults] setBool:neverShow forKey:[NSString stringWithFormat:@"%@_%@_%@",NeverShowTip,CNUserShareModelUid,serviceId]]; | ||
| 40 | + if (!neverShow) { | ||
| 41 | + [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:[NSString stringWithFormat:@"%@_%@",CNUserShareModelUid,serviceId]]; | ||
| 42 | + } | ||
| 43 | + [CNLiveServicePresent usedServiceWithServingId:serviceId]; | ||
| 44 | + [CNLiveCServiceManagerBridge jumpServiceType:CNCServiceJumpTypeService service:serviceId type:type to:to shopType:shopType controller:controller]; | ||
| 45 | + }]; | ||
| 46 | + }else{ | ||
| 36 | [CNLiveServicePresent usedServiceWithServingId:serviceId]; | 47 | [CNLiveServicePresent usedServiceWithServingId:serviceId]; |
| 37 | [CNLiveCServiceManagerBridge jumpServiceType:CNCServiceJumpTypeService service:serviceId type:type to:to shopType:shopType controller:controller]; | 48 | [CNLiveCServiceManagerBridge jumpServiceType:CNCServiceJumpTypeService service:serviceId type:type to:to shopType:shopType controller:controller]; |
| 49 | + } | ||
| 38 | } | 50 | } |
| 39 | + (void)jumpServiceType:(CNCServiceJumpType)jumpType service:(NSString *)serviceId type:(NSString *)type to:(NSString *)to shopType:(NSString *)shopType controller:(UIViewController *)controller{ | 51 | + (void)jumpServiceType:(CNCServiceJumpType)jumpType service:(NSString *)serviceId type:(NSString *)type to:(NSString *)to shopType:(NSString *)shopType controller:(UIViewController *)controller{ |
| 40 | NSDictionary *param = @{ | 52 | NSDictionary *param = @{ |
| @@ -67,4 +79,30 @@ static NSString *NeverShowTip = @"NeverShowTip"; | @@ -67,4 +79,30 @@ static NSString *NeverShowTip = @"NeverShowTip"; | ||
| 67 | return nil; | 79 | return nil; |
| 68 | } | 80 | } |
| 69 | 81 | ||
| 82 | ++ (BOOL)prepareBeginTime:(NSDate *)beginDate andNowTime:(NSDate *)nowDate | ||
| 83 | +{ | ||
| 84 | + | ||
| 85 | + //利用NSCalendar比较日期的差异 | ||
| 86 | + NSCalendar *calendar = [NSCalendar currentCalendar]; | ||
| 87 | + /** | ||
| 88 | + * 要比较的时间单位,常用如下,可以同时传: | ||
| 89 | + * NSCalendarUnitDay : 天 | ||
| 90 | + * NSCalendarUnitYear : 年 | ||
| 91 | + * NSCalendarUnitMonth : 月 | ||
| 92 | + * NSCalendarUnitHour : 时 | ||
| 93 | + * NSCalendarUnitMinute : 分 | ||
| 94 | + * NSCalendarUnitSecond : 秒 | ||
| 95 | + */ | ||
| 96 | + NSCalendarUnit unit = NSCalendarUnitDay;//只比较天数差异 | ||
| 97 | + //比较的结果是NSDateComponents类对象 | ||
| 98 | + NSDateComponents *delta = [calendar components:unit fromDate:beginDate toDate:nowDate options:0]; | ||
| 99 | + //打印 | ||
| 100 | + NSLog(@"%@",delta); | ||
| 101 | + //获取其中的"天" | ||
| 102 | + NSLog(@"%ld",delta.day); | ||
| 103 | + if (delta.day>=30) { | ||
| 104 | + return YES; | ||
| 105 | + } | ||
| 106 | + return NO; | ||
| 107 | +} | ||
| 70 | @end | 108 | @end |
CNLiveCServiceModule/Classes/View/CNLiveAlertTipView.m
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | @interface CNLiveAlertTipView() | 10 | @interface CNLiveAlertTipView() |
| 11 | @property (nonatomic, strong)UILabel *titleLabel; | 11 | @property (nonatomic, strong)UILabel *titleLabel; |
| 12 | -@property (nonatomic, strong)UILabel *messageLabel; | 12 | +@property (nonatomic, strong)UITextView *messageLabel; |
| 13 | @property (nonatomic, strong)UIButton *cancelBtn; | 13 | @property (nonatomic, strong)UIButton *cancelBtn; |
| 14 | @property (nonatomic, strong)UIButton *sureBtn; | 14 | @property (nonatomic, strong)UIButton *sureBtn; |
| 15 | @property (nonatomic, strong)UIButton *notShowBtn; | 15 | @property (nonatomic, strong)UIButton *notShowBtn; |
| @@ -33,14 +33,8 @@ | @@ -33,14 +33,8 @@ | ||
| 33 | make.top.equalTo(tipView).offset(25); | 33 | make.top.equalTo(tipView).offset(25); |
| 34 | make.centerX.mas_equalTo(tipView); | 34 | make.centerX.mas_equalTo(tipView); |
| 35 | }]; | 35 | }]; |
| 36 | - tipView.messageLabel.text = @"1、每人每天有5次投票机会,在网家家APP内参与该活动最多可投5票。在微信、QQ等平台参与该活动最多可投3票;投票机会0点重置。\n\n2、本活动禁止刷票,凡是通过非正常手段刷票获取票数的行为,系统检测到并核实后将取消参赛资格。凡是通过非正常手段刷票获取票数的行为,系统检测到并核实后将取消参赛资。"; | ||
| 37 | - [tipView.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 38 | - make.top.equalTo(tipView.titleLabel.mas_bottom); | ||
| 39 | - make.width.offset(255); | ||
| 40 | - make.height.offset(185); | ||
| 41 | - make.centerX.mas_equalTo(tipView); | ||
| 42 | - }]; | ||
| 43 | - | 36 | + |
| 37 | + | ||
| 44 | [tipView.cancelBtn setTitle:@"拒绝" forState:UIControlStateNormal]; | 38 | [tipView.cancelBtn setTitle:@"拒绝" forState:UIControlStateNormal]; |
| 45 | [tipView.sureBtn setTitle:@"接受" forState:UIControlStateNormal]; | 39 | [tipView.sureBtn setTitle:@"接受" forState:UIControlStateNormal]; |
| 46 | [tipView.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) { | 40 | [tipView.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) { |
| @@ -61,6 +55,15 @@ | @@ -61,6 +55,15 @@ | ||
| 61 | make.height.offset(20); | 55 | make.height.offset(20); |
| 62 | make.left.equalTo(tipView).offset(15); | 56 | make.left.equalTo(tipView).offset(15); |
| 63 | }]; | 57 | }]; |
| 58 | + | ||
| 59 | + tipView.messageLabel.text = [CNLiveAlertTipView noteFileTxt]; | ||
| 60 | + [tipView.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) { | ||
| 61 | + make.top.equalTo(tipView.titleLabel.mas_bottom); | ||
| 62 | + make.width.offset(255); | ||
| 63 | + make.bottom.equalTo(tipView.notShowBtn.mas_top).offset(-25); | ||
| 64 | + make.centerX.mas_equalTo(tipView); | ||
| 65 | + }]; | ||
| 66 | + | ||
| 64 | QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init]; | 67 | QMUIModalPresentationViewController *modalViewController = [[QMUIModalPresentationViewController alloc] init]; |
| 65 | modalViewController.contentView = tipView; | 68 | modalViewController.contentView = tipView; |
| 66 | modalViewController.modal = YES; | 69 | modalViewController.modal = YES; |
| @@ -93,14 +96,12 @@ | @@ -93,14 +96,12 @@ | ||
| 93 | } | 96 | } |
| 94 | return _titleLabel; | 97 | return _titleLabel; |
| 95 | } | 98 | } |
| 96 | --(UILabel *)messageLabel | 99 | +-(UITextView *)messageLabel |
| 97 | { | 100 | { |
| 98 | if (!_messageLabel) { | 101 | if (!_messageLabel) { |
| 99 | - _messageLabel = [[UILabel alloc] init]; | ||
| 100 | - _messageLabel.textAlignment = NSTextAlignmentCenter; | 102 | + _messageLabel = [[UITextView alloc] init]; |
| 101 | _messageLabel.textColor = CNLiveColorWithHexString(@"#333333"); | 103 | _messageLabel.textColor = CNLiveColorWithHexString(@"#333333"); |
| 102 | _messageLabel.font = UIFontMake(13); | 104 | _messageLabel.font = UIFontMake(13); |
| 103 | - _messageLabel.numberOfLines = 0; | ||
| 104 | } | 105 | } |
| 105 | return _messageLabel; | 106 | return _messageLabel; |
| 106 | } | 107 | } |
| @@ -144,4 +145,18 @@ | @@ -144,4 +145,18 @@ | ||
| 144 | } | 145 | } |
| 145 | return _notShowBtn; | 146 | return _notShowBtn; |
| 146 | } | 147 | } |
| 148 | + | ||
| 149 | ++ (NSString *) noteFileTxt{ | ||
| 150 | + NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(@"CNLiveServiceVC")]; | ||
| 151 | + NSURL *url = [bundle URLForResource:@"CNServiceBundle" withExtension:@"bundle"]; | ||
| 152 | + NSBundle *targetBundle = [NSBundle bundleWithURL:url]; | ||
| 153 | + NSString *path = [targetBundle pathForResource:@"serviceNote" ofType:@"txt"]; | ||
| 154 | + | ||
| 155 | + NSData *data = [NSData dataWithContentsOfFile:path]; | ||
| 156 | + NSString * chapterContent = @""; | ||
| 157 | + BOOL lossy = NO; | ||
| 158 | + NSStringEncoding string = [NSString stringEncodingForData:data encodingOptions:NULL convertedString:&chapterContent usedLossyConversion:&lossy]; | ||
| 159 | + NSLog(@"%ld",string); | ||
| 160 | + return chapterContent; | ||
| 161 | +} | ||
| 147 | @end | 162 | @end |