Commit 6e80e712 authored by jianglx's avatar jianglx

添加会员使用代金券;修改QQ海报分享不了的问题

parent e4582669
...@@ -4,6 +4,7 @@ package com.frame.base.url; ...@@ -4,6 +4,7 @@ package com.frame.base.url;
* ARouter上面的注解需要我们写路径标识 * ARouter上面的注解需要我们写路径标识
*/ */
public final class Constance { public final class Constance {
public static final String ACTIVITY_URL_ORDERLIST ="/order/OrderListActivity"; public static final String ACTIVITY_URL_ORDERLIST ="/order/OrderListActivity";
public static final String ACTIVITY_URL_CHOOSEAVISITOR ="/traveler/ChooseAVisitorActivity"; public static final String ACTIVITY_URL_CHOOSEAVISITOR ="/traveler/ChooseAVisitorActivity";
......
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
flavorDimensions "default" flavorDimensions "default"
versionCode 151 versionCode 152
versionName "1.5.1" versionName "1.5.2"
multiDexEnabled true multiDexEnabled true
......
...@@ -40,5 +40,5 @@ dependencies { ...@@ -40,5 +40,5 @@ dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
api project(':RvWrapper') api project(':RvWrapper')
api project(':component_resource') api project(':component_resource')
implementation project(':component_control')
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:orientation="vertical" android:layout_height="wrap_content"
android:background="@color/colorWrite" android:background="@color/colorWrite"
android:layout_height="wrap_content"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:paddingRight="@dimen/size_15"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_60"> android:layout_height="@dimen/size_60"
android:paddingRight="@dimen/size_15">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:textSize="@dimen/text_16" android:text="请选择支付方式"
android:textColor="@color/textMain" android:textColor="@color/textMain"
android:text="请选择支付方式"/> android:textSize="@dimen/text_16" />
<ImageView <ImageView
android:id="@+id/iv_close" android:id="@+id/iv_close"
android:layout_width="@dimen/size_30" android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_30" android:layout_height="@dimen/size_30"
android:padding="@dimen/size_5"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@drawable/common_btn_close"/> android:padding="@dimen/size_5"
android:src="@drawable/common_btn_close" />
</RelativeLayout> </RelativeLayout>
<include layout="@layout/common_line"/> <include layout="@layout/common_line" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -38,41 +40,41 @@ ...@@ -38,41 +40,41 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/text_16" android:text="实付金额:"
android:textColor="@color/textMain" android:textColor="@color/textMain"
android:text="实付金额:"/> android:textSize="@dimen/text_16" />
<TextView <TextView
android:id="@+id/tv_amount" android:id="@+id/tv_amount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/text_16" android:text="¥0"
android:textColor="@color/colorAuxiliaryRed" android:textColor="@color/colorAuxiliaryRed"
android:text="¥0"/> android:textSize="@dimen/text_16" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_item_wechat" android:id="@+id/ll_item_wechat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_70" android:layout_height="@dimen/size_70"
android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/size_15" android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15" android:paddingRight="@dimen/size_15">
android:gravity="center_vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/text_16"
android:textColor="@color/textMain"
android:drawablePadding="@dimen/size_8"
android:drawableLeft="@drawable/common_icon_wechat_pay" android:drawableLeft="@drawable/common_icon_wechat_pay"
android:text="微信支付"/> android:drawablePadding="@dimen/size_8"
android:text="微信支付"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<View <View
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"/> android:layout_weight="1" />
<ImageView <ImageView
android:id="@+id/iv_wx_select" android:id="@+id/iv_wx_select"
...@@ -84,32 +86,33 @@ ...@@ -84,32 +86,33 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_half"
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15" android:layout_marginRight="@dimen/size_15"
android:layout_height="@dimen/size_half" android:background="@color/colorLine" />
android:background="@color/colorLine"/>
<LinearLayout <LinearLayout
android:id="@+id/ll_item_alipay" android:id="@+id/ll_item_alipay"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_70" android:layout_height="@dimen/size_70"
android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/size_15" android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15" android:paddingRight="@dimen/size_15">
android:gravity="center_vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/text_16"
android:textColor="@color/textMain"
android:drawablePadding="@dimen/size_8"
android:drawableLeft="@drawable/common_icon_alipay" android:drawableLeft="@drawable/common_icon_alipay"
android:text="支付宝支付"/> android:drawablePadding="@dimen/size_8"
android:text="支付宝支付"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<View <View
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1"/> android:layout_weight="1" />
<ImageView <ImageView
android:id="@+id/iv_alipy_select" android:id="@+id/iv_alipy_select"
...@@ -120,24 +123,61 @@ ...@@ -120,24 +123,61 @@
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_half"
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15" android:layout_marginRight="@dimen/size_15"
android:background="@color/colorLine" />
<LinearLayout
android:id="@+id/ll_item_coupon"
android:layout_width="match_parent"
android:layout_height="@dimen/size_70"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:visibility="gone">
<TextView
android:id="@+id/tv_coupon_number"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawablePadding="@dimen/size_8"
android:textColor="@color/textMain"
android:textSize="@dimen/text_16" />
<com.rv.component.control.SwitchButton
android:id="@+id/sb_coupon_select"
android:layout_width="@dimen/size_45"
android:layout_height="@dimen/size_28"
app:sb_button_color="@color/colorWrite"
app:sb_checked_color="@color/gray_FFB74B"
app:sb_show_indicator="false"
app:sb_uncheckcircle_color="@color/textLightGrey" />
</LinearLayout>
<View
android:id="@+id/line_coupon"
android:layout_width="match_parent"
android:layout_height="@dimen/size_half" android:layout_height="@dimen/size_half"
android:background="@color/colorLine"/> android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:background="@color/colorLine"
android:visibility="gone" />
<TextView <TextView
android:id="@+id/tv_pay_immediately" android:id="@+id/tv_pay_immediately"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:text="立即支付"
android:gravity="center"
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/size_15" android:layout_marginRight="@dimen/size_15"
android:layout_marginBottom="@dimen/size_15" android:layout_marginBottom="@dimen/size_15"
android:layout_marginTop="@dimen/size_20"
android:background="@drawable/shape_rv_bg_yellow" android:background="@drawable/shape_rv_bg_yellow"
android:gravity="center"
android:text="立即支付"
android:textColor="@color/colorWrite" android:textColor="@color/colorWrite"
android:textSize="@dimen/text_16" android:textSize="@dimen/text_16" />
/>
</LinearLayout> </LinearLayout>
\ No newline at end of file
This diff is collapsed.
package com.xxrv.coupon.adapter; package com.xxrv.coupon.adapter;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter; import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
...@@ -46,7 +48,9 @@ public class CarCouponAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity, ...@@ -46,7 +48,9 @@ public class CarCouponAdapter extends BaseMultiItemQuickAdapter<MultiItemEntity,
CarCouponBean.DataBean.CarCouponTypeDataBean.CarCouponDataBean item = (CarCouponBean.DataBean.CarCouponTypeDataBean.CarCouponDataBean) bean; CarCouponBean.DataBean.CarCouponTypeDataBean.CarCouponDataBean item = (CarCouponBean.DataBean.CarCouponTypeDataBean.CarCouponDataBean) bean;
helper.setText(R.id.tv_name,item.getTitle()); helper.setText(R.id.tv_name,item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle()); helper.setText(R.id.tv_type,item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime())); if (!TextUtils.isEmpty(item.getExpireDate()))
helper.setText(R.id.tv_date, item.getExpireDate());
// helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime()));
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount())); helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount()));
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券 if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券
helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元"); helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元");
......
package com.xxrv.coupon.adapter; package com.xxrv.coupon.adapter;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.component.utils.DateUtils; import com.rv.component.utils.DateUtils;
...@@ -18,15 +20,17 @@ public class ExpiredCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, ...@@ -18,15 +20,17 @@ public class ExpiredCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean,
@Override @Override
protected void convert(BaseViewHolder helper, CouponBean.DataBean item) { protected void convert(BaseViewHolder helper, CouponBean.DataBean item) {
if (item !=null){ if (item != null) {
helper.setText(R.id.tv_name,item.getTitle()); helper.setText(R.id.tv_name, item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle()); helper.setText(R.id.tv_type, item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime())); if (!TextUtils.isEmpty(item.getExpireDate()))
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount())); helper.setText(R.id.tv_date, item.getExpireDate());
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券 // helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime()));
helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元"); helper.setText(R.id.tv_amount, String.valueOf(item.getUsedAmount()));
}else if ("3".equals(item.getType())){ if ("1".equals(item.getType())) { //1满减券 2叠加满减券 3无门槛券
helper.setText(R.id.tv_condition,"无门槛"); helper.setText(R.id.tv_condition, "满" + item.getWithAmount() + "减" + item.getUsedAmount() + "元");
} else if ("3".equals(item.getType())) {
helper.setText(R.id.tv_condition, "无门槛");
} }
} }
......
package com.xxrv.coupon.adapter; package com.xxrv.coupon.adapter;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.component.utils.DateUtils; import com.rv.component.utils.DateUtils;
...@@ -21,7 +23,9 @@ public class UsedCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, Bas ...@@ -21,7 +23,9 @@ public class UsedCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, Bas
if (item !=null){ if (item !=null){
helper.setText(R.id.tv_name,item.getTitle()); helper.setText(R.id.tv_name,item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle()); helper.setText(R.id.tv_type,item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime())); if (!TextUtils.isEmpty(item.getExpireDate()))
helper.setText(R.id.tv_date, item.getExpireDate());
// helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime()));
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount())); helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount()));
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券 if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券
helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元"); helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元");
......
package com.xxrv.coupon.adapter; package com.xxrv.coupon.adapter;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.component.utils.DateUtils; import com.rv.component.utils.DateUtils;
...@@ -7,7 +9,7 @@ import com.xxrv.coupon.R; ...@@ -7,7 +9,7 @@ import com.xxrv.coupon.R;
import com.xxrv.coupon.bean.CouponBean; import com.xxrv.coupon.bean.CouponBean;
/** /**
*优惠券 待使用 * 优惠券 待使用
*/ */
public class WaitCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, BaseViewHolder> { public class WaitCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, BaseViewHolder> {
...@@ -18,17 +20,17 @@ public class WaitCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, Bas ...@@ -18,17 +20,17 @@ public class WaitCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, Bas
@Override @Override
protected void convert(BaseViewHolder helper, CouponBean.DataBean item) { protected void convert(BaseViewHolder helper, CouponBean.DataBean item) {
if (item !=null){ if (item != null) {
helper.setText(R.id.tv_name,item.getTitle()); helper.setText(R.id.tv_name, item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle()); helper.setText(R.id.tv_type, item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime())); if (!TextUtils.isEmpty(item.getExpireDate()))
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount())); helper.setText(R.id.tv_date, item.getExpireDate());
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券 helper.setText(R.id.tv_amount, String.valueOf(item.getUsedAmount()));
helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元"); if ("1".equals(item.getType())) { //1满减券 2叠加满减券 3无门槛券
}else if ("3".equals(item.getType())){ helper.setText(R.id.tv_condition, "满" + item.getWithAmount() + "减" + item.getUsedAmount() + "元");
helper.setText(R.id.tv_condition,"无门槛"); } else if ("3".equals(item.getType())) {
helper.setText(R.id.tv_condition, "无门槛");
} }
} }
} }
} }
...@@ -80,6 +80,7 @@ public class CarCouponBean extends BaseBean { ...@@ -80,6 +80,7 @@ public class CarCouponBean extends BaseBean {
private long crtTime;// ": 1563350412834, private long crtTime;// ": 1563350412834,
private long startTime;// ": 1563331306739, private long startTime;// ": 1563331306739,
private long expireTime;// ": 1577760103000, 到期时间 private long expireTime;// ": 1577760103000, 到期时间
private String expireDate ;
private String useTime;// ": 0, private String useTime;// ": 0,
private String title;// ": "租车券", 优惠券标题 private String title;// ": "租车券", 优惠券标题
private String subtitle;// ": "租车券", 副标题 private String subtitle;// ": "租车券", 副标题
...@@ -281,6 +282,14 @@ public class CarCouponBean extends BaseBean { ...@@ -281,6 +282,14 @@ public class CarCouponBean extends BaseBean {
this.isChecked = isChecked; this.isChecked = isChecked;
} }
public String getExpireDate() {
return expireDate;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
@Override @Override
public int getItemType() { public int getItemType() {
return CarCouponAdapter.TYPE_CARCOUPON_NAME; return CarCouponAdapter.TYPE_CARCOUPON_NAME;
......
...@@ -35,6 +35,7 @@ public class CouponBean extends BaseBean { ...@@ -35,6 +35,7 @@ public class CouponBean extends BaseBean {
private long crtTime;// ": 1563350412834, private long crtTime;// ": 1563350412834,
private long startTime;// ": 1563331306739, private long startTime;// ": 1563331306739,
private long expireTime;// ": 1577760103000, 到期时间 private long expireTime;// ": 1577760103000, 到期时间
private String expireDate ;
private String useTime;// ": 0, private String useTime;// ": 0,
private String title;// ": "租车券", 优惠券标题 private String title;// ": "租车券", 优惠券标题
private String subtitle;// ": "租车券", 副标题 private String subtitle;// ": "租车券", 副标题
...@@ -226,5 +227,13 @@ public class CouponBean extends BaseBean { ...@@ -226,5 +227,13 @@ public class CouponBean extends BaseBean {
public void setSubtitle(String subtitle) { public void setSubtitle(String subtitle) {
this.subtitle = subtitle; this.subtitle = subtitle;
} }
public String getExpireDate() {
return expireDate;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
} }
} }
...@@ -77,6 +77,11 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme ...@@ -77,6 +77,11 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme
intent.setComponent(new ComponentName(getContext(), "com.xxfc.rv.MainActivity")); intent.setComponent(new ComponentName(getContext(), "com.xxfc.rv.MainActivity"));
intent.putExtra("to", "travel"); intent.putExtra("to", "travel");
startActivity(intent); startActivity(intent);
} else if ("4".equals(bean.getChannel())){
Intent intent = new Intent();
intent.setComponent(new ComponentName(getContext(), "com.rv.member.MemberCenterActivity"));
startActivity(intent);
_mActivity.finish();
} }
} }
}); });
......
...@@ -9,6 +9,7 @@ import android.text.TextUtils; ...@@ -9,6 +9,7 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.frame.base.bus.LoginSuccessfulEvent; import com.frame.base.bus.LoginSuccessfulEvent;
...@@ -22,7 +23,9 @@ import com.ruiwenliu.wrapper.base.BaseBean; ...@@ -22,7 +23,9 @@ import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity; import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.util.ViewHolder; import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.control.SwitchButton;
import com.rv.component.dialog.PaymentTypeSelection; import com.rv.component.dialog.PaymentTypeSelection;
import com.rv.component.utils.Arith;
import com.rv.home.rv.module.ApiConfig; import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.login.LoginRvActivity; import com.rv.home.rv.module.ui.login.LoginRvActivity;
import com.rv.home.rv.module.ui.main.home.order.OrderListActivity; import com.rv.home.rv.module.ui.main.home.order.OrderListActivity;
...@@ -39,6 +42,8 @@ import com.rv.member.view.MemberTopView; ...@@ -39,6 +42,8 @@ import com.rv.member.view.MemberTopView;
import com.rv.tourism.bean.BeanTourOrderAliPay; import com.rv.tourism.bean.BeanTourOrderAliPay;
import com.tencent.mm.opensdk.openapi.IWXAPI; import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory; import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.xxrv.coupon.api.CouponApi;
import com.xxrv.coupon.bean.CarCouponBean;
import com.yuyife.okgo.OkGoUtil; import com.yuyife.okgo.OkGoUtil;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -72,6 +77,8 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -72,6 +77,8 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
private boolean hasAgree = false; private boolean hasAgree = false;
private CarCouponBean.DataBean.CarCouponTypeDataBean.CarCouponDataBean couponBean;
public static Intent getIntent(Context context) { public static Intent getIntent(Context context) {
return new Intent(context, MemberCenterActivity.class); return new Intent(context, MemberCenterActivity.class);
...@@ -187,6 +194,17 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -187,6 +194,17 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
case 4: case 4:
mPresenter.aliPay(MemberCenterActivity.this, (BeanTourOrderAliPay) result); mPresenter.aliPay(MemberCenterActivity.this, (BeanTourOrderAliPay) result);
break; break;
case 5:
CarCouponBean bean = (CarCouponBean) result;
if (bean != null) {
if (bean.getData() != null) {
couponBean = bean.getData().getCoupon();
}
}
showPayDialog();
break;
} }
} }
...@@ -211,6 +229,27 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -211,6 +229,27 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
getMemberData(); getMemberData();
} }
private void getCouponData() {
if (OkGoUtil.getToken() != null) {
Map<String, Object> headMap = new LinkedHashMap<>();
headMap.put("Authorization", OkGoUtil.getToken());
Map<String, Object> map = new LinkedHashMap<>();
map.put("type", 0);
map.put("channel", "4");
map.put("amount", selectCard.getPrice());
mPresenter.getData(RvFrameConfig.HOST, 5, CouponApi.HTTP_URL_COUPON_TYPELIST, CarCouponBean.class, map, headMap, true);
}
// if (OkGoUtil.getToken() != null) {
// Map<String, Object> headMap = new LinkedHashMap<>();
// headMap.put("Authorization", OkGoUtil.getToken());
// Map<String, Object> map = new LinkedHashMap<>();
// map.put("type", "0");
// map.put("channel", 4);
// mPresenter.getData(RvFrameConfig.HOST, 5, CouponApi.HTTP_URL_COUPON_LIST, CouponBean.class, map, headMap, false);
// }
}
/********** /**********
* 获取会员中心信息 * 获取会员中心信息
*/ */
...@@ -258,15 +297,38 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -258,15 +297,38 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
private int payType = 1; private int payType = 1;
private MemberListBean.MemberCard selectCard;
private String userPhone;
private PayListener payListener = new PayListener() { private PayListener payListener = new PayListener() {
@Override @Override
public void pay(final MemberListBean.MemberCard card, final String phone) { public void pay(final MemberListBean.MemberCard card, final String phone) {
if (!isLogin()) return; if (!isLogin()) return;
selectCard = card;
userPhone = phone;
couponBean = null;
getCouponData();
}
@Override
public void checkAgreement(boolean b) {
hasAgree = b;
}
};
private boolean isUseCoupon = false;
private void showPayDialog() {
new PaymentTypeSelection(MemberCenterActivity.this) { new PaymentTypeSelection(MemberCenterActivity.this) {
@Override @Override
public void helper(final ViewHolder helper) { public void helper(final ViewHolder helper) {
super.helper(helper); super.helper(helper);
helper.setText(R.id.tv_amount, String.format("¥%1$s", card.getPrice())); if (couponBean != null) {
isUseCoupon = true;
helper.setText(R.id.tv_amount, String.format("¥%1$s", Arith.sub(selectCard.getPrice().doubleValue(), couponBean.getUsedAmount())));
} else {
isUseCoupon = false;
helper.setText(R.id.tv_amount, String.format("¥%1$s", selectCard.getPrice()));
}
helper.setOnClickListener(new View.OnClickListener() { helper.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -284,29 +346,64 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> { ...@@ -284,29 +346,64 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
} else if (i == R.id.tv_pay_immediately) { } else if (i == R.id.tv_pay_immediately) {
dismiss(); dismiss();
mPresenter.createOrder(card, phone, 2); mPresenter.createOrder(selectCard, isUseCoupon ? (couponBean != null ? couponBean.getTickerNo() : "") : "", userPhone, 2);
} }
} }
}, R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately); }, R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately);
if (couponBean != null) {
helper.getItemView().findViewById(R.id.ll_item_coupon).setVisibility(View.VISIBLE);
TextView tvCouponNumber = helper.getItemView().findViewById(R.id.tv_coupon_number);
tvCouponNumber.setVisibility(View.VISIBLE);
tvCouponNumber.setText("使用" + couponBean.getUsedAmount() + "元代金券");
helper.getItemView().findViewById(R.id.line_coupon).setVisibility(View.VISIBLE);
SwitchButton switchButton = helper.getItemView().findViewById(R.id.sb_coupon_select);
switchButton.setVisibility(View.VISIBLE);
switchButton.setChecked(true);
switchButton.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(SwitchButton view, boolean isChecked) {
if (isChecked) {
isUseCoupon = true;
helper.setText(R.id.tv_amount, String.format("¥%1$s", Arith.sub(selectCard.getPrice().doubleValue(), couponBean.getUsedAmount())));
} else {
isUseCoupon = false;
helper.setText(R.id.tv_amount, String.format("¥%1$s", selectCard.getPrice()));
} }
}.show();
} }
});
}
}
}.show();
@Override // new PaymentTypeSelection(MemberCenterActivity.this) {
public void checkAgreement(boolean b) { // @Override
hasAgree = b; // public void helper(final ViewHolder helper) {
// int count = ll_cardview_content.getChildCount(); // super.helper(helper);
// if (count > 0) { // helper.setText(R.id.tv_amount, String.format("¥%1$s", selectCard.getPrice()));
// for (int i = 0; i < count; i++) { // helper.setOnClickListener(new View.OnClickListener() {
// View view = ll_cardview_content.getChildAt(i); // @Override
// if (view instanceof MemberItemView) { // public void onClick(View v) {
// ((MemberItemView) view).setHasAgree(hasAgree); // int i = v.getId();
// if (i == R.id.iv_close) {
// dismiss();
// } else if (i == R.id.ll_item_wechat) {
// payType = 1;
// helper.getView(com.rv.home.R.id.iv_wx_select).setSelected(true);
// helper.getView(com.rv.home.R.id.iv_alipy_select).setSelected(false);
// } else if (i == com.rv.home.R.id.ll_item_alipay) {
// payType = 2;
// helper.getView(com.rv.home.R.id.iv_wx_select).setSelected(false);
// helper.getView(com.rv.home.R.id.iv_alipy_select).setSelected(true);
//
// } else if (i == R.id.tv_pay_immediately) {
// dismiss();
// mPresenter.createOrder(selectCard,"", userPhone, 2);
// } // }
// } // }
// }, R.id.iv_close, R.id.ll_item_wechat, R.id.ll_item_alipay, R.id.tv_pay_immediately);
// } // }
// }.show();
} }
};
public interface PayListener { public interface PayListener {
void pay(MemberListBean.MemberCard card, String phone); void pay(MemberListBean.MemberCard card, String phone);
......
...@@ -5,17 +5,17 @@ package com.rv.member.bean; ...@@ -5,17 +5,17 @@ package com.rv.member.bean;
* 会员卡支付请求订单 * 会员卡支付请求订单
*/ */
public class MemberOrderPostBodyBean { public class MemberOrderPostBodyBean {
private String couponIds; private String tickerNos;
private int memberLevel; private int memberLevel;
private int memberLevelId; private int memberLevelId;
private String facilitatePhone; private String facilitatePhone;
public String getCouponIds() { public String getTickerNos() {
return couponIds; return tickerNos;
} }
public void setCouponIds(String couponIds) { public void setTickerNos(String tickerNos) {
this.couponIds = couponIds; this.tickerNos = tickerNos;
} }
public int getMemberLevel() { public int getMemberLevel() {
...@@ -42,8 +42,8 @@ public class MemberOrderPostBodyBean { ...@@ -42,8 +42,8 @@ public class MemberOrderPostBodyBean {
this.facilitatePhone = facilitatePhone; this.facilitatePhone = facilitatePhone;
} }
public MemberOrderPostBodyBean(String couponIds, int memberLevel, int memberLevelId, String inviterPhone) { public MemberOrderPostBodyBean(String tickerNos, int memberLevel, int memberLevelId, String inviterPhone) {
this.couponIds = couponIds; this.tickerNos = tickerNos;
this.memberLevel = memberLevel; this.memberLevel = memberLevel;
this.memberLevelId = memberLevelId; this.memberLevelId = memberLevelId;
this.facilitatePhone = inviterPhone; this.facilitatePhone = inviterPhone;
......
...@@ -52,9 +52,9 @@ public class MemberPresenter extends CommonPresenter { ...@@ -52,9 +52,9 @@ public class MemberPresenter extends CommonPresenter {
} }
} }
public void createOrder(MemberListBean.MemberCard card,String phone ,int position) { public void createOrder(MemberListBean.MemberCard card, String couponIds, String phone, int position) {
MemberOrderPostBodyBean memberOrderPostBodyBean = new MemberOrderPostBodyBean("", card.getLevel(), card.getId(),phone); MemberOrderPostBodyBean memberOrderPostBodyBean = new MemberOrderPostBodyBean(couponIds, card.getLevel(), card.getId(), phone);
Map<String, Object> headMap = new LinkedHashMap<>(); Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null) if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken()); headMap.put("Authorization", OkGoUtil.getToken());
......
...@@ -167,7 +167,6 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> { ...@@ -167,7 +167,6 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
case 1001: case 1001:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
mPresenter.showShareDialog(llContent, rvWebView); mPresenter.showShareDialog(llContent, rvWebView);
;
} else { } else {
Toast.makeText(getApplicationContext(), "授权失败,无法分享海报", Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(), "授权失败,无法分享海报", Toast.LENGTH_SHORT).show();
} }
......
...@@ -58,6 +58,7 @@ public class PopularizeActivity extends BaseStatusActivity<CommonPresenter> impl ...@@ -58,6 +58,7 @@ public class PopularizeActivity extends BaseStatusActivity<CommonPresenter> impl
listAdapter = new PopularizeListAdapter(new ArrayList<PopularizeBean.PopularizeItem>()); listAdapter = new PopularizeListAdapter(new ArrayList<PopularizeBean.PopularizeItem>());
refresh.setHeaderView(new SimpleRefreshView(this)); refresh.setHeaderView(new SimpleRefreshView(this));
refresh.setOnSimpleRefreshListener(this); refresh.setOnSimpleRefreshListener(this);
listAdapter.setOnLoadMoreListener(this, recyclerView);
recyclerView.setAdapter(listAdapter); recyclerView.setAdapter(listAdapter);
} }
...@@ -87,7 +88,7 @@ public class PopularizeActivity extends BaseStatusActivity<CommonPresenter> impl ...@@ -87,7 +88,7 @@ public class PopularizeActivity extends BaseStatusActivity<CommonPresenter> impl
PopularizeBean bean = (PopularizeBean) result; PopularizeBean bean = (PopularizeBean) result;
if (bean.isRel() && bean.getData() != null && bean.getData().getUserTeamMemberBos() != null) { if (bean.isRel() && bean.getData() != null && bean.getData().getUserTeamMemberBos() != null) {
if (currentPage == 1) { if (currentPage == 1) {
pageTotal = bean.getData().getPageNum(); pageTotal = bean.getData().getTotalPage();
refresh.onRefreshComplete(); refresh.onRefreshComplete();
if (bean.getData().getUserTeamMemberBos().size() == 0) { if (bean.getData().getUserTeamMemberBos().size() == 0) {
listAdapter.setEmptyView(getEmptyView(recyclerView, -1, getString(R.string.rv_select_not_data))); listAdapter.setEmptyView(getEmptyView(recyclerView, -1, getString(R.string.rv_select_not_data)));
......
...@@ -16,21 +16,17 @@ import android.text.TextUtils; ...@@ -16,21 +16,17 @@ import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.base.utils.ui.image.round.RoundImageView; import com.base.utils.ui.image.round.RoundImageView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity; import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.bean.UserInfoBean; import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.glide.GlideManager; import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.util.glide.GlideOptions; import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
...@@ -40,11 +36,13 @@ import com.rv.component.utils.RvCache; ...@@ -40,11 +36,13 @@ import com.rv.component.utils.RvCache;
import com.rv.component.utils.ZxingUtils; import com.rv.component.utils.ZxingUtils;
import com.rv.share.presenter.ReativeBillPresenter; import com.rv.share.presenter.ReativeBillPresenter;
import com.rv.share.utils.TransformationUtils; import com.rv.share.utils.TransformationUtils;
import com.yuyife.okgo.OkGoUtil;
import butterknife.BindView; import butterknife.BindView;
import butterknife.OnClick; import butterknife.OnClick;
/*******
* 原始生成海报界面
*/
public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter> { public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter> {
private String url; private String url;
......
...@@ -30,6 +30,7 @@ public class PopularizeBean extends BaseBean { ...@@ -30,6 +30,7 @@ public class PopularizeBean extends BaseBean {
private BigDecimal totalIncome; private BigDecimal totalIncome;
private int pageNum ; private int pageNum ;
private int pageSize ; private int pageSize ;
private int totalPage ;
private List<PopularizeItem> userTeamMemberBos ; private List<PopularizeItem> userTeamMemberBos ;
...@@ -64,6 +65,14 @@ public class PopularizeBean extends BaseBean { ...@@ -64,6 +65,14 @@ public class PopularizeBean extends BaseBean {
public void setUserTeamMemberBos(List<PopularizeItem> userTeamMemberBos) { public void setUserTeamMemberBos(List<PopularizeItem> userTeamMemberBos) {
this.userTeamMemberBos = userTeamMemberBos; this.userTeamMemberBos = userTeamMemberBos;
} }
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
} }
public static class PopularizeItem { public static class PopularizeItem {
......
...@@ -120,7 +120,12 @@ public class ReativeBillPresenter extends CommonPresenter { ...@@ -120,7 +120,12 @@ public class ReativeBillPresenter extends CommonPresenter {
@Override @Override
public void qqShare() { public void qqShare() {
if (image == null) {
shareDeal();
}
if (image != null) {
share(SHARE_MEDIA.QQ, image, "");
}
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment