Browse Source

1、首页只保留消息通知;2、发现页面新增跳转喜马拉雅H5

master
公司电脑 1 year ago
parent
commit
5c8205a8da
  1. BIN
      tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate
  2. 32
      tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  3. 30
      tongxin/AppDelegate.m
  4. 21
      tongxin/Assets.xcassets/通用/Discover_banner.imageset/Contents.json
  5. BIN
      tongxin/Assets.xcassets/通用/Discover_banner.imageset/Discover_banner@2x.png
  6. 51
      tongxin/Base.lproj/Main.storyboard
  7. 2
      tongxin/Info.plist
  8. 52
      tongxin/VC/Discover/DiscoverViewController.m
  9. 88
      tongxin/VC/Login/ScanCodeViewController.m
  10. 8
      tongxin/VC/WatchHome/NewHomeVC/HomeMsgTableViewCell.m
  11. 2
      tongxin/VC/WatchHome/WatchHomeViewController.m

BIN
tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

32
tongxin.xcworkspace/xcuserdata/ecell.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -254,8 +254,8 @@ @@ -254,8 +254,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "240"
endingLineNumber = "240"
startingLineNumber = "243"
endingLineNumber = "243"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
@ -270,8 +270,8 @@ @@ -270,8 +270,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "218"
endingLineNumber = "218"
startingLineNumber = "221"
endingLineNumber = "221"
landmarkName = "-pushRegistry:didReceiveIncomingPushWithPayload:forType:"
landmarkType = "7">
</BreakpointContent>
@ -494,8 +494,8 @@ @@ -494,8 +494,8 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "154"
endingLineNumber = "154"
startingLineNumber = "157"
endingLineNumber = "157"
landmarkName = "-showRootViewController"
landmarkType = "7">
</BreakpointContent>
@ -574,27 +574,11 @@ @@ -574,27 +574,11 @@
filePath = "tongxin/AppDelegate.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "557"
endingLineNumber = "557"
startingLineNumber = "560"
endingLineNumber = "560"
landmarkName = "-handlePushMsg:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "14940987-4772-4E47-BDB2-C234FF9B9FF8"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "tongxin/VC/WatchHome/SingViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "-GetSignInfo:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

30
tongxin/AppDelegate.m

@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
#import <AMapLocationKit/AMapLocationKit.h>
#import <AMapSearchKit/AMapSearchKit.h>
#import <AdSupport/AdSupport.h>
#import <AppTrackingTransparency/AppTrackingTransparency.h>
//微信SDK头文件
#import <WXApi.h>
@ -65,6 +67,7 @@ @@ -65,6 +67,7 @@
[userDefault setValue:@"童信APP活着的状态" forKey:@"APPStatus"];
[User loadFormFile];
[self showRootViewController];
[self requestIDFATracking];
[self getadSwitch];
self.window.backgroundColor = [UIColor whiteColor];
@ -783,6 +786,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -783,6 +786,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
//MARK:重新启动在应用程序处于非活动状态时暂停(或尚未启动)的任何任务。如果应用程序以前在后台,可以选择刷新用户界面。
[self requestIDFATracking];
if(self.backgroudMsg){
//MARK: 取消本地推送
@ -876,7 +880,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -876,7 +880,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
#endif
#endif
BUAdSDKConfiguration *configuration = [BUAdSDKConfiguration configuration];
configuration.appID = @"5408119";
configuration.appID = @"5424285";
[BUAdSDKManager startWithAsyncCompletionHandler:^(BOOL success, NSError *error) {
@ -887,12 +891,13 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -887,12 +891,13 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
}
}];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self requestIDFATracking];
});
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self requestIDFATracking];
// });
}
- (void)requestIDFATracking {
- (void)requestIDFATracking
{
if (@available(iOS 14, *)) {
// iOS14及以上版本需要先请求权限
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
@ -907,10 +912,13 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -907,10 +912,13 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
} else {
// iOS14以下版本依然使用老方法
// 判断在设置-隐私里用户是否打开了广告跟踪
if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {
if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled])
{
NSString *idfa = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];
NSLog(@"%@",idfa);
} else {
}
else
{
NSLog(@"请在设置-隐私-广告中打开广告跟踪功能");
}
}
@ -922,7 +930,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -922,7 +930,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
{
CGRect frame = [UIScreen mainScreen].bounds;
self.startTime = CACurrentMediaTime();
BUSplashAd *splashAd = [[BUSplashAd alloc] initWithSlotID:@"888361613" adSize:frame.size];
BUSplashAd *splashAd = [[BUSplashAd alloc] initWithSlotID:@"888432838" adSize:frame.size];
splashAd.supportCardView = YES;
splashAd.supportZoomOutView = YES;
@ -946,12 +954,14 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -946,12 +954,14 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
///当材料加载失败时调用此方法
- (void)splashAdLoadFail:(nonnull BUSplashAd *)splashAd error:(BUAdError * _Nullable)error {
[self disYulan];
[self pbu_logWithSEL:_cmd msg:@""];
}
///当闪屏视图渲染失败时调用此方法
- (void)splashAdRenderFail:(nonnull BUSplashAd *)splashAd error:(BUAdError * _Nullable)error {
[self disYulan];
[self pbu_logWithSEL:_cmd msg:@""];
}
///当渲染成功时调用这个方法
@ -976,8 +986,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -976,8 +986,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
- (void)disYulan
{
MyTabBarViewController *mytabVC = (MyTabBarViewController*)[UICommon currentVC].tabBarController;
[mytabVC removeTransitionImageView];
[self.tabbarView removeTransitionImageView];
}
@ -1010,4 +1019,5 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response @@ -1010,4 +1019,5 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
}
@end

21
tongxin/Assets.xcassets/通用/Discover_banner.imageset/Contents.json vendored

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

BIN
tongxin/Assets.xcassets/通用/Discover_banner.imageset/Discover_banner@2x.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

51
tongxin/Base.lproj/Main.storyboard

@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
</connections>
</mapView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tUf-d4-Yas">
<rect key="frame" x="344" y="209" width="50" height="59"/>
<rect key="frame" x="336" y="224" width="50" height="59"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Rty-lR-cWg">
<rect key="frame" x="344" y="135" width="50" height="59"/>
<rect key="frame" x="336" y="150" width="50" height="59"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
@ -143,7 +143,7 @@ @@ -143,7 +143,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4mF-w8-Ajb">
<rect key="frame" x="339" y="288" width="50" height="59"/>
<rect key="frame" x="331" y="303" width="50" height="59"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UvQ-sD-dZl">
<rect key="frame" x="344" y="440" width="50" height="59"/>
<rect key="frame" x="336" y="455" width="50" height="59"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="9"/>
@ -3623,6 +3623,9 @@ @@ -3623,6 +3623,9 @@
<constraint firstAttribute="width" constant="60" id="Cof-Ib-WdE"/>
</constraints>
<state key="normal" image="hangup"/>
<connections>
<action selector="hangUpButton:" destination="CEf-zS-oi5" eventType="touchUpInside" id="Hh7-et-qFE"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="挂断" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XwQ-De-J5C">
<rect key="frame" x="0.0" y="60" width="60" height="30"/>
@ -3673,6 +3676,9 @@ @@ -3673,6 +3676,9 @@
<constraint firstAttribute="width" secondItem="M9Z-hJ-RO2" secondAttribute="height" multiplier="1:1" id="zzG-2i-S8q"/>
</constraints>
<state key="normal" image="hangup"/>
<connections>
<action selector="activeHangUpBtnAction:" destination="CEf-zS-oi5" eventType="touchUpInside" id="lJG-AV-YIv"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@ -3717,6 +3723,9 @@ @@ -3717,6 +3723,9 @@
<constraint firstAttribute="width" constant="60" id="BS4-TW-4HL"/>
</constraints>
<state key="normal" image="call"/>
<connections>
<action selector="acceptBtnAction:" destination="CEf-zS-oi5" eventType="touchUpInside" id="CaS-cv-KJz"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@ -3765,6 +3774,9 @@ @@ -3765,6 +3774,9 @@
</constraints>
<state key="normal" image="Button_Camera"/>
<state key="selected" image="Button_Camera_active"/>
<connections>
<action selector="didClickSwitchCameraButton:" destination="CEf-zS-oi5" eventType="touchUpInside" id="IfT-sB-BuA"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@ -3790,6 +3802,9 @@ @@ -3790,6 +3802,9 @@
</constraints>
<state key="normal" image="Button_Mute"/>
<state key="selected" image="Button_Mute_active"/>
<connections>
<action selector="didClickMuteButton:" destination="CEf-zS-oi5" eventType="touchUpInside" id="b3c-uT-9z1"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="静音" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Md1-lQ-KFu">
<rect key="frame" x="0.0" y="60" width="60" height="30"/>
@ -3831,9 +3846,17 @@ @@ -3831,9 +3846,17 @@
</constraints>
</view>
<connections>
<outlet property="acceptView" destination="Cdh-mQ-3JZ" id="Ii6-Jg-3RO"/>
<outlet property="activeHangupView" destination="s7z-Uh-dn1" id="fMe-tO-Vgu"/>
<outlet property="buttonStackView" destination="b1k-UE-Gh9" id="Ebj-hQ-tWY"/>
<outlet property="hangupView" destination="Aic-6h-Xhy" id="DRE-4b-nDU"/>
<outlet property="headImageView" destination="grm-sg-jiC" id="wVU-ej-SQT"/>
<outlet property="localVideo" destination="FRA-7K-nag" id="ORE-BL-23D"/>
<outlet property="muteBtnView" destination="Fve-L7-AkA" id="R8M-JC-4uy"/>
<outlet property="nameLabel" destination="Qo1-iX-rJZ" id="d4R-XR-Ust"/>
<outlet property="remoteVideo" destination="DDg-gc-zyG" id="3RY-Rf-kRC"/>
<outlet property="switchCameraView" destination="ulG-cV-u6U" id="wSV-zw-s0g"/>
<outlet property="timeLabel" destination="qsr-Rd-Ptg" id="WlA-QZ-iNE"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="hvt-9m-CqO" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -3949,22 +3972,22 @@ @@ -3949,22 +3972,22 @@
<image name="Button_Camera" width="71" height="71"/>
<image name="Button_Camera_active" width="71" height="71"/>
<image name="Button_Mute" width="71" height="71"/>
<image name="Button_Mute_active" width="64" height="64"/>
<image name="call" width="96" height="96"/>
<image name="hangup" width="64" height="64"/>
<image name="Button_Mute_active" width="74" height="74"/>
<image name="call" width="94" height="94"/>
<image name="hangup" width="94" height="94"/>
<image name="ic_arrow_drop_dowm_main" width="36" height="36"/>
<image name="icon_baby_history" width="20" height="20"/>
<image name="icon_baby_positioning" width="24" height="24"/>
<image name="icon_baby_security_fence" width="20" height="20"/>
<image name="icon_base_station" width="12" height="12"/>
<image name="icon_delect_1" width="16" height="16"/>
<image name="icon_baby_history" width="30" height="30"/>
<image name="icon_baby_positioning" width="45" height="45"/>
<image name="icon_baby_security_fence" width="30" height="30"/>
<image name="icon_base_station" width="16" height="14"/>
<image name="icon_delect_1" width="13" height="13"/>
<image name="icon_delect_Track" width="14" height="14"/>
<image name="icon_drop-down" width="8" height="5"/>
<image name="icon_drop-down" width="9" height="5"/>
<image name="icon_hot_issue" width="97" height="27"/>
<image name="icon_map_mode" width="30" height="30"/>
<image name="icon_message_box" width="220" height="98"/>
<image name="icon_phone_positioning" width="54" height="54"/>
<image name="icon_positioning_g" width="24" height="29"/>
<image name="icon_positioning_g" width="30" height="30"/>
<image name="icon_return_black" width="21" height="21"/>
<image name="icon_set_up_black" width="21" height="21"/>
<image name="img_automatic_answer_bg" width="375" height="180"/>

