Commit 938fbeec authored by mengcuiguang's avatar mengcuiguang

代码优化

parent cbf1b22f
...@@ -88,7 +88,7 @@ public class MintsApplication extends MultiDexApplication { ...@@ -88,7 +88,7 @@ public class MintsApplication extends MultiDexApplication {
private MiitHelper.AppIdsUpdater appIdsUpdater = new MiitHelper.AppIdsUpdater() { private MiitHelper.AppIdsUpdater appIdsUpdater = new MiitHelper.AppIdsUpdater() {
@Override @Override
public void OnIdsAvalid(@NonNull String ids) { public void OnIdsAvalid(@NonNull String ids) {
System.out.println("mcg __ ++++++ids: " + ids); // System.out.println("mcg __ ++++++ids: " + ids);
oaid = ids; oaid = ids;
} }
}; };
...@@ -233,13 +233,13 @@ public class MintsApplication extends MultiDexApplication { ...@@ -233,13 +233,13 @@ public class MintsApplication extends MultiDexApplication {
@Override @Override
public void onSuccess() { public void onSuccess() {
AppConfig.lyAdSdkInitState = true; AppConfig.lyAdSdkInitState = true;
System.out.println("lyAd success"); // System.out.println("lyAd success");
} }
@Override @Override
public void onFailed(int code) { public void onFailed(int code) {
AppConfig.lyAdSdkInitState = false; AppConfig.lyAdSdkInitState = false;
System.out.println("lyAd fail" + code); // System.out.println("lyAd fail" + code);
} }
}); });
} }
......
...@@ -22,6 +22,7 @@ public class UserTaskMsgBean implements Serializable { ...@@ -22,6 +22,7 @@ public class UserTaskMsgBean implements Serializable {
private boolean cashOut2yuan;// true-提现过2元 private boolean cashOut2yuan;// true-提现过2元
private boolean cashOut5yuan;// true-提现过5元 private boolean cashOut5yuan;// true-提现过5元
private int downLoadTaskOrder;//0-立言前穿山甲后 private int downLoadTaskOrder;//0-立言前穿山甲后
private int firstGiveFriendCoin;//新人金币
private boolean wxDrawFlag;//true可用 false无法使用 private boolean wxDrawFlag;//true可用 false无法使用
private boolean showAdView;//true显示 false隐藏 private boolean showAdView;//true显示 false隐藏
...@@ -308,4 +309,8 @@ public class UserTaskMsgBean implements Serializable { ...@@ -308,4 +309,8 @@ public class UserTaskMsgBean implements Serializable {
public int getRedPacketSecond() { public int getRedPacketSecond() {
return redPacketSecond; return redPacketSecond;
} }
public int getFirstGiveFriendCoin() {
return firstGiveFriendCoin;
}
} }
...@@ -134,42 +134,6 @@ public class LoanPresenter extends BasePresenter<LoanView> { ...@@ -134,42 +134,6 @@ public class LoanPresenter extends BasePresenter<LoanView> {
}); });
} }
/**
* 获取红包状态
*/
public void getRedboxEnter() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.getFallCount(),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.showToast(e.getMessage());
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
view.getRedboxEnterSuc();
break;
default:
view.showToast(message);
break;
}
}
});
}
/** /**
* 获取首页喝水信息 * 获取首页喝水信息
*/ */
......
...@@ -116,14 +116,6 @@ public interface LoanService { ...@@ -116,14 +116,6 @@ public interface LoanService {
@POST("api/getAllFriends") @POST("api/getAllFriends")
Observable<BaseResponse<FriendsRecordBean>> getAllFriends(); Observable<BaseResponse<FriendsRecordBean>> getAllFriends();
/**
* 金币/积分兑换
*
* @return
*/
@POST("api/changeCoin")
Observable<BaseResponse<Object>> changeCoin(@Body Map<String, Object> vo);
/** /**
* 获取用户配置信息 * 获取用户配置信息
* *
...@@ -388,22 +380,6 @@ public interface LoanService { ...@@ -388,22 +380,6 @@ public interface LoanService {
@POST("api/getPayAccoutMsg") @POST("api/getPayAccoutMsg")
Observable<BaseResponse<AlipayBindBean>> getPayAccoutMsg(); Observable<BaseResponse<AlipayBindBean>> getPayAccoutMsg();
/**
* 获取小区疫情信息
*
* @return
*/
@POST("common/queryIllMsg")
Observable<BaseResponse<FallBean>> getFallMsg();
/**
* 小区疫情统计
*
* @return
*/
@POST("common/queryIll/add")
Observable<BaseResponse<Object>> getFallCount();
/** /**
* 绑定邀请码 * 绑定邀请码
* *
...@@ -420,14 +396,6 @@ public interface LoanService { ...@@ -420,14 +396,6 @@ public interface LoanService {
@POST("api/v116/getChallageHallMsg") @POST("api/v116/getChallageHallMsg")
Observable<BaseResponse<UserVersusBean>> getChallageHallMsg(); Observable<BaseResponse<UserVersusBean>> getChallageHallMsg();
/**
* 获取邀请码
*
* @return
*/
@POST("api/v116/baseUserMsg")
Observable<BaseResponse<JsonObject>> getBaseUserMsg();
/** /**
* 提交分享状态 * 提交分享状态
* *
...@@ -508,32 +476,32 @@ public interface LoanService { ...@@ -508,32 +476,32 @@ public interface LoanService {
builder.interceptors().add(okHttpInterceptor); builder.interceptors().add(okHttpInterceptor);
Retrofit retrofit; Retrofit retrofit;
if (BuildConfig.DEBUG) { // if (BuildConfig.DEBUG) {
SPUtil spUtil = SPUtil.getInstance(context); // SPUtil spUtil = SPUtil.getInstance(context);
if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) { // if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) {
spUtil.putString(Constant.LOCAL_IP, "http://39.106.5.102:9082/gs-api/"); // spUtil.putString(Constant.LOCAL_IP, "http://39.106.5.102:9082/gs-api/");
} // }
retrofit = new Retrofit.Builder() // retrofit = new Retrofit.Builder()
.client(builder.build()) // .client(builder.build())
.baseUrl(spUtil.getString(Constant.LOCAL_IP)) // .baseUrl(spUtil.getString(Constant.LOCAL_IP))
.addConverterFactory(GsonConverterFactory.create()) // .addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) // .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build(); // .build();
} else { // } else {
retrofit = new Retrofit.Builder() // retrofit = new Retrofit.Builder()
.client(builder.build()) // .client(builder.build())
.baseUrl(BuildConfig.MainIp) // .baseUrl(BuildConfig.MainIp)
.addConverterFactory(GsonConverterFactory.create()) // .addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) // .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build(); // .build();
} // }
// retrofit = new Retrofit.Builder() retrofit = new Retrofit.Builder()
// .client(builder.build()) .client(builder.build())
// .baseUrl(BuildConfig.MainIp) .baseUrl(BuildConfig.MainIp)
// .addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build(); .build();
return retrofit.create(LoanService.class); return retrofit.create(LoanService.class);
......
...@@ -63,7 +63,7 @@ public class AboutasActivity extends BaseActivity { ...@@ -63,7 +63,7 @@ public class AboutasActivity extends BaseActivity {
case R.id.tv_aboutas_service: case R.id.tv_aboutas_service:
bundle = new Bundle(); bundle = new Bundle();
bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "服务协议"); bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "服务协议");
bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "register.html"); bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "high/register.html");
readyGo(BaseWebActivity.class, bundle); readyGo(BaseWebActivity.class, bundle);
break; break;
case R.id.tv_aboutas_policy: case R.id.tv_aboutas_policy:
......
...@@ -159,6 +159,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo ...@@ -159,6 +159,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
if (llDrawcashBottom != null) { if (llDrawcashBottom != null) {
if (AntiShake.check(llDrawcashBottom.getId())) return; if (AntiShake.check(llDrawcashBottom.getId())) return;
} }
System.out.println("mcg __ drawcash onresume");
drawcashPresenter.getUserTaskMsg(); drawcashPresenter.getUserTaskMsg();
} }
...@@ -218,7 +220,6 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo ...@@ -218,7 +220,6 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
btnDrawcashOne.setEnabled(false); btnDrawcashOne.setEnabled(false);
} }
} else { } else {
btnDrawcashThree.setEnabled(false);
btnDrawcashTwo.setEnabled(false); btnDrawcashTwo.setEnabled(false);
btnDrawcashOne.setEnabled(false); btnDrawcashOne.setEnabled(false);
...@@ -486,8 +487,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo ...@@ -486,8 +487,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
llDrawcashTop.setVisibility(View.VISIBLE); llDrawcashTop.setVisibility(View.VISIBLE);
llDrawcashBottom.setVisibility(View.GONE); llDrawcashBottom.setVisibility(View.GONE);
tvDrawcashHintTop.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币"); tvDrawcashHintTop.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashFriendsTop.setText("可用有效好友数:" + moneyArrBean.getNowFriends()); tvDrawcashFriendsTop.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
} }
} else if (cash == 150 && coin >= 1500000) { } else if (cash == 150 && coin >= 1500000) {
...@@ -497,8 +498,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo ...@@ -497,8 +498,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
llDrawcashTop.setVisibility(View.VISIBLE); llDrawcashTop.setVisibility(View.VISIBLE);
llDrawcashBottom.setVisibility(View.GONE); llDrawcashBottom.setVisibility(View.GONE);
tvDrawcashHintTop.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币"); tvDrawcashHintTop.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashFriendsTop.setText("可用有效好友数:" + moneyArrBean.getNowFriends()); tvDrawcashFriendsTop.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
} }
} else if (cash == 200 && coin >= 2000000) { } else if (cash == 200 && coin >= 2000000) {
if (outMoneyArr != null && outMoneyArr.size() >= 3) { if (outMoneyArr != null && outMoneyArr.size() >= 3) {
...@@ -506,8 +507,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo ...@@ -506,8 +507,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
llDrawcashTop.setVisibility(View.GONE); llDrawcashTop.setVisibility(View.GONE);
llDrawcashBottom.setVisibility(View.VISIBLE); llDrawcashBottom.setVisibility(View.VISIBLE);
tvDrawcashHintBottom.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币"); tvDrawcashHintBottom.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashFriendsBottom.setText("可用有效好友数:" + moneyArrBean.getNowFriends()); tvDrawcashFriendsBottom.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
} }
} else if (cash == 500 && coin >= 5000000) { } else if (cash == 500 && coin >= 5000000) {
...@@ -515,9 +516,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo ...@@ -515,9 +516,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
DrawcashBean.CashOutMoneyArrBean moneyArrBean = outMoneyArr.get(4); DrawcashBean.CashOutMoneyArrBean moneyArrBean = outMoneyArr.get(4);
llDrawcashTop.setVisibility(View.GONE); llDrawcashTop.setVisibility(View.GONE);
llDrawcashBottom.setVisibility(View.VISIBLE); llDrawcashBottom.setVisibility(View.VISIBLE);
tvDrawcashHintBottom.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashHintBottom.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币"); tvDrawcashFriendsBottom.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
tvDrawcashFriendsBottom.setText("可用有效好友数:" + moneyArrBean.getNowFriends());
} }
} else { } else {
llDrawcashTop.setVisibility(View.GONE); llDrawcashTop.setVisibility(View.GONE);
......
...@@ -323,7 +323,7 @@ public class LoginActivity extends BaseActivity implements LoginView { ...@@ -323,7 +323,7 @@ public class LoginActivity extends BaseActivity implements LoginView {
case R.id.tv_login_agreement: case R.id.tv_login_agreement:
bundle = new Bundle(); bundle = new Bundle();
bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "用户注册协议"); bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "用户注册协议");
bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "register.html"); bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "high/register.html");
readyGo(BaseWebActivity.class, bundle); readyGo(BaseWebActivity.class, bundle);
break; break;
case R.id.tv_login_policy: case R.id.tv_login_policy:
......
...@@ -212,7 +212,7 @@ public class WxLoginActivity extends BaseActivity implements WxLoginView, OnLogi ...@@ -212,7 +212,7 @@ public class WxLoginActivity extends BaseActivity implements WxLoginView, OnLogi
case R.id.tv_wxlogin_agreement: case R.id.tv_wxlogin_agreement:
bundle = new Bundle(); bundle = new Bundle();
bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "用户注册协议"); bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "用户注册协议");
bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "register.html"); bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "high/register.html");
readyGo(BaseWebActivity.class, bundle); readyGo(BaseWebActivity.class, bundle);
break; break;
case R.id.tv_wxlogin_policy: case R.id.tv_wxlogin_policy:
......
...@@ -405,9 +405,9 @@ public class MainFragment extends BaseFragment ...@@ -405,9 +405,9 @@ public class MainFragment extends BaseFragment
Bundle bundle; Bundle bundle;
switch (view.getId()) { switch (view.getId()) {
case R.id.tv_fragment_main_whatgold:// 如何赚金币 case R.id.tv_fragment_main_whatgold:// 如何赚金币
System.out.println("mcg __ getPesudoUniqueID:"+ DevicesUtil.getPesudoUniqueID()); // System.out.println("mcg __ getPesudoUniqueID:"+ DevicesUtil.getPesudoUniqueID());
System.out.println("mcg __ getUUID:"+ DevicesUtil.getUUID()); // System.out.println("mcg __ getUUID:"+ DevicesUtil.getUUID());
System.out.println("mcg __ googld device UUID:"+ new DeviceUuidFactory(getContext()).getDeviceUuid().toString()); // System.out.println("mcg __ googld device UUID:"+ new DeviceUuidFactory(getContext()).getDeviceUuid().toString());
readyGo(WhatGoldActivity.class); readyGo(WhatGoldActivity.class);
break; break;
...@@ -586,6 +586,11 @@ public class MainFragment extends BaseFragment ...@@ -586,6 +586,11 @@ public class MainFragment extends BaseFragment
userManager.setAdShowFlag(data.isAdFlag()); userManager.setAdShowFlag(data.isAdFlag());
// 显示游戏文字
tvFragmentMainFriendHint.setText(new SpanUtils().append("每邀一位得")
.append(data.getFirstGiveFriendCoin() + "").setForegroundColor(getResources().getColor(R.color.main_mints))
.create());
// 游戏赚按钮 // 游戏赚按钮
boolean main = getActivity() instanceof MainActivity; boolean main = getActivity() instanceof MainActivity;
if (data.isAdFlag()) { if (data.isAdFlag()) {
...@@ -1308,7 +1313,7 @@ public class MainFragment extends BaseFragment ...@@ -1308,7 +1313,7 @@ public class MainFragment extends BaseFragment
// 显示游戏文字 // 显示游戏文字
tvFragmentMainFriendHint.setText(new SpanUtils().append("每邀一位得") tvFragmentMainFriendHint.setText(new SpanUtils().append("每邀一位得")
.append("3000").setForegroundColor(getResources().getColor(R.color.main_mints)) .append("1000").setForegroundColor(getResources().getColor(R.color.main_mints))
.create()); .create());
// 显示红包动画 // 显示红包动画
...@@ -1370,7 +1375,7 @@ public class MainFragment extends BaseFragment ...@@ -1370,7 +1375,7 @@ public class MainFragment extends BaseFragment
if (dialog != null && dialog.isShowing()) { if (dialog != null && dialog.isShowing()) {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "用户协议"); bundle.putString(BaseWebActivity.BUNDLE_KEY_TITLE, "用户协议");
bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "register.html"); bundle.putString(BaseWebActivity.BUNDLE_KEY_URL, BuildConfig.MainIp + "high/register.html");
readyGo(BaseWebActivity.class, bundle); readyGo(BaseWebActivity.class, bundle);
} }
......
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