Commit 4fbede89 authored by yinjiacheng's avatar yinjiacheng

update 生活号认证流程首页、生活号个人认证页、生活号企业认证页TopBar

parent 5ab3c176
...@@ -38,9 +38,8 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(), ...@@ -38,9 +38,8 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
} }
private fun initView() { private fun initView() {
viewBind.layoutCommonHeader.ivBack.visibility = View.GONE // 此页面默认不可返回
viewBind.bvTopBar.setBackVisibility(false)
viewBind.layoutCommonHeader.tvTitle.text = resources.getString(R.string.join_life_circle)
viewBind.viewPersonalAuth.setData( viewBind.viewPersonalAuth.setData(
resources.getString(R.string.personal_auth), resources.getString(R.string.personal_auth),
resources.getString(R.string.personal_auth_condition), resources.getString(R.string.personal_auth_condition),
...@@ -54,15 +53,15 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(), ...@@ -54,15 +53,15 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
) )
if (intent.getSerializableExtra(XRouterPathConstants.ParamsKey) != null) { if (intent.getSerializableExtra(XRouterPathConstants.ParamsKey) != null) {
val paramsMap = intent.getSerializableExtra(XRouterPathConstants.ParamsKey) as HashMap<*, *> val paramsMap = intent.getSerializableExtra(XRouterPathConstants.ParamsKey) as HashMap<*, *>
var fromTag = paramsMap["from"] as String val fromTag = paramsMap["from"] as String
if (fromTag == "auth") { if (fromTag == "auth") {
viewBind.layoutCommonHeader.ivBack.visibility = View.VISIBLE // 如果由商户基本信息跳转至此页面 则此页面可返回
viewBind.bvTopBar.setBackVisibility(true)
} }
} }
} }
private fun initListener() { private fun initListener() {
viewBind.layoutCommonHeader.ivBack.setOnClickListener(this)
viewBind.tvJoinStrategy.setOnClickListener(this) viewBind.tvJoinStrategy.setOnClickListener(this)
viewBind.viewPersonalAuth.setOnClickListener(this) viewBind.viewPersonalAuth.setOnClickListener(this)
viewBind.viewEnterpriseAuth.setOnClickListener(this) viewBind.viewEnterpriseAuth.setOnClickListener(this)
...@@ -70,9 +69,6 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(), ...@@ -70,9 +69,6 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (v?.id) { when (v?.id) {
R.id.iv_back -> {
XPageManager.pop(null)
}
R.id.tv_join_strategy -> { R.id.tv_join_strategy -> {
// TODO: 5/26/21 入驻攻略 // TODO: 5/26/21 入驻攻略
} }
......
...@@ -71,11 +71,10 @@ class LifeAccountPersonalAuthActivity : ...@@ -71,11 +71,10 @@ class LifeAccountPersonalAuthActivity :
} }
private fun initView() { private fun initView() {
viewBind.viewCommonHeader.tvTitle.text = resources.getString(R.string.personal_auth)
} }
private fun initListener() { private fun initListener() {
viewBind.viewCommonHeader.ivBack.setOnClickListener(this)
viewBind.svOccupation.setOnClickListener(this) viewBind.svOccupation.setOnClickListener(this)
viewBind.cbProtocol.setOnCheckedChangeListener(this) viewBind.cbProtocol.setOnCheckedChangeListener(this)
viewBind.btnNext.setOnClickListener(this) viewBind.btnNext.setOnClickListener(this)
...@@ -119,7 +118,6 @@ class LifeAccountPersonalAuthActivity : ...@@ -119,7 +118,6 @@ class LifeAccountPersonalAuthActivity :
override fun onClick(v: View?) { override fun onClick(v: View?) {
when (v?.id) { when (v?.id) {
R.id.iv_back -> XPageManager.pop(null)
R.id.sv_occupation -> { R.id.sv_occupation -> {
XPageManager.push(XRouterPathConstants.CHOOSE_CAREER, null) XPageManager.push(XRouterPathConstants.CHOOSE_CAREER, null)
} }
......
...@@ -19,81 +19,81 @@ import com.yidian.xpage.XPageManager ...@@ -19,81 +19,81 @@ import com.yidian.xpage.XPageManager
* description: 生活号名称修改 * description: 生活号名称修改
*/ */
class LifeAccountModifyNameActivity : BaseActivity<ActivityLifeAccountModifyNameBinding>(), class LifeAccountModifyNameActivity : BaseActivity<ActivityLifeAccountModifyNameBinding>(),
CommonTopBarView.OnCommonTopBarCallback, CommonTopBarView.OnCommonTopBarActionCallback,
LifeAccountAuthIdentityInfoEditView.OnLifeAccountAuthIdentityInfoEditViewCallback, LifeAccountAuthIdentityInfoEditView.OnLifeAccountAuthIdentityInfoEditViewCallback,
ICreateLifeAccountCallback { ICreateLifeAccountCallback {
companion object { companion object {
const val EXTRA_LIFE_ACCOUNT_ID = "life_account_id" const val EXTRA_LIFE_ACCOUNT_ID = "life_account_id"
const val EXTRA_LIFE_ACCOUNT_NAME = "life_account_name" const val EXTRA_LIFE_ACCOUNT_NAME = "life_account_name"
} }
private var lifeAccountId: String? = null private var lifeAccountId: String? = null
private var lifeAccountName: String? = null private var lifeAccountName: String? = null
override fun createViewBinding(): ActivityLifeAccountModifyNameBinding { override fun createViewBinding(): ActivityLifeAccountModifyNameBinding {
return ActivityLifeAccountModifyNameBinding.inflate(layoutInflater) return ActivityLifeAccountModifyNameBinding.inflate(layoutInflater)
} }
override fun getXPageName(): String { override fun getXPageName(): String {
return XRouterPathConstants.LIFE_ACCOUNT_MODIFY_NAME return XRouterPathConstants.LIFE_ACCOUNT_MODIFY_NAME
} }
override fun init(savedInstanceState: Bundle?) { override fun init(savedInstanceState: Bundle?) {
super.init(savedInstanceState) super.init(savedInstanceState)
initView() initView()
initListener() initListener()
initData() initData()
} }
private fun initView() { private fun initView() {
// 只允许输入中文并且最长20汉字 // 只允许输入中文并且最长20汉字
viewBind.evLifeAccountName.setInputFilters(InputFilterUtil.getChineseFilter(), InputFilter.LengthFilter(20)) viewBind.evLifeAccountName.setInputFilters(InputFilterUtil.getChineseFilter(), InputFilter.LengthFilter(20))
} }
private fun initListener() { private fun initListener() {
viewBind.bvTopBar.setOnCommonTopBarCallback(this) viewBind.bvTopBar.setOnCommonTopBarCallback(null, this)
viewBind.evLifeAccountName.setOnLifeAccountAuthIdentityInfoEditViewCallback(this) viewBind.evLifeAccountName.setOnLifeAccountAuthIdentityInfoEditViewCallback(this)
}
private fun initData() {
intent.getSerializableExtra(XRouterPathConstants.ParamsKey)?.let { params ->
(params as HashMap<*, *>).let {
lifeAccountId = it[EXTRA_LIFE_ACCOUNT_ID] as String
lifeAccountName = it[EXTRA_LIFE_ACCOUNT_NAME] as String
}
} }
viewBind.evLifeAccountName.fillEditContent(lifeAccountName)
private fun initData() { // 获取焦点弹出软键盘
intent.getSerializableExtra(XRouterPathConstants.ParamsKey)?.let { params -> viewBind.evLifeAccountName.requestEditTextFocus()
(params as HashMap<*, *>).let { }
lifeAccountId = it[EXTRA_LIFE_ACCOUNT_ID] as String
lifeAccountName = it[EXTRA_LIFE_ACCOUNT_NAME] as String override fun onDoAction() {
} // 请求接口检查并修改生活号名称
} ApiService.createLifeAccount(
viewBind.evLifeAccountName.fillEditContent(lifeAccountName) this,
// 获取焦点弹出软键盘 hashMapOf(
viewBind.evLifeAccountName.requestEditTextFocus() Pair(EXTRA_LIFE_ACCOUNT_ID, lifeAccountId.toString()),
} Pair(EXTRA_LIFE_ACCOUNT_NAME, viewBind.evLifeAccountName.getEditContent())
)
override fun onDoAction() { )
// 请求接口检查并修改生活号名称 }
ApiService.createLifeAccount(
this, override fun onTextClear(from: LifeAccountAuthIdentityInfoEditView) {
hashMapOf(
Pair(EXTRA_LIFE_ACCOUNT_ID, lifeAccountId.toString()), }
Pair(EXTRA_LIFE_ACCOUNT_NAME, viewBind.evLifeAccountName.getEditContent())
) override fun onTextChange(from: LifeAccountAuthIdentityInfoEditView, text: String) {
)
} }
override fun onTextClear(from: LifeAccountAuthIdentityInfoEditView) { override fun createLifeAccountCallback(result: Boolean) {
if (result) {
} // 生活号名称修改成功
XPageManager.pop(null)
override fun onTextChange(from: LifeAccountAuthIdentityInfoEditView, text: String) { } else {
// 生活号名称修改失败 提示
} viewBind.evLifeAccountName.showErrorTips(resources.getString(R.string.life_account_name_already_exist))
override fun createLifeAccountCallback(result: Boolean) {
if (result) {
// 生活号名称修改成功
XPageManager.pop(null)
} else {
// 生活号名称修改失败 提示
viewBind.evLifeAccountName.showErrorTips(resources.getString(R.string.life_account_name_already_exist))
}
} }
} }
\ No newline at end of file }
...@@ -33,7 +33,7 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), ...@@ -33,7 +33,7 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
IGetConfigListCallback, IGetLifeAccountListCallback, MerchantSwitchDialog.OnMerchantSwitchCallback, IGetConfigListCallback, IGetLifeAccountListCallback, MerchantSwitchDialog.OnMerchantSwitchCallback,
LifeAccountLabelView.OnLifeAccountLabelCallback, IGetLifeAccountInfoByIdCallback, LifeAccountLabelView.OnLifeAccountLabelCallback, IGetLifeAccountInfoByIdCallback,
MerchantCenterBottomHintDialog.OnMerchantCenterBottomHintCallback, IAuthMerchantCheckCallback, MerchantCenterBottomHintDialog.OnMerchantCenterBottomHintCallback, IAuthMerchantCheckCallback,
MerchantServiceFunctionAdapter.OnItemClickListener, CommonTopBarView.OnCommonTopBarCallback { MerchantServiceFunctionAdapter.OnItemClickListener, CommonTopBarView.OnCommonTopBarActionCallback {
companion object { companion object {
// 传递的生活号信息 // 传递的生活号信息
......
...@@ -30,7 +30,15 @@ class CommonTopBarView @JvmOverloads constructor( ...@@ -30,7 +30,15 @@ class CommonTopBarView @JvmOverloads constructor(
) )
} }
private var callback: OnCommonTopBarCallback? = null /**
* 返回按钮点击回调
*/
private var backCallback: OnCommonTopBarBackCallback? = null
/**
* 操作按钮点击回调
*/
private var actionCallback: OnCommonTopBarActionCallback? = null
init { init {
val typeArray = context.obtainStyledAttributes(attrs, R.styleable.CommonTopBarView) val typeArray = context.obtainStyledAttributes(attrs, R.styleable.CommonTopBarView)
...@@ -62,20 +70,36 @@ class CommonTopBarView @JvmOverloads constructor( ...@@ -62,20 +70,36 @@ class CommonTopBarView @JvmOverloads constructor(
override fun onClick(v: View?) { override fun onClick(v: View?) {
if (v?.id == R.id.iv_back) { if (v?.id == R.id.iv_back) {
XPageManager.pop(null) // 若没有设置返回点击回调则默认pop
backCallback?.onDoBack() ?: XPageManager.pop(null)
} else if (v?.id == R.id.tv_action) { } else if (v?.id == R.id.tv_action) {
callback?.onDoAction() actionCallback?.onDoAction()
} }
} }
fun setOnCommonTopBarCallback(callback: OnCommonTopBarCallback) { /**
this.callback = callback * 设置回调
* @param backCallback 返回按钮点击回调
* @param actionCallback 操作按钮点击回调
*/
fun setOnCommonTopBarCallback(backCallback: OnCommonTopBarBackCallback?, actionCallback: OnCommonTopBarActionCallback?) {
this.backCallback = backCallback
this.actionCallback = actionCallback
} }
interface OnCommonTopBarCallback { interface OnCommonTopBarActionCallback {
/** /**
* 操作回调 * 操作按钮回调
*/ */
fun onDoAction() fun onDoAction()
} }
interface OnCommonTopBarBackCallback {
/**
* 返回按钮回调
*/
fun onDoBack()
}
} }
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
<com.yidian.nightmode.widget.YdConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.yidian.nightmode.widget.YdConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:fitsSystemWindows="true">
<include <com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
android:id="@+id/layout_common_header" android:id="@+id/bv_top_bar"
layout="@layout/layout_common_header"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="42dp" android:layout_height="wrap_content"
android:layout_marginTop="10dp" app:CommonTopBarView_title_text="@string/join_life_circle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.yidian.nightmode.widget.YdTextView <com.yidian.nightmode.widget.YdTextView
...@@ -24,7 +23,7 @@ ...@@ -24,7 +23,7 @@
android:textColor="#DE000000" android:textColor="#DE000000"
android:textSize="15sp" android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_common_header" /> app:layout_constraintTop_toBottomOf="@id/bv_top_bar" />
<com.yidian.nightmode.widget.YdTextView <com.yidian.nightmode.widget.YdTextView
android:id="@+id/tv_provide_services" android:id="@+id/tv_provide_services"
......
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
<com.yidian.nightmode.widget.YdConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.yidian.nightmode.widget.YdConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:fitsSystemWindows="true">
<include <com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
android:id="@+id/view_common_header" android:id="@+id/bv_top_bar"
layout="@layout/layout_common_header"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="42dp" android:layout_height="wrap_content"
android:layout_marginTop="10dp" app:CommonTopBarView_title_text="@string/enterprise_auth"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthProcessView <com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthProcessView
...@@ -19,7 +18,7 @@ ...@@ -19,7 +18,7 @@
android:layout_height="61dp" android:layout_height="61dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_common_header" /> app:layout_constraintTop_toBottomOf="@id/bv_top_bar" />
<com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthSelectView <com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthSelectView
android:id="@+id/sv_merchant_type" android:id="@+id/sv_merchant_type"
......
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
<com.yidian.nightmode.widget.YdConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.yidian.nightmode.widget.YdConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:fitsSystemWindows="true">
<include <com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
android:id="@+id/view_common_header" android:id="@+id/bv_top_bar"
layout="@layout/layout_common_header"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="42dp" android:layout_height="wrap_content"
android:layout_marginTop="10dp" app:CommonTopBarView_title_text="@string/personal_auth"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthSelectView <com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthSelectView
...@@ -19,7 +18,7 @@ ...@@ -19,7 +18,7 @@
android:layout_height="58dp" android:layout_height="58dp"
app:LifeAccountAuthSelectView_content_hint_text="@string/describe_yourself" app:LifeAccountAuthSelectView_content_hint_text="@string/describe_yourself"
app:LifeAccountAuthSelectView_name_text="@string/occupation_label" app:LifeAccountAuthSelectView_name_text="@string/occupation_label"
app:layout_constraintTop_toBottomOf="@id/view_common_header" /> app:layout_constraintTop_toBottomOf="@id/bv_top_bar" />
<com.yidian.nightmode.widget.YdFrameLayout <com.yidian.nightmode.widget.YdFrameLayout
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
......
<?xml version="1.0" encoding="utf-8"?>
<com.yidian.nightmode.widget.YdConstraintLayout 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/toolbar_height"
android:fitsSystemWindows="true">
<com.yidian.nightmode.widget.YdImageView
android:id="@+id/iv_back"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_marginStart="19dp"
android:src="@drawable/icon_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.yidian.nightmode.widget.YdTextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="#FF333333"
android:textSize="17sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</com.yidian.nightmode.widget.YdConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/addressBar"
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="@color/white">
<ImageButton
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:background="@null"
android:paddingStart="@dimen/back_button_padding_left"
android:paddingEnd="@dimen/back_button_padding_right"
android:scaleType="fitCenter"
android:src="@drawable/selector_big_back_black_button" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginStart="5dp"
android:textColor="#333333"
android:textSize="18sp" />
</RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment