Giter VIP home page Giter VIP logo

simple-epc's Introduction

简版EPC SDK开发文档

  • build.gradle设置
allprojects {
    repositories {
        flatDir {
                    dirs 'libs'
                }
        maven { url "https://raw.githubusercontent.com/tudahua/simple-epc/master" }
    }
}
 implementation 'com.qixiubao:simple-epc:1.0.3'
  • 初始化
 ApiServiceDelegate.init(Context context,String appId, String secret, boolean isDebug); 
  • 获取分类数据
         HashMap<String, Object> map = new HashMap<>();
         map.put("brand_id", 14);
         map.put("epc_id", 1014);
         ApiServiceDelegate.getApiServiceDelegate(this)
                 .getAllCate(map)
                 .enqueue(new CallBack<CataModel>() {
                     @Override
                     public void onSuccess(CataModel cataModel) {
                         //成功回调
                     }
                     @Override
                     public void onFailure(String message, int code) {
                         //失败回调
                     }
                 });
  • 获取当前部位下组图数据

            HashMap<String, Object> map = new HashMap<>();
            //分类部件Id
            map.put("id", 99);
            map.put("model_id", 7252);
            ApiServiceDelegate.getApiServiceDelegate(this)
                    .getCataDetail(map)
                    .enqueue(new CallBack<CataDetail>() {
                        @Override
                        public void onSuccess(CataDetail data) {
                        }
    
                        @Override
                        public void onFailure(String message, int code) {
                        }
                    });
  • 默认UI入口

 RequireData requireData = new RequireData();
//0:BSM 模式 1:EPC模式
 requireData.type = 0;
 requireData.brand_id = 68;
 requireData.model_id = 7252;
 requireData.epc_id = 1034;
 requireData.token = "549bdd7064d455610946d69d0ca6717b";
 requireData.access_time = "1548466724";
 requireData.param = "5kNCKBb8XZ0vYMgxb3e2odC4zvRz-v6y_Eywj-2hzzJzbneuYdJzlJymgv6czzJzY3KxU2k0a34vYMg0adBzlJybmg6YpEIx_zz7z3k7YMk-Zda0Y3s_Zde5od4uzvRzjvq3izz7z3a0b2gwVzy9pcNzYns_YZy9pZyzj-qvj-6vzzJzjvuxivu0jzyA1z04VnjzlJyDnvZzXgF7z2wjadgxUnnzlJyzj-qvj-2xzzJzbns0aGe2V3egVjy9zvqxz2H";
 Intent intent = SimpleEpcCatalogActivity.getCallingIntent(MainActivity.this, requireData);
 startActivity(intent);
 //选中回调
 SimpleEpcCatalogActivity.setOnSelectedCallBack(new SimpleEpcCatalogActivity.OnSelectedCallBack() {
       @Override
       public void onSelected(SimpleEpcDetail data, int position) {
       //选中的配件
       SimpleEpcDetail.DataBean.ListBean listBean = data.data.list.get(position); 
       }
 });
  • SimpleEpcImageView使用方法(详细示例查看demo)
 void setData(int picWidth, int picHeight, final List<SimpleEpcCatalogBean> data, Bitmap bitmap);
 void setOnSelectedListener(OnSelectedListener onSelectedListener);
 public interface OnSelectedListener {
       /**
        * 点选回调
        *
        * @param index 点中第几个
        */
       void onClickSelected(int index);

       /**
        * 圈选回调
        *
        * @param selectedList selectedList.selectedChildren 圈选中的配件
        */
       void onDrawSelected(List<SimpleEpcCatalogBean> selectedList);

       /**
        * 旋转后滑动收回
        */
       void onSlide();
   }

simple-epc's People

Contributors

tudahua avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.