Commit e24bef1a authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 939c3156
......@@ -12,7 +12,6 @@ import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TTPreLoadExpressManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.WnManager
......@@ -181,29 +180,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 新人福利 放到个人中心展示 防止首页红包转动异常
// 设置视频权限
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate}")
// 广告视频数
AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount}")
// 设置视频权重
initAdWeight(data)
// 调用金币视频信息接口
homePresenter.getHomeVedioMsg()
// 手机号登录未绑定微信 弹出界面不能关闭
if (userManager.userIsLogin() && TextUtils.isEmpty(userManager.wxOpenid)) {
if (bindWxDialog == null) {
bindWxDialog = BindWxDialog(requireActivity())
bindWxDialog!!.show()
}
} else {
if (bindWxDialog != null && bindWxDialog!!.isShowing) {
bindWxDialog?.dismiss()
}
}
loginMobileBindWx()
}
override fun getHomeVedioMsgSuc(data: MainVedioMsgBean) {
......@@ -501,4 +485,34 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
})
powerDialog!!.show()
}
/**
* 设置视频权重
*/
private fun initAdWeight(data: UserTaskMsgBean) {
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate}")
// 广告视频数
AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount}")
}
/**
* 手机号登录未绑定微信 弹出界面不能关闭
*/
private fun loginMobileBindWx() {
if (userManager.userIsLogin() && TextUtils.isEmpty(userManager.wxOpenid)) {
if (bindWxDialog == null) {
bindWxDialog = BindWxDialog(requireActivity())
bindWxDialog!!.show()
}
} else {
if (bindWxDialog != null && bindWxDialog!!.isShowing) {
bindWxDialog?.dismiss()
}
}
}
}
\ No newline at end of file
......@@ -817,9 +817,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
myPresenter.cmtShareStatus()
Timer().schedule(1000,{
shareDialog.dismiss()
})
// Timer().schedule(1000,{
// shareDialog.dismiss()
// })
}
})
shareDialog.show()
......
......@@ -168,6 +168,9 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
ToastUtil.show(MintsApplication.getContext(), "请先安装微信")
}
Timer().schedule(1000,{
dismiss()
})
}
private fun shareWechatFavoite() {
......@@ -189,5 +192,8 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
ToastUtil.show(MintsApplication.getContext(), "请先安装微信")
}
Timer().schedule(1000,{
dismiss()
})
}
}
\ No newline at end of file
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