Commit 9ef200d2706bbdd84aba779f0105a6ea17c17bc1
1 parent
0118d641
Exists in
yxb_dev
and in
2 other branches
no message
Showing
6 changed files
with
56 additions
and
44 deletions
Show diff stats
app/src/main/java/com/shunzhi/parent/ui/activity/consult/ConsultTwoLevelActivity.java
@@ -23,9 +23,10 @@ import java.util.List; | @@ -23,9 +23,10 @@ import java.util.List; | ||
23 | 23 | ||
24 | public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements View.OnClickListener { | 24 | public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements View.OnClickListener { |
25 | 25 | ||
26 | - public static void getInstance(Context context,String channel){ | 26 | + public static void getInstance(Context context,String channel,String titleName){ |
27 | Intent intent=new Intent(context,ConsultTwoLevelActivity.class); | 27 | Intent intent=new Intent(context,ConsultTwoLevelActivity.class); |
28 | intent.putExtra("channel",channel); | 28 | intent.putExtra("channel",channel); |
29 | + intent.putExtra("titleName",titleName); | ||
29 | context.startActivity(intent); | 30 | context.startActivity(intent); |
30 | } | 31 | } |
31 | 32 | ||
@@ -33,7 +34,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | @@ -33,7 +34,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | ||
33 | 34 | ||
34 | EditText et_search; | 35 | EditText et_search; |
35 | 36 | ||
36 | - String channel; | 37 | + String channel,titleName; |
37 | 38 | ||
38 | FrameLayout frame_consult_two; | 39 | FrameLayout frame_consult_two; |
39 | 40 | ||
@@ -51,6 +52,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | @@ -51,6 +52,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | ||
51 | 52 | ||
52 | private void initViews() { | 53 | private void initViews() { |
53 | channel=getIntent().getStringExtra("channel"); | 54 | channel=getIntent().getStringExtra("channel"); |
55 | + titleName=getIntent().getStringExtra("titleName"); | ||
54 | ivBack = findViewById(R.id.ivBack); | 56 | ivBack = findViewById(R.id.ivBack); |
55 | ivBack.setOnClickListener(this); | 57 | ivBack.setOnClickListener(this); |
56 | frame_consult_two=findViewById(R.id.frame_consult_two); | 58 | frame_consult_two=findViewById(R.id.frame_consult_two); |
@@ -63,6 +65,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | @@ -63,6 +65,7 @@ public class ConsultTwoLevelActivity extends BaseMVPCompatActivity implements Vi | ||
63 | consultTwoLevelFragment=new ConsultTwoLevelFragment(); | 65 | consultTwoLevelFragment=new ConsultTwoLevelFragment(); |
64 | Bundle bundle=new Bundle(); | 66 | Bundle bundle=new Bundle(); |
65 | bundle.putString("channel",channel); | 67 | bundle.putString("channel",channel); |
68 | + bundle.putString("titleName",titleName); | ||
66 | consultTwoLevelFragment.setArguments(bundle); | 69 | consultTwoLevelFragment.setArguments(bundle); |
67 | getSupportFragmentManager().beginTransaction().add(R.id.frame_consult_two,consultTwoLevelFragment) | 70 | getSupportFragmentManager().beginTransaction().add(R.id.frame_consult_two,consultTwoLevelFragment) |
68 | .show(consultTwoLevelFragment).commit(); | 71 | .show(consultTwoLevelFragment).commit(); |
app/src/main/java/com/shunzhi/parent/ui/activity/orderdetail/OrderDetailActivity.java
@@ -156,12 +156,15 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra | @@ -156,12 +156,15 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra | ||
156 | 156 | ||
157 | private TextView tvStartTIme_EndTime,tvProductName,tvPayState; | 157 | private TextView tvStartTIme_EndTime,tvProductName,tvPayState; |
158 | 158 | ||
159 | + private ImageView ivState; | ||
160 | + | ||
159 | public MyOrderBeanListViewHolder(View itemView) { | 161 | public MyOrderBeanListViewHolder(View itemView) { |
160 | super(itemView); | 162 | super(itemView); |
161 | layout_order_list=itemView.findViewById(R.id.layout_order_list); | 163 | layout_order_list=itemView.findViewById(R.id.layout_order_list); |
162 | tvStartTIme_EndTime=itemView.findViewById(R.id.tvStartTIme_EndTime); | 164 | tvStartTIme_EndTime=itemView.findViewById(R.id.tvStartTIme_EndTime); |
163 | tvProductName=itemView.findViewById(R.id.tvProductName); | 165 | tvProductName=itemView.findViewById(R.id.tvProductName); |
164 | tvPayState=itemView.findViewById(R.id.tvPayState); | 166 | tvPayState=itemView.findViewById(R.id.tvPayState); |
167 | + ivState=itemView.findViewById(R.id.ivState); | ||
165 | } | 168 | } |
166 | 169 | ||
167 | @Override | 170 | @Override |
@@ -172,15 +175,19 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra | @@ -172,15 +175,19 @@ public class OrderDetailActivity extends BaseMVPCompatActivity<OrderDetailContra | ||
172 | switch (object.payState){ | 175 | switch (object.payState){ |
173 | case 0://待支付 | 176 | case 0://待支付 |
174 | tvPayState.setText("待支付"); | 177 | tvPayState.setText("待支付"); |
178 | + ivState.setBackgroundColor(getResources().getColor(R.color.md_red_500)); | ||
175 | break; | 179 | break; |
176 | case 1://支付成功 | 180 | case 1://支付成功 |
177 | tvPayState.setText("支付成功"); | 181 | tvPayState.setText("支付成功"); |
182 | + ivState.setImageDrawable(getResources().getDrawable(R.drawable.success)); | ||
178 | break; | 183 | break; |
179 | case 2://交易关闭 | 184 | case 2://交易关闭 |
180 | tvPayState.setText("交易关闭"); | 185 | tvPayState.setText("交易关闭"); |
186 | + ivState.setBackgroundColor(getResources().getColor(R.color.gray)); | ||
181 | break; | 187 | break; |
182 | case 3: | 188 | case 3: |
183 | tvPayState.setText("支付失败"); | 189 | tvPayState.setText("支付失败"); |
190 | + ivState.setImageDrawable(getResources().getDrawable(R.drawable.close)); | ||
184 | break; | 191 | break; |
185 | } | 192 | } |
186 | 193 |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java
@@ -5,6 +5,7 @@ import android.support.annotation.NonNull; | @@ -5,6 +5,7 @@ import android.support.annotation.NonNull; | ||
5 | import android.support.annotation.Nullable; | 5 | import android.support.annotation.Nullable; |
6 | import android.support.v4.view.ViewPager; | 6 | import android.support.v4.view.ViewPager; |
7 | import android.text.TextUtils; | 7 | import android.text.TextUtils; |
8 | +import android.util.Log; | ||
8 | import android.view.View; | 9 | import android.view.View; |
9 | import android.widget.ImageView; | 10 | import android.widget.ImageView; |
10 | import android.widget.TextView; | 11 | import android.widget.TextView; |
@@ -87,42 +88,29 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | @@ -87,42 +88,29 @@ public class StartFragment extends BaseMVPCompatFragment<ConsultContract.Consult | ||
87 | } | 88 | } |
88 | 89 | ||
89 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { | 90 | private void initBannes(List<GuangGaoBean> guangGaoBeanList) { |
91 | + try { | ||
90 | final List<String> imgUrl = new ArrayList<>(); | 92 | final List<String> imgUrl = new ArrayList<>(); |
91 | List<String> describeList = new ArrayList<>(); | 93 | List<String> describeList = new ArrayList<>(); |
92 | for (int i = 0; i < guangGaoBeanList.size(); i++) { | 94 | for (int i = 0; i < guangGaoBeanList.size(); i++) { |
93 | - imgUrl.add(guangGaoBeanList.get(i).fileSrc); | 95 | + imgUrl.add(AppConfig.BASE_URL_FILE+guangGaoBeanList.get(i).fileSrc); |
94 | describeList.add(guangGaoBeanList.get(i).describe); | 96 | describeList.add(guangGaoBeanList.get(i).describe); |
95 | } | 97 | } |
96 | xBanner.setData(imgUrl, describeList); | 98 | xBanner.setData(imgUrl, describeList); |
97 | - xBanner.setmAutoPlayAble(false); | ||
98 | - xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); | ||
99 | - | 99 | + xBanner.stopAutoPlay(); |
100 | + xBanner.setmAutoPalyTime(10000); | ||
101 | +// xBanner.setSlideScrollMode(View.OVER_SCROLL_NEVER); | ||
102 | + Log.d("66666","imgUrl="+imgUrl.toString()+"describeList="+describeList.toString()); | ||
100 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { | 103 | xBanner.setmAdapter(new XBanner.XBannerAdapter() { |
101 | @Override | 104 | @Override |
102 | public void loadBanner(XBanner banner, Object model, View view, int position) { | 105 | public void loadBanner(XBanner banner, Object model, View view, int position) { |
103 | - Glide.with(getActivity()).load(AppConfig.BASE_URL_FILE+imgUrl.get(position)).placeholder(R.drawable.ic_launcher_background) | 106 | + Glide.with(getActivity()).load(imgUrl.get(position)).placeholder(R.drawable.ic_launcher_background) |
104 | .into((ImageView) view); | 107 | .into((ImageView) view); |
105 | } | 108 | } |
106 | }); | 109 | }); |
107 | 110 | ||
108 | - xBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { | ||
109 | - @Override | ||
110 | - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { | ||
111 | - if (position == imgUrl.size() - 1) { | ||
112 | - startNewActivity(MainActivity.class); | ||
113 | - } | ||
114 | - } | ||
115 | - | ||
116 | - @Override | ||
117 | - public void onPageSelected(int position) { | ||
118 | - | ||
119 | - } | ||
120 | - | ||
121 | - @Override | ||
122 | - public void onPageScrollStateChanged(int state) { | ||
123 | - | ||
124 | - } | ||
125 | - }); | ||
126 | 111 | ||
112 | + }catch (Exception e){ | ||
113 | + e.printStackTrace(); | ||
114 | + } | ||
127 | } | 115 | } |
128 | } | 116 | } |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultOneLevelFragment.java
@@ -140,7 +140,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -140,7 +140,7 @@ public class ConsultOneLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
140 | @Override | 140 | @Override |
141 | public void onClick(View view) { | 141 | public void onClick(View view) { |
142 | ChannelBean channelBean = (ChannelBean) view.getTag(); | 142 | ChannelBean channelBean = (ChannelBean) view.getTag(); |
143 | - ConsultTwoLevelActivity.getInstance(getActivity(), channelBean.getId() + ""); | 143 | + ConsultTwoLevelActivity.getInstance(getActivity(), channelBean.getId() + "",channelBean.getChannelName()); |
144 | } | 144 | } |
145 | }); | 145 | }); |
146 | layout_control.addView(textAndImgShowView); | 146 | layout_control.addView(textAndImgShowView); |
app/src/main/java/com/shunzhi/parent/ui/fragment/consult/ConsultTwoLevelFragment.java
@@ -36,7 +36,7 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -36,7 +36,7 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
36 | MyConsultAdapter myConsultAdapter = null; | 36 | MyConsultAdapter myConsultAdapter = null; |
37 | 37 | ||
38 | 38 | ||
39 | - String channel=""; | 39 | + String channel="",titleName; |
40 | @Override | 40 | @Override |
41 | public int getLayoutId() { | 41 | public int getLayoutId() { |
42 | return R.layout.fragment_consult_two_level; | 42 | return R.layout.fragment_consult_two_level; |
@@ -45,10 +45,9 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | @@ -45,10 +45,9 @@ public class ConsultTwoLevelFragment extends BaseMVPCompatFragment<ConsultOneCon | ||
45 | @Override | 45 | @Override |
46 | public void initUI(View view, @Nullable Bundle savedInstanceState) { | 46 | public void initUI(View view, @Nullable Bundle savedInstanceState) { |
47 | tvContentName = view.findViewById(R.id.tvContentName); | 47 | tvContentName = view.findViewById(R.id.tvContentName); |
48 | - tvContentName.setText(""); | ||
49 | - | ||
50 | - recyclerView = view.findViewById(R.id.recyclerView); | 48 | + tvContentName.setText(getArguments().getString("titleName")); |
51 | channel=getArguments().getString("channel"); | 49 | channel=getArguments().getString("channel"); |
50 | + recyclerView = view.findViewById(R.id.recyclerView); | ||
52 | 51 | ||
53 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel),0,1); | 52 | mPresenter.getConsultContent(AppContext.getInstance().district, Integer.parseInt(channel),0,1); |
54 | } | 53 | } |
app/src/main/res/layout/item_order_list.xml
@@ -45,20 +45,35 @@ | @@ -45,20 +45,35 @@ | ||
45 | android:background="@drawable/shape_radius8_whit" | 45 | android:background="@drawable/shape_radius8_whit" |
46 | android:layout_width="match_parent" | 46 | android:layout_width="match_parent" |
47 | android:layout_height="wrap_content"> | 47 | android:layout_height="wrap_content"> |
48 | + <LinearLayout | ||
49 | + android:paddingBottom="@dimen/size_dp_5" | ||
50 | + android:paddingTop="@dimen/size_dp_5" | ||
51 | + android:layout_gravity="center" | ||
52 | + android:gravity="center" | ||
53 | + android:layout_width="wrap_content" | ||
54 | + android:layout_height="wrap_content"> | ||
55 | + | ||
56 | + | ||
57 | + <ImageView | ||
58 | + android:id="@+id/ivState" | ||
59 | + android:layout_width="@dimen/size_dp_20" | ||
60 | + android:layout_height="@dimen/size_dp_20" | ||
61 | + android:src="@drawable/success" | ||
62 | + android:layout_marginRight="@dimen/size_dp_5" | ||
63 | + /> | ||
64 | + | ||
65 | + <TextView | ||
66 | + android:id="@+id/tvPayState" | ||
67 | + android:layout_gravity="center" | ||
68 | + android:drawablePadding="@dimen/size_dp_5" | ||
69 | + android:layout_width="wrap_content" | ||
70 | + android:layout_height="wrap_content" | ||
71 | + android:text="订购成功" | ||
72 | + android:textColor="@color/xueqing_blue" | ||
73 | + android:textSize="@dimen/textSize16" | ||
74 | + android:gravity="center" | ||
75 | + /> | ||
76 | + </LinearLayout> | ||
48 | 77 | ||
49 | - <TextView | ||
50 | - android:id="@+id/tvPayState" | ||
51 | - android:layout_gravity="center" | ||
52 | - android:drawablePadding="@dimen/size_dp_5" | ||
53 | - android:layout_width="wrap_content" | ||
54 | - android:layout_height="wrap_content" | ||
55 | - android:text="订购成功" | ||
56 | - android:textColor="@color/xueqing_blue" | ||
57 | - android:textSize="@dimen/textSize16" | ||
58 | - android:gravity="center" | ||
59 | - android:paddingBottom="@dimen/size_dp_5" | ||
60 | - android:paddingTop="@dimen/size_dp_5" | ||
61 | - android:drawableLeft="@drawable/order_success" | ||
62 | - /> | ||
63 | </FrameLayout> | 78 | </FrameLayout> |
64 | </LinearLayout> | 79 | </LinearLayout> |
65 | \ No newline at end of file | 80 | \ No newline at end of file |