From f5180b600511d1871635bd364beb5bdd15f6ae88 Mon Sep 17 00:00:00 2001
From: zuojincheng <lf_zuo@163.com>
Date: 星期三, 26 三月 2025 18:05:07 +0800
Subject: [PATCH] feat(nfc): 优化 NFC写卡功能并添加新方法- 在 BaseNfcWriteHelper 中添加了新的 writeData 方法,增加了 isConnect 参数 - 优化了 NativeNfcWriteHelper 中的 writeData 实现,支持选择性连接 NFC - 更新了 NfcWriteAdapter,支持新的 writeData 方法- 修改了 NfcWreatHelper 中的 writeData 方法,使用新的接口 - 优化了 NfcWreatActivity 中的写卡逻辑

---
 generallibrary/src/main/java/com/dayu/general/activity/MyFragment.kt |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/generallibrary/src/main/java/com/dayu/general/activity/MyFragment.kt b/generallibrary/src/main/java/com/dayu/general/activity/MyFragment.kt
index cafd478..bb3bf41 100644
--- a/generallibrary/src/main/java/com/dayu/general/activity/MyFragment.kt
+++ b/generallibrary/src/main/java/com/dayu/general/activity/MyFragment.kt
@@ -1,10 +1,12 @@
 package com.dayu.general.activity
 
+import android.content.Intent
 import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import androidx.fragment.app.Fragment
+import com.dayu.general.BaseApplication
 import com.dayu.general.databinding.FragmentMyBinding
 
 class MyFragment : Fragment() {
@@ -15,6 +17,44 @@
         savedInstanceState: Bundle?
     ): View? {
         binding = FragmentMyBinding.inflate(inflater, container, false)
+        binding?.logoutRL?.setOnClickListener {
+            logout()
+        }
         return binding?.root
     }
+
+    override fun onResume() {
+        super.onResume()
+        if (BaseApplication.userName.isNotEmpty()) {
+            binding?.myName?.text = BaseApplication.userName
+        } else {
+            binding?.myName?.text = "鏈櫥褰�"
+        }
+        if (BaseApplication.userPhone.isNotEmpty()) {
+            binding?.myPhone?.text = BaseApplication.userPhone
+        } else {
+            binding?.myPhone?.text = "鏈櫥褰�"
+        }
+        if (BaseApplication.blockName.isNotEmpty()) {
+            binding?.myAdName?.text = BaseApplication.blockName
+        } else {
+            binding?.myAdName?.text = "鏈櫥褰�"
+        }
+    }
+
+    fun logout() {
+        BaseApplication.userId = ""
+        BaseApplication.userName = ""
+        BaseApplication.userPhone = ""
+        BaseApplication.blockId = ""
+        BaseApplication.blockName = ""
+        binding?.myName?.text = "鏈櫥褰�"
+        binding?.myPhone?.text = "鏈櫥褰�"
+        binding?.myAdName?.text = "鏈櫥褰�"
+        var intent= Intent(activity,LoginActivity::class.java)
+        startActivity(intent)
+        activity?.finish()
+    }
+
+
 }
\ No newline at end of file

--
Gitblit v1.8.0