//
|
// MyJSInterface.m
|
// EasyJSWebViewSample
|
//
|
// Created by Lau Alex on 19/1/13.
|
// Copyright (c) 2013 Dukeland. All rights reserved.
|
//
|
|
#import "MyJSInterface.h"
|
|
@implementation MyJSInterface
|
|
- (NSString *)getUid{
|
NSString *uid = [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]];
|
NSLog(@"%@",uid);
|
if(![[NSUserDefaults standardUserDefaults] objectForKey:@"userId"]){
|
return @"0";
|
}
|
return uid;
|
}
|
- (NSString *)getVersion{
|
return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
|
}
|
- (NSString *)getSign:(NSString *)string{
|
NSString *MD5String = [NSString md5:[NSString stringWithFormat:@"%@@?,223Hbb88lll",string]];
|
NSLog(@"%@",MD5String);
|
return MD5String;
|
}
|
|
- (void)toast:(NSString *)string{
|
|
ALToastCenter(string);
|
}
|
|
- (void)jumpGoodsSplash:(NSString *)string{
|
NSDictionary *dic = @{@"type":@"new",@"id":string};
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"jumpGoodsDETAIL" object:dic];
|
|
}
|
|
- (void)jumpGoodsDetail:(NSString *)string{
|
NSDictionary *dic = @{@"type":@"old",@"id":string};
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"jumpGoodsDETAIL" object:dic];
|
}
|
|
-(void)jumpSearch:(NSString *)key {
|
|
NSDictionary *dic = @{@"key" : key};
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"jumpSearch" object:dic];
|
}
|
|
- (void)login{
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"jumpLoginVc" object:nil];
|
|
}
|
@end
|