fix 新用户首次不展示其他窗口,活动页适配

This commit is contained in:
cyh 2024-09-04 18:01:38 +08:00
parent bc803f6a24
commit b8747254e8
5 changed files with 52 additions and 29 deletions

View File

@ -332,6 +332,9 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
.removeValueForKey(BZYConstants.MMKV_KEY_REMEMBER_PASSWORD) .removeValueForKey(BZYConstants.MMKV_KEY_REMEMBER_PASSWORD)
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_REMEMBER_IS_CHECKED, false) MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_REMEMBER_IS_CHECKED, false)
} }
if(TextUtils.isEmpty(username)){
return
}
username_encrypt = AESUtil.byteArrayToHexStr( username_encrypt = AESUtil.byteArrayToHexStr(
AESUtil.encrypt(username) AESUtil.encrypt(username)
) )

View File

@ -106,7 +106,8 @@ class NewMainActivity : BaseActivity() {
lateinit var tv_expire_date: TextView lateinit var tv_expire_date: TextView
private lateinit var drawer: DrawerLayout private lateinit var drawer: DrawerLayout
private lateinit var mainAtyVM: MainAtyVM private lateinit var mainAtyVM: MainAtyVM
private lateinit var activityDialog:ActivityViewDialog private var activityDialog: ActivityViewDialog? = null
companion object { companion object {
//记录心跳失败次数 //记录心跳失败次数
var HEART_BEAT_FAILURE_FREQUENCY = 0 var HEART_BEAT_FAILURE_FREQUENCY = 0
@ -207,7 +208,7 @@ class NewMainActivity : BaseActivity() {
// } // }
mainAtyVM = ViewModelProvider(this).get(MainAtyVM::class.java) mainAtyVM = ViewModelProvider(this).get(MainAtyVM::class.java)
observe(this, mainAtyVM) observe(this, mainAtyVM)
mainAtyVM.getNoticeInfo()
mainAtyVM.getRuningNoticeInfo() mainAtyVM.getRuningNoticeInfo()
mainAtyVM.startHeartBeat() mainAtyVM.startHeartBeat()
initViews() initViews()
@ -224,7 +225,7 @@ class NewMainActivity : BaseActivity() {
startLog() startLog()
// showBindAccount() // showBindAccount()
firstEntry() firstEntry()
activityPopupWindow()
} }
/* /*
@ -252,8 +253,12 @@ class NewMainActivity : BaseActivity() {
} }
} }
} else {
mainAtyVM.getNoticeInfo()
activityPopupWindow()
} }
} }
private fun startLog() { private fun startLog() {
launch(Dispatchers.IO) { launch(Dispatchers.IO) {
@ -465,27 +470,33 @@ class NewMainActivity : BaseActivity() {
} else { } else {
RxToast.error("签到失败:${data.message}") RxToast.error("签到失败:${data.message}")
} }
} else if (httpStatus.reqType== HttpReqType.GetActivity) { } else if (httpStatus.reqType == HttpReqType.GetActivity) {
val data = httpStatus.rsp as GetActivityRsp val data = httpStatus.rsp as GetActivityRsp
if(data.code==200){ if (data.code == 200) {
data.data.let { if (data.data != null) {
if (data.data.data != null) {
if (data.data.data.list.isNotEmpty()) {
data.data.data.list[0].redirectLink.let { data.data.data.list[0].redirectLink.let {
activityDialog= ActivityViewDialog(this,data.data.data.list[0].redirectLink) activityDialog =
activityDialog.showDialog() ActivityViewDialog(this, data.data.data.list[0].redirectLink)
activityDialog.setOnDialogClickListener(object :OnDialogClickListener{ activityDialog?.showDialog()
activityDialog?.setOnDialogClickListener(object :
OnDialogClickListener {
override fun onRechargeClickListener() { override fun onRechargeClickListener() {
//跳转到支付界面 //跳转到支付界面
goRechargeWeb() goRechargeWeb()
} }
override fun onCancelClickListener() { override fun onCancelClickListener() {
activityDialog.dismiss() activityDialog?.dismiss()
} }
}) })
} }
} }
} }
android.util.Log.i("levelData","data:::${data}") }
}
android.util.Log.i("levelData", "data:::${data}")
} }
} }
@ -730,7 +741,10 @@ class NewMainActivity : BaseActivity() {
public fun goBackupRechargeWeb() { public fun goBackupRechargeWeb() {
startActivityForResult(Intent(this@NewMainActivity, BackupRechargeActivity::class.java), REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY) startActivityForResult(
Intent(this@NewMainActivity, BackupRechargeActivity::class.java),
REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY
)
} }
private fun showPayResultDialog() { private fun showPayResultDialog() {
@ -1011,7 +1025,9 @@ class NewMainActivity : BaseActivity() {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY) { if (requestCode == REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY) {
activityDialog.dismiss() if (activityDialog != null) {
activityDialog?.dismiss()
}
showPayResultDialog() showPayResultDialog()
} }
} }

View File

@ -8,7 +8,7 @@ object SystemLogcat {
"Go", "Go",
"DEBUG", "DEBUG",
"AndroidRuntime", "AndroidRuntime",
"ClashMetaForAndroid", "BJM",
"LwIP", "LwIP",
) )

View File

@ -175,7 +175,7 @@ class MainAtyVM : PublicViewMode() {
"pageNum" to "1", "pageNum" to "1",
"pageSize" to "5", "pageSize" to "5",
"clientTypeArray" to "1", "clientTypeArray" to "1",
"moduleType" to "home" "moduleType" to "HOME"
) )
doAsync(HttpReqType.GetActivity) { httpApi.getActivity(params) } doAsync(HttpReqType.GetActivity) { httpApi.getActivity(params) }
} }

View File

@ -7,20 +7,24 @@
<ImageView <ImageView
android:id="@+id/ivActivityImg" android:id="@+id/ivActivityImg"
android:layout_width="match_parent"
android:layout_height="400dp" android:layout_width="0dp"
android:layout_marginStart="5dp" app:layout_constraintWidth_percent="0.95"
android:layout_marginEnd="5dp" app:layout_constraintHeight_percent="0.81"
android:layout_height="0dp"
android:layout_margin="10dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_activity_bg" /> />
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
android:id="@+id/abRecharge" android:id="@+id/abRecharge"
android:layout_width="250dp" android:layout_width="0dp"
android:layout_height="50dp" app:layout_constraintWidth_percent="0.55"
app:layout_constraintHeight_percent="0.11"
android:layout_height="0dp"
android:background="@drawable/activity_bt_shape" android:background="@drawable/activity_bt_shape"
android:text="@string/recharge" android:text="@string/recharge"
android:textColor="@color/white" android:textColor="@color/white"