Commit 938fbeec authored by mengcuiguang's avatar mengcuiguang

代码优化

parent cbf1b22f
......@@ -88,7 +88,7 @@ public class MintsApplication extends MultiDexApplication {
private MiitHelper.AppIdsUpdater appIdsUpdater = new MiitHelper.AppIdsUpdater() {
@Override
public void OnIdsAvalid(@NonNull String ids) {
System.out.println("mcg __ ++++++ids: " + ids);
// System.out.println("mcg __ ++++++ids: " + ids);
oaid = ids;
}
};
......@@ -233,13 +233,13 @@ public class MintsApplication extends MultiDexApplication {
@Override
public void onSuccess() {
AppConfig.lyAdSdkInitState = true;
System.out.println("lyAd success");
// System.out.println("lyAd success");
}
@Override
public void onFailed(int code) {
AppConfig.lyAdSdkInitState = false;
System.out.println("lyAd fail" + code);
// System.out.println("lyAd fail" + code);
}
});
}
......
......@@ -22,6 +22,7 @@ public class UserTaskMsgBean implements Serializable {
private boolean cashOut2yuan;// true-提现过2元
private boolean cashOut5yuan;// true-提现过5元
private int downLoadTaskOrder;//0-立言前穿山甲后
private int firstGiveFriendCoin;//新人金币
private boolean wxDrawFlag;//true可用 false无法使用
private boolean showAdView;//true显示 false隐藏
......@@ -308,4 +309,8 @@ public class UserTaskMsgBean implements Serializable {
public int getRedPacketSecond() {
return redPacketSecond;
}
public int getFirstGiveFriendCoin() {
return firstGiveFriendCoin;
}
}
......@@ -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 {
@POST("api/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 {
@POST("api/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 {
@POST("api/v116/getChallageHallMsg")
Observable<BaseResponse<UserVersusBean>> getChallageHallMsg();
/**
* 获取邀请码
*
* @return
*/
@POST("api/v116/baseUserMsg")
Observable<BaseResponse<JsonObject>> getBaseUserMsg();
/**
* 提交分享状态
*
......@@ -508,32 +476,32 @@ public interface LoanService {
builder.interceptors().add(okHttpInterceptor);
Retrofit retrofit;
if (BuildConfig.DEBUG) {
SPUtil spUtil = SPUtil.getInstance(context);
if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) {
spUtil.putString(Constant.LOCAL_IP, "http://39.106.5.102:9082/gs-api/");
}
retrofit = new Retrofit.Builder()
.client(builder.build())
.baseUrl(spUtil.getString(Constant.LOCAL_IP))
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build();
} else {
retrofit = new Retrofit.Builder()
.client(builder.build())
.baseUrl(BuildConfig.MainIp)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build();
}
// if (BuildConfig.DEBUG) {
// SPUtil spUtil = SPUtil.getInstance(context);
// if (TextUtils.isEmpty(spUtil.getString(Constant.LOCAL_IP))) {
// spUtil.putString(Constant.LOCAL_IP, "http://39.106.5.102:9082/gs-api/");
// }
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(spUtil.getString(Constant.LOCAL_IP))
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
// } else {
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(BuildConfig.MainIp)
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
// }
// retrofit = new Retrofit.Builder()
// .client(builder.build())
// .baseUrl(BuildConfig.MainIp)
// .addConverterFactory(GsonConverterFactory.create())
// .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
// .build();
retrofit = new Retrofit.Builder()
.client(builder.build())
.baseUrl(BuildConfig.MainIp)
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build();
return retrofit.create(LoanService.class);
......
......@@ -63,7 +63,7 @@ public class AboutasActivity extends BaseActivity {
case R.id.tv_aboutas_service:
bundle = new Bundle();
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);
break;
case R.id.tv_aboutas_policy:
......
......@@ -159,6 +159,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
if (llDrawcashBottom != null) {
if (AntiShake.check(llDrawcashBottom.getId())) return;
}
System.out.println("mcg __ drawcash onresume");
drawcashPresenter.getUserTaskMsg();
}
......@@ -218,7 +220,6 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
btnDrawcashOne.setEnabled(false);
}
} else {
btnDrawcashThree.setEnabled(false);
btnDrawcashTwo.setEnabled(false);
btnDrawcashOne.setEnabled(false);
......@@ -486,8 +487,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
llDrawcashTop.setVisibility(View.VISIBLE);
llDrawcashBottom.setVisibility(View.GONE);
tvDrawcashHintTop.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币");
tvDrawcashFriendsTop.setText("可用有效好友数:" + moneyArrBean.getNowFriends());
tvDrawcashHintTop.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashFriendsTop.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
}
} else if (cash == 150 && coin >= 1500000) {
......@@ -497,8 +498,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
llDrawcashTop.setVisibility(View.VISIBLE);
llDrawcashBottom.setVisibility(View.GONE);
tvDrawcashHintTop.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币");
tvDrawcashFriendsTop.setText("可用有效好友数:" + moneyArrBean.getNowFriends());
tvDrawcashHintTop.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashFriendsTop.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
}
} else if (cash == 200 && coin >= 2000000) {
if (outMoneyArr != null && outMoneyArr.size() >= 3) {
......@@ -506,8 +507,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
llDrawcashTop.setVisibility(View.GONE);
llDrawcashBottom.setVisibility(View.VISIBLE);
tvDrawcashHintBottom.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币");
tvDrawcashFriendsBottom.setText("可用有效好友数:" + moneyArrBean.getNowFriends());
tvDrawcashHintBottom.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashFriendsBottom.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
}
} else if (cash == 500 && coin >= 5000000) {
......@@ -515,9 +516,8 @@ public class DrawcashActivity extends BaseActivity implements DrawcashView, OnLo
DrawcashBean.CashOutMoneyArrBean moneyArrBean = outMoneyArr.get(4);
llDrawcashTop.setVisibility(View.GONE);
llDrawcashBottom.setVisibility(View.VISIBLE);
tvDrawcashHintBottom.setText("每新邀请" + moneyArrBean.getNeedFs() + "位有效好友即可提现,提现成功立返" + moneyArrBean.getFsGiveCoin() + "金币");
tvDrawcashFriendsBottom.setText("可用有效好友数:" + moneyArrBean.getNowFriends());
tvDrawcashHintBottom.setText("邀请" + moneyArrBean.getNeedFs() + "位好友且每位好友获得" + moneyArrBean.getFsGiveCoin() + "金币即可提现");
tvDrawcashFriendsBottom.setText("可用有效好友数: " + moneyArrBean.getNowFriends() + " / " + moneyArrBean.getNeedFs());
}
} else {
llDrawcashTop.setVisibility(View.GONE);
......
......@@ -323,7 +323,7 @@ public class LoginActivity extends BaseActivity implements LoginView {
case R.id.tv_login_agreement:
bundle = new Bundle();
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);
break;
case R.id.tv_login_policy:
......
......@@ -212,7 +212,7 @@ public class WxLoginActivity extends BaseActivity implements WxLoginView, OnLogi
case R.id.tv_wxlogin_agreement:
bundle = new Bundle();
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);
break;
case R.id.tv_wxlogin_policy:
......
......@@ -405,9 +405,9 @@ public class MainFragment extends BaseFragment
Bundle bundle;
switch (view.getId()) {
case R.id.tv_fragment_main_whatgold:// 如何赚金币
System.out.println("mcg __ getPesudoUniqueID:"+ DevicesUtil.getPesudoUniqueID());
System.out.println("mcg __ getUUID:"+ DevicesUtil.getUUID());
System.out.println("mcg __ googld device UUID:"+ new DeviceUuidFactory(getContext()).getDeviceUuid().toString());
// System.out.println("mcg __ getPesudoUniqueID:"+ DevicesUtil.getPesudoUniqueID());
// System.out.println("mcg __ getUUID:"+ DevicesUtil.getUUID());
// System.out.println("mcg __ googld device UUID:"+ new DeviceUuidFactory(getContext()).getDeviceUuid().toString());
readyGo(WhatGoldActivity.class);
break;
......@@ -586,6 +586,11 @@ public class MainFragment extends BaseFragment
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;
if (data.isAdFlag()) {
......@@ -1308,7 +1313,7 @@ public class MainFragment extends BaseFragment
// 显示游戏文字
tvFragmentMainFriendHint.setText(new SpanUtils().append("每邀一位得")
.append("3000").setForegroundColor(getResources().getColor(R.color.main_mints))
.append("1000").setForegroundColor(getResources().getColor(R.color.main_mints))
.create());
// 显示红包动画
......@@ -1370,7 +1375,7 @@ public class MainFragment extends BaseFragment
if (dialog != null && dialog.isShowing()) {
Bundle bundle = new Bundle();
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);
}
......
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