Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
0
Merge Requests
0
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
bp
ShenghuoquanBusiness
Commits
c0dc7d47
Commit
c0dc7d47
authored
Aug 27, 2021
by
chengkun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单列表和优惠券
parent
2f4c5a71
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
1225 additions
and
3 deletions
+1225
-3
XRouterPathConstants.kt
.../java/com/yidian/bcommon/constant/XRouterPathConstants.kt
+3
-0
AndroidManifest.xml
Components/BOrder/src/main/AndroidManifest.xml
+2
-0
OrderListAdapter.kt
...om/yidian/shenghuoquan/border/adapter/OrderListAdapter.kt
+65
-0
VoncherAdapter.kt
.../com/yidian/shenghuoquan/border/adapter/VoncherAdapter.kt
+38
-0
ClassMapUtil.kt
...n/java/com/yidian/shenghuoquan/border/app/ClassMapUtil.kt
+3
-3
CounponDto.kt
...ain/java/com/yidian/shenghuoquan/border/dto/CounponDto.kt
+44
-0
OrderWebData.kt
...n/java/com/yidian/shenghuoquan/border/dto/OrderWebData.kt
+73
-0
UserOrderListOperation.kt
...yidian/shenghuoquan/border/http/UserOrderListOperation.kt
+31
-0
UserOrderListService.kt
...m/yidian/shenghuoquan/border/http/UserOrderListService.kt
+22
-0
OrderListCallBack.kt
...an/shenghuoquan/border/http/callback/OrderListCallBack.kt
+7
-0
WebListDataCallback.kt
.../shenghuoquan/border/http/callback/WebListDataCallback.kt
+5
-0
HardCode.kt
...c/main/java/com/yidian/shenghuoquan/border/ui/HardCode.kt
+62
-0
OrderListActivity.kt
...va/com/yidian/shenghuoquan/border/ui/OrderListActivity.kt
+76
-0
VoncherActivity.kt
...java/com/yidian/shenghuoquan/border/ui/VoncherActivity.kt
+44
-0
PageMapUtils.kt
...java/com/yidian/shenghuoquan/border/utils/PageMapUtils.kt
+12
-0
SpaceItemDecoration.kt
...m/yidian/shenghuoquan/border/utils/SpaceItemDecoration.kt
+16
-0
RoundImageView.kt
...ava/com/yidian/shenghuoquan/border/view/RoundImageView.kt
+189
-0
OrderListViewModel.kt
...idian/shenghuoquan/border/viewmodel/OrderListViewModel.kt
+26
-0
VoncherViewModel.kt
.../yidian/shenghuoquan/border/viewmodel/VoncherViewModel.kt
+7
-0
icon_arrow_right.png
.../BOrder/src/main/res/drawable-xxhdpi/icon_arrow_right.png
+0
-0
icon_arrow_white.png
.../BOrder/src/main/res/drawable-xxhdpi/icon_arrow_white.png
+0
-0
icon_react_under_text.png
...er/src/main/res/drawable-xxhdpi/icon_react_under_text.png
+0
-0
icon_yuan.png
Components/BOrder/src/main/res/drawable-xxhdpi/icon_yuan.png
+0
-0
shape_coner.xml
Components/BOrder/src/main/res/drawable/shape_coner.xml
+12
-0
shape_rond_react.xml
Components/BOrder/src/main/res/drawable/shape_rond_react.xml
+12
-0
shape_scan_order.xml
Components/BOrder/src/main/res/drawable/shape_scan_order.xml
+16
-0
test_pic.jpeg
Components/BOrder/src/main/res/drawable/test_pic.jpeg
+0
-0
border_activity_order_list.xml
...BOrder/src/main/res/layout/border_activity_order_list.xml
+76
-0
border_activity_voncher.xml
...ts/BOrder/src/main/res/layout/border_activity_voncher.xml
+49
-0
border_recycle_order_item.xml
.../BOrder/src/main/res/layout/border_recycle_order_item.xml
+229
-0
border_voncher_item.xml
...onents/BOrder/src/main/res/layout/border_voncher_item.xml
+99
-0
attr.xml
Components/BOrder/src/main/res/values/attr.xml
+7
-0
No files found.
CommonLib/BCommon/src/main/java/com/yidian/bcommon/constant/XRouterPathConstants.kt
View file @
c0dc7d47
...
@@ -172,5 +172,8 @@ class XRouterPathConstants {
...
@@ -172,5 +172,8 @@ class XRouterPathConstants {
// C端设置页
// C端设置页
const
val
C_SETTING
=
"/SettingActivity"
const
val
C_SETTING
=
"/SettingActivity"
const
val
ORDER_LIST
=
"/b/order/order_detail_new"
const
val
VONCHER_LIST
=
"/b/order/voncher_list"
}
}
}
}
Components/BOrder/src/main/AndroidManifest.xml
View file @
c0dc7d47
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
android:windowSoftInputMode=
"adjustPan"
/>
android:windowSoftInputMode=
"adjustPan"
/>
<activity
android:name=
"com.yidian.shenghuoquan.border.ui.OrderDetailActivity"
/>
<activity
android:name=
"com.yidian.shenghuoquan.border.ui.OrderDetailActivity"
/>
<activity
android:name=
"com.yidian.shenghuoquan.border.ui.SelectPickupPointActivity"
/>
<activity
android:name=
"com.yidian.shenghuoquan.border.ui.SelectPickupPointActivity"
/>
<activity
android:name=
".ui.OrderListActivity"
/>
<activity
android:name=
".ui.VoncherActivity"
/>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/adapter/OrderListAdapter.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.adapter
import
android.content.Context
import
android.graphics.Typeface
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.RelativeLayout
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.yidian.shenghuoquan.border.R
import
com.yidian.shenghuoquan.border.app.bean.OrderWebData
class
OrderListAdapter
(
var
context
:
Context
,
var
orderList
:
List
<
OrderWebData
>)
:
RecyclerView
.
Adapter
<
RecyclerView
.
ViewHolder
>()
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
{
var
view
:
View
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
border_recycle_order_item
,
parent
,
false
)
var
holder
=
MyViewHoder
(
view
)
return
holder
}
override
fun
onBindViewHolder
(
holder
:
RecyclerView
.
ViewHolder
,
position
:
Int
)
{
mapDataToHoder
(
orderList
[
position
],
holder
as
MyViewHoder
)
}
override
fun
getItemCount
():
Int
{
return
orderList
.
size
}
class
MyViewHoder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
}
private
fun
mapDataToHoder
(
data
:
OrderWebData
,
holder
:
MyViewHoder
)
{
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_market_name
).
text
=
data
.
marketing_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_status
).
text
=
data
.
online_status
when
(
data
.
order_item_list
.
size
)
{
1
->
{
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog1_name
).
text
=
data
.
order_item_list
[
0
].
goods_name
}
2
->
{
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog1_name
).
text
=
data
.
order_item_list
[
0
].
goods_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog2_name
).
text
=
data
.
order_item_list
[
1
].
goods_name
}
3
->
{
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog1_name
).
text
=
data
.
order_item_list
[
0
].
goods_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_goog2_name
).
text
=
data
.
order_item_list
[
1
].
goods_name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_good3_name
).
text
=
data
.
order_item_list
[
2
].
goods_name
}
}
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_order_goods_count
).
text
=
data
.
goods_num
.
toString
()
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_time
).
text
=
data
.
pay_time
var
money
:
TextView
=
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_count
)
money
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
)
money
.
text
=
"${data.payment}"
holder
.
itemView
.
findViewById
<
RelativeLayout
>(
R
.
id
.
rl_show_order_detail
).
setOnClickListener
{
//跳转订单详情页面
}
if
(
data
.
online_status
.
equals
(
"4"
))
{
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_status
).
text
=
"已退款:"
}
else
{
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_pay_money_status
).
text
=
"已支付:"
}
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/adapter/VoncherAdapter.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.adapter
import
android.content.Context
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.yidian.shenghuoquan.border.R
import
com.yidian.shenghuoquan.border.app.bean.Coupon
class
VoncherAdapter
(
var
context
:
Context
,
var
voncherList
:
List
<
Coupon
>)
:
RecyclerView
.
Adapter
<
RecyclerView
.
ViewHolder
>()
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
{
var
view
:
View
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
border_voncher_item
,
parent
,
false
)
var
holder
=
MyViewHoder
(
view
)
return
holder
}
override
fun
onBindViewHolder
(
holder
:
RecyclerView
.
ViewHolder
,
position
:
Int
)
{
mapDataToHoder
(
voncherList
[
position
],
holder
as
MyViewHoder
,
position
)
}
override
fun
getItemCount
():
Int
{
return
voncherList
.
size
}
class
MyViewHoder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
}
private
fun
mapDataToHoder
(
data
:
Coupon
,
holder
:
MyViewHoder
,
position
:
Int
)
{
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_voncher_name
).
text
=
data
.
name
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_voncher_amount
).
text
=
data
.
coupon_amount
.
toString
()
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_start_end_time
).
text
=
"${data.start_time} ${data.end_time}"
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_voncher_type
).
text
=
"${data.type}"
holder
.
itemView
.
findViewById
<
TextView
>(
R
.
id
.
tv_voncher_desc
).
text
=
data
.
desc
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/app/ClassMapUtil.kt
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app
package
com.yidian.shenghuoquan.border.app
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.shenghuoquan.border.ui.ConfirmOrderActivity
import
com.yidian.shenghuoquan.border.ui.*
import
com.yidian.shenghuoquan.border.ui.OrderDetailActivity
import
com.yidian.shenghuoquan.border.ui.SelectPickupPointActivity
/**
/**
...
@@ -15,6 +13,8 @@ object ClassMapUtil {
...
@@ -15,6 +13,8 @@ object ClassMapUtil {
XRouterPathConstants
.
Companion
.
CONFIRM_ORDER_ACTIVITY
to
ConfirmOrderActivity
::
class
.
java
,
// 确认订单
XRouterPathConstants
.
Companion
.
CONFIRM_ORDER_ACTIVITY
to
ConfirmOrderActivity
::
class
.
java
,
// 确认订单
XRouterPathConstants
.
Companion
.
ORDER_DETAIL_ACTIVITY
to
OrderDetailActivity
::
class
.
java
,
// 订单详情
XRouterPathConstants
.
Companion
.
ORDER_DETAIL_ACTIVITY
to
OrderDetailActivity
::
class
.
java
,
// 订单详情
XRouterPathConstants
.
Companion
.
PICKUP_POINT_ACTIVITY
to
SelectPickupPointActivity
::
class
.
java
,
// 选择自提点
XRouterPathConstants
.
Companion
.
PICKUP_POINT_ACTIVITY
to
SelectPickupPointActivity
::
class
.
java
,
// 选择自提点
XRouterPathConstants
.
Companion
.
ORDER_LIST
to
OrderListActivity
::
class
.
java
,
// 订单列表
XRouterPathConstants
.
Companion
.
VONCHER_LIST
to
VoncherActivity
::
class
.
java
,
// 优惠券列表
)
)
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/dto/CounponDto.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.bean
import
android.os.Parcelable
import
com.google.gson.annotations.SerializedName
import
kotlinx.parcelize.Parcelize
data class
CounponDto
(
val
coupon_list
:
List
<
Coupon
>
)
@Parcelize
data class
Coupon
(
@SerializedName
(
"amount"
)
val
amount
:
String
,
@SerializedName
(
"counpon_amount"
)
val
coupon_amount
:
Int
,
@SerializedName
(
"coupon_id"
)
val
coupon_id
:
String
,
@SerializedName
(
"desc"
)
val
desc
:
String
,
@SerializedName
(
"end_time"
)
val
end_time
:
String
,
@SerializedName
(
"id"
)
val
id
:
String
,
@SerializedName
(
"jump_url"
)
val
jump_url
:
String
,
@SerializedName
(
"name"
)
val
name
:
String
,
@SerializedName
(
"start_time"
)
val
start_time
:
String
,
@SerializedName
(
"status"
)
val
status
:
Int
,
@SerializedName
(
"thumbnail"
)
val
thumbnail
:
String
,
@SerializedName
(
"type"
)
val
type
:
Int
,
@SerializedName
(
"use_activity_type"
)
val
use_activity_type
:
Int
,
@SerializedName
(
"use_amount_min"
)
val
use_amount_min
:
Int
,
@SerializedName
(
"use_amount_type"
)
val
use_amount_type
:
Int
,
@SerializedName
(
"use_shop_type"
)
val
use_shop_type
:
Int
)
:
Parcelable
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/dto/OrderWebData.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.bean
data class
OrderWebData
(
val
create_time_text
:
String
,
val
desc_pic_url
:
String
,
val
discount_fee
:
Int
,
val
goods_desc
:
String
,
val
goods_introduce
:
String
,
val
goods_name
:
String
,
val
goods_num
:
Int
,
val
goods_price
:
String
,
val
life_account_icon
:
String
,
val
life_account_id
:
String
,
val
life_account_name
:
String
,
val
marketing_id
:
Int
,
val
marketing_name
:
String
,
val
merge_order_item_list
:
List
<
MergeOrderItem
>,
val
online_status
:
String
,
val
order_id
:
String
,
val
order_item_list
:
List
<
OrderItem
>,
val
order_price
:
String
,
val
order_status
:
Int
,
val
order_status_text
:
String
,
val
original_price
:
String
,
val
pay_time
:
String
,
val
payment
:
Double
,
val
place_list
:
PlaceList
,
val
refund_amount
:
Double
,
val
refund_apply_time
:
String
,
val
refund_finish_time
:
String
,
val
shipping_list
:
ShippingList
,
val
total_amount_sold
:
String
,
val
total_price
:
Double
)
data class
MergeOrderItem
(
val
goods_name
:
String
,
val
goods_num
:
Int
,
val
price
:
Double
)
data class
OrderItem
(
val
goods_name
:
String
,
val
goods_num
:
Int
,
val
goods_sku_id
:
String
,
val
price
:
Double
)
data class
PlaceList
(
val
address
:
String
,
val
area
:
String
,
val
city
:
String
,
val
contact_name
:
String
,
val
create_time
:
String
,
val
is_delete
:
Int
,
val
latitude
:
String
,
val
life_account_id
:
String
,
val
location
:
String
,
val
longitude
:
String
,
val
phone
:
String
,
val
province
:
String
,
val
take_place_id
:
Int
,
val
take_place_name
:
String
,
val
update_time
:
String
)
data class
ShippingList
(
val
receiver_address
:
String
,
val
receiver_mobile
:
String
,
val
receiver_name
:
String
)
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/http/UserOrderListOperation.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.http
import
com.yidian.bcommon.http.HttpParamsUtils
import
com.yidian.bcommon.http.HttpResult
import
com.yidian.bcommon.http.HttpResultSubscriber
import
com.yidian.bcommon.http.TransformUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.shenghuoquan.border.app.bean.OrderWebData
import
com.yidian.shenghuoquan.border.app.http.callback.OrderListCallBack
import
timber.log.Timber
object
UserOrderListOperation
{
private
var
userOrderListApi
=
ServiceFactory
.
getInstance
().
createService
(
UserOrderListService
::
class
.
java
)
fun
userOrderList
(
requestParams
:
HashMap
<
String
,
String
?
>,
callBack
:
OrderListCallBack
)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
userOrderListApi
.
userOrderList
(
publicParamsMap
,
privateParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
List
<
OrderWebData
>?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
List
<
OrderWebData
>?>?)
{
Timber
.
tag
(
"UserOrderListOperation"
).
i
(
"onSuccess ${result?.result.toString()}"
)
callBack
.
onOrderListCallback
(
result
!!
.
result
)
}
override
fun
onFailure
(
result
:
HttpResult
<
List
<
OrderWebData
>?>?)
{
Timber
.
tag
(
"UserOrderListOperation"
).
i
(
"onFailure ${result?.result.toString()}"
)
}
})
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/http/UserOrderListService.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.http
import
com.yidian.bcommon.http.HttpResult
import
io.reactivex.rxjava3.core.Observable
import
retrofit2.http.Body
import
retrofit2.http.GET
import
retrofit2.http.POST
import
retrofit2.http.QueryMap
import
java.util.*
interface
UserOrderListService
{
companion
object
{
const
val
userOrderList
=
"/order/order/user_order_list"
}
/**
* 获取用户订单列表
*/
@POST
(
userOrderList
)
fun
userOrderList
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
params
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/http/callback/OrderListCallBack.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.http.callback
import
com.yidian.shenghuoquan.border.app.bean.OrderWebData
interface
OrderListCallBack
{
fun
onOrderListCallback
(
orders
:
List
<
OrderWebData
>?)
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/http/callback/WebListDataCallback.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.http.callback
interface
WebListDataCallback
<
T
>{
fun
onWebListDataCallBack
(
list
:
List
<
T
>)
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/ui/HardCode.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.activity
object
HardCode
{
const
val
VoncherList
=
"{"
+
" \"coupon_list\":["
+
" {"
+
" \"id\": \"02A9NOTyZjKT5F\","
+
" \"coupon_id\": \"02A9NOTyZjKT5F\","
+
" \"coupon_amount\": 300,"
+
" \"amount\": \"3.00\","
+
" \"start_time\": \"2021.08.25 10:03\","
+
" \"end_time\": \"2021.09.01 10:03\","
+
" \"status\": 1,"
+
" \"name\": \"新用户无门槛代金券\","
+
" \"desc\": \"仅限生活圈午餐使用\","
+
" \"thumbnail\": \"\","
+
" \"jump_url\": \"\","
+
" \"type\": 1,"
+
" \"use_shop_type\": 0,"
+
" \"use_activity_type\": 0,"
+
" \"use_amount_type\": 0,"
+
" \"use_amount_min\": 0"
+
" },"
+
" {"
+
" \"id\": \"02A9NOTyZjKT5F\","
+
" \"coupon_id\": \"02A9NOTyZjKT5F\","
+
" \"coupon_amount\": 300,"
+
" \"amount\": \"3.00\","
+
" \"start_time\": \"2021.08.25 10:03\","
+
" \"end_time\": \"2021.09.01 10:03\","
+
" \"status\": 1,"
+
" \"name\": \"新用户无门槛代金券1\","
+
" \"desc\": \"仅限生活圈午餐使用1\","
+
" \"thumbnail\": \"\","
+
" \"jump_url\": \"\","
+
" \"type\": 1,"
+
" \"use_shop_type\": 0,"
+
" \"use_activity_type\": 0,"
+
" \"use_amount_type\": 0,"
+
" \"use_amount_min\": 0"
+
" },"
+
" {"
+
" \"id\": \"02A9NOTyZjKT5F\","
+
" \"coupon_id\": \"02A9NOTyZjKT5F\","
+
" \"coupon_amount\": 300,"
+
" \"amount\": \"3.00\","
+
" \"start_time\": \"2021.08.25 10:03\","
+
" \"end_time\": \"2021.09.01 10:03\","
+
" \"status\": 1,"
+
" \"name\": \"新用户无门槛代金券2\","
+
" \"desc\": \"仅限生活圈午餐使用2\","
+
" \"thumbnail\": \"\","
+
" \"jump_url\": \"\","
+
" \"type\": 1,"
+
" \"use_shop_type\": 0,"
+
" \"use_activity_type\": 0,"
+
" \"use_amount_type\": 0,"
+
" \"use_amount_min\": 0"
+
" }"
+
"]"
+
"}"
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/ui/OrderListActivity.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.ui
import
android.graphics.Typeface
import
android.graphics.drawable.Drawable
import
androidx.activity.viewModels
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.bcommon.extensions.initTitleBar
import
com.yidian.bcommon.mvvm.BaseMvvmActivity
import
com.yidian.news.ui.SystemBarUtils
import
com.yidian.shenghuoquan.border.R
import
com.yidian.shenghuoquan.border.app.adapter.OrderListAdapter
import
com.yidian.shenghuoquan.border.app.utils.SpaceItemDecoration
import
com.yidian.shenghuoquan.border.databinding.BorderActivityOrderListBinding
import
com.yidian.shenghuoquan.border.viewmodel.OrderListViewModel
import
com.yidian.xpage.XPageViewProtocol
import
timber.log.Timber
class
OrderListActivity
:
BaseMvvmActivity
<
BorderActivityOrderListBinding
,
OrderListViewModel
>()
,
XPageViewProtocol
{
override
val
layoutId
:
Int
=
R
.
layout
.
border_activity_order_list
override
val
vm
:
OrderListViewModel
by
viewModels
()
private
lateinit
var
listAdapter
:
OrderListAdapter
override
fun
initView
()
{
initTitleBar
(
binding
.
orderListToolbar
,
binding
.
tvTitle
,
"参与的"
)
SystemBarUtils
.
setStatusBarTextColorWhite
(
this
)
binding
.
orderListToolbar
.
setNavigationIcon
(
R
.
drawable
.
icon_arrow_white
)
initRecycleView
()
initClickEvent
()
vm
.
requestUserOrder
(
HashMap
<
String
,
String
?>())
}
private
fun
initRecycleView
()
{
val
spacingInPixels
=
resources
.
getDimensionPixelSize
(
R
.
dimen
.
dp10
)
binding
.
rcvOrderList
.
addItemDecoration
(
SpaceItemDecoration
(
spacingInPixels
))
vm
.
_orderList
.
observe
(
this
,
{
Timber
.
tag
(
"OrderListObsver"
).
i
(
">>>>>>>>>>>>>>>>>>>>>>>>"
)
listAdapter
=
OrderListAdapter
(
this
,
it
)
binding
.
rcvOrderList
.
adapter
=
listAdapter
})
}
private
fun
initClickEvent
()
{
binding
.
tvRefunded
.
setOnClickListener
{
binding
.
tvRefunded
.
setTypeface
(
Typeface
.
defaultFromStyle
(
Typeface
.
BOLD
))
val
dra
:
Drawable
?
=
getDrawable
(
R
.
drawable
.
icon_react_under_text
)
dra
!!
.
setBounds
(
0
,
0
,
dra
!!
.
intrinsicWidth
,
dra
!!
.
intrinsicHeight
)
binding
.
tvRefunded
.
setCompoundDrawables
(
null
,
null
,
null
,
dra
)
binding
.
tvOrderlistAll
.
setTypeface
(
Typeface
.
defaultFromStyle
(
Typeface
.
NORMAL
))
binding
.
tvOrderlistAll
.
setCompoundDrawables
(
null
,
null
,
null
,
null
)
var
param
=
HashMap
<
String
,
String
?>()
param
[
"order_status"
]
=
"4"
vm
.
requestUserOrder
(
param
)
}
binding
.
tvOrderlistAll
.
setOnClickListener
{
binding
.
tvRefunded
.
setTypeface
(
Typeface
.
defaultFromStyle
(
Typeface
.
NORMAL
))
binding
.
tvRefunded
.
setCompoundDrawables
(
null
,
null
,
null
,
null
)
binding
.
tvOrderlistAll
.
setTypeface
(
Typeface
.
defaultFromStyle
(
Typeface
.
BOLD
))
val
dra
:
Drawable
?
=
getDrawable
(
R
.
drawable
.
icon_react_under_text
)
dra
!!
.
setBounds
(
0
,
0
,
dra
!!
.
intrinsicWidth
,
dra
!!
.
intrinsicHeight
)
binding
.
tvOrderlistAll
.
setCompoundDrawables
(
null
,
null
,
null
,
dra
)
vm
.
requestUserOrder
(
HashMap
<
String
,
String
?>())
}
}
private
fun
requestUserOrder
()
{
}
override
fun
getXPageName
():
String
{
return
XRouterPathConstants
.
ORDER_LIST
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/ui/VoncherActivity.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.ui
import
androidx.activity.viewModels
import
com.google.gson.Gson
import
com.yidian.bcommon.constant.XRouterPathConstants.Companion.VONCHER_LIST
import
com.yidian.bcommon.extensions.initTitleBar
import
com.yidian.bcommon.mvvm.BaseMvvmActivity
import
com.yidian.news.ui.SystemBarUtils
import
com.yidian.shenghuoquan.border.R
import
com.yidian.shenghuoquan.border.app.activity.HardCode
import
com.yidian.shenghuoquan.border.app.adapter.VoncherAdapter
import
com.yidian.shenghuoquan.border.app.bean.CounponDto
import
com.yidian.shenghuoquan.border.app.utils.SpaceItemDecoration
import
com.yidian.shenghuoquan.border.app.viewmodel.VoncherViewModel
import
com.yidian.shenghuoquan.border.databinding.BorderActivityVoncherBinding
import
com.yidian.xpage.XPageViewProtocol
class
VoncherActivity
:
BaseMvvmActivity
<
BorderActivityVoncherBinding
,
VoncherViewModel
>(),
XPageViewProtocol
{
override
val
layoutId
:
Int
=
R
.
layout
.
border_activity_voncher
override
val
vm
:
VoncherViewModel
by
viewModels
()
private
lateinit
var
listAdapter
:
VoncherAdapter
override
fun
initView
()
{
SystemBarUtils
.
setStatusBarTextColorWhite
(
this
)
initTitleBar
(
binding
.
voncherListToolbar
,
binding
.
tvTitle
,
"我的代金券"
)
binding
.
voncherListToolbar
.
setNavigationIcon
(
R
.
drawable
.
icon_arrow_white
)
initRecycleView
()
}
override
fun
getXPageName
():
String
{
return
VONCHER_LIST
}
private
fun
initRecycleView
()
{
val
spacingInPixels
=
resources
.
getDimensionPixelSize
(
R
.
dimen
.
dp10
)
binding
.
rcvVoncherList
.
addItemDecoration
(
SpaceItemDecoration
(
spacingInPixels
))
var
gson
=
Gson
()
var
voncherObj
=
gson
.
fromJson
<
CounponDto
>(
HardCode
.
VoncherList
,
CounponDto
::
class
.
java
)
listAdapter
=
VoncherAdapter
(
this
,
voncherObj
.
coupon_list
)
binding
.
rcvVoncherList
.
adapter
=
listAdapter
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/utils/PageMapUtils.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.utils
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.shenghuoquan.border.ui.OrderListActivity
import
com.yidian.shenghuoquan.border.ui.VoncherActivity
object
PageMapUtils
{
val
xPageNodeMap
=
mapOf
(
XRouterPathConstants
.
Companion
.
ORDER_LIST
to
OrderListActivity
::
class
.
java
,
// 订单列表
XRouterPathConstants
.
Companion
.
VONCHER_LIST
to
VoncherActivity
::
class
.
java
// 订单列表
)
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/utils/SpaceItemDecoration.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.utils
import
android.graphics.Color
import
android.graphics.Rect
import
android.view.View
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView.ItemDecoration
class
SpaceItemDecoration
(
private
val
space
:
Int
)
:
ItemDecoration
()
{
override
fun
getItemOffsets
(
outRect
:
Rect
,
view
:
View
,
parent
:
RecyclerView
,
state
:
RecyclerView
.
State
)
{
if
(
parent
.
getChildAdapterPosition
(
view
)
==
0
)
{
outRect
.
top
=
space
}
outRect
.
bottom
=
space
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/view/RoundImageView.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.view
import
android.content.Context
import
kotlin.jvm.JvmOverloads
import
android.view.View.MeasureSpec
import
android.graphics.drawable.Drawable
import
android.graphics.drawable.BitmapDrawable
import
android.content.res.TypedArray
import
android.graphics.*
import
android.util.AttributeSet
import
androidx.appcompat.widget.AppCompatImageView
import
com.yidian.shenghuoquan.border.R
class
RoundImageView
@JvmOverloads
constructor
(
context
:
Context
,
attrs
:
AttributeSet
?
=
null
)
:
AppCompatImageView
(
context
,
attrs
)
{
private
val
paint
:
Paint
private
val
paintBorder
:
Paint
private
var
mSrcBitmap
:
Bitmap
?
=
null
/**
* 圆角的弧度
*/
private
val
mRadius
:
Float
private
val
mIsCircle
:
Boolean
public
override
fun
onDraw
(
canvas
:
Canvas
)
{
val
width
=
canvas
.
width
-
paddingLeft
-
paddingRight
val
height
=
canvas
.
height
-
paddingTop
-
paddingBottom
val
image
=
drawableToBitmap
(
drawable
)
if
(
mIsCircle
)
{
val
reSizeImage
=
reSizeImageC
(
image
,
width
,
height
)
canvas
.
drawBitmap
(
createCircleImage
(
reSizeImage
,
width
,
height
),
paddingLeft
.
toFloat
(),
paddingTop
.
toFloat
(),
null
)
}
else
{
val
reSizeImage
=
reSizeImage
(
image
,
width
,
height
)
canvas
.
drawBitmap
(
createRoundImage
(
reSizeImage
,
width
,
height
),
paddingLeft
.
toFloat
(),
paddingTop
.
toFloat
(),
null
)
}
}
/**
* 画圆角
*
* @param source
* @param width
* @param height
* @return
*/
private
fun
createRoundImage
(
source
:
Bitmap
,
width
:
Int
,
height
:
Int
):
Bitmap
{
val
paint
=
Paint
()
paint
.
isAntiAlias
=
true
val
target
=
Bitmap
.
createBitmap
(
width
,
height
,
Bitmap
.
Config
.
ARGB_8888
)
val
canvas
=
Canvas
(
target
)
val
rect
=
RectF
(
0F
,
0F
,
width
.
toFloat
(),
height
.
toFloat
())
canvas
.
drawRoundRect
(
rect
,
mRadius
,
mRadius
,
paint
)
// 核心代码取两个图片的交集部分
paint
.
xfermode
=
PorterDuffXfermode
(
PorterDuff
.
Mode
.
SRC_IN
)
canvas
.
drawBitmap
(
source
,
0f
,
0f
,
paint
)
return
target
}
/**
* 画圆
*
* @param source
* @param width
* @param height
* @return
*/
private
fun
createCircleImage
(
source
:
Bitmap
,
width
:
Int
,
height
:
Int
):
Bitmap
{
val
paint
=
Paint
()
paint
.
isAntiAlias
=
true
val
target
=
Bitmap
.
createBitmap
(
width
,
height
,
Bitmap
.
Config
.
ARGB_8888
)
val
canvas
=
Canvas
(
target
)
canvas
.
drawCircle
(
(
width
/
2
).
toFloat
(),
(
height
/
2
).
toFloat
(),
(
Math
.
min
(
width
,
height
)
/
2
).
toFloat
(),
paint
)
// 核心代码取两个图片的交集部分
paint
.
xfermode
=
PorterDuffXfermode
(
PorterDuff
.
Mode
.
SRC_IN
)
canvas
.
drawBitmap
(
source
,
((
width
-
source
.
width
)
/
2
).
toFloat
(),
(
(
height
-
source
.
height
)
/
2
).
toFloat
(),
paint
)
return
target
}
override
fun
onMeasure
(
widthMeasureSpec
:
Int
,
heightMeasureSpec
:
Int
)
{
val
width
=
MeasureSpec
.
getSize
(
widthMeasureSpec
)
val
height
=
MeasureSpec
.
getSize
(
heightMeasureSpec
)
setMeasuredDimension
(
width
,
height
)
}
/**
* drawable转bitmap
*
* @param drawable
* @return
*/
private
fun
drawableToBitmap
(
drawable
:
Drawable
?):
Bitmap
?
{
if
(
drawable
==
null
)
{
return
if
(
mSrcBitmap
!=
null
)
{
mSrcBitmap
}
else
{
null
}
}
else
if
(
drawable
is
BitmapDrawable
)
{
return
drawable
.
bitmap
}
val
bitmap
=
Bitmap
.
createBitmap
(
drawable
.
intrinsicWidth
,
drawable
.
intrinsicHeight
,
Bitmap
.
Config
.
ARGB_8888
)
val
canvas
=
Canvas
(
bitmap
)
drawable
.
setBounds
(
0
,
0
,
canvas
.
width
,
canvas
.
height
)
drawable
.
draw
(
canvas
)
return
bitmap
}
/**
* 重设Bitmap的宽高
*
* @param bitmap
* @param newWidth
* @param newHeight
* @return
*/
private
fun
reSizeImage
(
bitmap
:
Bitmap
?,
newWidth
:
Int
,
newHeight
:
Int
):
Bitmap
{
val
width
=
bitmap
!!
.
width
val
height
=
bitmap
.
height
// 计算出缩放比
val
scaleWidth
=
newWidth
.
toFloat
()
/
width
val
scaleHeight
=
newHeight
.
toFloat
()
/
height
// 矩阵缩放bitmap
val
matrix
=
Matrix
()
matrix
.
postScale
(
scaleWidth
,
scaleHeight
)
return
Bitmap
.
createBitmap
(
bitmap
,
0
,
0
,
width
,
height
,
matrix
,
true
)
}
/**
* 重设Bitmap的宽高
*
* @param bitmap
* @param newWidth
* @param newHeight
* @return
*/
private
fun
reSizeImageC
(
bitmap
:
Bitmap
?,
newWidth
:
Int
,
newHeight
:
Int
):
Bitmap
{
val
width
=
bitmap
!!
.
width
val
height
=
bitmap
.
height
val
x
=
(
newWidth
-
width
)
/
2
val
y
=
(
newHeight
-
height
)
/
2
if
(
x
>
0
&&
y
>
0
)
{
return
Bitmap
.
createBitmap
(
bitmap
,
0
,
0
,
width
,
height
,
null
,
true
)
}
var
scale
=
1f
scale
=
if
(
width
>
height
)
{
// 按照宽度进行等比缩放
newWidth
.
toFloat
()
/
width
}
else
{
// 按照高度进行等比缩放
// 计算出缩放比
newHeight
.
toFloat
()
/
height
}
val
matrix
=
Matrix
()
matrix
.
postScale
(
scale
,
scale
)
return
Bitmap
.
createBitmap
(
bitmap
,
0
,
0
,
width
,
height
,
matrix
,
true
)
}
init
{
val
ta
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
RoundImageView
)
mRadius
=
ta
.
getDimension
(
R
.
styleable
.
RoundImageView_radius
,
0f
)
mIsCircle
=
ta
.
getBoolean
(
R
.
styleable
.
RoundImageView_circle
,
false
)
val
srcResource
=
attrs
!!
.
getAttributeResourceValue
(
"http://schemas.android.com/apk/res/android"
,
"src"
,
0
)
if
(
srcResource
!=
0
)
mSrcBitmap
=
BitmapFactory
.
decodeResource
(
resources
,
srcResource
)
ta
.
recycle
()
paint
=
Paint
()
paint
.
isAntiAlias
=
true
paintBorder
=
Paint
()
paintBorder
.
isAntiAlias
=
true
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/viewmodel/OrderListViewModel.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.viewmodel
import
androidx.lifecycle.LiveData
import
androidx.lifecycle.MutableLiveData
import
com.yidian.bcommon.mvvm.BaseViewModel
import
com.yidian.shenghuoquan.border.app.bean.OrderWebData
import
com.yidian.shenghuoquan.border.app.http.UserOrderListOperation
import
com.yidian.shenghuoquan.border.app.http.callback.OrderListCallBack
class
OrderListViewModel
:
BaseViewModel
(){
private
var
orderList
:
MutableLiveData
<
List
<
OrderWebData
>>
=
MutableLiveData
<
List
<
OrderWebData
>>()
var
_orderList
:
LiveData
<
List
<
OrderWebData
>>
=
orderList
fun
requestUserOrder
(
param
:
HashMap
<
String
,
String
?>)
{
UserOrderListOperation
.
userOrderList
(
param
,
orderListCallBack
)
}
private
var
orderListCallBack
=
object
:
OrderListCallBack
{
override
fun
onOrderListCallback
(
orders
:
List
<
OrderWebData
>?)
{
if
(
orders
!=
null
)
{
orderList
.
value
=
orders
!!
}
}
}
}
Components/BOrder/src/main/java/com/yidian/shenghuoquan/border/viewmodel/VoncherViewModel.kt
0 → 100644
View file @
c0dc7d47
package
com.yidian.shenghuoquan.border.app.viewmodel
import
com.yidian.bcommon.mvvm.BaseViewModel
class
VoncherViewModel
:
BaseViewModel
(){
}
Components/BOrder/src/main/res/drawable-xxhdpi/icon_arrow_right.png
0 → 100644
View file @
c0dc7d47
434 Bytes
Components/BOrder/src/main/res/drawable-xxhdpi/icon_arrow_white.png
0 → 100644
View file @
c0dc7d47
839 Bytes
Components/BOrder/src/main/res/drawable-xxhdpi/icon_react_under_text.png
0 → 100644
View file @
c0dc7d47
199 Bytes
Components/BOrder/src/main/res/drawable-xxhdpi/icon_yuan.png
0 → 100644
View file @
c0dc7d47
4.07 KB
Components/BOrder/src/main/res/drawable/shape_coner.xml
0 → 100644
View file @
c0dc7d47
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<size
android:width=
"70dp"
/>
<size
android:height=
"22dp"
/>
<corners
android:bottomLeftRadius=
"11dp"
android:bottomRightRadius=
"11dp"
android:topLeftRadius=
"11dp"
android:topRightRadius=
"11dp"
/>
<solid
android:color=
"#FD7823"
/>
</shape>
\ No newline at end of file
Components/BOrder/src/main/res/drawable/shape_rond_react.xml
0 → 100644
View file @
c0dc7d47
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<size
android:width=
"343dp"
/>
<size
android:height=
"252dp"
/>
<corners
android:bottomLeftRadius=
"20dp"
android:bottomRightRadius=
"20dp"
android:topLeftRadius=
"20dp"
android:topRightRadius=
"20dp"
/>
<solid
android:color=
"#FFFFFF"
/>
</shape>
\ No newline at end of file
Components/BOrder/src/main/res/drawable/shape_scan_order.xml
0 → 100644
View file @
c0dc7d47
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<size
android:width=
"70dp"
/>
<size
android:height=
"28dp"
/>
<corners
android:bottomLeftRadius=
"14dp"
android:bottomRightRadius=
"14dp"
android:topLeftRadius=
"14dp"
android:topRightRadius=
"14dp"
/>
<stroke
android:width=
"1px"
android:color=
"#E5E5E5"
>
</stroke>
<solid
android:color=
"#FFFFFF"
/>
</shape>
\ No newline at end of file
Components/BOrder/src/main/res/drawable/test_pic.jpeg
0 → 100644
View file @
c0dc7d47
6.3 KB
Components/BOrder/src/main/res/layout/border_activity_order_list.xml
0 → 100644
View file @
c0dc7d47
<?xml version="1.0" encoding="utf-8"?>
<layout
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"
>
<data>
<variable
name=
"vm"
type=
"com.yidian.shenghuoquan.border.viewmodel.OrderListViewModel"
/>
</data>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:background=
"#D8D8D8"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/order_list_toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:fitsSystemWindows=
"true"
android:minHeight=
"50dp"
android:paddingStart=
"@dimen/dp15"
android:paddingEnd=
"@dimen/dp15"
app:layout_scrollFlags=
"scroll|enterAlways"
app:navigationIcon=
"@drawable/icon_arrow_white"
android:background=
"#F6775B"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:textColor=
"#FFFFFF"
android:textSize=
"18sp"
android:textStyle=
"bold"
tools:text=
"标题"
/>
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp44"
android:layout_marginTop=
"@dimen/dp2"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_orderlist_all"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp16"
android:text=
"全部"
android:textColor=
"#333333"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:layout_gravity=
"center_vertical"
app:drawableBottomCompat=
"@drawable/icon_react_under_text"
>
</TextView>
<TextView
android:id=
"@+id/tv_refunded"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp40"
android:text=
"已退款 (17)"
android:textColor=
"#333333"
android:textSize=
"16sp"
android:layout_gravity=
"center_vertical"
>
</TextView>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rcv_order_list"
android:layout_width=
"343dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"center_horizontal"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
>
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</layout>
\ No newline at end of file
Components/BOrder/src/main/res/layout/border_activity_voncher.xml
0 → 100644
View file @
c0dc7d47
<?xml version="1.0" encoding="utf-8"?>
<layout
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"
>
<data>
<variable
name=
"vm"
type=
"com.yidian.shenghuoquan.border.app.viewmodel.VoncherViewModel"
/>
</data>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:background=
"#D8D8D8"
>
<androidx.appcompat.widget.Toolbar
android:id=
"@+id/voncher_list_toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:fitsSystemWindows=
"true"
android:minHeight=
"50dp"
android:paddingStart=
"@dimen/dp15"
android:paddingEnd=
"@dimen/dp15"
app:layout_scrollFlags=
"scroll|enterAlways"
app:navigationIcon=
"@drawable/icon_arrow_white"
android:background=
"#F6775B"
app:titleTextColor=
"@color/white"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:textColor=
"#FFFFFF"
android:textSize=
"18sp"
android:textStyle=
"bold"
tools:text=
"标题"
/>
</androidx.appcompat.widget.Toolbar>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rcv_voncher_list"
android:layout_width=
"343dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"center_horizontal"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
>
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</layout>
\ No newline at end of file
Components/BOrder/src/main/res/layout/border_recycle_order_item.xml
0 → 100644
View file @
c0dc7d47
<?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=
"@dimen/dp265"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:background=
"@drawable/shape_rond_react"
android:paddingLeft=
"@dimen/dp16"
android:paddingRight=
"@dimen/dp16"
android:paddingTop=
"@dimen/dp20"
android:paddingBottom=
"@dimen/dp20"
>
<RelativeLayout
android:id=
"@+id/ll_you_hui_and_pay"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginStart=
"16dp"
android:layout_centerHorizontal=
"true"
>
<TextView
android:id=
"@+id/tv_market_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:textSize=
"16sp"
android:textColor=
"#333333"
android:text=
"拼餐优惠多多"
>
</TextView>
<ImageView
android:layout_width=
"@dimen/dp14"
android:layout_height=
"@dimen/dp14"
android:layout_toRightOf=
"@+id/tv_market_name"
android:layout_marginLeft=
"@dimen/dp4"
android:layout_centerVertical=
"true"
android:src=
"@drawable/icon_arrow_right"
>
</ImageView>
<TextView
android:id=
"@+id/tv_pay_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_alignParentEnd=
"true"
android:layout_marginEnd=
"@dimen/dp16"
android:text=
"已支付"
android:textSize=
"14sp"
>
</TextView>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_youhui_detail"
android:layout_width=
"wrap_content"
android:layout_height=
"18dp"
android:layout_marginStart=
"@dimen/dp16"
android:layout_below=
"@+id/ll_you_hui_and_pay"
android:layout_marginTop=
"@dimen/dp11"
android:textSize=
"12sp"
android:gravity=
"center"
android:textColor=
"#D66948"
android:text=
"新人首单立减十元"
>
</TextView>
<RelativeLayout
android:id=
"@+id/rl_order_image_count"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp80"
android:orientation=
"horizontal"
android:layout_below=
"@+id/tv_youhui_detail"
android:layout_marginTop=
"@dimen/dp16"
android:layout_marginStart=
"@dimen/dp16"
android:layout_centerHorizontal=
"true"
>
<LinearLayout
android:id=
"@+id/ll_order_image1"
android:layout_width=
"82dp"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<com.yidian.shenghuoquan.border.app.view.RoundImageView
android:layout_width=
"@dimen/dp82"
android:layout_height=
"@dimen/dp60"
android:scaleType=
"centerInside"
app:radius=
"@dimen/dp12"
android:src=
"@drawable/test_pic"
>
</com.yidian.shenghuoquan.border.app.view.RoundImageView>
<TextView
android:id=
"@+id/tv_goog1_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:textSize=
"12sp"
android:text=
"肉末茄子+蔬菜"
android:gravity=
"center"
android:textColor=
"#999999"
android:ellipsize=
"end"
android:maxLines=
"1"
>
</TextView>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_order_image2"
android:layout_width=
"82dp"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:layout_toRightOf=
"@+id/ll_order_image1"
android:layout_marginStart=
"@dimen/dp8"
>
<com.yidian.shenghuoquan.border.app.view.RoundImageView
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp60"
android:scaleType=
"centerCrop"
app:radius=
"@dimen/dp12"
android:src=
"@drawable/test_pic"
>
</com.yidian.shenghuoquan.border.app.view.RoundImageView>
<TextView
android:id=
"@+id/tv_goog2_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:gravity=
"center"
android:text=
"肉末茄子+蔬菜"
android:textColor=
"#999999"
android:textSize=
"12sp"
android:ellipsize=
"end"
android:maxLines=
"1"
>
</TextView>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_order_image3"
android:layout_width=
"@dimen/dp82"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:layout_marginLeft=
"@dimen/dp8"
android:layout_toRightOf=
"@+id/ll_order_image2"
>
<com.yidian.shenghuoquan.border.app.view.RoundImageView
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:scaleType=
"centerCrop"
app:radius=
"@dimen/dp12"
android:src=
"@drawable/test_pic"
>
</com.yidian.shenghuoquan.border.app.view.RoundImageView>
<TextView
android:id=
"@+id/tv_good3_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:textSize=
"12sp"
android:text=
"肉末茄子+蔬菜"
android:gravity=
"center"
android:textColor=
"#999999"
android:maxLines=
"1"
android:ellipsize=
"end"
>
</TextView>
</LinearLayout>
<TextView
android:id=
"@+id/tv_order_goods_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_alignParentRight=
"true"
android:textSize=
"13sp"
android:layout_marginRight=
"@dimen/dp17"
android:text=
"共2件"
android:gravity=
"center"
android:textColor=
"#999999"
>
</TextView>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_time_and_pay_money"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp16"
android:layout_marginTop=
"@dimen/dp16"
android:layout_below=
"@+id/rl_order_image_count"
>
<TextView
android:id=
"@+id/tv_pay_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14sp"
android:layout_centerVertical=
"true"
android:text=
"2010-3-24 11:07"
android:textColor=
"#666666"
>
</TextView>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/dp18"
android:layout_alignParentRight=
"true"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_pay_money_status"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14sp"
android:text=
"已支付: "
>
</TextView>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"12sp"
android:text=
"¥"
android:textStyle=
"bold"
>
</TextView>
<TextView
android:id=
"@+id/tv_pay_money_count"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14sp"
android:text=
"0.01"
>
</TextView>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/rl_show_order_detail"
android:layout_width=
"@dimen/dp70"
android:layout_height=
"@dimen/dp28"
android:background=
"@drawable/shape_scan_order"
android:layout_below=
"@+id/rl_time_and_pay_money"
android:layout_alignParentRight=
"true"
android:layout_marginTop=
"@dimen/dp16"
>
<TextView
android:id=
"@+id/tv_scan_order"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:text=
"查看订单"
android:textColor=
"#999999"
android:textSize=
"12sp"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
>
</TextView>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
Components/BOrder/src/main/res/layout/border_voncher_item.xml
0 → 100644
View file @
c0dc7d47
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp123"
android:background=
"@drawable/shape_rond_react"
android:orientation=
"vertical"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp20"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp16"
android:layout_marginRight=
"@dimen/dp16"
>
<TextView
android:id=
"@+id/tv_voncher_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:text=
"生活圈团餐无门槛代金券"
>
</TextView>
<TextView
android:id=
"@+id/tv_voncher_amount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"16sp"
android:textStyle=
"bold"
android:text=
"5.05"
android:layout_alignParentRight=
"true"
android:textColor=
"#fd7823"
>
</TextView>
<ImageView
android:layout_width=
"@dimen/dp9"
android:layout_height=
"@dimen/dp20"
android:src=
"@drawable/icon_yuan"
android:layout_toLeftOf=
"@+id/tv_voncher_amount"
android:layout_marginRight=
"2dp"
app:tint=
"#fd7823"
>
</ImageView>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp16"
android:layout_marginTop=
"8dp"
>
<TextView
android:id=
"@+id/tv_start_end_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"2021.07.14 14:00-21021.09.13 23:34"
>
</TextView>
<TextView
android:id=
"@+id/tv_voncher_type"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"无门槛"
android:layout_alignParentRight=
"true"
android:layout_marginRight=
"@dimen/dp16"
android:textColor=
"#FD7823"
android:textSize=
"14sp"
>
</TextView>
</RelativeLayout>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp22"
android:layout_marginLeft=
"@dimen/dp16"
android:layout_marginRight=
"@dimen/dp16"
>
<TextView
android:id=
"@+id/tv_voncher_desc"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14sp"
android:textColor=
"#666666"
android:text=
"仅限生活圈午餐使用"
>
</TextView>
<RelativeLayout
android:layout_width=
"@dimen/dp70"
android:layout_height=
"22dp"
android:layout_alignParentRight=
"true"
android:background=
"@drawable/shape_coner"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"立即使用"
android:layout_centerInParent=
"true"
android:textColor=
"#FFFFFF"
android:textSize=
"11sp"
>
</TextView>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
Components/BOrder/src/main/res/values/attr.xml
0 → 100644
View file @
c0dc7d47
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"RoundImageView"
>
<attr
name=
"circle"
format=
"boolean"
/>
<attr
name=
"radius"
format=
"dimension"
/>
</declare-styleable>
</resources>
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