修改 测试问题
This commit is contained in:
parent
b4b1efe730
commit
05e7c4ffdd
@ -2,6 +2,16 @@ package com.yunbao.common.bean;
|
|||||||
|
|
||||||
public class CoolConfig extends BaseModel {
|
public class CoolConfig extends BaseModel {
|
||||||
private int rate;
|
private int rate;
|
||||||
|
private String ticketCount ;
|
||||||
|
|
||||||
|
public String getTicketCount() {
|
||||||
|
return ticketCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CoolConfig setTicketCount(String ticketCount) {
|
||||||
|
this.ticketCount = ticketCount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public int getRate() {
|
public int getRate() {
|
||||||
return rate;
|
return rate;
|
||||||
|
@ -41,7 +41,7 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
|
|||||||
cinemaTicket = findViewById(R.id.cinema_ticket);
|
cinemaTicket = findViewById(R.id.cinema_ticket);
|
||||||
ticketsPlusMinus = findViewById(R.id.tickets_plus_minus);
|
ticketsPlusMinus = findViewById(R.id.tickets_plus_minus);
|
||||||
quantityNeed = findViewById(R.id.quantity_need);
|
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));
|
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
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) {
|
public void onClick(View view) {
|
||||||
if (ticket > 1) {
|
if (ticket > 1) {
|
||||||
ticket = 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));
|
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||||
}
|
}
|
||||||
@ -65,7 +66,7 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
ticket = 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));
|
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.yunbao.common.event;
|
package com.yunbao.common.event;
|
||||||
|
|
||||||
import com.yunbao.common.bean.BaseModel;
|
import com.yunbao.common.bean.BaseModel;
|
||||||
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
import com.yunbao.common.bean.VideoBean;
|
import com.yunbao.common.bean.VideoBean;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -23,6 +24,16 @@ public class JavascriptInterfaceEvent extends BaseModel {
|
|||||||
private String data;
|
private String data;
|
||||||
private String name;
|
private String name;
|
||||||
private String image;
|
private String image;
|
||||||
|
private CoolConfig coolConfig;
|
||||||
|
|
||||||
|
public CoolConfig getCoolConfig() {
|
||||||
|
return coolConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JavascriptInterfaceEvent setCoolConfig(CoolConfig coolConfig) {
|
||||||
|
this.coolConfig = coolConfig;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
|
@ -3,9 +3,10 @@ package com.yunbao.common.utils;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.webkit.JavascriptInterface;
|
import android.webkit.JavascriptInterface;
|
||||||
import android.webkit.ValueCallback;
|
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
|
||||||
|
import com.momo.mcamera.util.JsonUtil;
|
||||||
|
import com.yunbao.common.bean.CoolConfig;
|
||||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||||
|
|
||||||
public class JavascriptInterfacePlayLetUtils {
|
public class JavascriptInterfacePlayLetUtils {
|
||||||
@ -42,9 +43,10 @@ public class JavascriptInterfacePlayLetUtils {
|
|||||||
|
|
||||||
@JavascriptInterface
|
@JavascriptInterface
|
||||||
public void postWeakBalance(String data) {
|
public void postWeakBalance(String data) {
|
||||||
|
CoolConfig coolConfig = new JsonUtil().fromJson(data, CoolConfig.class);
|
||||||
Log.e("TAG", "postWeakBalance data==" + data);
|
Log.e("TAG", "postWeakBalance data==" + data);
|
||||||
Bus.get().post(new JavascriptInterfaceEvent()
|
Bus.get().post(new JavascriptInterfaceEvent()
|
||||||
|
.setCoolConfig(coolConfig)
|
||||||
.setMethod("postWeakBalance"));
|
.setMethod("postWeakBalance"));
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,10 +22,10 @@ ext {
|
|||||||
|
|
||||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||||
// true表示谷歌支付 false
|
// true表示谷歌支付 false
|
||||||
isGooglePlay : true,
|
isGooglePlay : false,
|
||||||
//是否上报异常日志
|
//是否上报异常日志
|
||||||
isUploadLog : true,
|
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.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
}
|
}
|
||||||
mWebView.loadUrl(url);
|
mWebView.loadUrl(url);
|
||||||
findViewById(R.id.native_callback).setOnClickListener(new View.OnClickListener() {
|
// findViewById(R.id.native_callback).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onClick(View view) {
|
// public void onClick(View view) {
|
||||||
mWebView.post(new Runnable() {
|
// mWebView.post(new Runnable() {
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
|
//
|
||||||
NativeCallbackModel model = new NativeCallbackModel();
|
// NativeCallbackModel model = new NativeCallbackModel();
|
||||||
model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
|
// model.setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
|
||||||
String nativeJson = new JsonUtil().toJson(model);
|
// String nativeJson = new JsonUtil().toJson(model);
|
||||||
mWebView.evaluateJavascript("javascript:nativeCallback('" +nativeJson + "')", new ValueCallback<String>() {
|
// mWebView.evaluateJavascript("javascript:nativeCallback('" +nativeJson + "')", new ValueCallback<String>() {
|
||||||
@Override
|
// @Override
|
||||||
public void onReceiveValue(String value) {
|
// public void onReceiveValue(String value) {
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadNewUrl() {
|
public void loadNewUrl() {
|
||||||
@ -397,7 +397,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
|||||||
new XPopup.Builder(mContext)
|
new XPopup.Builder(mContext)
|
||||||
.enableDrag(false)
|
.enableDrag(false)
|
||||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
|
.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
|
@Override
|
||||||
public void onCallBack() {
|
public void onCallBack() {
|
||||||
mWebView.post(new Runnable() {
|
mWebView.post(new Runnable() {
|
||||||
|
@ -18,11 +18,11 @@
|
|||||||
android:layout_height="3dp"
|
android:layout_height="3dp"
|
||||||
android:progressDrawable="@drawable/bg_horizontal_progressbar" />
|
android:progressDrawable="@drawable/bg_horizontal_progressbar" />
|
||||||
|
|
||||||
<Button
|
<!-- <Button-->
|
||||||
android:id="@+id/native_callback"
|
<!-- android:id="@+id/native_callback"-->
|
||||||
android:layout_width="wrap_content"
|
<!-- android:layout_width="wrap_content"-->
|
||||||
android:layout_height="wrap_content"
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
|
||||||
android:text="nativeCallback" />
|
<!-- android:text="nativeCallback" />-->
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user