Commit d0f61292 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

mob event

parent 7504dca6
No preview for this file type
......@@ -984,8 +984,8 @@
A9C2B8D624D039B400010EAE /* ZJJinJiViewController.m */,
A9C2B8D524D039B400010EAE /* ZJXiaoXiViewController.h */,
A9C2B8D124D039B400010EAE /* ZJXiaoXiViewController.m */,
A9C2B8D424D039B400010EAE /* ZJTianJiaViewController.m */,
A9C2B8DA24D039B400010EAE /* ZJTianJiaViewController.h */,
A9C2B8D424D039B400010EAE /* ZJTianJiaViewController.m */,
);
path = Controller;
sourceTree = "<group>";
......
......@@ -48,7 +48,7 @@
[AMapServices sharedServices].apiKey = @"501f8a894329f4b57bbfee208a11676f";
[UMConfigure initWithAppkey:@"5f02fdef167edd8d94000012" channel:nil];
[UMConfigure initWithAppkey:@"5f2291bcb4b08b653e8fd2a2" channel:nil];
[MobClick event:@"app_start"];
BuglyConfig * config = [[BuglyConfig alloc] init];
......
......@@ -255,7 +255,8 @@
}
- (void)showFriendSet:(ZJFriendModel *)model {
[MobClick event:@"addfriends_show_unlock_dialog"];
__weak typeof(self) weakSelf = self;
friend = [[ZJFriendSettingView alloc] init];
......
......@@ -400,6 +400,7 @@
}
- (void)myTrack{
[MobClick event:@"home_mycard_click"];
ZJFriendTrackMapViewController *trackMapVc = [[ZJFriendTrackMapViewController alloc] init];
trackMapVc.isMyTrack = YES;
[self.navigationController showViewController:trackMapVc sender:nil];
......
......@@ -99,6 +99,7 @@
NSLog(@"添加关心的人");
[self logCollection];
[MobClick event:@"home_addfriend_click"];
[MobClick event:@"add_person"];
ZJTianJiaViewController *tianJiaVC = [[ZJTianJiaViewController alloc] init];
[self.navigationController pushViewController:tianJiaVC animated:YES];
}
......
......@@ -117,6 +117,7 @@
#pragma mark 发送信息给所有紧急联系人
- (void)sendAllEmergencyContact{
[MobClick event:@"alert"];
if (![ZJUserInfoManager shared].isLogin) {
// [MBProgressHUD showMessage:@"请先进行登录"];
ZJOauthLoginConfig * config = [[ZJOauthLoginConfig alloc] initWithCurrentVC:self];
......
......@@ -280,6 +280,7 @@
[self.tongYButton setTitle:@"购买前请先阅读并同意《海豚守护付费会员服务协议》" forState:0];
[self.tongYButton setTitleColor:[UIColor colorWithHex:0x666666] forState:UIControlStateNormal];
[self.tongYButton.titleLabel setFont:[UIFont systemFontOfSize:KFont(13)]];
self.tongYButton.titleLabel.adjustsFontSizeToFitWidth = YES;
[self.beiJingView addSubview:self.tongYButton];
[self.tongYButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.xuanZheButoon.mas_right).mas_offset(KScaleWidth(5));
......@@ -315,6 +316,7 @@
[MBProgressHUD showError:@"获取产品信息失败"];
return;
}
// dolphinsguard_lifetime_vip
[ZTPurchaseManager purchaseWithProductIdWithProductId:productId inView:self.view success:^{
if (self.payFinish) {
......
......@@ -91,6 +91,7 @@
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:modelDic options:NSJSONWritingPrettyPrinted error:nil];
NSString * string = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
[MobClick event:@"low_power_switch_click"];
[[TQNetworkTools shared] postWithAction:userRemindInfoSet parameters:@{@"":string} success:^(id _Nonnull response) {
NSString *result = [[NSString alloc] initWithData:response
......
......@@ -138,9 +138,9 @@
if(![ZJUserInfoManager shared].userInfoModel.isMember){
[[ZJGoodsMagager shared] goodsWithVC:self callBack:^(id _Nonnull s) {
[[ZJUserInfoManager shared] updataUserInfo:^(ZJMineUserInfoModel * _Nonnull model) {
} failure:^(id _Nonnull error) {
}];
}];
return;
......@@ -148,6 +148,7 @@
switch (sender.tag-0x64) {
case 0:{
[MobClick event:@"friends_location_card_click"];
NSDictionary * switchDic = [[self.data Read] objectForKey:@"switch"];
BOOL map_style2 = switchDic && [[NSString stringWithFormat:@"%@",[switchDic objectForKey:@"map_page_style"]] isEqualToString:@"1"];
......@@ -157,11 +158,13 @@
}
break;
case 1:{
[MobClick event:@"place_remind_card_click"];
ZJLocationAttentionVC * vc = [ZJLocationAttentionVC new];
[self.navigationController pushViewController:vc animated:YES];
}
break;
case 2:{
[MobClick event:@"low_power_card_click"];
ZJElectricalRemindVC * remind = [[UIStoryboard storyboardWithName:@"Guard" bundle:nil] instantiateViewControllerWithIdentifier:@"ZJElectricalRemindVC"];
[self.navigationController pushViewController:remind animated:YES];
}
......@@ -230,15 +233,21 @@
if(![ZJUserInfoManager shared].userInfoModel.isMember){
[[ZJGoodsMagager shared] goodsWithVC:self callBack:^(id _Nonnull s) {
[[ZJUserInfoManager shared] updataUserInfo:^(ZJMineUserInfoModel * _Nonnull model) {
} failure:^(id _Nonnull error) {
}];
}];
return;
}
if (indexPath.row < 4){
NSArray * event = @[@"vegetable_click", @"getup_click", @"fruit_click", @"Water_click"];
[MobClick event:event[indexPath.row]];
}
if (indexPath.row == self.dataSource.count - 1) {
[MobClick event:@"add_remind_click"];
ZJAddReminderController *vc = [ZJAddReminderController new];
[self.navigationController pushViewController:vc animated:YES];
}else{
......
......@@ -32,7 +32,7 @@
<rect key="frame" x="107" y="15" width="200" height="194"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Uob-FV-s6z">
<rect key="frame" x="79" y="598.5" width="256.5" height="57.5"/>
<rect key="frame" x="79" y="435" width="256.5" height="57.5"/>
<state key="normal" image="LocationHint_back_btn_select"/>
<state key="selected" image="LocationHint_back_btn_selected"/>
<connections>
......@@ -62,13 +62,14 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="chR-61-Bcl" firstAttribute="centerX" secondItem="j5y-pY-6pp" secondAttribute="centerX" id="CSP-9Z-apR"/>
<constraint firstItem="Uob-FV-s6z" firstAttribute="top" secondItem="9E9-pW-Lib" secondAttribute="bottom" constant="80" id="Dx2-tr-cB3"/>
<constraint firstItem="9E9-pW-Lib" firstAttribute="top" secondItem="chR-61-Bcl" secondAttribute="bottom" constant="20" id="KIr-bb-Qf1"/>
<constraint firstItem="9E9-pW-Lib" firstAttribute="centerX" secondItem="chR-61-Bcl" secondAttribute="centerX" id="YEm-z9-yB6"/>
<constraint firstItem="j5y-pY-6pp" firstAttribute="centerX" secondItem="jqH-qv-uUS" secondAttribute="centerX" id="a0s-5I-zzr"/>
<constraint firstItem="chR-61-Bcl" firstAttribute="top" secondItem="j5y-pY-6pp" secondAttribute="bottom" constant="42" id="csD-Mf-xFw"/>
<constraint firstItem="j5y-pY-6pp" firstAttribute="top" secondItem="jqH-qv-uUS" secondAttribute="top" constant="15" id="p8K-u9-NQh"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Uob-FV-s6z" secondAttribute="bottom" constant="44" id="pVR-te-71u"/>
<constraint firstItem="Uob-FV-s6z" firstAttribute="centerX" secondItem="j5y-pY-6pp" secondAttribute="centerX" id="rcn-3A-ghJ"/>
<constraint firstItem="Uob-FV-s6z" firstAttribute="centerY" secondItem="jqH-qv-uUS" secondAttribute="centerY" multiplier="1.4" id="rpc-Bw-EIf"/>
</constraints>
</view>
</subviews>
......
......@@ -177,7 +177,7 @@
- (void)uploadLog:(NSInteger)index{
NSArray * array = @[@"我关心的人", @"定位", @"我的"];
NSArray * array = @[@"tabbar_myconcern_person", @"tabbar_map", @"tabbar_my"];
NSMutableDictionary *dict = @{@"event": @"guazinovel", @"action": @"tab_imp", @"value": array[index]}.mutableCopy;
......
......@@ -127,19 +127,14 @@
if (_payInfo){
NSDictionary * switchDic = [[self.data Read] objectForKey:@"switch"];
NSString * jsonStr;
if ([[switchDic objectForKey:@"isLadderPay"] isEqual:@1]) {
NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:_payInfo
options:0
error:&error];
jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}else{
jsonStr = [NSString stringWithFormat:@"{\"agree\":\"%@\",\"payUrl\":\"%@\",\"price\":\"%@\",\"serviceUrl\":\"%@\",\"hintStyle\":\"%@\",\"hintStyleDes\":\"%@\"}", [_payInfo objectForKey:@"agree"], [_payInfo objectForKey:@"payUrl"], [_payInfo objectForKey:@"price"], [_payInfo objectForKey:@"serviceUrl"], [_payInfo objectForKey:@"hintStyle"], [_payInfo objectForKey:@"hintStyleDes"]];
}
NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:_payInfo
options:0
error:&error];
jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSString *inputValueJS = [NSString stringWithFormat:@"getPayJson('%@')", jsonStr];
[webView evaluateJavaScript:inputValueJS completionHandler:^(id _Nullable response, NSError * _Nullable error) {
......@@ -200,7 +195,14 @@
- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *__nullable credential))completionHandler{
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling ,nil);
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
NSURLCredential *credential = [[NSURLCredential alloc]initWithTrust:challenge.protectionSpace.serverTrust];
completionHandler(NSURLSessionAuthChallengeUseCredential,credential);
}else{
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling ,nil);
}
}
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures{
......@@ -222,12 +224,7 @@
if([message.name isEqualToString:@"OCJSBridge"]){
[self share];
}else if ([message.name isEqualToString:@"payResultCallBack"]){
NSDictionary * switchDic = [[self.data Read] objectForKey:@"switch"];
if ([[switchDic objectForKey:@"isLadderPay"] isEqual:@1]) {
[self orderVerify:message.body];
}else{
[self orderVerify:nil];
}
[self orderVerify:message.body];
}else if ([message.name isEqualToString:@"protocolSelectedResultCallBack"]){
NSString * result = message.body;
[_payInfo setValue:result forKey:@"agree"];
......
......@@ -107,6 +107,7 @@
//添加关心的人
- (void)addCardFriend {
[MobClick event:@"add_person"];
ZJTianJiaViewController *tianJiaVC = [[ZJTianJiaViewController alloc] init];
[self.navigationController pushViewController:tianJiaVC animated:YES];
}
......
......@@ -38,6 +38,7 @@
//添加关心的人
- (void)addCardFriend {
[self logCollection];
[MobClick event:@"add_person"];
ZJTianJiaViewController *tianJiaVC = [[ZJTianJiaViewController alloc] init];
[self.navigationController pushViewController:tianJiaVC animated:YES];
}
......
......@@ -43,6 +43,7 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
[super viewDidLoad];
// Do any additional setup after loading the view.
[MobClick event:@"place_remind_add_click"];
[self setupUI];
[self requestData];
}
......@@ -119,6 +120,14 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
dict[@"weekSetting"] = self.weekSetting;
NSString *json = [self convertToJsonData:dict];
NSLog(@"%@",json);
NSArray * event = @[@"vegetable_add_remind_save", @"getup_add_remind_save", @"fruit_add_remind_save", @"Water_add_remind_save"];
if (self.model.id-2>=0 || self.model.id-2<4) {
[MobClick event:event[self.model.id-2]];
}else{
[MobClick event:@"add_remind_click"];
}
[[TQNetworkTools shared] postWithBodyAction:userRemindInfoSet parameters:@{} body:dict success:^(NSDictionary * _Nonnull response) {
if ([response[@"status"] intValue] == 200) {
[MBProgressHUD showMessage:@"添加成功"];
......@@ -171,7 +180,9 @@ static NSString * const ZJReminderFooterViewID = @"ZJReminderFooterViewID";
{// 关心的人
ZJReminderCareController *vc = [ZJReminderCareController new];
__weak typeof(self) weakSelf = self;
[MobClick event:@"place_remind_selectfriend_click"];
vc.backData = ^(ZJFriendModel * _Nonnull model) {
[MobClick event:@"place_remind_none_addfriends_click"];
weakSelf.friendModel = model;
if (weakSelf.dataArray.count) {
ZJChooseIcon *item = weakSelf.dataArray[0];
......
......@@ -100,14 +100,7 @@ static ZJGoodsMagager * manager;
_callBack = callBack;
_currentVC = currentVC;
if ([self.products firstObject]) {
NSDictionary * switchDic = [[self.data Read] objectForKey:@"switch"];
if ([[switchDic objectForKey:@"isLadderPay"] isEqual:@1]) {
[self getUrl_new:0];
}else{
[self getUrl:[self.products firstObject]];
}
[self getUrl_new:0];
}else{
[self getGoods];
}
......@@ -137,13 +130,8 @@ static ZJGoodsMagager * manager;
}
}
if ([self.products firstObject]) {
NSDictionary * switchDic = [[self.data Read] objectForKey:@"switch"];
if ([[switchDic objectForKey:@"isLadderPay"] isEqual:@1]) {
[self getUrl_new:0];
}else{
[self getUrl:[self.products firstObject]];
}
[self getUrl_new:0];
}
}
} failure:^(NSError * _Nonnull error) {
......@@ -157,37 +145,6 @@ static ZJGoodsMagager * manager;
}];
}
- (void)getUrl:(ZJIPAProductModel *)model{
[MBProgressHUD showLoading:@"请稍后..." toView:_currentVC.view];
[[TQNetworkTools shared] postWithAction:userPay parameters:@{@"payPlatform":@"1", @"goodsId":[NSString stringWithFormat:@"%ld", (long)model.goodsId], @"payType":@"2", @"wxType":@"H5"} success:^(id _Nonnull response) {
[MBProgressHUD hideHUDForView:self.currentVC.view];
if ([response[@"status"] integerValue] == 200 && ![[[response objectForKey:@"result"] objectForKey:@"data"] isKindOfClass:[NSNull class]]) {
[self webGoods:response good:model tradeNo:response[@"result"][@"data"][@"wakeup"][@"extData"]];
}else{
if (self.tradeNoCount < 3) {
[self getUrl:[self.products firstObject]];
self.tradeNoCount++;
NSError * error = [NSError errorWithDomain:NSCocoaErrorDomain code:998 userInfo:nil];
[Bugly reportError:error];
}
}
} failure:^(NSError * _Nonnull error) {
[MBProgressHUD hideHUDForView:self.currentVC.view];
// [MBProgressHUD showError:@"商品信息获取失败,请稍后再试" toView:self.currentVC.view];
if (self.tradeNoCount < 3) {
[self getUrl:[self.products firstObject]];
self.tradeNoCount++;
NSError * error = [NSError errorWithDomain:NSCocoaErrorDomain code:999 userInfo:nil];
[Bugly reportError:error];
}
}];
}
- (void)getUrl_new:(NSInteger)index{
ZJIPAProductModel *model = self.products[index];
[MBProgressHUD showLoading:@"请稍后..." toView:_currentVC.view];
......@@ -241,38 +198,6 @@ static ZJGoodsMagager * manager;
}];
}
- (void)webGoods:(id)response good:(ZJIPAProductModel *)model tradeNo:(NSString *)tradeNo{
NSDictionary * dic = [ZJUserInfoManager shared].h5_url;
NSDictionary * switchDic = [[self.data Read] objectForKey:@"switch"];
NSString * string = [NSString stringWithFormat:@"%@&redirect_url=%@", [[[response[@"result"] objectForKey:@"data"]objectForKey:@"wakeup"] objectForKey:@"mwebUrl"], [dic objectForKey:@"WXbackUrl"]];
NSString * serviceUrl = [dic objectForKey:@"pay"] ? : @"";
NSString * agree = [switchDic objectForKey:@"wd_agreement_selected"] ? : @"";
NSString * price = [NSString stringWithFormat:@"%.2f", (float)model.fen/100];
NSString * hintStyle = [[self.data Read] objectForKey:@"hintStyle"]?:@"99";
NSString * hintStyleDes = [[self.data Read] objectForKey:@"hintStyleDes"]?:@"";
_web = [[BaseWebViewController alloc] init];
_web.url = [dic objectForKey:@"appPayUrl"];
_web.payInfo = @{@"payUrl":string, @"serviceUrl":serviceUrl, @"agree":agree, @"price":price, @"hintStyle":hintStyle, @"hintStyleDes":hintStyleDes}.mutableCopy;
_web.tradeNo = tradeNo;
_web.schemes = [dic objectForKey:@"WXbackUrl"];
[_currentVC.navigationController pushViewController:_web animated:YES];
__weak typeof(self) weakSelf = self;
_web.goodsResultCallback = ^(id s) {
if (weakSelf.callBack) {
weakSelf.callBack(@"");
};
[weakSelf.web.navigationController popViewControllerAnimated:YES];
};
[[NSNotificationCenter defaultCenter] addObserver:_web selector:@selector(isLoadGoodsUrl) name:@"loadingGoodsUrl" object:nil];
}
- (void)webGoods_new:(id)response{
NSDictionary * dic = [ZJUserInfoManager shared].h5_url;
......@@ -286,12 +211,7 @@ static ZJGoodsMagager * manager;
NSString * hintStyleDes = [[self.data Read] objectForKey:@"hintStyleDes"]?:@"";
_web = [[BaseWebViewController alloc] init];
_web.url = [dic objectForKey:@"appPayUrl"];
if ([[switchDic objectForKey:@"isLadderPay"] isEqual:@1]) {
_web.url = [dic objectForKey:@"LadderPayUrl"];
}else{
_web.url = [dic objectForKey:@"appPayUrl"];
}
_web.url = [dic objectForKey:@"LadderPayUrl"];
_web.payInfo = @{@"goodsInfo":self.goodsInfo,@"serviceUrl":serviceUrl,@"userUrl":userUrl,@"privacyUrl":privacyUrl,@"agree":agree,@"hintStyle":hintStyle,@"hintStyleDes":hintStyleDes}.mutableCopy;
_web.schemes = [dic objectForKey:@"WXbackUrl"];
[_currentVC.navigationController pushViewController:_web animated:YES];
......
......@@ -51,7 +51,7 @@
<string></string>
<key>CFBundleURLSchemes</key>
<array>
<string>h5v2.zhangxinzhixun.com</string>
<string>h5v1.zhangxinzhixun.com</string>
</array>
</dict>
</array>
......
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