隐藏首页部分功能,修改引导页进入默认页为推送页,2.7.2/272
This commit is contained in:
parent
ece2bcc9e8
commit
4085fe2d14
|
|
@ -20,8 +20,8 @@ android {
|
||||||
applicationId "com.cheng.BoLe"
|
applicationId "com.cheng.BoLe"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 271
|
versionCode 272
|
||||||
versionName "2.7.1"
|
versionName "2.7.2"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,10 @@ data class MenuEntity(
|
||||||
companion object {
|
companion object {
|
||||||
fun getHomeMenu(): List<MenuEntity> {
|
fun getHomeMenu(): List<MenuEntity> {
|
||||||
val list = mutableListOf<MenuEntity>()
|
val list = mutableListOf<MenuEntity>()
|
||||||
list.add(MenuEntity("dljz", R.mipmap.ic_home_icon1, "代理记账"))
|
// list.add(MenuEntity("dljz", R.mipmap.ic_home_icon1, "代理记账"))
|
||||||
list.add(MenuEntity("qyzc", R.mipmap.ic_home_icon2, "企业注册"))
|
// list.add(MenuEntity("qyzc", R.mipmap.ic_home_icon2, "企业注册"))
|
||||||
list.add(MenuEntity("bszz", R.mipmap.ic_home_icon3, "标书制作"))
|
// list.add(MenuEntity("bszz", R.mipmap.ic_home_icon3, "标书制作"))
|
||||||
list.add(MenuEntity("zzdb", R.mipmap.ic_home_icon4, "资质代办"))
|
// list.add(MenuEntity("zzdb", R.mipmap.ic_home_icon4, "资质代办"))
|
||||||
UserConfigManager.getBidTypes().forEach {
|
UserConfigManager.getBidTypes().forEach {
|
||||||
when(it.name) {
|
when(it.name) {
|
||||||
"招标公告" -> list.add(MenuEntity(it.id, R.mipmap.ic_home_icon5, it.name))
|
"招标公告" -> list.add(MenuEntity(it.id, R.mipmap.ic_home_icon5, it.name))
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
package com.cheng.blzb.event
|
package com.cheng.blzb.event
|
||||||
|
|
||||||
class PayStatusEvent(var payStatus: PayStatusEnum, var message: String? = "")
|
class PayStatusEvent(var payStatus: PayStatusEnum, var message: String = "")
|
||||||
|
|
@ -7,6 +7,7 @@ import android.text.TextUtils
|
||||||
import android.window.OnBackInvokedDispatcher
|
import android.window.OnBackInvokedDispatcher
|
||||||
import androidx.activity.addCallback
|
import androidx.activity.addCallback
|
||||||
import androidx.core.os.BuildCompat
|
import androidx.core.os.BuildCompat
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
import com.cheng.blzb.R
|
import com.cheng.blzb.R
|
||||||
import com.cheng.blzb.common.EventConstants
|
import com.cheng.blzb.common.EventConstants
|
||||||
import com.cheng.blzb.event.LogoutSuccessEvent
|
import com.cheng.blzb.event.LogoutSuccessEvent
|
||||||
|
|
@ -23,7 +24,11 @@ class MainActivity : BaseActivity() {
|
||||||
|
|
||||||
private var lastBackClickTime = 0L
|
private var lastBackClickTime = 0L
|
||||||
|
|
||||||
override fun getFragment() = MainFragment()
|
override fun getFragment(): Fragment {
|
||||||
|
val fragment = MainFragment()
|
||||||
|
fragment.arguments = intent.extras
|
||||||
|
return fragment
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
|
||||||
|
|
@ -782,11 +782,11 @@ class GuideVipFragment: BaseFragment<FragmentGuideVipBinding, GuideVipViewModel>
|
||||||
private fun setBackPressed() {
|
private fun setBackPressed() {
|
||||||
if (BuildCompat.isAtLeastT()) {
|
if (BuildCompat.isAtLeastT()) {
|
||||||
requireActivity().onBackInvokedDispatcher.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT) {
|
requireActivity().onBackInvokedDispatcher.registerOnBackInvokedCallback(OnBackInvokedDispatcher.PRIORITY_DEFAULT) {
|
||||||
requireActivity().startActivity<MainActivity>()
|
requireActivity().startActivity<MainActivity>(Pair("origin", "bootpage"))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
requireActivity().onBackPressedDispatcher.addCallback(this) {
|
requireActivity().onBackPressedDispatcher.addCallback(this) {
|
||||||
requireActivity().startActivity<MainActivity>()
|
requireActivity().startActivity<MainActivity>(Pair("origin", "bootpage"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ import com.huantansheng.easyphotos.EasyPhotos
|
||||||
|
|
||||||
|
|
||||||
class MainFragment : BaseFragment<FragmentMainBinding, MainViewModel>() {
|
class MainFragment : BaseFragment<FragmentMainBinding, MainViewModel>() {
|
||||||
|
private val origin by lazy { arguments?.getString("origin") ?: "" }
|
||||||
private val tabText = listOf("首页", "推送", "合作商", "我的")
|
private val tabText = listOf("首页", "推送", "合作商", "我的")
|
||||||
private val fragmentList by lazy { mutableListOf<Fragment>() }
|
private val fragmentList by lazy { mutableListOf<Fragment>() }
|
||||||
private val pageAdapter by lazy { BasePageAdapter(childFragmentManager, tabText, fragmentList, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) }
|
private val pageAdapter by lazy { BasePageAdapter(childFragmentManager, tabText, fragmentList, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) }
|
||||||
|
|
@ -101,6 +102,10 @@ class MainFragment : BaseFragment<FragmentMainBinding, MainViewModel>() {
|
||||||
|
|
||||||
override fun initData() {
|
override fun initData() {
|
||||||
super.initData()
|
super.initData()
|
||||||
|
if (origin == "bootpage") {
|
||||||
|
binding.rbPush.isChecked = true
|
||||||
|
}
|
||||||
|
|
||||||
UserConfigManager.userConfig {
|
UserConfigManager.userConfig {
|
||||||
checkVersion()
|
checkVersion()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.cheng.blzb.ui.fragment.main
|
||||||
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import com.cheng.blzb.bean.AreaEntity
|
import com.cheng.blzb.bean.AreaEntity
|
||||||
|
import com.cheng.blzb.bean.UserAuthEntity
|
||||||
import com.cheng.blzb.bean.UserEntity
|
import com.cheng.blzb.bean.UserEntity
|
||||||
import com.cheng.blzb.net.ApiFactory
|
import com.cheng.blzb.net.ApiFactory
|
||||||
import com.example.base.extensions.toast
|
import com.example.base.extensions.toast
|
||||||
|
|
@ -12,9 +13,9 @@ import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
|
|
||||||
class MainViewModel : BaseViewModel() {
|
class MainViewModel : BaseViewModel() {
|
||||||
val userInfoLiveData = MutableLiveData<UserEntity>()
|
val userInfoLiveData = MutableLiveData<UserEntity>()
|
||||||
|
|
||||||
val areaLiveData = MutableLiveData<List<AreaEntity>>()
|
val areaLiveData = MutableLiveData<List<AreaEntity>>()
|
||||||
val getCouponLiveData = MutableLiveData<Int>()
|
val getCouponLiveData = MutableLiveData<Int>()
|
||||||
|
val authLiveData = MutableLiveData<UserAuthEntity>()
|
||||||
|
|
||||||
fun userInfo() {
|
fun userInfo() {
|
||||||
launchOnUiTryCatch({
|
launchOnUiTryCatch({
|
||||||
|
|
@ -78,4 +79,16 @@ class MainViewModel : BaseViewModel() {
|
||||||
L.d(it)
|
L.d(it)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun checkAuth() {
|
||||||
|
launchOnUiTryCatch({
|
||||||
|
val response = ApiFactory.apiService.checkAuth()
|
||||||
|
if (response.status) {
|
||||||
|
authLiveData.postValue(response.data)
|
||||||
|
} else toast(response.message, true)
|
||||||
|
}, {
|
||||||
|
setError(it)
|
||||||
|
L.d(it)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -120,7 +120,7 @@ object PayUtils {
|
||||||
else -> {
|
else -> {
|
||||||
// 该笔订单真实的支付结果,需要依赖服务端的异步通知。
|
// 该笔订单真实的支付结果,需要依赖服务端的异步通知。
|
||||||
L.d("resultStatus=${resultStatus}")
|
L.d("resultStatus=${resultStatus}")
|
||||||
RxBus.defaultInstance.post(PayStatusEvent(PayStatusEnum.PAY_ERROR, resultInfo))
|
RxBus.defaultInstance.post(PayStatusEvent(PayStatusEnum.PAY_ERROR, resultInfo ?: ""))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue