├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml ├── libraries │ ├── Dart_SDK.xml │ ├── Flutter_Plugins.xml │ └── Flutter_for_Android.xml ├── misc.xml ├── modules.xml ├── runConfigurations │ └── example_lib_main_dart.xml ├── vcs.xml └── workspace.xml ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.en.md ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ ├── libs │ ├── JDSDK_h.jar │ ├── armeabi-v7a │ │ └── libCPS.so │ ├── armeabi │ │ └── libCPS.so │ ├── cps_1.0.0.jar │ ├── jdmasdk.jar │ └── x86 │ │ └── libCPS.so │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── wxwx │ │ └── flutter_kepler │ │ ├── FlutterKeplerHandle.java │ │ ├── FlutterKeplerPlugin.java │ │ ├── LoadingDialog.java │ │ ├── PluginConstants.java │ │ ├── PluginResponse.java │ │ └── PluginUtil.java │ └── res │ ├── drawable-xxhdpi │ ├── kepler_back_normal.png │ ├── kepler_back_pressed.png │ ├── kepler_selcet_more_normal.png │ ├── kepler_selcet_more_pressed.png │ ├── neterror.png │ ├── seclect_item_has_message.png │ ├── seclect_item_history.png │ ├── seclect_item_logout.png │ ├── seclect_item_no_has_message.png │ ├── seclect_item_orderlist.png │ ├── seclect_item_serch.png │ ├── select_bg.9.png │ └── white.png │ ├── drawable │ ├── btn_reload.xml │ ├── kepler_btn_back.xml │ ├── kepler_btn_select_more.xml │ ├── kepler_dialog_bk.xml │ ├── kepler_dialog_button_ne.xml │ ├── kepler_dialog_button_po.xml │ ├── pressbar_color.xml │ ├── sdk_title_bg_with_shadow.xml │ └── yuanjiao.xml │ ├── layout │ ├── dialogloading.xml │ ├── item_tab_layout.xml │ ├── kepler_mid_lin.xml │ ├── kepler_simple_dialog_lay.xml │ ├── more_select_item.xml │ ├── neterror_layout.xml │ ├── sdk_title_layout.xml │ └── web_bottom_layout.xml │ ├── raw │ └── safe.jpg │ └── values │ ├── strings.xml │ └── styles.xml ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── app │ │ ├── build.gradle │ │ ├── release.keystore │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── wxwx │ │ │ │ │ └── flutter_kepler_example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── raw │ │ │ │ └── safe.jpg │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── flutter_export_environment.sh │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── Kepler.bundle │ │ └── safe.jpg │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── flutter_kepler.iml ├── flutter_kepler └── .idea │ └── workspace.xml ├── images └── ios.jpg ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── ConstKey │ │ └── FlutterKeplerConstKey.h │ ├── FlutterKeplerPlugin.h │ ├── FlutterKeplerPlugin.m │ ├── Handle │ │ ├── FlutterKeplerHandler.h │ │ └── FlutterKeplerHandler.m │ └── Tools │ │ ├── FlutterKeplerTools.h │ │ └── FlutterKeplerTools.m ├── JDKepler │ └── JDKeplerSDK.framework │ │ ├── Headers │ │ ├── JDKeplerSDK.h │ │ └── KeplerApiManager.h │ │ ├── Info.plist │ │ ├── JDKeplerSDK │ │ └── Modules │ │ └── module.modulemap └── flutter_kepler.podspec ├── lib ├── flutter_kepler.dart ├── kepler_const_key.dart └── kepler_model.dart ├── pubspec.lock ├── pubspec.yaml └── test └── flutter_kepler_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: e4ebcdf6f4facee5779c38a04d91d08dc58ea7a4 8 | channel: beta 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 8 | ## 0.0.1 9 | 完成开发 10 | * TODO: Describe initial release. 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 FlutterTaoBaoKe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # flutter_kepler 2 | 3 | #### Description 4 | flutter 京东开普勒插件 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 8 | # flutter_kepler 9 | 10 | #### 介绍 11 | flutter 京东开普勒插件 12 | 13 | 地址:[flutter_kepler](https://pub.dev/packages/flutter_kepler) 14 | 15 | 支持Android和iOS,原生版本V2.2.4 16 | 17 | Android:983598009@qq.com 18 | iOS:329106954@qq.com 19 | ### 如何引入项目 20 | 21 | [如何引入](https://pub.dev/packages/flutter_kepler#-installing-tab-) 22 | ``` 23 | dependencies: 24 | flutter_kepler: ^版本号 25 | ``` 26 | 27 | ### 已知问题 28 | * iOS 29 | 不知道是不是example的iOS包名导购模式还在申请的原因,登录收不到回调。建议集成方自己试一下 30 | 31 | ### 工程性方法 32 | 参考[开普勒文档](http://kepler.jd.com/console/docCenterCatalog/docContent?channelId=46) 33 | 34 | #### ios需要的工程性配置 35 | 36 | 1.进入[后台管理](http://kepler.jd.com/console/app/app_list.action),生成自己的SDK 37 | 2.将下载的SDk解压缩得到 JDKeplerSDK.framework、Kepler.bundle(JDKeplerSDK.framework用不上) 38 | 3.将Kepler.bundle拖入原生项目,如下图 39 | ![image](./images/ios.jpg) 40 | 41 | #### android需要的工程性配置 42 | 43 | 在待引入工程的android目录下, AndroidManifest.xml文件内 44 | 45 | `例如 flutter_kepler\example\android\app\src\main\AndroidManifest.xml` 46 | 47 | 添加以下配置 48 | 49 | ``` 50 | 51 | ... 52 | 53 | 54 | 55 | 56 | 57 | 58 | ... 59 | 60 | ... 61 | 64 | 65 | 66 | 67 | 72 | 73 | 75 | ... 76 | 77 | 78 | ``` 79 | 80 | [参考链接]() 81 | 82 | 安全图片同样需要放在 待引入工程的android目录下 , /main/res/raw/safe.jpg 83 | 84 | 85 | ### 方法说明 86 | * 头文件引入 87 | ``` 88 | import 'package:flutter_kepler/flutter_kepler.dart'; 89 | ``` 90 | 91 | * 初始化 92 | ``` 93 | /** 94 | * 初始化 95 | * appKey:去管理后台查看 96 | * appSecret:去管理后台查看 97 | * result:{ 98 | * errorCode, //0为初始化成功,其他为失败 99 | * errorMessage, //message 100 | * } 101 | */ 102 | var result = await FlutterKepler.initKepler( 103 | appKey: "", 104 | appSecret: "", 105 | ); 106 | ``` 107 | 108 | * 打开url 109 | ``` 110 | /// 111 | /// 通过URL打开任意商品页面 112 | /// @param url 页面url 113 | /// @param userInfo 不需要可以不传 传参数据为第三方应用自定义,可以为页面,频道标识;也可以标识分成信息;该数据只做统计需求。传参长度,使用URL encode之后长度必须小于256字节(不建议传入中文以及特殊字符) 114 | /// 禁止传参带入以下符号: =#%&+?<{} 115 | /// 116 | /// 117 | FlutterKepler.keplerPageWithURL( 118 | url: "", 119 | userInfo:{}, 120 | ); 121 | ``` 122 | 123 | * 打开导航页 124 | ``` 125 | /// 126 | /// 打开导航页 127 | /// @param userInfo 不需要可以不传 传参数据为第三方应用自定义,可以为页面,频道标识;也可以标识分成信息;该数据只做统计需求。传参长度,使用URL encode之后长度必须小于256字节(不建议传入中文以及特殊字符) 128 | /// 禁止传参带入以下符号: =#%&+?<{} 129 | /// 130 | /// 131 | FlutterKepler.keplerNavigationPage(userInfo:{},); 132 | ``` 133 | 134 | * 通过SKU打开Kepler单品页 135 | ``` 136 | 137 | /// 138 | /// 通过SKU打开Kepler单品页 139 | /// @param sku 商品sku 140 | /// @param userInfo 不需要可以不传 传参数据为第三方应用自定义,可以为页面,频道标识;也可以标识分成信息;该数据只做统计需求。传参长度,使用URL encode之后长度必须小于256字节(不建议传入中文以及特殊字符) 141 | /// 禁止传参带入以下符号: =#%&+?<{} 142 | /// 143 | /// 144 | FlutterKepler.keplerOpenItemDetailWithSKU( 145 | sku: "", 146 | userInfo:{}, 147 | ); 148 | ``` 149 | 150 | * 打开订单列表 151 | ``` 152 | /// 153 | /// 打开订单列表 154 | /// @param userInfo 不需要可以不传 传参数据为第三方应用自定义,可以为页面,频道标识;也可以标识分成信息;该数据只做统计需求。传参长度,使用URL encode之后长度必须小于256字节(不建议传入中文以及特殊字符) 155 | /// 禁止传参带入以下符号: =#%&+?<{} 156 | /// 157 | /// 158 | FlutterKepler.keplerOpenOrderList( 159 | userInfo:{} 160 | ); 161 | ``` 162 | 163 | 164 | * 根据搜索关键字打开搜索结果页 165 | ``` 166 | /// 167 | /// 根据搜索关键字打开搜索结果页 168 | /// @param searchKey 搜索关键字 169 | /// @param userInfo 不需要可以不传 传参数据为第三方应用自定义,可以为页面,频道标识;也可以标识分成信息;该数据只做统计需求。传参长度,使用URL encode之后长度必须小于256字节(不建议传入中文以及特殊字符) 170 | /// 禁止传参带入以下符号: =#%&+?<{} 171 | /// 172 | /// 173 | FlutterKepler.keplerOpenSearchResult( 174 | searchKey: "", 175 | userInfo:{} 176 | ); 177 | ``` 178 | 179 | * 打开购物车界面 180 | ``` 181 | /// 182 | /// 打开购物车界面 183 | /// @param userInfo 不需要可以不传 传参数据为第三方应用自定义,可以为页面,频道标识;也可以标识分成信息;该数据只做统计需求。传参长度,使用URL encode之后长度必须小于256字节(不建议传入中文以及特殊字符) 184 | /// 禁止传参带入以下符号: =#%&+?<{} 185 | /// 186 | /// 187 | FlutterKepler.keplerOpenShoppingCart( 188 | userInfo:{} 189 | ); 190 | ``` 191 | 192 | 193 | * 添加到购物车(深圳的加车接口) 194 | ``` 195 | /// 196 | /// 添加到购物车(深圳的加车接口) 197 | /// @param sku 添加到购物车中的商品id 198 | /// @param number 添加到购物车中商品数量,默认1件 199 | ///result:{ 200 | /// errorCode, //0为成功,其他为失败 201 | /// errorMessage, //message 202 | /// } 203 | /// 204 | var result = await FlutterKepler.keplerAddToCartWithSku( 205 | sku: "", 206 | number:"", 207 | ); 208 | ``` 209 | 210 | * 联盟一键加购 211 | ``` 212 | /// 213 | ///联盟一键加购 214 | ///unionID 联盟ID 215 | ///AppID 查看位置:我的推广-推广管理-APP管理 216 | ///skuID 商品SKU, 217 | ///refer refer (原生页面传域名+文章编号) 218 | /// 219 | ///result:{ 220 | /// errorCode, //0为成功,其他为失败 221 | /// errorMessage, //message 222 | /// } 223 | 224 | var result = await FlutterKepler.keplerFastPurchase( 225 | unionID: "", 226 | appID: "", 227 | skuID: "", 228 | refer: "", 229 | ); 230 | ``` 231 | 232 | * 登录授权 233 | ``` 234 | ///⚠️iOS可能收不到回调,Android正常,请自行测试 235 | ///登录授权 236 | /// 237 | ///result:{ 238 | /// errorCode, //0为成功,其他为失败 239 | /// errorMessage, //message 240 | /// } 241 | var result = await FlutterKepler.keplerLogin(); 242 | ``` 243 | 244 | * 登出并清除登录状态 245 | ``` 246 | ///登出,清除登录状态 247 | FlutterKepler.keplerCancelAuth(); 248 | ``` 249 | 250 | * 判断是否登录 251 | ``` 252 | ///判断登录是否失效 253 | /// 254 | ///result:{ 255 | /// errorCode, //0为成功,其他为失败 256 | /// errorMessage, //message 257 | /// } 258 | var result = await FlutterKepler.keplerIsLogin(); 259 | ``` 260 | 261 | * 是否强制使用H5打开界面 默认为true 262 | ``` 263 | /// 是否强制使用H5打开界面 默认为true; 264 | /// 设置为false时,调用商品详情页,订单列表,购物车等方法时将跳转到京东app并打开对应的界面 265 | FlutterKepler.setKeplerOpenByH5(isOpenByH5: bool); 266 | ``` 267 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.wxwx.flutter_kepler' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | compileSdkVersion 28 26 | 27 | defaultConfig { 28 | minSdkVersion 16 29 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 30 | } 31 | lintOptions { 32 | disable 'InvalidPackage' 33 | } 34 | 35 | sourceSets{ 36 | main{ 37 | jniLibs.srcDirs = ['src/libs'] 38 | } 39 | } 40 | compileOptions { 41 | sourceCompatibility JavaVersion.VERSION_1_8 42 | targetCompatibility JavaVersion.VERSION_1_8 43 | } 44 | } 45 | 46 | dependencies{ 47 | implementation files('src/libs/jdmasdk.jar') 48 | implementation files('src/libs/JDSDK_h.jar') 49 | implementation files('src/libs/cps_1.0.0.jar') 50 | } 51 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | 3 | #android.useAndroidX=true 4 | #android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_kepler' 2 | -------------------------------------------------------------------------------- /android/src/libs/JDSDK_h.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/libs/JDSDK_h.jar -------------------------------------------------------------------------------- /android/src/libs/armeabi-v7a/libCPS.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/libs/armeabi-v7a/libCPS.so -------------------------------------------------------------------------------- /android/src/libs/armeabi/libCPS.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/libs/armeabi/libCPS.so -------------------------------------------------------------------------------- /android/src/libs/cps_1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/libs/cps_1.0.0.jar -------------------------------------------------------------------------------- /android/src/libs/jdmasdk.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/libs/jdmasdk.jar -------------------------------------------------------------------------------- /android/src/libs/x86/libCPS.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/libs/x86/libCPS.so -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/wxwx/flutter_kepler/FlutterKeplerHandle.java: -------------------------------------------------------------------------------- 1 | package com.wxwx.flutter_kepler; 2 | 3 | import android.content.DialogInterface; 4 | import android.os.Handler; 5 | import android.util.Log; 6 | import android.webkit.WebChromeClient; 7 | import android.webkit.WebViewClient; 8 | import android.widget.Toast; 9 | import io.flutter.plugin.common.PluginRegistry.Registrar; 10 | import io.flutter.plugin.common.MethodChannel.Result; 11 | import io.flutter.plugin.common.MethodCall; 12 | import java.util.HashMap; 13 | import android.app.AlertDialog; 14 | import static com.wxwx.flutter_kepler.PluginConstants.*; 15 | import static com.wxwx.flutter_kepler.PluginUtil.*; 16 | 17 | import com.kepler.jd.Listener.ActionCallBck; 18 | import com.kepler.jd.Listener.AsyncInitListener; 19 | import com.kepler.jd.Listener.LoginListener; 20 | import com.kepler.jd.Listener.OpenAppAction; 21 | import com.kepler.jd.login.KeplerApiManager; 22 | import com.kepler.jd.sdk.bean.KelperTask; 23 | import com.kepler.jd.sdk.bean.KeplerAttachParameter; 24 | import com.kepler.jd.sdk.bean.KeplerGlobalParameter; 25 | import com.kepler.jd.sdk.exception.KeplerBufferOverflowException; 26 | import com.kepler.jd.sdk.exception.KeplerAttachException; 27 | 28 | import org.json.JSONException; 29 | 30 | import java.util.Map; 31 | 32 | /** 33 | * 34 | * @Author karedem 35 | * @Date 2019/9/7 19:55 36 | * @Description 接口处理者 37 | **/ 38 | public class FlutterKeplerHandle { 39 | 40 | private static FlutterKeplerHandle handle; 41 | private Registrar register; 42 | private Handler mHandler = new Handler(); 43 | private KelperTask mKelperTask = null; 44 | /** 45 | * 加载对话框 46 | */ 47 | private LoadingDialog dialog; 48 | 49 | private OpenAppAction mOpenAppAction = new OpenAppAction() { 50 | @Override 51 | public void onStatus(final int status) { 52 | mHandler.post(new Runnable() { 53 | @Override 54 | public void run() { 55 | if (status == OpenAppAction.OpenAppAction_start) {//开始状态未必一定执行, 56 | //dialogShow(); 57 | } else { 58 | mKelperTask=null; 59 | //dialogDiss(); 60 | } 61 | } 62 | }); 63 | } 64 | }; 65 | 66 | /** 67 | * 显示加载对话框 68 | */ 69 | private void dialogShow() { 70 | if (dialog == null) { 71 | dialog = new LoadingDialog(register.activity()); 72 | // dialog.setCanceledOnTouchOutside(false); 73 | dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { 74 | @Override 75 | public void onCancel(DialogInterface dialog) { 76 | if (mKelperTask != null) {//取消 77 | mKelperTask.setCancel(true); 78 | } 79 | } 80 | }); 81 | } 82 | dialog.show(); 83 | } 84 | 85 | private void dialogDiss() { 86 | if (dialog != null) { 87 | dialog.dismiss(); 88 | } 89 | } 90 | 91 | //第一次调用getInstance register不能为空 92 | public static FlutterKeplerHandle getInstance(Registrar register){ 93 | if (handle == null){ 94 | synchronized (FlutterKeplerHandle.class){ 95 | handle = new FlutterKeplerHandle(); 96 | handle.register = register; 97 | } 98 | } 99 | return handle; 100 | } 101 | 102 | /** 103 | * 将map参数构造为 KeplerAttachParameter 对象 104 | * @param map 105 | * @return 106 | */ 107 | private KeplerAttachParameter getAttachParameter(Map info) throws JSONException, KeplerAttachException, KeplerBufferOverflowException{ 108 | if (info == null){ 109 | info = new HashMap<>(); 110 | } 111 | KeplerAttachParameter customerInfo = new KeplerAttachParameter(); 112 | 113 | for (String key:info.keySet()){ 114 | if ("customerInfo".equalsIgnoreCase(key)){ 115 | customerInfo.setCustomerInfo(String.valueOf(info.get(key))); 116 | }else if ("positionId".equalsIgnoreCase(key)){ 117 | try { 118 | customerInfo.setPositionId((Integer)info.get(key)); 119 | } 120 | catch (Exception e){} 121 | }else { 122 | customerInfo.putKeplerAttachParameter(key,String.valueOf(info.get(key))); 123 | } 124 | } 125 | return customerInfo; 126 | } 127 | 128 | /** 129 | * 初始化开普勒 130 | * @param call 131 | * @param result 132 | */ 133 | public void initKepler(MethodCall call, Result result){ 134 | String appKey = call.argument("appKey"); 135 | String appSecret = call.argument("appSecret"); 136 | KeplerApiManager.asyncInitSdk(register.activity().getApplication(), appKey, appSecret, new AsyncInitListener() { 137 | @Override 138 | public void onSuccess() { 139 | result.success(PluginResponse.success(null).toMap()); 140 | } 141 | 142 | @Override 143 | public void onFailure() { 144 | String errorCode = "-1"; 145 | String errorMsg = "初始化失败"; 146 | result.success(new PluginResponse(errorCode, errorMsg, null).toMap()); 147 | } 148 | }); 149 | } 150 | 151 | /** 152 | * 授权登陆 153 | * @param result 154 | */ 155 | public void keplerLogin(Result result){ 156 | KeplerApiManager.getWebViewService().login(register.activity(), new LoginListener() { 157 | @Override 158 | public void authSuccess() { 159 | result.success(PluginResponse.success(null).toMap()); 160 | } 161 | 162 | @Override 163 | public void authFailed(int errorCode) { 164 | result.success(authError(errorCode).toMap()); 165 | } 166 | }); 167 | } 168 | 169 | public void keplerIsLogin(MethodCall call, Result result){ 170 | KeplerApiManager.getWebViewService().checkLoginState(new ActionCallBck() { 171 | @Override 172 | public boolean onDateCall(int key, String info) { 173 | Map res = new HashMap<>(); 174 | res.put("key", key); 175 | res.put("info", info); 176 | result.success(PluginResponse.success(res).toMap()); 177 | return false; 178 | } 179 | 180 | @Override 181 | public boolean onErrCall(int key, String error) { 182 | result.success(new PluginResponse(String.valueOf(key), error, null).toMap()); 183 | return false; 184 | } 185 | }); 186 | } 187 | 188 | /** 189 | * 清除授权登陆 190 | * @param result 191 | */ 192 | public void keplerCancelAuth(MethodCall call, Result result){ 193 | KeplerApiManager.getWebViewService().cancelAuth(register.activity()); 194 | } 195 | 196 | /** 197 | * 通过URL方式打开 198 | * @param call 199 | * @param result 200 | */ 201 | public void openJDUrlPage(MethodCall call, Result result){ 202 | String url = call.argument("url"); 203 | Map info = (Map)call.argument("userInfo"); 204 | try { 205 | KeplerAttachParameter customerInfo = getAttachParameter(info); 206 | mKelperTask= KeplerApiManager.getWebViewService().openJDUrlPage(url, customerInfo,register.activity(), mOpenAppAction,TIMEOUT); 207 | } catch (KeplerBufferOverflowException | KeplerAttachException | JSONException e) { 208 | result.success(PluginResponse.failed(e).toMap()); 209 | } 210 | } 211 | 212 | /** 213 | * 打开导航页 214 | */ 215 | public void keplerNavigationPage(MethodCall call, Result result){ 216 | Map info = (Map)call.argument("userInfo"); 217 | try { 218 | KeplerAttachParameter customerInfo = getAttachParameter(info); 219 | mKelperTask= KeplerApiManager.getWebViewService().openNavigationPage(customerInfo,register.activity(), mOpenAppAction,TIMEOUT); 220 | } catch (KeplerBufferOverflowException | KeplerAttachException | JSONException e) { 221 | result.success(PluginResponse.failed(e).toMap()); 222 | } 223 | } 224 | 225 | /** 226 | * 通过SKU 打开商品详情 227 | */ 228 | public void keplerOpenItemDetail(MethodCall call, Result result){ 229 | String sku = call.argument("sku"); 230 | Map info = (Map)call.argument("userInfo"); 231 | try { 232 | KeplerAttachParameter customerInfo = getAttachParameter(info); 233 | mKelperTask= KeplerApiManager.getWebViewService().openItemDetailsPage(sku, customerInfo,register.activity(), mOpenAppAction,TIMEOUT); 234 | } catch (KeplerBufferOverflowException | KeplerAttachException | JSONException e) { 235 | result.success(PluginResponse.failed(e).toMap()); 236 | } 237 | } 238 | 239 | /** 240 | * 打开dingdan列表 241 | */ 242 | public void keplerOpenOrderList(MethodCall call, Result result){ 243 | Map info = (Map)call.argument("userInfo"); 244 | try { 245 | KeplerAttachParameter customerInfo = getAttachParameter(info); 246 | mKelperTask= KeplerApiManager.getWebViewService().openOrderListPage(customerInfo,register.activity(), mOpenAppAction,TIMEOUT); 247 | } catch (KeplerBufferOverflowException | KeplerAttachException | JSONException e) { 248 | result.success(PluginResponse.failed(e).toMap()); 249 | } 250 | } 251 | 252 | /** 253 | * 打开search结果 254 | * @param call 255 | * @param result 256 | */ 257 | public void keplerOpenSearchResult(MethodCall call, Result result){ 258 | String searchKey = call.argument("searchKey"); 259 | Map info = (Map)call.argument("userInfo"); 260 | try { 261 | KeplerAttachParameter customerInfo = getAttachParameter(info); 262 | mKelperTask= KeplerApiManager.getWebViewService().openSearchPage( 263 | searchKey, customerInfo, register.activity(), mOpenAppAction, TIMEOUT); 264 | } catch (KeplerBufferOverflowException | KeplerAttachException | JSONException e) { 265 | result.success(PluginResponse.failed(e).toMap()); 266 | } 267 | } 268 | 269 | /** 270 | * 打开购物车 271 | * @param result 272 | */ 273 | public void keplerOpenShoppingCart(MethodCall call, Result result){ 274 | Map info = (Map)call.argument("userInfo"); 275 | try { 276 | KeplerAttachParameter customerInfo = getAttachParameter(info); 277 | mKelperTask= KeplerApiManager.getWebViewService().openCartPage( 278 | customerInfo, register.activity(), mOpenAppAction, TIMEOUT); 279 | } catch (KeplerBufferOverflowException | KeplerAttachException | JSONException e) { 280 | result.success(PluginResponse.failed(e).toMap()); 281 | } 282 | } 283 | 284 | /** 285 | * 加入shoppingCart 286 | * @param result 287 | */ 288 | public void keplerAddToCartWithSku(MethodCall call, Result result){ 289 | String sku = call.argument("sku"); 290 | String[] skus = new String[]{sku}; 291 | String num = call.argument("num"); 292 | int[] numbers = new int[]{Integer.parseInt(num)}; 293 | try { 294 | KeplerApiManager.getWebViewService().add2Cart(register.activity(), skus, numbers, new ActionCallBck() { 295 | @Override 296 | public boolean onDateCall(int key, String info) { 297 | Map res = new HashMap<>(); 298 | res.put("key", key); 299 | res.put("info", info); 300 | result.success(PluginResponse.success(res).toMap()); 301 | return false; 302 | } 303 | @Override public boolean onErrCall(int key, final String error) { 304 | PluginResponse response = PluginUtil.addCartError(key, error); 305 | result.success(response.toMap()); 306 | return true; 307 | } 308 | }); 309 | } catch (Exception e) { 310 | result.success(PluginResponse.failed(e).toMap()); 311 | } 312 | } 313 | 314 | /** 315 | * 一键加入购物车 316 | * @param call call.argument["unionID"] 联盟ID,必须传入真实的联盟ID; 317 | * call.argument["appId"] APPID(查看位置:联盟后台-我的推广-推广管理-APP管理); 318 | * call.argument["skuID"] 加车商品的skuId ; 319 | * call.argument["refer"] H5文章页面传url,原生页面传域名+文章编号 ; 320 | * @param result 321 | */ 322 | public void keplerFastPurchase(MethodCall call, Result result){ 323 | String unionID = call.argument("unionID"); 324 | String appId = call.argument("appId"); 325 | String skuID = call.argument("skuID"); 326 | String refer = call.argument("refer"); 327 | 328 | KeplerApiManager.getWebViewService().addToCart(register.activity(), 329 | unionID, 330 | appId, 331 | skuID, 332 | refer, new ActionCallBck() { 333 | @Override 334 | public boolean onDateCall(int key, final String info) { 335 | Map res = new HashMap<>(); 336 | res.put("key", key); 337 | res.put("info", info); 338 | result.success(PluginResponse.success(res).toMap()); 339 | return false; 340 | } 341 | 342 | @Override 343 | public boolean onErrCall(final int key, final String error) { 344 | PluginResponse response = PluginUtil.addCartError(key, error); 345 | result.success(response.toMap()); 346 | return false; 347 | } 348 | }); 349 | } 350 | 351 | //原生SDK Android未实现此接口 352 | public void keplerCheckUpdate(MethodCall call, Result result){ 353 | //nothing to do 354 | } 355 | 356 | //原生SDK Android未实现此接口 357 | public void setKeplerProgressBarColor(MethodCall call, Result result){ 358 | //nothing to do 359 | } 360 | 361 | /** 362 | * 是否强制使用H5打开界面 默认为YES;设置为NO时,调用商品详情页,订单列表,购物车等方法时将跳转到京东app并打开对应的界面. 363 | * @param call 364 | * @param result 365 | */ 366 | public void setKeplerOpenByH5(MethodCall call, Result result){ 367 | boolean isOpenByH5 = call.argument("isOpenByH5"); 368 | KeplerGlobalParameter.getSingleton().setIsOpenByH5Mode(isOpenByH5); 369 | } 370 | 371 | /** 372 | * 打开京东后显示的返回按钮的tagID 373 | * @param call 374 | * @param result 375 | */ 376 | public void setKeplerJDappBackTagID(MethodCall call, Result result){ 377 | String JDappBackTagID = call.argument("JDappBackTagID"); 378 | KeplerGlobalParameter.getSingleton().setJDappBackTagID(JDappBackTagID); 379 | } 380 | 381 | } -------------------------------------------------------------------------------- /android/src/main/java/com/wxwx/flutter_kepler/FlutterKeplerPlugin.java: -------------------------------------------------------------------------------- 1 | package com.wxwx.flutter_kepler; 2 | 3 | import io.flutter.plugin.common.MethodCall; 4 | import io.flutter.plugin.common.MethodChannel; 5 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 6 | import io.flutter.plugin.common.MethodChannel.Result; 7 | import io.flutter.plugin.common.PluginRegistry.Registrar; 8 | 9 | /** FlutterKeplerPlugin */ 10 | public class FlutterKeplerPlugin implements MethodCallHandler { 11 | 12 | private static com.wxwx.flutter_kepler.FlutterKeplerHandle handle; 13 | /** Plugin registration. */ 14 | public static void registerWith(Registrar registrar) { 15 | handle = FlutterKeplerHandle.getInstance(registrar); 16 | final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_kepler"); 17 | channel.setMethodCallHandler(new FlutterKeplerPlugin()); 18 | } 19 | 20 | @Override 21 | public void onMethodCall(MethodCall call, Result result) { 22 | if (call.method.equals("getPlatformVersion")) { 23 | result.success("Android " + android.os.Build.VERSION.RELEASE); 24 | }else if(call.method.equals("initKepler")){ 25 | handle.initKepler(call, result); 26 | }else if(call.method.equals("keplerLogin")){ 27 | handle.keplerLogin(result); 28 | }else if(call.method.equals("keplerIsLogin")){ 29 | handle.keplerIsLogin(call, result); 30 | }else if(call.method.equals("keplerCancelAuth")){ 31 | handle.keplerCancelAuth(call, result); 32 | } else if(call.method.equals("keplerPageWithURL")){ 33 | handle.openJDUrlPage(call, result); 34 | } else if(call.method.equals("keplerNavigationPage")){ 35 | handle.keplerNavigationPage(call, result); 36 | } else if(call.method.equals("keplerOpenItemDetailWithSKU")){ 37 | handle.keplerOpenItemDetail(call, result); 38 | } else if(call.method.equals("keplerOpenOrderList")){ 39 | handle.keplerOpenOrderList(call, result); 40 | } else if(call.method.equals("keplerOpenSearchResult")){ 41 | handle.keplerOpenSearchResult(call, result); 42 | } else if(call.method.equals("keplerOpenShoppingCart")){ 43 | handle.keplerOpenShoppingCart(call, result); 44 | } else if(call.method.equals("keplerAddToCartWithSku")){ 45 | handle.keplerAddToCartWithSku(call, result); 46 | } else if(call.method.equals("keplerFastPurchase")){ 47 | handle.keplerFastPurchase(call, result); 48 | } else if(call.method.equals("keplerCheckUpdate")){ 49 | handle.keplerCheckUpdate(call, result); 50 | } else if(call.method.equals("setKeplerProgressBarColor")){ 51 | handle.setKeplerProgressBarColor(call, result); 52 | } else if(call.method.equals("setKeplerOpenByH5")){ 53 | handle.setKeplerOpenByH5(call, result); 54 | } else if(call.method.equals("setKeplerJDappBackTagID")){ 55 | handle.setKeplerJDappBackTagID(call, result); 56 | } else { 57 | result.notImplemented(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /android/src/main/java/com/wxwx/flutter_kepler/LoadingDialog.java: -------------------------------------------------------------------------------- 1 | package com.wxwx.flutter_kepler; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.os.Bundle; 6 | import android.widget.LinearLayout; 7 | import android.widget.TextView; 8 | 9 | import com.wxwx.flutter_kepler.R; 10 | 11 | public class LoadingDialog extends Dialog { 12 | 13 | private TextView tv; 14 | 15 | public LoadingDialog(Context context) { 16 | super(context, R.style.loadingDialogStyle); 17 | } 18 | 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | setContentView(R.layout.dialogloading); 23 | tv = (TextView)findViewById(R.id.tv); 24 | tv.setText("加载"); 25 | LinearLayout linearLayout = (LinearLayout)this.findViewById(R.id.LinearLayout); 26 | linearLayout.getBackground().setAlpha(210); 27 | } 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/wxwx/flutter_kepler/PluginConstants.java: -------------------------------------------------------------------------------- 1 | package com.wxwx.flutter_kepler; 2 | 3 | /** 4 | * @Author karedem 5 | * @Date 2019/9/10 11:28 6 | * @Description 常量类 7 | **/ 8 | public interface PluginConstants { 9 | 10 | /** 11 | * 超时时间设定 12 | */ 13 | int TIMEOUT = 15; 14 | String ERROR_CODE_EXCEPTION = "-99999"; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /android/src/main/java/com/wxwx/flutter_kepler/PluginResponse.java: -------------------------------------------------------------------------------- 1 | package com.wxwx.flutter_kepler; 2 | 3 | import java.io.Serializable; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import static com.wxwx.flutter_kepler.PluginConstants.*; 8 | 9 | /** 10 | * @Author karedem 11 | * @Date 2019/9/7 19:55 12 | * @Description 插件 响应返回实体类 13 | **/ 14 | public class PluginResponse implements Serializable { 15 | 16 | private String errorCode; 17 | private String errorMessage; 18 | private Object data; 19 | 20 | public static PluginResponse success(Object obj){ 21 | return new PluginResponse("0", "成功", obj); 22 | } 23 | 24 | public static PluginResponse failed(Exception e){ 25 | return new PluginResponse(ERROR_CODE_EXCEPTION, "异常中止: " + e.getMessage(), null); 26 | } 27 | 28 | public PluginResponse(String errorCode, String errorMessage, Object data) { 29 | this.errorCode = errorCode; 30 | this.errorMessage = errorMessage; 31 | this.data = data; 32 | } 33 | 34 | public Map toMap(){ 35 | HashMap map = new HashMap<>(); 36 | map.put("errorCode", errorCode); 37 | map.put("errorMessage", errorMessage); 38 | map.put("data", data); 39 | return map; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /android/src/main/java/com/wxwx/flutter_kepler/PluginUtil.java: -------------------------------------------------------------------------------- 1 | package com.wxwx.flutter_kepler; 2 | 3 | import static com.wxwx.flutter_kepler.PluginConstants.*; 4 | import com.kepler.jd.login.KeplerApiManager; 5 | import java.util.Map; 6 | 7 | /** 8 | * @Author karedem 9 | * @Date 2019/9/10 11:42 10 | * @Description 映射返回对应值 11 | **/ 12 | public class PluginUtil { 13 | 14 | 15 | //根据授权登陆错误码返回对应结果 16 | public static PluginResponse authError(int errorCode){ 17 | switch (errorCode) { 18 | case KeplerApiManager.KeplerApiManagerLoginErr_Init:// 初始化失败 19 | return new PluginResponse(String.valueOf(errorCode), "初始化失败", null); 20 | case KeplerApiManager.KeplerApiManagerLoginErr_InitIng:// 初始化没有完成 21 | return new PluginResponse(String.valueOf(errorCode), "初始化没有完成", null); 22 | case KeplerApiManager.KeplerApiManagerLoginErr_openH5authPageURLSettingNull://跳转url // 为null break; 23 | return new PluginResponse(String.valueOf(errorCode),"跳转url为null", null); 24 | case KeplerApiManager.KeplerApiManagerLoginErr_getTokenErr:// 获取失败(oath授权之后,获取cookie过程出错) break; 25 | return new PluginResponse(String.valueOf(errorCode),"获取cookie过程出错", null); 26 | case KeplerApiManager.KeplerApiManagerLoginErr_User_Cancel:// 用户取消 break; 27 | return new PluginResponse(String.valueOf(errorCode),"用户取消", null); 28 | case KeplerApiManager.KeplerApiManagerLoginErr_AuthErr_ActivityOpen://打开授权页面失败 break; 29 | return new PluginResponse(String.valueOf(errorCode),"打开授权页面失败", null); 30 | default: 31 | return new PluginResponse(String.valueOf(errorCode),"未定义的失败原因", null); 32 | } 33 | } 34 | 35 | //根据打开购物车错误码返回对应结果 36 | public static PluginResponse addCartError(int key, String error){ 37 | switch (key) { 38 | case KeplerApiManager.KeplerApiManagerActionErr: 39 | case KeplerApiManager.KeplerApiManagerActionServerErr: 40 | // 操作失败 break; 41 | case KeplerApiManager.KeplerApiManagerActionErr_CartFullErr: 42 | // 购物车上限 break; 43 | case KeplerApiManager.KeplerApiManagerActionErr_DataErr: 44 | case KeplerApiManager.KeplerApiManagerActionErr_ParameterErr: 45 | case KeplerApiManager.KeplerApiManagerActionErr_ParserErr: 46 | case KeplerApiManager.KeplerApiManagerActionErr_TokenLast: 47 | case KeplerApiManager.NetLinker_Err_Not_200: // 服务端出错 break; 48 | case KeplerApiManager.KeplerApiManagerActionErr_AppKeyNotExist:// app_key不存在 49 | case KeplerApiManager.KeplerApiManagerActionErr_AppKeyErr:// 无效app_key 50 | case KeplerApiManager.KeplerApiManagerActionErr_AppKeyLast://缺少app_key参数 break; 51 | case KeplerApiManager.KeplerApiManagerActionErr_TokenNotExist: 52 | case KeplerApiManager.KeplerApiManagerActionErr_UNLogin: 53 | case KeplerApiManager.KeplerApiManagerActionErr_TokenTimeOutTErr: 54 | // KeplerApiManager.getWebViewService().login( // StartActivityForSDK.this, // mLoginListener); break; 55 | case KeplerApiManager.NetLinker_Err_NoNetwork: // 没有网络 break; 56 | case KeplerApiManager.NetLinker_Err_UnsupportedEncodingException: 57 | case KeplerApiManager.NetLinker_Err_IOException: 58 | case KeplerApiManager.NetLinker_Err_ClientProtocolException: 59 | case KeplerApiManager.NetLinker_Err_NetException: // 网络访问出错 break; 60 | case KeplerApiManager.KeplerApiManagerAdd2CartErr_NoLogin: 61 | //调用加车接口失败,失败原因:未登录状态 62 | break; 63 | default: break; 64 | } 65 | //这里有error 暂时不用switch判断 66 | return new PluginResponse(String.valueOf(key), error, null); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/kepler_back_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/kepler_back_normal.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/kepler_back_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/kepler_back_pressed.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/kepler_selcet_more_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/kepler_selcet_more_normal.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/kepler_selcet_more_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/kepler_selcet_more_pressed.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/neterror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/neterror.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/seclect_item_has_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/seclect_item_has_message.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/seclect_item_history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/seclect_item_history.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/seclect_item_logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/seclect_item_logout.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/seclect_item_no_has_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/seclect_item_no_has_message.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/seclect_item_orderlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/seclect_item_orderlist.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/seclect_item_serch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/seclect_item_serch.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/select_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/select_bg.9.png -------------------------------------------------------------------------------- /android/src/main/res/drawable-xxhdpi/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlutterTaoBaoKe/flutter_kepler/1da2bff95d51bbd0406c37f9109405cbc4f93086/android/src/main/res/drawable-xxhdpi/white.png -------------------------------------------------------------------------------- /android/src/main/res/drawable/btn_reload.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/kepler_btn_back.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/kepler_btn_select_more.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/kepler_dialog_bk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/kepler_dialog_button_ne.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/kepler_dialog_button_po.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/pressbar_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/sdk_title_bg_with_shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/src/main/res/drawable/yuanjiao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /android/src/main/res/layout/dialogloading.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 23 | 24 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/src/main/res/layout/item_tab_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 15 | 16 | 23 | 24 | 32 | 33 | 34 | 41 | 42 | 49 | 50 | 58 | 59 | 60 | 67 | 68 | 76 | 77 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /android/src/main/res/layout/kepler_mid_lin.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/src/main/res/layout/kepler_simple_dialog_lay.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 25 | 26 | 37 | 38 | 39 | 43 | 44 | 51 | 52 |