|
|
@@ -82,6 +82,7 @@ import org.greenrobot.eventbus.Subscribe;
|
|
|
|
|
|
import java.net.URI;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Locale;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
@@ -224,17 +225,22 @@ public class KFZSJs {
|
|
|
|
|
|
@JavascriptInterface
|
|
|
public String getSheepAds(int type) {
|
|
|
- return JSONObject.toJSONString(DDProviderHelper.getInstance().listSheepAd(type));
|
|
|
+ List<SheepAd> ads = DDProviderHelper.getInstance().listSheepAd(type);
|
|
|
+ if (ads != null) {
|
|
|
+ return JSONObject.toJSONString(ads);
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@JavascriptInterface
|
|
|
- public void clickSheepAd(String json){
|
|
|
+ public void clickSheepAd(String json) {
|
|
|
SheepAd ad = JSONObject.parseObject(json, SheepAd.class);
|
|
|
AdHelper.goAdLink(activity, ad);
|
|
|
}
|
|
|
|
|
|
@JavascriptInterface
|
|
|
- public void statSheepAd(String ids){
|
|
|
+ public void statSheepAd(String ids) {
|
|
|
AdHelper.stat(ids, 1);
|
|
|
}
|
|
|
|
|
|
@@ -310,7 +316,7 @@ public class KFZSJs {
|
|
|
}
|
|
|
|
|
|
@JavascriptInterface
|
|
|
- public void shareWebAsImage(String url){
|
|
|
+ public void shareWebAsImage(String url) {
|
|
|
Intent in = new Intent(activity, ActWebShareImage.class);
|
|
|
in.putExtra("web_url", url);
|
|
|
activity.startActivity(in);
|
|
|
@@ -478,7 +484,7 @@ public class KFZSJs {
|
|
|
}
|
|
|
|
|
|
@JavascriptInterface
|
|
|
- public void onPayCompleted(String orderNo, int status){
|
|
|
+ public void onPayCompleted(String orderNo, int status) {
|
|
|
Intent intent = new Intent();
|
|
|
intent.putExtra("orderno", orderNo);
|
|
|
intent.putExtra("status", status);
|
|
|
@@ -497,7 +503,7 @@ public class KFZSJs {
|
|
|
}
|
|
|
|
|
|
@JavascriptInterface
|
|
|
- public void buyVip(){
|
|
|
+ public void buyVip() {
|
|
|
Jump2View.getInstance().gotoVip(activity);
|
|
|
}
|
|
|
|