1
0

2 Коммитууд 8ac091fd71 ... 46720789f3

Эзэн SHA1 Мессеж Огноо
  poppin_leaf 46720789f3 Merge branch 'feature/dev_identify' 1 сар өмнө
  linjianpeng dfc693e51b 认证加协议 1 сар өмнө

+ 2 - 1
module_base/src/main/java/com/yc/module_base/Constans.kt

@@ -29,4 +29,5 @@ const val IS_HOME_ACTIVITY= "is_home_activity"
 const val KEY_HAS_GET_INSTALL_PARAMS= "key_Has_Get_Install_Params"
 const val KEY_NIGHT_MODE= "key_night_mode"
 const val ANCHOR_PK_TIME_SETTING= "anchor_pk_time_setting"
-const val PAY_AGREE= "pay_agree"
+const val PAY_AGREE= "pay_agree"
+const val ANCHOR_PRIVACY= "anchor_privacy"

+ 46 - 1
module_me/src/main/java/com/mita/module_me/view/certifiedanchor/CertifiedActivity.kt

@@ -4,6 +4,7 @@ import android.Manifest
 import android.content.Intent
 import android.content.pm.PackageManager
 import android.graphics.Color
+import android.text.SpannableStringBuilder
 import androidx.core.app.ActivityCompat
 import androidx.core.content.ContextCompat
 import com.alibaba.android.arouter.facade.annotation.Route
@@ -14,20 +15,29 @@ import com.mita.module_me.model.PostCertifiedAnchorBody
 import com.mita.module_me.view.certifiedanchor.CertifiedVm.Companion.BACK_CODE
 import com.mita.module_me.view.certifiedanchor.CertifiedVm.Companion.POSITIVE_CODE
 import com.mita.module_me.view.certifiedanchor.CertifiedVm.Companion.READY_CODE
+import com.xueyu.kotlinextlibrary.color
 import com.xueyu.kotlinextlibrary.deviceWidth
 import com.xueyu.kotlinextlibrary.dp
+import com.xueyu.kotlinextlibrary.launchActivity
+import com.xueyu.kotlinextlibrary.setClickable
 import com.xueyu.kotlinextlibrary.string
 import com.xueyu.kotlinextlibrary.toGone
 import com.xueyu.kotlinextlibrary.toVisible
 import com.xueyu.kotlinextlibrary.widthAndHeight
+import com.yc.baselibrary.cache.Cache
 import com.yc.baselibrary.event.LiveBusEvent
 import com.yc.baselibrary.ext.loadImage
 import com.yc.baselibrary.ext.set1sSafeListener
+import com.yc.baselibrary.ext.setSafeListener
 import com.yc.baselibrary.ext.showTopPopup
 import com.yc.baselibrary.ext.toast
 import com.yc.baselibrary.upload.UpLoad
 import com.yc.baselibrary.view.base.BaseActivity
 import com.yc.baselibrary.view.dialog.TopDialog
+import com.yc.baselibrary.view.webview.NormalWebView
+import com.yc.baselibrary.view.webview.WebViewVm
+import com.yc.commonlibrary.ANCHOR
+import com.yc.module_base.ANCHOR_PRIVACY
 import com.yc.module_base.LiveSession
 import com.yc.module_base.arouter.MeRouter
 import com.yc.module_base.dialog.OpenAlbumBottom
@@ -39,6 +49,7 @@ import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.ivIdPo
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.ivIdPositiveIcon
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.ivIdReady
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.ivIdReadyIcon
+import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.ivNoticeSelect
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.lineName
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.lineNumber
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.rlError
@@ -46,6 +57,7 @@ import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.rlSucc
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.step1
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.step3
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.tvCommit
+import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.tvNotice
 import kotlinx.android.synthetic.main.module_me_activity_certified_anchor.tvRel
 
 
