Axion 7 anos atrás
pai
commit
3e80c29b81

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -37,6 +37,7 @@
         </activity>
         <activity android:name=".home.acticity.commonActivity"/>
         <activity android:name=".home.acticity.homeNewsDetailActivity"/>
+        <activity android:name=".home.acticity.researchResultActivity"/>
     </application>
 
 </manifest>

+ 14 - 0
app/src/main/java/com/wiipu/peopleheart/home/HomeFragment.java

@@ -3,6 +3,7 @@ package com.wiipu.peopleheart.home;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
+import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 
@@ -19,6 +20,7 @@ import com.wiipu.peopleheart.home.contract.HomeContract;
 import com.wiipu.peopleheart.home.presenter.HomePresenter;
 import com.wiipu.peopleheart.home.response.homeNewsResponse;
 import com.wiipu.peopleheart.home.response.topNewsResponse;
+import com.wiipu.peopleheart.widget.ClearEditText;
 import com.wiipu.peopleheart.widget.convenientBanner.GlideHolderView;
 
 import java.util.ArrayList;
@@ -33,6 +35,15 @@ public class HomeFragment extends BaseMvpFragment implements HomeContract.View,O
     @BindView(R.id.cb_images)
     ConvenientBanner mConvenientBanner;
 
+    @BindView(R.id.et_query_num)
+    ClearEditText query_num;
+
+    @BindView(R.id.et_pass)
+    ClearEditText query_pass;
+
+    @BindView(R.id.bt_query)
+    Button bt_query;
+
     @BindView(R.id.rv_tushuominzhu)
     RecyclerView homeRcylerView;
 
@@ -136,6 +147,7 @@ public class HomeFragment extends BaseMvpFragment implements HomeContract.View,O
         dajiaping.setOnClickListener(this);
         mianduimian.setOnClickListener(this);
         yijiantiwen.setOnClickListener(this);
+        bt_query.setOnClickListener(this);
 
     }
 
@@ -300,6 +312,8 @@ public class HomeFragment extends BaseMvpFragment implements HomeContract.View,O
                 commonActivity.start(getActivity(), "http://rongzhi110.xazhima.com/weixinMinxin/indexToReservation.php"
                         , getResources().getString(R.string.tv_mianduimianyuyue));
                 break;
+            case R.id.bt_query:
+                
             default:
                 break;
         }

+ 106 - 0
app/src/main/java/com/wiipu/peopleheart/home/acticity/researchResultActivity.java

@@ -0,0 +1,106 @@
+package com.wiipu.peopleheart.home.acticity;
+
+import android.content.Context;
+import android.content.Intent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.wiipu.commonlib.base.BaseMvpActivity;
+import com.wiipu.peopleheart.R;
+import com.wiipu.peopleheart.home.contract.researchResultContract;
+import com.wiipu.peopleheart.home.presenter.researchResultPresenter;
+import com.wiipu.peopleheart.home.response.researchResultResponse;
+
+import butterknife.BindView;
+
+/**
+ * Description:首页办件查询详情
+ */
+public class researchResultActivity extends BaseMvpActivity implements researchResultContract.View{
+
+    @BindView(R.id.iv_back)
+    ImageView iv_back;
+
+    @BindView(R.id.research_frame)
+    FrameLayout mFrameLayout;
+
+    private researchResultPresenter mResearchResultPresenter;
+
+    private View itemView;
+
+    public static void start(Context context,String index,String password) {
+        Intent intent = new Intent(context, researchResultActivity.class);
+        intent.putExtra("index", index);
+        intent.putExtra("password", password);
+        context.startActivity(intent);
+
+    }
+
+    @Override
+    public void showResearchResult(researchResultResponse researchResultResponse) {
+        itemView = LayoutInflater.from(researchResultActivity.this).inflate(R.layout.item_research_result, null);
+        TextView title = itemView.findViewById(R.id.item_research_title);
+        title.setText("索引号");
+        TextView content = itemView.findViewById(R.id.item_research_content);
+        content.setText(researchResultResponse.getIndex());
+        mFrameLayout.addView(itemView);
+    }
+
+    @Override
+    public void showEmpty() {
+
+    }
+
+    @Override
+    public void showError(String message) {
+
+    }
+
+    @Override
+    protected void attach() {
+        mResearchResultPresenter = new researchResultPresenter(this);
+    }
+
+    @Override
+    protected void detach() {
+
+    }
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_research_result;
+    }
+
+    @Override
+    protected void initViews() {
+
+    }
+
+    @Override
+    protected void initListeners() {
+
+    }
+
+    @Override
+    protected void initData() {
+        Intent intent = getIntent();
+        String index = intent.getStringExtra("index");
+        String password = intent.getStringExtra("password");
+        mResearchResultPresenter.getResearchResult(index, password);
+    }
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.iv_back:
+                finish();
+                break;
+            default:
+                break;
+
+        }
+    }
+}

+ 21 - 0
app/src/main/java/com/wiipu/peopleheart/home/contract/researchResultContract.java

@@ -0,0 +1,21 @@
+package com.wiipu.peopleheart.home.contract;
+
+import com.wiipu.commonlib.base.BaseView;
+import com.wiipu.peopleheart.home.response.researchResultResponse;
+
+/**
+ * Description:
+ */
+public interface researchResultContract {
+
+    interface View extends BaseView {
+
+        void showResearchResult(researchResultResponse researchResultResponse);
+
+    }
+
+    interface Presenter {
+        void getResearchResult(String index, String password);
+    }
+
+}

+ 50 - 0
app/src/main/java/com/wiipu/peopleheart/home/presenter/researchResultPresenter.java

@@ -0,0 +1,50 @@
+package com.wiipu.peopleheart.home.presenter;
+
+import com.wiipu.commonlib.base.BasePresenter;
+import com.wiipu.commonlib.base.BaseResponse;
+import com.wiipu.commonlib.net.HttpClient;
+import com.wiipu.commonlib.net.HttpObserver;
+import com.wiipu.commonlib.net.RxTransformer;
+import com.wiipu.commonlib.utils.LogUtils;
+import com.wiipu.commonlib.utils.VerifyUtils;
+import com.wiipu.peopleheart.application.Constants;
+import com.wiipu.peopleheart.home.contract.researchResultContract;
+import com.wiipu.peopleheart.home.response.researchResultResponse;
+import com.wiipu.peopleheart.home.response.topNewsResponse;
+import com.wiipu.peopleheart.home.services.HomeServices;
+
+import rx.Subscription;
+
+/**
+ * Description:
+ */
+public class researchResultPresenter extends BasePresenter<researchResultContract.View> implements researchResultContract.Presenter {
+    public researchResultPresenter(researchResultContract.View view) {
+        super(view);
+    }
+
+    @Override
+    public void getResearchResult(String index, String password) {
+        final String method = "find_handing";
+        long timestamp = System.currentTimeMillis();
+        String sign = VerifyUtils.getSign(method, timestamp);
+        Subscription subscription = HttpClient.getInstance()
+                .create(HomeServices.class)
+                .getResearchResult(method, timestamp, Constants.SRC, index,password,sign)
+                .compose(RxTransformer.<BaseResponse<researchResultResponse>>apply())
+                .subscribe(new HttpObserver<researchResultResponse>() {
+                    @Override
+                    public void success(researchResultResponse result) {
+                        mView.showResearchResult(result);
+
+                    }
+
+                    @Override
+                    public void fail(String msg) {
+                        mView.showError(msg);
+                        LogUtils.e(msg);
+                    }
+                });
+        mSubscriptions.add(subscription);
+    }
+}

+ 81 - 0
app/src/main/java/com/wiipu/peopleheart/home/response/researchResultResponse.java

