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
420f9e8f
Commit
420f9e8f
authored
Aug 10, 2019
by
linfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券修改、发布、bug修复和优化
parent
42f9ce5c
Changes
45
Show whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
1026 additions
and
154 deletions
+1026
-154
MultiItemBean.java
...c/main/java/com/ruiwenliu/wrapper/bean/MultiItemBean.java
+1
-1
TransformationUtil2.java
.../java/com/ruiwenliu/wrapper/util/TransformationUtil2.java
+35
-0
dimens.xml
RvWrapper/src/main/res/values/dimens.xml
+1
-0
shape_rv_bg_while_circle.xml
...source/src/main/res/drawable/shape_rv_bg_while_circle.xml
+5
-0
DateUtils.java
...utils/src/main/java/com/rv/component/utils/DateUtils.java
+17
-0
DiscoveryFragment.java
...y/src/main/java/com/xxfc/discovery/DiscoveryFragment.java
+11
-1
PatFragment.java
...rc/main/java/com/xxfc/discovery/fragment/PatFragment.java
+1
-1
RecommendFragment.java
...n/java/com/xxfc/discovery/fragment/RecommendFragment.java
+1
-1
DetailPatActivity.java
...main/java/com/xxfc/discovery/other/DetailPatActivity.java
+1
-1
fragment_pat.xml
module_discovery/src/main/res/layout/fragment_pat.xml
+5
-2
ApiConfig.java
...e_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
+3
-0
CarRentalListActivity.java
...rv/home/rv/module/ui/main/home/CarRentalListActivity.java
+1
-3
CityListActivity.java
.../com/rv/home/rv/module/ui/main/home/CityListActivity.java
+1
-2
ConfirmOrderActivity.java
.../rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
+24
-34
HomeFragment.java
...java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
+5
-5
AttributeListAdapter.java
.../rv/module/ui/main/home/adapter/AttributeListAdapter.java
+1
-3
CityListAdapter.java
.../home/rv/module/ui/main/home/adapter/CityListAdapter.java
+1
-1
HotCarTypeAdapter.java
...ome/rv/module/ui/main/home/adapter/HotCarTypeAdapter.java
+20
-2
CarAttributeListBean.java
...ome/rv/module/ui/main/home/bean/CarAttributeListBean.java
+1
-1
CityHeadBean.java
...com/rv/home/rv/module/ui/main/home/bean/CityHeadBean.java
+1
-1
HotCityBean.java
.../com/rv/home/rv/module/ui/main/home/bean/HotCityBean.java
+0
-3
HotCityListBean.java
.../rv/home/rv/module/ui/main/home/bean/HotCityListBean.java
+1
-1
ListsBean.java
...va/com/rv/home/rv/module/ui/main/home/bean/ListsBean.java
+1
-1
CompletedFragment.java
.../home/rv/module/ui/main/home/order/CompletedFragment.java
+1
-1
ForPaymentBean.java
...ome/rv/module/ui/main/home/order/bean/ForPaymentBean.java
+0
-1
fragment_home.xml
module_home/src/main/res/layout/fragment_home.xml
+1
-1
rv_item_hot_car_type.xml
module_home/src/main/res/layout/rv_item_hot_car_type.xml
+2
-2
build.gradle
module_mine/build.gradle
+3
-2
AndroidManifest.xml
module_mine/src/main/AndroidManifest.xml
+1
-1
MineFragment.java
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
+2
-1
MyReleasePatAdapter.java
.../main/java/com/rv/rvmine/adapter/MyReleasePatAdapter.java
+49
-0
MyReleaseActivity.java
...c/main/java/com/rv/rvmine/traveler/MyReleaseActivity.java
+206
-0
activity_my_release.xml
module_mine/src/main/res/layout/activity_my_release.xml
+26
-0
rv_item_rv_release_pat.xml
module_mine/src/main/res/layout/rv_item_rv_release_pat.xml
+58
-0
strings.xml
module_mine/src/main/res/values/strings.xml
+0
-1
TravelerConfirmOrderActivity.java
...va/com/rv/tourism/other/TravelerConfirmOrderActivity.java
+19
-18
CalendarActivity.java
...rc/main/java/com/rv/plugin/calendar/CalendarActivity.java
+13
-4
CarPurChaseListAdapter.java
.../com/xxrv/carpurchase/adapter/CarPurChaseListAdapter.java
+19
-1
rv_item_car_purchase_list.xml
...urchase/src/main/res/layout/rv_item_car_purchase_list.xml
+2
-2
CarCouponActivity.java
...upon/src/main/java/com/xxrv/coupon/CarCouponActivity.java
+79
-26
CarCouponAdapter.java
...c/main/java/com/xxrv/coupon/adapter/CarCouponAdapter.java
+53
-26
CouponApi.java
...n_coupon/src/main/java/com/xxrv/coupon/api/CouponApi.java
+2
-0
CarCouponBean.java
...pon/src/main/java/com/xxrv/coupon/bean/CarCouponBean.java
+292
-0
activity_car_coupon.xml
plugin_coupon/src/main/res/layout/activity_car_coupon.xml
+43
-3
rv_item_carcoupon_type_title.xml
...upon/src/main/res/layout/rv_item_carcoupon_type_title.xml
+17
-0
No files found.
module_home/src/main/java/com/rv/home/rv/module/basic
/bean/MultiItemBean.java
→
RvWrapper/src/main/java/com/ruiwenliu/wrapper
/bean/MultiItemBean.java
View file @
420f9e8f
package
com
.
r
v
.
home
.
rv
.
module
.
basic
.
bean
;
package
com
.
r
uiwenliu
.
wrapper
.
bean
;
import
com.chad.library.adapter.base.entity.MultiItemEntity
;
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/util/TransformationUtil2.java
0 → 100644
View file @
420f9e8f
package
com
.
ruiwenliu
.
wrapper
.
util
;
import
android.graphics.Bitmap
;
import
android.view.ViewGroup
;
import
android.widget.ImageView
;
import
com.bumptech.glide.request.target.ImageViewTarget
;
public
class
TransformationUtil2
extends
ImageViewTarget
<
Bitmap
>
{
private
ImageView
target
;
public
TransformationUtil2
(
ImageView
target
)
{
super
(
target
);
this
.
target
=
target
;
}
@Override
protected
void
setResource
(
Bitmap
resource
)
{
target
.
setImageBitmap
(
resource
);
if
(
resource
==
null
)
return
;
//获取原图的宽高
int
width
=
resource
.
getWidth
();
int
height
=
resource
.
getHeight
();
//获取imageView的宽
int
imageViewWidth
=
target
.
getWidth
();
int
imageViewHeight
=
(
int
)
(
imageViewWidth
*
0.75
);
ViewGroup
.
LayoutParams
params
=
target
.
getLayoutParams
();
params
.
height
=
imageViewHeight
;
target
.
setLayoutParams
(
params
);
}
}
\ No newline at end of file
RvWrapper/src/main/res/values/dimens.xml
View file @
420f9e8f
...
...
@@ -52,6 +52,7 @@
<dimen
name=
"size_240"
>
240dp
</dimen>
<dimen
name=
"size_245"
>
245dp
</dimen>
<dimen
name=
"size_250"
>
250dp
</dimen>
<dimen
name=
"size_430"
>
430dp
</dimen>
<dimen
name=
"size_500"
>
500dp
</dimen>
<dimen
name=
"size_535"
>
535dp
</dimen>
<dimen
name=
"size_550"
>
550dp
</dimen>
...
...
component_resource/src/main/res/drawable/shape_rv_bg_while_circle.xml
0 → 100644
View file @
420f9e8f
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"8dp"
/>
<solid
android:color=
"@color/colorWrite"
/>
</shape>
\ No newline at end of file
component_utils/src/main/java/com/rv/component/utils/DateUtils.java
View file @
420f9e8f
...
...
@@ -571,6 +571,23 @@ public class DateUtils {
return
day
;
}
/**
* 给时分减30分钟
*/
public
static
String
formatDate199
(
String
dateStr
)
{
String
day
=
""
;
try
{
long
time
=
sdf12
.
parse
(
dateStr
).
getTime
();
time
-=
30
*
60
*
1000
;
Date
da
=
new
Date
(
time
);
day
=
sdf12
.
format
(
da
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
day
;
}
/**
* 把时分转成毫秒
...
...
module_discovery/src/main/java/com/xxfc/discovery/DiscoveryFragment.java
View file @
420f9e8f
...
...
@@ -200,7 +200,17 @@ public class DiscoveryFragment extends BaseFragment<DiscoveryPresenter> {
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
iv_discovery_content_add
)
{
//添加
showPopupWindow
(
ivDiscoveryContentAdd
);
// showPopupWindow(ivDiscoveryContentAdd);
//判断是否已经登录
if
(
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_LOGINRV
).
navigation
();
return
;
}
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_POSTPAT
)
.
navigation
();
}
}
...
...
module_discovery/src/main/java/com/xxfc/discovery/fragment/PatFragment.java
View file @
420f9e8f
...
...
@@ -134,7 +134,7 @@ public class PatFragment extends BaseFragment<DiscoveryPresenter> implements Sim
itemDatabean
=
(
DiscoveryRecommendBean
.
DataBeanX
.
DataBean
)
adapter
.
getItem
(
position
);
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
ll_item_islike
)
{
isLike
();
//
isLike();
}
}
});
...
...
module_discovery/src/main/java/com/xxfc/discovery/fragment/RecommendFragment.java
View file @
420f9e8f
...
...
@@ -111,7 +111,7 @@ public class RecommendFragment extends BaseFragment<DiscoveryPresenter> implemen
public
void
onItemChildClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
ll_item_islike
){
showToast
(
"222222"
);
//
showToast("222222");
}
}
});
...
...
module_discovery/src/main/java/com/xxfc/discovery/other/DetailPatActivity.java
View file @
420f9e8f
...
...
@@ -112,7 +112,7 @@ public class DetailPatActivity extends BaseStatusActivity<DiscoveryPresenter> {
initWeb
();
if
(!
TextUtils
.
isEmpty
(
title
)
&&
!
TextUtils
.
isEmpty
(
iconUrl
))
{
initShare
(
webUrl
+
"&shareType=app"
,
title
,
""
,
iconUrl
);
initShare
(
webUrl
+
"&shareType=app"
,
title
,
"
【滴房车】开着房车去旅行,一样的旅途,不一样的精彩
"
,
iconUrl
);
}
}
...
...
module_discovery/src/main/res/layout/fragment_pat.xml
View file @
420f9e8f
...
...
@@ -7,7 +7,8 @@
android:orientation=
"vertical"
tools:context=
".fragment.PatFragment"
>
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<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"
>
...
...
@@ -16,7 +17,9 @@
<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>
android:layout_height=
"wrap_content"
>
</android.support.v7.widget.RecyclerView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
...
...
module_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
View file @
420f9e8f
...
...
@@ -125,4 +125,7 @@ public class ApiConfig {
//获取推荐消息列表
public
static
String
RVENTHUSIAST_HOTMSG_LIST
=
RvFrameConfig
.
HOST
+
"/api/im/msg/app/unauth/hotMsg/list"
;
//我的发布
public
static
String
RVENTHUSIAST_GETBYUSERID_LIST
=
RvFrameConfig
.
HOST
+
"/api/im/msg/getByUserId"
;
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/CarRentalListActivity.java
View file @
420f9e8f
...
...
@@ -8,7 +8,6 @@ import android.support.v4.content.ContextCompat;
import
android.support.v7.widget.GridLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
...
...
@@ -30,7 +29,7 @@ import com.rv.home.R;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.r
v.home.rv.module.basic
.bean.MultiItemBean
;
import
com.r
uiwenliu.wrapper
.bean.MultiItemBean
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.adapter.AttributeListAdapter
;
import
com.rv.home.rv.module.ui.main.home.adapter.CarRentalListAdapter
;
...
...
@@ -47,7 +46,6 @@ import java.util.List;
import
java.util.Map
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.OnClick
;
/**
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/CityListActivity.java
View file @
420f9e8f
...
...
@@ -28,7 +28,7 @@ import com.rv.component.utils.LogUtil;
import
com.rv.home.R
;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.r
v.home.rv.module.basic
.bean.MultiItemBean
;
import
com.r
uiwenliu.wrapper
.bean.MultiItemBean
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter
;
import
com.rv.home.rv.module.ui.main.home.bean.CityHeadBean
;
...
...
@@ -42,7 +42,6 @@ import java.io.IOException;
import
java.io.InputStreamReader
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.regex.Pattern
;
import
butterknife.BindView
;
import
io.reactivex.Flowable
;
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/ConfirmOrderActivity.java
View file @
420f9e8f
...
...
@@ -68,6 +68,7 @@ import com.tencent.mm.opensdk.modelpay.PayReq;
import
com.tencent.mm.opensdk.openapi.IWXAPI
;
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
;
import
com.xxrv.coupon.api.CouponApi
;
import
com.xxrv.coupon.bean.CarCouponBean
;
import
com.xxrv.coupon.bean.CouponBean
;
import
com.yuyife.okgo.OkGoUtil
;
...
...
@@ -175,7 +176,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
private
int
isMemberType
;
private
double
carAmount
;
//请求优惠券金额
private
double
oldCarAmount
;
//
private
List
<
C
ouponBean
.
DataBean
>
couponDataList
;
//优惠券数据
private
List
<
C
arCouponBean
.
DataBean
.
CarCouponType
DataBean
>
couponDataList
;
//优惠券数据
private
SelectedItemAdapter
mSelectedItemAdapter
;
...
...
@@ -186,6 +187,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
private
List
<
String
>
selectItemList
=
new
ArrayList
<>();
//随车物品
private
List
<
SelectItemBean
.
DataBean
>
selectItem
;
private
List
<
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
>
selectCouponList
=
null
;
public
static
Intent
getIntent
(
Context
context
,
OrderDataBean
bean
,
CarTypeListBean
.
DataBeanX
.
DataBean
carBean
,
String
startTime
,
String
endTime
)
{
return
new
Intent
(
context
,
ConfirmOrderActivity
.
class
)
...
...
@@ -209,6 +211,8 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
intiView
();
initRxBus
();
selectCouponList
=
new
ArrayList
<>();
// mSelectedItemAdapter = new SelectedItemAdapter();
// rvContentSelect.setLayoutManager(new LinearLayoutManager(this));
// rvContentSelect.setAdapter(mSelectedItemAdapter);
...
...
@@ -301,7 +305,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
aliPayData
((
OrderAliPayBean
)
result
);
break
;
case
4
:
C
ouponBean
couponBean
=
(
CouponBean
)
result
;
C
arCouponBean
couponBean
=
(
Car
CouponBean
)
result
;
couponData
(
couponBean
);
break
;
}
...
...
@@ -332,12 +336,8 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
getPayMoney
();
break
;
case
133
:
List
<
CouponBean
.
DataBean
>
selectCouponList
=
JSON
.
parseArray
(
data
.
getStringExtra
(
"selectCoupon"
),
CouponBean
.
DataBean
.
class
);
List
<
CouponBean
.
DataBean
>
resultCouponList
=
JSON
.
parseArray
(
data
.
getStringExtra
(
"resultCouponList"
),
CouponBean
.
DataBean
.
class
);
if
(
resultCouponList
!=
null
&&
resultCouponList
.
size
()
>
0
)
{
couponDataList
=
resultCouponList
;
}
selectCouponList
.
clear
();
selectCouponList
=
JSON
.
parseArray
(
data
.
getStringExtra
(
"selectCoupon"
),
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
.
class
);
couponIdList
.
clear
();
double
couponPrice
=
0
;
if
(
selectCouponList
!=
null
&&
selectCouponList
.
size
()
>
0
)
{
...
...
@@ -347,14 +347,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
}
}
couponAmount
=
couponPrice
;
tvCouponAmount
.
setText
(
"-¥"
+
couponAmount
);
// selectPosition = data.getIntExtra("position", 0);
// if (couponDataList != null && couponDataList.size() > 0) {
// dataBean.setTickerNos(couponDataList.get(selectPosition).getTickerNo());
// couponAmount = couponDataList.get(selectPosition).getUsedAmount();
//
// }
tvCouponAmount
.
setText
(
"-¥"
+
new
BigDecimal
(
couponAmount
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
getPayMoney
();
break
;
...
...
@@ -470,6 +463,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CARCOUPON
)
.
withSerializable
(
"coupon"
,
JSON
.
toJSONString
(
couponDataList
))
.
withSerializable
(
"selectCoupon"
,
JSON
.
toJSONString
(
selectCouponList
))
.
navigation
(
this
,
133
);
}
}
else
if
(
id
==
R
.
id
.
tv_item_caritem
)
{
...
...
@@ -594,24 +588,20 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
*
* @param couponBean
*/
private
void
couponData
(
CouponBean
couponBean
)
{
if
(
couponBean
.
getData
()
!=
null
&&
couponBean
.
getData
().
size
()
>
0
)
{
couponDataList
=
couponBean
.
getData
();
status
=
couponDataList
.
get
(
0
).
getStatus
();
if
(
"1"
.
equals
(
status
))
{
dataBean
.
setTickerNos
(
couponDataList
.
get
(
0
).
getTickerNo
());
couponAmount
=
couponDataList
.
get
(
0
).
getUsedAmount
();
tvCouponAmount
.
setText
(
"-¥"
+
couponDataList
.
get
(
0
).
getUsedAmount
());
couponDataList
.
get
(
0
).
setCheck
(
true
);
couponIdList
.
add
(
couponDataList
.
get
(
0
).
getTickerNo
());
getPayMoney
();
}
else
{
private
void
couponData
(
CarCouponBean
couponBean
)
{
if
(
couponBean
.
getData
()
!=
null
)
{
couponDataList
=
couponBean
.
getData
().
getArray
();
if
(
couponBean
.
getData
().
getCoupon
()
==
null
)
{
dataBean
.
setTickerNos
(
""
);
couponAmount
=
0
;
tvCouponAmount
.
setText
(
"暂无可用优惠券"
);
getPayMoney
();
}
else
{
selectCouponList
.
add
(
couponBean
.
getData
().
getCoupon
());
dataBean
.
setTickerNos
(
couponBean
.
getData
().
getCoupon
().
getTickerNo
());
couponAmount
=
couponBean
.
getData
().
getCoupon
().
getUsedAmount
();
tvCouponAmount
.
setText
(
"-¥"
+
couponBean
.
getData
().
getCoupon
().
getUsedAmount
());
getPayMoney
();
}
}
else
{
dataBean
.
setTickerNos
(
""
);
...
...
@@ -624,10 +614,10 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
* 初始化View
*/
private
void
intiView
()
{
String
icon
=
""
;
if
(!
TextUtils
.
isEmpty
(
mCarBean
.
getVehicleModel
().
getCoverPic
())){
String
icon
=
""
;
if
(!
TextUtils
.
isEmpty
(
mCarBean
.
getVehicleModel
().
getCoverPic
()))
{
icon
=
mCarBean
.
getVehicleModel
().
getCoverPic
();
}
else
{
}
else
{
icon
=
mCarBean
.
getVehicleModel
().
getIcon
();
}
GlideManager
.
getInstance
(
mActivity
).
loadImage
(
icon
,
ivGoods
);
...
...
@@ -772,7 +762,7 @@ public class ConfirmOrderActivity extends BaseStatusActivity<CommonPresenter> {
map
.
put
(
"type"
,
0
);
map
.
put
(
"channel"
,
"1"
);
map
.
put
(
"amount"
,
carAmount
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
4
,
CouponApi
.
HTTP_URL_COUPON_
LIST
,
CouponBean
.
class
,
map
,
headMap
,
false
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
4
,
CouponApi
.
HTTP_URL_COUPON_
TYPELIST
,
Car
CouponBean
.
class
,
map
,
headMap
,
false
);
}
private
String
getContent
(
String
name
,
String
card
)
{
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
View file @
420f9e8f
...
...
@@ -388,7 +388,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
.
withString
(
"longitude"
,
data
.
getLongitude
())
.
withString
(
"latitude"
,
data
.
getLatitude
())
.
navigation
();
}
else
if
(
"
1
"
.
equals
(
hotType
))
{
}
else
if
(
"
4
"
.
equals
(
hotType
))
{
//优质车型
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_DETAILCARPURCHASE
)
...
...
@@ -449,7 +449,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
@Override
public
void
onRefresh
()
{
hotData
();
recommendGood
(
"2"
);
recommendGood
(
hotType
);
onFreshLoadDisCovery
();
}
...
...
@@ -536,7 +536,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
protected
void
loadData
(
Bundle
savedInstanceState
)
{
loadBannerData
();
hotData
();
recommendGood
(
"2"
);
recommendGood
(
hotType
);
onFreshLoadDisCovery
();
}
...
...
@@ -847,7 +847,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
mAdapter
.
getData
().
clear
();
mAdapter
.
notifyDataSetChanged
();
recommendGood
(
"4"
);
hotType
=
"
1
"
;
hotType
=
"
4
"
;
}
else
if
(
id
==
R
.
id
.
tv_see_more_popular
)
{
//查看更多热门
...
...
@@ -859,7 +859,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
//娱乐营地
SwitchFragment
.
sChangeFragment
.
changge
(
2
);
}
else
if
(
"
1
"
.
equals
(
hotType
))
{
}
else
if
(
"
4
"
.
equals
(
hotType
))
{
//优质车型
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CARPURCHASELIST
)
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/AttributeListAdapter.java
View file @
420f9e8f
...
...
@@ -5,8 +5,7 @@ import android.support.v4.content.ContextCompat;
import
com.chad.library.adapter.base.BaseMultiItemQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.basic.bean.MultiItemBean
;
import
com.ruiwenliu.wrapper.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.bean.CarAttributeListBean
;
import
java.util.List
;
...
...
@@ -65,7 +64,6 @@ public class AttributeListAdapter extends BaseMultiItemQuickAdapter<MultiItemBea
getData
().
set
(
position
,
bean
);
notifyItemChanged
(
position
);
}
}
/**
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/CityListAdapter.java
View file @
420f9e8f
...
...
@@ -9,7 +9,7 @@ import android.widget.TextView;
import
com.chad.library.adapter.base.BaseMultiItemQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.rv.home.R
;
import
com.r
v.home.rv.module.basic
.bean.MultiItemBean
;
import
com.r
uiwenliu.wrapper
.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.bean.CityHeadBean
;
import
com.rv.home.rv.module.ui.main.home.bean.HotCityBean
;
import
com.rv.home.rv.module.ui.main.home.bean.HotCityListBean
;
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/HotCarTypeAdapter.java
View file @
420f9e8f
...
...
@@ -4,8 +4,14 @@ import android.text.TextUtils;
import
android.widget.ImageView
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.ruiwenliu.wrapper.util.BaseGlideHolder
;
import
com.ruiwenliu.wrapper.util.TransformationUtil
;
import
com.ruiwenliu.wrapper.util.TransformationUtil2
;
import
com.ruiwenliu.wrapper.util.glide.GlideOptions
;
import
com.rv.home.R
;
import
com.rv.home.rv.module.ui.main.home.bean.HomeHotGoodListBean
;
import
com.rv.home.rv.module.ui.main.home.bean.HomePopularBrigade
;
...
...
@@ -26,7 +32,19 @@ public class HotCarTypeAdapter extends BaseQuickAdapter<HomeHotGoodListBean.Data
@Override
protected
void
convert
(
BaseGlideHolder
helper
,
HomeHotGoodListBean
.
DataBean
bean
)
{
helper
.
loadRoundImage
(
mContext
,
bean
.
getIcon
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
6
);
// helper.loadRoundImage(mContext,bean.getIcon(), (ImageView) helper.getView(R.id.iv_goods),6);
ImageView
image
=
helper
.
getView
(
R
.
id
.
iv_goods
);
GlideOptions
options
=
GlideOptions
.
placeholderOf
(
com
.
ruiwenliu
.
wrapper
.
R
.
drawable
.
glide_icon_placeholder
).
error
(
com
.
ruiwenliu
.
wrapper
.
R
.
drawable
.
glide_icon_error
);
TransformationUtil2
utils
=
new
TransformationUtil2
(
image
);
Glide
.
with
(
mContext
)
.
asBitmap
()
.
load
(
bean
.
getIcon
())
.
apply
(
options
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
12
)).
override
(
image
.
getWidth
(),
image
.
getHeight
()))
.
into
(
utils
);
helper
.
setText
(
R
.
id
.
tv_name
,
bean
.
getName
());
helper
.
setText
(
R
.
id
.
tv_content
,
bean
.
getName1
());
if
(!
TextUtil
.
isEmpty
(
bean
.
getPrice
()))
{
...
...
@@ -43,7 +61,7 @@ public class HotCarTypeAdapter extends BaseQuickAdapter<HomeHotGoodListBean.Data
private
String
getUnit
()
{
if
(!
TextUtils
.
isEmpty
(
hotType
))
{
switch
(
hotType
)
{
case
"
1
"
:
case
"
4
"
:
return
mContext
.
getString
(
R
.
string
.
rv_one_car
);
case
"2"
:
return
mContext
.
getString
(
R
.
string
.
rv_one_person
);
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/CarAttributeListBean.java
View file @
420f9e8f
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.r
v.home.rv.module.basic
.bean.MultiItemBean
;
import
com.r
uiwenliu.wrapper
.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.adapter.AttributeListAdapter
;
import
java.util.List
;
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/CityHeadBean.java
View file @
420f9e8f
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
bean
;
import
com.r
v.home.rv.module.basic
.bean.MultiItemBean
;
import
com.r
uiwenliu.wrapper
.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter
;
/**
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/HotCityBean.java
View file @
420f9e8f
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
bean
;
import
com.rv.home.rv.module.basic.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter
;
/**
* Created :Auser
* Date: 2019/5/11.
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/HotCityListBean.java
View file @
420f9e8f
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
bean
;
import
com.r
v.home.rv.module.basic
.bean.MultiItemBean
;
import
com.r
uiwenliu.wrapper
.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter
;
import
java.util.List
;
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/ListsBean.java
View file @
420f9e8f
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
bean
;
import
com.r
v.home.rv.module.basic
.bean.MultiItemBean
;
import
com.r
uiwenliu.wrapper
.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter
;
/**
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/CompletedFragment.java
View file @
420f9e8f
...
...
@@ -157,7 +157,7 @@ public class CompletedFragment extends BaseFragment<CommonPresenter> implements
Map
<
String
,
Object
>
mapData
=
new
LinkedHashMap
<>();
mapData
.
put
(
"page"
,
page
);
mapData
.
put
(
"limit"
,
10
);
mapData
.
put
(
"
status"
,
6
);
mapData
.
put
(
"
multiStatus"
,
"6,7"
);
mPresenter
.
getData
(
RvFrameConfig
.
VEHICLE_ORDER
,
0
,
ApiConfig
.
HTTP_URL_ORDER_LIST
,
OrderListBean
.
class
,
mapData
,
headMap
,
page
==
1
?
true
:
false
);
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/order/bean/ForPaymentBean.java
View file @
420f9e8f
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
order
.
bean
;
import
com.chad.library.adapter.base.entity.MultiItemEntity
;
import
com.rv.home.rv.module.basic.bean.MultiItemBean
;
import
com.rv.home.rv.module.ui.main.home.order.adapter.OrderListAdapter
;
/**
...
...
module_home/src/main/res/layout/fragment_home.xml
View file @
420f9e8f
...
...
@@ -560,7 +560,7 @@
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView_content"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_
535
"
android:layout_height=
"@dimen/size_
430
"
android:layout_marginTop=
"@dimen/size_10"
android:paddingLeft=
"@dimen/size_10"
android:paddingRight=
"@dimen/size_10"
/>
...
...
module_home/src/main/res/layout/rv_item_hot_car_type.xml
View file @
420f9e8f
...
...
@@ -12,8 +12,8 @@
<ImageView
android:id=
"@+id/iv_goods"
android:layout_width=
"match_parent"
android:layout_height=
"
@dimen/size_180
"
android:scaleType=
"
centerCrop"
/>
android:layout_height=
"
wrap_content
"
android:scaleType=
"
fitXY"
/>
<TextView
android:id=
"@+id/tv_name"
...
...
module_mine/build.gradle
View file @
420f9e8f
...
...
@@ -16,9 +16,10 @@ android {
annotationProcessorOptions
{
arguments
=
[
moduleName
:
project
.
getName
()
]
arguments
=
[
moduleName
:
project
.
getName
()
]
}
}
}
}
}
...
...
module_mine/src/main/AndroidManifest.xml
View file @
420f9e8f
...
...
@@ -3,7 +3,7 @@
package=
"com.rv.rvmine"
>
<application>
<activity
android:name=
".traveler.MyReleaseActivity"
></activity>
<activity
android:name=
"com.rv.version.activity.UpdateAppActivity"
/>
</application>
...
...
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
View file @
420f9e8f
...
...
@@ -55,6 +55,7 @@ import com.rv.rvmine.personal.IDCardCertificationActivity;
import
com.rv.rvmine.rxbusevent.UserInfoEvent
;
import
com.rv.rvmine.traveler.ChooseAVisitorActivity
;
import
com.rv.rvmine.traveler.CollectionActivity
;
import
com.rv.rvmine.traveler.MyReleaseActivity
;
import
com.rv.rvmine.traveler.PersonalInformationActivity
;
import
com.rv.rvmine.traveler.SettingActivity
;
import
com.rv.share.ShareActivity
;
...
...
@@ -333,7 +334,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
}
else
if
(
id
==
R
.
id
.
rl_item_my_release
)
{
//我的发布
if
(
isLogin
())
return
;
s
howToast
(
"该功能还在开发中。。。"
);
s
tartActivity
(
MyReleaseActivity
.
getIntent
(
_mActivity
)
);
}
else
if
(
id
==
R
.
id
.
rl_item_collection
)
{
//收藏
...
...
module_mine/src/main/java/com/rv/rvmine/adapter/MyReleasePatAdapter.java
0 → 100644
View file @
420f9e8f
package
com
.
rv
.
rvmine
.
adapter
;
import
android.widget.ImageView
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.ruiwenliu.wrapper.util.BaseGlideHolder
;
import
com.ruiwenliu.wrapper.util.TransformationUtil
;
import
com.ruiwenliu.wrapper.util.glide.GlideOptions
;
import
com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean
;
import
com.rv.rvmine.R
;
public
class
MyReleasePatAdapter
extends
BaseQuickAdapter
<
HomeRecommendBean
.
DataBeanX
.
DataBean
,
BaseGlideHolder
>
{
public
MyReleasePatAdapter
()
{
super
(
R
.
layout
.
rv_item_rv_release_pat
);
}
@Override
protected
void
convert
(
BaseGlideHolder
helper
,
HomeRecommendBean
.
DataBeanX
.
DataBean
item
)
{
HomeRecommendBean
.
DataBeanX
.
DataBean
.
Body
body
=
item
.
getBody
();
if
(
body
!=
null
)
{
if
(
body
.
getImages
()
!=
null
&&
body
.
getImages
().
size
()
>
0
)
{
// GlideManager.getInstance(mContext).loadRoundImage2(body.getImages().get(0).getOurl(), (ImageView) helper.getView(R.id.iv_icon_pat),8);
ImageView
image
=
helper
.
getView
(
R
.
id
.
iv_icon_pat
);
GlideOptions
options
=
GlideOptions
.
placeholderOf
(
com
.
ruiwenliu
.
wrapper
.
R
.
drawable
.
glide_icon_placeholder
).
error
(
com
.
ruiwenliu
.
wrapper
.
R
.
drawable
.
glide_icon_error
);
TransformationUtil
utils
=
new
TransformationUtil
(
image
);
Glide
.
with
(
mContext
)
.
asBitmap
()
.
load
(
body
.
getImages
().
get
(
0
).
getOurl
())
.
apply
(
options
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
12
)).
override
(
image
.
getWidth
(),
image
.
getHeight
()))
.
into
(
utils
);
}
helper
.
setText
(
R
.
id
.
tv_title
,
body
.
getText
());
if
(
"4"
.
equals
(
body
.
getType
()))
{
//消息类型 基础属性 1=文字消息、2=图文消息、3=语音消息、4=视频消息、 5=文件消
helper
.
setGone
(
R
.
id
.
iv_isvideo
,
true
);
}
else
{
helper
.
setGone
(
R
.
id
.
iv_isvideo
,
false
);
}
}
}
}
module_mine/src/main/java/com/rv/rvmine/traveler/MyReleaseActivity.java
0 → 100644
View file @
420f9e8f
package
com
.
rv
.
rvmine
.
traveler
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Rect
;
import
android.os.Bundle
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.StaggeredGridLayoutManager
;
import
android.view.View
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
;
import
com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean
;
import
com.rv.rvmine.R
;
import
com.rv.rvmine.R2
;
import
com.rv.rvmine.adapter.MyReleasePatAdapter
;
import
com.yuyife.okgo.OkGoUtil
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
/**
* 我的发布
*/
public
class
MyReleaseActivity
extends
BaseStatusActivity
<
CommonPresenter
>
implements
SimpleRefreshLayout
.
OnSimpleRefreshListener
{
@BindView
(
R2
.
id
.
rv_content
)
RecyclerView
rvContent
;
@BindView
(
R2
.
id
.
refresh
)
SimpleRefreshLayout
mSimpleRefreshLayout
;
private
int
countPage
;
private
int
mPage
;
private
MyReleasePatAdapter
mAdapter
;
public
static
Intent
getIntent
(
Context
context
)
{
return
new
Intent
(
context
,
MyReleaseActivity
.
class
);
}
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_my_release
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"我的发布"
);
mSimpleRefreshLayout
.
setHeaderView
(
new
SimpleRefreshView
(
mActivity
));
mSimpleRefreshLayout
.
setOnSimpleRefreshListener
(
this
);
mAdapter
=
new
MyReleasePatAdapter
();
final
StaggeredGridLayoutManager
staggeredGridLayoutManager
=
new
StaggeredGridLayoutManager
(
2
,
StaggeredGridLayoutManager
.
VERTICAL
);
rvContent
.
setItemAnimator
(
null
);
rvContent
.
addOnScrollListener
(
new
RecyclerView
.
OnScrollListener
()
{
@Override
public
void
onScrollStateChanged
(
RecyclerView
recyclerView
,
int
newState
)
{
super
.
onScrollStateChanged
(
recyclerView
,
newState
);
int
[]
first
=
new
int
[
2
];
staggeredGridLayoutManager
.
findFirstCompletelyVisibleItemPositions
(
first
);
if
(
newState
==
RecyclerView
.
SCROLL_STATE_IDLE
&&
(
first
[
0
]
==
1
||
first
[
1
]
==
1
))
{
recyclerView
.
invalidateItemDecorations
();
}
}
});
rvContent
.
setLayoutManager
(
staggeredGridLayoutManager
);
rvContent
.
addItemDecoration
(
new
AbSpacesItemDecoration
(
20
,
10
));
// 分割线。
rvContent
.
setAdapter
(
mAdapter
);
mAdapter
.
bindToRecyclerView
(
rvContent
);
mAdapter
.
setEnableLoadMore
(
true
);
mAdapter
.
disableLoadMoreIfNotFullPage
();
mAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
HomeRecommendBean
.
DataBeanX
.
DataBean
item
=
(
HomeRecommendBean
.
DataBeanX
.
DataBean
)
adapter
.
getItem
(
position
);
if
(
item
!=
null
)
{
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_DETAILPAT
)
.
withString
(
"id"
,
item
.
getMsgId
())
.
withString
(
"title"
,
item
.
getBody
().
getText
())
.
withString
(
"iconUrl"
,
item
.
getBody
().
getImages
().
get
(
0
).
getOurl
())
.
navigation
();
}
}
});
mAdapter
.
setOnLoadMoreListener
(
new
BaseQuickAdapter
.
RequestLoadMoreListener
()
{
@Override
public
void
onLoadMoreRequested
()
{
if
(
rvContent
!=
null
)
{
rvContent
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
mPage
>=
countPage
)
{
mAdapter
.
loadMoreEnd
();
}
else
{
mPage
++;
geDataList
(
mPage
);
}
}
},
200
);
}
}
},
rvContent
);
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
,
Intent
intent
)
{
super
.
loadData
(
savedInstanceState
,
intent
);
onFresh
();
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
mSimpleRefreshLayout
.
onRefreshComplete
();
switch
(
requestType
)
{
case
0
:
processData
((
HomeRecommendBean
)
result
);
break
;
}
}
private
void
processData
(
HomeRecommendBean
bean
)
{
if
(
mPage
==
1
)
{
countPage
=
bean
.
getData
().
getPageSize
();
mAdapter
.
setNewData
(
bean
.
getData
().
getList
());
if
(
bean
.
getData
().
getTotalCount
()
==
0
)
{
mAdapter
.
setEmptyView
(
getEmptyView
(
rvContent
,
-
1
,
"暂无发布的数据"
));
mAdapter
.
notifyDataSetChanged
();
}
}
else
{
mAdapter
.
addData
(
bean
.
getData
().
getList
());
mAdapter
.
loadMoreComplete
();
}
}
@Override
public
void
onRefresh
()
{
onFresh
();
}
/**
* 刷新
*/
private
void
onFresh
()
{
mPage
=
1
;
geDataList
(
mPage
);
}
/**
* 请求数据
*
* @param page
*/
private
void
geDataList
(
int
page
)
{
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
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
0
,
ApiConfig
.
RVENTHUSIAST_GETBYUSERID_LIST
,
HomeRecommendBean
.
class
,
map
,
headMap
,
page
==
1
?
true
:
false
);
}
public
class
AbSpacesItemDecoration
extends
RecyclerView
.
ItemDecoration
{
private
int
left
;
private
int
right
;
public
AbSpacesItemDecoration
(
int
left
,
int
right
)
{
this
.
left
=
left
;
this
.
right
=
right
;
}
@Override
public
void
getItemOffsets
(
Rect
outRect
,
View
view
,
RecyclerView
parent
,
RecyclerView
.
State
state
)
{
int
position
=
parent
.
getChildAdapterPosition
(
view
);
StaggeredGridLayoutManager
.
LayoutParams
lp
=
(
StaggeredGridLayoutManager
.
LayoutParams
)
view
.
getLayoutParams
();
if
(
lp
.
getSpanIndex
()
%
2
==
0
)
{
outRect
.
left
=
left
;
outRect
.
right
=
right
;
}
else
{
outRect
.
left
=
right
;
outRect
.
right
=
left
;
}
outRect
.
top
=
left
;
}
}
}
module_mine/src/main/res/layout/activity_my_release.xml
0 → 100644
View file @
420f9e8f
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/gray_f5f5f5"
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>
</LinearLayout>
\ No newline at end of file
module_mine/src/main/res/layout/rv_item_rv_release_pat.xml
0 → 100644
View file @
420f9e8f
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/iv_icon_pat"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<ImageView
android:id=
"@+id/iv_isvideo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:src=
"@drawable/icon_fragment_video_hint"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:paddingLeft=
"@dimen/size_5"
android:paddingRight=
"@dimen/size_5"
android:maxLines=
"2"
android:ellipsize=
"end"
android:text=
"行摄川西邂逅生命中未知的精彩"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_14"
/>
<TextView
android:id=
"@+id/tv_address"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:layout_marginBottom=
"@dimen/size_10"
android:paddingLeft=
"@dimen/size_5"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_12"
android:text=
"2222222"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
module_mine/src/main/res/values/strings.xml
View file @
420f9e8f
...
...
@@ -42,5 +42,4 @@
<string
name=
"tv_open_membership"
>
立即开通普通会员
</string>
</resources>
module_tourism/src/main/java/com/rv/tourism/other/TravelerConfirmOrderActivity.java
View file @
420f9e8f
...
...
@@ -61,6 +61,7 @@ import com.tencent.mm.opensdk.modelpay.PayReq;
import
com.tencent.mm.opensdk.openapi.IWXAPI
;
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
;
import
com.xxrv.coupon.api.CouponApi
;
import
com.xxrv.coupon.bean.CarCouponBean
;
import
com.xxrv.coupon.bean.CouponBean
;
import
com.yuyife.okgo.OkGoUtil
;
...
...
@@ -136,7 +137,8 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
private
BeanConfirmOrder
info
;
private
int
payType
=
1
;
//选择支付类型
private
List
<
CouponBean
.
DataBean
>
couponDataList
;
//优惠券数据
private
List
<
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
>
couponDataList
;
//优惠券数据
private
List
<
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
>
selectCouponList
=
null
;
private
double
couponAmount
=
0
;
//优惠券金额
private
String
status
=
"1"
;
// 优惠券状态
...
...
@@ -159,6 +161,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
titleView
.
setTitle
(
"确认订单"
);
api
=
WXAPIFactory
.
createWXAPI
(
this
,
RvFrameConfig
.
APP_ID
);
dataBean
=
(
BeanOrderParam
)
intent
.
getSerializableExtra
(
"dataBean"
);
selectCouponList
=
new
ArrayList
<>();
if
(
dataBean
!=
null
)
{
tvCompany
.
setText
(
dataBean
.
getStartCompanyName
());
tvSetoffCompanyAddress
.
setText
(
dataBean
.
getStartAddr
());
...
...
@@ -299,7 +302,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
setData
((
BeanConfirmOrder
)
result
);
break
;
case
4
:
C
ouponBean
couponBean
=
(
CouponBean
)
result
;
C
arCouponBean
couponBean
=
(
Car
CouponBean
)
result
;
couponData
(
couponBean
);
break
;
}
...
...
@@ -310,15 +313,14 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
*
* @param couponBean
*/
private
void
couponData
(
CouponBean
couponBean
)
{
if
(
couponBean
.
getData
()
!=
null
&&
couponBean
.
getData
().
size
()
>
0
)
{
couponDataList
=
couponBean
.
getData
();
status
=
couponDataList
.
get
(
0
).
getStatus
();
if
(
"1"
.
equals
(
status
))
{
couponAmount
=
couponDataList
.
get
(
0
).
getUsedAmount
();
tvCouponAmount
.
setText
(
"-¥"
+
couponDataList
.
get
(
0
).
getUsedAmount
());
couponDataList
.
get
(
0
).
setCheck
(
true
);
couponIdList
.
add
(
couponDataList
.
get
(
0
).
getTickerNo
());
private
void
couponData
(
CarCouponBean
couponBean
)
{
if
(
couponBean
.
getData
()
!=
null
)
{
couponDataList
=
couponBean
.
getData
().
getArray
();
if
(
couponBean
.
getData
().
getCoupon
()
!=
null
)
{
selectCouponList
.
add
(
couponBean
.
getData
().
getCoupon
());
couponAmount
=
couponBean
.
getData
().
getCoupon
().
getUsedAmount
();
tvCouponAmount
.
setText
(
"-¥"
+
couponBean
.
getData
().
getCoupon
().
getUsedAmount
());
couponIdList
.
add
(
couponBean
.
getData
().
getCoupon
().
getTickerNo
());
getPayMoney
();
}
else
{
tvCouponAmount
.
setText
(
"暂无优惠券"
);
...
...
@@ -414,6 +416,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CARCOUPON
)
.
withSerializable
(
"coupon"
,
JSON
.
toJSONString
(
couponDataList
))
.
withSerializable
(
"selectCoupon"
,
JSON
.
toJSONString
(
selectCouponList
))
.
navigation
(
this
,
134
);
}
}
...
...
@@ -430,7 +433,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
map
.
put
(
"type"
,
0
);
map
.
put
(
"channel"
,
"2"
);
map
.
put
(
"amount"
,
price
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
4
,
CouponApi
.
HTTP_URL_COUPON_
LIST
,
CouponBean
.
class
,
map
,
headMap
,
false
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
4
,
CouponApi
.
HTTP_URL_COUPON_
TYPELIST
,
Car
CouponBean
.
class
,
map
,
headMap
,
false
);
}
...
...
@@ -553,11 +556,9 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
}
mVisitorInformationAdapter
.
notifyDataSetChanged
();
}
else
if
(
134
==
requestCode
&&
resultCode
==
RESULT_OK
)
{
List
<
CouponBean
.
DataBean
>
selectCouponList
=
JSON
.
parseArray
(
data
.
getStringExtra
(
"selectCoupon"
),
CouponBean
.
DataBean
.
class
);
List
<
CouponBean
.
DataBean
>
resultCouponList
=
JSON
.
parseArray
(
data
.
getStringExtra
(
"resultCouponList"
),
CouponBean
.
DataBean
.
class
);
if
(
resultCouponList
!=
null
&&
resultCouponList
.
size
()
>
0
)
{
couponDataList
=
resultCouponList
;
}
selectCouponList
.
clear
();
selectCouponList
=
JSON
.
parseArray
(
data
.
getStringExtra
(
"selectCoupon"
),
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
.
class
);
couponIdList
.
clear
();
double
couponPrice
=
0
;
if
(
selectCouponList
!=
null
&&
selectCouponList
.
size
()
>
0
)
{
...
...
@@ -567,7 +568,7 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
}
}
couponAmount
=
couponPrice
;
tvCouponAmount
.
setText
(
"-¥"
+
couponAmount
);
tvCouponAmount
.
setText
(
"-¥"
+
new
BigDecimal
(
couponAmount
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
()
);
getPayMoney
();
}
}
...
...
plugin_calendar/src/main/java/com/rv/plugin/calendar/CalendarActivity.java
View file @
420f9e8f
...
...
@@ -152,7 +152,7 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
@Override
public
void
onSelected
(
int
selectedIndex
,
String
item
)
{
if
(
s_begDate
.
equals
(
s_endDate
)
&&
DateUtils
.
formatDate20
(
s_endTime
)
<=
DateUtils
.
formatDate20
(
s_begTime
))
{
if
(
s_begDate
.
equals
(
s_endDate
)
&&
DateUtils
.
formatDate20
(
item
)
<=
DateUtils
.
formatDate20
(
s_begTime
))
{
s_endTime
=
DateUtils
.
formatDate19
(
s_begTime
);
wheelViewRight
.
setSeletion
(
begSelected
);
endSelected
=
begSelected
;
...
...
@@ -168,17 +168,21 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
if
(
timeList
!=
null
)
{
for
(
int
i
=
0
;
i
<
timeList
.
size
();
i
++)
{
if
(
timeList
.
get
(
i
).
equals
(
begTime
))
{
begSelected
=
i
;
wheelViewLeft
.
setSeletion
(
i
);
s_begTime
=
begTime
;
}
else
if
(
timeList
.
get
(
i
).
equals
(
"08:00"
))
{
begSelected
=
i
;
wheelViewLeft
.
setSeletion
(
i
);
s_begTime
=
"08:00"
;
}
if
(
timeList
.
get
(
i
).
equals
(
endTime
))
{
endSelected
=
i
;
wheelViewRight
.
setSeletion
(
i
);
s_endTime
=
endTime
;
}
else
if
(
timeList
.
get
(
i
).
equals
(
"18:00"
))
{
endSelected
=
i
;
wheelViewRight
.
setSeletion
(
i
);
s_endTime
=
"18:00"
;
}
...
...
@@ -203,6 +207,11 @@ public class CalendarActivity extends BaseStatusActivity<CalendarPresenter> {
return
;
}
if
(
s_begDate
.
equals
(
s_endDate
)
&&
DateUtils
.
formatDate20
(
s_endTime
)
<=
DateUtils
.
formatDate20
(
s_begTime
)){
showToast
(
"还车时刻要大于取车时刻!"
);
return
;
}
Intent
intent
=
new
Intent
();
intent
.
putExtra
(
"begDate"
,
s_begDate
+
" "
+
s_begTime
);
intent
.
putExtra
(
"endDate"
,
s_endDate
+
" "
+
s_endTime
);
...
...
plugin_carpurchase/src/main/java/com/xxrv/carpurchase/adapter/CarPurChaseListAdapter.java
View file @
420f9e8f
...
...
@@ -2,9 +2,14 @@ package com.xxrv.carpurchase.adapter;
import
android.widget.ImageView
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.view.StarBar
;
import
com.ruiwenliu.wrapper.util.BaseGlideHolder
;
import
com.ruiwenliu.wrapper.util.TransformationUtil2
;
import
com.ruiwenliu.wrapper.util.glide.GlideOptions
;
import
com.xxrv.carpurchase.R
;
import
com.xxrv.carpurchase.beam.CarPurChaseListBean
;
...
...
@@ -20,7 +25,20 @@ public class CarPurChaseListAdapter extends BaseQuickAdapter<CarPurChaseListBean
@Override
protected
void
convert
(
BaseGlideHolder
helper
,
CarPurChaseListBean
.
DataBeanX
.
DataBean
item
)
{
helper
.
loadImage
(
mContext
,
item
.
getIcon
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
));
// helper.loadImage(mContext, item.getIcon(), (ImageView) helper.getView(R.id.iv_goods));
ImageView
image
=
helper
.
getView
(
R
.
id
.
iv_goods
);
GlideOptions
options
=
GlideOptions
.
placeholderOf
(
com
.
ruiwenliu
.
wrapper
.
R
.
drawable
.
glide_icon_placeholder
).
error
(
com
.
ruiwenliu
.
wrapper
.
R
.
drawable
.
glide_icon_error
);
TransformationUtil2
utils
=
new
TransformationUtil2
(
image
);
Glide
.
with
(
mContext
)
.
asBitmap
()
.
load
(
item
.
getIcon
())
.
apply
(
options
)
.
apply
(
RequestOptions
.
bitmapTransform
(
new
RoundedCorners
(
12
)).
override
(
image
.
getWidth
(),
image
.
getHeight
()))
.
into
(
utils
);
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getName
());
helper
.
setText
(
R
.
id
.
tv_context
,
item
.
getKeyword
());
float
score
=
(
float
)
item
.
getScore
()
/
10
;
...
...
plugin_carpurchase/src/main/res/layout/rv_item_car_purchase_list.xml
View file @
420f9e8f
...
...
@@ -15,9 +15,9 @@
<ImageView
android:id=
"@+id/iv_goods"
android:layout_width=
"@dimen/size_1
2
0"
android:layout_width=
"@dimen/size_1
3
0"
android:layout_height=
"@dimen/size_100"
android:scaleType=
"
centerCrop
"
/>
android:scaleType=
"
fitXY
"
/>
<RelativeLayout
android:layout_width=
"match_parent"
...
...
plugin_coupon/src/main/java/com/xxrv/coupon/CarCouponActivity.java
View file @
420f9e8f
...
...
@@ -5,16 +5,19 @@ import android.os.Bundle;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.View
;
import
android.widget.ImageView
;
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.entity.MultiItemEntity
;
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.xxrv.coupon.adapter.CarCouponAdapter
;
import
com.xxrv.coupon.bean.CarCouponBean
;
import
com.xxrv.coupon.bean.CouponBean
;
import
com.xxrv.coupon.presenter.CouponAllPresenter
;
...
...
@@ -32,14 +35,21 @@ import butterknife.OnClick;
public
class
CarCouponActivity
extends
BaseStatusActivity
<
CouponAllPresenter
>
{
@BindView
(
R2
.
id
.
rv_content
)
RecyclerView
rvContent
;
@BindView
(
R2
.
id
.
iv_select
)
ImageView
ivSelect
;
private
CarCouponAdapter
mAdapter
;
List
<
C
ouponBean
.
DataBean
>
couponBeans
;
List
<
C
arCouponBean
.
DataBean
.
CarCouponType
DataBean
>
couponBeans
;
@Autowired
()
String
coupon
;
private
List
<
CouponBean
.
DataBean
>
couponList
;
@Autowired
()
String
selectCoupon
;
private
List
<
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
>
couponList
;
private
List
<
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
>
selectcarCouponDataBeans
;
private
boolean
select
;
//保留上一次选中的
@Override
...
...
@@ -53,63 +63,106 @@ public class CarCouponActivity extends BaseStatusActivity<CouponAllPresenter> {
couponList
=
new
ArrayList
<>();
mAdapter
=
new
CarCouponAdapter
();
mAdapter
=
new
CarCouponAdapter
(
new
ArrayList
<
MultiItemEntity
>()
);
rvContent
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
,
LinearLayoutManager
.
VERTICAL
,
false
));
rvContent
.
setAdapter
(
mAdapter
);
if
(
selectCoupon
!=
null
)
{
selectcarCouponDataBeans
=
JSON
.
parseArray
(
selectCoupon
,
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
.
class
);
}
if
(
coupon
!=
null
)
{
couponBeans
=
JSON
.
parseArray
(
coupon
,
CouponBean
.
DataBean
.
class
);
mAdapter
.
addData
(
couponBeans
);
couponBeans
=
JSON
.
parseArray
(
coupon
,
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
class
);
List
<
MultiItemEntity
>
multiList
=
new
ArrayList
<>();
for
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
bean
:
couponBeans
)
{
multiList
.
add
(
bean
);
for
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
childrenBean
:
bean
.
getList
())
{
if
(
selectcarCouponDataBeans
!=
null
)
{
for
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
selectCoupon
:
selectcarCouponDataBeans
)
{
if
(
selectCoupon
.
getTickerNo
().
equals
(
childrenBean
.
getTickerNo
()))
{
childrenBean
.
setCheck
(
true
);
}
}
}
multiList
.
add
(
childrenBean
);
}
}
mAdapter
.
addData
(
multiList
);
}
mAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
CouponBean
.
DataBean
item
=
(
CouponBean
.
DataBean
)
adapter
.
getItem
(
position
);
if
(
"1"
.
equals
(
item
.
getStatus
()))
{
select
=
item
.
isCheck
();
List
<
CouponBean
.
DataBean
>
data
=
mAdapter
.
getData
();
if
(
data
!=
null
&&
data
.
size
()
>
0
){
MultiItemEntity
bean
=
mAdapter
.
getItem
(
position
);
if
(
bean
instanceof
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
{
ivSelect
.
setSelected
(
false
);
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
couponBean
=
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
bean
;
if
(
"1"
.
equals
(
couponBean
.
getStatus
()))
{
select
=
couponBean
.
isCheck
();
List
<
MultiItemEntity
>
data
=
mAdapter
.
getData
();
if
(
data
!=
null
&&
data
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
if
(
data
.
get
(
i
).
getType
().
equals
(
item
.
getType
())){
data
.
get
(
i
).
setCheck
(
false
);
MultiItemEntity
bean2
=
data
.
get
(
i
);
if
(
bean2
instanceof
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
{
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
data2
=
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
bean2
;
if
(
data2
.
getType
().
equals
(
couponBean
.
getType
()))
{
data2
.
setCheck
(
false
);
}
}
if
(
select
){
item
.
setCheck
(
false
);
}
else
{
item
.
setCheck
(
true
);
}
if
(
select
)
{
couponBean
.
setCheck
(
false
);
}
else
{
couponBean
.
setCheck
(
true
);
}
}
mAdapter
.
notifyDataSetChanged
();
}
}
}
});
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
}
@OnClick
(
R2
.
id
.
btn_item_ok
)
@OnClick
(
{
R2
.
id
.
btn_item_ok
,
R2
.
id
.
ll_item_coupon_air
}
)
public
void
onViewClicked
(
View
view
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
btn_item_ok
)
{
couponList
.
clear
();
List
<
CouponBean
.
DataBean
>
data
=
mAdapter
.
getData
();
if
(
data
!=
null
&&
data
.
size
()
>
0
)
{
List
<
MultiItemEntity
>
data
=
mAdapter
.
getData
();
if
(
data
!=
null
&&
data
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
if
(
data
.
get
(
i
).
isCheck
()){
couponList
.
add
(
data
.
get
(
i
));
MultiItemEntity
multiItemEntity
=
data
.
get
(
i
);
if
(
multiItemEntity
instanceof
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
{
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
data2
=
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
multiItemEntity
;
if
(
data2
.
isCheck
())
{
couponList
.
add
(
data2
);
}
}
}
getIntent
().
putExtra
(
"resultCouponList"
,
JSON
.
toJSONString
(
data
));
}
getIntent
().
putExtra
(
"resultCouponList"
,
JSON
.
toJSONString
(
data
));
getIntent
().
putExtra
(
"selectCoupon"
,
JSON
.
toJSONString
(
couponList
));
setResult
(
RESULT_OK
,
getIntent
());
finish
();
}
else
if
(
id
==
R
.
id
.
ll_item_coupon_air
)
{
ivSelect
.
setSelected
(
true
);
List
<
MultiItemEntity
>
data
=
mAdapter
.
getData
();
if
(
data
!=
null
&&
data
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
MultiItemEntity
bean2
=
data
.
get
(
i
);
if
(
bean2
instanceof
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
{
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
data2
=
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
bean2
;
data2
.
setCheck
(
false
);
}
}
}
mAdapter
.
notifyDataSetChanged
();
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/adapter/CarCouponAdapter.java
View file @
420f9e8f
package
com
.
xxrv
.
coupon
.
adapter
;
import
com.chad.library.adapter.base.BaseMultiItemQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.entity.MultiItemEntity
;
import
com.ruiwenliu.wrapper.bean.MultiItemBean
;
import
com.rv.component.utils.DateUtils
;
import
com.xxrv.coupon.R
;
import
com.xxrv.coupon.bean.CarCouponBean
;
import
com.xxrv.coupon.bean.CouponBean
;
import
java.util.List
;
/**
* 优惠券 租车确认订单
*/
public
class
CarCouponAdapter
extends
BaseQuickAdapter
<
CouponBean
.
DataBean
,
BaseViewHolder
>
{
public
class
CarCouponAdapter
extends
BaseMultiItemQuickAdapter
<
MultiItemEntity
,
BaseViewHolder
>
{
public
static
final
int
TYPE_CARCOUPON_TITLE
=
1
;
public
static
final
int
TYPE_CARCOUPON_NAME
=
2
;
public
CarCouponAdapter
()
{
super
(
R
.
layout
.
rv_item_carcoupon
);
public
CarCouponAdapter
(
List
<
MultiItemEntity
>
data
)
{
super
(
data
);
addItemType
(
TYPE_CARCOUPON_TITLE
,
R
.
layout
.
rv_item_carcoupon_type_title
);
addItemType
(
TYPE_CARCOUPON_NAME
,
R
.
layout
.
rv_item_carcoupon
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
CouponBean
.
DataBean
item
)
{
if
(
item
!=
null
){
protected
void
convert
(
BaseViewHolder
helper
,
MultiItemEntity
bean
)
{
switch
(
helper
.
getItemViewType
())
{
case
TYPE_CARCOUPON_TITLE:
if
(
bean
!=
null
){
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
item
=
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
)
bean
;
if
(
"1"
.
equals
(
item
.
getType
()))
{
//1满减券 2叠加满减券 3无门槛券(需要限制大小
helper
.
setText
(
R
.
id
.
tv_type_title
,
"满减券"
);
}
else
if
(
"2"
.
equals
(
item
.
getType
())){
helper
.
setText
(
R
.
id
.
tv_type_title
,
"叠加满减券"
);
}
else
if
(
"3"
.
equals
(
item
.
getType
())){
helper
.
setText
(
R
.
id
.
tv_type_title
,
"无门槛券"
);
}
}
break
;
case
TYPE_CARCOUPON_NAME:
if
(
bean
!=
null
){
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
item
=
(
CarCouponBean
.
DataBean
.
CarCouponTypeDataBean
.
CarCouponDataBean
)
bean
;
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
()));
...
...
@@ -41,5 +66,7 @@ public class CarCouponAdapter extends BaseQuickAdapter<CouponBean.DataBean, Base
helper
.
setGone
(
R
.
id
.
tv_layout_gray
,
true
);
}
}
break
;
}
}
}
plugin_coupon/src/main/java/com/xxrv/coupon/api/CouponApi.java
View file @
420f9e8f
...
...
@@ -6,4 +6,6 @@ public class CouponApi {
//我的优惠卷
public
static
String
HTTP_URL_COUPON_LIST
=
RvFrameConfig
.
HOST
+
"/api/activity/user/coupon/list"
;
public
static
String
HTTP_URL_COUPON_TYPELIST
=
RvFrameConfig
.
HOST
+
"/api/activity/user/coupon/typelist"
;
}
plugin_coupon/src/main/java/com/xxrv/coupon/bean/CarCouponBean.java
0 → 100644
View file @
420f9e8f
package
com
.
xxrv
.
coupon
.
bean
;
import
com.chad.library.adapter.base.entity.MultiItemEntity
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.xxrv.coupon.adapter.CarCouponAdapter
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
CarCouponBean
extends
BaseBean
{
private
DataBean
data
;
private
boolean
rel
;
public
DataBean
getData
()
{
return
data
;
}
public
void
setData
(
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
CarCouponTypeDataBean
.
CarCouponDataBean
coupon
;
private
List
<
CarCouponTypeDataBean
>
array
;
public
CarCouponTypeDataBean
.
CarCouponDataBean
getCoupon
()
{
return
coupon
;
}
public
void
setCoupon
(
CarCouponTypeDataBean
.
CarCouponDataBean
coupon
)
{
this
.
coupon
=
coupon
;
}
public
List
<
CarCouponTypeDataBean
>
getArray
()
{
return
array
;
}
public
void
setArray
(
List
<
CarCouponTypeDataBean
>
array
)
{
this
.
array
=
array
;
}
public
static
class
CarCouponTypeDataBean
implements
Serializable
,
MultiItemEntity
{
private
String
type
;
private
List
<
CarCouponDataBean
>
list
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
List
<
CarCouponDataBean
>
getList
()
{
return
list
;
}
public
void
setList
(
List
<
CarCouponDataBean
>
list
)
{
this
.
list
=
list
;
}
@Override
public
int
getItemType
()
{
return
CarCouponAdapter
.
TYPE_CARCOUPON_TITLE
;
}
public
static
class
CarCouponDataBean
implements
Serializable
,
MultiItemEntity
{
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, 0-全平台;1-租车;2-旅游;3-营地
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
;
private
String
isChecked
;
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
;
}
public
String
getIsChecked
()
{
return
isChecked
;
}
public
void
setIsChecked
(
String
isChecked
)
{
this
.
isChecked
=
isChecked
;
}
@Override
public
int
getItemType
()
{
return
CarCouponAdapter
.
TYPE_CARCOUPON_NAME
;
}
}
}
}
}
plugin_coupon/src/main/res/layout/activity_car_coupon.xml
View file @
420f9e8f
...
...
@@ -5,13 +5,53 @@
android:background=
"@color/colorGrayBg"
android:orientation=
"vertical"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/rv_content"
<android.support.v4.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_weight=
"1"
android:layout_height=
"0dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_item_coupon_air"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_70"
android:layout_marginLeft=
"@dimen/size_15"
android:layout_marginTop=
"@dimen/size_15"
android:layout_marginRight=
"@dimen/size_15"
android:background=
"@drawable/shape_rv_bg_while_circle"
android:gravity=
"center_vertical"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_15"
android:layout_weight=
"1"
android:text=
"不使用优惠券"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_16"
/>
<ImageView
android:id=
"@+id/iv_select"
android:layout_width=
"@dimen/size_20"
android:layout_height=
"@dimen/size_20"
android:layout_marginLeft=
"@dimen/size_10"
android:layout_marginRight=
"@dimen/size_20"
android:src=
"@drawable/selector_rv_icon_mark"
/>
</LinearLayout>
<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>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<Button
android:id=
"@+id/btn_item_ok"
android:layout_width=
"match_parent"
...
...
plugin_coupon/src/main/res/layout/rv_item_carcoupon_type_title.xml
0 → 100644
View file @
420f9e8f
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_type_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/text_16"
android:layout_margin=
"@dimen/size_15"
android:textColor=
"@color/colorMain"
android:text=
"通用券"
/>
</RelativeLayout>
\ 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