|
|
@@ -10,6 +10,45 @@
|
|
|
#import "RAUtils.h"
|
|
|
#import "OLDataProvider.h"
|
|
|
#import "Singleton.h"
|
|
|
+#import "GoogleAnalyst.h"
|
|
|
+#import "ERPUtils.h"
|
|
|
+
|
|
|
+
|
|
|
+NSString *const kScreenName = @"kScreenName";
|
|
|
+NSString *const kAction = @"kAction";
|
|
|
+NSString *const kExtra = @"kExtra";
|
|
|
+
|
|
|
+
|
|
|
+NSString *const ScreenCodeLoginView = @"Login Screen";
|
|
|
+NSString *const ScreenCodeHomeView = @"Home Screen";
|
|
|
+NSString *const ScreenCodeCategory = @"Category Screen";
|
|
|
+NSString *const ScreenCodeCart = @"Cart Sceen";
|
|
|
+NSString *const ScreenCodeOrderList = @"Order History Screen";
|
|
|
+NSString *const ScreenCodeSearch = @"Search Screen";
|
|
|
+NSString *const ScreenCodeAccount = @"Account Screen";
|
|
|
+NSString *const ScreenCodeWishList = @"Wish List Screen";
|
|
|
+NSString *const ScreenCodePortfolio = @"Portfolio Screen";
|
|
|
+NSString *const ScreenCodeViewPortfolios = @"View Portfolios Screen";
|
|
|
+NSString *const ScreenCodeCamScan = @"Cam Scan Screen";
|
|
|
+NSString *const ScreenCodeScannerSetting = @"Scanner Setting Screen";
|
|
|
+NSString *const ScreenCodeOfflineSetting = @"Offline Setting Screen";
|
|
|
+NSString *const ScreenCodePlaceOrder = @"Place Order Screen";
|
|
|
+NSString *const ScreenCodeCustomerInfo = @"Customer Information Screen";
|
|
|
+NSString *const ScreenCodeNewCustomer = @"New Customer Screen";
|
|
|
+NSString *const ScreenCodeEditCustomer = @"Edit Customer Information Screen";
|
|
|
+NSString *const ScreenCodeModelInfo = @"Model Information Screen";
|
|
|
+NSString *const ScreenCodeOrderInfo = @"Order Information Screeen";
|
|
|
+NSString *const ScreenCodeUserSign = @"User Sign Screen";
|
|
|
+NSString *const ScreenCodeNewAddress = @"New Address Screen";
|
|
|
+NSString *const ScreenCodeAdvanceSearch = @"Account Advance Search Screen";
|
|
|
+NSString *const ScreenCodeCreatePortfolio = @"Create Portfolio Screen";
|
|
|
+NSString *const ScreenCodeParticularCategory = @"Particular Category Screen";
|
|
|
+NSString *const ScreenCodeEditPortfolio = @"Edit Portfolio Screen";
|
|
|
+NSString *const ScreenCodePriceSetting = @"Price Setting Screen";
|
|
|
+NSString *const ScreenCodeCategoryPrice = @"Category Price Screen";
|
|
|
+NSString *const ScreenCodeSetCatetoryPrice = @"Set Category Price Screen";
|
|
|
+NSString *const ScreenCodeUploadImage = @"Upload Image Screen";
|
|
|
+NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
|
|
|
|
|
|
@implementation iSalesNetwork
|
|
|
|
|
|
@@ -128,7 +167,15 @@
|
|
|
[params setValue:uuid.UUIDString forKey:@"idfv"];
|
|
|
#endif
|
|
|
|
|
|
-
|
|
|
+ NSString *screenName = [params valueForKey:kScreenName];
|
|
|
+ NSString *userAction = [params valueForKey:kAction];
|
|
|
+ NSMutableDictionary *extra = [[params valueForKey:kExtra] mutableCopy];
|
|
|
+ if ([userAction isEqualToString:@"Login"]) {
|
|
|
+ if (!extra) {
|
|
|
+ extra = [NSMutableDictionary dictionary];
|
|
|
+ }
|
|
|
+ [extra setObject:[params objectForKey:@"user"] forKey:@"user"];
|
|
|
+ }
|
|
|
|
|
|
repeat:
|
|
|
{
|
|
|
@@ -283,6 +330,9 @@ repeat:
|
|
|
{
|
|
|
[iSalesNetwork err_log:[RAUtils base64en:[RAUtils dict2string:params]] result:[RAUtils base64en:[RAUtils dict2string:ret]] module:url code:RESULT_NET_ERROR];
|
|
|
}
|
|
|
+#ifdef BUILD_NPD
|
|
|
+ [ERPUtils googleAnalyticsSendRequestString:url WithScreen:screenName Action:userAction Extra:extra];
|
|
|
+#endif
|
|
|
return jsonData;
|
|
|
|
|
|
}
|
|
|
@@ -347,9 +397,13 @@ repeat:
|
|
|
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsobj
|
|
|
options:0
|
|
|
error:nil];
|
|
|
+#ifdef BUILD_NPD
|
|
|
+ [ERPUtils googleAnalyticsSendRequestString:url WithScreen:screenName Action:userAction Extra:extra];
|
|
|
+#endif
|
|
|
return jsonData;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
return responseData;
|
|
|
}
|
|
|
}
|
|
|
@@ -387,6 +441,9 @@ repeat:
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
[params setValue:listid forKey:@"tearsheetsId"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+ [params setValue:ScreenCodeViewPortfolios forKey:kScreenName];
|
|
|
+// [params setValue:@"Delete Portfolio" forKey:kAction];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -422,6 +479,9 @@ repeat:
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
[params setValue:item_ids forKey:@"portfolioId"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodePortfolio forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -465,6 +525,8 @@ repeat:
|
|
|
[params setValue:item_ids forKey:@"collectId"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
|
|
|
+ [params setValue:ScreenCodeWishList forKey:kScreenName];
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
return [OLDataProvider offline_deletewishlist:params];
|
|
|
@@ -507,6 +569,10 @@ repeat:
|
|
|
[params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
[params setValue:item_ids forKey:@"cartItemId"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeCart forKey:kScreenName];
|
|
|
+// [params setValue:@"Cart Move To Wish List" forKey:kAction];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -553,6 +619,10 @@ repeat:
|
|
|
[params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
[params setValue:item_ids forKey:@"collectId"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeWishList forKey:kScreenName];
|
|
|
+ [params setValue:@"Move To Cart" forKey:kAction];
|
|
|
+
|
|
|
NSData *json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -600,6 +670,10 @@ repeat:
|
|
|
[params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
[params setValue:item_ids forKey:@"cartItemId"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeCart forKey:kScreenName];
|
|
|
+// [params setValue:@"" forKey:kAction];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -676,6 +750,9 @@ repeat:
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeNewAddress forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -716,6 +793,9 @@ repeat:
|
|
|
[params setValue:order_code forKey:@"code"];
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeOrderInfo forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -756,6 +836,9 @@ repeat:
|
|
|
[params setValue:path forKey:@"picpath"];
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeUserSign forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -796,6 +879,8 @@ repeat:
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
|
|
|
+ [params setValue:ScreenCodePlaceOrder forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -834,6 +919,8 @@ repeat:
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
|
|
|
+ [params setValue:ScreenCodeOrderInfo forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -888,6 +975,9 @@ repeat:
|
|
|
[params setValue:order_id forKey:@"orderId"];
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeOrderList forKey:kScreenName];
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
return [OLDataProvider offline_notimpl];
|
|
|
@@ -923,6 +1013,9 @@ repeat:
|
|
|
[params setValue:order_code forKey:@"orderCode"];
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setValue:ScreenCodeOrderList forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -945,7 +1038,7 @@ repeat:
|
|
|
else
|
|
|
return nil;
|
|
|
}
|
|
|
-+(NSDictionary*)release_Order:(NSString*) order_code
|
|
|
++(NSDictionary*)release_Order:(NSString*) order_code withScreen:(NSString *)screenName
|
|
|
{
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
@@ -959,6 +1052,11 @@ repeat:
|
|
|
[params setValue:order_code forKey:@"orderCode"];
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ if (screenName) {
|
|
|
+ [params setValue:screenName forKey:kScreenName];
|
|
|
+ }
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -1001,6 +1099,8 @@ repeat:
|
|
|
if(appDelegate.password!=nil)
|
|
|
[info setValue:appDelegate.password forKey:@"password"];
|
|
|
|
|
|
+ [info setObject:ScreenCodeEditCustomer forKey:kScreenName];
|
|
|
+
|
|
|
[info setValue:order_code forKey:@"orderCode"];
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
@@ -1045,6 +1145,9 @@ repeat:
|
|
|
//
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeModelInfo forKey:kScreenName];
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
params[@"offline_Command"]=url;
|
|
|
@@ -1092,6 +1195,9 @@ repeat:
|
|
|
//
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodePlaceOrder forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -1151,6 +1257,7 @@ repeat:
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeEditCustomer forKey:kScreenName];
|
|
|
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -1207,6 +1314,9 @@ repeat:
|
|
|
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeNewCustomer forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -1266,6 +1376,9 @@ repeat:
|
|
|
|
|
|
// [params setValue:sourceid forKey:@"sourceid"];
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodePlaceOrder forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -1316,6 +1429,31 @@ repeat:
|
|
|
// [params setValue:editor forKey:@"editor"];
|
|
|
DebugLog(@"request editor url:%@",request_url);
|
|
|
|
|
|
+
|
|
|
+ if([request_url isEqualToString:URL_NEW_CUSTOMER])
|
|
|
+ {
|
|
|
+ [params setObject:ScreenCodeNewCustomer forKey:kScreenName];
|
|
|
+ }
|
|
|
+ else if([request_url isEqualToString:URL_EDIT_CUSTOMER])
|
|
|
+ {
|
|
|
+ [params setObject:ScreenCodeEditCustomer forKey:kScreenName];
|
|
|
+ }
|
|
|
+ else if([request_url isEqualToString:URL_CUSTOMER_ADV_SEARCH])
|
|
|
+ {
|
|
|
+ [params setObject:ScreenCodeAdvanceSearch forKey:kScreenName];
|
|
|
+ }
|
|
|
+ else if([request_url isEqualToString:URL_CARTDELIVERY])
|
|
|
+ {
|
|
|
+ [params setObject:ScreenCodePlaceOrder forKey:kScreenName];
|
|
|
+ }
|
|
|
+ else if([request_url isEqualToString:URL_ADDRESS_EDOTOR])
|
|
|
+ {
|
|
|
+ [params setObject:ScreenCodeNewAddress forKey:kScreenName];
|
|
|
+ }
|
|
|
+ else if ([request_url isEqualToString:URL_DM_PARAMS]){
|
|
|
+ [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
|
|
|
+ }
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -1424,6 +1562,12 @@ repeat:
|
|
|
[params setValue:[NSNumber numberWithBool:isMerged] forKey:@"isMerged"];
|
|
|
|
|
|
[params setValue:status_code forKey:@"orderStatus"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeOrderList forKey:kScreenName];
|
|
|
+ if (keywords) {
|
|
|
+ [params setObject:@"Search" forKey:kAction];
|
|
|
+ }
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -1467,6 +1611,11 @@ repeat:
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",limit] forKey:@"limit"];
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",offset] forKey:@"offset"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeViewPortfolios forKey:kScreenName];
|
|
|
+ if (keywords) {
|
|
|
+ [params setObject:@"Search" forKey:kAction];
|
|
|
+ }
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -1515,6 +1664,9 @@ repeat:
|
|
|
[params setValue:appDelegate.contact_id forKey:@"contactId"];
|
|
|
if(appDelegate.password!=nil)
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
|
|
|
+
|
|
|
/*
|
|
|
[params setValue:request_url forKey:@"pdfUrl"];
|
|
|
[params setValue:name forKey:@"pdfName"];
|
|
|
@@ -1577,6 +1729,8 @@ repeat:
|
|
|
if(appDelegate.password!=nil)
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
|
|
|
+
|
|
|
// [params setValue:request_url forKey:@"pdfUrl"];
|
|
|
NSData* json= nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -1631,6 +1785,9 @@ repeat:
|
|
|
[params setValue:appDelegate.contact_id forKey:@"contactId"];
|
|
|
if(appDelegate.password!=nil)
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
|
|
|
+
|
|
|
/*
|
|
|
[params setValue:path forKey:@"pdfPath"];
|
|
|
[params setValue:name forKey:@"pdfName"];
|
|
|
@@ -1717,6 +1874,14 @@ repeat:
|
|
|
[params setValue:contact_type forKey:@"contactType"];
|
|
|
[params setValue:keywords forKey:@"keyword"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeAccount forKey:kScreenName];
|
|
|
+ if (keywords) {
|
|
|
+ [params setObject:@"Search" forKey:kAction];
|
|
|
+ }
|
|
|
+ if (upparams) {
|
|
|
+ [params setObject:@"Advance Search" forKey:kAction];
|
|
|
+ }
|
|
|
+
|
|
|
NSString* url=nil;
|
|
|
if([contact_type isEqualToString:@"Sales_Order_Ship_To"])
|
|
|
url=URL_SHIPTO_LIST;
|
|
|
@@ -1749,6 +1914,9 @@ repeat:
|
|
|
|
|
|
[params setValue:orderid forKey:@"orderId"];
|
|
|
// [params setValue:[NSString stringWithFormat:@"%d",limit ] forKey:@"limit"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeOrderInfo forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -1790,7 +1958,7 @@ repeat:
|
|
|
NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
|
|
|
return jsobj;
|
|
|
}
|
|
|
-+(NSDictionary*) add_toCart:(NSString* ) item_id count:(int) count
|
|
|
++(NSDictionary*) add_toCart:(NSString* ) item_id count:(int) count name:(NSString *)name
|
|
|
{
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
@@ -1806,6 +1974,12 @@ repeat:
|
|
|
[params setValue:item_id forKey:@"product_id"];
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",count] forKey:@"count"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeModelInfo forKey:kScreenName];
|
|
|
+ [params setObject:@"Add To Cart" forKey:kAction];
|
|
|
+ if (name) {
|
|
|
+ NSDictionary *extra = @{@"ModelName" : name,@"Count" : @(count)};
|
|
|
+ [params setObject:extra forKey:kExtra];
|
|
|
+ }
|
|
|
|
|
|
NSDictionary* customerinfo= appDelegate.customerInfo;
|
|
|
|
|
|
@@ -1849,7 +2023,7 @@ repeat:
|
|
|
return jsobj;
|
|
|
}
|
|
|
|
|
|
-+(NSDictionary*) add_toCart_byName:(NSString* ) model_name
|
|
|
++(NSDictionary*) add_toCart_byName:(NSString* ) model_name withScreen:(NSString *)screenName
|
|
|
{
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
@@ -1865,6 +2039,9 @@ repeat:
|
|
|
[params setValue:model_name forKey:@"product_name"];
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",-1] forKey:@"count"];
|
|
|
|
|
|
+ [params setObject:screenName forKey:kScreenName];
|
|
|
+ [params setObject:@"Add To Cart" forKey:kAction];
|
|
|
+ [params setObject:@{@"ModelName" : model_name} forKey:kExtra];
|
|
|
|
|
|
NSDictionary* customerinfo= appDelegate.customerInfo;
|
|
|
|
|
|
@@ -1954,6 +2131,8 @@ repeat:
|
|
|
[params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
|
|
|
|
|
|
+ [params setObject:ScreenCodeOrderList forKey:kScreenName];
|
|
|
+
|
|
|
NSDictionary* customerinfo= appDelegate.customerInfo;
|
|
|
|
|
|
NSArray* keys=[customerinfo allKeys];
|
|
|
@@ -1998,7 +2177,7 @@ repeat:
|
|
|
|
|
|
return jsobj;
|
|
|
}
|
|
|
-+(NSDictionary*) add_toPortfolio:(NSString* ) item_id
|
|
|
++(NSDictionary*) add_toPortfolio:(NSString* ) item_id withScreen:(NSString *)screenName
|
|
|
{
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
@@ -2011,6 +2190,8 @@ repeat:
|
|
|
|
|
|
[params setValue:item_id forKey:@"product_id"];
|
|
|
|
|
|
+ [params setObject:screenName forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -2039,7 +2220,7 @@ repeat:
|
|
|
}
|
|
|
return jsobj;
|
|
|
}
|
|
|
-+(NSDictionary*) add_toWatchList:(NSString* ) item_id
|
|
|
++(NSDictionary*) add_toWatchList:(NSString* ) item_id withScreen:(NSString *)screenName
|
|
|
{
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
@@ -2050,7 +2231,11 @@ repeat:
|
|
|
if(appDelegate.password!=nil)
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
|
|
|
+
|
|
|
[params setValue:item_id forKey:@"product_id"];
|
|
|
+
|
|
|
+ [params setObject:screenName forKey:kScreenName];
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
return [OLDataProvider offline_add2wishlist:params];
|
|
|
@@ -2093,6 +2278,9 @@ repeat:
|
|
|
[params setValue:[NSString stringWithFormat:@"%f",price] forKey:@"price"];
|
|
|
|
|
|
[params setValue:[NSString stringWithFormat:@"%f",discount] forKey:@"discount"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeCart forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json= nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -2166,6 +2354,8 @@ repeat:
|
|
|
if(qty != -INT32_MAX)
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",qty] forKey:@"available_qty"];
|
|
|
|
|
|
+ [params setObject:ScreenCodePortfolio forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -2196,6 +2386,8 @@ repeat:
|
|
|
|
|
|
[params setValue:order_code forKey:@"orderCode"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeCart forKey:kScreenName];
|
|
|
+
|
|
|
if(notes.length==0)
|
|
|
notes=@"";
|
|
|
|
|
|
@@ -2232,6 +2424,8 @@ repeat:
|
|
|
|
|
|
[params setValue:cart_id forKey:@"cartitem_id"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeCart forKey:kScreenName];
|
|
|
+
|
|
|
if(notes.length==0)
|
|
|
notes=@"";
|
|
|
|
|
|
@@ -2268,7 +2462,7 @@ repeat:
|
|
|
|
|
|
[params setValue:cart_id forKey:@"cartitem_id"];
|
|
|
|
|
|
-
|
|
|
+ [params setObject:ScreenCodeCart forKey:kScreenName];
|
|
|
|
|
|
NSString* free=nil;
|
|
|
|
|
|
@@ -2306,6 +2500,7 @@ repeat:
|
|
|
|
|
|
[params setValue:cart_id forKey:@"cartitem_id"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeCart forKey:kScreenName];
|
|
|
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",value] forKey:@"inputInt"];
|
|
|
|
|
|
@@ -2368,6 +2563,9 @@ repeat:
|
|
|
return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
|
|
|
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeOfflineSetting forKey:kScreenName];
|
|
|
+
|
|
|
// AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
// if(appDelegate.user!=nil)
|
|
|
@@ -2402,6 +2600,9 @@ repeat:
|
|
|
return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
|
|
|
|
|
|
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeOfflineSync forKey:kScreenName];
|
|
|
+
|
|
|
// AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
// if(appDelegate.user!=nil)
|
|
|
@@ -2449,6 +2650,9 @@ repeat:
|
|
|
[params setValue:@"true" forKey:@"internal_address"];
|
|
|
else
|
|
|
[params setValue:@"false" forKey:@"internal_address"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeOfflineSync forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=[self get_json:URL_CHECK_OFFLINE parameters:params];
|
|
|
if(json==nil)
|
|
|
return nil;
|
|
|
@@ -2486,6 +2690,9 @@ repeat:
|
|
|
[params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
|
|
|
[params setValue:[NSNumber numberWithInt:sort] forKey:@"sort"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeCart forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -2554,6 +2761,8 @@ repeat:
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",INT_MAX ] forKey:@"limit"];
|
|
|
[params setValue:[NSNumber numberWithInt:sort] forKey:@"sort"];
|
|
|
|
|
|
+ [params setObject:ScreenCodePortfolio forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -2599,6 +2808,9 @@ repeat:
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",INT_MAX ] forKey:@"limit"];
|
|
|
|
|
|
[params setValue:[NSNumber numberWithInt:sort] forKey:@"sort"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeWishList forKey:kScreenName];
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
return [OLDataProvider offline_wishlist:params];
|
|
|
@@ -2647,6 +2859,12 @@ repeat:
|
|
|
|
|
|
[params setValue:category_id forKey:@"category"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeModelInfo forKey:kScreenName];
|
|
|
+ [params setObject:@"Open A Model" forKey:kAction];
|
|
|
+ if (model_name) {
|
|
|
+ NSDictionary *extra = @{@"ModelName" : model_name};
|
|
|
+ [params setObject:extra forKey:kExtra];
|
|
|
+ }
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
return [OLDataProvider offline_model:params];
|
|
|
@@ -2729,6 +2947,12 @@ repeat:
|
|
|
[params setValue:filter forKey:@"filter"];
|
|
|
[params setValue:keyword forKey:@"keyword"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeCategory forKey:kScreenName];
|
|
|
+ if ([addTo isEqualToString:@"cart"]) {
|
|
|
+ [params setObject:@"Add To Cart" forKey:kAction];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
NSData* json= nil;
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -2912,6 +3136,19 @@ repeat:
|
|
|
[params setValue:filter forKey:@"filter"];
|
|
|
[params setValue:keyword forKey:@"keyword"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeCategory forKey:kScreenName];
|
|
|
+ if (alert) {
|
|
|
+ [params setObject:@"Filter" forKey:kAction];
|
|
|
+ }
|
|
|
+ if ([Singleton sharedInstance].homeItemClick) {
|
|
|
+ [params setObject:@"Brow A Particular Category On Home" forKey:kAction];
|
|
|
+ [Singleton sharedInstance].homeItemClick = NO;
|
|
|
+
|
|
|
+ NSDictionary *extra = @{@"CoverName" : [Singleton sharedInstance].homeClickedItemName};
|
|
|
+ [Singleton sharedInstance].homeClickedItemName = nil;
|
|
|
+ [params setObject:extra forKey:kExtra];
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -2959,6 +3196,11 @@ repeat:
|
|
|
else
|
|
|
[params setValue:@"false" forKey:@"exactMatch"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeSearch forKey:kScreenName];
|
|
|
+ if ([addTo isEqualToString:@"cart"]) {
|
|
|
+ [params setObject:@"Add To Cart" forKey:kAction];
|
|
|
+ }
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -3027,6 +3269,12 @@ repeat:
|
|
|
[params setValue:@"true" forKey:@"exactMatch"];
|
|
|
else
|
|
|
[params setValue:@"false" forKey:@"exactMatch"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeSearch forKey:kScreenName];
|
|
|
+ if (keywords) {
|
|
|
+ [params setObject:@"Search" forKey:kAction];
|
|
|
+ }
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
return [OLDataProvider offline_search:params];
|
|
|
@@ -3079,6 +3327,12 @@ repeat:
|
|
|
|
|
|
[params setValue:[NSString stringWithFormat:@"%ld",limit] forKey:@"limit"];
|
|
|
[params setValue:[NSString stringWithFormat:@"%ld",offset] forKey:@"offset"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeParticularCategory forKey:kScreenName];
|
|
|
+ if ([addTo isEqualToString:@"cart"]) {
|
|
|
+ [params setObject:@"Add To Cart" forKey:kAction];
|
|
|
+ }
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -3136,7 +3390,18 @@ repeat:
|
|
|
[params setValue:appDelegate.order_code forKey:@"orderCode"];
|
|
|
|
|
|
|
|
|
-
|
|
|
+ [params setObject:ScreenCodeParticularCategory forKey:kScreenName];
|
|
|
+ if (alert && qty && available && price && bestseller) {
|
|
|
+ [params setObject:@"Filter" forKey:kAction];
|
|
|
+ }
|
|
|
+ if ([Singleton sharedInstance].homeItemClick) {
|
|
|
+ [params setObject:@"Brow A Particular Category On Home" forKey:kAction];
|
|
|
+ [Singleton sharedInstance].homeItemClick = NO;
|
|
|
+
|
|
|
+ NSDictionary *extra = @{@"CoverName" : [Singleton sharedInstance].homeClickedItemName};
|
|
|
+ [Singleton sharedInstance].homeClickedItemName = nil;
|
|
|
+ [params setObject:extra forKey:kExtra];
|
|
|
+ }
|
|
|
|
|
|
|
|
|
// [params setValue:[NSString stringWithFormat:@"%d",price_template] forKey:@"price_template"];
|
|
|
@@ -3213,6 +3478,9 @@ repeat:
|
|
|
if(appDelegate.password!=nil)
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
[params setValue:fashionId forKey:@"fashionId"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeEditPortfolio forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json = nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -3244,6 +3512,9 @@ repeat:
|
|
|
// [params setValue:appDelegate.password forKey:@"password"];
|
|
|
[params setValue:user forKey:@"username"];
|
|
|
[params setValue:email forKey:@"email"];
|
|
|
+
|
|
|
+ [params setObject:ScreenCodeLoginView forKey:kScreenName];
|
|
|
+
|
|
|
if(![self IsNetworkAvailable])
|
|
|
return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
|
|
|
|
|
|
@@ -3273,6 +3544,7 @@ repeat:
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",price_template] forKey:@"price_template"];
|
|
|
[params setValue:[NSString stringWithFormat:@"%d",customid] forKey:@"custom_id"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeHomeView forKey:kScreenName];
|
|
|
|
|
|
// AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -3417,6 +3689,9 @@ repeat:
|
|
|
[params setValue:@"false" forKey:@"is_debug"];
|
|
|
#endif
|
|
|
|
|
|
+ [params setObject:ScreenCodeLoginView forKey:kScreenName];
|
|
|
+ [params setObject:@"Login" forKey:kAction];
|
|
|
+
|
|
|
NSData* json= nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -3433,8 +3708,7 @@ repeat:
|
|
|
|
|
|
if(json==nil)
|
|
|
return RESULT_NET_ERROR;
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
int ret = [self parse_authinfo:json user:user password:password];
|
|
|
DebugLog(@"parse_authinfo return %d ",ret);
|
|
|
|
|
|
@@ -3459,6 +3733,8 @@ repeat:
|
|
|
[params setValue:url forKey:@"business_card"];
|
|
|
// [params setValue:[NSNumber numberWithInt:index ] forKey:@"index"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeEditCustomer forKey:kScreenName];
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
return [OLDataProvider offline_notimpl];
|
|
|
@@ -3515,6 +3791,8 @@ repeat:
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
[params setValue:contactid forKey:@"contactId"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeCustomerInfo forKey:kScreenName];
|
|
|
+
|
|
|
if(appDelegate.offline_mode)
|
|
|
return [OLDataProvider offline_contactinfo:params];
|
|
|
if(![self IsNetworkAvailable])
|
|
|
@@ -3757,7 +4035,8 @@ repeat:
|
|
|
if(appDelegate.password!=nil)
|
|
|
[dic setValue:appDelegate.password forKey:@"password"];
|
|
|
|
|
|
- [dic setValue:[NSString stringWithFormat:@"%d",priceType] forKey:@"price_type"];
|
|
|
+ [dic setValue:[NSString stringWithFormat:@"%ld",priceType] forKey:@"price_type"];
|
|
|
+ [dic setObject:ScreenCodePriceSetting forKey:kScreenName];
|
|
|
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -3792,6 +4071,8 @@ repeat:
|
|
|
|
|
|
if(appDelegate.password!=nil)
|
|
|
[dic setValue:appDelegate.password forKey:@"password"];
|
|
|
+
|
|
|
+ [dic setObject:ScreenCodeCategoryPrice forKey:kScreenName];
|
|
|
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
@@ -3828,6 +4109,8 @@ repeat:
|
|
|
if(appDelegate.password!=nil)
|
|
|
[params setValue:appDelegate.password forKey:@"password"];
|
|
|
|
|
|
+ [params setObject:ScreenCodeSetCatetoryPrice forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -3866,6 +4149,9 @@ repeat:
|
|
|
[dic setValue:[params objectForKey:@"order_ids"] forKey:@"order_ids"];
|
|
|
[dic setValue:[params objectForKey:@"targetOrderId"] forKey:@"targetOrderId"];
|
|
|
[dic setValue:[params objectForKey:@"customerInfo"] forKey:@"customerInfo"];
|
|
|
+
|
|
|
+ [dic setObject:ScreenCodeOrderList forKey:kScreenName];
|
|
|
+
|
|
|
NSData* json=nil;
|
|
|
if(appDelegate.offline_mode)
|
|
|
{
|
|
|
@@ -3939,6 +4225,8 @@ repeat:
|
|
|
[dic setValue:so_id forKey:@"orderCode"];
|
|
|
[dic setValue:addr forKey:@"email"];
|
|
|
|
|
|
+ [dic setObject:ScreenCodeCart forKey:kScreenName];
|
|
|
+
|
|
|
if (appDelegate.customerInfo) {
|
|
|
NSString *customer_cid = [appDelegate.customerInfo objectForKey:@"customer_cid"];
|
|
|
if (customer_cid) {
|
|
|
@@ -3970,7 +4258,7 @@ repeat:
|
|
|
return @{@"result" : @(RESULT_FALSE)};
|
|
|
}
|
|
|
|
|
|
-+ (NSDictionary *)notifyModel:(NSString *)modelID emailAddr:(NSString *)addr{
|
|
|
++ (NSDictionary *)notifyModel:(NSString *)modelID emailAddr:(NSString *)addr withScreen:(NSString *)screenName{
|
|
|
|
|
|
NSMutableDictionary* dic = [[NSMutableDictionary alloc] init];
|
|
|
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
@@ -3987,6 +4275,8 @@ repeat:
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ [dic setObject:screenName forKey:kScreenName];
|
|
|
+
|
|
|
[dic setValue:modelID forKey:@"productId"];
|
|
|
|
|
|
if (addr) { // 弹框输入
|