Commit b31fc9da authored by Sandy's avatar Sandy

细节修改

parent f88230c5
This diff is collapsed.
......@@ -68,6 +68,7 @@
switch (btn.tag) {
case 0:
{
//更多品牌
MoreHotBrandViewController *moreHotBrandVC = [[MoreHotBrandViewController alloc] init];
moreHotBrandVC.isShowNavigationBar = YES;
moreHotBrandVC.arrItems = self.arrData[0];
......@@ -76,6 +77,7 @@
break;
case 1:
{
//更多标签
MoreHotTagViewController *moreHotTagVC = [[MoreHotTagViewController alloc] init];
moreHotTagVC.arrItems = self.arrData[1];
moreHotTagVC.isShowNavigationBar = YES;
......
......@@ -11,6 +11,7 @@
#import "CommodityDetailTopView.h"
#import "CommodityMutipleSelectBottomView.h"
#import <WebKit/WebKit.h>
#import "JavenCustomerService.h"
@interface CommodityDetailViewController ()<WKNavigationDelegate>
@property (nonatomic, weak) WKWebView * webView;
@property (nonatomic, strong) CommodityDetailBottomView *bottomView;
......@@ -37,6 +38,7 @@
kButtonAddAction(self.bottomView.buttonShare, shareAction);
kButtonAddAction(self.topView.buttonBack, backAction);
kButtonAddAction(self.topView.buttonHome, homeAction);
kButtonAddAction(self.bottomView.buttonPhone, startCustomerServices);
[self checkIsFavorite];
......@@ -89,7 +91,8 @@
[weakSelf checkIsFavorite];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
......@@ -152,21 +155,13 @@
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
// 当内容开始返回时调用
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation
{
}
// 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
self.bottomView.userInteractionEnabled = YES;
[MBProgressHUD hideHUDForView:self.view];
}
// 页面加载失败时调用
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation
{
}
- (void)shareAction
......@@ -187,23 +182,10 @@
}
//隐藏navigationbar
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES];
}
#pragma mark - webView delegate
- (void)webViewDidStartLoad:(UIWebView *)webView {
[MBProgressHUD showHUDAddedTo:webView animated:YES];
- (void)startCustomerServices {
[JavenCustomerService startCustomerServices:self];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
self.bottomView.userInteractionEnabled = YES;
[MBProgressHUD hideHUDForView:webView];
}
#pragma mark =========== lazy loading ===========
- (CommodityDetailBottomView *)bottomView {
......
......@@ -92,12 +92,12 @@
@"fetchParts" : @[@"string"]};
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"goods/query2" parameters:myDictionary success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:weakSelf.view];
for (NSDictionary *dic in responseObject[@"queryResult"]) {
CommotityListModel *model = [CommotityListModel modelObjectWithDictionary:dic];
[weakSelf.arrItemDatas addObject:model];
}
[MBProgressHUD hideHUDForView:weakSelf.view];
[weakSelf.collectionView reloadData];
[weakSelf.collectionView.mj_header endRefreshing];
if ([responseObject[@"queryResult"] count] < kPageSize) {
......@@ -106,7 +106,8 @@
[weakSelf.collectionView.mj_footer endRefreshing];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
......@@ -241,6 +242,7 @@
detailVC.model = self.arrItemDatas[indexPath.row];
CommodityListCollectionViewCell *cell = (CommodityListCollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];
detailVC.image = cell.imageViewTop.image;
detailVC.isShowNavigationBar = NO;
[self.navigationController pushViewController:detailVC animated:YES];
}
......
......@@ -91,10 +91,11 @@
@"fetchParts" : [NSNull null]};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"goods/query2" parameters:myDictionary success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:weakSelf.view];
for (NSDictionary *dic in responseObject[@"queryResult"]) {
CommotityListModel *model = [CommotityListModel modelObjectWithDictionary:dic];
[weakSelf.arrItemDatas addObject:model];
......@@ -102,7 +103,8 @@
[weakSelf.collectionView reloadData];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
......
......@@ -223,7 +223,8 @@
[weakSelf.tableView reloadData];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
......@@ -327,11 +328,13 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
CommodityDetailViewController *detailVC = [[CommodityDetailViewController alloc] init];
detailVC.model = self.arrItemDatas[indexPath.row];
CommodityTableViewCell *cell = (CommodityTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
detailVC.image = cell.imgView.image;
detailVC.isShowNavigationBar = NO;
//跳转商品详情
[self.navigationController pushViewController:detailVC animated:YES];
}
......
......@@ -68,8 +68,12 @@
}
- (void)setUpData {
WS(weakSelf)
WS(weakSelf);
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[[HTTPCilent shareCilent] POST:@"reseller/customer/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:weakSelf.view];
if ([responseObject[@"code"] isEqualToNumber:@0]) {
NSMutableArray *arr = weakSelf.searchBar.isFirstResponder ? weakSelf.results : weakSelf.arrCellData;
......@@ -77,8 +81,6 @@
JavenCustomer *customer = [JavenCustomer modelObjectWithDictionary:dic];
[arr addObject:customer];
}
if ([responseObject[@"queryResult"] count] < kPageSize) {
[weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
}else{
......@@ -86,16 +88,18 @@
}
[weakSelf.tableView reloadData];
}else{
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:nil];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
- (NSDictionary *)getParams
{
NSDictionary *params = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
NSDictionary *searchParams = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].domain]},
@{@"operation" : @"createInfo.time between",
......@@ -103,18 +107,37 @@
@"parameters" : @[self.customerCreateDate, [NSNull null]]},
@{@"operation" : @"reseller uuid equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].uuid]},
@{@"operation" : @"mobilephone equals",
@"parameters" : @[[UserInfo shareInstance].uuid]}
,
@{@"operation" : @"consumer mobilephone equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[_phoneNo]}],
@"parameters" : @[_phoneNo]}
],
@"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}],
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@""]};
NSString *strJson = [params mj_JSONString];
return params;
NSDictionary *params = @{@"defintion" : @{@"conditions" : @[@{@"operation" : @"domain equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].domain]},
@{@"operation" : @"createInfo.time between",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[self.customerCreateDate, [NSNull null]]},
@{@"operation" : @"reseller uuid equals",
@"parameter" : @{@"operation" : @"string"},
@"parameters" : @[[UserInfo shareInstance].uuid]}
],
@"orders" : @[@{@"field" : self.field,
@"direction" : self.direction}],
@"pageSize" : @(kPageSize),
@"page" : @(self.page),
@"probePages" : @0},
@"fetchParts" : @[@""]};
return self.searchBar.isFirstResponder ? searchParams : params;
}
......
......@@ -54,17 +54,27 @@
}
- (void)setUpData {
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"order/query" parameters:[self getParams] success:^(NSURLSessionDataTask *task, id responseObject) {
for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenOrderModel *model = [JavenOrderModel modelObjectWithDictionary:dic];
[weakSelf.arrDatas addObject:model];
[MBProgressHUD hideHUDForView:weakSelf.view];
if (kIsResponseSuccess(responseObject)) {
for (NSDictionary *dic in responseObject[@"queryResult"]) {
JavenOrderModel *model = [JavenOrderModel modelObjectWithDictionary:dic];
[weakSelf.arrDatas addObject:model];
}
}else{
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:nil];
}
[weakSelf.tableView reloadData];
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
......
......@@ -19,13 +19,14 @@
- (void)viewDidLoad {
[super viewDidLoad];
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight - 64)];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.baidu.com"]]];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.strUrl]]];
self.webView = webView;
webView.navigationDelegate = self;
[self.view addSubview:webView];
// Do any additional setup after loading the view from its nib.
}
#pragma mark - wkwebview delegate
// 页面开始加载时调用
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
......@@ -33,11 +34,7 @@
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
// 当内容开始返回时调用
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation
{
}
// 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
......@@ -45,11 +42,7 @@
[MBProgressHUD hideHUDForView:self.view];
}
// 页面加载失败时调用
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation
{
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......
......@@ -8,7 +8,9 @@
#import "InvitePartnerViewController.h"
#import "SeeMoreViewController.h"
@interface InvitePartnerViewController ()<UIWebViewDelegate>
#import <WebKit/WebKit.h>
@interface InvitePartnerViewController ()<WKNavigationDelegate>
@property (weak, nonatomic) IBOutlet UIButton *btnInvite;
@end
......@@ -26,25 +28,30 @@
- (void)setUpWebView {
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/visit.html", [UserInfo shareInstance].webShopBaseUrl];
// NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:inviteWebUrl]];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:10];
UIWebView *webView = [UIWebView new];
webView.delegate = self;
WKWebView *webView = [WKWebView new];
webView.navigationDelegate = self;
webView.backgroundColor = kBacroundColor;
[webView loadRequest:request];
[self.view addSubview:webView];
webView.sd_layout.topSpaceToView(self.view, 0).leftSpaceToView(self.view, 0).rightSpaceToView(self.view, 0).bottomSpaceToView(self.btnInvite, 0);
}
#pragma mark =========== webView delegate ===========
- (void)webViewDidStartLoad:(UIWebView *)webView {
[MBProgressHUD showHUDAddedTo:webView animated:YES];
#pragma mark - wkwebview delegate
// 页面开始加载时调用
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[MBProgressHUD hideHUDForView:webView];
// 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
[MBProgressHUD hideHUDForView:self.view];
}
//查看更多
- (void)actionSeeMore {
SeeMoreViewController *seeMoreVC = [[SeeMoreViewController alloc] init];
seeMoreVC.isShowNavigationBar = YES;
......
......@@ -7,8 +7,8 @@
//
#import "SeeMoreViewController.h"
@interface SeeMoreViewController ()<UIWebViewDelegate>
#import <WebKit/WebKit.h>
@interface SeeMoreViewController ()<WKNavigationDelegate>
@end
......@@ -22,8 +22,8 @@
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/abcShare.html", [UserInfo shareInstance].webShopBaseUrl];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:inviteWebUrl] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:10];
UIWebView *webView = [UIWebView new];
webView.delegate = self;
WKWebView *webView = [WKWebView new];
webView.navigationDelegate = self;
[webView loadRequest:request];
[self.view addSubview:webView];
webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
......@@ -32,14 +32,21 @@
}
#pragma mark =========== webView delegate ===========
- (void)webViewDidStartLoad:(UIWebView *)webView {
[MBProgressHUD showHUDAddedTo:webView animated:YES];
#pragma mark - wkwebview delegate
// 页面开始加载时调用
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[MBProgressHUD hideHUDForView:webView];
// 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
[MBProgressHUD hideHUDForView:self.view];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -7,8 +7,9 @@
//
#import "AgreementViewController.h"
#import <WebKit/WebKit.h>
@interface AgreementViewController ()
@interface AgreementViewController ()<WKNavigationDelegate>
@end
......@@ -28,7 +29,6 @@
}];
// Do any additional setup after loading the view from its nib.
}
- (void)setUpWebView:(NSString *)url {
......@@ -36,13 +36,28 @@
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/visitorXy.html", url];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:inviteWebUrl]];
UIWebView *webView = [UIWebView new];
WKWebView *webView = [WKWebView new];
webView.navigationDelegate = self;
[webView loadRequest:request];
[self.view addSubview:webView];
webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
webView.sd_layout.topSpaceToView(self.view, 0).leftSpaceToView(self.view, 0).rightSpaceToView(self.view, 0).bottomSpaceToView(self.view, 0);
}
// 页面开始加载时调用
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
}
// 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation
{
self.title = webView.title;
[MBProgressHUD hideHUDForView:self.view];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......
......@@ -55,7 +55,8 @@
[MBProgressHUD Javen_showError:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:nil];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
......@@ -83,7 +84,8 @@
[self.tabBarController dismissViewControllerAnimated:YES completion:nil];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
......
......@@ -7,8 +7,8 @@
//
#import "MyAcountHelfViewController.h"
@interface MyAcountHelfViewController ()
#import <WebKit/WebKit.h>
@interface MyAcountHelfViewController ()<WKNavigationDelegate>
@end
......@@ -22,7 +22,7 @@
NSString *inviteWebUrl = [NSString stringWithFormat:@"%@Wap/helpVisit.html", [UserInfo shareInstance].webShopBaseUrl];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:inviteWebUrl]];
UIWebView *webView = [UIWebView new];
WKWebView *webView = [WKWebView new];
[webView loadRequest:request];
[self.view addSubview:webView];
webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
......
......@@ -82,16 +82,20 @@
[MBProgressHUD Javen_showMessage:@"提交中…" onView:self.view];
WS(weakSelf)
[[HTTPCilent shareCilent] POST:@"reseller/save" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:weakSelf.view];
if ([responseObject[@"code"] isEqualToNumber:@0]) {
[MBProgressHUD hideHUDForView:weakSelf.view];
[MBProgressHUD Javen_showSuccess:@"设置成功!" onView:weakSelf.view delay:0.7 complete:^{
}];
}else{
[MBProgressHUD Javen_showSuccess:responseObject[@"message"] onView:weakSelf.view delay:0.7 complete:^{
}];
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
......
......@@ -120,7 +120,7 @@
[[HTTPCilent shareCilent] POST:@"reseller/save" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
[MBProgressHUD hideHUDForView:weakSelf.view];
if ([responseObject[@"code"] isEqualToNumber:@0]) {
if (kIsResponseSuccess(responseObject)) {
[MBProgressHUD Javen_showSuccess:@"修改成功!" onView:weakSelf.view delay:0.7 complete:^{
[weakSelf popAction];
......@@ -130,7 +130,8 @@
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
[MBProgressHUD hideHUDForView:weakSelf.view];
}];
}
......
......@@ -42,16 +42,17 @@
JavenSingleSortView *sortView = [JavenSingleSortView sortViewTitles:@[@"全部账单",@"进账单",@"出账单",@"待确认账单"]];
sortView.frame = CGRectMake(0, 0, 150, 35);
self.navigationItem.titleView = sortView;
sortView.leftTableSelect = ^(NSInteger row){
[self changeConditions:row];
};
[self setUpTableView];
[self setUpData];
self.noBillHistoryView = [NoBillHistoryView viewWithNibName:@"NoBillHistoryView"];
self.noBillHistoryView.hidden = YES;
[self.view addSubview:self.noBillHistoryView];
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
// Do any additional setup after loading the view from its nib.
}
- (void)viewWillLayoutSubviews {
......@@ -94,6 +95,12 @@
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.frame = CGRectMake(0, 0, kWidth, kHeight - 64);
[self.view addSubview:self.tableView];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 0, kWidth, 40)];
label.text = @"如需查看更多记录,请联系客服";
label.textColor = kTextColorGray;
self.tableView.tableFooterView = label;
self.tableView.backgroundColor = kBacroundColor;
}
......@@ -162,13 +169,13 @@
[weakSelf.arrDatas addObject:model];
}
weakSelf.noBillHistoryView.hidden = !weakSelf.arrDatas.count == 0;
weakSelf.noBillHistoryView.hidden = !weakSelf.arrDatas.count == 0;
[weakSelf sortModelWithMonth];
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
self.navigationController.navigationBar.userInteractionEnabled = YES;
[weakSelf.tableView reloadData];
}
......@@ -258,6 +265,13 @@
return _arrSortedMonths;
}
- (NoBillHistoryView *)noBillHistoryView {
if (!_noBillHistoryView) {
_noBillHistoryView = [NoBillHistoryView viewWithNibName:@"NoBillHistoryView"];
_noBillHistoryView.hidden = YES;
}
return _noBillHistoryView;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
......
......@@ -11,7 +11,7 @@
#import "UITableView+Category.h"
#import <SobotKit/SobotKit.h>
#import "NavigationbarView.h"
#import "JavenCustomerService.h"
#define kCellID @"cellId"
@interface MassageViewController ()<UITableViewDelegate, UITableViewDataSource>
......@@ -63,161 +63,7 @@
}
- (void)startCustomerServices {
//企业编号,必填
UserInfo *resellerInfo = [UserInfo shareInstance];
NSString *sysNumber=@"1e5947ae875f4a11af054f153c9422ee";
//启动
ZCLibInitInfo *initInfo = [ZCLibInitInfo new];
initInfo.enterpriseId = sysNumber;
//用户id,用于标识用户,建议填写
initInfo.userId=resellerInfo.uuid;
initInfo.phone=resellerInfo.mobilephone;
initInfo.nickName=resellerInfo.name;
initInfo.email=@"unkown";
ZCKitInfo *uiInfo=[ZCKitInfo new];
uiInfo.info=initInfo;
[self customerUI:uiInfo];
[ZCSobot startZCChatView:uiInfo with:self
pageBlock:^(ZCUIChatController *object, ZCPageBlockType type) {
//点击返回
if(type==ZCPageBlockGoBack){
NSLog(@"点击了关闭按钮");
}
//页面UI初始化完成,可以获取UIView,自定义UI
if(type==ZCPageBlockLoadFinish){
// object.topView.backgroundColor = kSysWhite;
//
// object.titleLabel.textColor = [UIColor colorWithHexString:@"333333"];
//
// //banner 返回按钮
// object.backButton.tintColor = [UIColor colorWithHexString:@"333333"];
// [object.backButton setTitle:@"返回" forState:UIControlStateNormal];
// [object.backButton setTitleColor:[UIColor colorWithHexString:@"333333"] forState:UIControlStateNormal];
[object.backButton setImage:[UIImage imageNamed:@"bac"] forState:UIControlStateNormal];
// object.backButton.titleLabel.font = [UIFont systemFontOfSize:18];
//banner 标题
//[object.titleLabel setFont:[UIFont systemFontOfSize:30]];
//banner 底部View
//[object.topView setBackgroundColor:[UIColor greenColor]];
//输入框
//UITextView *tv=[object getChatTextView];
//[tv setBackgroundColor:[UIColor redColor]];
}
//messageLinkClick ,不重写,系统自己跳转,sdk内部不做任何处理
} messageLinkClick:nil];
}
-(void) customerUI:(ZCKitInfo *) kitInfo{
/**
* 自定义信息
*/
//顶部导航条标题文字 评价标题文字 系统相册标题文字 评价客服(立即结束 取消)按钮文字
// kitInfo.titleFont = [UIFont systemFontOfSize:30];
//返回按钮 输入框文字 评价客服是否有以下情况 label 文字 提价评价按钮
// kitInfo.listTitleFont = [UIFont systemFontOfSize:22];
//没有网络提醒的button 没有更多记录label的文字 语音输入的按钮文字 评价不满意(4个button)文字
//占位图片的lablel文字 语音输入时间label文字 语音tipLabel的文字 voiceButton标题文字
// kitInfo.listDetailFont = [UIFont systemFontOfSize:25];
//消息提醒 (转人工、客服接待等)
// kitInfo.listTimeFont = [UIFont systemFontOfSize:22];
//聊天气泡中的文字
// kitInfo.chatFont = [UIFont systemFontOfSize:22];
//聊天的背景颜色
// kitInfo.backgroundColor = [UIColor redColor];
//导航、客服气泡、线条的颜色
kitInfo.customBannerColor = kSysWhite;
//左边气泡的颜色
// kitInfo.leftChatColor = kCustomGreenColor;
//右边气泡的颜色
kitInfo.rightChatColor = kCustomGreenColor;
//底部bottom的背景颜色
kitInfo.backgroundBottomColor = kSysWhite;
//底部bottom的输入框线条背景颜色
//kitInfo.backgroundBottomLineColor = [UIColor redColor];
//提示气泡的背景颜色
// kitInfo.BgTipAirBubblesColor = [UIColor redColor];
//顶部文字的颜色
kitInfo.topViewTextColor = kTextColorDarkGray;
//提示气泡文字颜色
kitInfo.tipLayerTextColor = kTextColorDarkGray;
//左边气泡文字的颜色
kitInfo.leftChatTextColor = kTextColorDarkGray;
//右边气泡文字的颜色[注意:语音动画图片,需要单独替换]
// kitInfo.rightChatTextColor = [UIColor redColor];
//时间文字的颜色
// kitInfo.timeTextColor = [UIColor redColor];
//客服昵称颜色
// kitInfo.serviceNameTextColor = [UIColor redColor];
[JavenCustomerService startCustomerServices:self];
}
......
......@@ -74,6 +74,7 @@
success(task, responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
[MBProgressHUD showMessage:@"网络错误,请检查网络!"];
CLog(@"GET请求失败!----->%@", [error localizedDescription]);
failure(task, error);
}];
......
//
// JavenCustomerService.h
// ALand
//
// Created by Z on 16/5/19.
// Copyright © 2016年 Z. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface JavenCustomerService : NSObject
+ (void)startCustomerServices:(UIViewController *)vc;
@end
//
// JavenCustomerService.m
// ALand
//
// Created by Z on 16/5/19.
// Copyright © 2016年 Z. All rights reserved.
//
#import "JavenCustomerService.h"
#import "ZCSobot.h"
@implementation JavenCustomerService
+ (void)startCustomerServices:(UIViewController *)vc {
//企业编号,必填
UserInfo *resellerInfo = [UserInfo shareInstance];
NSString *sysNumber=@"1e5947ae875f4a11af054f153c9422ee";
//启动
ZCLibInitInfo *initInfo = [ZCLibInitInfo new];
initInfo.enterpriseId = sysNumber;
//用户id,用于标识用户,建议填写
initInfo.userId=resellerInfo.uuid;
initInfo.phone=resellerInfo.mobilephone;
initInfo.nickName=resellerInfo.name;
initInfo.email=@"unkown";
ZCKitInfo *uiInfo=[ZCKitInfo new];
uiInfo.info=initInfo;
[self customerUI:uiInfo];
[ZCSobot startZCChatView:uiInfo with:vc
pageBlock:^(ZCUIChatController *object, ZCPageBlockType type) {
//点击返回
if(type==ZCPageBlockGoBack){
NSLog(@"点击了关闭按钮");
}
//页面UI初始化完成,可以获取UIView,自定义UI
if(type==ZCPageBlockLoadFinish){
// object.topView.backgroundColor = kSysWhite;
//
// object.titleLabel.textColor = [UIColor colorWithHexString:@"333333"];
//
// //banner 返回按钮
// object.backButton.tintColor = [UIColor colorWithHexString:@"333333"];
// [object.backButton setTitle:@"返回" forState:UIControlStateNormal];
// [object.backButton setTitleColor:[UIColor colorWithHexString:@"333333"] forState:UIControlStateNormal];
[object.backButton setImage:[UIImage imageNamed:@"bac"] forState:UIControlStateNormal];
// object.backButton.titleLabel.font = [UIFont systemFontOfSize:18];
//banner 标题
//[object.titleLabel setFont:[UIFont systemFontOfSize:30]];
//banner 底部View
//[object.topView setBackgroundColor:[UIColor greenColor]];
//输入框
//UITextView *tv=[object getChatTextView];
//[tv setBackgroundColor:[UIColor redColor]];
}
//messageLinkClick ,不重写,系统自己跳转,sdk内部不做任何处理
} messageLinkClick:nil];
}
+ (void)customerUI:(ZCKitInfo *) kitInfo{
/**
* 自定义信息
*/
//顶部导航条标题文字 评价标题文字 系统相册标题文字 评价客服(立即结束 取消)按钮文字
// kitInfo.titleFont = [UIFont systemFontOfSize:30];
//返回按钮 输入框文字 评价客服是否有以下情况 label 文字 提价评价按钮
// kitInfo.listTitleFont = [UIFont systemFontOfSize:22];
//没有网络提醒的button 没有更多记录label的文字 语音输入的按钮文字 评价不满意(4个button)文字
//占位图片的lablel文字 语音输入时间label文字 语音tipLabel的文字 voiceButton标题文字
// kitInfo.listDetailFont = [UIFont systemFontOfSize:25];
//消息提醒 (转人工、客服接待等)
// kitInfo.listTimeFont = [UIFont systemFontOfSize:22];
//聊天气泡中的文字
// kitInfo.chatFont = [UIFont systemFontOfSize:22];
//聊天的背景颜色
// kitInfo.backgroundColor = [UIColor redColor];
//导航、客服气泡、线条的颜色
kitInfo.customBannerColor = kSysWhite;
//左边气泡的颜色
// kitInfo.leftChatColor = kCustomGreenColor;
//右边气泡的颜色
kitInfo.rightChatColor = kCustomGreenColor;
//底部bottom的背景颜色
kitInfo.backgroundBottomColor = kSysWhite;
//底部bottom的输入框线条背景颜色
//kitInfo.backgroundBottomLineColor = [UIColor redColor];
//提示气泡的背景颜色
// kitInfo.BgTipAirBubblesColor = [UIColor redColor];
//顶部文字的颜色
kitInfo.topViewTextColor = kTextColorDarkGray;
//提示气泡文字颜色
kitInfo.tipLayerTextColor = kTextColorDarkGray;
//左边气泡文字的颜色
kitInfo.leftChatTextColor = kTextColorDarkGray;
//右边气泡文字的颜色[注意:语音动画图片,需要单独替换]
// kitInfo.rightChatTextColor = [UIColor redColor];
//时间文字的颜色
// kitInfo.timeTextColor = [UIColor redColor];
//客服昵称颜色
// kitInfo.serviceNameTextColor = [UIColor redColor];
}
@end
......@@ -7,12 +7,13 @@
//
#import <UIKit/UIKit.h>
typedef void (^ActionBlock)(void);
@interface ShareContentView : UIView
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *url;
@property (nonatomic, copy) NSString *content;
@property (nonatomic, strong) UIImage *image;
@property (nonatomic, copy) ActionBlock clickBlock;
......
......@@ -11,8 +11,9 @@
@implementation ShareContentView
//分享到微信朋友
- (IBAction)shareToWeiChatSession:(id)sender {
self.clickBlock();
[UMSocialData defaultData].extConfig.wechatSessionData.url = self.url;
[UMSocialData defaultData].extConfig.wechatSessionData.title = self.title;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatSession] content:self.content image:self.image location:nil urlResource:nil presentedController:nil completion:^(UMSocialResponseEntity *response){
......@@ -23,7 +24,9 @@
}
//分享到微信朋友圈
- (IBAction)shareWxTimeLine:(id)sender {
self.clickBlock();
[UMSocialData defaultData].extConfig.wechatTimelineData.url = self.url;
[UMSocialData defaultData].extConfig.wechatTimelineData.title = self.content;
[[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToWechatTimeline] content:self.content image:self.image location:nil urlResource:nil presentedController:nil completion:^(UMSocialResponseEntity *response){
......
......@@ -35,11 +35,10 @@
WS(weakSelf)
self.cover.tapAction = ^{
[UIView animateWithDuration:0.3 animations:^{
CLog(@"animate");
weakSelf.shareContentView.frame = CGRectMake(0, kHeight, kWidth, 140);
}];
[weakSelf hide];
};
self.shareContentView.clickBlock = ^{
[weakSelf hide];
};
self.shareContentView.title = title;
......@@ -50,6 +49,15 @@
}
- (void)hide
{
[self.cover hide];
[UIView animateWithDuration:0.3 animations:^{
self.shareContentView.frame = CGRectMake(0, kHeight, kWidth, 140);
}];
}
- (CoverShadowView *)cover
{
if (!_cover) {
......@@ -70,6 +78,15 @@
return _shareContentView;
}
/**
* 分享店铺
*
* @param title 标题
* @param shopDescription 描述
* @param url 链接
* @param image 图片
* @param imageUrl 图片链接(判断图片链接是否存在,不存在则禁止分享)
*/
- (void)shareShopWithTitle:(NSString *)title shopDescription:(NSString *)shopDescription url:(NSString *)url image:(UIImage *)image imageUrl:(NSString *)imageUrl
{
if (!title || title.length == 0) {
......@@ -83,6 +100,7 @@
}
}
/** 邀请合伙人 */
- (void)invitePartner
{
NSString *urlStr = [NSString stringWithFormat:@"%@ShopUser/gpregister/invitationCode/%@.html", [UserInfo shareInstance].webShopBaseUrl, [UserInfo shareInstance].invitationCode];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment