Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
X
xxsq
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
xxsq
Commits
18108c1a
Commit
18108c1a
authored
Jun 10, 2022
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :小象省钱 [实现方案] :加入优惠券弹窗
parent
cf728904
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
239 additions
and
10 deletions
+239
-10
H5PayUtil.kt
cms/src/main/java/com/zxhl/cms/pay/H5PayUtil.kt
+0
-1
HuafeiCouponsAdapter.kt
.../java/com/zxbw/modulemain/adapter/HuafeiCouponsAdapter.kt
+84
-0
UserCenterFragment.kt
...n/java/com/zxbw/modulemain/fragment/UserCenterFragment.kt
+11
-5
DialogUtils.kt
...ain/src/main/java/com/zxbw/modulemain/view/DialogUtils.kt
+40
-4
icon_huafei_bottom_bg.png
...ain/src/main/res/drawable-xhdpi/icon_huafei_bottom_bg.png
+0
-0
icon_huafei_bottom_bg_unselect.png
...ain/res/drawable-xhdpi/icon_huafei_bottom_bg_unselect.png
+0
-0
icon_huafei_close.png
moduleMain/src/main/res/drawable-xhdpi/icon_huafei_close.png
+0
-0
icon_huafei_select.png
...leMain/src/main/res/drawable-xhdpi/icon_huafei_select.png
+0
-0
icon_huafei_unselect.png
...Main/src/main/res/drawable-xhdpi/icon_huafei_unselect.png
+0
-0
icon_huafeo_dialog_bg.png
...ain/src/main/res/drawable-xhdpi/icon_huafeo_dialog_bg.png
+0
-0
dialog_layout_fetch_all_card.xml
...Main/src/main/res/layout/dialog_layout_fetch_all_card.xml
+68
-0
item_layout_huafei_coupons_view.xml
...n/src/main/res/layout/item_layout_huafei_coupons_view.xml
+36
-0
No files found.
cms/src/main/java/com/zxhl/cms/pay/H5PayUtil.kt
View file @
18108c1a
...
...
@@ -66,7 +66,6 @@ class H5PayUtil {
callBack
.
jumpZfbAppException
(
e
)
return
true
//没有安装该app时,返回true,表示拦截自定义链接,但不跳转,避免弹出上面的错误页面
}
view
?.
loadUrl
(
url
)
return
false
;
}
...
...
moduleMain/src/main/java/com/zxbw/modulemain/adapter/HuafeiCouponsAdapter.kt
0 → 100644
View file @
18108c1a
package
com.zxbw.modulemain.adapter
import
android.app.Activity
import
android.graphics.Color
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.zxbw.modulemain.R
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.common.base.BaseRecyclerAdapter
import
com.zxhl.cms.utils.OnRecycleItemClickListener
import
com.zxhl.cms.widget.RecycleImageView
class
HuafeiCouponsAdapter
:
BaseRecyclerAdapter
<
Any
,
HuafeiCouponsAdapter
.
ViewHolder
>
{
private
var
mContext
:
Activity
?
=
null
private
val
listener
:
OnRecycleItemClickListener
<
Any
>
private
var
mSelectPos
=
-
1
;
constructor
(
content
:
Activity
?,
listener
:
OnRecycleItemClickListener
<
Any
>
)
:
super
()
{
mContext
=
content
this
.
listener
=
listener
}
fun
setSelectPos
(
pos
:
Int
)
{
mSelectPos
=
pos
;
notifyDataSetChanged
()
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
if
(
mSelectPos
==
position
)
{
holder
.
id_ll_huafei_coupons_item_view
?.
setBackgroundResource
(
R
.
drawable
.
icon_huafei_select
)
holder
.
id_tv_huafei_amount
?.
setTextColor
(
Color
.
parseColor
(
"#FFE5C6"
))
holder
.
id_tv_huafei_desc
?.
setTextColor
(
Color
.
parseColor
(
"#D9D9D9"
))
}
else
{
holder
.
id_ll_huafei_coupons_item_view
?.
setBackgroundResource
(
R
.
drawable
.
icon_huafei_unselect
)
holder
.
id_tv_huafei_amount
?.
setTextColor
(
Color
.
parseColor
(
"#894F2A"
))
holder
.
id_tv_huafei_desc
?.
setTextColor
(
Color
.
parseColor
(
"#999999"
))
}
holder
.
id_ll_huafei_coupons_item_view
?.
setOnClickListener
{
if
(
mSelectPos
!=
position
)
{
mSelectPos
=
position
listener
.
onItemClick
(
it
,
position
,
null
)
}
else
{
mSelectPos
=
-
1
;
listener
.
onItemClick
(
it
,
position
,
null
)
}
notifyDataSetChanged
()
}
}
override
fun
getItemCount
():
Int
{
return
10
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
return
ViewHolder
(
LayoutInflater
.
from
(
AppContext
.
get
())
.
inflate
(
R
.
layout
.
item_layout_huafei_coupons_view
,
parent
,
false
)
)
}
class
ViewHolder
:
RecyclerView
.
ViewHolder
{
var
id_ll_huafei_coupons_item_view
:
LinearLayout
?
var
id_tv_huafei_amount
:
TextView
?
var
id_tv_huafei_desc
:
TextView
?
constructor
(
itemView
:
View
)
:
super
(
itemView
)
{
id_ll_huafei_coupons_item_view
=
itemView
.
findViewById
<
LinearLayout
>(
R
.
id
.
id_ll_huafei_coupons_item_view
)
id_tv_huafei_amount
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_huafei_amount
)
id_tv_huafei_desc
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_huafei_desc
)
}
}
}
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/fragment/UserCenterFragment.kt
View file @
18108c1a
...
...
@@ -14,10 +14,7 @@ import com.zxhl.cms.net.ApiClient
import
com.zxhl.cms.net.RxSchedulers
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.callback.BaseObserver
import
com.zxhl.cms.utils.AdCallback
import
com.zxhl.cms.utils.JumpUtils
import
com.zxhl.cms.utils.UserDataUtils
import
com.zxhl.cms.utils.Utils
import
com.zxhl.cms.utils.*
import
kotlinx.android.synthetic.main.fragment_layout_user_center.*
/**
...
...
@@ -32,7 +29,14 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
//JumpUtils.CardVoucherJump("猫眼")
}
id_img_kefu
?.
setOnClickListener
{
JumpUtils
.
webJump
(
"客服"
,
NetConfig
.
H5
.
WEB_URL_CUSTOMER_SERVICE
)
// JumpUtils.webJump("客服", NetConfig.H5.WEB_URL_CUSTOMER_SERVICE)
DialogUtils
.
showFetchAllCard
(
activity
!!
,
object
:
OnRecycleItemClickListener
<
Any
>{
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
,
data
:
Any
?)
{
}
})
}
id_tv_kaitong
?.
setOnClickListener
{
JumpUtils
.
MemberOrderJump
()
...
...
@@ -76,12 +80,14 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
UserDataUtils
.
updateUserInfo
(
this
)
}
}
private
var
isPause
=
false
override
fun
onPause
()
{
super
.
onPause
()
isPause
=
true
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
isPause
)
{
...
...
moduleMain/src/main/java/com/zxbw/modulemain/view/DialogUtils.kt
View file @
18108c1a
...
...
@@ -13,6 +13,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
com.bumptech.glide.Glide
import
com.zxbw.modulemain.R
import
com.zxbw.modulemain.adapter.HuafeiCouponsAdapter
import
com.zxbw.modulemain.box.adapter.SelectBoxAdapter
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.net.SettingPreference
...
...
@@ -373,6 +374,7 @@ object DialogUtils {
mDialog
.
setCancelable
(
true
)
mDialog
.
show
()
}
//显示删除用户提示弹窗
fun
showDeleteUserIdTips
(
context
:
Activity
?,
deleteListener
:
View
.
OnClickListener
)
{
if
(
context
==
null
)
return
...
...
@@ -396,11 +398,12 @@ object DialogUtils {
mDialog
.
setCancelable
(
false
)
mDialog
.
show
()
}
//退出挽留弹窗
fun
showExitSkillBuy
(
context
:
Activity
?,
listener
:
View
.
OnClickListener
)
{
if
(
context
==
null
)
return
val
mDialog
=
Dialog
(
context
,
R
.
style
.
CenterCompatDialogTheme
)
val
mDialogView
=
if
(
context
==
null
)
return
val
mDialog
=
Dialog
(
context
,
R
.
style
.
CenterCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_layout_exit_skill_buy
,
context
,
...
...
@@ -420,7 +423,9 @@ object DialogUtils {
mDialog
.
setCancelable
(
false
)
mDialog
.
show
()
}
fun
showLootAll
(
context
:
Activity
?,
listener
:
View
.
OnClickListener
){
//失败提示弹窗
fun
showLootAll
(
context
:
Activity
?,
listener
:
View
.
OnClickListener
)
{
if
(
context
==
null
)
return
val
mDialog
=
Dialog
(
context
,
R
.
style
.
CenterCompatDialogTheme
)
val
mDialogView
=
...
...
@@ -440,4 +445,35 @@ object DialogUtils {
mDialog
.
setCancelable
(
false
)
mDialog
.
show
()
}
//话费优惠券列表
fun
showFetchAllCard
(
context
:
Activity
,
listener
:
OnRecycleItemClickListener
<
Any
>)
{
if
(
context
.
isDestroyed
)
return
val
mDialog
=
Dialog
(
context
,
R
.
style
.
CenterCompatDialogTheme
)
val
mDialogView
=
showBottomDialog
(
R
.
layout
.
dialog_layout_fetch_all_card
,
context
,
mDialog
,
0
,
Gravity
.
CENTER
)
val
youhuiList
=
mDialogView
.
findViewById
<
RecyclerView
>(
R
.
id
.
id_rcl_huafei_list
);
val
huafeiCouponsAdapter
=
HuafeiCouponsAdapter
(
context
,
listener
)
youhuiList
.
layoutManager
=
GridLayoutManager
(
context
,
2
)
youhuiList
.
adapter
=
huafeiCouponsAdapter
mDialogView
.
findViewById
<
ImageView
>(
R
.
id
.
id_img_close_dialog
).
setOnClickListener
{
mDialog
.
dismiss
()
}
mDialogView
.
findViewById
<
TextView
>(
R
.
id
.
id_tv_bottom_btn
).
setOnClickListener
{
mDialog
.
dismiss
()
}
mDialog
.
setCanceledOnTouchOutside
(
false
)
mDialog
.
setCancelable
(
false
)
mDialog
.
show
()
}
}
\ No newline at end of file
moduleMain/src/main/res/drawable-xhdpi/icon_huafei_bottom_bg.png
0 → 100644
View file @
18108c1a
6.01 KB
moduleMain/src/main/res/drawable-xhdpi/icon_huafei_bottom_bg_unselect.png
0 → 100644
View file @
18108c1a
8.16 KB
moduleMain/src/main/res/drawable-xhdpi/icon_huafei_close.png
0 → 100644
View file @
18108c1a
2.04 KB
moduleMain/src/main/res/drawable-xhdpi/icon_huafei_select.png
0 → 100644
View file @
18108c1a
3.52 KB
moduleMain/src/main/res/drawable-xhdpi/icon_huafei_unselect.png
0 → 100644
View file @
18108c1a
2.28 KB
moduleMain/src/main/res/drawable-xhdpi/icon_huafeo_dialog_bg.png
0 → 100644
View file @
18108c1a
5.69 KB
moduleMain/src/main/res/layout/dialog_layout_fetch_all_card.xml
0 → 100644
View file @
18108c1a
<?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=
"match_parent"
android:gravity=
"center"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/id_img_close_dialog"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignRight=
"@id/id_ll_huafei_view"
android:layout_marginBottom=
"20dp"
android:src=
"@drawable/icon_huafei_close"
/>
<LinearLayout
android:id=
"@+id/id_ll_huafei_view"
android:layout_width=
"304dp"
android:layout_height=
"361dp"
android:layout_below=
"@id/id_img_close_dialog"
android:background=
"@drawable/icon_huafeo_dialog_bg"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"30dp"
android:text=
"当前话费券"
android:textColor=
"@color/color_333333"
android:textSize=
"20sp"
android:textStyle=
"bold"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/id_rcl_huafei_list"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginLeft=
"12dp"
android:layout_marginTop=
"5dp"
android:layout_marginRight=
"12dp"
android:layout_weight=
"1"
/>
<RelativeLayout
android:id=
"@+id/id_rl_bottom_btn_view"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
android:background=
"@drawable/icon_huafei_bottom_bg"
>
<TextView
android:id=
"@+id/id_tv_bottom_btn"
android:layout_width=
"180dp"
android:layout_height=
"46dp"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"15dp"
android:gravity=
"center"
android:text=
"立即支付"
android:textColor=
"#F8E8CC"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
moduleMain/src/main/res/layout/item_layout_huafei_coupons_view.xml
0 → 100644
View file @
18108c1a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/id_ll_huafei_coupons_item_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"8dp"
android:layout_marginRight=
"10dp"
android:layout_marginBottom=
"8dp"
android:background=
"@drawable/icon_huafei_unselect"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/id_tv_huafei_amount"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1.5"
android:gravity=
"center"
android:text=
"¥ 5"
android:textColor=
"#894F2A"
android:textSize=
"24sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/id_tv_huafei_desc"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"满100元可用"
android:textColor=
"@color/color_999999"
android:textSize=
"12sp"
/>
</LinearLayout>
\ 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