Commit 004be3c4 authored by fengruiyu's avatar fengruiyu

支付成功之后刷新地图页面问题

parent 2dab4867
......@@ -37,6 +37,14 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
override fun getStatusBarHeightView(): View? {
return null
}
public fun verifyMember(){
if (UserManager.INSTANCE.userIsLogin() && UserManager.INSTANCE.getVipFlag()) {
binding.mainViewpager.setCurrentItem(3, false)
} else {
binding.mainViewpager.setCurrentItem(0, false)
}
}
override fun initData() {
super.initData()
......@@ -112,7 +120,7 @@ private fun BottomNavigationViewEx.init(navigationItemSelectedAction: (Int) -> U
return this
}
private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
private fun ViewPager2.initMain(activity: MainActivity): ViewPager2 {
//是否可滑动
this.isUserInputEnabled = false
//预加载
......@@ -124,7 +132,7 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
return when (position) {
0 -> {
//首页
HomeFragment()
HomeFragment(activity)
}
1 -> {
//广场
......@@ -140,7 +148,7 @@ private fun ViewPager2.initMain(activity: FragmentActivity): ViewPager2 {
else -> {
//首页
HomeFragment()
HomeFragment(activity)
}
}
......
......@@ -25,6 +25,7 @@ import com.mints.street.R
import com.mints.street.bean.MapBean
import com.mints.street.bean.PositioningBean
import com.mints.street.databinding.FragmentHomeBinding
import com.mints.street.main.MainActivity
import com.mints.street.manager.UmengManager
import com.mints.street.widget.ScrollLayout
import com.mints.street.widget.dialog.DialogUtils
......@@ -39,7 +40,7 @@ import me.goldze.mvvmhabit.utils.ToastUtils
* Created by 冯瑞雨 on 2021/7/2.
* 首页页面
*/
class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener {
class HomeFragment(val mainActivity: MainActivity) : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorEventListener {
companion object {
val IS_FIRST_OPEN: String = "isFirstOpen"
}
......@@ -99,6 +100,9 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
uploadDeviceInfo()
}
private fun uploadDeviceInfo() {
UmengManager.initUm()
......@@ -299,6 +303,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
override fun onResume() {
super.onResume()
binding.bmapView.onResume()
mainActivity.verifyMember()
}
override fun onDestroy() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment