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
003ce9be
Commit
003ce9be
authored
Jul 10, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化选择门店细节
parent
c5753c1d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
6 deletions
+52
-6
CategorySearchActivity.kt
...henghuoquan/commodity/ui/coupon/CategorySearchActivity.kt
+13
-1
commodity_activity_category_search.xml
...rc/main/res/layout/commodity_activity_category_search.xml
+2
-0
EditStoreActivity.kt
...an/shenghuoquan/newscontent/ui/store/EditStoreActivity.kt
+33
-0
activity_store_edit.xml
...s/newscontent/src/main/res/layout/activity_store_edit.xml
+4
-5
No files found.
Components/commodity/src/main/java/com/yidian/shenghuoquan/commodity/ui/coupon/CategorySearchActivity.kt
View file @
003ce9be
package
com.yidian.shenghuoquan.commodity.ui.coupon
import
android.view.KeyEvent
import
androidx.activity.viewModels
import
androidx.core.view.isVisible
import
com.yidian.common.XEventConfig
...
...
@@ -27,11 +28,20 @@ class CategorySearchActivity : BaseMvvmActivity<CommodityActivityCategorySearchB
initTitleBar
(
binding
.
include
.
toolbar
,
binding
.
include
.
tvTitle
,
"选择类目"
)
setupRecyclerView
()
subscribeUiEvent
()
initClick
()
}
private
fun
initClick
()
{
binding
.
etSearchKeyword
.
setOnKeyListener
{
_
,
keyCode
,
event
->
if
(
event
.
action
==
KeyEvent
.
ACTION_DOWN
&&
keyCode
==
KeyEvent
.
KEYCODE_ENTER
)
{
vm
.
toSearch
()
}
false
}
}
private
fun
setupRecyclerView
()
{
binding
.
rvCategoryList
.
adapter
=
adapter
adapter
.
setEmptyView
(
R
.
layout
.
empty_view
)
adapter
.
setOnItemClickListener
{
adapter
,
_
,
position
->
val
selectCategoryDto
=
adapter
.
getItem
(
position
)
as
SelectCategoryDto
// 关闭选择类目页面
...
...
@@ -57,6 +67,8 @@ class CategorySearchActivity : BaseMvvmActivity<CommodityActivityCategorySearchB
})
vm
.
clearEditEvent
.
observe
(
this
,
{
binding
.
etSearchKeyword
.
setText
(
""
)
binding
.
rvCategoryList
.
isVisible
=
false
adapter
.
setList
(
null
)
})
}
...
...
Components/commodity/src/main/res/layout/commodity_activity_category_search.xml
View file @
003ce9be
...
...
@@ -51,6 +51,8 @@
android:layout_height=
"@dimen/dp40"
android:background=
"@null"
android:hint=
"请输入关键词搜索商品类目"
android:imeOptions=
"actionSearch"
android:singleLine=
"true"
android:text=
"@={vm.searchKeyword}"
android:textColor=
"@color/color_333333"
android:textSize=
"@dimen/sp16"
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/store/EditStoreActivity.kt
View file @
003ce9be
...
...
@@ -4,6 +4,7 @@ import android.content.Intent
import
android.os.Bundle
import
android.widget.Toast
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.utils.ToastUtils
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityStoreEditBinding
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.utils.StorageUtil
...
...
@@ -79,6 +80,9 @@ class EditStoreActivity : BaseActivity<ActivityStoreEditBinding>(), CommonTopBar
}
private
fun
toAddStore
()
{
if
(!
dataValidation
())
{
return
}
val
requestParams
=
HashMap
<
String
,
String
?>()
requestParams
[
"life_account_id"
]
=
StorageUtil
.
getLifeAccountId
()
requestParams
[
"phone"
]
=
viewBind
.
storePhoneNum
.
text
.
toString
()
...
...
@@ -95,6 +99,9 @@ class EditStoreActivity : BaseActivity<ActivityStoreEditBinding>(), CommonTopBar
}
private
fun
toUpdateStore
()
{
if
(!
dataValidation
())
{
return
}
val
requestParams
=
HashMap
<
String
,
String
?>()
requestParams
[
"sub_shop_id"
]
=
store
.
sub_shop_id
requestParams
[
"life_account_id"
]
=
StorageUtil
.
getLifeAccountId
()
...
...
@@ -112,6 +119,32 @@ class EditStoreActivity : BaseActivity<ActivityStoreEditBinding>(), CommonTopBar
}
}
private
fun
dataValidation
():
Boolean
{
val
storeName
=
viewBind
.
storeName
.
text
.
toString
()
val
storePhoneNum
=
viewBind
.
storePhoneNum
.
text
.
toString
()
if
(
storeName
.
isBlank
())
{
ToastUtils
.
showShortSafe
(
"请输入门店名称"
)
return
false
}
if
(
store
.
title
.
isBlank
())
{
ToastUtils
.
showShortSafe
(
"请选择门店地址"
)
return
false
}
if
(
store
.
latitude
.
isBlank
()
||
store
.
longitude
.
isBlank
())
{
ToastUtils
.
showShortSafe
(
"门店位置坐标信息为空"
)
return
false
}
if
(
storePhoneNum
.
isBlank
())
{
ToastUtils
.
showShortSafe
(
"请输入联系电话"
)
return
false
}
if
(
storePhoneNum
.
length
!=
11
)
{
ToastUtils
.
showShortSafe
(
"请输入11位手机号"
)
return
false
}
return
true
}
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
resultCode
==
200
)
{
...
...
Components/newscontent/src/main/res/layout/activity_store_edit.xml
View file @
003ce9be
...
...
@@ -25,23 +25,22 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"90dp"
android:layout_height=
"24dp"
android:layout_gravity=
"center_vertical|start"
android:text=
"店名"
android:textColor=
"#4D4C4D"
android:textSize=
"16sp"
/>
<EditText
android:id=
"@+id/store_name"
android:layout_width=
"
247dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"24dp"
android:layout_gravity=
"center_vertical|start"
android:background=
"@null"
android:maxLength=
"
13
"
android:maxLength=
"
20
"
android:textColor=
"#333333"
android:textSize=
"16sp"
android:textStyle=
"bold"
...
...
@@ -117,7 +116,7 @@
android:layout_gravity=
"center_vertical|start"
android:background=
"@null"
android:inputType=
"number"
android:maxLength=
"1
3
"
android:maxLength=
"1
1
"
android:textColor=
"#333333"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
...
...
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