正在查看: 微商客 v2.1.2 应用的 HomeNewFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 微商客 v2.1.2 应用的 HomeNewFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.jianzhen.wsk.ui;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.alipay.sdk.app.PayTask;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jianzhen.wsk.BaseFragment;
import com.jianzhen.wsk.R;
import com.jianzhen.wsk.base.FunIdConstant;
import com.jianzhen.wsk.bean.PayResult;
import com.jianzhen.wsk.dialog.BaseDialog;
import com.jianzhen.wsk.dialog.BottomVipDialog;
import com.jianzhen.wsk.dialog.NoticeDialog;
import com.jianzhen.wsk.dialog.XyTipDialog;
import com.jianzhen.wsk.net.ErrorBean;
import com.jianzhen.wsk.net.api.ApiEngine;
import com.jianzhen.wsk.net.api.Constant;
import com.jianzhen.wsk.net.api.RequestData;
import com.jianzhen.wsk.net.bean.BaseBean;
import com.jianzhen.wsk.net.bean.FunctionBean;
import com.jianzhen.wsk.net.bean.GetFunctionLimit;
import com.jianzhen.wsk.net.bean.HomeFunDataBean;
import com.jianzhen.wsk.net.bean.LoginBean;
import com.jianzhen.wsk.net.bean.VipListBean;
import com.jianzhen.wsk.net.bean.WxPayBean;
import com.jianzhen.wsk.net.rxjava.ResultSubscriber;
import com.jianzhen.wsk.ui.HomeNewFragment;
import com.jianzhen.wsk.ui.addfriend.AddNearbyFriendActivity;
import com.jianzhen.wsk.ui.addfriend.FriendPassActivity;
import com.jianzhen.wsk.ui.addfriend.GroupInAddFriendActivity;
import com.jianzhen.wsk.ui.addfriend.PhoneNumberAddFriendActivity;
import com.jianzhen.wsk.ui.addfriend.TakePhotoAddFriendActivity;
import com.jianzhen.wsk.ui.detection.AccountActiveActivity;
import com.jianzhen.wsk.ui.detection.SeeWhoDeletedMeNewActivity;
import com.jianzhen.wsk.ui.friendscircle.CopyFriendActivity;
import com.jianzhen.wsk.ui.friendscircle.ForwardMomentsActivity;
import com.jianzhen.wsk.ui.friendscircle.SendMomentsActivity;
import com.jianzhen.wsk.ui.groupsend.BatchSendActivity;
import com.jianzhen.wsk.ui.groupsend.CollectSendActivity;
import com.jianzhen.wsk.ui.groupsend.FriendsByFriendsSendActivity;
import com.jianzhen.wsk.ui.groupsend.GroupCycleSend;
import com.jianzhen.wsk.ui.groupsend.ImgTextSendActivity;
import com.jianzhen.wsk.ui.groupsend.VideoSendActivity;
import com.jianzhen.wsk.ui.hk.DyCommentActivity;
import com.jianzhen.wsk.ui.hk.DyToCommentActivity;
import com.jianzhen.wsk.ui.hk.DyToHostCommentActivity;
import com.jianzhen.wsk.ui.hk.KSToCommentActivity;
import com.jianzhen.wsk.ui.hk.KSToHostCommentActivity;
import com.jianzhen.wsk.ui.hk.KsCommentActivity;
import com.jianzhen.wsk.ui.hk.SphCommentActivity;
import com.jianzhen.wsk.ui.hk.XhsCommentActivity;
import com.jianzhen.wsk.ui.hk.XhsToCommentActivity;
import com.jianzhen.wsk.ui.hk.XhsToHostCommentActivity;
import com.jianzhen.wsk.ui.login.LoginActivity;
import com.jianzhen.wsk.ui.set.NoticeActivity;
import com.jianzhen.wsk.utils.DataSaveUtils;
import com.jianzhen.wsk.utils.SharedPreferencesUtil;
import com.jianzhen.wsk.utils.Utils;
import com.jianzhen.wsk.utils.WeChatLoginAndPayUtils;
import com.jianzhen.wsk.v1.activity.DyAccountActiveActivity;
import com.jianzhen.wsk.v1.activity.WxAcceptGroupActivity;
import com.jianzhen.wsk.v1.activity.WxClearGroupMessageActivity;
import com.jianzhen.wsk.v1.activity.WxClearMessageActivity;
import com.jianzhen.wsk.v1.activity.WxDeleteFriendActivity;
import com.jianzhen.wsk.v1.activity.WxDeleteGroupImActivity;
import com.jianzhen.wsk.v1.activity.WxFriendInteractActivity;
import com.jianzhen.wsk.v1.activity.WxGroupNoticeActivity;
import com.jianzhen.wsk.v1.activity.WxGroupRemarkActivity;
import com.jianzhen.wsk.v1.activity.WxGroupToSaveActivity;
import com.jianzhen.wsk.v1.activity.WxMore2OneActivity;
import com.jianzhen.wsk.v1.activity.WxOne2MoreActivity;
import com.jianzhen.wsk.v1.activity.WxSportsInteractActivity;
import com.umeng.analytics.MobclickAgent;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action0;
import rx.schedulers.Schedulers;
public class HomeNewFragment extends BaseFragment {
private static final int SDK_PAY_FLAG = 1;
private RecyclerView addFriendRv;
private RecyclerView connectionsRv;
private TextView isVipTv;
private TextView marqueeText;
private String noticeStr;
private TextView openVipTv;
private RecyclerView otherRv;
private RecyclerView sendGroupRv;
private LinearLayout tipLay1;
private LinearLayout tipLay2;
private LinearLayout tipLay3;
private LinearLayout tipLay4;
private LinearLayout tipLay5;
private LinearLayout tipLay6;
private String vipPrice;
private TextView vipTimeTv;
private String vipType;
private List<FunctionBean> topFunctionBeans = new ArrayList();
private List<FunctionBean> sendGroupFunctionBeans = new ArrayList();
private List<FunctionBean> addFriendFunctionBeans = new ArrayList();
private List<FunctionBean> otherFunctionBeans = new ArrayList();
private List<FunctionBean> connectionsFunctionBeans = new ArrayList();
private int vipStatus = 0;
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message message) {
if (message.what == 1) {
PayResult payResult = new PayResult((Map) message.obj);
payResult.getResult();
String resultStatus = payResult.getResultStatus();
if (TextUtils.equals(resultStatus, "9000")) {
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) "支付成功", 0).show();
BaseFragment.startIntent(HomeNewFragment.this.getActivity(), VipBuySuccessActivity.class);
return;
}
if (TextUtils.equals(resultStatus, "6001")) {
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) "支付取消", 0).show();
return;
}
if (TextUtils.equals(resultStatus, "6002")) {
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) "网络连接出错", 0).show();
return;
}
if (TextUtils.equals(resultStatus, "4000")) {
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) "支付失败", 0).show();
} else {
if (TextUtils.equals(resultStatus, "8000") || TextUtils.equals(resultStatus, "6004") || TextUtils.equals(resultStatus, "6006")) {
return;
}
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) "支付出错了,请稍后再试!!", 0).show();
}
}
}
};
private List<VipListBean.ResultBean> vipListBeans = new ArrayList();
private VipListBean.ResultBean yearVipData = new VipListBean.ResultBean();
private final Handler mmHandler = new AnonymousClass11(Looper.getMainLooper());
public static class NoticeBean {
public String noticeStr;
}
@Override
protected int setLayoutResourceId() {
return R.layout.fragment_home_new;
}
@Override
protected void initView() {
super.initView();
this.marqueeText = (TextView) this.mRootView.findViewById(R.id.marqueeText);
setNotice();
this.sendGroupRv = this.mRootView.findViewById(R.id.group_send_rv);
this.addFriendRv = this.mRootView.findViewById(R.id.add_friend_rv);
this.otherRv = this.mRootView.findViewById(R.id.other_tool_rv);
this.connectionsRv = this.mRootView.findViewById(R.id.connections_tool_rv);
this.tipLay1 = (LinearLayout) this.mRootView.findViewById(R.id.home_top_lay_1);
this.tipLay2 = (LinearLayout) this.mRootView.findViewById(R.id.home_top_lay_2);
this.tipLay3 = (LinearLayout) this.mRootView.findViewById(R.id.home_top_lay_3);
this.tipLay4 = (LinearLayout) this.mRootView.findViewById(R.id.home_top_lay_4);
this.tipLay5 = (LinearLayout) this.mRootView.findViewById(R.id.home_top_lay_5);
this.tipLay6 = (LinearLayout) this.mRootView.findViewById(R.id.home_top_lay_6);
this.isVipTv = (TextView) this.mRootView.findViewById(R.id.is_vip_tv);
this.vipTimeTv = (TextView) this.mRootView.findViewById(R.id.vip_time);
this.openVipTv = (TextView) this.mRootView.findViewById(R.id.open_vip);
this.mRootView.findViewById(R.id.vip_lay).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.this.lambda$initView$0(view);
}
});
setFunctionData();
getHideFunc();
getMembersList();
}
public void lambda$initView$0(View view) {
if (!DataSaveUtils.isLogin(getActivity())) {
startIntent(getActivity(), LoginActivity.class);
} else {
startIntent(getActivity(), VipActivity.class);
}
}
public void onResume() {
super.onResume();
setVip();
}
private void setVip() {
LoginBean.ResultBean loginData = DataSaveUtils.getLoginData(getActivity());
if (DataSaveUtils.isLogin(getActivity()) && loginData != null) {
int membership = DataSaveUtils.getLoginData(getActivity()).getMembership();
this.vipStatus = membership;
if (membership == 0) {
this.isVipTv.setText("当前暂未开通会员");
this.vipTimeTv.setText("开通会员,畅享更多会员特权");
this.openVipTv.setText("立即开通");
return;
} else if (membership == 1) {
this.isVipTv.setText("已开通会员");
this.vipTimeTv.setText("会员到期时间:" + DataSaveUtils.getLoginData(getActivity()).getMembershipExpireTime());
this.openVipTv.setText("续费会员");
return;
} else {
if (membership == 2) {
this.isVipTv.setText("会员已到期");
this.vipTimeTv.setText("会员到期时间:" + DataSaveUtils.getLoginData(getActivity()).getMembershipExpireTime());
this.openVipTv.setText("续费会员");
return;
}
return;
}
}
this.isVipTv.setText("当前暂未开通会员");
this.vipTimeTv.setText("开通会员,畅享更多会员特权");
this.openVipTv.setText("立即开通");
}
public void setTopTools() {
boolean z = false;
boolean z2 = false;
boolean z3 = false;
boolean z4 = false;
boolean z5 = false;
for (FunctionBean functionBean : this.topFunctionBeans) {
if (functionBean.id.equals("10001")) {
z = true;
}
if (functionBean.id.equals("10062")) {
z2 = true;
}
if (functionBean.id.equals(FunIdConstant.WHO_DELETE_ME)) {
z3 = true;
}
if (functionBean.id.equals("10020")) {
z4 = true;
}
if (functionBean.id.equals("10024")) {
z5 = true;
}
}
this.tipLay1.setVisibility(z ? 0 : 8);
this.tipLay2.setVisibility(z2 ? 0 : 8);
this.tipLay3.setVisibility(z3 ? 0 : 8);
this.tipLay4.setVisibility(z4 ? 0 : 8);
this.tipLay5.setVisibility(z5 ? 0 : 8);
this.tipLay1.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.this.lambda$setTopTools$1(view);
}
});
this.tipLay2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.this.lambda$setTopTools$2(view);
}
});
this.tipLay3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.this.lambda$setTopTools$3(view);
}
});
this.tipLay4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.this.lambda$setTopTools$4(view);
}
});
this.tipLay5.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.this.lambda$setTopTools$5(view);
}
});
}
public void lambda$setTopTools$1(View view) {
setIntent("10001");
}
public void lambda$setTopTools$2(View view) {
setIntent("10062");
}
public void lambda$setTopTools$3(View view) {
setIntent(FunIdConstant.WHO_DELETE_ME);
}
public void lambda$setTopTools$4(View view) {
setIntent("10020");
}
public void lambda$setTopTools$5(View view) {
setIntent("10024");
}
private View addHeaderView(RecyclerView recyclerView, String str) {
View inflate = getLayoutInflater().inflate(R.layout.item_func_title, (ViewGroup) recyclerView, false);
((TextView) inflate.findViewById(R.id.item_title)).setText(str);
return inflate;
}
public void setGroupRv() {
this.sendGroupRv.setLayoutManager(new GridLayoutManager(getActivity(), 4));
FuncAdapter funcAdapter = new FuncAdapter(R.layout.item_function_list, this.sendGroupFunctionBeans);
this.sendGroupRv.setAdapter(funcAdapter);
funcAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
public final void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
HomeNewFragment.this.lambda$setGroupRv$6(baseQuickAdapter, view, i);
}
});
if (!this.sendGroupFunctionBeans.isEmpty()) {
funcAdapter.addHeaderView(addHeaderView(this.sendGroupRv, "群发工具"));
this.sendGroupRv.setVisibility(0);
} else {
this.sendGroupRv.setVisibility(8);
}
}
public void lambda$setGroupRv$6(BaseQuickAdapter baseQuickAdapter, View view, int i) {
setIntent(this.sendGroupFunctionBeans.get(i).id);
}
public void setAddRv() {
this.connectionsRv.setLayoutManager(new GridLayoutManager(getActivity(), 4));
FuncAdapter funcAdapter = new FuncAdapter(R.layout.item_function_list, this.connectionsFunctionBeans);
this.connectionsRv.setAdapter(funcAdapter);
funcAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
public void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
HomeNewFragment homeNewFragment = HomeNewFragment.this;
homeNewFragment.setIntent(((FunctionBean) homeNewFragment.connectionsFunctionBeans.get(i)).id);
}
});
if (!this.connectionsFunctionBeans.isEmpty()) {
funcAdapter.addHeaderView(addHeaderView(this.connectionsRv, "人脉拓展"));
this.connectionsRv.setVisibility(0);
} else {
this.connectionsRv.setVisibility(8);
}
}
public void setAddFriendRv() {
this.addFriendRv.setLayoutManager(new GridLayoutManager(getActivity(), 4));
FuncAdapter funcAdapter = new FuncAdapter(R.layout.item_function_list, this.addFriendFunctionBeans);
this.addFriendRv.setAdapter(funcAdapter);
funcAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
public final void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
HomeNewFragment.this.lambda$setAddFriendRv$7(baseQuickAdapter, view, i);
}
});
if (!this.addFriendFunctionBeans.isEmpty()) {
funcAdapter.addHeaderView(addHeaderView(this.addFriendRv, "获客工具"));
this.addFriendRv.setVisibility(0);
} else {
this.addFriendRv.setVisibility(8);
}
}
public void lambda$setAddFriendRv$7(BaseQuickAdapter baseQuickAdapter, View view, int i) {
setIntent(this.addFriendFunctionBeans.get(i).id);
}
public void setOtherToolsRv() {
this.otherRv.setLayoutManager(new GridLayoutManager(getActivity(), 4));
FuncAdapter funcAdapter = new FuncAdapter(R.layout.item_function_list, this.otherFunctionBeans);
this.otherRv.setAdapter(funcAdapter);
funcAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
public final void onItemClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
HomeNewFragment.this.lambda$setOtherToolsRv$8(baseQuickAdapter, view, i);
}
});
if (!this.otherFunctionBeans.isEmpty()) {
funcAdapter.addHeaderView(addHeaderView(this.otherRv, "其他工具"));
this.otherRv.setVisibility(0);
} else {
this.otherRv.setVisibility(8);
}
}
public void lambda$setOtherToolsRv$8(BaseQuickAdapter baseQuickAdapter, View view, int i) {
setIntent(this.otherFunctionBeans.get(i).id);
}
public void setIntent(final String str) {
if (!DataSaveUtils.isLogin(getActivity())) {
startIntent(getActivity(), LoginActivity.class);
return;
}
int i = 0;
if (!SharedPreferencesUtil.getBoolean(getActivity(), "isWxToolsAgreement", false) && this.vipStatus != 0) {
new XyTipDialog(getActivity(), i) {
@Override
protected void sureOk(int i2) {
super.sureOk(i2);
HomeNewFragment.this.goIntent(str);
HomeNewFragment.this.agreeDataRequest();
}
}.show();
} else {
MobclickAgent.onEvent(getActivity(), "home_" + str);
goIntent(str);
}
}
public void goIntent(String str) {
str.hashCode();
switch (str) {
case "10001":
ImgTextSendActivity.startActivity(getActivity(), str);
break;
case "10002":
case "10004":
case "10005":
case "10006":
case "10007":
case "10008":
CollectSendActivity.startActivity(getActivity(), str);
break;
case "10003":
VideoSendActivity.startActivity(getActivity(), str);
break;
case "10010":
FriendsByFriendsSendActivity.startActivity(getActivity(), FunIdConstant.FRIEND_TO_ONE_BUY_ONE);
break;
case "10011":
startIntent(getActivity(), ForwardMomentsActivity.class);
break;
case "10012":
startIntent(getActivity(), SmsSendActivity.class);
break;
case "10013":
startIntent(getActivity(), SYMainActivity.class);
break;
case "10015":
startIntent(getActivity(), SeeWhoDeletedMeNewActivity.class);
break;
case "10016":
startIntent(getActivity(), GroupInAddFriendActivity.class);
break;
case "10017":
startIntent(getActivity(), PhoneNumberAddFriendActivity.class);
break;
case "10018":
startIntent(getActivity(), TakePhotoAddFriendActivity.class);
break;
case "10019":
startIntent(getActivity(), AddNearbyFriendActivity.class);
break;
case "10020":
case "10024":
case "10025":
case "10026":
case "10027":
case "10029":
case "10030":
case "10031":
case "10032":
case "10033":
case "10065":
case "10072":
case "10073":
case "10074":
case "10075":
case "10076":
case "10077":
case "10078":
case "10080":
case "10081":
case "10083":
getFuncLimit(str);
break;
case "10021":
startIntent(getActivity(), SendMomentsActivity.class);
break;
case "10022":
startIntent(getActivity(), FriendPassActivity.class);
break;
case "10028":
startIntent(getActivity(), BatchSendActivity.class);
break;
case "10062":
startIntent(getActivity(), CopyFriendActivity.class);
break;
case "10063":
startIntent(getActivity(), AccountActiveActivity.class);
break;
case "10082":
startIntent(getActivity(), WxGroupToSaveActivity.class);
break;
case "10085":
startIntent(getActivity(), WxGroupNoticeActivity.class);
break;
case "10086":
startIntent(getActivity(), WxAcceptGroupActivity.class);
break;
}
}
private void setFunctionData() {
this.topFunctionBeans.add(new FunctionBean("10001", getString(R.string.img_text_send_title), R.mipmap.home_icon_11, "精准获客,高效拓客一键达成"));
this.topFunctionBeans.add(new FunctionBean("10062", getString(R.string.more_friend_circle_title), R.mipmap.home_icon_1, "一键群发,解放双手,高效稳定"));
this.topFunctionBeans.add(new FunctionBean(FunIdConstant.WHO_DELETE_ME, "看谁删了我", R.mipmap.home_icon_17, "一键检测,精准清理无效人脉"));
this.topFunctionBeans.add(new FunctionBean("10020", getString(R.string.dy_hk_title), R.mipmap.home_icon_12, "轻松拓宽人脉,无限商机尽在掌握"));
this.topFunctionBeans.add(new FunctionBean("10024", getString(R.string.xhs_sy_tip), R.mipmap.home_icon_18, "一键转发,轻松复制爆款文案"));
this.sendGroupFunctionBeans.add(new FunctionBean("10002", getString(R.string.collect_send_title), R.mipmap.home_icon_2, "收藏群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10028", getString(R.string.friend_batch_send_title), R.mipmap.home_icon_3, "分批群发"));
this.sendGroupFunctionBeans.add(new FunctionBean(FunIdConstant.FRIEND_TO_ONE_BUY_ONE, getString(R.string.friend_one2one_send_title), R.mipmap.home_icon_33, "好友逐一群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10004", getString(R.string.url_send_title), R.mipmap.home_icon_4, "链接群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10003", getString(R.string.video_send_title), R.mipmap.img_7, "视频群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10006", getString(R.string.xcx_send_title), R.mipmap.home_icon_4, "小程序群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10005", getString(R.string.card_send_title), R.mipmap.home_icon_mp, "名片群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10008", getString(R.string.video_number_send_title), R.mipmap.img_77, "视频号群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10007", getString(R.string.gzh_send_title), R.mipmap.home_icon_5, "公众号群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10012", getString(R.string.sms_title), R.mipmap.home_icon_8, "短信群发"));
this.sendGroupFunctionBeans.add(new FunctionBean("10065", getString(R.string.group_cycle_title), R.mipmap.group_cycle_cion, "循环群发"));
this.connectionsFunctionBeans.add(new FunctionBean(FunIdConstant.PHONE_NUM_ADD_FRIED, getString(R.string.phone_add_title), R.mipmap.home_icon_13, "手机号加人"));
this.connectionsFunctionBeans.add(new FunctionBean("10018", getString(R.string.take_add_title), R.mipmap.home_icon_14, "拍照加人"));
this.connectionsFunctionBeans.add(new FunctionBean(FunIdConstant.GROUP_IN_ADD_FRIEND, getString(R.string.group_add_title), R.mipmap.group_add, "群加人"));
this.connectionsFunctionBeans.add(new FunctionBean("10019", getString(R.string.nearby_add_title), R.mipmap.home_icon_15, "附近的人"));
this.connectionsFunctionBeans.add(new FunctionBean("10072", getString(R.string.group_remark), R.mipmap.set_group_remarket, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10080", getString(R.string.more_to_single_group), R.mipmap.more_to_one_group, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10081", getString(R.string.single_to_more_group), R.mipmap.more_to_one_group, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10077", getString(R.string.delete_friend), R.mipmap.delete_friends, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10076", getString(R.string.delete_group), R.mipmap.finish_group, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10078", getString(R.string.clear_group_message), R.mipmap.delete_group_message, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10083", getString(R.string.clear_message), R.mipmap.delete_group_message, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10085", getString(R.string.group_notice), R.mipmap.set_group_remarket, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10082", getString(R.string.group_save_book), R.mipmap.more_to_one_group, ""));
this.connectionsFunctionBeans.add(new FunctionBean(FunIdConstant.WHO_DELETE_ME, "看谁删了我", R.mipmap.home_icon_7, "一键检测,精准清理无效人脉"));
this.connectionsFunctionBeans.add(new FunctionBean("10073", getString(R.string.wx_circle_zan), R.mipmap.friend_circle_zan, ""));
this.connectionsFunctionBeans.add(new FunctionBean("10074", getString(R.string.wx_sport_zan), R.mipmap.wx_sport_zan, ""));
this.connectionsFunctionBeans.add(new FunctionBean(FunIdConstant.FUN_CIRCLE_ID, getString(R.string.friend_circle_title), R.mipmap.home_icon_6, "转发单条朋友圈"));
this.connectionsFunctionBeans.add(new FunctionBean("10062", getString(R.string.more_friend_circle_title), R.mipmap.home_icon_6, "多条朋友圈"));
this.connectionsFunctionBeans.add(new FunctionBean("10086", getString(R.string.accept_group), R.mipmap.more_to_one_group, ""));
this.addFriendFunctionBeans.add(new FunctionBean("10075", getString(R.string.dy_active), R.mipmap.dy_active, "抖音账号活跃"));
this.addFriendFunctionBeans.add(new FunctionBean("10020", getString(R.string.dy_hk_title), R.mipmap.home_icon_11, "精准获客,高效拓客一键达成"));
this.addFriendFunctionBeans.add(new FunctionBean("10025", getString(R.string.ks_hk_title), R.mipmap.kuaishou, "快手获客"));
this.addFriendFunctionBeans.add(new FunctionBean("10024", getString(R.string.xhs_hk_title), R.mipmap.hong, "小红书获客"));
this.addFriendFunctionBeans.add(new FunctionBean("10027", getString(R.string.sph_hk_title), R.mipmap.sph_hk_icon, "视频号获客"));
this.addFriendFunctionBeans.add(new FunctionBean("10026", getString(R.string.dy_comment_title), R.mipmap.dy_comment_icon, "抖音评论获客"));
this.addFriendFunctionBeans.add(new FunctionBean("10029", getString(R.string.dy_more_comment_title), R.mipmap.dy_pl_comment_icon, "抖音批量评论"));
this.addFriendFunctionBeans.add(new FunctionBean("10030", getString(R.string.xhs_comment_title), R.mipmap.hong2, "小红书评论获客"));
this.addFriendFunctionBeans.add(new FunctionBean("10031", getString(R.string.xhs_more_comment_title), R.mipmap.hong3, "小红书批量评论"));
this.addFriendFunctionBeans.add(new FunctionBean("10032", getString(R.string.ks_comment_title), R.mipmap.kuaishou2, "快手评论获客"));
this.addFriendFunctionBeans.add(new FunctionBean("10033", getString(R.string.ks_more_comment_title), R.mipmap.kuaishou3, "快手批量评论"));
this.otherFunctionBeans.add(new FunctionBean("10022", "通过好友验证", R.mipmap.home_icon_16, "通过好友验证"));
this.otherFunctionBeans.add(new FunctionBean("10063", "账号活跃", R.mipmap.img_8, "账号活跃"));
this.otherFunctionBeans.add(new FunctionBean("10021", "不折叠发圈", R.mipmap.home_icon_19, "发朋友圈"));
}
public void getHideFunc() {
ApiEngine.getInstance().getApiService().getHideFuncs(RequestData.get()).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(new ResultSubscriber<HomeFunDataBean>() {
@Override
public void onError(ErrorBean errorBean) {
}
@Override
public void onData(HomeFunDataBean homeFunDataBean) {
if (homeFunDataBean.getCode() == 200) {
if (homeFunDataBean.getResult().size() > 0) {
for (HomeFunDataBean.ResultBean resultBean : homeFunDataBean.getResult()) {
Iterator it = HomeNewFragment.this.sendGroupFunctionBeans.iterator();
while (true) {
if (it.hasNext()) {
FunctionBean functionBean = (FunctionBean) it.next();
if (resultBean.getFuncCode().equals(functionBean.id)) {
HomeNewFragment.this.sendGroupFunctionBeans.remove(functionBean);
break;
}
}
}
}
for (HomeFunDataBean.ResultBean resultBean2 : homeFunDataBean.getResult()) {
Iterator it2 = HomeNewFragment.this.addFriendFunctionBeans.iterator();
while (true) {
if (it2.hasNext()) {
FunctionBean functionBean2 = (FunctionBean) it2.next();
if (resultBean2.getFuncCode().equals(functionBean2.id)) {
HomeNewFragment.this.addFriendFunctionBeans.remove(functionBean2);
break;
}
}
}
}
for (HomeFunDataBean.ResultBean resultBean3 : homeFunDataBean.getResult()) {
Iterator it3 = HomeNewFragment.this.otherFunctionBeans.iterator();
while (true) {
if (it3.hasNext()) {
FunctionBean functionBean3 = (FunctionBean) it3.next();
if (resultBean3.getFuncCode().equals(functionBean3.id)) {
HomeNewFragment.this.otherFunctionBeans.remove(functionBean3);
break;
}
}
}
}
for (HomeFunDataBean.ResultBean resultBean4 : homeFunDataBean.getResult()) {
Iterator it4 = HomeNewFragment.this.connectionsFunctionBeans.iterator();
while (true) {
if (it4.hasNext()) {
FunctionBean functionBean4 = (FunctionBean) it4.next();
if (resultBean4.getFuncCode().equals(functionBean4.id)) {
HomeNewFragment.this.connectionsFunctionBeans.remove(functionBean4);
break;
}
}
}
}
for (HomeFunDataBean.ResultBean resultBean5 : homeFunDataBean.getResult()) {
Iterator it5 = HomeNewFragment.this.topFunctionBeans.iterator();
while (true) {
if (it5.hasNext()) {
FunctionBean functionBean5 = (FunctionBean) it5.next();
if (resultBean5.getFuncCode().equals(functionBean5.id)) {
HomeNewFragment.this.topFunctionBeans.remove(functionBean5);
break;
}
}
}
}
Iterator<HomeFunDataBean.ResultBean> it6 = homeFunDataBean.getResult().iterator();
while (true) {
if (it6.hasNext()) {
if (it6.next().getFuncCode().equals("50003")) {
Constant.customerServiceWithWx = false;
break;
}
} else {
break;
}
}
Iterator<HomeFunDataBean.ResultBean> it7 = homeFunDataBean.getResult().iterator();
while (true) {
if (it7.hasNext()) {
if (it7.next().getFuncCode().equals("50004")) {
Constant.isTestUp = false;
break;
}
} else {
break;
}
}
Iterator<HomeFunDataBean.ResultBean> it8 = homeFunDataBean.getResult().iterator();
while (true) {
if (it8.hasNext()) {
if (it8.next().getFuncCode().equals("50010")) {
HomeNewFragment.this.sendGroupFunctionBeans.clear();
break;
}
} else {
break;
}
}
Iterator<HomeFunDataBean.ResultBean> it9 = homeFunDataBean.getResult().iterator();
while (true) {
if (it9.hasNext()) {
if (it9.next().getFuncCode().equals("50011")) {
HomeNewFragment.this.connectionsFunctionBeans.clear();
break;
}
} else {
break;
}
}
Iterator<HomeFunDataBean.ResultBean> it10 = homeFunDataBean.getResult().iterator();
while (true) {
if (it10.hasNext()) {
if (it10.next().getFuncCode().equals("50012")) {
HomeNewFragment.this.addFriendFunctionBeans.clear();
break;
}
} else {
break;
}
}
Iterator<HomeFunDataBean.ResultBean> it11 = homeFunDataBean.getResult().iterator();
while (true) {
if (it11.hasNext()) {
if (it11.next().getFuncCode().equals("50013")) {
HomeNewFragment.this.otherFunctionBeans.clear();
break;
}
} else {
break;
}
}
}
HomeNewFragment.this.setGroupRv();
HomeNewFragment.this.setAddRv();
HomeNewFragment.this.setAddFriendRv();
HomeNewFragment.this.setOtherToolsRv();
HomeNewFragment.this.setTopTools();
}
}
});
}
private static class FuncAdapter extends BaseQuickAdapter<FunctionBean, BaseViewHolder> {
public FuncAdapter(int i, List<FunctionBean> list) {
super(i, list);
}
public void convert(BaseViewHolder baseViewHolder, FunctionBean functionBean) {
ImageView imageView = (ImageView) baseViewHolder.getView(R.id.item_iv);
ImageView imageView2 = (ImageView) baseViewHolder.getView(R.id.item_tip_iv);
TextView textView = (TextView) baseViewHolder.getView(R.id.item_name);
imageView2.setVisibility(4);
if (functionBean.id.equals("10001") || functionBean.id.equals("10002") || functionBean.id.equals(FunIdConstant.FUN_CIRCLE_ID)) {
imageView2.setVisibility(0);
imageView2.setImageResource(R.mipmap.hot);
}
if (functionBean.id.equals("10020")) {
imageView2.setVisibility(0);
imageView2.setImageResource(R.mipmap.huoke);
}
if (functionBean.id.equals("10024")) {
imageView2.setVisibility(0);
if (Utils.isAchieveTime()) {
imageView2.setImageResource(R.mipmap.huoke);
} else {
imageView2.setImageResource(R.mipmap.new_icon);
}
}
if (functionBean.id.equals("10025")) {
imageView2.setVisibility(0);
if (Utils.isAchieveTime()) {
imageView2.setImageResource(R.mipmap.huoke);
} else {
imageView2.setImageResource(R.mipmap.new_icon);
}
}
if (functionBean.id.equals("10026")) {
imageView2.setVisibility(0);
if (Utils.isAchieveTime()) {
imageView2.setImageResource(R.mipmap.huoke);
} else {
imageView2.setImageResource(R.mipmap.new_icon);
}
}
if (functionBean.id.equals("10027")) {
imageView2.setVisibility(0);
if (Utils.isAchieveTime()) {
imageView2.setImageResource(R.mipmap.huoke);
} else {
imageView2.setImageResource(R.mipmap.new_icon);
}
}
textView.setText(functionBean.name);
imageView.setImageResource(functionBean.imgUrl);
}
}
public void goPay(boolean z, boolean z2) {
if (!DataSaveUtils.isLogin(getActivity())) {
startIntent(getActivity(), LoginActivity.class);
return;
}
String str = this.yearVipData.getMembershipShopId() + "";
this.vipType = this.yearVipData.getMembershipName();
if (z2) {
Intent intent = new Intent((Context) getActivity(), (Class<?>) ScanCodePayActivity.class);
intent.putExtra("vipNameStr", this.vipType);
intent.putExtra("vipPriceStr", this.yearVipData.getMembershipAliPrice() + "");
startActivity(intent);
return;
}
if (z) {
this.vipPrice = this.yearVipData.getMembershipAliPrice() + "";
aliPayOrder(str);
} else {
this.vipPrice = this.yearVipData.getMembershipWxPrice() + "";
wxPayOrder(str);
}
}
private void aliPayOrder(String str) {
showProgressDialog(getActivity(), "支付中。。。");
ArrayList arrayList = new ArrayList();
arrayList.add(new RequestData.RequestPar("membershipShopId", str));
ApiEngine.getInstance().getApiService().aliPayOrder(RequestData.get(arrayList)).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribeOn(AndroidSchedulers.mainThread()).doOnTerminate(new Action0() {
public final void call() {
HomeNewFragment.this.dismissProgressDialog();
}
}).subscribeOn(AndroidSchedulers.mainThread()).subscribe(new ResultSubscriber<WxPayBean>() {
@Override
public void onError(ErrorBean errorBean) {
HomeNewFragment.this.dismissProgressDialog();
}
@Override
public void onData(final WxPayBean wxPayBean) {
if (wxPayBean.getCode() == 200) {
HomeNewFragment.this.setOrderDetails(wxPayBean.getResult().getOrderNo(), wxPayBean.getResult().getOrderTime());
new Thread(new Runnable() {
@Override
public void run() {
Map payV2 = new PayTask(HomeNewFragment.this.getActivity()).payV2(wxPayBean.getResult().getOrderStr(), true);
Message message = new Message();
message.what = 1;
message.obj = payV2;
HomeNewFragment.this.mHandler.sendMessage(message);
}
}).start();
} else {
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) wxPayBean.getMsg(), 0).show();
}
}
});
}
private void wxPayOrder(String str) {
showProgressDialog(getActivity(), "支付中。。。");
ArrayList arrayList = new ArrayList();
arrayList.add(new RequestData.RequestPar("membershipShopId", str));
ApiEngine.getInstance().getApiService().wxPayOrder(RequestData.get(arrayList)).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribeOn(AndroidSchedulers.mainThread()).doOnTerminate(new Action0() {
public final void call() {
HomeNewFragment.this.dismissProgressDialog();
}
}).subscribeOn(AndroidSchedulers.mainThread()).subscribe(new ResultSubscriber<WxPayBean>() {
@Override
public void onError(ErrorBean errorBean) {
HomeNewFragment.this.dismissProgressDialog();
}
@Override
public void onData(WxPayBean wxPayBean) {
if (wxPayBean.getCode() == 200) {
WxPayBean.ResultBean result = wxPayBean.getResult();
new WeChatLoginAndPayUtils(HomeNewFragment.this.getActivity()).senWxPayRequest(result.getMchId(), result.getPrepayId(), result.getNonceStr(), result.getTimeStamp(), result.getSign());
HomeNewFragment.this.setOrderDetails(result.getOrderNo(), result.getOrderTime());
return;
}
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) wxPayBean.getMsg(), 0).show();
}
});
}
public void setOrderDetails(String str, String str2) {
SharedPreferencesUtil.putString(getActivity(), "orderNo", str);
SharedPreferencesUtil.putString(getActivity(), "orderTime", str2);
SharedPreferencesUtil.putString(getActivity(), "vipType", this.vipType);
SharedPreferencesUtil.putString(getActivity(), "vipPrice", this.vipPrice);
}
public void getMembersList() {
ApiEngine.getInstance().getApiService().getMemberships(RequestData.get()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribeOn(AndroidSchedulers.mainThread()).doOnTerminate(new Action0() {
public final void call() {
HomeNewFragment.this.dismissProgressDialog();
}
}).subscribeOn(AndroidSchedulers.mainThread()).subscribe(new ResultSubscriber<VipListBean>() {
@Override
public void onError(ErrorBean errorBean) {
HomeNewFragment.this.dismissProgressDialog();
}
@Override
public void onData(VipListBean vipListBean) {
if (vipListBean.getCode() == 200) {
HomeNewFragment.this.vipListBeans = vipListBean.getResult();
for (VipListBean.ResultBean resultBean : HomeNewFragment.this.vipListBeans) {
if (resultBean.getMembershipType().equals("300")) {
HomeNewFragment.this.yearVipData = resultBean;
}
}
}
}
});
}
public void getFuncLimit(final String str) {
showProgressDialog(getActivity(), "");
ArrayList arrayList = new ArrayList();
arrayList.add(new RequestData.RequestPar("funcCode", str));
ApiEngine.getInstance().getApiService().getFuncLimit(RequestData.get(arrayList)).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribeOn(AndroidSchedulers.mainThread()).doOnTerminate(new Action0() {
public final void call() {
HomeNewFragment.this.dismissProgressDialog();
}
}).subscribeOn(AndroidSchedulers.mainThread()).subscribe(new ResultSubscriber<GetFunctionLimit>() {
@Override
public void onError(ErrorBean errorBean) {
HomeNewFragment.this.dismissProgressDialog();
}
@Override
public void onData(GetFunctionLimit getFunctionLimit) {
if (getFunctionLimit.getCode() == 200) {
String membership = getFunctionLimit.getResult().getMembership();
if (getFunctionLimit.getResult().getLimitType() == 0) {
HomeNewFragment.this.startDy(true, str, 3);
return;
}
membership.hashCode();
switch (membership) {
case "0":
if (getFunctionLimit.getResult().getLimitType() <= getFunctionLimit.getResult().getCount()) {
HomeNewFragment.this.startDy(false, str, 1);
break;
} else {
HomeNewFragment.this.startDy(false, str, 0);
break;
}
case "1":
if (!getFunctionLimit.getResult().getYearMembership().equals("1")) {
if (getFunctionLimit.getResult().getLimitType() > getFunctionLimit.getResult().getCount()) {
HomeNewFragment.this.startDy(false, str, 0);
break;
} else {
HomeNewFragment.this.startDy(false, str, 1);
break;
}
} else {
HomeNewFragment.this.startDy(true, str, 3);
break;
}
case "2":
HomeNewFragment.this.startDy(false, str, 2);
break;
}
return;
}
Toast.makeText((Context) HomeNewFragment.this.getActivity(), (CharSequence) getFunctionLimit.getMsg(), 0).show();
}
});
}
public void startDy(boolean z, String str, int i) {
if (z) {
str.hashCode();
switch (str) {
case "10020":
startIntent(getActivity(), DyCommentActivity.class);
break;
case "10024":
startIntent(getActivity(), XhsCommentActivity.class);
break;
case "10025":
startIntent(getActivity(), KsCommentActivity.class);
break;
case "10026":
startIntent(getActivity(), DyToCommentActivity.class);
break;
case "10027":
startIntent(getActivity(), SphCommentActivity.class);
break;
case "10029":
startIntent(getActivity(), DyToHostCommentActivity.class);
break;
case "10030":
startIntent(getActivity(), XhsToCommentActivity.class);
break;
case "10031":
startIntent(getActivity(), XhsToHostCommentActivity.class);
break;
case "10032":
startIntent(getActivity(), KSToCommentActivity.class);
break;
case "10033":
startIntent(getActivity(), KSToHostCommentActivity.class);
break;
case "10065":
startIntent(getActivity(), GroupCycleSend.class);
break;
case "10072":
startIntent(getActivity(), WxGroupRemarkActivity.class);
break;
case "10073":
startIntent(getActivity(), WxFriendInteractActivity.class);
break;
case "10074":
startIntent(getActivity(), WxSportsInteractActivity.class);
break;
case "10075":
startIntent(getActivity(), DyAccountActiveActivity.class);
break;
case "10076":
startIntent(getActivity(), WxDeleteGroupImActivity.class);
break;
case "10077":
startIntent(getActivity(), WxDeleteFriendActivity.class);
break;
case "10078":
startIntent(getActivity(), WxClearGroupMessageActivity.class);
break;
case "10080":
startIntent(getActivity(), WxMore2OneActivity.class);
break;
case "10081":
startIntent(getActivity(), WxOne2MoreActivity.class);
break;
case "10083":
startIntent(getActivity(), WxClearMessageActivity.class);
break;
}
}
new BottomVipDialog(getActivity(), this.yearVipData.getMembershipAliPrice() + "", this.yearVipData.getMembershipWxPrice() + "", i, str) {
@Override
protected void payOk(boolean z2, boolean z3) {
super.payOk(z2, z3);
HomeNewFragment.this.goPay(z2, z3);
}
}.show();
}
private void showToolsAgreementTip(final String str) {
final BaseDialog baseDialog = new BaseDialog(getActivity());
baseDialog.setTitleText("工具协议");
baseDialog.setContentText("微商客工具专门设计来帮助用户更高效地管理其客户群体。我们郑重提醒您必须严格遵循平台的所有相关规定,绝不允许利用该工具传播任何违法或违规信息。一经发现,我们将立即终止服务并举报至相关监管部门处理。");
baseDialog.setLeftButton("拒绝", -1, new View.OnClickListener() {
@Override
public final void onClick(View view) {
BaseDialog.this.dismiss();
}
});
baseDialog.setRightButton("我同意", -1, new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.this.lambda$showToolsAgreementTip$14(str, baseDialog, view);
}
});
baseDialog.show();
}
public void lambda$showToolsAgreementTip$14(String str, BaseDialog baseDialog, View view) {
SharedPreferencesUtil.putBoolean(getActivity(), "wxToolsAgreement", true);
goIntent(str);
baseDialog.dismiss();
}
private void setNotice() {
getNotice();
}
private void getNotice() {
new Thread() {
@Override
public void run() {
super.run();
try {
Response execute = new OkHttpClient().newCall(new Request.Builder().url("http://cdn.usfriend.cn/wsk/notice/notice.txt").build()).execute();
String str = "";
if (execute.body() != null) {
str = execute.body().string();
}
NoticeBean noticeBean = (NoticeBean) JSON.parseObject(str, NoticeBean.class);
HomeNewFragment.this.noticeStr = noticeBean.noticeStr;
if (HomeNewFragment.this.noticeStr == null || HomeNewFragment.this.noticeStr.isEmpty()) {
return;
}
Message message = new Message();
message.what = 100;
HomeNewFragment.this.mmHandler.sendMessage(message);
} catch (Exception e) {
e.printStackTrace();
}
}
}.start();
}
class AnonymousClass11 extends Handler {
AnonymousClass11(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
if (message.what == 100) {
new NoticeDialog(HomeNewFragment.this.getActivity(), HomeNewFragment.this.noticeStr).show();
HomeNewFragment.this.marqueeText.setSelected(true);
HomeNewFragment.this.marqueeText.setText(HomeNewFragment.this.noticeStr);
HomeNewFragment.this.marqueeText.setVisibility(0);
HomeNewFragment.this.marqueeText.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNewFragment.AnonymousClass11.this.lambda$handleMessage$0(view);
}
});
}
}
public void lambda$handleMessage$0(View view) {
BaseFragment.startIntent(HomeNewFragment.this.getActivity(), NoticeActivity.class);
}
}
public void agreeDataRequest() {
if (SharedPreferencesUtil.getBoolean(getActivity(), "agree", false)) {
return;
}
ApiEngine.getInstance().getApiService().agree(RequestData.get(new ArrayList())).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(new ResultSubscriber<BaseBean>() {
@Override
public void onError(ErrorBean errorBean) {
}
@Override
public void onData(BaseBean baseBean) {
if (baseBean.getCode() == 200) {
SharedPreferencesUtil.putBoolean(HomeNewFragment.this.getActivity(), "agree", true);
}
}
});
}
}