@@ -0,0 +1,81 @@
+package com.wiipu.peopleheart.home.response;
+
+/**
+ * Description:
+ */
+public class researchResultResponse {
+    /**
+     * "index": "1",
+     "title": "测试全选",
+     "category": "1",
+     "count": "0",
+     "content": "测速",
+     "status": "正在办理",
+     "process": "2018-09-06   市民提交问题;"
+
+     */
+
+    private String index;
+    private String title;
+    private String category;
+    private String count;
+    private String content;
+    private String status;
+    private String process;
+
+    public String getIndex() {
+        return index;
+    }
+
+    public void setIndex(String index) {
+        this.index = index;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getCount() {
+        return count;
+    }
+
+    public void setCount(String count) {
+        this.count = count;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getProcess() {
+        return process;
+    }
+
+    public void setProcess(String process) {
+        this.process = process;
+    }
+}

+ 14 - 0
app/src/main/java/com/wiipu/peopleheart/home/services/HomeServices.java

@@ -3,6 +3,7 @@ package com.wiipu.peopleheart.home.services;
 import com.wiipu.commonlib.base.BaseResponse;
 import com.wiipu.peopleheart.home.response.homeNewsDetailResponse;
 import com.wiipu.peopleheart.home.response.homeNewsResponse;
+import com.wiipu.peopleheart.home.response.researchResultResponse;
 import com.wiipu.peopleheart.home.response.topNewsResponse;
 
 import retrofit2.http.Field;
@@ -50,4 +51,17 @@ public interface HomeServices {
                                                                        @Field("id") String id,
                                                                        @Field("sign") String sign);
 
+    /**
+     * 首页办件查询
+     */
+
+    @POST("api.php")
+    @FormUrlEncoded
+    Observable<BaseResponse<researchResultResponse>> getResearchResult(@Field("method") String method,
+                                                                       @Field("timestamp") long timestamp,
+                                                                       @Field("source") int source,
+                                                                       @Field("index") String index,
+                                                                       @Field("password") String password,
+                                                                       @Field("sign") String sign);
+
 }

+ 40 - 0
app/src/main/res/layout/activity_research_result.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:orientation="vertical"
+    >
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/margin48dp"
+        android:background="@color/blue_black">
+
+        <ImageView
+            android:id="@+id/iv_back"
+            android:layout_width="@dimen/margin20dp"
+            android:layout_height="@dimen/margin20dp"
+            android:src="@drawable/ic_imagepicker_arrow_left"
+            android:layout_alignParentLeft="true"
+            android:layout_centerInParent="true"
+            android:layout_marginLeft="10dp"
+            />
+        <TextView
+            android:id="@+id/tv_title_common"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:textSize="@dimen/textsize_20"
+            android:textColor="@color/white"
+            android:text="@string/tv_research_title"
+            android:layout_centerInParent="true"
+            />
+
+    </RelativeLayout>
+
+    <FrameLayout
+        android:id="@+id/research_frame"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"/>
+
+</LinearLayout>

+ 34 - 0
app/src/main/res/layout/item_research_result.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:orientation="horizontal"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content">
+
+    <TextView
+        android:layout_width="@dimen/margin100dp"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:id="@+id/item_research_title"
+        />
+
+    <ImageView
+        android:layout_width="@dimen/margin20dp"
+        android:layout_height="@dimen/margin20dp"
+        android:layout_gravity="center"
+        android:src="@drawable/details_adjustment_point"
+        android:visibility="gone"
+        android:id="@+id/item_research_iv"
+        />
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:id="@+id/item_research_content"
+        android:layout_marginStart="@dimen/margin20dp"
+        android:gravity="center"
+        />
+
+
+
+
+</LinearLayout>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -36,6 +36,7 @@
     <string name="tv_tushuominsheng">图说民生</string>
     <string name="tv_ques_one_key">一键提问</string>
     <string name="tv_detail_news">民生新闻详情</string>
+    <string name="tv_research_title">办件详情</string>
 
 
 </resources>