master
wenfei 8 months ago
parent 8049685769
commit e62a58d839

@ -174,8 +174,8 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
if (isApkInDebug(context)) {
// 管理员
// binding.etUsername.setText("ZHPS_Admin")
// binding.etPassword.setText("Rehome.zhps@996")
binding.etUsername.setText("ZHPS_Admin")
binding.etPassword.setText("Rehome.zhps@996")
//公司内网215管理员
// binding.etUsername.setText("ZHPS_Admin")

@ -3,6 +3,7 @@ package com.rehome.zhdcoa.ui.fragment
import android.app.Activity
import android.content.Intent
import android.os.Handler
import android.os.Looper
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -88,6 +89,7 @@ import retrofit2.Response
import java.text.SimpleDateFormat
import java.util.Calendar
/**
* Create By HuangWenFei
* 创建日期2024-09-15 10:13
@ -135,12 +137,15 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>() {
// showLog(result)
// }
Handler().postDelayed({ // 在指定时间后要执行的代码
//隐藏掉 本平台为非涉密平台,严禁处理、传输国家秘密、工作秘密、商业秘密、敏感信息
//showLog("隐藏掉 本平台为非涉密平台,严禁处理、传输国家秘密、工作秘密、商业秘密、敏感信息")
binding.llTip.visibility=View.GONE;
}, 5000)
if (this.isAdded && this.isVisible) { //android.os.Handler
showLog("this.isAdded && this.isVisible")
// Fragment存在且可见可以安全访问
Handler(Looper.getMainLooper()).postDelayed({ // 在指定时间后要执行的代码
//隐藏掉 本平台为非涉密平台,严禁处理、传输国家秘密、工作秘密、商业秘密、敏感信息
//showLog("隐藏掉 本平台为非涉密平台,严禁处理、传输国家秘密、工作秘密、商业秘密、敏感信息")
binding.llTip.visibility=View.GONE;
}, 5000)
}
}
override fun initData() {
@ -159,12 +164,27 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>() {
GetMineKQData(today, beforeyesterday) //获取我的考勤数据
}
override fun onResume() {
super.onResume()
showLog("onResume")
if (this.isAdded && this.isVisible&&binding.llTip.visibility==View.VISIBLE) {
showLog("this.isAdded && this.isVisible&&binding.llTip.visibility==View.VISIBLE")
// Fragment存在且可见可以安全访问
Handler(Looper.getMainLooper()).postDelayed({ // 在指定时间后要执行的代码
//隐藏掉 本平台为非涉密平台,严禁处理、传输国家秘密、工作秘密、商业秘密、敏感信息
//showLog("隐藏掉 本平台为非涉密平台,严禁处理、传输国家秘密、工作秘密、商业秘密、敏感信息")
binding.llTip.visibility=View.GONE;
}, 5000)
}
}
override fun onStart() {
super.onStart()
showLog("onStart()")
initData()
}
private fun initLists() {
val titles = arrayOf(
"来访管理",

@ -424,13 +424,15 @@ public class MineFragment extends BaseLazyFragment {
clearImageDiskCache(getActivity());
loadImage();
if (App.getInstance().getUserInfo().getManid().equals("310569") || App.getInstance().getUserInfo().getManid().equals("ZHPS_Admin") || App.getInstance().getUserInfo().getManid().equals("310674")) {
tvSq.setVisibility(View.VISIBLE);
} else {
tvSq.setVisibility(View.GONE);
}
if (App.getInstance().getUserInfo() != null && App.getInstance().getUserInfo().getManid() != null) {
if (App.getInstance().getUserInfo().getManid().equals("310569") || App.getInstance().getUserInfo().getManid().equals("ZHPS_Admin") || App.getInstance().getUserInfo().getManid().equals("310674")) {
tvSq.setVisibility(View.VISIBLE);
} else {
tvSq.setVisibility(View.GONE);
if (this.isAdded() && this.isVisible()) {
getAboutMeData();
}
getAboutMeData();
}
}
@ -625,7 +627,7 @@ public class MineFragment extends BaseLazyFragment {
}
private void checkUpdate() {
HttpUtils.getApi(requireActivity()).getCheckUpdataApk().enqueue(new BaseCallBack<ApkUpdateBean>(getActivity()) {
HttpUtils.getApi(context).getCheckUpdataApk().enqueue(new BaseCallBack<ApkUpdateBean>(getActivity()) {
@Override
public void onSuccess(Call<ApkUpdateBean> call, Response<ApkUpdateBean> response) {
ApkUpdateBean apkUpdateBean = response.body();
@ -746,7 +748,7 @@ public class MineFragment extends BaseLazyFragment {
builder.addFormDataPart("file", "headPhoto", RequestBody.create(MediaType.parse("image/*"), fos));
//builder.addFormDataPart("file", "headPhoto", RequestBody.create(MediaType.parse("image/*"), new File(HeadPhotoFilePath)));
HttpUtils.getApi(requireActivity()).updateHeadPhoto("head_up", App.getInstance().getUserInfo().getManid(), ".jpg", builder.build()).enqueue(new BaseCallBack<HeadPhotoResultBean>(getActivity()) {
HttpUtils.getApi(context).updateHeadPhoto("head_up", App.getInstance().getUserInfo().getManid(), ".jpg", builder.build()).enqueue(new BaseCallBack<HeadPhotoResultBean>(getActivity()) {
@Override
public void onSuccess(Call<HeadPhotoResultBean> call, Response<HeadPhotoResultBean> response) {
HeadPhotoResultBean headPhotoResultBean = response.body();
@ -767,7 +769,7 @@ public class MineFragment extends BaseLazyFragment {
//获取我的待办(其他数据)
public void getOtherCount() {
HttpUtils.getApi(requireActivity()).getOther(App.getInstance().getUserInfo().getManid()).enqueue(new BaseCallBack<QtdbBean>(getContext()) {
HttpUtils.getApi(context).getOther(App.getInstance().getUserInfo().getManid()).enqueue(new BaseCallBack<QtdbBean>(getContext()) {
@Override
public void onSuccess(Call<QtdbBean> call, Response<QtdbBean> response) {
QtdbBean bean = response.body();
@ -785,7 +787,7 @@ public class MineFragment extends BaseLazyFragment {
//获取关于我的数据总数量
public void getAboutMeData() {
HttpUtils.getApi(requireActivity()).getAboutMe(App.getInstance().getUserInfo().getManid()).enqueue(new BaseCallBackNoProgress<AboutMeBean>(getActivity()) {
HttpUtils.getApi(context).getAboutMe(App.getInstance().getUserInfo().getManid()).enqueue(new BaseCallBackNoProgress<AboutMeBean>(getActivity()) {
@Override
public void onSuccess(Call<AboutMeBean> call, Response<AboutMeBean> response) {
AboutMeBean bean = response.body();
@ -845,7 +847,9 @@ public class MineFragment extends BaseLazyFragment {
@Override
public void onResume() {
super.onResume();
getAboutMeData();
if (this.isAdded() && this.isVisible()) {
getAboutMeData();
}
}

Loading…
Cancel
Save