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
81a194f5
Commit
81a194f5
authored
Jul 17, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 商品列表上架操作增加二次确认弹窗
parent
bb35d170
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
CommodityListAdapter.kt
...oquan/commodity/ui/coupon/adapter/CommodityListAdapter.kt
+18
-0
CommodityListItemViewModel.kt
...mmodity/ui/coupon/viewmodel/CommodityListItemViewModel.kt
+2
-1
strings.xml
Components/commodity/src/main/res/values/strings.xml
+1
-0
No files found.
Components/commodity/src/main/java/com/yidian/shenghuoquan/commodity/ui/coupon/adapter/CommodityListAdapter.kt
View file @
81a194f5
...
@@ -175,6 +175,24 @@ class CommodityListAdapter(private val context: Context, private val status: Com
...
@@ -175,6 +175,24 @@ class CommodityListAdapter(private val context: Context, private val status: Com
is
CommodityOfflineItemViewHolder
->
{
is
CommodityOfflineItemViewHolder
->
{
holder
.
binding
.
setVariable
(
BR
.
data
,
data
)
holder
.
binding
.
setVariable
(
BR
.
data
,
data
)
holder
.
binding
.
setVariable
(
BR
.
vm
,
CommodityListItemViewModel
())
holder
.
binding
.
setVariable
(
BR
.
vm
,
CommodityListItemViewModel
())
holder
.
binding
.
vm
?.
commodityOnlineOperationEvent
?.
observe
(
context
as
LifecycleOwner
,
{
// 弹出确认上架弹窗
CommonHintDialog
(
context
,
context
.
resources
.
getString
(
R
.
string
.
commodity_up_shelves_confirm
),
arrayListOf
(
context
.
resources
.
getString
(
R
.
string
.
cancel
),
context
.
resources
.
getString
(
R
.
string
.
up_shelves
)),
object
:
CommonHintDialog
.
OnHintOptionCallback
{
override
fun
onLeftOption
()
{
}
override
fun
onRightOption
()
{
// 上架商品
holder
.
binding
.
vm
?.
requestCommodityOnline
(
it
.
goodsSpuId
)
}
}).
show
()
})
holder
.
binding
.
vm
?.
commodityOnlineSuccessEvent
?.
observe
(
context
as
LifecycleOwner
,
{
holder
.
binding
.
vm
?.
commodityOnlineSuccessEvent
?.
observe
(
context
as
LifecycleOwner
,
{
// 上架成功 刷新列表
// 上架成功 刷新列表
ToastUtil
.
showToast
(
context
,
context
.
resources
.
getString
(
R
.
string
.
up_shelves_success
))
ToastUtil
.
showToast
(
context
,
context
.
resources
.
getString
(
R
.
string
.
up_shelves_success
))
...
...
Components/commodity/src/main/java/com/yidian/shenghuoquan/commodity/ui/coupon/viewmodel/CommodityListItemViewModel.kt
View file @
81a194f5
...
@@ -48,7 +48,8 @@ class CommodityListItemViewModel : BaseViewModel(), ICommodityOperationCallback
...
@@ -48,7 +48,8 @@ class CommodityListItemViewModel : BaseViewModel(), ICommodityOperationCallback
* 商品上架
* 商品上架
*/
*/
fun
commodityOnline
(
item
:
Goods
)
{
fun
commodityOnline
(
item
:
Goods
)
{
requestCommodityOnline
(
item
.
goodsSpuId
)
// 发送数据
commodityOnlineOperationEvent
.
value
=
item
}
}
/**
/**
...
...
Components/commodity/src/main/res/values/strings.xml
View file @
81a194f5
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
<string
name=
"no_search_result"
>
暂无搜索结果
</string>
<string
name=
"no_search_result"
>
暂无搜索结果
</string>
<string
name=
"click_search_again"
>
请点击搜索框重新进行搜索
</string>
<string
name=
"click_search_again"
>
请点击搜索框重新进行搜索
</string>
<string
name=
"commodity_down_shelves_confirm"
>
确认下架商品?
</string>
<string
name=
"commodity_down_shelves_confirm"
>
确认下架商品?
</string>
<string
name=
"commodity_up_shelves_confirm"
>
确认上架商品?
</string>
<string
name=
"cancel"
>
取消
</string>
<string
name=
"cancel"
>
取消
</string>
<string
name=
"down_shelves_success"
>
下架成功
</string>
<string
name=
"down_shelves_success"
>
下架成功
</string>
<string
name=
"up_shelves_success"
>
上架成功
</string>
<string
name=
"up_shelves_success"
>
上架成功
</string>
...
...
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