diff --git a/common/src/main/java/com/yunbao/common/bean/CoolConfig.java b/common/src/main/java/com/yunbao/common/bean/CoolConfig.java index e0b7552a5..b00bce6f8 100644 --- a/common/src/main/java/com/yunbao/common/bean/CoolConfig.java +++ b/common/src/main/java/com/yunbao/common/bean/CoolConfig.java @@ -2,6 +2,16 @@ package com.yunbao.common.bean; public class CoolConfig extends BaseModel { private int rate; + private String ticketCount ; + + public String getTicketCount() { + return ticketCount; + } + + public CoolConfig setTicketCount(String ticketCount) { + this.ticketCount = ticketCount; + return this; + } public int getRate() { return rate; diff --git a/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java index 41ac75ff8..d44442c19 100644 --- a/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/CinemaTicketPopupWindow.java @@ -41,7 +41,7 @@ public class CinemaTicketPopupWindow extends CenterPopupView { cinemaTicket = findViewById(R.id.cinema_ticket); ticketsPlusMinus = findViewById(R.id.tickets_plus_minus); quantityNeed = findViewById(R.id.quantity_need); - cinemaTicket.setText(String.valueOf(ticket)); + cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString()); ticketsPlusMinus.setText(String.valueOf(ticket)); quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString()); ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_close), new ViewClicksAntiShake.ViewClicksCallBack() { @@ -55,7 +55,8 @@ public class CinemaTicketPopupWindow extends CenterPopupView { public void onClick(View view) { if (ticket > 1) { ticket = ticket - 1; - cinemaTicket.setText(String.valueOf(ticket)); + + cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString()); ticketsPlusMinus.setText(String.valueOf(ticket)); quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString()); } @@ -65,7 +66,7 @@ public class CinemaTicketPopupWindow extends CenterPopupView { @Override public void onClick(View view) { ticket = ticket + 1; - cinemaTicket.setText(String.valueOf(ticket)); + cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString()); ticketsPlusMinus.setText(String.valueOf(ticket)); quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString()); } diff --git a/common/src/main/java/com/yunbao/common/event/JavascriptInterfaceEvent.java b/common/src/main/java/com/yunbao/common/event/JavascriptInterfaceEvent.java index 474e127e4..8b1beba89 100644 --- a/common/src/main/java/com/yunbao/common/event/JavascriptInterfaceEvent.java +++ b/common/src/main/java/com/yunbao/common/event/JavascriptInterfaceEvent.java @@ -1,6 +1,7 @@ package com.yunbao.common.event; import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.CoolConfig; import com.yunbao.common.bean.VideoBean; import java.util.ArrayList; @@ -23,6 +24,16 @@ public class JavascriptInterfaceEvent extends BaseModel { private String data; private String name; private String image; + private CoolConfig coolConfig; + + public CoolConfig getCoolConfig() { + return coolConfig; + } + + public JavascriptInterfaceEvent setCoolConfig(CoolConfig coolConfig) { + this.coolConfig = coolConfig; + return this; + } public String getName() { return name; diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfacePlayLetUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfacePlayLetUtils.java index 1f7bfb453..fed640833 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfacePlayLetUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfacePlayLetUtils.java @@ -3,9 +3,10 @@ package com.yunbao.common.utils; import android.app.Activity; import android.util.Log; import android.webkit.JavascriptInterface; -import android.webkit.ValueCallback; import android.webkit.WebView; +import com.momo.mcamera.util.JsonUtil; +import com.yunbao.common.bean.CoolConfig; import com.yunbao.common.event.JavascriptInterfaceEvent; public class JavascriptInterfacePlayLetUtils { @@ -42,9 +43,10 @@ public class JavascriptInterfacePlayLetUtils { @JavascriptInterface public void postWeakBalance(String data) { - + CoolConfig coolConfig = new JsonUtil().fromJson(data, CoolConfig.class); Log.e("TAG", "postWeakBalance data==" + data); Bus.get().post(new JavascriptInterfaceEvent() + .setCoolConfig(coolConfig) .setMethod("postWeakBalance")); diff --git a/config.gradle b/config.gradle index 8bd78b4b7..a841a0df1 100644 --- a/config.gradle +++ b/config.gradle @@ -22,10 +22,10 @@ ext { baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false - isGooglePlay : true, + isGooglePlay : false, //是否上报异常日志 isUploadLog : true, //是否打包成插件包模式 - isPluginModel : false, + isPluginModel : true, ] } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index d0cb74102..2cf564480 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -223,26 +223,26 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); } mWebView.loadUrl(url); - findViewById(R.id.native_callback).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - mWebView.post(new Runnable() { - @Override - public void run() { - - NativeCallbackModel model = new NativeCallbackModel(); - model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId())); - String nativeJson = new JsonUtil().toJson(model); - mWebView.evaluateJavascript("javascript:nativeCallback('" +nativeJson + "')", new ValueCallback() { - @Override - public void onReceiveValue(String value) { - } - }); - - } - }); - } - }); +// findViewById(R.id.native_callback).setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View view) { +// mWebView.post(new Runnable() { +// @Override +// public void run() { +// +// NativeCallbackModel model = new NativeCallbackModel(); +// model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId())); +// String nativeJson = new JsonUtil().toJson(model); +// mWebView.evaluateJavascript("javascript:nativeCallback('" +nativeJson + "')", new ValueCallback() { +// @Override +// public void onReceiveValue(String value) { +// } +// }); +// +// } +// }); +// } +// }); } public void loadNewUrl() { @@ -397,7 +397,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl new XPopup.Builder(mContext) .enableDrag(false) .maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34)) - .asCustom(new CinemaTicketPopupWindow(mContext, data, new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() { + .asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() { @Override public void onCallBack() { mWebView.post(new Runnable() { diff --git a/main/src/main/res/layout/view_main_encourage.xml b/main/src/main/res/layout/view_main_encourage.xml index aeda3309b..d796f713a 100644 --- a/main/src/main/res/layout/view_main_encourage.xml +++ b/main/src/main/res/layout/view_main_encourage.xml @@ -18,11 +18,11 @@ android:layout_height="3dp" android:progressDrawable="@drawable/bg_horizontal_progressbar" /> -