Commit 9e6ee8e8ff5c0d221587b152e0d0193df4679eb0
1 parent
4378a687
Exists in
yxb_dev
and in
2 other branches
no message
Showing
8 changed files
with
77 additions
and
31 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/adapter/ChildAdapter.java
| ... | ... | @@ -33,7 +33,7 @@ public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean> { |
| 33 | 33 | |
| 34 | 34 | @Override |
| 35 | 35 | public BaseRecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
| 36 | - View view = LayoutInflater.from(context).inflate(R.layout.item_childlist, null); | |
| 36 | + View view = LayoutInflater.from(context).inflate(R.layout.activity_web_view, null); | |
| 37 | 37 | return new MyViewHolder(view); |
| 38 | 38 | } |
| 39 | 39 | |
| ... | ... | @@ -53,25 +53,29 @@ public class ChildAdapter extends BaseRecyclerViewAdapter<ChildBean> { |
| 53 | 53 | |
| 54 | 54 | @Override |
| 55 | 55 | public void onBindViewHolder(final ChildBean object, int position) { |
| 56 | - txt_childname.setText(object.getStudentName()); | |
| 57 | - txt_childclass.setText(object.getSchoolName() + " " + object.getClassName()); | |
| 58 | - itemView.setOnClickListener(new View.OnClickListener() { | |
| 59 | - @Override | |
| 60 | - public void onClick(View v) { | |
| 61 | - Gson g = new Gson(); | |
| 62 | - String jsonString = g.toJson(object, ChildBean.class).toString(); | |
| 63 | - context.startActivity(new Intent().putExtra("childJson", jsonString).setClass(context, ChildDetialActivity.class)); | |
| 64 | - } | |
| 65 | - }); | |
| 66 | - | |
| 67 | - go_buy.setOnClickListener(new View.OnClickListener() { | |
| 68 | - @Override | |
| 69 | - public void onClick(View v) { | |
| 70 | - WebViewActivity.getInstance(context, | |
| 71 | - AppConfig.BASE_URL_ORDER+"/ParentOrderCenter.aspx?userid="+ | |
| 72 | - AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID),AppConfig.ORDER_CENTER); | |
| 73 | - } | |
| 74 | - }); | |
| 56 | + try { | |
| 57 | + txt_childname.setText(object.getStudentName()); | |
| 58 | + txt_childclass.setText(object.getSchoolName() + " " + object.getClassName()); | |
| 59 | + itemView.setOnClickListener(new View.OnClickListener() { | |
| 60 | + @Override | |
| 61 | + public void onClick(View v) { | |
| 62 | + Gson g = new Gson(); | |
| 63 | + String jsonString = g.toJson(object, ChildBean.class).toString(); | |
| 64 | + context.startActivity(new Intent().putExtra("childJson", jsonString).setClass(context, ChildDetialActivity.class)); | |
| 65 | + } | |
| 66 | + }); | |
| 67 | + | |
| 68 | + go_buy.setOnClickListener(new View.OnClickListener() { | |
| 69 | + @Override | |
| 70 | + public void onClick(View v) { | |
| 71 | + WebViewActivity.getInstance(context, | |
| 72 | + AppConfig.BASE_URL_ORDER + "/ParentOrderCenter.aspx?userid=" + | |
| 73 | + AppConfig.getAppConfig(AppContext.getInstance()).get(AppConfig.USER_ID), AppConfig.ORDER_CENTER); | |
| 74 | + } | |
| 75 | + }); | |
| 76 | + } catch (Exception e) { | |
| 77 | + e.printStackTrace(); | |
| 78 | + } | |
| 75 | 79 | } |
| 76 | 80 | |
| 77 | 81 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/contract/consult/consultone/ConsultOneContract.java
| ... | ... | @@ -26,6 +26,8 @@ public interface ConsultOneContract { |
| 26 | 26 | public abstract void getBanners(String position,String areaName); |
| 27 | 27 | |
| 28 | 28 | public abstract void getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex); |
| 29 | + | |
| 30 | + public abstract void getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); | |
| 29 | 31 | } |
| 30 | 32 | |
| 31 | 33 | interface IConsultOneModel extends IBaseModel{ |
| ... | ... | @@ -34,6 +36,8 @@ public interface ConsultOneContract { |
| 34 | 36 | Observable<JsonObject> getBanners(String position,String areaName); |
| 35 | 37 | |
| 36 | 38 | Observable<JsonObject> getConsultContent(String areaName, int channel, int toFirstPage, int pageIndex); |
| 39 | + | |
| 40 | + Observable<JsonObject> getInformationTopic(String keyword,String areaName,String channel,String toFirstPage,int pageIndex); | |
| 37 | 41 | } |
| 38 | 42 | |
| 39 | 43 | interface IConsultOneView extends IBaseFragment{ | ... | ... |
app/src/main/java/com/shunzhi/parent/presenter/consult/consultone/ConsultOnePresenter.java
| ... | ... | @@ -93,7 +93,7 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
| 93 | 93 | JsonObject json=jsonObject.getAsJsonObject("data"); |
| 94 | 94 | Gson g=new Gson(); |
| 95 | 95 | ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); |
| 96 | - Log.e("ssss-===",channelInfo.toString()); | |
| 96 | +// Log.e("ssss-===",channelInfo.toString()); | |
| 97 | 97 | List<ChannelContextBean> contextList = channelInfo.getChannelContent(); |
| 98 | 98 | List<ChannelBean> channelList = channelInfo.getSubchannel(); |
| 99 | 99 | mIView.showChannel(channelList); |
| ... | ... | @@ -109,6 +109,28 @@ public class ConsultOnePresenter extends ConsultOneContract.ConsultOnePresenter{ |
| 109 | 109 | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | + @Override | |
| 113 | + public void getInformationTopic(String keyword, String areaName, String channel, String toFirstPage,int pageIndex) { | |
| 114 | + mRxManager.register(mIModel.getInformationTopic(keyword,areaName,channel,toFirstPage,pageIndex).subscribe(new Consumer<JsonObject>() { | |
| 115 | + @Override | |
| 116 | + public void accept(JsonObject jsonObject) throws Exception { | |
| 117 | + JsonObject json=jsonObject.getAsJsonObject("data"); | |
| 118 | + Gson g=new Gson(); | |
| 119 | + ChannelInfo channelInfo = g.fromJson(json.toString(),ChannelInfo.class); | |
| 120 | +// Log.e("ssss-===",channelInfo.toString()); | |
| 121 | + List<ChannelContextBean> contextList = channelInfo.getChannelContent(); | |
| 122 | + List<ChannelBean> channelList = channelInfo.getSubchannel(); | |
| 123 | + mIView.showChannel(channelList); | |
| 124 | + mIView.showConsultContent(contextList); | |
| 125 | + } | |
| 126 | + }, new Consumer<Throwable>() { | |
| 127 | + @Override | |
| 128 | + public void accept(Throwable throwable) throws Exception { | |
| 129 | + OkHttpExceptionUtil.handOkHttpException((HttpException) throwable); | |
| 130 | + } | |
| 131 | + })); | |
| 132 | + } | |
| 133 | + | |
| 112 | 134 | |
| 113 | 135 | @Override |
| 114 | 136 | public ConsultOneContract.IConsultOneModel getModel() { | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
| ... | ... | @@ -27,8 +27,8 @@ public class WebViewActivity extends BaseCompatActivity { |
| 27 | 27 | |
| 28 | 28 | NestedScrollWebView nesteScrollWebView; |
| 29 | 29 | LinearLayout binding_success, binding_success2; |
| 30 | -// ImageView close; | |
| 31 | - TextView tv_info,zuoye,title_web,close_btn; | |
| 30 | + ImageView close_btn; | |
| 31 | + TextView tv_info,zuoye,title_web; | |
| 32 | 32 | |
| 33 | 33 | int type; |
| 34 | 34 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/orderdetail/OrderDetailActivity.java
| ... | ... | @@ -17,13 +17,16 @@ import com.share.mvpsdk.base.BasePresenter; |
| 17 | 17 | import com.share.mvpsdk.base.activity.BaseMVPCompatActivity; |
| 18 | 18 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewAdapter; |
| 19 | 19 | import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 20 | +import com.share.mvpsdk.base.adapter.OnItemClickListener; | |
| 20 | 21 | import com.share.mvpsdk.utils.DateUtils; |
| 21 | 22 | import com.share.mvpsdk.utils.DisplayUtils; |
| 23 | +import com.shunzhi.parent.AppConfig; | |
| 22 | 24 | import com.shunzhi.parent.R; |
| 23 | 25 | import com.shunzhi.parent.bean.orderdetail.OrderDetailBean; |
| 24 | 26 | import com.shunzhi.parent.bean.orderdetail.OrderDetailBeanList; |
| 25 | 27 | import com.shunzhi.parent.contract.orderdetail.OrderDetailContract; |
| 26 | 28 | import com.shunzhi.parent.presenter.orederdetail.OrderDetailPresenter; |
| 29 | +import com.shunzhi.parent.ui.activity.mywebview.WebViewActivity; | |
| 27 | 30 | |
| 28 | 31 | import java.util.List; |
| 29 | 32 | |
| ... | ... | @@ -119,6 +122,14 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra |
| 119 | 122 | tvDate.setText(object.date); |
| 120 | 123 | |
| 121 | 124 | myOrderBeanListAdapter.addAll(object.orderList); |
| 125 | + myOrderBeanListAdapter.setOnItemClickListener(new OnItemClickListener() { | |
| 126 | + @Override | |
| 127 | + public void onItemClickListener(Object object, int position) { | |
| 128 | + OrderDetailBeanList orderDetailBeanList= (OrderDetailBeanList) object; | |
| 129 | + WebViewActivity.getInstance(OrderDetailActivity.this, | |
| 130 | + AppConfig.BASE_URL_ORDER+"OrderDetail.aspx?orderid="+orderDetailBeanList.orderId,-1); | |
| 131 | + } | |
| 132 | + }); | |
| 122 | 133 | |
| 123 | 134 | } |
| 124 | 135 | |
| ... | ... | @@ -154,7 +165,7 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra |
| 154 | 165 | } |
| 155 | 166 | |
| 156 | 167 | @Override |
| 157 | - public void onBindViewHolder(OrderDetailBeanList object, int position) { | |
| 168 | + public void onBindViewHolder(final OrderDetailBeanList object, final int position) { | |
| 158 | 169 | tvStartTIme_EndTime.setText(object.saleStartTime.split(" ")[0]+"-"+ |
| 159 | 170 | object.saleEndTime.split(" ")[0]); |
| 160 | 171 | tvProductName.setText(object.productName); |
| ... | ... | @@ -172,6 +183,13 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra |
| 172 | 183 | tvPayState.setText("支付失败"); |
| 173 | 184 | break; |
| 174 | 185 | } |
| 186 | + | |
| 187 | + layout_order_list.setOnClickListener(new View.OnClickListener() { | |
| 188 | + @Override | |
| 189 | + public void onClick(View view) { | |
| 190 | + onItemClickListener.onItemClickListener(object,position); | |
| 191 | + } | |
| 192 | + }); | |
| 175 | 193 | } |
| 176 | 194 | } |
| 177 | 195 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
| ... | ... | @@ -70,7 +70,6 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 70 | 70 | @Override |
| 71 | 71 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
| 72 | 72 | |
| 73 | - | |
| 74 | 73 | recycler_context = view.findViewById(R.id.recycler_content); |
| 75 | 74 | initRecycler(); |
| 76 | 75 | |
| ... | ... | @@ -86,8 +85,8 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
| 86 | 85 | videoplayer.backButton.setVisibility(View.GONE); |
| 87 | 86 | |
| 88 | 87 | // mPresenter.getTools(layout_control); |
| 89 | - mPresenter.getBanners("2", "余杭区"); | |
| 90 | - mPresenter.getContextChannel("余杭区", 0, 1, 1); | |
| 88 | + mPresenter.getBanners("2", AppContext.getInstance().district); | |
| 89 | + mPresenter.getContextChannel(AppContext.getInstance().district, 0, 1, 1); | |
| 91 | 90 | |
| 92 | 91 | initBroadCast(); |
| 93 | 92 | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
| ... | ... | @@ -21,6 +21,7 @@ import com.share.mvpsdk.base.adapter.BaseRecyclerViewHolder; |
| 21 | 21 | import com.share.mvpsdk.base.fragment.BaseMVPCompatFragment; |
| 22 | 22 | import com.share.mvpsdk.utils.DisplayUtils; |
| 23 | 23 | import com.shunzhi.parent.AppConfig; |
| 24 | +import com.shunzhi.parent.AppContext; | |
| 24 | 25 | import com.shunzhi.parent.R; |
| 25 | 26 | import com.shunzhi.parent.adapter.MyConsultAdapter; |
| 26 | 27 | import com.shunzhi.parent.bean.GuangGaoBean; |
| ... | ... | @@ -85,8 +86,8 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 85 | 86 | recyclerViewGrally = view.findViewById(R.id.recyclerViewGrally); |
| 86 | 87 | recyclerViewConsultOne = view.findViewById(R.id.recyclerViewConsultOne); |
| 87 | 88 | |
| 88 | - mPresenter.getBanners("3","余杭"); | |
| 89 | - mPresenter.getConsultContent("余杭区", 42, 0, 1); | |
| 89 | + mPresenter.getBanners("3", AppContext.getInstance().district); | |
| 90 | + mPresenter.getConsultContent(AppContext.getInstance().district, 42, 0, 1); | |
| 90 | 91 | // initRecyclerViewConsult(); |
| 91 | 92 | } |
| 92 | 93 | |
| ... | ... | @@ -126,7 +127,6 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon |
| 126 | 127 | |
| 127 | 128 | @Override |
| 128 | 129 | public void showBanners(List<GuangGaoBean> guangGaoBeanList) { |
| 129 | - Log.d("6666","imgesUrl="+guangGaoBeanList); | |
| 130 | 130 | initRecyclerView(guangGaoBeanList); |
| 131 | 131 | } |
| 132 | 132 | ... | ... |
app/src/main/res/layout/activity_mychild.xml