Skip to content

Commit

Permalink
升级开普勒SDK至3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
孑愁 committed Nov 25, 2020
1 parent 1eceddd commit 5d20975
Show file tree
Hide file tree
Showing 39 changed files with 105 additions and 110 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ typings/
*.iml
.idea/
examples/package-lock.json
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# react-native-mkepler (SDK Ver. 2.2.4)
# react-native-mkepler (SDK Ver. 3.2.0)

## 开始

Expand Down
Binary file modified android/libs/JDSDK_h.jar
Binary file not shown.
71 changes: 13 additions & 58 deletions android/src/main/java/com/jd/jdsdk/RNReactNativeMkeplerModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,22 +243,14 @@ public void showItemById(final ReadableMap data, final Promise p) {
Boolean isOpenByH5 = data.getBoolean("isOpenByH5");
this.dealParam(data);
if (isOpenByH5 == true) {
try {
KeplerApiManager.getWebViewService()
.openItemDetailsWebViewPage(itemID,
mKeplerAttachParameter);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
KeplerApiManager.getWebViewService()
.openItemDetailsWebViewPage(itemID,
mKeplerAttachParameter);
} else {
try {
mKelperTask = KeplerApiManager.getWebViewService()
.openItemDetailsPage(itemID, mKeplerAttachParameter,
reactContext, mOpenAppAction, timeOut);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -283,21 +275,13 @@ public void showItemByUrl(final ReadableMap data, final Promise p) {
Boolean isOpenByH5 = data.getBoolean("isOpenByH5");
this.dealParam(data);
if (isOpenByH5 == true) {
try {
KeplerApiManager.getWebViewService().openJDUrlWebViewPage(url,
mKeplerAttachParameter);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
KeplerApiManager.getWebViewService().openJDUrlWebViewPage(url,
mKeplerAttachParameter);
} else {
try {
mKelperTask = KeplerApiManager.getWebViewService()
.openJDUrlPage(url, mKeplerAttachParameter,
reactContext, mOpenAppAction, timeOut);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -320,21 +304,13 @@ public void openOrderList(final ReadableMap data, final Promise p) {
Boolean isOpenByH5 = data.getBoolean("isOpenByH5");
this.dealParam(data);
if (isOpenByH5 == true) {
try {
KeplerApiManager.getWebViewService().openOrderListWebViewPage(
mKeplerAttachParameter);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
KeplerApiManager.getWebViewService().openOrderListWebViewPage(
mKeplerAttachParameter);
} else {
try {
mKelperTask = KeplerApiManager.getWebViewService()
.openOrderListPage(mKeplerAttachParameter,
reactContext, mOpenAppAction, timeOut);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -357,21 +333,13 @@ public void openNavigationPage(final ReadableMap data, final Promise p) {
Boolean isOpenByH5 = data.getBoolean("isOpenByH5");
this.dealParam(data);
if (isOpenByH5 == true) {
try {
KeplerApiManager.getWebViewService().openNavigationWebViewPage(
mKeplerAttachParameter);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
KeplerApiManager.getWebViewService().openNavigationWebViewPage(
mKeplerAttachParameter);
} else {
try {
mKelperTask = KeplerApiManager.getWebViewService()
.openNavigationPage(mKeplerAttachParameter,
reactContext, mOpenAppAction, timeOut);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -396,21 +364,13 @@ public void openSearchResult(final ReadableMap data, final Promise p) {
Boolean isOpenByH5 = data.getBoolean("isOpenByH5");
this.dealParam(data);
if (isOpenByH5 == true) {
try {
KeplerApiManager.getWebViewService().openSearchWebViewPage(
searchKey, mKeplerAttachParameter);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
KeplerApiManager.getWebViewService().openSearchWebViewPage(
searchKey, mKeplerAttachParameter);
} else {
try {
mKelperTask = KeplerApiManager.getWebViewService()
.openSearchPage(searchKey, mKeplerAttachParameter,
reactContext, mOpenAppAction, timeOut);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Expand All @@ -433,13 +393,8 @@ public void openShoppingCart(final ReadableMap data, final Promise p) {
Boolean isOpenByH5 = data.getBoolean("isOpenByH5");
this.dealParam(data);
if (isOpenByH5 == true) {
try {
KeplerApiManager.getWebViewService().openCartWebViewPage(
mKeplerAttachParameter);
} catch (KeplerBufferOverflowException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
KeplerApiManager.getWebViewService().openCartWebViewPage(
mKeplerAttachParameter);
} else {
try {
mKelperTask = KeplerApiManager.getWebViewService()
Expand Down
Empty file modified android/src/main/res/drawable-xxhdpi/kepler_back_normal.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/kepler_back_pressed.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/neterror.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/seclect_item_history.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/seclect_item_logout.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/seclect_item_orderlist.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/seclect_item_serch.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/select_bg.9.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable-xxhdpi/white.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/src/main/res/drawable/btn_reload.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/drawable/kepler_btn_back.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/drawable/kepler_btn_select_more.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/drawable/kepler_dialog_bk.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/drawable/kepler_dialog_button_ne.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/drawable/kepler_dialog_button_po.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/drawable/pressbar_color.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/drawable/sdk_title_bg_with_shadow.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/layout/item_tab_layout.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/layout/kepler_mid_lin.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/layout/kepler_simple_dialog_lay.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/layout/more_select_item.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/layout/neterror_layout.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/layout/sdk_title_layout.xml
100755 → 100644
Empty file.
Empty file modified android/src/main/res/layout/web_bottom_layout.xml
100755 → 100644
Empty file.
90 changes: 45 additions & 45 deletions android/src/main/res/values/strings.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<resources>

<string name="app_name">sdk</string>
<string name="Illegal_info"> Illegal application ,check init !</string>
<string name="kepler_check_net">请检查您的网络环境</string>
<string name="order">订单中心</string>
<string name="history">最近浏览</string>
<string name="search">搜索</string>
<string name="message">消息</string>
<string name="loginout">退出登录</string>
<string name="give_up_message">"下单后24小时内未支付成功,订单将被取消,请尽快完成支付。"</string>
<string name="give_up_title">确定要离开收银台</string>
<string name="give_up_goon">继续支付</string>
<string name="give_up_affirm">确认离开</string>
<string name="loginout_success">注销成功</string>
<string name="not_login">未登录</string>
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->

<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->




</resources>
<resources>

<string name="app_name">sdk</string>
<string name="Illegal_info"> Illegal application ,check init !</string>
<string name="kepler_check_net">请检查您的网络环境</string>
<string name="order">订单中心</string>
<string name="history">最近浏览</string>
<string name="search">搜索</string>
<string name="message">消息</string>
<string name="loginout">退出登录</string>
<string name="give_up_message">"下单后24小时内未支付成功,订单将被取消,请尽快完成支付。"</string>
<string name="give_up_title">确定要离开收银台</string>
<string name="give_up_goon">继续支付</string>
<string name="give_up_affirm">确认离开</string>
<string name="loginout_success">注销成功</string>
<string name="not_login">未登录</string>
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->

<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->
<!--<string name="app_name">sdk</string>-->




</resources>
Empty file modified android/src/main/res/values/styles.xml
100755 → 100644
Empty file.
45 changes: 42 additions & 3 deletions ios/KeplerSDK/JDKeplerSDK.framework/Headers/KeplerApiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// 提供Kepler服务
// Created by JD.K on 16/6/20.
// Copyright © 2016年 JD.K. All rights reserved.
// version 2.2.4
// version 3.2.0

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
Expand All @@ -16,6 +16,8 @@ typedef void (^initFailedCallback)(NSError *error);
/** JD内部App登录流程 */
typedef void (^initJDInnerLogin)(UIViewController *currentViewController);

typedef void (^clearCookiesCallBack)(BOOL isSuccess);

typedef NS_ENUM(NSInteger, JDInnerLogin) {
JDInnerLoginFailure = 0, //获取code失败
JDInnerLoginCancel, //用户取消登录
Expand Down Expand Up @@ -125,14 +127,27 @@ typedef void (^keplerCompletionHandler)(BOOL result,id _Nullable responseObject,
- (void)openNavigationPage:(UIViewController *)sourceController jumpType:(NSInteger)jumpType customParams:(NSString *)customParams API_DEPRECATED_WITH_REPLACEMENT("openNavigationPage:sourceController:jumpType:userInfo:", ios(7.0,11.0));

- (void)openNavigationPage:(UIViewController *)sourceController jumpType:(NSInteger)jumpType userInfo:(NSDictionary *)userInfo;

/**
* 通过SKU打开Kepler单品页
*
* @param sku 商品SKU
*/
- (void)openItemDetailWithSKU:(NSString *)sku sourceController:(UIViewController *)sourceController jumpType:(NSInteger)jumpType customParams:(NSString *)customParams API_DEPRECATED_WITH_REPLACEMENT("openItemDetailWithSKU:sourceController:jumpType:userInfo:", ios(7.0,11.0));
- (void)openItemDetailWithSKU:(NSString *)sku
sourceController:(UIViewController *)sourceController
jumpType:(NSInteger)jumpType
customParams:(NSString *)customParams API_DEPRECATED_WITH_REPLACEMENT("openItemDetailWithSKU:sourceController:jumpType:userInfo:", ios(7.0,11.0));
// 京东商详接口
- (void)openItemDetailWithSKU:(NSString *)sku
sourceController:(UIViewController *)sourceController
jumpType:(NSInteger)jumpType
userInfo:(NSDictionary *)userInfo;

- (void)openItemDetailWithSKU:(NSString *)sku sourceController:(UIViewController *)sourceController jumpType:(NSInteger)jumpType userInfo:(NSDictionary *)userInfo;
// 京喜商详接口
- (void)openJXItemDetailWithSKU:(NSString *)sku
sourceController:(UIViewController *)sourceController
jumpType:(NSInteger)jumpType
userInfo:(NSDictionary *)userInfo;

/**
* 打开订单列表
Expand Down Expand Up @@ -204,16 +219,38 @@ typedef void (^keplerCompletionHandler)(BOOL result,id _Nullable responseObject,
@param appID AppID 查看位置:我的推广-推广管理-APP管理
@param skuID 商品SKU
@param refer refer (原生页面传域名+文章编号)
@param subUnionId 子联盟ID,可用于区分媒体自身的用户ID
@param viewController 当前的视图控制器
@param completionHandler 返回
*/
- (void)keplerFastPurchaseWith:(NSString *)unionID
appID:(NSString *)appID
skuID:(NSString *)skuID
refer:(NSString *)refer
subUnionId:(NSString *)subUnionId
controller:(UIViewController *)viewController
completion:(keplerCompletionHandler)completionHandler;

/**
批量一键加购
@param unionID
@param appID AppID 查看位置:我的推广-推广管理-APP管理
@param skuIDs 商品SKU 以逗号隔开
@param skuCounts 商品SKU 对应的数量 以逗号隔开
@param refer refer (原生页面传域名+文章编号)
@param subUnionId 子联盟ID,可用于区分媒体自身的用户ID
@param viewController 当前的视图控制器
@param completionHandler 返回
*/
- (void)keplerFastPurchaseWith:(NSString *)unionID
appID:(NSString *)appID
skuIDs:(NSString *)skuIDs
skuCounts:(NSString *)skuCounts
refer:(NSString *)refer
subUnionId:(NSString *)subUnionId
controller:(UIViewController *)viewController
completion:(keplerCompletionHandler)completionHandler;

/***************************** End *******************************************/

Expand Down Expand Up @@ -250,6 +287,8 @@ typedef void (^keplerCompletionHandler)(BOOL result,id _Nullable responseObject,
*/
- (void)cancelAuth;

- (void)cancelAuthWithBlock:(clearCookiesCallBack)completedBlock;

/**
* 设置加载进度条颜色
*/
Expand Down
Binary file modified ios/KeplerSDK/JDKeplerSDK.framework/Info.plist
Binary file not shown.
Binary file modified ios/KeplerSDK/JDKeplerSDK.framework/JDKeplerSDK
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-mkepler",
"version": "3.0.1",
"version": "3.1.0",
"description": "react-native library for JD Kepler",
"main": "index.js",
"scripts": {
Expand All @@ -22,6 +22,6 @@
},
"homepage": "https://github.com/bashen1/react-native-mkepler#readme",
"peerDependencies": {
"react-native": ">=0.40"
"react-native": ">=0.60"
}
}
2 changes: 1 addition & 1 deletion react-native-mkepler.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Pod::Spec.new do |s|

s.vendored_frameworks = "ios/KeplerSDK/*"

s.dependency "React"
s.dependency "React-Core"

end

0 comments on commit 5d20975

Please sign in to comment.