Commit 06d60b96 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent a001ccd4
......@@ -15,6 +15,7 @@ class VideoPresenter : BasePresenter<VideoView>() {
fun getVipProducts() {
val vo = HashMap<String, Any>()
vo["isInstallAlipay"] = true
AppHttpManager.getInstance(loanApplication)
.call(loanService.getVipProducts(vo),
object : BaseSubscriber<BaseResponse<VipBean>>() {
......
......@@ -174,16 +174,17 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
episode_tv.text = String.format("共%d集 更新中", it.total)
}
info_tv.text = String.format("第%d集", mVedioBean!!.seeIndex)
if(!UserManager.getInstance().newFlag){
unlock.text = String.format("观看激励视频")
unlock.visibility=View.VISIBLE
tv_title.text = String.format(
"解锁%s·第%d-%d集",
it.title,
mInitUnlockIndex + 1,
mInitUnlockIndex + lockSet
)
}else{
unlock.visibility=View.GONE
}
tv_title.text = if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
tv_info.text = String.format("看激励视频解锁%d集剧情\n请按照顺序解锁", lockSet)
if (mVedioBean!!.collect == 0) {
setCollectImage(zan_iv)
......
......@@ -15,6 +15,7 @@ import com.duben.xixiplaylet.common.Constant
import com.duben.xixiplaylet.manager.LocalVedioManager
import com.duben.xixiplaylet.mvp.model.IndexList
import com.duben.xixiplaylet.mvp.model.NineShowBean
import com.duben.xixiplaylet.mvp.model.VipBean
import com.duben.xixiplaylet.mvp.presenters.VideoPresenter
import com.duben.xixiplaylet.mvp.views.VideoView
import com.duben.xixiplaylet.ui.fragment.base.BaseFragment
......@@ -393,5 +394,9 @@ class DramaTabFragment : BaseFragment(), VideoView {
}
override fun getVipProductSuc(data: VipBean) {
}
}
\ No newline at end of file
......@@ -58,8 +58,10 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override fun initViewsAndEvents() {
videoPresenter.attachView(this)
mVedioBean?.let { videoPresenter.getIndexList("" + it.vedioId) }
videoPresenter.getVipProducts()
initView()
videoPresenter.getVipProducts()
}
override fun getBundleExtras(extras: Bundle?) {
......
......@@ -91,22 +91,20 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
vipBtn.visibility = View.GONE
adBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集1"
} else { // 开通会员解锁
adBtn.visibility = View.GONE
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集2"
}
} else {
adBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text = String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
// 自有剧详情页 会员
adBtn.visibility = View.GONE
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集3"
}
holder.getView<TextView>(R.id.unlock).text = String.format("查看激励视频")
......
......@@ -26,6 +26,7 @@ import com.duben.xixiplaylet.utils.SpanUtils
import com.duben.xixiplaylet.video.tx.VideoModel
import com.duben.library.utils.GlideUtils
import com.duben.library.utils.nodoubleclick.AntiShake
import com.duben.xixiplaylet.common.AppConfig
import com.duben.xixiplaylet.ui.widgets.DialogListener
import com.duben.xixiplaylet.ui.widgets.VideoEpisodeDialog
import kotlinx.android.synthetic.main.activity_new_tx_video.*
......@@ -54,6 +55,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override fun initViewsAndEvents() {
videoPresenter.attachView(this)
videoPresenter.getVipProducts()
mVedioBean?.let { videoPresenter.getIndexList("" + it.vedioId) }
initView()
}
......@@ -230,6 +232,12 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
override fun getVipProductSuc(data: VipBean) {
if (data.list != null && data.list.size > 0) {
AppConfig.firstVipPrice = data.list.get(0).price
}
}
override fun onEpisodeClick(position: Int) {
dialog?.dismiss()
val data = new_super_short_video_view.data
......
......@@ -15,6 +15,7 @@ import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.duben.xixiplaylet.R
import com.duben.xixiplaylet.ad.express.ExpressAdCallback
import com.duben.xixiplaylet.ad.express.ExpressManager
import com.duben.xixiplaylet.common.AppConfig
import com.duben.xixiplaylet.manager.UserManager
import com.duben.xixiplaylet.mvp.model.*
import com.duben.xixiplaylet.utils.UIUtils
......@@ -61,37 +62,18 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
VEDIO3DOS_AD -> { // 观看激励视频解锁
vipBtn.visibility = View.GONE
adBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text = String.format(
"解锁%s·第%d集",
it.title,
holder.adapterPosition + 1
)
holder.getView<TextView>(R.id.tv_info).text = String.format(
"看激励视频解锁1集剧情\n请按照顺序解锁"
)
holder.getView<TextView>(R.id.tv_title).text = if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
}
VEDIO3DOS_PAY -> { // 开通会员解锁
adBtn.visibility = View.GONE
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_info).visibility = View.GONE
vipBtn.setBackgroundResource(R.mipmap.bg_detail_bottom_vip)
holder.getView<TextView>(R.id.tv_title).text =
String.format("解锁%s·全集", it.title)
holder.getView<TextView>(R.id.tv_title).text =if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
}
else -> {
adBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text = String.format(
"解锁%s·第%d-%d集",
it.title,
it.unlockIndex + 1,
it.unlockIndex + it.adGiveVedioNum
)
holder.getView<TextView>(R.id.tv_info).text = String.format(
"看激励视频解锁%d集剧情\n请按照顺序解锁",
it.adGiveVedioNum
)
adBtn.visibility = View.GONE
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text = if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
}
}
......
......@@ -201,14 +201,6 @@
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="试看已结束" />
<Button
android:id="@+id/unlock"
android:layout_width="230dp"
......
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