Commit 77018fd6 authored by jyx's avatar jyx

提现页面对接京东h5

parent 95043aa9
......@@ -15,6 +15,25 @@ public class DrawcashBean implements Serializable {
private String remark;
private List<CashOutMoneyArrBean> cashOutMoneyArr;
private VedioRules vedioRules;
private boolean isJDNewUser;
public String getJDUrl() {
return JDUrl;
}
public void setJDUrl(String JDUrl) {
this.JDUrl = JDUrl;
}
private String JDUrl;
public Boolean getIsJDNewUser() {
return isJDNewUser;
}
public void setIsJDNewUser(Boolean isJDNewUser) {
this.isJDNewUser = isJDNewUser;
}
public int getVedioComplete() {
return vedioComplete;
......@@ -84,6 +103,10 @@ public class DrawcashBean implements Serializable {
private double money;
private boolean canCashOut;
public void setCanCashOut(boolean canCashOut) {
this.canCashOut = canCashOut;
}
public int getVedio() {
return vedio;
}
......@@ -92,7 +115,6 @@ public class DrawcashBean implements Serializable {
return money;
}
public boolean isCanCashOut() {
return canCashOut;
}
......
......@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.widget.RadioGroup
import androidx.recyclerview.widget.GridLayoutManager
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
......@@ -36,7 +37,7 @@ import java.util.*
* 时间:2020/10/12 14:37
*/
class DrawcashActivity : BaseActivity(),
DrawcashView, View.OnClickListener, OnItemClickListener, OnLoginListener {
DrawcashView, View.OnClickListener, OnItemClickListener, OnLoginListener, RadioGroup.OnCheckedChangeListener {
private val TAG = DrawcashActivity::class.java.simpleName
......@@ -53,6 +54,8 @@ class DrawcashActivity : BaseActivity(),
private var userConfig: DrawcashBean? = null
private var isLoadRvItem: Boolean = true //是否首次加载rv item
private var isJDNewUser = false
private var jumpJdUrl: String? = null
override fun getContentViewLayoutID() = R.layout.activity_drawcash
......@@ -88,7 +91,6 @@ class DrawcashActivity : BaseActivity(),
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
R.id.tv_right_subtitle -> {
......@@ -123,6 +125,17 @@ class DrawcashActivity : BaseActivity(),
}
R.id.tvDrawcashNext -> {
if (priceList != null && priceList!!.size > 0) {
// 跳转京东金融
if (isJDNewUser) {
jumpJdUrl?.let {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, "京东金融")
bundle.putString(WebActivity.WEB_URL, jumpJdUrl)
readyGo(WebActivity::class.java, bundle)
return
}
}
// 校验当前金币< 选择金币 =提示 去做任务
if (userConfig?.coin!! < priceList!![drawcashAdapter.getPosition()].money * 10000) {
showToast("金币不足,快去做任务吧")
......@@ -178,6 +191,15 @@ class DrawcashActivity : BaseActivity(),
tvDrawcashName.setText(data.nickName)
}
if (data.isJDNewUser) {
jumpJdUrl = data.jdUrl
isJDNewUser = true
rl_drawcash.visibility = View.VISIBLE
rl_drawcash.setOnCheckedChangeListener(this)
} else {
rl_drawcash.visibility = View.GONE
}
// 提现更改权重
initAdWeight(data.vedioRules)
......@@ -194,6 +216,8 @@ class DrawcashActivity : BaseActivity(),
if (isLoadRvItem) {
priceList = data.cashOutMoneyArr
initRvView()
tvDrawJd.isChecked = true
}
val allcoinBig = BigDecimal(data.coin.toString())
val rateBig = BigDecimal("10000")
......@@ -241,7 +265,9 @@ class DrawcashActivity : BaseActivity(),
private fun initRvView() {
val gridLayoutManager = GridLayoutManager(this, 3)
rvCash.layoutManager = gridLayoutManager
drawcashAdapter = priceList?.let { DrawcashAdapter(it, userConfig?.remark!!) }!!
drawcashAdapter = priceList?.let {
DrawcashAdapter(it, userConfig?.remark!!)
}!!
rvCash.adapter = drawcashAdapter
drawcashAdapter.setOnItemClickListener(this)
......@@ -264,7 +290,7 @@ class DrawcashActivity : BaseActivity(),
* 设置视频权重
*/
private fun initAdWeight(data: DrawcashBean.VedioRules) {
vedioAdingManager?.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO, data.fL_VEDIO)
vedioAdingManager.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO, data.fL_VEDIO)
// vedioAdingManager?.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO)
LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} ylhWeight:${data.ylH_VEDIO} sdhzWeight:${data.sdhZ_VEDIO} flWeight:${data.fL_VEDIO}")
// 广告视频数
......@@ -296,6 +322,17 @@ class DrawcashActivity : BaseActivity(),
})
it.show()
}
}
override fun onCheckedChanged(group: RadioGroup?, checkedId: Int) {
if (group?.checkedRadioButtonId == R.id.tvDrawJd) {
if (::drawcashAdapter.isInitialized) {
drawcashAdapter.setIsAllUnEnable(true)
}
} else {
if (::drawcashAdapter.isInitialized) {
drawcashAdapter.setIsAllUnEnable(false)
}
}
}
}
\ No newline at end of file
......@@ -53,6 +53,8 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
private val userManager by lazy { UserManager.getInstance() }
private var mCurrentPosition = 0
private lateinit var mPlayerManager: XmPlayerManager
override fun getContentViewLayoutID() = R.layout.activity_xmly_play
......@@ -355,6 +357,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
R.id.iv_left_icon -> finish()
R.id.play_or_pause -> {
if (mPlayerManager.playListSize == 0) {
mCurrentPosition = 0
mPlayerManager.playList(xmlyData, 0)
return
}
......@@ -368,11 +371,45 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
}
R.id.next_sound -> {
// 下一首
mPlayerManager.playNext()
for (s in mUnlockList) {
if (s == (mCurrentPosition + 2).toString()) {
mPlayerManager.playNext()
return
}
}
showToast("第" + (mCurrentPosition + 2) + "条尚未解锁,点击即可解锁")
// 广告解锁
// if (AppConfig.xmlyAdFlag) {
// readyGo(XmlyAwardActivity::class.java)
// xmlyPlayPresenter.pushXmlyUnlockMsg(userManager.userID, mCategoryId.toString(), mAlbumId.toString(), (mCurrentPosition + 2).toString())
// mUnlockList.add((mCurrentPosition + 2).toString())
// xmlyPlayAdapter.notifyItemChanged(mCurrentPosition + 1)
// } else {
// showToast("解锁失败,请重试")
// }
}
R.id.pre_sound -> {
// 上一首
mPlayerManager.playPre()
for (s in mUnlockList) {
if (s == (mCurrentPosition).toString()) {
mPlayerManager.playPre()
return
}
}
showToast("第" + mCurrentPosition + "条尚未解锁,点击即可解锁")
// 广告解锁
// if (AppConfig.xmlyAdFlag) {
// readyGo(XmlyAwardActivity::class.java)
// xmlyPlayPresenter.pushXmlyUnlockMsg(userManager.userID, mCategoryId.toString(), mAlbumId.toString(), (mCurrentPosition).toString())
// mUnlockList.add((mCurrentPosition).toString())
// xmlyPlayAdapter.notifyItemChanged(mCurrentPosition)
// } else {
// showToast("解锁失败,请重试")
// }
}
}
}
......@@ -423,6 +460,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
override fun onItemClick(position: Int) {
for (s in mUnlockList) {
if (s == (position + 1).toString()) {
mCurrentPosition = position
mPlayerManager.playList(xmlyData, position)
return
}
......
......@@ -13,17 +13,20 @@ import com.mints.goodmoney.mvp.model.DrawcashBean
import com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import java.lang.String
class DrawcashAdapter(val priceList: MutableList<DrawcashBean.CashOutMoneyArrBean>, val remark:kotlin.String) :
class DrawcashAdapter(val priceList: MutableList<DrawcashBean.CashOutMoneyArrBean>, val remark: kotlin.String) :
RecyclerView.Adapter<DrawcashAdapter.ViewHolder>() {
var myPos: Int = 0
var mIsAllUnEnable: Boolean = false
lateinit var context: Context
private var mPriceList: MutableList<DrawcashBean.CashOutMoneyArrBean> = priceList
lateinit var mOnItemClickListener: OnItemClickListener
init {
if (priceList != null && priceList.size > 0) {
for (i in 0..priceList.size - 1) {
if (priceList.size > 0) {
for (i in 0 until priceList.size) {
if (priceList[i].isCanCashOut) {
myPos = i
break
......@@ -66,46 +69,56 @@ class DrawcashAdapter(val priceList: MutableList<DrawcashBean.CashOutMoneyArrBea
// } else {
// holder.llDrawItem.setEnabled(false)
// }
mOnItemClickListener.onItemClick(holder.llDrawItem, position)
notifyDataSetChanged()
if (!mIsAllUnEnable) {
mOnItemClickListener.onItemClick(holder.llDrawItem, position)
notifyDataSetChanged()
}
}
// if (!priceBean.isCanCashOut) {
// holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.black))
// holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.gray))
// holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
// holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
// } else {
// //当前选中
// if (getPosition() == position) {
// holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.white))
// holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.white))
// holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.white))
// holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter_none)
// } else {
// holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.black))
// holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.gray))
// holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
// holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
// }
// }
if (getPosition() == position) {
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter_none)
} else {
if (mIsAllUnEnable || !priceBean.isCanCashOut) {
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.black))
holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
} else {
//当前选中
if (getPosition() == position) {
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter_none)
} else {
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.black))
holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
}
}
if (!mIsAllUnEnable) {
if (getPosition() == position) {
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.white))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter_none)
} else {
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.black))
holder.tvDrawItemHint.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
}
}
holder.itemView.setTag(position)
}
fun setIsAllUnEnable(isAllUnEnable: Boolean) {
mIsAllUnEnable = isAllUnEnable
val newList = mPriceList
mPriceList = newList
notifyDataSetChanged()
}
override fun getItemCount() = priceList.size
fun setOnItemClickListener(listener: OnItemClickListener) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/color_ccc" />
<solid android:color="@color/color_FFDD0C" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_jd_selected" android:state_checked="true" />
<item android:drawable="@drawable/shape_jd_unselected" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/color_ccc" />
<solid android:color="@color/white" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/color_ccc" />
<solid android:color="@color/color_4BB93F" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/shape_wechat_selected" android:state_checked="true" />
<item android:drawable="@drawable/shape_wechat_unselected" android:state_checked="false" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/color_ccc" />
<solid android:color="@color/white" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
......@@ -101,6 +101,52 @@
android:textSize="14sp" />
</RelativeLayout>
<RadioGroup
android:id="@+id/rl_drawcash"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal"
android:visibility="gone">
<RadioButton
android:id="@+id/tvDrawWechat"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:background="@drawable/shape_wechat_selector"
android:button="@null"
android:drawableStart="@mipmap/ic_draw_wx"
android:drawablePadding="-30dp"
android:gravity="center"
android:paddingStart="30dp"
android:text="微信"
android:textColor="@color/black"
android:textSize="14sp" />
<RadioButton
android:id="@+id/tvDrawJd"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:background="@drawable/shape_jd_selector"
android:button="@null"
android:drawableStart="@mipmap/ic_draw_jd"
android:drawablePadding="-30dp"
android:gravity="center"
android:paddingStart="30dp"
android:text="京东"
android:textColor="@color/black"
android:textSize="14sp" />
</RadioGroup>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvCash"
android:layout_width="match_parent"
......
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