2
tongxin/Info.plist

@ -163,7 +163,7 @@ @@ -163,7 +163,7 @@
<key>NSSiriUsageDescription</key>
<string>请为APP打开Siri权限</string>
<key>NSUserTrackingUsageDescription</key>
<string>获取IDFA有助于提供更优质的个性化服务及内容</string>
<string>该标识符将用于向您投放个性化广告</string>
<key>SKAdNetworkItems</key>
<array>
<dict>

52
tongxin/VC/Discover/DiscoverViewController.m

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
#import "DiscoverViewController.h"
#import "DiscoverTableViewCell.h"
#import "SingViewController.h"
#import "ActivityWebViewController.h"
@interface DiscoverViewController ()<UITableViewDelegate,UITableViewDataSource>
@ -36,6 +37,25 @@ @@ -36,6 +37,25 @@
//
// }];
[self.view addSubview:self.disTableView];
UIImage *img = ImageName_(@"Discover_banner");
UIButton *ximaBtn = [UICommon ui_buttonSimple:CGRectZero font:Font_(0) normalColor:KKWhiteColorColor normalText:@"" click:^(id x) {
ActivityWebViewController *vc = [[ActivityWebViewController alloc] init];
vc.zx_navTitle = @"喜马拉雅";
vc.url = @"https://m.ximalaya.com/kidiot-service-app?appKey=6b267bcd4f91494aa182bb4a89b95a0b&channelId=72e7cc893dd049dc83d62e277080fdbd";
[self.navigationController pushViewController:vc animated:YES];
}];
ximaBtn.layer.cornerRadius = 10;
ximaBtn.layer.masksToBounds = YES;
[ximaBtn setBackgroundImage:img forState:0];
[self.view addSubview:ximaBtn];
[ximaBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.view).inset(15);
make.height.mas_equalTo(img.size.height);
// make.top.equalTo(searchBar.mas_bottom).offset(15);
make.top.equalTo(self.disTableView.mas_bottom).offset(15);
}];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
@ -45,13 +65,15 @@ @@ -45,13 +65,15 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 55;
return 60;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
DiscoverTableViewCell *cell = [DiscoverTableViewCell cellWithTableView:tableView indexPath:indexPath];
cell.layer.cornerRadius = 10;
cell.layer.masksToBounds = YES;
[cell setCellText:indexPath.row == 0 ? @"任务中心" : @"我的兑换" :indexPath.row == 0 ? @"icon_task" : @"icon_gift"];
return cell;
}
@ -78,19 +100,22 @@ @@ -78,19 +100,22 @@
{
if (!_disTableView)
{
_disTableView = [[UITableView alloc] init];
if (@available(iOS 13.0, *)) {
_disTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-iPhoneX_NavHeight) style:UITableViewStyleInsetGrouped];
} else {
_disTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-iPhoneX_NavHeight) style:UITableViewStyleGrouped];
}
_disTableView = [[UITableView alloc] initWithFrame:CGRectMake(15, iPhoneX_NavHeight+20, ScreenWidth-30, 60) style:UITableViewStylePlain];
// if (@available(iOS 13.0, *)) {
// _disTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, 55) style:UITableViewStyleInsetGrouped];
// } else {
// _disTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, 55) style:UITableViewStyleGrouped];
// }
_disTableView.delegate = self;
_disTableView.dataSource = self;
//_disTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_disTableView.backgroundColor = KKClearColor;
// _disTableView.tableHeaderView = self.headerView;
// _disTableView.tableHeaderView.height = 185;
// _disTableView.tableHeaderView.height = 145;
// _disTableView.tableHeaderView = self.headerView;
// _disTableView.tableHeaderView.height = 185;
// _disTableView.tableHeaderView.height = 145;
_disTableView.bounces = NO; //禁止弹跳
_disTableView.showsHorizontalScrollIndicator = NO;
_disTableView.showsVerticalScrollIndicator = NO;
[_disTableView registerClass:DiscoverTableViewCell.class forCellReuseIdentifier:NSStringFromClass(DiscoverTableViewCell.class)];
}
return _disTableView;
@ -122,11 +147,14 @@ @@ -122,11 +147,14 @@
// make.height.mas_equalTo(30);
// }];
UIImageView *topImg = [UICommon ui_imageView:CGRectZero fileName:@"金币商城"];
UIButton *topImg = [UICommon ui_buttonSimple:CGRectZero font:Font_(0) normalColor:KKWhiteColorColor normalText:@"" click:^(id x) {
}];
[topImg setImage:ImageName_(@"Discover_banner") forState:0];
[_headerView addSubview:topImg];
[topImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(_headerView).inset(20);
make.height.mas_equalTo(topImg.image.size.height);
make.height.mas_equalTo(topImg.currentImage.size.height);
// make.top.equalTo(searchBar.mas_bottom).offset(15);
make.top.equalTo(_headerView).offset(10);
}];

88
tongxin/VC/Login/ScanCodeViewController.m

@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
#import "WatchHomeViewController.h"
#import "WebViewController.h"
#import "SelectContactVC.h"
#import <SGQRCode/SGQRCode.h>
#import "SGQRCode.h"
@interface ScanCodeViewController ()<SGScanCodeDelegate,SGScanCodeSampleBufferDelegate,UITextFieldDelegate>
/// 识别后的字符串
@ -29,44 +29,36 @@ @@ -29,44 +29,36 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.zx_navBarBackgroundColor = KKClearColor;
self.view.backgroundColor = UIColor.darkTextColor;
self.zx_navTitle = @"添加设备";
[self zx_setRightBtnWithText:@"二维码/条码丢失?" clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
UIButton *backBtn = [UICommon ui_buttonSimple:CGRectMake(0, 0, 30, 30) font:Font_(0) normalColor:KKClearColor normalText:@"" click:^(id x) {
[self.navigationController popViewControllerAnimated:YES];
}];
[backBtn setBackgroundImage:ImageName_(@"icon_return_round") forState:0];
self.zx_navLeftBtn.zx_customView = backBtn;
self.zx_navTitleColor = KKWhiteColorColor;
self.zx_navTitle = @"添加设备";
[self zx_setRightBtnWithText:@"二维码丢失?" clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
WebViewController *vc = [WebViewController new];
vc.url = QRcodeLostURLStr;
vc.title = @"二维码丢失";
[self.navigationController pushViewController:vc animated:YES];
}];
self.zx_navRightBtn.titleLabel.font = Font_(12);
[self.zx_navRightBtn setTitleColor:KKWhiteColorColor forState:0];
[self.view addSubview:self.scanView];
// self.zx_navRightBtn.titleLabel.font = Font_(12);
WEAKSELF
JLAuthorizationManager *jlManager = [JLAuthorizationManager defaultManager];
[jlManager JL_requestAuthorizationWithAuthorizationType:JLAuthorizationTypeVideo
authorizedHandler:^{
[weakSelf setupCamera];
}
unAuthorizedHandler:^
{
UIAlertController *alert = [myHelper getAlertWithTitle:[NSString stringWithFormat:@"请为%@打开相机权限",APPName]
actionTitles:@[@"设置"]
style:UIAlertControllerStyleAlert
block:^(UIAlertAction *action)
{
if ([action.title isEqualToString:@"设置"]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}
}];
[weakSelf presentViewController:alert animated:YES completion:nil];
}];
}
- (void)setupCamera
{
[self.view addSubview:self.scanView];
self.scanCode = [[SGScanCode alloc] init];
if (![self.scanCode checkCameraDeviceRearAvailable]) {
return;
@ -143,7 +135,14 @@ @@ -143,7 +135,14 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self start];
WEAKSELF
[self takeCameraAuthorityStatusCompletion:^(BOOL allow) {
if (allow)
{
[weakSelf setupCamera];
[weakSelf start];
}
}];
}
- (void)viewWillDisappear:(BOOL)animated {
@ -304,6 +303,43 @@ @@ -304,6 +303,43 @@
}
}
- (void)takeCameraAuthorityStatusCompletion:(void(^)(BOOL allow))completion
{
//获取摄像头权限当前的状态
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if ((authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied))
{
//用户禁止app 访问摄像头 或设置了家长控制 可以根据需求 给用户做一个友好的提示来让用户解除限制
UIAlertController *alert = [myHelper getAlertWithTitle:[NSString stringWithFormat:@"请为%@打开相机权限",APPName]
actionTitles:@[@"设置"]
style:UIAlertControllerStyleAlert
block:^(UIAlertAction *action)
{
if ([action.title isEqualToString:@"设置"]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}
}];
[self presentViewController:alert animated:YES completion:nil];
if (completion) {
completion(NO);
}
}
else
{
//判断是真机还是模拟器
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
if (completion) {
completion(YES);
}
} else {
NSLog(@"模拟器中无法打开照相机,请在真机中使用");
if (completion) {
completion(NO);
}
}
}
}
#pragma mark - Navigation

