Commit 1c1190fa4bed554dad8c67e0da763c330dedda14
1 parent
03248c7f
Exists in
yxb_dev
and in
1 other branch
no message
Showing
6 changed files
with
34 additions
and
11 deletions
Show diff stats
app/libs/processor.jar
No preview for this file type
app/src/main/java/com/shunzhi/parent/contract/consult/ConsultContract.java
app/src/main/java/com/shunzhi/parent/presenter/consult/ConsultPresenter.java
... | ... | @@ -137,14 +137,14 @@ public class ConsultPresenter extends ConsultContract.ConsultPresenter { |
137 | 137 | mRxManager.register(mIModel.loginVote(phoneNum, password).subscribe(new Consumer<String>() { |
138 | 138 | @Override |
139 | 139 | public void accept(String str) throws Exception { |
140 | - Log.e("111111",str.toString()); | |
141 | - mIView.showVote(position); | |
140 | + Log.e("111111",str); | |
141 | + mIView.showVote(position,str); | |
142 | 142 | } |
143 | 143 | }, new Consumer<Throwable>() { |
144 | 144 | @Override |
145 | 145 | public void accept(Throwable throwable) throws Exception { |
146 | 146 | Log.e("111111",throwable.getMessage()); |
147 | - mIView.showVote(position); | |
147 | + mIView.showVote(position,""); | |
148 | 148 | } |
149 | 149 | })); |
150 | 150 | } | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/activity/mywebview/WebViewActivity.java
... | ... | @@ -4,6 +4,7 @@ import android.content.Context; |
4 | 4 | import android.content.Intent; |
5 | 5 | import android.graphics.Bitmap; |
6 | 6 | import android.os.Bundle; |
7 | +import android.text.TextUtils; | |
7 | 8 | import android.view.View; |
8 | 9 | import android.webkit.JavascriptInterface; |
9 | 10 | import android.webkit.WebChromeClient; |
... | ... | @@ -27,12 +28,21 @@ public class WebViewActivity extends BaseCompatActivity { |
27 | 28 | |
28 | 29 | NestedScrollWebView nesteScrollWebView; |
29 | 30 | LinearLayout binding_success, binding_success2; |
30 | - ImageView close_btn,close_btn_right; | |
31 | + ImageView close_btn, close_btn_right; | |
31 | 32 | TextView tv_info, zuoye, title_web; |
32 | 33 | |
33 | 34 | int type; |
34 | 35 | |
35 | 36 | private ProgressBar pvWeb; |
37 | + private String token, url; | |
38 | + | |
39 | + public static void getInstance(Context context, String url, int type, String token) { | |
40 | + Intent intent = new Intent(context, WebViewActivity.class); | |
41 | + intent.putExtra("url", url); | |
42 | + intent.putExtra("type", type); | |
43 | + intent.putExtra("token", token); | |
44 | + context.startActivity(intent); | |
45 | + } | |
36 | 46 | |
37 | 47 | public static void getInstance(Context context, String url, int type) { |
38 | 48 | Intent intent = new Intent(context, WebViewActivity.class); |
... | ... | @@ -66,9 +76,9 @@ public class WebViewActivity extends BaseCompatActivity { |
66 | 76 | close_btn_right.setOnClickListener(new View.OnClickListener() { |
67 | 77 | @Override |
68 | 78 | public void onClick(View v) { |
69 | - if(type!=-1&&type!= AppConfig.ORDER_CENTER) { | |
79 | + if (type != -1 && type != AppConfig.ORDER_CENTER) { | |
70 | 80 | startActivity(new Intent().setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP).setClass(WebViewActivity.this, MainActivity.class)); |
71 | - }else{ | |
81 | + } else { | |
72 | 82 | finish(); |
73 | 83 | } |
74 | 84 | } |
... | ... | @@ -85,6 +95,13 @@ public class WebViewActivity extends BaseCompatActivity { |
85 | 95 | |
86 | 96 | pvWeb = findViewById(R.id.pb_web); |
87 | 97 | type = getIntent().getIntExtra("type", 0); |
98 | + token = getIntent().getStringExtra("token"); | |
99 | + url = getIntent().getStringExtra("url"); | |
100 | + if (token != null && !"".equals(token) &&! TextUtils.isEmpty(token)) { | |
101 | + url = url + "&Token=" + token; | |
102 | + } | |
103 | + | |
104 | + | |
88 | 105 | if (type == AppConfig.BINDING_SUCCESS_HEZUO) { |
89 | 106 | binding_success.setVisibility(View.VISIBLE); |
90 | 107 | binding_success2.setVisibility(View.GONE); |
... | ... | @@ -117,7 +134,7 @@ public class WebViewActivity extends BaseCompatActivity { |
117 | 134 | |
118 | 135 | initWebView(); |
119 | 136 | initWebSetting(nesteScrollWebView.getSettings()); |
120 | - nesteScrollWebView.loadUrl(getIntent().getStringExtra("url")); | |
137 | + nesteScrollWebView.loadUrl(url); | |
121 | 138 | } |
122 | 139 | |
123 | 140 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/ConsultFragment.java
... | ... | @@ -230,8 +230,13 @@ public class ConsultFragment extends BaseMVPCompatFragment<ConsultContract.Consu |
230 | 230 | } |
231 | 231 | |
232 | 232 | @Override |
233 | - public void showVote(int position) { | |
234 | - WebViewActivity.getInstance(getContext(), imgWebUrl.get(position), -1); | |
233 | + public void showVote(int position,String token) { | |
234 | + Log.e("000000",imgWebUrl.get(position).toString()); | |
235 | + if(imgWebUrl.get(position).startsWith(AppConfig.BASE_URL_VOTE)) { | |
236 | + WebViewActivity.getInstance(getContext(), imgWebUrl.get(position), -1, token); | |
237 | + }else{ | |
238 | + WebViewActivity.getInstance(getContext(), imgWebUrl.get(position), -1); | |
239 | + } | |
235 | 240 | } |
236 | 241 | |
237 | 242 | @Override | ... | ... |
app/src/main/java/com/shunzhi/parent/ui/fragment/StartFragment.java