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)
MMKV.defaultMMKV().encode(BZYConstants.MMKV_KEY_REMEMBER_IS_CHECKED, false)
}
if(TextUtils.isEmpty(username)){
return
}
username_encrypt = AESUtil.byteArrayToHexStr(
AESUtil.encrypt(username)
)

View File

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

View File

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

View File

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

View File

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