Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RvApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lify
RvApp
Commits
e1d97c8e
Commit
e1d97c8e
authored
Jul 19, 2019
by
linfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
租车和旅游优惠券 优惠券列表
parent
4deb65da
Changes
39
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
825 additions
and
300 deletions
+825
-300
Constance.java
MyFrame/src/main/java/com/frame/base/url/Constance.java
+2
-0
DateUtils.java
...utils/src/main/java/com/rv/component/utils/DateUtils.java
+11
-0
PostPatActivity.java
...c/main/java/com/xxfc/discovery/other/PostPatActivity.java
+5
-10
build.gradle
module_home/build.gradle
+1
-0
BaseLoginActivity.java
...n/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
+0
-1
ConfirmOrderActivity.java
.../rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
+101
-9
OrderDataBean.java
...om/rv/home/rv/module/ui/main/home/bean/OrderDataBean.java
+6
-6
rv_act_confim_order.xml
module_home/src/main/res/layout/rv_act_confim_order.xml
+2
-0
build.gradle
module_tourism/build.gradle
+2
-0
TravelerConfirmOrderActivity.java
...va/com/rv/tourism/other/TravelerConfirmOrderActivity.java
+99
-6
activity_confirm_order_travel.xml
...ism/src/main/res/layout/activity_confirm_order_travel.xml
+28
-0
build.gradle
plugin_coupon/build.gradle
+1
-0
CarCouponActivity.java
...upon/src/main/java/com/xxrv/coupon/CarCouponActivity.java
+34
-18
CarCouponAdapter.java
...c/main/java/com/xxrv/coupon/adapter/CarCouponAdapter.java
+26
-2
ExpiredCouponAdapter.java
...in/java/com/xxrv/coupon/adapter/ExpiredCouponAdapter.java
+15
-2
UsedCouponAdapter.java
.../main/java/com/xxrv/coupon/adapter/UsedCouponAdapter.java
+15
-2
WaitCouponAdapter.java
.../main/java/com/xxrv/coupon/adapter/WaitCouponAdapter.java
+16
-6
CouponApi.java
...n_coupon/src/main/java/com/xxrv/coupon/api/CouponApi.java
+9
-0
CouponBean.java
...coupon/src/main/java/com/xxrv/coupon/bean/CouponBean.java
+230
-0
WaitCouponBean.java
...on/src/main/java/com/xxrv/coupon/bean/WaitCouponBean.java
+0
-82
ExpiredCouponFragment.java
.../java/com/xxrv/coupon/fragment/ExpiredCouponFragment.java
+26
-42
UsedCouponFragment.java
...ain/java/com/xxrv/coupon/fragment/UsedCouponFragment.java
+18
-49
WaitCouponFragment.java
...ain/java/com/xxrv/coupon/fragment/WaitCouponFragment.java
+17
-42
CouponAllPresenter.java
...in/java/com/xxrv/coupon/presenter/CouponAllPresenter.java
+1
-1
icon_layout_select_coupon.png
...src/main/res/drawable-xhdpi/icon_layout_select_coupon.png
+0
-0
activity_car_coupon.xml
plugin_coupon/src/main/res/layout/activity_car_coupon.xml
+3
-11
rv_item_carcoupon.xml
plugin_coupon/src/main/res/layout/rv_item_carcoupon.xml
+20
-7
rv_item_expiredcoupon.xml
plugin_coupon/src/main/res/layout/rv_item_expiredcoupon.xml
+1
-1
rv_item_usedcoupon.xml
plugin_coupon/src/main/res/layout/rv_item_usedcoupon.xml
+1
-1
rv_item_waitcoupon.xml
plugin_coupon/src/main/res/layout/rv_item_waitcoupon.xml
+1
-1
.gitignore
plugin_wallet/.gitignore
+1
-0
build.gradle
plugin_wallet/build.gradle
+43
-0
proguard-rules.pro
plugin_wallet/proguard-rules.pro
+21
-0
AndroidManifest.xml
plugin_wallet/src/main/AndroidManifest.xml
+9
-0
WalletActivity.java
...rc/main/java/com/xxrv/wallet/activity/WalletActivity.java
+32
-0
WalletPresenter.java
.../main/java/com/xxrv/wallet/presenter/WalletPresenter.java
+14
-0
activity_wallet.xml
plugin_wallet/src/main/res/layout/activity_wallet.xml
+9
-0
strings.xml
plugin_wallet/src/main/res/values/strings.xml
+3
-0
settings.gradle
settings.gradle
+2
-1
No files found.
MyFrame/src/main/java/com/frame/base/url/Constance.java
View file @
e1d97c8e
...
...
@@ -45,4 +45,6 @@ public final class Constance {
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_CARCOUPON
=
"/xxrv/coupon/CarCouponActivity"
;
}
component_utils/src/main/java/com/rv/component/utils/DateUtils.java
View file @
e1d97c8e
...
...
@@ -178,6 +178,17 @@ public class DateUtils {
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
));
}
/**
* 获取手机当前时间戳毫秒
*
...
...
module_discovery/src/main/java/com/xxfc/discovery/other/PostPatActivity.java
View file @
e1d97c8e
...
...
@@ -28,17 +28,14 @@ import com.frame.base.bus.Observer;
import
com.frame.base.bus.RxBus
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.SPConstance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.util.LocationManager
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.util.glide.GlideManager
;
import
com.ruiwenliu.wrapper.util.permission.RxPermission
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.control.MyGridView
;
import
com.rv.component.control.SquareCenterImageView
;
import
com.rv.component.utils.DateUtils
;
import
com.rv.component.utils.Inc
;
import
com.xxfc.discovery.R
;
import
com.xxfc.discovery.R2
;
...
...
@@ -52,9 +49,6 @@ import com.xxfc.imcamera.photopicker.PhotoPickerActivity;
import
com.xxfc.imcamera.photopicker.SelectModel
;
import
com.xxfc.imcamera.photopicker.intent.PhotoPickerIntent
;
import
com.yuyife.okgo.OkGoUtil
;
import
org.json.JSONArray
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -152,9 +146,10 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
Map
<
String
,
Object
>
headMap
=
new
LinkedHashMap
<>();
if
(
OkGoUtil
.
getToken
()
!=
null
)
{
String
imToken
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPStringCode
(
SPConstance
.
USER_JSON
,
SPConstance
.
USER_JSON_IMTOKEN
);
// String imUserId = UtilsManager.getInstance(OkGoUtil.application).getSPStringCode(SPConstance.USER_JSON, SPConstance.USER_JSON_IMUSERID);
headMap
.
put
(
"Authorization"
,
imToken
);
// mPresenter.postData(DiscoveryApi.IMA_BASEUSRL,1, DiscoveryApi.DISCOVERY_MSG_ADD, BaseBean.class, map, headMap,true);
// headMap.put("Authorization", imToken);
// headMap.put("content-type ","application/json");
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"access_token"
,
OkGoUtil
.
getToken
());
...
...
@@ -175,9 +170,9 @@ public class PostPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
map
.
put
(
"cityId"
,
"0"
);
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
})
public
void
onViewClicked
(
View
view
)
{
int
id
=
view
.
getId
();
...
...
module_home/build.gradle
View file @
e1d97c8e
...
...
@@ -43,6 +43,7 @@ dependencies {
api
project
(
':component_control'
)
api
project
(
':plugin_search'
)
api
project
(
':plugin_calendar'
)
api
project
(
':plugin_coupon'
)
api
project
(
':RvWrapper'
)
// api project(':RvTravel')
annotationProcessor
'com.alibaba:arouter-compiler:1.1.4'
...
...
module_home/src/main/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
View file @
e1d97c8e
...
...
@@ -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_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_IMTOKEN
,
registeredBean
.
getData
().
getImToken
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_ISCERTIFICATIONSTATUS
,
registeredBean
.
getData
().
getCertificationStatus
()).
commit
();
Map
<
String
,
Object
>
headMap
=
new
LinkedHashMap
<>();
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
View file @
e1d97c8e
This diff is collapsed.
Click to expand it.
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/OrderDataBean.java
View file @
e1d97c8e
...
...
@@ -49,7 +49,7 @@ public class OrderDataBean implements Serializable{
// private int vehicleId;
private
int
damageSafe
;
//是否购买免赔 1--是 0--否
private
int
rentFreeDay
;
//是否使用出租免费天数 1--是 0--否
private
String
couponId
s
;
//优惠券ids,逗号分割
private
String
tickerNo
s
;
//优惠券ids,逗号分割
public
int
getDayNum
()
{
return
dayNum
;
...
...
@@ -181,12 +181,12 @@ public class OrderDataBean implements Serializable{
this
.
rentFreeDay
=
rentFreeDay
;
}
public
String
get
CouponId
s
()
{
return
couponId
s
;
public
String
get
TickerNo
s
()
{
return
tickerNo
s
;
}
public
void
set
CouponIds
(
String
couponId
s
)
{
this
.
couponIds
=
couponId
s
;
public
void
set
TickerNos
(
String
tickerNo
s
)
{
this
.
tickerNos
=
tickerNo
s
;
}
@Override
...
...
@@ -208,7 +208,7 @@ public class OrderDataBean implements Serializable{
", startTime="
+
startTime
+
", damageSafe="
+
damageSafe
+
", rentFreeDay="
+
rentFreeDay
+
", couponIds='"
+
couponId
s
+
'\''
+
", couponIds='"
+
tickerNo
s
+
'\''
+
'}'
;
}
}
module_home/src/main/res/layout/rv_act_confim_order.xml
View file @
e1d97c8e
...
...
@@ -711,6 +711,7 @@
<include
layout=
"@layout/common_line"
/>
<RelativeLayout
android:id=
"@+id/rl_item_select_coupon"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
>
...
...
@@ -723,6 +724,7 @@
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"
...
...
module_tourism/build.gradle
View file @
e1d97c8e
...
...
@@ -39,8 +39,10 @@ dependencies {
annotationProcessor
'com.jakewharton:butterknife-compiler:9.0.0-rc1'
annotationProcessor
'com.alibaba:arouter-compiler:1.1.4'
implementation
'com.github.zcweng:switch-button:0.0.3@aar'
implementation
'com.alibaba:fastjson:1.2.21'
api
project
(
':component_dialog'
)
api
project
(
':plugin_search'
)
api
project
(
':RvWrapper'
)
api
project
(
':component_control'
)
api
project
(
':plugin_coupon'
)
}
module_tourism/src/main/java/com/rv/tourism/other/TravelerConfirmOrderActivity.java
View file @
e1d97c8e
This diff is collapsed.
Click to expand it.
module_tourism/src/main/res/layout/activity_confirm_order_travel.xml
View file @
e1d97c8e
...
...
@@ -383,6 +383,34 @@
app:sb_show_indicator=
"false"
app:sb_uncheckcircle_color=
"@color/textLightGrey"
/>
</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
android:id=
"@+id/rl_item_notice"
...
...
plugin_coupon/build.gradle
View file @
e1d97c8e
...
...
@@ -37,6 +37,7 @@ dependencies {
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'
implementation
'com.alibaba:fastjson:1.2.21'
api
project
(
':RvWrapper'
)
api
project
(
':component_resource'
)
api
project
(
':component_utils'
)
...
...
plugin_coupon/src/main/java/com/xxrv/coupon/CarCouponActivity.java
View file @
e1d97c8e
package
com
.
xxrv
.
coupon
;
import
android.content.Intent
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.support.v7.widget.LinearLayoutManager
;
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.frame.base.url.Constance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
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.UsedCouponAdapter
;
import
com.xxrv.coupon.
bean.CouponBean
;
import
com.xxrv.coupon.presenter.CouponAllPresenter
;
import
java.util.List
;
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
)
RecyclerView
rvContent
;
@BindView
(
R2
.
id
.
refresh
)
SimpleRefreshLayout
mSimpleRefreshLayout
;
private
CarCouponAdapter
mAdapter
;
@Autowired
()
String
coupon
;
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_car_coupon
;
...
...
@@ -38,27 +45,36 @@ public class CarCouponActivity extends BaseStatusActivity<CouponAllPresenter>imp
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"优惠券"
);
mSimpleRefreshLayout
.
setHeaderView
(
new
SimpleRefreshView
(
mActivity
));
mSimpleRefreshLayout
.
setOnSimpleRefreshListener
(
this
);
mAdapter
=
new
CarCouponAdapter
();
rvContent
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
,
LinearLayoutManager
.
VERTICAL
,
false
));
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
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
public
void
on
LoadMoreRequested
(
)
{
public
void
on
ShowResult
(
int
requestType
,
BaseBean
result
)
{
}
@Override
public
void
onRefresh
()
{
private
void
processData
(
CouponBean
bean
)
{
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/adapter/CarCouponAdapter.java
View file @
e1d97c8e
...
...
@@ -2,20 +2,44 @@ package com.xxrv.coupon.adapter;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.rv.component.utils.DateUtils
;
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
()
{
super
(
R
.
layout
.
rv_item_carcoupon
);
}
@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
);
}
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/adapter/ExpiredCouponAdapter.java
View file @
e1d97c8e
...
...
@@ -2,20 +2,33 @@ package com.xxrv.coupon.adapter;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.rv.component.utils.DateUtils
;
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
()
{
super
(
R
.
layout
.
rv_item_expiredcoupon
);
}
@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
,
"无门槛"
);
}
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/adapter/UsedCouponAdapter.java
View file @
e1d97c8e
...
...
@@ -2,20 +2,33 @@ package com.xxrv.coupon.adapter;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.rv.component.utils.DateUtils
;
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
()
{
super
(
R
.
layout
.
rv_item_usedcoupon
);
}
@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
,
"无门槛"
);
}
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/adapter/WaitCouponAdapter.java
View file @
e1d97c8e
package
com
.
xxrv
.
coupon
.
adapter
;
import
android.widget.ImageView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.rv.component.utils.DateUtils
;
import
com.xxrv.coupon.R
;
import
com.xxrv.coupon.bean.
Wait
CouponBean
;
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
()
{
super
(
R
.
layout
.
rv_item_waitcoupon
);
}
@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
,
"无门槛"
);
}
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/api/
Search
Api.java
→
plugin_coupon/src/main/java/com/xxrv/coupon/api/
Coupon
Api.java
View file @
e1d97c8e
...
...
@@ -2,6 +2,8 @@ package com.xxrv.coupon.api;
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"
;
}
plugin_coupon/src/main/java/com/xxrv/coupon/bean/CouponBean.java
0 → 100644
View file @
e1d97c8e
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
;
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/bean/WaitCouponBean.java
deleted
100644 → 0
View file @
4deb65da
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
{
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/fragment/ExpiredCouponFragment.java
View file @
e1d97c8e
package
com
.
xxrv
.
coupon
.
fragment
;
import
android.os.Bundle
;
import
android.support.v7.widget.LinearLayoutManager
;
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.BaseFragment
;
import
com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
;
import
com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView
;
import
com.xxrv.coupon.R
;
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.yuyife.okgo.OkGoUtil
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
...
...
@@ -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
)
RecyclerView
rvContent
;
@BindView
(
R2
.
id
.
refresh
)
SimpleRefreshLayout
mSimpleRefreshLayout
;
private
int
countPage
;
private
int
mPage
;
private
ExpiredCouponAdapter
mAdapter
;
public
static
ExpiredCouponFragment
getInstance
(
int
type
)
{
Bundle
bundl
=
new
Bundle
();
...
...
@@ -48,64 +54,42 @@ public class ExpiredCouponFragment extends BaseFragment<CouponAllPresenter> impl
mSimpleRefreshLayout
.
setHeaderView
(
new
SimpleRefreshView
(
_mActivity
));
mSimpleRefreshLayout
.
setOnSimpleRefreshListener
(
this
);
mAdapter
=
new
ExpiredCouponAdapter
();
rvContent
.
setLayoutManager
(
new
LinearLayoutManager
(
_mActivity
,
LinearLayoutManager
.
VERTICAL
,
false
));
rvContent
.
setAdapter
(
mAdapter
);
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
)
{
onFresh
();
}
/**
* 刷新
*/
private
void
onFresh
()
{
mPage
=
1
;
geDataList
(
mPage
);
geDataList
();
}
/**
* 请求数据
*
* @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
.
put
(
"page"
,
page
);
map
.
put
(
"type"
,
2
);
// mPresenter.postData( 0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false);
map
.
put
(
"type"
,
"3"
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
0
,
CouponApi
.
HTTP_URL_COUPON_LIST
,
CouponBean
.
class
,
map
,
headMap
,
false
);
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
mSimpleRefreshLayout
.
onRefreshComplete
();
// processData((DiscoveryRecommend
Bean) result);
processData
((
Coupon
Bean
)
result
);
}
// private void processData(DiscoveryRecommendBean bean) {
// if (mPage == 1) {
// countPage = bean.getData().getTotalPage();
// 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);
// }
private
void
processData
(
CouponBean
bean
)
{
mAdapter
.
getData
().
clear
();
mAdapter
.
addData
(
bean
.
getData
());
}
@Override
public
void
onRefresh
()
{
onFresh
();
geDataList
();
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/fragment/UsedCouponFragment.java
View file @
e1d97c8e
...
...
@@ -5,6 +5,7 @@ import android.support.v7.widget.LinearLayoutManager;
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.BaseFragment
;
import
com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
;
...
...
@@ -13,7 +14,10 @@ import com.xxrv.coupon.R;
import
com.xxrv.coupon.R2
;
import
com.xxrv.coupon.adapter.UsedCouponAdapter
;
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.yuyife.okgo.OkGoUtil
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
...
...
@@ -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
)
RecyclerView
rvContent
;
...
...
@@ -32,8 +36,6 @@ public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> impleme
SimpleRefreshLayout
mSimpleRefreshLayout
;
UsedCouponAdapter
mAdapter
;
private
int
countPage
;
private
int
mPage
;
public
static
UsedCouponFragment
getInstance
(
int
type
)
{
Bundle
bundl
=
new
Bundle
();
...
...
@@ -58,73 +60,40 @@ public class UsedCouponFragment extends BaseFragment<CouponAllPresenter> impleme
rvContent
.
setLayoutManager
(
new
LinearLayoutManager
(
_mActivity
,
LinearLayoutManager
.
VERTICAL
,
false
));
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
protected
void
loadData
(
Bundle
savedInstanceState
)
{
onFresh
();
}
/**
* 刷新
*/
private
void
onFresh
()
{
mPage
=
1
;
geDataList
(
mPage
);
geDataList
();
}
/**
* 请求数据
*
* @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
.
put
(
"page"
,
page
);
map
.
put
(
"type"
,
2
);
// mPresenter.postData( 0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false);
map
.
put
(
"type"
,
"1"
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
0
,
CouponApi
.
HTTP_URL_COUPON_LIST
,
CouponBean
.
class
,
map
,
headMap
,
false
);
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
mSimpleRefreshLayout
.
onRefreshComplete
();
// processData((DiscoveryRecommend
Bean) result);
processData
((
Coupon
Bean
)
result
);
}
// private void processData(DiscoveryRecommendBean bean) {
// if (mPage == 1) {
// countPage = bean.getData().getTotalPage();
// 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);
// }
private
void
processData
(
CouponBean
bean
)
{
mAdapter
.
getData
().
clear
();
mAdapter
.
addData
(
bean
.
getData
());
}
@Override
public
void
onRefresh
()
{
onFresh
();
geDataList
();
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/fragment/WaitCouponFragment.java
View file @
e1d97c8e
...
...
@@ -2,7 +2,7 @@ package com.xxrv.coupon.fragment;
import
android.os.Bundle
;
import
android.support.v7.widget.LinearLayoutManager
;
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.BaseFragment
;
import
com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
;
...
...
@@ -10,8 +10,10 @@ import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import
com.xxrv.coupon.R
;
import
com.xxrv.coupon.R2
;
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.yuyife.okgo.OkGoUtil
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
...
...
@@ -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
)
RecyclerView
rvContent
;
...
...
@@ -30,8 +32,6 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme
WaitCouponAdapter
mAdapter
;
private
int
countPage
;
private
int
mPage
;
public
static
WaitCouponFragment
getInstance
(
int
type
)
{
Bundle
bundl
=
new
Bundle
();
...
...
@@ -59,59 +59,34 @@ public class WaitCouponFragment extends BaseFragment<CouponAllPresenter> impleme
@Override
protected
void
loadData
(
Bundle
savedInstanceState
)
{
onFresh
();
}
/**
* 刷新
*/
private
void
onFresh
()
{
mPage
=
1
;
geDataList
(
mPage
);
geDataList
();
}
/**
* 请求数据
*
* @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
.
put
(
"page"
,
page
);
map
.
put
(
"type"
,
2
);
// mPresenter.postData( 0, DiscoveryApi.DISCOVERY_UNAUTH_LIST, DiscoveryRecommendBean.class, map, page == 1 ? false : false);
map
.
put
(
"type"
,
"0"
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
0
,
CouponApi
.
HTTP_URL_COUPON_LIST
,
CouponBean
.
class
,
map
,
headMap
,
false
);
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
mSimpleRefreshLayout
.
onRefreshComplete
();
processData
((
WaitCouponBean
)
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
();
}
processData
((
CouponBean
)
result
);
}
@Override
public
void
onLoadMoreRequested
()
{
if
(
mPage
>=
countPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mPage
++;
geDataList
(
mPage
);
}
private
void
processData
(
CouponBean
bean
)
{
mAdapter
.
getData
().
clear
();
mAdapter
.
addData
(
bean
.
getData
());
}
@Override
public
void
onRefresh
()
{
onFresh
();
geDataList
();
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/presenter/CouponAllPresenter.java
View file @
e1d97c8e
...
...
@@ -9,6 +9,6 @@ public class CouponAllPresenter extends MvpPresenter {
* 域名地址
*/
public
String
getBaseUrl
()
{
return
RvFrameConfig
.
AUTH_P
OST
;
return
RvFrameConfig
.
H
OST
;
}
}
plugin_coupon/src/main/res/drawable-xhdpi/icon_layout_select_coupon.png
0 → 100644
View file @
e1d97c8e
2.99 KB
plugin_coupon/src/main/res/layout/activity_car_coupon.xml
View file @
e1d97c8e
...
...
@@ -5,16 +5,8 @@
android:background=
"@color/colorGrayBg"
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:id=
"@+id/rv_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
</android.support.v7.widget.RecyclerView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
android:layout_height=
"wrap_content"
></android.support.v7.widget.RecyclerView>
</LinearLayout>
plugin_coupon/src/main/res/layout/rv_item_carcoupon.xml
View file @
e1d97c8e
<?xml version="1.0" encoding="utf-8"?>
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/ll_item_rv_enthusiast"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -13,7 +13,7 @@
android:layout_marginLeft=
"@dimen/size_15"
android:layout_marginTop=
"@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"
>
<LinearLayout
...
...
@@ -61,6 +61,10 @@
android:orientation=
"horizontal"
android:paddingLeft=
"@dimen/size_10"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -84,7 +88,7 @@
android:layout_height=
"wrap_content"
android:text=
"9000"
android:textColor=
"@color/gray_F64747"
android:textSize=
"@dimen/text_3
8
"
android:textSize=
"@dimen/text_3
0
"
android:textStyle=
"bold"
/>
</LinearLayout>
...
...
@@ -97,15 +101,24 @@
android:textColor=
"@color/text_Gray"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
</LinearLayout>
<ImageView
android:id=
"@+id/iv_select"
android:layout_width=
"@dimen/size_20"
android:layout_height=
"@dimen/size_20"
android:layout_marginLeft=
"@dimen/size_30"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"@dimen/size_10"
android:layout_marginRight=
"@dimen/size_20"
android:layout_gravity=
"center_vertical|right"
android:src=
"@drawable/selector_rv_icon_mark"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<TextView
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
plugin_coupon/src/main/res/layout/rv_item_expiredcoupon.xml
View file @
e1d97c8e
...
...
@@ -83,7 +83,7 @@
android:layout_height=
"wrap_content"
android:text=
"9000"
android:textColor=
"@color/gray_F64747"
android:textSize=
"@dimen/text_3
8
"
android:textSize=
"@dimen/text_3
0
"
android:textStyle=
"bold"
/>
</LinearLayout>
...
...
plugin_coupon/src/main/res/layout/rv_item_usedcoupon.xml
View file @
e1d97c8e
...
...
@@ -83,7 +83,7 @@
android:layout_height=
"wrap_content"
android:text=
"9000"
android:textColor=
"@color/gray_F64747"
android:textSize=
"@dimen/text_3
8
"
android:textSize=
"@dimen/text_3
0
"
android:textStyle=
"bold"
/>
</LinearLayout>
...
...
plugin_coupon/src/main/res/layout/rv_item_waitcoupon.xml
View file @
e1d97c8e
...
...
@@ -83,7 +83,7 @@
android:layout_height=
"wrap_content"
android:text=
"9000"
android:textColor=
"@color/gray_F64747"
android:textSize=
"@dimen/text_3
8
"
android:textSize=
"@dimen/text_3
0
"
android:textStyle=
"bold"
/>
</LinearLayout>
...
...
plugin_wallet/.gitignore
0 → 100644
View file @
e1d97c8e
/build
plugin_wallet/build.gradle
0 → 100644
View file @
e1d97c8e
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'
)
}
plugin_wallet/proguard-rules.pro
0 → 100644
View file @
e1d97c8e
# 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
plugin_wallet/src/main/AndroidManifest.xml
0 → 100644
View file @
e1d97c8e
<?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
plugin_wallet/src/main/java/com/xxrv/wallet/activity/WalletActivity.java
0 → 100644
View file @
e1d97c8e
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
)
{
}
}
plugin_wallet/src/main/java/com/xxrv/wallet/presenter/WalletPresenter.java
0 → 100644
View file @
e1d97c8e
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
;
}
}
plugin_wallet/src/main/res/layout/activity_wallet.xml
0 → 100644
View file @
e1d97c8e
<?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
plugin_wallet/src/main/res/values/strings.xml
0 → 100644
View file @
e1d97c8e
<resources>
<string
name=
"app_name"
>
plugin_wallet
</string>
</resources>
settings.gradle
View file @
e1d97c8e
...
...
@@ -30,3 +30,4 @@ include ':plugin_coupon'
include
':plugin_share'
include
':plugin_points'
include
':plugin_imcamera'
include
':plugin_wallet'
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment