-        LogHelper.d("czy","即将上传的照片是"+currentPhoto);
46
-        new UploadTask(currentPhoto,this).executeOnExecutor(ThreadExecutor.getInstance().getExecutor());
47
-    }
29
+    private void startQuery(){
30
+        HashMap<String,String> params = new HashMap<>();
31
+        params.put("user_id", Preferences.getInstance().getLensManId());
32
+        new HttpPostTask(params){
33
+            OrderBean orderBean;
34
+            @Override
35
+            protected boolean parseResponse(String response) {
36
+                orderBean = new OrderBean();
48 37
 
49
-    @Override
50
-    public void onPhotoUploadSucceed(PhotoBean bean) {
51
-        if(bean.equals(currentPhoto)){
52
-            currentPhoto.uploadStatus =  PhotoBean.UploadStatus.STATUS_SUCCESS;
53
-            DBService.getInstance().updatePhotoBean(currentPhoto);
54
-            if(listener!=null){
55
-                listener.onPhotoUploaded(currentPhoto);
38
+                return super.parseResponse(response);
56 39
             }
57
-            currentPhoto = null;
58
-        }
59
-        startUpload();
60
-    }
61 40
 
62
-    @Override
63
-    public void onPhotoUploadFail(PhotoBean bean) {
64
-        if(bean.equals(currentPhoto)){
65
-            currentPhoto.uploadStatus =  PhotoBean.UploadStatus.STATUS_ERROR;
66
-            DBService.getInstance().updatePhotoBean(currentPhoto);
67
-            if(listener!=null){
68
-                listener.onPhotoUploadError(currentPhoto);
41
+            @Override
42
+            protected void onPostSuccess() {
43
+                super.onPostSuccess();
44
+                onNewOrderArrived(orderBean);
69 45
             }
70
-            currentPhoto = null;
71
-        }
72
-        startUpload();
73
-    }
74 46
 
75
-    public void setPhotoUploadListener(PhotoUploadListener listener){
76
-        this.listener = listener;
47
+            @Override
48
+            protected void onPostFail() {
49
+                super.onPostFail();
50
+            }
51
+        }.executeOnExecutor(ThreadExecutor.getInstance().getExecutor());
52
+
77 53
     }
78 54
 
79
-    public interface PhotoUploadListener{
80
-        void onPhotoUploaded(PhotoBean bean);
81
-        void onPhotoUploadError(PhotoBean bean);
55
+    private void onNewOrderArrived(OrderBean bean){
56
+
82 57
     }
83 58
 
84
-    public class MyBinder extends Binder {
59
+    public class OrderServiceBinder extends Binder {
85 60
 
86 61
         public OrderDealService getService(){
87 62
             return OrderDealService.this;

+ 1 - 0
app/src/main/java/ai/pai/lensman/utils/UrlContainer.java

@@ -37,6 +37,7 @@ public class UrlContainer {
37 37
 
38 38
     public static final String BRIEFS_URL = HOST_URL+"l/brief";
39 39
 
40
+    public static final String QUERY_ORDER_URL = HOST_URL+"l/query";
40 41
 
41 42
 
42 43
 }

kodo - Gogs: Go Git Service

Aucune description

Brightcells: a7cbbf15a7 Update max_length for CharField 8 ans auparavant
..
0001_initial.py 7a17d0fb90 add api wxpay & add redis relative 10 ans auparavant
0002_orderinfo_trade_type.py 0f425ae151 add api wx_order_query_api 10 ans auparavant
0003_auto_20160417_1544.py a0dfcb6f16 Alter field pay_status on orderinfo 10 ans auparavant
0004_auto_20160422_1322.py 102152ca4a add api lensman_photo_bought & modify api wx_order_create_api and adjust return field 10 ans auparavant
0005_remove_orderinfo_to_lid.py 8c384ff52e remove to_lid 10 ans auparavant
0006_auto_20160901_1439.py 6199c8f7ad add api lensman_origin_wanted_api/lensman_origin_photo_upload_api 10 ans auparavant
0007_orderinfo_unifiedorder_result.py b2aa0f8533 Add new field unifiedorder_result 9 ans auparavant
0008_auto_20170714_0759.py 32061504ff Add some fields for Order 9 ans auparavant
0009_auto_20170715_2314.py 75dbf7fdc8 New migration 9 ans auparavant
0010_auto_20180101_2220.py 9bb56c50cc Makemigrations 8 ans auparavant
0011_auto_20180103_0446.py a7cbbf15a7 Update max_length for CharField 8 ans auparavant
__init__.py 7a17d0fb90 add api wxpay & add redis relative 10 ans auparavant