Commit e1d97c8e authored by linfeng's avatar linfeng

租车和旅游优惠券 优惠券列表

parent 4deb65da
...@@ -45,4 +45,6 @@ public final class Constance { ...@@ -45,4 +45,6 @@ public final class Constance {
public static final String ACTIVITY_URL_MAPLOCATION="/discovery/other/MapLocationActivity"; public static final String ACTIVITY_URL_MAPLOCATION="/discovery/other/MapLocationActivity";
public static final String ACTIVITY_URL_COUPONALL="/xxrv/coupon/CouponAllActivity"; public static final String ACTIVITY_URL_COUPONALL="/xxrv/coupon/CouponAllActivity";
public static final String ACTIVITY_URL_CARCOUPON="/xxrv/coupon/CarCouponActivity";
} }
...@@ -178,6 +178,17 @@ public class DateUtils { ...@@ -178,6 +178,17 @@ public class DateUtils {
return sdf7.format(new Date(time)); return sdf7.format(new Date(time));
} }
/**
* 将时间戳转换成yyyy-MM-dd字符串
*
* @param time 时间戳
* @return yyyy-MM-dd
*/
public static String timestampToString2(long time) {
return sdf4.format(new Date(time));
}
/** /**
* 获取手机当前时间戳毫秒 * 获取手机当前时间戳毫秒
* *
......
...@@ -28,17 +28,14 @@ import com.frame.base.bus.Observer; ...@@ -28,17 +28,14 @@ import com.frame.base.bus.Observer;
import com.frame.base.bus.RxBus; import com.frame.base.bus.RxBus;
import com.frame.base.url.Constance; import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
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.util.LocationManager; import com.ruiwenliu.wrapper.util.LocationManager;
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.permission.RxPermission; import com.ruiwenliu.wrapper.util.permission.RxPermission;
import com.ruiwenliu.wrapper.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.control.MyGridView; import com.rv.component.control.MyGridView;
import com.rv.component.control.SquareCenterImageView; import com.rv.component.control.SquareCenterImageView;
import com.rv.component.utils.DateUtils;
import com.rv.component.utils.Inc; import com.rv.component.utils.Inc;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
import com.xxfc.discovery.R2; import com.xxfc.discovery.R2;
...@@ -52,9 +49,6 @@ import com.xxfc.imcamera.photopicker.PhotoPickerActivity; ...@@ -52,9 +49,6 @@ import com.xxfc.imcamera.photopicker.PhotoPickerActivity;
import com.xxfc.imcamera.photopicker.SelectModel; import com.xxfc.imcamera.photopicker.SelectModel;
import com.xxfc.imcamera.photopicker.intent.PhotoPickerIntent; import com.xxfc.imcamera.photopicker.intent.PhotoPickerIntent;
import com.yuyife.okgo.OkGoUtil; import com.yuyife.okgo.OkGoUtil;
import org.json.JSONArray;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -152,9 +146,10 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> { ...@@ -152,9 +146,10 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
Map<String, Object> headMap = new LinkedHashMap<>(); Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null) { if (OkGoUtil.getToken() != null) {
String imToken = UtilsManager.getInstance(OkGoUtil.application).getSPStringCode(SPConstance.USER_JSON, SPConstance.USER_JSON_IMTOKEN); // mPresenter.postData(DiscoveryApi.IMA_BASEUSRL,1, DiscoveryApi.DISCOVERY_MSG_ADD, BaseBean.class, map, headMap,true);
// String imUserId = UtilsManager.getInstance(OkGoUtil.application).getSPStringCode(SPConstance.USER_JSON, SPConstance.USER_JSON_IMUSERID);
headMap.put("Authorization", imToken);
// headMap.put("Authorization", imToken);
// headMap.put("content-type ","application/json"); // headMap.put("content-type ","application/json");
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("access_token", OkGoUtil.getToken()); map.put("access_token", OkGoUtil.getToken());
...@@ -175,9 +170,9 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> { ...@@ -175,9 +170,9 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
map.put("cityId", "0"); map.put("cityId", "0");
mPresenter.postData(DiscoveryApi.IMA_BASEUSRL,1, DiscoveryApi.DISCOVERY_MSG_ADD, BaseBean.class, map, headMap,true); mPresenter.postData(DiscoveryApi.IMA_BASEUSRL,1, DiscoveryApi.DISCOVERY_MSG_ADD, BaseBean.class, map, headMap,true);
} }
} }
@OnClick({R2.id.ll_item_select_icon, R2.id.ll_item_select_address, R2.id.tv_pat_ok}) @OnClick({R2.id.ll_item_select_icon, R2.id.ll_item_select_address, R2.id.tv_pat_ok})
public void onViewClicked(View view) { public void onViewClicked(View view) {
int id = view.getId(); int id = view.getId();
......
...@@ -43,6 +43,7 @@ dependencies { ...@@ -43,6 +43,7 @@ dependencies {
api project(':component_control') api project(':component_control')
api project(':plugin_search') api project(':plugin_search')
api project(':plugin_calendar') api project(':plugin_calendar')
api project(':plugin_coupon')
api project(':RvWrapper') api project(':RvWrapper')
// api project(':RvTravel') // api project(':RvTravel')
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4' annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
......
...@@ -124,7 +124,6 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat ...@@ -124,7 +124,6 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERID, registeredBean.getData().getUserId()).commit(); UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERID, registeredBean.getData().getUserId()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_TOKEN, registeredBean.getToken()).commit(); UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_TOKEN, registeredBean.getToken()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_IMUSERID, registeredBean.getData().getImUserId()).commit(); UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_IMUSERID, registeredBean.getData().getImUserId()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_IMTOKEN, registeredBean.getData().getImToken()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_ISCERTIFICATIONSTATUS, registeredBean.getData().getCertificationStatus()).commit(); UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_ISCERTIFICATIONSTATUS, registeredBean.getData().getCertificationStatus()).commit();
Map<String, Object> headMap = new LinkedHashMap<>(); Map<String, Object> headMap = new LinkedHashMap<>();
......
...@@ -49,7 +49,7 @@ public class OrderDataBean implements Serializable{ ...@@ -49,7 +49,7 @@ public class OrderDataBean implements Serializable{
// private int vehicleId; // private int vehicleId;
private int damageSafe;//是否购买免赔 1--是 0--否 private int damageSafe;//是否购买免赔 1--是 0--否
private int rentFreeDay;//是否使用出租免费天数 1--是 0--否 private int rentFreeDay;//是否使用出租免费天数 1--是 0--否
private String couponIds;//优惠券ids,逗号分割 private String tickerNos;//优惠券ids,逗号分割
public int getDayNum() { public int getDayNum() {
return dayNum; return dayNum;
...@@ -181,12 +181,12 @@ public class OrderDataBean implements Serializable{ ...@@ -181,12 +181,12 @@ public class OrderDataBean implements Serializable{
this.rentFreeDay = rentFreeDay; this.rentFreeDay = rentFreeDay;
} }
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;
} }
@Override @Override
...@@ -208,7 +208,7 @@ public class OrderDataBean implements Serializable{ ...@@ -208,7 +208,7 @@ public class OrderDataBean implements Serializable{
", startTime=" + startTime + ", startTime=" + startTime +
", damageSafe=" + damageSafe + ", damageSafe=" + damageSafe +
", rentFreeDay=" + rentFreeDay + ", rentFreeDay=" + rentFreeDay +
", couponIds='" + couponIds + '\'' + ", couponIds='" + tickerNos + '\'' +
'}'; '}';
} }
} }
...@@ -711,6 +711,7 @@ ...@@ -711,6 +711,7 @@
<include layout="@layout/common_line" /> <include layout="@layout/common_line" />
<RelativeLayout <RelativeLayout
android:id="@+id/rl_item_select_coupon"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_50"> android:layout_height="@dimen/size_50">
...@@ -723,6 +724,7 @@ ...@@ -723,6 +724,7 @@
android:textSize="@dimen/text_16" /> android:textSize="@dimen/text_16" />
<TextView <TextView
android:id="@+id/tv_coupon_amount"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
......
...@@ -39,8 +39,10 @@ dependencies { ...@@ -39,8 +39,10 @@ dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4' annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
implementation 'com.github.zcweng:switch-button:0.0.3@aar' implementation 'com.github.zcweng:switch-button:0.0.3@aar'
implementation 'com.alibaba:fastjson:1.2.21'
api project(':component_dialog') api project(':component_dialog')
api project(':plugin_search') api project(':plugin_search')
api project(':RvWrapper') api project(':RvWrapper')
api project(':component_control') api project(':component_control')
api project(':plugin_coupon')
} }
...@@ -383,6 +383,34 @@ ...@@ -383,6 +383,34 @@
app:sb_show_indicator="false" app:sb_show_indicator="false"
app:sb_uncheckcircle_color="@color/textLightGrey" /> app:sb_uncheckcircle_color="@color/textLightGrey" />
</LinearLayout> </LinearLayout>
<include layout="@layout/common_line" />
<RelativeLayout
android:background="@color/colorWrite"
android:id="@+id/rl_item_select_coupon"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_15"
android:layout_width="match_parent"
android:layout_height="@dimen/size_50">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="使用优惠券"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" />
<TextView
android:id="@+id/tv_coupon_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="暂无优惠券"
android:textColor="@color/gray_FFB74B"
android:textSize="@dimen/text_14" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_item_notice" android:id="@+id/rl_item_notice"
......
...@@ -37,6 +37,7 @@ dependencies { ...@@ -37,6 +37,7 @@ dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support.constraint:constraint-layout:1.1.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4' annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
implementation 'com.alibaba:fastjson:1.2.21'
api project(':RvWrapper') api project(':RvWrapper')
api project(':component_resource') api project(':component_resource')
api project(':component_utils') api project(':component_utils')
......
package com.xxrv.coupon; package com.xxrv.coupon;
import android.content.Intent; import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.fastjson.JSON;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
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.weight.TitleView; import com.ruiwenliu.wrapper.weight.TitleView;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.xxrv.coupon.adapter.CarCouponAdapter; import com.xxrv.coupon.adapter.CarCouponAdapter;
import com.xxrv.coupon.adapter.UsedCouponAdapter; import com.xxrv.coupon.bean.CouponBean;
import com.xxrv.coupon.presenter.CouponAllPresenter; import com.xxrv.coupon.presenter.CouponAllPresenter;
import java.util.List;
import butterknife.BindView; import butterknife.BindView;
/** /**
* 租车优惠券 * 租车优惠券
*/ */
public class CarCouponActivity extends BaseStatusActivity<CouponAllPresenter>implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener { @Route(path = Constance.ACTIVITY_URL_CARCOUPON)
public class CarCouponActivity extends BaseStatusActivity<CouponAllPresenter> {
@BindView(R2.id.rv_content) @BindView(R2.id.rv_content)
RecyclerView rvContent; RecyclerView rvContent;
@BindView(R2.id.refresh)
SimpleRefreshLayout mSimpleRefreshLayout;
private CarCouponAdapter mAdapter; private CarCouponAdapter mAdapter;
@Autowired()
String coupon;
@Override @Override
protected int setLayout() { protected int setLayout() {
return R.layout.activity_car_coupon; return R.layout.activity_car_coupon;
...@@ -38,27 +45,36 @@ public class CarCouponActivity extends BaseStatusActivity<CouponAllPresenter>imp ...@@ -38,27 +45,36 @@ public class CarCouponActivity extends BaseStatusActivity<CouponAllPresenter>imp
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) { protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("优惠券"); titleView.setTitle("优惠券");
mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(mActivity));
mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
mAdapter = new CarCouponAdapter(); mAdapter = new CarCouponAdapter();
rvContent.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false)); rvContent.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
rvContent.setAdapter(mAdapter); rvContent.setAdapter(mAdapter);
if (coupon != null) {
List<CouponBean.DataBean> couponBeans = JSON.parseArray(coupon, CouponBean.DataBean.class);
mAdapter.addData(couponBeans);
} }
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onShowResult(int requestType, BaseBean result) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
CouponBean.DataBean item = (CouponBean.DataBean) adapter.getItem(position);
if ("1".equals(item.getStatus())) {
getIntent().putExtra("position", position);
setResult(RESULT_OK, getIntent());
finish();
}
}
});
} }
@Override @Override
public void onLoadMoreRequested() { public void onShowResult(int requestType, BaseBean result) {
} }
@Override private void processData(CouponBean bean) {
public void onRefresh() {
} }
} }
...@@ -2,20 +2,44 @@ package com.xxrv.coupon.adapter; ...@@ -2,20 +2,44 @@ package com.xxrv.coupon.adapter;
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.xxrv.coupon.R; import com.xxrv.coupon.R;
import com.xxrv.coupon.bean.CouponBean;
/** /**
* 优惠券 租车确认订单 * 优惠券 租车确认订单
*/ */
public class CarCouponAdapter extends BaseQuickAdapter<String, BaseViewHolder> { public class CarCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, BaseViewHolder> {
public CarCouponAdapter() { public CarCouponAdapter() {
super(R.layout.rv_item_carcoupon); super(R.layout.rv_item_carcoupon);
} }
@Override @Override
protected void convert(BaseViewHolder helper, String item) { protected void convert(BaseViewHolder helper, CouponBean.DataBean item) {
if (item !=null){
helper.setText(R.id.tv_name,item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime()));
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount()));
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券
helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元");
}else if ("3".equals(item.getType())){
helper.setText(R.id.tv_condition,"无门槛");
}
if (item.isCheck()){
helper.getView(R.id.iv_select).setSelected(true);
}else {
helper.getView(R.id.iv_select).setSelected(false);
}
if ("1".equals(item.getStatus())){
helper.setGone(R.id.tv_layout_gray,false);
}else {
helper.setGone(R.id.tv_layout_gray,true);
}
}
} }
} }
...@@ -2,20 +2,33 @@ package com.xxrv.coupon.adapter; ...@@ -2,20 +2,33 @@ package com.xxrv.coupon.adapter;
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.xxrv.coupon.R; import com.xxrv.coupon.R;
import com.xxrv.coupon.bean.CouponBean;
/** /**
* 优惠券 已过期 * 优惠券 已过期
*/ */
public class ExpiredCouponAdapter extends BaseQuickAdapter<String, BaseViewHolder> { public class ExpiredCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, BaseViewHolder> {
public ExpiredCouponAdapter() { public ExpiredCouponAdapter() {
super(R.layout.rv_item_expiredcoupon); super(R.layout.rv_item_expiredcoupon);
} }
@Override @Override
protected void convert(BaseViewHolder helper, String item) { protected void convert(BaseViewHolder helper, CouponBean.DataBean item) {
if (item !=null){
helper.setText(R.id.tv_name,item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime()));
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount()));
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券
helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元");
}else if ("3".equals(item.getType())){
helper.setText(R.id.tv_condition,"无门槛");
}
} }
}
} }
...@@ -2,20 +2,33 @@ package com.xxrv.coupon.adapter; ...@@ -2,20 +2,33 @@ package com.xxrv.coupon.adapter;
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.xxrv.coupon.R; import com.xxrv.coupon.R;
import com.xxrv.coupon.bean.CouponBean;
/** /**
* 优惠券 已使用 * 优惠券 已使用
*/ */
public class UsedCouponAdapter extends BaseQuickAdapter<String, BaseViewHolder> { public class UsedCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, BaseViewHolder> {
public UsedCouponAdapter() { public UsedCouponAdapter() {
super(R.layout.rv_item_usedcoupon); super(R.layout.rv_item_usedcoupon);
} }
@Override @Override
protected void convert(BaseViewHolder helper, String item) { protected void convert(BaseViewHolder helper, CouponBean.DataBean item) {
if (item !=null){
helper.setText(R.id.tv_name,item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime()));
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount()));
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券
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.widget.ImageView;
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.xxrv.coupon.R; import com.xxrv.coupon.R;
import com.xxrv.coupon.bean.WaitCouponBean; import com.xxrv.coupon.bean.CouponBean;
/** /**
* *优惠券 待使用
*/ */
public class WaitCouponAdapter extends BaseQuickAdapter<WaitCouponBean.DataBeanX.DataBean, BaseViewHolder> { public class WaitCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, BaseViewHolder> {
public WaitCouponAdapter() { public WaitCouponAdapter() {
super(R.layout.rv_item_waitcoupon); super(R.layout.rv_item_waitcoupon);
} }
@Override @Override
protected void convert(BaseViewHolder helper, WaitCouponBean.DataBeanX.DataBean item) { protected void convert(BaseViewHolder helper, CouponBean.DataBean item) {
if (item !=null){
helper.setText(R.id.tv_name,item.getTitle());
helper.setText(R.id.tv_type,item.getSubtitle());
helper.setText(R.id.tv_date,"有效期至" + DateUtils.timestampToString2(item.getExpireTime()));
helper.setText(R.id.tv_amount,String.valueOf(item.getUsedAmount()));
if ("1".equals(item.getType())){ //1满减券 2叠加满减券 3无门槛券
helper.setText(R.id.tv_condition,"满"+item.getWithAmount()+"减"+item.getUsedAmount()+"元");
}else if ("3".equals(item.getType())){
helper.setText(R.id.tv_condition,"无门槛");
}
} }
}
} }
...@@ -2,6 +2,8 @@ package com.xxrv.coupon.api; ...@@ -2,6 +2,8 @@ package com.xxrv.coupon.api;
import com.frame.rv.config.RvFrameConfig; import com.frame.rv.config.RvFrameConfig;
public interface SearchApi extends RvFrameConfig { public class CouponApi {
//我的优惠卷
public static String HTTP_URL_COUPON_LIST = RvFrameConfig.HOST + "/api/activity/user/coupon/list";
} }
package com.xxrv.coupon.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class CouponBean extends BaseBean {
private List<DataBean> data;
private boolean rel;
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class DataBean implements Serializable {
private String couponId;// ": 2,
private String userId;// ": 176,
private String tickerNo;// ": "172825637097181184",
private String isUse;// ": 0,
private long crtTime;// ": 1563350412834,
private long startTime;// ": 1563331306739,
private long expireTime;// ": 1577760103000, 到期时间
private String useTime;// ": 0,
private String title;// ": "租车券", 优惠券标题
private String subtitle;// ": "租车券", 副标题
private String icon;// ": "https://xxtest.upyuns.com/image/admin/20190513143243.png",
private String used;// ": 61,
private String channel;// ": 1,
private String userType;// ": 0,
private String type;// ": 1,1满减券 2叠加满减券 3无门槛券
private String withSpecial;// ": 2,
private String withSn;// ": "",
private double withAmount;// ": 2400, 满多少金额
private double usedAmount;// ": 900,用券抵扣金额
private String status;// ": 1, 1-有效;2-无效
private String url;// ": ""
private boolean isCheck;
public boolean isCheck() {
return isCheck;
}
public void setCheck(boolean check) {
isCheck = check;
}
public String getCouponId() {
return couponId;
}
public void setCouponId(String couponId) {
this.couponId = couponId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getTickerNo() {
return tickerNo;
}
public void setTickerNo(String tickerNo) {
this.tickerNo = tickerNo;
}
public String getIsUse() {
return isUse;
}
public void setIsUse(String isUse) {
this.isUse = isUse;
}
public long getCrtTime() {
return crtTime;
}
public void setCrtTime(long crtTime) {
this.crtTime = crtTime;
}
public long getStartTime() {
return startTime;
}
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public long getExpireTime() {
return expireTime;
}
public void setExpireTime(long expireTime) {
this.expireTime = expireTime;
}
public String getUseTime() {
return useTime;
}
public void setUseTime(String useTime) {
this.useTime = useTime;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getUsed() {
return used;
}
public void setUsed(String used) {
this.used = used;
}
public String getChannel() {
return channel;
}
public void setChannel(String channel) {
this.channel = channel;
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getWithSpecial() {
return withSpecial;
}
public void setWithSpecial(String withSpecial) {
this.withSpecial = withSpecial;
}
public String getWithSn() {
return withSn;
}
public void setWithSn(String withSn) {
this.withSn = withSn;
}
public double getWithAmount() {
return withAmount;
}
public void setWithAmount(double withAmount) {
this.withAmount = withAmount;
}
public double getUsedAmount() {
return usedAmount;
}
public void setUsedAmount(double usedAmount) {
this.usedAmount = usedAmount;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getSubtitle() {
return subtitle;
}
public void setSubtitle(String subtitle) {
this.subtitle = subtitle;
}
}
}
package com.xxrv.coupon.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class WaitCouponBean extends BaseBean {
private DataBeanX data;
private boolean rel;
public DataBeanX getData() {
return data;
}
public void setData(DataBeanX data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public static class DataBeanX {
private int totalCount;
private int totalPage;
private int pageNum;
private int pageSize;
private List<DataBean> data;
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean implements Serializable {
}
}
}
package com.xxrv.coupon.fragment; package com.xxrv.coupon.fragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment; import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout; import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView; import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.xxrv.coupon.R; import com.xxrv.coupon.R;
import com.xxrv.coupon.R2; import com.xxrv.coupon.R2;
import com.xxrv.coupon.adapter.ExpiredCouponAdapter;
import com.xxrv.coupon.adapter.UsedCouponAdapter;
import com.xxrv.coupon.api.CouponApi;
import com.xxrv.coupon.bean.CouponBean;
import com.xxrv.coupon.presenter.CouponAllPresenter; import com.xxrv.coupon.presenter.CouponAllPresenter;
import com.yuyife.okgo.OkGoUtil;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
...@@ -20,15 +27,14 @@ import butterknife.BindView; ...@@ -20,15 +27,14 @@ import butterknife.BindView;
/** /**
* 优惠券 已过期 * 优惠券 已过期
*/ */
public class ExpiredCouponFragment extends BaseFragment<CouponAllPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener { public class ExpiredCouponFragment extends BaseFragment<CouponAllPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content) @BindView(R2.id.rv_content)
RecyclerView rvContent; RecyclerView rvContent;
@BindView(R2.id.refresh) @BindView(R2.id.refresh)
SimpleRefreshLayout mSimpleRefreshLayout; SimpleRefreshLayout mSimpleRefreshLayout;
private int countPage; private ExpiredCouponAdapter mAdapter;
private int mPage;
public static ExpiredCouponFragment getInstance(int type) { public static ExpiredCouponFragment getInstance(int type) {
Bundle bundl = new Bundle(); Bundle bundl = new Bundle();
...@@ -48,64 +54,42 @@ public class ExpiredCouponFragment extends BaseFragment<CouponAllPresenter> impl ...@@ -48,64 +54,42 @@ public class ExpiredCouponFragment extends BaseFragment<CouponAllPresenter> impl
mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity)); mSimpleRefreshLayout.setHeaderView(new SimpleRefreshView(_mActivity));
mSimpleRefreshLayout.setOnSimpleRefreshListener(this); mSimpleRefreshLayout.setOnSimpleRefreshListener(this);
mAdapter = new ExpiredCouponAdapter();
rvContent.setLayoutManager(new LinearLayoutManager(_mActivity, LinearLayoutManager.VERTICAL, false));
rvContent.setAdapter(mAdapter);
} }
@Override @Override
protected void loadData(Bundle savedInstanceState) { protected void loadData(Bundle savedInstanceState) {
onFresh(); geDataList();
}
/**
* 刷新
*/
private void onFresh() {
mPage = 1;
geDataList(mPage);
} }
/** /**
* 请求数据 * 请求数据
*
* @param page
*/ */
private void geDataList(int page) { private void geDataList() {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page); map.put("type", "3");
map.put("type",2); mPresenter.getData(RvFrameConfig.HOST, 0, CouponApi.HTTP_URL_COUPON_LIST, CouponBean.class, map, headMap, false);
// mPresenter.postData( 0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false);
} }
@Override @Override
public void onShowResult(int requestType, BaseBean result) { public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete(); mSimpleRefreshLayout.onRefreshComplete();
// processData((DiscoveryRecommendBean) result); processData((CouponBean) result);
} }
// private void processData(DiscoveryRecommendBean bean) { private void processData(CouponBean bean) {
// if (mPage == 1) { mAdapter.getData().clear();
// countPage = bean.getData().getTotalPage(); mAdapter.addData(bean.getData());
// mAdapter.setNewData(bean.getData().getList());
// if (bean.getData().getTotalCount() == 0) {
//
// }
// } else {
// mAdapter.addData(bean.getData().getList());
// mAdapter.loadMoreComplete();
// }
// }
@Override
public void onLoadMoreRequested() {
// if (mPage >= countPage) {
// mAdapter.loadMoreEnd();
// } else {
// mPage++;
// geDataList(mPage);
// }
} }
@Override @Override
public void onRefresh() { public void onRefresh() {
onFresh(); geDataList();
} }
} }
...@@ -5,6 +5,7 @@ import android.support.v7.widget.LinearLayoutManager; ...@@ -5,6 +5,7 @@ import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment; import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout; import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
...@@ -13,7 +14,10 @@ import com.xxrv.coupon.R; ...@@ -13,7 +14,10 @@ import com.xxrv.coupon.R;
import com.xxrv.coupon.R2; import com.xxrv.coupon.R2;
import com.xxrv.coupon.adapter.UsedCouponAdapter; import com.xxrv.coupon.adapter.UsedCouponAdapter;
import com.xxrv.coupon.adapter.WaitCouponAdapter; import com.xxrv.coupon.adapter.WaitCouponAdapter;
import com.xxrv.coupon.api.CouponApi;
import com.xxrv.coupon.bean.CouponBean;
import com.xxrv.coupon.presenter.CouponAllPresenter; import com.xxrv.coupon.presenter.CouponAllPresenter;
import com.yuyife.okgo.OkGoUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -24,7 +28,7 @@ import butterknife.BindView; ...@@ -24,7 +28,7 @@ import butterknife.BindView;
/** /**
* 优惠券 已使用 * 优惠券 已使用
*/ */
public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener { public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content) @BindView(R2.id.rv_content)
RecyclerView rvContent; RecyclerView rvContent;
...@@ -32,8 +36,6 @@ public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> impleme ...@@ -32,8 +36,6 @@ public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> impleme
SimpleRefreshLayout mSimpleRefreshLayout; SimpleRefreshLayout mSimpleRefreshLayout;
UsedCouponAdapter mAdapter; UsedCouponAdapter mAdapter;
private int countPage;
private int mPage;
public static UsedCouponFragment getInstance(int type) { public static UsedCouponFragment getInstance(int type) {
Bundle bundl = new Bundle(); Bundle bundl = new Bundle();
...@@ -58,73 +60,40 @@ public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> impleme ...@@ -58,73 +60,40 @@ public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> impleme
rvContent.setLayoutManager(new LinearLayoutManager(_mActivity, LinearLayoutManager.VERTICAL, false)); rvContent.setLayoutManager(new LinearLayoutManager(_mActivity, LinearLayoutManager.VERTICAL, false));
rvContent.setAdapter(mAdapter); rvContent.setAdapter(mAdapter);
setData();
}
private void setData() {
ArrayList<String> strings = new ArrayList<>();
for (int i = 0; i < 10; i++) {
strings.add("2222");
}
mAdapter.addData(strings);
} }
@Override @Override
protected void loadData(Bundle savedInstanceState) { protected void loadData(Bundle savedInstanceState) {
onFresh(); geDataList();
}
/**
* 刷新
*/
private void onFresh() {
mPage = 1;
geDataList(mPage);
} }
/** /**
* 请求数据 * 请求数据
* *
* @param page
*/ */
private void geDataList(int page) { private void geDataList() {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page); map.put("type", "1");
map.put("type",2); mPresenter.getData(RvFrameConfig.HOST,0, CouponApi.HTTP_URL_COUPON_LIST, CouponBean.class, map,headMap,false);
// mPresenter.postData( 0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false);
} }
@Override @Override
public void onShowResult(int requestType, BaseBean result) { public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete(); mSimpleRefreshLayout.onRefreshComplete();
// processData((DiscoveryRecommendBean) result); processData((CouponBean) result);
} }
// private void processData(DiscoveryRecommendBean bean) { private void processData(CouponBean bean) {
// if (mPage == 1) { mAdapter.getData().clear();
// countPage = bean.getData().getTotalPage(); mAdapter.addData(bean.getData());
// mAdapter.setNewData(bean.getData().getList());
// if (bean.getData().getTotalCount() == 0) {
//
// }
// } else {
// mAdapter.addData(bean.getData().getList());
// mAdapter.loadMoreComplete();
// }
// }
@Override
public void onLoadMoreRequested() {
// if (mPage >= countPage) {
// mAdapter.loadMoreEnd();
// } else {
// mPage++;
// geDataList(mPage);
// }
} }
@Override @Override
public void onRefresh() { public void onRefresh() {
onFresh(); geDataList();
} }
} }
...@@ -2,7 +2,7 @@ package com.xxrv.coupon.fragment; ...@@ -2,7 +2,7 @@ package com.xxrv.coupon.fragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean; import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment; import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout; import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
...@@ -10,8 +10,10 @@ import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView; ...@@ -10,8 +10,10 @@ import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.xxrv.coupon.R; import com.xxrv.coupon.R;
import com.xxrv.coupon.R2; import com.xxrv.coupon.R2;
import com.xxrv.coupon.adapter.WaitCouponAdapter; import com.xxrv.coupon.adapter.WaitCouponAdapter;
import com.xxrv.coupon.bean.WaitCouponBean; import com.xxrv.coupon.api.CouponApi;
import com.xxrv.coupon.bean.CouponBean;
import com.xxrv.coupon.presenter.CouponAllPresenter; import com.xxrv.coupon.presenter.CouponAllPresenter;
import com.yuyife.okgo.OkGoUtil;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
...@@ -21,7 +23,7 @@ import butterknife.BindView; ...@@ -21,7 +23,7 @@ import butterknife.BindView;
* 优惠券 待使用 * 优惠券 待使用
*/ */
public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener { public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> implements SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.rv_content) @BindView(R2.id.rv_content)
RecyclerView rvContent; RecyclerView rvContent;
...@@ -30,8 +32,6 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme ...@@ -30,8 +32,6 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme
WaitCouponAdapter mAdapter; WaitCouponAdapter mAdapter;
private int countPage;
private int mPage;
public static WaitCouponFragment getInstance(int type) { public static WaitCouponFragment getInstance(int type) {
Bundle bundl = new Bundle(); Bundle bundl = new Bundle();
...@@ -59,59 +59,34 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme ...@@ -59,59 +59,34 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme
@Override @Override
protected void loadData(Bundle savedInstanceState) { protected void loadData(Bundle savedInstanceState) {
onFresh(); geDataList();
}
/**
* 刷新
*/
private void onFresh() {
mPage = 1;
geDataList(mPage);
} }
/** /**
* 请求数据 * 请求数据
*
* @param page
*/ */
private void geDataList(int page) { private void geDataList() {
Map<String, Object> headMap = new LinkedHashMap<>();
if (OkGoUtil.getToken() != null)
headMap.put("Authorization", OkGoUtil.getToken());
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("page", page); map.put("type", "0");
map.put("type",2); mPresenter.getData(RvFrameConfig.HOST,0, CouponApi.HTTP_URL_COUPON_LIST, CouponBean.class, map,headMap,false);
// mPresenter.postData( 0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false);
} }
@Override @Override
public void onShowResult(int requestType, BaseBean result) { public void onShowResult(int requestType, BaseBean result) {
mSimpleRefreshLayout.onRefreshComplete(); mSimpleRefreshLayout.onRefreshComplete();
processData((WaitCouponBean) result); processData((CouponBean) result);
}
private void processData(WaitCouponBean bean) {
if (mPage == 1) {
countPage = bean.getData().getTotalPage();
mAdapter.setNewData(bean.getData().getData());
if (bean.getData().getTotalCount() == 0) {
}
} else {
mAdapter.addData(bean.getData().getData());
mAdapter.loadMoreComplete();
}
} }
@Override private void processData(CouponBean bean) {
public void onLoadMoreRequested() { mAdapter.getData().clear();
if (mPage >= countPage) { mAdapter.addData(bean.getData());
mAdapter.loadMoreEnd();
} else {
mPage++;
geDataList(mPage);
}
} }
@Override @Override
public void onRefresh() { public void onRefresh() {
onFresh(); geDataList();
} }
} }
...@@ -9,6 +9,6 @@ public class CouponAllPresenter extends MvpPresenter { ...@@ -9,6 +9,6 @@ public class CouponAllPresenter extends MvpPresenter {
* 域名地址 * 域名地址
*/ */
public String getBaseUrl() { public String getBaseUrl() {
return RvFrameConfig.AUTH_POST; return RvFrameConfig.HOST;
} }
} }
...@@ -5,16 +5,8 @@ ...@@ -5,16 +5,8 @@
android:background="@color/colorGrayBg" android:background="@color/colorGrayBg"
android:orientation="vertical"> android:orientation="vertical">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/rv_content" android:id="@+id/rv_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>
</android.support.v7.widget.RecyclerView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_item_rv_enthusiast" android:id="@+id/ll_item_rv_enthusiast"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_15" android:layout_marginTop="@dimen/size_15"
android:layout_marginRight="@dimen/size_15" android:layout_marginRight="@dimen/size_15"
android:background="@drawable/icon_layout_expired_coupon" android:background="@drawable/icon_layout_select_coupon"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/size_10"> android:paddingLeft="@dimen/size_10">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -84,7 +88,7 @@ ...@@ -84,7 +88,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="9000" android:text="9000"
android:textColor="@color/gray_F64747" android:textColor="@color/gray_F64747"
android:textSize="@dimen/text_38" android:textSize="@dimen/text_30"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
...@@ -97,15 +101,24 @@ ...@@ -97,15 +101,24 @@
android:textColor="@color/text_Gray" android:textColor="@color/text_Gray"
android:textSize="@dimen/text_10" /> android:textSize="@dimen/text_10" />
</LinearLayout> </LinearLayout>
</LinearLayout>
<ImageView <ImageView
android:id="@+id/iv_select" android:id="@+id/iv_select"
android:layout_width="@dimen/size_20" android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20" android:layout_height="@dimen/size_20"
android:layout_marginLeft="@dimen/size_30" android:layout_marginLeft="@dimen/size_10"
android:layout_gravity="center_vertical" android:layout_marginRight="@dimen/size_20"
android:layout_gravity="center_vertical|right"
android:src="@drawable/selector_rv_icon_mark"/> android:src="@drawable/selector_rv_icon_mark"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> <TextView
\ No newline at end of file android:visibility="visible"
android:id="@+id/tv_layout_gray"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/size_15"
android:layout_height="@dimen/size_100"
android:background="@color/gray_50ffffff"/>
</RelativeLayout>
\ No newline at end of file
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="9000" android:text="9000"
android:textColor="@color/gray_F64747" android:textColor="@color/gray_F64747"
android:textSize="@dimen/text_38" android:textSize="@dimen/text_30"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="9000" android:text="9000"
android:textColor="@color/gray_F64747" android:textColor="@color/gray_F64747"
android:textSize="@dimen/text_38" android:textSize="@dimen/text_30"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="9000" android:text="9000"
android:textColor="@color/gray_F64747" android:textColor="@color/gray_F64747"
android:textSize="@dimen/text_38" android:textSize="@dimen/text_30"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
......
apply plugin: 'com.android.library'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = [moduleName: project.getName()]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
api 'com.jakewharton:butterknife:9.0.0-rc1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
api project(':RvWrapper')
api project(':component_resource')
api project(':component_utils')
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxrv.wallet">
<application>
<activity android:name=".activity.WalletActivity"></activity>
</application>
</manifest>
\ No newline at end of file
package com.xxrv.wallet.activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.xxrv.wallet.R;
import com.xxrv.wallet.presenter.WalletPresenter;
/**
* 钱包
*/
public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
@Override
protected int setLayout() {
return R.layout.activity_wallet;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
showTitle(false);
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
}
package com.xxrv.wallet.presenter;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.presenter.MvpPresenter;
public class WalletPresenter extends MvpPresenter {
@Override
/**
* 域名地址
*/
public String getBaseUrl() {
return RvFrameConfig.HOST;
}
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.WalletActivity">
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<resources>
<string name="app_name">plugin_wallet</string>
</resources>
...@@ -30,3 +30,4 @@ include ':plugin_coupon' ...@@ -30,3 +30,4 @@ include ':plugin_coupon'
include ':plugin_share' include ':plugin_share'
include ':plugin_points' include ':plugin_points'
include ':plugin_imcamera' include ':plugin_imcamera'
include ':plugin_wallet'
\ No newline at end of file
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