8
tongxin/VC/WatchHome/NewHomeVC/HomeMsgTableViewCell.m

@ -30,13 +30,15 @@ @@ -30,13 +30,15 @@
- (void)subCellView
{
NSArray *titleArr = @[@"消息通知",@"消息推送"];
NSArray *imageArr = @[@"home_icon_remind",@"home_icon_push"];
// NSArray *titleArr = @[@"消息通知",@"消息推送"];
// NSArray *imageArr = @[@"home_icon_remind",@"home_icon_push"];
NSArray *titleArr = @[@"消息通知"];
NSArray *imageArr = @[@"home_icon_remind"];
for (int i = 0; i < titleArr.count; i++)
{
UIView *bgView = [UICommon ui_view:CGRectZero backgroundColor:KKWhiteColorColor cornerRadius:12.5 borderWidth:0 borderColor:KKClearColor];
bgView.frame = CGRectMake(15, 15+i*25+i*10, ScreenWidth-30, 25);
bgView.frame = CGRectMake(15, 5+i*25+i*10, ScreenWidth-30, 25);
[self.contentView addSubview:bgView];
UIImageView *icon = [UICommon ui_imageView:CGRectZero fileName:imageArr[i]];

2
tongxin/VC/WatchHome/WatchHomeViewController.m

@ -489,7 +489,7 @@ @@ -489,7 +489,7 @@
if ([title isEqualToString:@"计步"])
return 181;
if ([title isEqualToString:@"消息"])
return 75;
return 30; //return 75;
if ([title isEqualToString:@"体温等"])
{
CGFloat hh = (ScreenWidth-45)/2;

Loading…
Cancel
Save