修改 测试问题
This commit is contained in:
parent
b4b1efe730
commit
05e7c4ffdd
@ -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;
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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"));
|
||||
|
||||
|
||||
|
@ -22,10 +22,10 @@ ext {
|
||||
|
||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||
// true表示谷歌支付 false
|
||||
isGooglePlay : true,
|
||||
isGooglePlay : false,
|
||||
//是否上报异常日志
|
||||
isUploadLog : true,
|
||||
//是否打包成插件包模式
|
||||
isPluginModel : false,
|
||||
isPluginModel : true,
|
||||
]
|
||||
}
|
||||
|
@ -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<String>() {
|
||||
@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<String>() {
|
||||
// @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() {
|
||||
|
@ -18,11 +18,11 @@
|
||||
android:layout_height="3dp"
|
||||
android:progressDrawable="@drawable/bg_horizontal_progressbar" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/native_callback"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/native_callback"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
|
||||
android:text="nativeCallback" />
|
||||
<!-- android:text="nativeCallback" />-->
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user