@@ -62,6 +74,7 @@ class CertifiedActivity : BaseActivity<CertifiedVm>() {
     private val PERMISSIONS = arrayOf(
         Manifest.permission.READ_EXTERNAL_STORAGE
     )
+    private var isSelectNotice: Boolean = false
 
     override fun initView() {
         this.window.decorView.systemUiVisibility = android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or
@@ -93,7 +106,11 @@ class CertifiedActivity : BaseActivity<CertifiedVm>() {
         tvRel.setOnClickListener {
             step1()
         }
-        tvCommit.set1sSafeListener {
+        tvCommit.setSafeListener {
+            if (!isSelectNotice) {
+                toast("同意《主播协议》")
+                return@setSafeListener
+            }
             val realName = etName.text.toString()
             val idNumber = etNumber.text.toString()
             when {
@@ -131,6 +148,34 @@ class CertifiedActivity : BaseActivity<CertifiedVm>() {
             )
         }
         step1()
+
+        isSelectNotice = Cache.getBoolean(ANCHOR_PRIVACY) ?: false
+        if (isSelectNotice) {
+            ivNoticeSelect.setImageResource(R.drawable.xinyu_login_select_on)
+        } else {
+            ivNoticeSelect.setImageResource(R.drawable.xinyu_login_select_off)
+        }
+        ivNoticeSelect.setOnClickListener {
+            if (isSelectNotice) {
+                Cache.put(ANCHOR_PRIVACY, false)
+                ivNoticeSelect.setImageResource(R.drawable.xinyu_login_select_off)
+            } else {
+                Cache.put(ANCHOR_PRIVACY, true)
+                ivNoticeSelect.setImageResource(R.drawable.xinyu_login_select_on)
+            }
+            isSelectNotice = !isSelectNotice
+        }
+
+        val str = "我已阅读并同意《主播协议》,实名认证需要填写真实姓名、身份证号,身份证照片,确保是本人的身份信息,用于开通直播、申请提现等需要实名认证的功能或服务。"
+        val builder = SpannableStringBuilder(str)
+        builder.setClickable(textColor = color(R.color.black), start = 7, end = 13, clickable = {
+            launchActivity<NormalWebView> {
+                putExtra(WebViewVm.H5_URL, ANCHOR)
+                putExtra(WebViewVm.H5_TITLE, "主播协议")
+                putExtra(WebViewVm.IS_NO_TOKEN, true)
+            }
+        })
+        tvNotice.text = builder
     }
 
     override fun ready() {

+ 30 - 1
module_me/src/main/res/layout/module_me_activity_certified_anchor.xml

@@ -23,8 +23,8 @@
         android:id="@+id/step1"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/dp_14"
         android:paddingHorizontal="@dimen/dp_14"
+        android:paddingTop="@dimen/dp_14"
         app:layout_constraintTop_toBottomOf="@+id/toolbar">
 
         <androidx.constraintlayout.widget.ConstraintLayout
@@ -271,6 +271,35 @@
                 app:layout_constraintLeft_toLeftOf="parent"
                 app:layout_constraintRight_toRightOf="parent"
                 app:layout_constraintTop_toBottomOf="@+id/ivIdReadyIcon" />
+
+            <LinearLayout
+                android:id="@+id/rlNotice"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/dp_40"
+                android:layout_marginBottom="@dimen/dp_120"
+                android:gravity="center_horizontal"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/tvCommit">
+
+                <ImageView
+                    android:id="@+id/ivNoticeSelect"
+                    android:layout_width="@dimen/dp_24"
+                    android:layout_height="@dimen/dp_24"
+                    android:padding="@dimen/dp_5"
+                    android:src="@drawable/xinyu_login_select_off" />
+
+                <TextView
+                    android:id="@+id/tvNotice"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_horizontal|start"
+                    android:textColor="#666666"
+                    android:textSize="@dimen/sp_13"
+                    tools:text="我已阅读并同意《主播协议》,实名认证需要填写真实姓名、身份证号,身份证照片,确保是本人的身份信息,用于开通直播、申请提现等需要实名认证的功能或服务。" />
+            </LinearLayout>
         </androidx.constraintlayout.widget.ConstraintLayout>
     </androidx.core.widget.NestedScrollView>