Commit ddb9925d authored by mengcuiguang's avatar mengcuiguang

添加提现方式,代码优化

parent ebb71992
...@@ -75,9 +75,6 @@ class InitAppService : IntentService("InitializeService") { ...@@ -75,9 +75,6 @@ class InitAppService : IntentService("InitializeService") {
//logger //logger
initLogger() initLogger()
// 一览视频
initYL()
// 数美 // 数美
ShumeiManager.getInstance().initShumei() ShumeiManager.getInstance().initShumei()
...@@ -142,32 +139,6 @@ class InitAppService : IntentService("InitializeService") { ...@@ -142,32 +139,6 @@ class InitAppService : IntentService("InitializeService") {
} }
} }
/**
* 一览视频
*/
private fun initYL() {
YLUIInit.getInstance()
.setCrashOpen(false)
.setApplication(application)
.setAccessKey("ylxgszgwjrr8")
.setAccessToken("lmnzhm9yjdlc86xiy74cjgixnqpxe4o2")
.build()
//页面个性化配置
YLUIConfig.getInstance() //抖音样式小视频配置
.littleLikeShow(true) //是否显示点赞
.littleShareShow(false) //是否显示分享
.littleComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
//feed流短视频样式配置
.videoComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
.videoLikeShow(false) //是否显示点赞
.videoShareShow(false) //是否显示分享
.followAvailable(false) //关注功能是否可用
.feedAvatarClickable(true) //头像是否支持点击跳转到作者页面
.feedSwipeRefreshEnable(true) //feed是否可以下拉刷新
FeedConfig.getInstance().playerStyle = FeedConfig.STYLE_NATIVE //FeedConfig.STYLE_STYLE_FEED_PLAY当前页面播放
}
/** /**
* 绑定jpush * 绑定jpush
*/ */
......
...@@ -16,6 +16,10 @@ import com.mints.goodmoney.common.Constant; ...@@ -16,6 +16,10 @@ import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.net.LoanService; import com.mints.goodmoney.net.LoanService;
import com.mints.goodmoney.utils.ForegroundOrBackground; import com.mints.goodmoney.utils.ForegroundOrBackground;
import com.mints.goodmoney.utils.SystemUtils; import com.mints.goodmoney.utils.SystemUtils;
import com.yilan.sdk.ui.YLUIInit;
import com.yilan.sdk.ui.configs.CommentConfig;
import com.yilan.sdk.ui.configs.FeedConfig;
import com.yilan.sdk.ui.configs.YLUIConfig;
import rx.Scheduler; import rx.Scheduler;
import rx.schedulers.Schedulers; import rx.schedulers.Schedulers;
...@@ -85,6 +89,9 @@ public class MintsApplication extends MultiDexApplication { ...@@ -85,6 +89,9 @@ public class MintsApplication extends MultiDexApplication {
// 穿山甲 // 穿山甲
// initCsj(); // initCsj();
// 一览视频
initYL();
} }
/** /**
...@@ -101,6 +108,32 @@ public class MintsApplication extends MultiDexApplication { ...@@ -101,6 +108,32 @@ public class MintsApplication extends MultiDexApplication {
TtCsjAdManager.init(this); TtCsjAdManager.init(this);
} }
/**
* 一览视频
*/
private void initYL() {
YLUIInit.getInstance()
.setCrashOpen(false)
.setApplication(this)
.setAccessKey("ylxgszgwjrr8")
.setAccessToken("lmnzhm9yjdlc86xiy74cjgixnqpxe4o2")
.build();
//页面个性化配置
YLUIConfig.getInstance() //抖音样式小视频配置
.littleLikeShow(true) //是否显示点赞
.littleShareShow(false) //是否显示分享
.littleComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
//feed流短视频样式配置
.videoComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
.videoLikeShow(false) //是否显示点赞
.videoShareShow(false) //是否显示分享
.followAvailable(false) //关注功能是否可用
.feedAvatarClickable(true) //头像是否支持点击跳转到作者页面
.feedSwipeRefreshEnable(true); //feed是否可以下拉刷新
FeedConfig.getInstance().setPlayerStyle(FeedConfig.STYLE_NATIVE); //FeedConfig.STYLE_STYLE_FEED_PLAY当前页面播放
}
/** /**
* app退出 * app退出
*/ */
......
...@@ -64,8 +64,8 @@ object Constant { ...@@ -64,8 +64,8 @@ object Constant {
const val FRAGMENT_CLICK_MY = 3 const val FRAGMENT_CLICK_MY = 3
// 协议地址 // 协议地址
var REGISTER_URL = BuildConfig.MainIp + "agreement/register.html"//服务协议 var REGISTER_URL = BuildConfig.MainIp + "gm/register.html"//服务协议
var PRIVACY_URL = BuildConfig.MainIp + "agreement/privacy.html"//隐私协议 var PRIVACY_URL = BuildConfig.MainIp + "gm/privacy.html"//隐私协议
/** /**
......
...@@ -5,74 +5,10 @@ import java.util.List; ...@@ -5,74 +5,10 @@ import java.util.List;
public class DrawcashBean implements Serializable { public class DrawcashBean implements Serializable {
/**
* msg : 微信账户目前正在维护中,预计3月28日前恢复,请优先用支付宝提现。
* realName : null
* wxDrawFlag : true
* surplus : 0
* openid : null
* lastCashOutType : WEIXIN
* cashOutMoneyArr : [{"money":"1","canUseOnce":true,"needFs":2,"nowFriends":0,"fsGiveCoin":800,"once":true,"canCashOut":false},{"money":"100","canUseOnce":true,"needFs":20,"nowFriends":0,"fsGiveCoin":1800,"once":true,"canCashOut":false},{"money":"150","canUseOnce":null,"needFs":30,"nowFriends":0,"fsGiveCoin":2800,"once":false,"canCashOut":false},{"money":"200","canUseOnce":null,"needFs":40,"nowFriends":0,"fsGiveCoin":3800,"once":false,"canCashOut":false},{"money":"500","canUseOnce":null,"needFs":50,"nowFriends":0,"fsGiveCoin":4800,"once":false,"canCashOut":false}]
* coinRate : 10000
* alipayAccount : null
* coin : 5562
*/
private String msg;
private String realName;
private boolean wxDrawFlag;
private int surplus;
private String openid; private String openid;
private String lastCashOutType; private String nickName;
private int coinRate;
private String alipayAccount;
private int coin; private int coin;
private int diamonds;
private int vedioCompleteSum;
private int vedioNeedSum;
private double firstValue;
private List<CashOutMoneyArrBean> cashOutMoneyArr; private List<CashOutMoneyArrBean> cashOutMoneyArr;
private List<CashOutMoneyArrBean> cashOutDiamondsArr;
public int getDiamonds() {
return diamonds;
}
public void setDiamonds(int diamonds) {
this.diamonds = diamonds;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public boolean isWxDrawFlag() {
return wxDrawFlag;
}
public void setWxDrawFlag(boolean wxDrawFlag) {
this.wxDrawFlag = wxDrawFlag;
}
public int getSurplus() {
return surplus;
}
public void setSurplus(int surplus) {
this.surplus = surplus;
}
public String getOpenid() { public String getOpenid() {
return openid; return openid;
...@@ -82,28 +18,12 @@ public class DrawcashBean implements Serializable { ...@@ -82,28 +18,12 @@ public class DrawcashBean implements Serializable {
this.openid = openid; this.openid = openid;
} }
public String getLastCashOutType() { public String getNickName() {
return lastCashOutType; return nickName;
}
public void setLastCashOutType(String lastCashOutType) {
this.lastCashOutType = lastCashOutType;
}
public int getCoinRate() {
return coinRate;
}
public void setCoinRate(int coinRate) {
this.coinRate = coinRate;
}
public String getAlipayAccount() {
return alipayAccount;
} }
public void setAlipayAccount(String alipayAccount) { public void setNickName(String nickName) {
this.alipayAccount = alipayAccount; this.nickName = nickName;
} }
public int getCoin() { public int getCoin() {
...@@ -122,105 +42,18 @@ public class DrawcashBean implements Serializable { ...@@ -122,105 +42,18 @@ public class DrawcashBean implements Serializable {
this.cashOutMoneyArr = cashOutMoneyArr; this.cashOutMoneyArr = cashOutMoneyArr;
} }
public int getVedioCompleteSum() {
return vedioCompleteSum;
}
public void setVedioCompleteSum(int vedioCompleteSum) {
this.vedioCompleteSum = vedioCompleteSum;
}
public int getVedioNeedSum() {
return vedioNeedSum;
}
public void setVedioNeedSum(int vedioNeedSum) {
this.vedioNeedSum = vedioNeedSum;
}
public double getFirstValue() {
return firstValue;
}
public void setFirstValue(double firstValue) {
this.firstValue = firstValue;
}
public List<CashOutMoneyArrBean> getCashOutDiamondsArr() {
return cashOutDiamondsArr;
}
public void setCashOutDiamondsArr(List<CashOutMoneyArrBean> cashOutDiamondsArr) {
this.cashOutDiamondsArr = cashOutDiamondsArr;
}
public class CashOutMoneyArrBean implements Serializable{ public class CashOutMoneyArrBean implements Serializable{
/** private double money;
* money : 1 private boolean canCashOut;
* canUseOnce : true
* needFs : 2 public double getMoney() {
* nowFriends : 0
* fsGiveCoin : 800
* once : true
* canCashOut : false
*/
private int money;
private boolean canUseOnce;//还有没有新人专享的机会
private int needFs;//需要多少朋友才能提现
private int nowFriends;//现在有多少了
private int fsGiveCoin;//朋友可以返给我多少
private boolean once;//是否是新人专享
private boolean canCashOut;//最终能不能提现
public int getMoney() {
return money; return money;
} }
public void setMoney(int money) { public void setMoney(double money) {
this.money = money; this.money = money;
} }
public boolean isCanUseOnce() {
return canUseOnce;
}
public void setCanUseOnce(boolean canUseOnce) {
this.canUseOnce = canUseOnce;
}
public int getNeedFs() {
return needFs;
}
public void setNeedFs(int needFs) {
this.needFs = needFs;
}
public int getNowFriends() {
return nowFriends;
}
public void setNowFriends(int nowFriends) {
this.nowFriends = nowFriends;
}
public int getFsGiveCoin() {
return fsGiveCoin;
}
public void setFsGiveCoin(int fsGiveCoin) {
this.fsGiveCoin = fsGiveCoin;
}
public boolean isOnce() {
return once;
}
public void setOnce(boolean once) {
this.once = once;
}
public boolean isCanCashOut() { public boolean isCanCashOut() {
return canCashOut; return canCashOut;
} }
......
...@@ -213,6 +213,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -213,6 +213,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
switch (code) { switch (code) {
case 200://成功 case 200://成功
view.showToast("提现成功"); view.showToast("提现成功");
getUserTaskMsg();
break; break;
default: default:
view.showToast(message); view.showToast(message);
......
package com.mints.goodmoney.mvp.presenters package com.mints.goodmoney.mvp.presenters
import android.text.TextUtils
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.manager.AppHttpManager import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.manager.ShumeiManager import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.* import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.MainVedioMsgBean
import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.mvp.views.HomeView import com.mints.goodmoney.mvp.views.HomeView
import com.mints.goodmoney.utils.DeviceUuidFactory import com.mints.goodmoney.utils.DeviceUuidFactory
import com.mints.library.net.neterror.BaseSubscriber import com.mints.library.net.neterror.BaseSubscriber
...@@ -71,6 +73,7 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -71,6 +73,7 @@ class HomePresenter : BasePresenter<HomeView>() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
view.showToast(e.message) view.showToast(e.message)
view.getHallBaseMsgFail()
} }
override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) { override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) {
...@@ -79,7 +82,10 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -79,7 +82,10 @@ class HomePresenter : BasePresenter<HomeView>() {
val message = baseResponse.getMessage() val message = baseResponse.getMessage()
when (code) { when (code) {
200 -> view.getHallBaseMsgSuc(baseResponse.getData()) 200 -> view.getHallBaseMsgSuc(baseResponse.getData())
else -> view.showToast(message) else ->{
view.getHallBaseMsgFail()
view.showToast(message)
}
} }
} }
}) })
......
...@@ -55,6 +55,45 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -55,6 +55,45 @@ class LoginPresenter : BasePresenter<LoginView>() {
}) })
} }
/**
* 绑定
*/
fun bindingMobile(mobile: String, smsCode: String) {
view.showLoading("加载中...")
val vo = HashMap<String, Any>()
vo["mobile"] = mobile
vo["smsCode"] = smsCode
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
AppHttpManager.getInstance(loanApplication)
.call(loanService.bindingMobile(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData()
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
view.loginSuc()
}
else -> view.showToast(message)
}
}
})
}
/** /**
* 登录 * 登录
*/ */
......
...@@ -6,5 +6,6 @@ import com.mints.goodmoney.mvp.model.UserTaskMsgBean ...@@ -6,5 +6,6 @@ import com.mints.goodmoney.mvp.model.UserTaskMsgBean
interface HomeView : BaseView { interface HomeView : BaseView {
fun getHallBaseMsgSuc(data: UserTaskMsgBean) fun getHallBaseMsgSuc(data: UserTaskMsgBean)
fun getHallBaseMsgFail()
fun getHomeVedioMsgSuc(data: MainVedioMsgBean) fun getHomeVedioMsgSuc(data: MainVedioMsgBean)
} }
...@@ -150,6 +150,14 @@ public interface LoanService { ...@@ -150,6 +150,14 @@ public interface LoanService {
@POST("api/wechatlogin") @POST("api/wechatlogin")
Observable<BaseResponse<UserBean>> wechatlogin(@Body Map<String, Object> vo); Observable<BaseResponse<UserBean>> wechatlogin(@Body Map<String, Object> vo);
/**
* 手机号绑定
*
* @return
*/
@POST("api/bindingMobile")
Observable<BaseResponse<UserBean>> bindingMobile(@Body Map<String, Object> vo);
/** /**
* 提交任务 * 提交任务
* *
...@@ -203,7 +211,7 @@ public interface LoanService { ...@@ -203,7 +211,7 @@ public interface LoanService {
* *
* @return * @return
*/ */
@POST("api/high/getUserCoinMsg") @POST("api/getUserCoinMsg")
Observable<BaseResponse<DrawcashBean>> getDrawcashUserTaskMsg(); Observable<BaseResponse<DrawcashBean>> getDrawcashUserTaskMsg();
/** /**
......
...@@ -81,7 +81,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -81,7 +81,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant.CARRIER_OFFLINE_DOUBLE -> { Constant.CARRIER_OFFLINE_DOUBLE -> {
tvAwardContent.setText("离线收益奖励" + curCoin + "金币") tvAwardContent.setText("离线收益奖励" + curCoin + "金币")
} }
Constant.CARRIER_SIGNIN_HOMEPAGE_CARD -> { Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD -> {
tvAwardContent.setText("签到奖励" + curCoin + "金币") tvAwardContent.setText("签到奖励" + curCoin + "金币")
} }
Constant.CARRIER_GAME -> { Constant.CARRIER_GAME -> {
......
...@@ -37,10 +37,11 @@ class DrawcashActivity : BaseActivity(), ...@@ -37,10 +37,11 @@ class DrawcashActivity : BaseActivity(),
private val userManager by lazy { UserManager.getInstance() } private val userManager by lazy { UserManager.getInstance() }
private val loginApi by lazy { LoginApi() } private val loginApi by lazy { LoginApi() }
private lateinit var drawcashAdapter: DrawcashAdapter private lateinit var drawcashAdapter: DrawcashAdapter
private var priceList: MutableList<DrawcashBean.CashOutMoneyArrBean>? = null
private var wxInfo: WXInfo? = null private var wxInfo: WXInfo? = null
private var userConfig: DrawcashBean? = null private var userConfig: DrawcashBean? = null
private var isLoadRvItem: Boolean = true//是否首次加载rv item private var isLoadRvItem: Boolean = true //是否首次加载rv item
override fun getContentViewLayoutID() = R.layout.activity_drawcash override fun getContentViewLayoutID() = R.layout.activity_drawcash
...@@ -50,32 +51,9 @@ class DrawcashActivity : BaseActivity(), ...@@ -50,32 +51,9 @@ class DrawcashActivity : BaseActivity(),
tv_activity_title.text = "提现" tv_activity_title.text = "提现"
drawcashPresenter.attachView(this) drawcashPresenter.attachView(this)
initText() initText()
initRvView()
initListener() initListener()
} }
private fun initText() {
tvDrawcashExplain.setText(
SpanUtils()
.append("提现说明:")
.append("\n")
.append("1、所有提现金额【无门槛】直接提现!新用户提现秒到账!")
.append("\n")
.append("2、由于提现需要实名制,非实名用户账号无法支持提现,请务必使用实名认证过的账号提现!")
.append("\n")
.append("3、单笔提现金额最低" + 0.3 + "元,最高" + 1000 + "元。")
.append("\n")
.append("4、提现申请将在3-5个工作日审核到账,请耐心等待。")
.append("\n")
.append("5、每日可申请提现一次,若当日限额已满,请次日申请。")
.append("\n")
.append("6、" + 0.3 + "元-" + 50 + "元,是新人专享福利,每个账号仅可享受一次。")
.create())
tvDrawcashHint.text = "* 如您或好友通过刷机等违规操作获取非法收益,平台将视情况扣除违规所得或冻结账号。" +
"\n* 最终解释权归本公司所有。"
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
...@@ -95,6 +73,10 @@ class DrawcashActivity : BaseActivity(), ...@@ -95,6 +73,10 @@ class DrawcashActivity : BaseActivity(),
when (v?.id) { when (v?.id) {
R.id.tv_activity_back -> finish() R.id.tv_activity_back -> finish()
R.id.tvDrawcashWx -> { R.id.tvDrawcashWx -> {
if (!TextUtils.isEmpty(userConfig?.openid)) {
return
}
val wechat = ShareSDK.getPlatform(Wechat.NAME) val wechat = ShareSDK.getPlatform(Wechat.NAME)
if (!wechat.isClientValid) { if (!wechat.isClientValid) {
showToast("请先安装微信") showToast("请先安装微信")
...@@ -106,30 +88,35 @@ class DrawcashActivity : BaseActivity(), ...@@ -106,30 +88,35 @@ class DrawcashActivity : BaseActivity(),
loginApi.login(this) loginApi.login(this)
} }
R.id.tvDrawcashNext -> { R.id.tvDrawcashNext -> {
// 校验当前金币< 选择金币 =提示 去做任务 if (priceList != null && priceList!!.size > 0) {
// if(userConfig?.coin<) // 校验当前金币< 选择金币 =提示 去做任务
if (userConfig?.coin!! < priceList!![drawcashAdapter?.getPosition()].money * 10000) {
// 是否登录 showToast("金币不足,快去做任务吧")
if (!userManager.userIsLogin()) { return
readyGo(LoginActivity::class.java) }
return
} // 是否登录
if (!userManager.userIsLogin()) {
// 是否绑定手机号 readyGo(LoginActivity::class.java)
if (TextUtils.isEmpty(userManager.mobile)) { return
val bundle = Bundle() }
bundle.putBoolean(Constant.LOGIN_FLAG, true)
readyGo(LoginActivity::class.java, bundle) // 是否绑定手机号
return if (TextUtils.isEmpty(userManager.mobile)) {
val bundle = Bundle()
bundle.putBoolean(Constant.LOGIN_FLAG, true)
readyGo(LoginActivity::class.java, bundle)
return
}
// 授权判断
if (TextUtils.isEmpty(userConfig?.openid)) {
showToast("微信未授权")
return
}
drawcashPresenter.saveTerminalInfo(ps, priceList!![drawcashAdapter?.getPosition()].money)
} }
// 授权判断
if (TextUtils.isEmpty(userConfig?.openid)) {
showToast("微信未授权")
return
}
drawcashPresenter.saveTerminalInfo(ps, 0.0)
} }
} }
} }
...@@ -140,11 +127,14 @@ class DrawcashActivity : BaseActivity(), ...@@ -140,11 +127,14 @@ class DrawcashActivity : BaseActivity(),
tvDrawcashGold.text = "${data.getCoin()}" tvDrawcashGold.text = "${data.getCoin()}"
if (TextUtils.isEmpty(data.openid)) { if (TextUtils.isEmpty(data.openid)) {
tvDrawcashWx.setText("去授权") tvDrawcashWx.setText("去授权")
tvDrawcashName.setText("微信昵称")
} else { } else {
tvDrawcashWx.setText("已授权") tvDrawcashWx.setText("已授权")
tvDrawcashName.setText(data.nickName)
} }
if (isLoadRvItem) { if (isLoadRvItem) {
priceList = data.cashOutMoneyArr
initRvView() initRvView()
} }
} }
...@@ -178,11 +168,32 @@ class DrawcashActivity : BaseActivity(), ...@@ -178,11 +168,32 @@ class DrawcashActivity : BaseActivity(),
return false return false
} }
private fun initText() {
tvDrawcashExplain.setText(
SpanUtils()
.append("提现说明:")
.append("\n")
.append("1、所有提现金额【无门槛】直接提现!新用户提现秒到账!")
.append("\n")
.append("2、由于提现需要实名制,非实名用户账号无法支持提现,请务必使用实名认证过的账号提现!")
.append("\n")
.append("3、单笔提现金额最低" + 0.3 + "元,最高" + 1000 + "元。")
.append("\n")
.append("4、提现申请将在3-5个工作日审核到账,请耐心等待。")
.append("\n")
.append("5、每日可申请提现一次,若当日限额已满,请次日申请。")
.append("\n")
.append("6、" + 0.3 + "元-" + 50 + "元,是新人专享福利,每个账号仅可享受一次。")
.create())
tvDrawcashHint.text = "* 如您或好友通过刷机等违规操作获取非法收益,平台将视情况扣除违规所得或冻结账号。" +
"\n* 最终解释权归本公司所有。"
}
private fun initRvView() { private fun initRvView() {
val gridLayoutManager = GridLayoutManager(this, 3) val gridLayoutManager = GridLayoutManager(this, 3)
rvCash.layoutManager = gridLayoutManager rvCash.layoutManager = gridLayoutManager
// vipAdapter = vipList?.let { VipAdapter(it) }!! drawcashAdapter = priceList?.let { DrawcashAdapter(it) }!!
drawcashAdapter = DrawcashAdapter(null)
rvCash.adapter = drawcashAdapter rvCash.adapter = drawcashAdapter
drawcashAdapter.setOnItemClickListener(this) drawcashAdapter.setOnItemClickListener(this)
......
...@@ -109,9 +109,14 @@ class LoginActivity : BaseActivity() ...@@ -109,9 +109,14 @@ class LoginActivity : BaseActivity()
.request(Manifest.permission.READ_PHONE_STATE) .request(Manifest.permission.READ_PHONE_STATE)
.subscribe { granted: Boolean -> .subscribe { granted: Boolean ->
if (granted) { if (granted) {
// 登录
mobile = mobile.replace(" ".toRegex(), "") mobile = mobile.replace(" ".toRegex(), "")
loginPresenter.login(mobile, code, ps) if (loginFlag) {
loginPresenter.bindingMobile(mobile, code)
} else {
// 登录
loginPresenter.login(mobile, code, ps)
}
} else { } else {
showMissingPermissionDialog("设备") showMissingPermissionDialog("设备")
} }
...@@ -152,10 +157,19 @@ class LoginActivity : BaseActivity() ...@@ -152,10 +157,19 @@ class LoginActivity : BaseActivity()
} }
override fun loginSuc() { override fun loginSuc() {
// false-登录 true-绑定手机号
if (loginFlag) {
showToast("绑定成功")
} else {
showToast("登录成功")
}
if (progressDialog != null) { if (progressDialog != null) {
progressDialog.dismiss() progressDialog.dismiss()
} }
finish() finish()
} }
...@@ -185,6 +199,7 @@ class LoginActivity : BaseActivity() ...@@ -185,6 +199,7 @@ class LoginActivity : BaseActivity()
private fun initView() { private fun initView() {
// false-登录 true-绑定手机号 // false-登录 true-绑定手机号
if (loginFlag) { if (loginFlag) {
tvLoginWx.visibility = View.GONE
tvLoginNext.text = "绑定手机号" tvLoginNext.text = "绑定手机号"
} }
......
...@@ -9,8 +9,10 @@ import android.widget.TextView ...@@ -9,8 +9,10 @@ import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.DrawcashBean
import java.lang.String
class DrawcashAdapter(val drawcashList: MutableList<String>?) : class DrawcashAdapter(val priceList: MutableList<DrawcashBean.CashOutMoneyArrBean>) :
RecyclerView.Adapter<DrawcashAdapter.ViewHolder>() { RecyclerView.Adapter<DrawcashAdapter.ViewHolder>() {
var myPos: Int = 0 var myPos: Int = 0
...@@ -18,6 +20,17 @@ class DrawcashAdapter(val drawcashList: MutableList<String>?) : ...@@ -18,6 +20,17 @@ class DrawcashAdapter(val drawcashList: MutableList<String>?) :
lateinit var mOnItemClickListener: OnItemClickListener lateinit var mOnItemClickListener: OnItemClickListener
init {
if (priceList != null && priceList.size > 0) {
for (i in 0..priceList.size - 1) {
if (priceList[i].isCanCashOut) {
myPos = i
break
}
}
}
}
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val llDrawItem: LinearLayout = view.findViewById(R.id.llDrawItem) val llDrawItem: LinearLayout = view.findViewById(R.id.llDrawItem)
val tvDrawItemCash: TextView = view.findViewById(R.id.tvDrawItemCash) val tvDrawItemCash: TextView = view.findViewById(R.id.tvDrawItemCash)
...@@ -32,29 +45,46 @@ class DrawcashAdapter(val drawcashList: MutableList<String>?) : ...@@ -32,29 +45,46 @@ class DrawcashAdapter(val drawcashList: MutableList<String>?) :
} }
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
// val drawcashBean = drawcashList[position] val priceBean = priceList[position]
if (priceBean.money >= 1) {
holder.tvDrawItemCash.text = "${String.format("%.0f", priceBean.money)}元"
} else {
holder.tvDrawItemCash.text = "${priceBean.money}元"
}
holder.tvDrawItemGold.text = "约${String.format("%.0f", priceBean.money * 10000)}金币"
holder.llDrawItem.setOnClickListener { holder.llDrawItem.setOnClickListener {
mOnItemClickListener?.onItemClick(position) if (priceBean.isCanCashOut) {
notifyDataSetChanged() holder.llDrawItem.setEnabled(true)
mOnItemClickListener.onItemClick(position)
notifyDataSetChanged()
} else {
holder.llDrawItem.setEnabled(false)
}
} }
if (getPosition() == position) { if (!priceBean.isCanCashOut) {
//当前选中 holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.grayc))
holder.tvDrawItemCash.setTextColor(ContextCompat.getColor(context, R.color.white)) holder.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.grayc))
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.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter) holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
} else {
if (getPosition() == position) {
//当前选中
holder.tvDrawItemCash.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.tvDrawItemGold.setTextColor(ContextCompat.getColor(context, R.color.gray))
holder.llDrawItem.setBackgroundResource(R.drawable.shape_vip_adapter)
}
} }
holder.itemView.setTag(position) holder.itemView.setTag(position)
} }
// override fun getItemCount() = drawcashList!!.size override fun getItemCount() = priceList.size
override fun getItemCount() = 15
interface OnItemClickListener { interface OnItemClickListener {
fun onItemClick(position: Int) fun onItemClick(position: Int)
......
...@@ -134,18 +134,23 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList ...@@ -134,18 +134,23 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
} }
// 离线收益 // 离线收益
if (data.offlineBean.offlineIncome > 0) { // if (data.offlineBean.offlineIncome > 0) {
val bundle = Bundle() // val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, data.offlineBean.offlineIncome) // bundle.putInt(Constant.MAIN_CUR_COIN, data.offlineBean.offlineIncome)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_OFFLINE_DOUBLE) // bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_OFFLINE_DOUBLE)
readyGo(AwardActivity::class.java, bundle) // readyGo(AwardActivity::class.java, bundle)
} // }
// 调用金币视频信息接口 // 调用金币视频信息接口
homePresenter.getHomeVedioMsg() homePresenter.getHomeVedioMsg()
} }
override fun getHallBaseMsgFail() {
smallRewardCoin = 0
bigRewardCoin = 0
}
override fun getHomeVedioMsgSuc(data: MainVedioMsgBean) { override fun getHomeVedioMsgSuc(data: MainVedioMsgBean) {
smallRewardCoin = data.smallRewardCoin smallRewardCoin = data.smallRewardCoin
bigRewardCoin = data.bigRewardCoin bigRewardCoin = data.bigRewardCoin
...@@ -178,8 +183,6 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList ...@@ -178,8 +183,6 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
bundle.putInt(Constant.MAIN_CUR_COIN, smallRewardCoin) bundle.putInt(Constant.MAIN_CUR_COIN, smallRewardCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_HOMEVEDIO_SMALL) bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_HOMEVEDIO_SMALL)
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
smallRewardCoin = 0
} }
} }
} }
......
...@@ -24,10 +24,7 @@ import com.mints.goodmoney.manager.UserManager ...@@ -24,10 +24,7 @@ import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.* import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter import com.mints.goodmoney.mvp.presenters.MyPresenter
import com.mints.goodmoney.mvp.views.MyView import com.mints.goodmoney.mvp.views.MyView
import com.mints.goodmoney.ui.activitys.AwardActivity import com.mints.goodmoney.ui.activitys.*
import com.mints.goodmoney.ui.activitys.LoginActivity
import com.mints.goodmoney.ui.activitys.MainActivity
import com.mints.goodmoney.ui.activitys.SettingsActivity
import com.mints.goodmoney.ui.adapter.GvMyAdapter import com.mints.goodmoney.ui.adapter.GvMyAdapter
import com.mints.goodmoney.ui.adapter.MainMyAdapter import com.mints.goodmoney.ui.adapter.MainMyAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment import com.mints.goodmoney.ui.fragment.base.BaseFragment
...@@ -492,7 +489,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -492,7 +489,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
return return
} }
// readyGo(GoldTryActivity::class.java) readyGo(DrawcashActivity::class.java)
} }
R.id.item_title_invitecode -> { R.id.item_title_invitecode -> {
if (userConfig != null) { if (userConfig != null) {
......
...@@ -60,7 +60,7 @@ class BrowserLayout : LinearLayout { ...@@ -60,7 +60,7 @@ class BrowserLayout : LinearLayout {
mWebView!!.settings.builtInZoomControls = true mWebView!!.settings.builtInZoomControls = true
mWebView!!.settings.setSupportMultipleWindows(true) mWebView!!.settings.setSupportMultipleWindows(true)
//将图片调整到适合webview的大小 //将图片调整到适合webview的大小
mWebView!!.settings.useWideViewPort = true mWebView!!.settings.useWideViewPort = false
mWebView!!.settings.loadWithOverviewMode = true mWebView!!.settings.loadWithOverviewMode = true
mWebView!!.settings.setSupportZoom(true) mWebView!!.settings.setSupportZoom(true)
mWebView!!.settings.pluginState = WebSettings.PluginState.ON mWebView!!.settings.pluginState = WebSettings.PluginState.ON
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
android:layout_marginTop="20dp" android:layout_marginTop="26dp"
android:layout_marginRight="30dp" android:layout_marginRight="30dp"
android:background="@drawable/shape_bg_award" android:background="@drawable/shape_bg_award"
android:orientation="vertical"> android:orientation="vertical">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="60dp" android:layout_marginTop="70dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:textColor="@color/black_text" android:textColor="@color/black_text"
android:textSize="18sp" android:textSize="18sp"
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_launcher" /> android:src="@mipmap/ic_award" />
</FrameLayout> </FrameLayout>
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
android:layout_margin="20dp"> android:layout_margin="20dp">
<TextView <TextView
android:id="@+id/tvDrawcashName"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableLeft="@mipmap/ic_draw_wx" android:drawableLeft="@mipmap/ic_draw_wx"
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:gravity="center" android:gravity="center"
android:textSize="14sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
\ 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