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
256498b2
Commit
256498b2
authored
May 27, 2021
by
lidawei1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 创建生活号页面逻辑修改
parent
27589f35
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
198 additions
and
24 deletions
+198
-24
XRouterPathConstants.kt
...n/src/main/java/com/yidian/common/XRouterPathConstants.kt
+1
-0
URLs.kt
...onLib/Common/src/main/java/com/yidian/common/http/URLs.kt
+1
-0
AndroidManifest.xml
Components/newscontent/src/main/AndroidManifest.xml
+4
-0
CreateLifeAccountBean.kt
...an/shenghuoquan/newscontent/bean/CreateLifeAccountBean.kt
+14
-0
ICreateLifeAccountCallback.kt
...enghuoquan/newscontent/bean/ICreateLifeAccountCallback.kt
+8
-0
ApiService.kt
...va/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
+16
-0
CommonService.kt
...com/yidian/shenghuoquan/newscontent/http/CommonService.kt
+5
-0
CreateAccountActivity.kt
...dian/shenghuoquan/newscontent/ui/CreateAccountActivity.kt
+0
-18
LiveAccountCreateActivity.kt
.../shenghuoquan/newscontent/ui/LiveAccountCreateActivity.kt
+111
-0
TempListActivity.kt
...om/yidian/shenghuoquan/newscontent/ui/TempListActivity.kt
+1
-1
TextWatcherAdapter.kt
...dian/shenghuoquan/newscontent/utils/TextWatcherAdapter.kt
+15
-0
activity_create_account.xml
...wscontent/src/main/res/layout/activity_create_account.xml
+14
-4
activity_login.xml
...onents/newscontent/src/main/res/layout/activity_login.xml
+6
-1
colors.xml
Components/newscontent/src/main/res/values/colors.xml
+2
-0
No files found.
CommonLib/Common/src/main/java/com/yidian/common/XRouterPathConstants.kt
View file @
256498b2
...
...
@@ -34,5 +34,6 @@ class XRouterPathConstants {
const
val
ID_CARD_TEST
=
"/idCardTest"
const
val
LIFE_ACCOUNT_ENTERPRISE_CERTIFICATION
=
"/lifeAccountEnterpriseCertification"
const
val
LIFE_ACCOUNT_PERSONAL_AUTH
=
"/lifeAccountPersonalAuth"
const
val
LIFE_ACCOUNT_CREATE
=
"/createLiveAccountActivity"
}
}
\ No newline at end of file
CommonLib/Common/src/main/java/com/yidian/common/http/URLs.kt
View file @
256498b2
...
...
@@ -51,5 +51,6 @@ class URLs {
const
val
getKSYunObjectId
=
"Ksy/ksyun/buildObectid"
const
val
getKSYunBucket
=
"Ksy/ksyun/getBucket"
const
val
businessLicenseOCR
=
"/Identify/BusLicense/businessLicenseOcr"
const
val
createLifeAccount
=
"/merchant/enterprise/create_life"
}
}
\ No newline at end of file
Components/newscontent/src/main/AndroidManifest.xml
View file @
256498b2
...
...
@@ -121,6 +121,10 @@
<activity
android:name=
".ui.LifeAccountEnterpriseCertificationActivity"
android:theme=
"@style/Transparent"
/>
<activity
android:name=
".ui.LiveAccountCreateActivity"
android:theme=
"@style/Transparent"
android:windowSoftInputMode=
"stateHidden|adjustResize"
/>
<activity
android:name=
".ui.LifeAccountPersonalAuthActivity"
android:theme=
"@style/Transparent"
/>
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/bean/CreateLifeAccountBean.kt
0 → 100644
View file @
256498b2
package
com.yidian.shenghuoquan.newscontent.bean
class
CreateLifeAccountBean
{
/**
* life_account_name 是 str 生活号名称
* code 是 str 企业社会统一识别码
* user_id 是 str 用id
*/
data class
Request
(
var
life_account_name
:
String
,
var
code
:
String
,
var
user_id
:
String
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/bean/ICreateLifeAccountCallback.kt
0 → 100644
View file @
256498b2
package
com.yidian.shenghuoquan.newscontent.bean
interface
ICreateLifeAccountCallback
{
/**
* @param result 创建生活号结果 true 成功过,false 失败
*/
fun
createLifeAccountCallback
(
result
:
Boolean
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
View file @
256498b2
...
...
@@ -13,7 +13,9 @@ import com.yidian.common.http.TransformUtil
import
com.yidian.common.http.httpbean.WebResult
import
com.yidian.common.utils.ToolsUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.shenghuoquan.newscontent.bean.CreateLifeAccountBean
import
com.yidian.shenghuoquan.newscontent.bean.DynamicExpressionBean
import
com.yidian.shenghuoquan.newscontent.bean.ICreateLifeAccountCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.*
import
com.yidian.xarc.xbrid.XBridManager
import
okhttp3.MultipartBody
...
...
@@ -577,6 +579,20 @@ class ApiService {
})
}
fun
createLifeAccount
(
callback
:
ICreateLifeAccountCallback
,
requestParams
:
CreateLifeAccountBean
.
Request
){
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
createLifeAccount
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
?>(){
override
fun
onSuccess
(
result
:
HttpResult
<
Any
?
>?)
{
callback
.
createLifeAccountCallback
(
true
)
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
?
>?)
{
callback
.
createLifeAccountCallback
(
false
)
}
})
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/CommonService.kt
View file @
256498b2
...
...
@@ -3,6 +3,7 @@ package com.yidian.shenghuoquan.newscontent.http
import
com.yidian.common.cardutils.bean.PolymerCommonCardBean
import
com.yidian.common.http.HttpResult
import
com.yidian.common.http.URLs
import
com.yidian.shenghuoquan.newscontent.bean.CreateLifeAccountBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.*
import
io.reactivex.rxjava3.core.Observable
import
okhttp3.MultipartBody
...
...
@@ -130,4 +131,8 @@ interface CommonService {
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
businessLicenseOCR
)
fun
businessLicenseOCR
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
BusinessLicenseOCRBean
.
Request
)
:
Observable
<
HttpResult
<
BusinessLicenseOCRBean
.
Response
>>
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
createLifeAccount
)
fun
createLifeAccount
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
CreateLifeAccountBean
.
Request
)
:
Observable
<
HttpResult
<
Any
?>>
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/CreateAccountActivity.kt
deleted
100644 → 0
View file @
27589f35
package
com.yidian.shenghuoquan.newscontent.ui
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityCreateAccountBinding
class
CreateAccountActivity
:
BaseActivity
<
ActivityCreateAccountBinding
>(){
override
fun
createViewBinding
():
ActivityCreateAccountBinding
{
return
ActivityCreateAccountBinding
.
inflate
(
layoutInflater
)
}
override
fun
getXPageName
():
String
{
return
"create_account"
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LiveAccountCreateActivity.kt
0 → 100644
View file @
256498b2
package
com.yidian.shenghuoquan.newscontent.ui
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.os.Bundle
import
android.text.Editable
import
androidx.core.view.isVisible
import
com.yidian.common.XRouterPathConstants.Companion.LIFE_ACCOUNT_CREATE
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.bean.ICreateLifeAccountCallback
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityCreateAccountBinding
import
com.yidian.shenghuoquan.newscontent.utils.TextWatcherAdapter
class
LiveAccountCreateActivity
:
BaseActivity
<
ActivityCreateAccountBinding
>(),
ICreateLifeAccountCallback
{
override
fun
createViewBinding
():
ActivityCreateAccountBinding
{
return
ActivityCreateAccountBinding
.
inflate
(
layoutInflater
)
}
override
fun
getXPageName
():
String
{
return
LIFE_ACCOUNT_CREATE
}
private
val
accountMaxLength
=
40
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initView
()
initListener
()
initData
()
}
private
fun
initData
()
{
setUserName
(
"兰小花"
,
"15800003242"
)
}
private
fun
initView
()
{
viewBind
.
btnCreateAccount
.
alpha
=
0.32f
viewBind
.
btnCreateAccount
.
isEnabled
=
false
//设置最大的名称限制
viewBind
.
etAccount
.
maxHeight
=
accountMaxLength
+
1
}
private
fun
initListener
()
{
viewBind
.
ivBack
.
setOnClickListener
{
finish
()
}
viewBind
.
etAccount
.
addTextChangedListener
(
object
:
TextWatcherAdapter
(){
override
fun
afterTextChanged
(
s
:
Editable
?)
{
if
(
s
==
null
)
return
checkAccount
(
s
.
toString
())
}
})
viewBind
.
btnCreateAccount
.
setOnClickListener
{
createNewAccount
()
}
}
private
fun
createNewAccount
()
{
// TODO: 2021/5/26 创建生活号
//模拟网络请求成功
// ApiService.createLifeAccount(this,request)
viewBind
.
btnCreateAccount
.
postDelayed
({
startActivity
(
Intent
(
this
@LiveAccountCreateActivity
,
LifeNumberActivity
::
class
.
java
))
},
2000L
)
}
@SuppressLint
(
"SetTextI18n"
)
private
fun
setUserName
(
name
:
String
,
number
:
String
){
val
numberFormat
=
formatNumber
(
number
)
viewBind
.
tvUserName
.
text
=
"$name $numberFormat"
}
private
fun
formatNumber
(
number
:
String
):
String
{
return
number
.
replace
(
"(\\d{3})\\d{4}(\\d{4})"
.
toRegex
(),
"$1****$2"
)
}
private
fun
checkAccount
(
s
:
String
)
{
if
(
s
.
isEmpty
()){
viewBind
.
btnCreateAccount
.
alpha
=
0.32f
viewBind
.
btnCreateAccount
.
isEnabled
=
false
viewBind
.
tvErrorTips
.
isVisible
=
false
viewBind
.
vDivider
.
setBackgroundResource
(
R
.
color
.
divider_white
)
return
}
if
(
s
.
length
>
accountMaxLength
){
viewBind
.
btnCreateAccount
.
alpha
=
0.32f
viewBind
.
btnCreateAccount
.
isEnabled
=
false
viewBind
.
tvErrorTips
.
isVisible
=
true
viewBind
.
etAccount
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
red_account_tips
))
viewBind
.
vDivider
.
setBackgroundResource
(
R
.
color
.
red_account_tips
)
}
else
{
viewBind
.
btnCreateAccount
.
alpha
=
1f
viewBind
.
btnCreateAccount
.
isEnabled
=
true
viewBind
.
tvErrorTips
.
isVisible
=
false
viewBind
.
etAccount
.
setTextColor
(
resources
.
getColor
(
R
.
color
.
gray_333
))
viewBind
.
vDivider
.
setBackgroundResource
(
R
.
color
.
divider_white
)
}
}
override
fun
createLifeAccountCallback
(
result
:
Boolean
)
{
//创建生活号的回调
if
(
result
){
//todo 创建成功 页面跳转
}
else
{
// todo 创建失败,失败逻辑
}
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/TempListActivity.kt
View file @
256498b2
...
...
@@ -35,7 +35,7 @@ class TempListActivity : BaseActivity<ActivityTempListBinding>() {
startActivity
(
Intent
(
this
@TempListActivity
,
LifeAccountEnterpriseCertificationActivity
::
class
.
java
))
}
viewBind
.
btCreateAccount
.
setOnClickListener
{
startActivity
(
Intent
(
this
@TempListActivity
,
CreateAccount
Activity
::
class
.
java
))
startActivity
(
Intent
(
this
@TempListActivity
,
LiveAccountCreate
Activity
::
class
.
java
))
}
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/utils/TextWatcherAdapter.kt
0 → 100644
View file @
256498b2
package
com.yidian.shenghuoquan.newscontent.utils
import
android.text.Editable
import
android.text.TextWatcher
abstract
class
TextWatcherAdapter
:
TextWatcher
{
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
}
override
fun
afterTextChanged
(
s
:
Editable
?)
{
}
}
\ No newline at end of file
Components/newscontent/src/main/res/layout/activity_create_account.xml
View file @
256498b2
...
...
@@ -20,10 +20,15 @@
android:id=
"@+id/iv_back"
android:layout_width=
"28dp"
android:layout_height=
"28dp"
android:paddingStart=
"10dp"
android:paddingEnd=
"10dp"
android:paddingTop=
"5dp"
android:paddingBottom=
"5dp"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"20dp"
android:scaleType=
"centerCrop"
android:src=
"@drawable/big_back"
/>
android:src=
"@drawable/big_back"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_title"
...
...
@@ -51,6 +56,11 @@
android:layout_height=
"60dp"
android:layout_marginEnd=
"20dp"
android:layout_marginStart=
"20dp"
android:background=
"@null"
android:textSize=
"16sp"
android:textCursorDrawable=
"@drawable/comment_dialog_cursor"
android:textColorHint=
"@color/account_hint"
android:textColor=
"@color/gray_333"
android:gravity=
"center_vertical"
android:hint=
"@string/account_create_tips"
/>
<View
...
...
@@ -68,7 +78,7 @@
android:paddingBottom=
"6dp"
android:paddingTop=
"6dp"
android:text=
"@string/account_error_tips"
android:textColor=
"
#FF3A3A
"
android:textColor=
"
@color/red_account_tips
"
android:textSize=
"12sp"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
...
...
@@ -90,7 +100,7 @@
android:layout_height=
"60dp"
android:gravity=
"center_vertical"
android:paddingStart=
"20dp"
android:text=
"@string/account_manager
"
tools:text=
"蓝小花15800000001
"
android:textColor=
"@color/gray_333"
android:textSize=
"16sp"
android:textStyle=
"bold"
...
...
@@ -118,7 +128,7 @@
android:layout_marginBottom=
"34dp"
android:textSize=
"18sp"
android:gravity=
"center"
android:alpha=
"0.
68
"
android:alpha=
"0.
32
"
android:textColor=
"@color/white"
android:text=
"@string/create_account"
android:layout_gravity=
"center_horizontal|bottom"
...
...
Components/newscontent/src/main/res/layout/activity_login.xml
View file @
256498b2
...
...
@@ -157,5 +157,10 @@
android:text=
"《隐私政策》"
/>
</LinearLayout>
<Button
android:layout_marginTop=
"20dp"
android:id=
"@+id/btn_open_account"
android:text=
"打开创建生活号页面"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/values/colors.xml
View file @
256498b2
...
...
@@ -34,4 +34,6 @@
<color
name=
"progress_d8d8d8_transparent"
>
#bfd8d8d8
</color>
<color
name=
"gray_333"
>
#333333
</color>
<color
name=
"divider_white"
>
#FFF2F2F2
</color>
<color
name=
"red_account_tips"
>
#FF3A3A
</color>
<color
name=
"account_hint"
>
#c2c2c2
</color>
</resources>
\ 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