Files
ifish/Ifish/controllers/IfishTabControllers/我的/mineControllers/IfishConnectUsViewController.m
T

180 lines
6.1 KiB
Objective-C

//
// IfishConnectUsViewController.m
// Ifish
//
// Created by wbzhan on 2019/5/23.
// Copyright © 2019 lianlian. All rights reserved.
//
#import "IfishConnectUsViewController.h"
#import "InfoByImageViewController.h"
@interface IfishConnectUsViewController ()<UITextViewDelegate>
Strong UIImageView *codeImage;//二维码
Strong UITextView *textView;
@end
@implementation IfishConnectUsViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.titleString = @"联系我们";
self.view.backgroundColor=[UIColor whiteColor];
[self.view addSubview:self.codeImage];
[self.view addSubview:self.textView];
[self.codeImage mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.view.mas_bottom).offset(-34);
make.width.mas_equalTo(kSizeFrom750(300.5));
make.height.mas_equalTo(kSizeFrom750(400));
make.centerX.mas_equalTo(self.view);
}];
[self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.view.mas_left).offset(10);
make.right.mas_equalTo(self.view.mas_right).offset(-10);
make.top.mas_equalTo(self.view.mas_top).offset(0);
make.bottom.mas_equalTo(self.codeImage.mas_top);
}];
// Do any additional setup after loading the view.
}
-(void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
[self protocolIsSelect:YES];
}
-(UITextView *)textView{
if (!_textView) {
_textView = InitObject(UITextView);
_textView.adjustsFontForContentSizeCategory=YES;
}
return _textView;
}
- (void)protocolIsSelect:(BOOL)select {
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"1、设备绑定不上?查看遥控器或显示屏控制插排是否正常?\na、若不正常考虑设备问题,可与购买方或厂家联系。\nb、若正常先查看手机连接路由器是否为2.4g频率wifi。若连接时提示去更改网络,则此时手机连接一定为5g网络,需更换2.4g网络重新绑定。\n2、换路由器后网络为2.4g频率WIFI,还是无法绑定?\na、若老路由器连接没问题,先用老路由器把设备绑定在线,联系爱鱼奇客服升级。\nb、两台手机开热点方法(暂时不用路由器)先把设备绑定上,设备在线后与爱鱼奇客服联系升级。手机开热点如何连接点击这里。\nc、手机开热点也连接不上,可与购买方或厂家联系。\n3、感谢您使用爱鱼奇app,连接智能设备请查看下方说明书,内含操作视频:http://u.eqxiu.com/s/KmmVl87l,插排及热流器售后服务热线点击这里。\n4、摄像头售后及爱鱼奇服务微信:18667812003"];
[attributedString addAttribute:NSLinkAttributeName
value:@"apmode://"
range:[[attributedString string] rangeOfString:@"手机开热点如何连接点击这里。"]];
[attributedString addAttribute:NSLinkAttributeName
value:@"http://u.eqxiu.com/s/KmmVl87l"
range:[[attributedString string] rangeOfString:@"http://u.eqxiu.com/s/KmmVl87l"]];
[attributedString addAttribute:NSLinkAttributeName
value:@"hotbar://"
range:[[attributedString string] rangeOfString:@"插排及热流器售后服务热线点击这里。"]];
CGFloat fontSize=18;
if (self.view.frame.size.width>410)
{
fontSize=18;
}
else if (self.view.frame.size.width>370)
{
fontSize=15;
}
else
{
fontSize=12;
}
[attributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:fontSize] range:NSMakeRange(0, attributedString.length)];
[attributedString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:fontSize] range:[[attributedString string] rangeOfString:@"http://u.eqxiu.com/s/KmmVl87l"]];
[attributedString addAttribute:NSLinkAttributeName value:@"tel://18667812003" range:[[attributedString string] rangeOfString:@"18667812003"]];
_textView.attributedText = attributedString;
_textView.linkTextAttributes = @{NSForegroundColorAttributeName: [UIColor blueColor],
NSUnderlineColorAttributeName: [UIColor lightGrayColor],
NSUnderlineStyleAttributeName: @(NSUnderlinePatternSolid)};
_textView.delegate=self;
_textView.editable=NO;
_textView.scrollEnabled = YES;
}
- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange {
self.hidesBottomBarWhenPushed=YES;
if ([[URL scheme] isEqualToString:@"apmode"]) {
InfoByImageViewController*info=[[InfoByImageViewController alloc]init];
info.title=@"热点连接方法";
info.image=[UIImage imageNamed:@"apmodeInfo"];
[self.navigationController pushViewController:info animated:YES];
return NO;
} else if ([[URL scheme] isEqualToString:@"hotbar"]) {
InfoByImageViewController*info=[[InfoByImageViewController alloc]init];
info.title=@"售后服务热线";
info.type=@"service";
info.image=[UIImage imageNamed:@"hotbarInfo"];
[self.navigationController pushViewController:info animated:YES];
return NO;
}
return YES;
}
-(UIImageView *)codeImage
{
if (!_codeImage) {
_codeImage = InitObject(UIImageView);
[_codeImage setImage:[UIImage imageNamed:@"code_wechat_us.jpeg"]];
}
return _codeImage;
}
-(void)telBtnClick:(UIButton *)sender{
NSURL *url=[NSURL URLWithString:@"tel://18667812003"];
BOOL canOpen = [[UIApplication sharedApplication] canOpenURL:url];
if (canOpen) {
if (@available(iOS 10.0, *)) {
/// 大于等于10.0系统使用此openURL方法
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}else{
[[UIApplication sharedApplication] openURL:url];
}
}
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end