This commit is contained in:
2020-08-14 18:20:31 +08:00
parent 95debe68f4
commit 9f536b6bdf
29 changed files with 665 additions and 458 deletions

View File

@@ -1,26 +0,0 @@
package com.example.administrator.seven;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.administrator.newjiajiesone", appContext.getPackageName());
}
}

View File

@@ -45,8 +45,8 @@ public abstract class MoFragment extends BaseFragment {
private RelativeLayout rl_top;
private RelativeLayout layTop_left_tv;
public MoFragment(Savaselect savaselect) {
this.savaselectbean = savaselect;
public MoFragment() {
}
public BaseQuickAdapter markingtwoAdapter;
public void sendMessage() {

View File

@@ -29,8 +29,8 @@ public class XikeInfoFragment extends MoFragment {
private TextView xike_01;
private String xike;
public XikeInfoFragment(Savaselect savaselect) {
super(savaselect);
public XikeInfoFragment() {
super();
}
@Override

View File

@@ -14,7 +14,7 @@ public class Main2Activity extends BaseActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
getSupportFragmentManager().beginTransaction().replace(R.id.container,new XikeInfoFragment(new Savaselect())).commit();
getSupportFragmentManager().beginTransaction().replace(R.id.container,new XikeInfoFragment()).commit();
}
}

View File

@@ -10,6 +10,7 @@ import android.widget.TextView;
import com.example.administrator.seven.R;
import com.example.administrator.seven.base.BaseActivity;
import com.example.administrator.seven.main.kehu.TraceFragment;
import com.example.administrator.seven.main.task.HomeFragment;
import com.example.administrator.seven.main.find.MapFragment;
import com.example.administrator.seven.main.my.MyFragment;
@@ -46,7 +47,7 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
private HomeFragment mHomeFragment;
private SendFragment mSendFragment;
private MapFragment mMapFragment;
private TraceFragment traceFragment;
private MyFragment mMineFragment;
private Fragment mCurrent;
@@ -106,7 +107,7 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
hideFragment(mSendFragment, fragmentTransaction);
hideFragment(mMapFragment, fragmentTransaction);
hideFragment(traceFragment, fragmentTransaction);
hideFragment(mMineFragment, fragmentTransaction);
if (mHomeFragment == null) {
fragmentTransaction.add(R.id.content_layout, mHomeFragment);
@@ -128,7 +129,7 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
hideFragment(mHomeFragment, fragmentTransaction);
hideFragment(mMapFragment, fragmentTransaction);
hideFragment(traceFragment, fragmentTransaction);
hideFragment(mMineFragment, fragmentTransaction);
if (mSendFragment == null) {
mSendFragment = new SendFragment();
@@ -153,12 +154,12 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
hideFragment(mHomeFragment, fragmentTransaction);
hideFragment(mSendFragment, fragmentTransaction);
hideFragment(mMineFragment, fragmentTransaction);
if (mMapFragment == null) {
mMapFragment = new MapFragment();
fragmentTransaction.add(R.id.content_layout, mMapFragment);
if (traceFragment == null) {
traceFragment = new TraceFragment();
fragmentTransaction.add(R.id.content_layout, traceFragment);
} else {
mCurrent = mMapFragment;
fragmentTransaction.show(mMapFragment);
mCurrent = traceFragment;
fragmentTransaction.show(traceFragment);
}
break;
case R.id.rl_mine:
@@ -175,7 +176,7 @@ public class MainActivity extends BaseActivity implements View.OnClickListener{
hideFragment(mHomeFragment, fragmentTransaction);
hideFragment(mSendFragment, fragmentTransaction);
hideFragment(mMapFragment, fragmentTransaction);
hideFragment(traceFragment, fragmentTransaction);
if (mMineFragment == null) {
mMineFragment = new MyFragment();
fragmentTransaction.add(R.id.content_layout, mMineFragment);

View File

@@ -1,196 +1,90 @@
package com.example.administrator.seven.main.kehu;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.administrator.seven.R;
import com.example.administrator.seven.main.entity.Savaselect;
import com.example.administrator.seven.main.kehu.adapter.MarkingTwoAdapter;
import com.example.administrator.seven.test.BaseFragment;
import com.example.administrator.seven.JsonUtils;
import com.example.administrator.seven.main.adapter.mine.XikeInfoAdapter;
import com.example.administrator.seven.main.entity.XikeInfoBean;
import com.example.administrator.seven.main.kehu.adapter.CusListAdapter;
import com.example.administrator.seven.okgonet.NetApi;
import com.example.administrator.seven.okgonet.Observer;
import com.lzy.okgo.model.Response;
import java.util.ArrayList;
import java.util.List;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
/**
* 功能:已流失
* 返回值:空
* 时间2017/7/17/017 14:52
* 客户列表
*/
@SuppressLint("ValidFragment")
public class CustomerFragment extends BaseFragment {
public static final String ARG_PAGE = "ARG_PAGE";
private boolean IS_LOADED = false;
public class CustomerFragment extends MobanFragment {
private static int mSerial = 0;
private int mTabPos = 0;
private boolean isFirst = true;
@SuppressLint("HandlerLeak")
private Handler handler = new Handler() {
public void handleMessage(Message msg) {
Log.e("tag", "IS_LOADED=" + IS_LOADED);
if (!IS_LOADED) {
IS_LOADED = true;
//请求我的客户已流失数据
requestmakingyiliushidata("2", "", true);
}
return;
}
;
};
private MarkingTwoAdapter markingtwoAdapter;
private Savaselect savaselectbean;
public CustomerFragment(int serial, Savaselect savaselect) {
public CustomerFragment(int serial) {
super();
mSerial = serial;
this.savaselectbean = savaselect;
}
public void sendMessage() {
Message message = handler.obtainMessage();
message.sendToTarget();
}
public void setTabPos(int mTabPos) {
this.mTabPos = mTabPos;
}
private String uid;
private RecyclerView mMarkingFragmentRecyclerView;
private SwipeRefreshLayout mSwl;
private int mNextRequestPage = 1;
private static final int PAGE_SIZE = 10;
View view;
private View notDataView;
private View errorView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = getActivity();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (view != null) {
ViewGroup parent = (ViewGroup) view.getParent();
if (parent != null) {
parent.removeView(view);
}
return view;
}
// uid = (String) SPUtils.getSp(getActivity(), FHConfig.KEY_USER_UID, "");
view = inflater.inflate(R.layout.criclefragmenttwo, container, false);
initView(view);
//设置页和当前页一致时加载,防止预加载
if (isFirst && mTabPos == mSerial) {
isFirst = false;
sendMessage();
}
return view;
}
private void initView(View mContentView) {
mMarkingFragmentRecyclerView = (RecyclerView) view.findViewById(R.id.marking_fragment_recyclerView);
mSwl = mContentView.findViewById(R.id.srl);
notDataView = getActivity().getLayoutInflater().inflate(R.layout.empty_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
notDataView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// refresh("1");
}
});
errorView = getActivity().getLayoutInflater().inflate(R.layout.error_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
errorView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// onRefresh();
}
});
}
public void sendMessagetwo() {
requestmakingyiliushidata("2", "", true);
}
public void requestmakingyiliushidata(String type, String key, Boolean show) {
initAdapter("2", "");
initRefreshLayout("2", "");
mSwl.setRefreshing(true);
refresh("2", "");
}
private void initAdapter(final String type, final String key) {
public void initAdapter() {
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
markingtwoAdapter = new MarkingTwoAdapter(mContext, null);
markingtwoAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
loadMore(type, key);
}
});
CusListAdapter markingtwoAdapter = new CusListAdapter(mContext, null);
getAdpter(markingtwoAdapter);
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
}
private void initRefreshLayout(final String type, final String key) {
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void requestData() {
new NetApi().xikeInfo("b886798bdce09746a787651013f2c6e6").subscribe(new Observer<Response>() {
@Override
public void onRefresh() {
refresh(type, key);
public void onNext(Response response) {
String body = (String) response.body();
XikeInfoBean.ResultBean esdv = JsonUtils.fromJson(body, XikeInfoBean.class).getResult();
mSwl.setRefreshing(false);
if (esdv != null && String.valueOf(esdv.getSuccess()).equals("0")) {
// List<XikeInfoBean.ResultBean.DataBean> data = esdv.getData();
List<XikeInfoBean.ResultBean.DataBean> data = new ArrayList<XikeInfoBean.ResultBean.DataBean>();
for (int i = 0; i < 20; i++)
{
XikeInfoBean.ResultBean.DataBean dataBean = new XikeInfoBean.ResultBean.DataBean();
dataBean.setTime("2020-07-01 12:00:00");
dataBean.setXike_num("+89.00");
dataBean.setXike_remark("收益账户转入");
data.add(dataBean);
}
if (data.size() == 0) {
//markingtwoAdapter.setEmptyView(notDataView);
return;
}
if (mNextRequestPage == 1) {
setData(true, data);
} else {
setData(false, data);
}
} else {
setData(true, null);
markingtwoAdapter.setEmptyView(notDataView);
mSwl.setRefreshing(false);
}
}
@Override
public void onError(Exception e) {
e.printStackTrace();
markingtwoAdapter.setEmptyView(errorView);
mSwl.setRefreshing(false);
}
});
}
private void refresh(String type, String key) {
mNextRequestPage = 1;
markingtwoAdapter.setEnableLoadMore(false);//这里的作用是防止下拉刷新的时候还可以上拉加载
requestmakingyiliushitwo();
}
private void loadMore(String type, String key) {
requestmakingyiliushitwo();
}
private void setData(boolean isRefresh, List data) {
mNextRequestPage++;
final int size = data == null ? 0 : data.size();
if (isRefresh) {
markingtwoAdapter.setNewData(data);
} else {
if (size > 0) {
markingtwoAdapter.addData(data);
}
}
if (size < PAGE_SIZE) {
//第一页如果不够一页就不显示没有更多数据布局
markingtwoAdapter.loadMoreEnd(isRefresh);
} else {
markingtwoAdapter.loadMoreComplete();
}
}
public void requestmakingyiliushitwo() {
}
@Override
public void onDestroy() {
super.onDestroy();
}
}

View File

@@ -1,196 +1,92 @@
package com.example.administrator.seven.main.kehu;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.administrator.seven.R;
import com.example.administrator.seven.main.entity.Savaselect;
import com.example.administrator.seven.main.kehu.adapter.MarkingTwoAdapter;
import com.example.administrator.seven.test.BaseFragment;
import com.example.administrator.seven.JsonUtils;
import com.example.administrator.seven.main.adapter.mine.XikeInfoAdapter;
import com.example.administrator.seven.main.entity.XikeInfoBean;
import com.example.administrator.seven.main.kehu.adapter.DeaListAdapter;
import com.example.administrator.seven.okgonet.NetApi;
import com.example.administrator.seven.okgonet.Observer;
import com.lzy.okgo.model.Response;
import java.util.ArrayList;
import java.util.List;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
/**
* 功能:已流失
* 返回值:空
* 时间2017/7/17/017 14:52
* 成交列表
*/
@SuppressLint("ValidFragment")
public class DealFragment extends BaseFragment {
public static final String ARG_PAGE = "ARG_PAGE";
private boolean IS_LOADED = false;
public class DealFragment extends MobanFragment {
private static int mSerial = 0;
private int mTabPos = 0;
private boolean isFirst = true;
@SuppressLint("HandlerLeak")
private Handler handler = new Handler() {
public void handleMessage(Message msg) {
Log.e("tag", "IS_LOADED=" + IS_LOADED);
if (!IS_LOADED) {
IS_LOADED = true;
//请求我的客户已流失数据
requestmakingyiliushidata("2", "", true);
}
return;
}
;
};
private MarkingTwoAdapter markingtwoAdapter;
private Savaselect savaselectbean;
public DealFragment(int serial, Savaselect savaselect) {
public DealFragment(int serial) {
super();
mSerial = serial;
this.savaselectbean = savaselect;
}
public void sendMessage() {
Message message = handler.obtainMessage();
message.sendToTarget();
}
public void setTabPos(int mTabPos) {
this.mTabPos = mTabPos;
}
private String uid;
private RecyclerView mMarkingFragmentRecyclerView;
private SwipeRefreshLayout mSwl;
private int mNextRequestPage = 1;
private static final int PAGE_SIZE = 10;
View view;
private View notDataView;
private View errorView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = getActivity();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (view != null) {
ViewGroup parent = (ViewGroup) view.getParent();
if (parent != null) {
parent.removeView(view);
}
return view;
}
// uid = (String) SPUtils.getSp(getActivity(), FHConfig.KEY_USER_UID, "");
view = inflater.inflate(R.layout.criclefragmenttwo, container, false);
initView(view);
//设置页和当前页一致时加载,防止预加载
if (isFirst && mTabPos == mSerial) {
isFirst = false;
sendMessage();
}
return view;
}
private void initView(View mContentView) {
mMarkingFragmentRecyclerView = (RecyclerView) view.findViewById(R.id.marking_fragment_recyclerView);
mSwl = mContentView.findViewById(R.id.srl);
notDataView = getActivity().getLayoutInflater().inflate(R.layout.empty_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
notDataView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// refresh("1");
}
});
errorView = getActivity().getLayoutInflater().inflate(R.layout.error_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
errorView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// onRefresh();
}
});
}
public void sendMessagetwo() {
requestmakingyiliushidata("2", "", true);
}
public void requestmakingyiliushidata(String type, String key, Boolean show) {
initAdapter("2", "");
initRefreshLayout("2", "");
mSwl.setRefreshing(true);
refresh("2", "");
}
private void initAdapter(final String type, final String key) {
public void initAdapter() {
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
markingtwoAdapter = new MarkingTwoAdapter(mContext, null);
markingtwoAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
loadMore(type, key);
}
});
DeaListAdapter markingtwoAdapter = new DeaListAdapter(mContext, null);
getAdpter(markingtwoAdapter);
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
}
private void initRefreshLayout(final String type, final String key) {
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void requestData() {
new NetApi().xikeInfo("b886798bdce09746a787651013f2c6e6").subscribe(new Observer<Response>() {
@Override
public void onRefresh() {
refresh(type, key);
public void onNext(Response response) {
String body = (String) response.body();
XikeInfoBean.ResultBean esdv = JsonUtils.fromJson(body, XikeInfoBean.class).getResult();
mSwl.setRefreshing(false);
if (esdv != null && String.valueOf(esdv.getSuccess()).equals("0")) {
// List<XikeInfoBean.ResultBean.DataBean> data = esdv.getData();
List<XikeInfoBean.ResultBean.DataBean> data = new ArrayList<XikeInfoBean.ResultBean.DataBean>();
for (int i = 0; i < 20; i++)
{
XikeInfoBean.ResultBean.DataBean dataBean = new XikeInfoBean.ResultBean.DataBean();
dataBean.setTime("2020-07-01 12:00:00");
dataBean.setXike_num("+89.00");
dataBean.setXike_remark("收益账户转入");
data.add(dataBean);
}
if (data.size() == 0) {
//markingtwoAdapter.setEmptyView(notDataView);
return;
}
if (mNextRequestPage == 1) {
setData(true, data);
} else {
setData(false, data);
}
} else {
setData(true, null);
markingtwoAdapter.setEmptyView(notDataView);
mSwl.setRefreshing(false);
}
}
@Override
public void onError(Exception e) {
e.printStackTrace();
markingtwoAdapter.setEmptyView(errorView);
mSwl.setRefreshing(false);
}
});
}
private void refresh(String type, String key) {
mNextRequestPage = 1;
markingtwoAdapter.setEnableLoadMore(false);//这里的作用是防止下拉刷新的时候还可以上拉加载
requestmakingyiliushitwo();
}
private void loadMore(String type, String key) {
requestmakingyiliushitwo();
}
private void setData(boolean isRefresh, List data) {
mNextRequestPage++;
final int size = data == null ? 0 : data.size();
if (isRefresh) {
markingtwoAdapter.setNewData(data);
} else {
if (size > 0) {
markingtwoAdapter.addData(data);
}
}
if (size < PAGE_SIZE) {
//第一页如果不够一页就不显示没有更多数据布局
markingtwoAdapter.loadMoreEnd(isRefresh);
} else {
markingtwoAdapter.loadMoreComplete();
}
}
public void requestmakingyiliushitwo() {
}
@Override
public void onDestroy() {
super.onDestroy();
}
}

View File

@@ -0,0 +1,91 @@
package com.example.administrator.seven.main.kehu;
import com.example.administrator.seven.JsonUtils;
import com.example.administrator.seven.main.adapter.mine.XikeInfoAdapter;
import com.example.administrator.seven.main.entity.XikeInfoBean;
import com.example.administrator.seven.main.kehu.adapter.DisListAdapter;
import com.example.administrator.seven.okgonet.NetApi;
import com.example.administrator.seven.okgonet.Observer;
import com.lzy.okgo.model.Response;
import java.util.ArrayList;
import java.util.List;
import androidx.recyclerview.widget.LinearLayoutManager;
/**
* 分配列表
*/
public class DistriFragment extends MobanFragment {
private static int mSerial = 0;
private int mTabPos = 0;
public DistriFragment(int serial) {
super();
mSerial = serial;
}
public void setTabPos(int mTabPos) {
this.mTabPos = mTabPos;
}
@Override
public void initAdapter() {
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
DisListAdapter markingtwoAdapter = new DisListAdapter(mContext, null);
getAdpter(markingtwoAdapter);
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
}
@Override
public void requestData() {
new NetApi().xikeInfo("b886798bdce09746a787651013f2c6e6").subscribe(new Observer<Response>() {
@Override
public void onNext(Response response) {
String body = (String) response.body();
XikeInfoBean.ResultBean esdv = JsonUtils.fromJson(body, XikeInfoBean.class).getResult();
mSwl.setRefreshing(false);
if (esdv != null && String.valueOf(esdv.getSuccess()).equals("0")) {
// List<XikeInfoBean.ResultBean.DataBean> data = esdv.getData();
List<XikeInfoBean.ResultBean.DataBean> data = new ArrayList<XikeInfoBean.ResultBean.DataBean>();
for (int i = 0; i < 20; i++)
{
XikeInfoBean.ResultBean.DataBean dataBean = new XikeInfoBean.ResultBean.DataBean();
dataBean.setTime("2020-07-01 12:00:00");
dataBean.setXike_num("+89.00");
dataBean.setXike_remark("收益账户转入");
data.add(dataBean);
}
if (data.size() == 0) {
//markingtwoAdapter.setEmptyView(notDataView);
return;
}
if (mNextRequestPage == 1) {
setData(true, data);
} else {
setData(false, data);
}
} else {
setData(true, null);
markingtwoAdapter.setEmptyView(notDataView);
mSwl.setRefreshing(false);
}
}
@Override
public void onError(Exception e) {
e.printStackTrace();
markingtwoAdapter.setEmptyView(errorView);
mSwl.setRefreshing(false);
}
});
}
@Override
public void onDestroy() {
super.onDestroy();
}
}

View File

@@ -8,12 +8,13 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.administrator.seven.R;
import com.example.administrator.seven.base.BaseFragment;
import com.example.administrator.seven.main.entity.Savaselect;
import com.example.administrator.seven.main.kehu.adapter.MarkingTwoAdapter;
import com.example.administrator.seven.test.BaseFragment;
import java.util.List;
@@ -21,17 +22,12 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
/**
* 功能已流失
* 返回值
* 时间2017/7/17/017 14:52
*/
@SuppressLint("ValidFragment")
public class TrackFragment extends BaseFragment {
public abstract class MobanFragment extends BaseFragment {
public static final String ARG_PAGE = "ARG_PAGE";
private boolean IS_LOADED = false;
private static int mSerial = 0;
private int mTabPos = 0;
private boolean isFirst = true;
@SuppressLint("HandlerLeak")
private Handler handler = new Handler() {
@@ -40,38 +36,34 @@ public class TrackFragment extends BaseFragment {
if (!IS_LOADED) {
IS_LOADED = true;
//请求我的客户已流失数据
requestmakingyiliushidata("2", "", true);
requesdata();
}
return;
}
;
};
private MarkingTwoAdapter markingtwoAdapter;
private Savaselect savaselectbean;
public Savaselect savaselectbean;
private RelativeLayout rl_top;
private RelativeLayout layTop_left_tv;
public MobanFragment() {
public TrackFragment(int serial, Savaselect savaselect) {
mSerial = serial;
this.savaselectbean = savaselect;
}
public BaseQuickAdapter markingtwoAdapter;
public void sendMessage() {
Message message = handler.obtainMessage();
message.sendToTarget();
}
public void setTabPos(int mTabPos) {
this.mTabPos = mTabPos;
}
private String uid;
private RecyclerView mMarkingFragmentRecyclerView;
private SwipeRefreshLayout mSwl;
private int mNextRequestPage = 1;
public RecyclerView mMarkingFragmentRecyclerView;
public SwipeRefreshLayout mSwl;
public int mNextRequestPage = 1;
private static final int PAGE_SIZE = 10;
View view;
private View notDataView;
private View errorView;
public View notDataView;
public View errorView;
public TextView mLayTopTitle;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -88,11 +80,10 @@ public class TrackFragment extends BaseFragment {
}
return view;
}
// uid = (String) SPUtils.getSp(getActivity(), FHConfig.KEY_USER_UID, "");
view = inflater.inflate(R.layout.criclefragmenttwo, container, false);
view = inflater.inflate(R.layout.kehumobanfragment, container, false);
initView(view);
//设置页和当前页一致时加载防止预加载
if (isFirst && mTabPos == mSerial) {
if (isFirst) {
isFirst = false;
sendMessage();
}
@@ -100,14 +91,13 @@ public class TrackFragment extends BaseFragment {
}
private void initView(View mContentView) {
mMarkingFragmentRecyclerView = (RecyclerView) view.findViewById(R.id.marking_fragment_recyclerView);
mSwl = mContentView.findViewById(R.id.srl);
notDataView = getActivity().getLayoutInflater().inflate(R.layout.empty_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
notDataView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// refresh("1");
// refresh();
}
});
errorView = getActivity().getLayoutInflater().inflate(R.layout.error_view, (ViewGroup) mMarkingFragmentRecyclerView.getParent(), false);
@@ -120,50 +110,36 @@ public class TrackFragment extends BaseFragment {
}
public void sendMessagetwo() {
requestmakingyiliushidata("2", "", true);
}
public void requestmakingyiliushidata(String type, String key, Boolean show) {
initAdapter("2", "");
initRefreshLayout("2", "");
public void requesdata() {
initAdapter();
initRefreshLayout();
mSwl.setRefreshing(true);
refresh("2", "");
refresh();
}
private void initAdapter(final String type, final String key) {
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
markingtwoAdapter = new MarkingTwoAdapter(mContext, null);
markingtwoAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
loadMore(type, key);
}
});
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
public abstract void initAdapter();
}
private void initRefreshLayout(final String type, final String key) {
private void initRefreshLayout() {
mSwl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refresh(type, key);
refresh();
}
});
}
private void refresh(String type, String key) {
private void refresh() {
mNextRequestPage = 1;
markingtwoAdapter.setEnableLoadMore(false);//这里的作用是防止下拉刷新的时候还可以上拉加载
requestmakingyiliushitwo();
requestData();
}
private void loadMore(String type, String key) {
requestmakingyiliushitwo();
public void loadMore() {
requestData();
}
private void setData(boolean isRefresh, List data) {
public void setData(boolean isRefresh, List data) {
mNextRequestPage++;
final int size = data == null ? 0 : data.size();
if (isRefresh) {
@@ -182,11 +158,13 @@ public class TrackFragment extends BaseFragment {
}
public void requestmakingyiliushitwo() {
public abstract void requestData();
public void getAdpter(BaseQuickAdapter markingtwoAdapter){
this.markingtwoAdapter=markingtwoAdapter;
}
@Override
public void onDestroy() {
super.onDestroy();

View File

@@ -38,10 +38,9 @@ public class TraceFragment extends BaseFragment implements View.OnClickListener
int curTab = 0;
private boolean IS_LOADED = false;
private ArrayList<Pair<String, Fragment>> items;
private TrackFragment genzongzhongFragment;
private CustomerFragment yiliushiFragment;
private CustomerFragment genzongzhongFragment;
private DistriFragment yiliushiFragment;
private DealFragment yichengjiaoFragment;
private boolean shifou = true;
private Savaselect savaselect;
@SuppressLint("HandlerLeak")
@@ -53,15 +52,15 @@ public class TraceFragment extends BaseFragment implements View.OnClickListener
IS_LOADED = true;
savaselect = new Savaselect();
items = new ArrayList<>();
genzongzhongFragment = new TrackFragment(curTab, savaselect);
genzongzhongFragment = new CustomerFragment(curTab);
genzongzhongFragment.setTabPos(0);
items.add(new Pair<String, Fragment>("跟踪中", genzongzhongFragment));
yiliushiFragment = new CustomerFragment(curTab, savaselect);
items.add(new Pair<String, Fragment>("客户列表", genzongzhongFragment));
yiliushiFragment = new DistriFragment(curTab);
yiliushiFragment.setTabPos(1);
items.add(new Pair<String, Fragment>("已流失", yiliushiFragment));
yichengjiaoFragment = new DealFragment(curTab, savaselect);
items.add(new Pair<String, Fragment>("分配列表", yiliushiFragment));
yichengjiaoFragment = new DealFragment(curTab);
yichengjiaoFragment.setTabPos(2);
items.add(new Pair<String, Fragment>("成交", yichengjiaoFragment));
items.add(new Pair<String, Fragment>("成交列表", yichengjiaoFragment));
final MyAdaptertwo myAdaptertwo = new MyAdaptertwo(getChildFragmentManager());
//mViewPager滑动监听
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@@ -73,10 +72,10 @@ public class TraceFragment extends BaseFragment implements View.OnClickListener
Log.i("TAG", "position:" + position);
if (position == 0) {
mBtSousuoDitu.setVisibility(View.VISIBLE);
((TrackFragment) myAdaptertwo.getItem(position)).sendMessage();
((CustomerFragment) myAdaptertwo.getItem(position)).sendMessage();
} else if (position == 1) {
mBtSousuoDitu.setVisibility(View.GONE);
((CustomerFragment) myAdaptertwo.getItem(position)).sendMessage();
((DistriFragment) myAdaptertwo.getItem(position)).sendMessage();
} else {
mBtSousuoDitu.setVisibility(View.GONE);
((DealFragment) myAdaptertwo.getItem(position)).sendMessage();
@@ -124,9 +123,6 @@ public class TraceFragment extends BaseFragment implements View.OnClickListener
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_kehu, container, false);
//获得是否是店长身份
// uid = (String) SPUtils.getSp(getActivity(), FHConfig.KEY_USER_UID, "");
// clerkposition = (String) SPUtils.getSp(getActivity(), FHConfig.IDENFINE, "");
viewPager = (ViewPager) view.findViewById(R.id.main_vp);
tab = (TabLayout) view.findViewById(R.id.main_tab_layout);
sendMessage();
@@ -144,13 +140,7 @@ public class TraceFragment extends BaseFragment implements View.OnClickListener
mEnterShopTitle = (TextView) view.findViewById(R.id.enter_shop_title);
mEnterShopTitle.setOnClickListener(this);
enter_shop_shaixuan = (TextView) view.findViewById(R.id.enter_shop_shaixuan);
if (clerkposition.equals("店员")) {
mEnterShopShai.setVisibility(View.GONE);
mEnterShopTitle.setVisibility(View.VISIBLE);
} else {
mEnterShopShai.setVisibility(View.VISIBLE);
mEnterShopTitle.setVisibility(View.GONE);
}
}
@Override

View File

@@ -0,0 +1,29 @@
package com.example.administrator.seven.main.kehu.adapter;
import android.content.Context;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.administrator.seven.R;
import com.example.administrator.seven.main.entity.XikeInfoBean;
import com.example.administrator.seven.utils.WidgetTools;
import java.util.List;
public class CusListAdapter extends BaseQuickAdapter<XikeInfoBean.ResultBean.DataBean, BaseViewHolder> {
Context mcontext;
public CusListAdapter(Context context, List list) {
super(R.layout.cuslist_item, list);
this.mcontext = context;
}
@Override
protected void convert(final BaseViewHolder helper, final XikeInfoBean.ResultBean.DataBean item) {
// WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_01), "", item.getXike_remark());
// WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_02), "", item.getTime());
// WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_03), "", item.getXike_num());
}
}

View File

@@ -0,0 +1,29 @@
package com.example.administrator.seven.main.kehu.adapter;
import android.content.Context;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.administrator.seven.R;
import com.example.administrator.seven.main.entity.XikeInfoBean;
import com.example.administrator.seven.utils.WidgetTools;
import java.util.List;
public class DeaListAdapter extends BaseQuickAdapter<XikeInfoBean.ResultBean.DataBean, BaseViewHolder> {
Context mcontext;
public DeaListAdapter(Context context, List list) {
super(R.layout.dealist_item, list);
this.mcontext = context;
}
@Override
protected void convert(final BaseViewHolder helper, final XikeInfoBean.ResultBean.DataBean item) {
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_name), "", item.getXike_remark());
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_phone), "", item.getTime());
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_watch), "", item.getXike_num());
}
}

View File

@@ -0,0 +1,29 @@
package com.example.administrator.seven.main.kehu.adapter;
import android.content.Context;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.administrator.seven.R;
import com.example.administrator.seven.main.entity.XikeInfoBean;
import com.example.administrator.seven.utils.WidgetTools;
import java.util.List;
public class DisListAdapter extends BaseQuickAdapter<XikeInfoBean.ResultBean.DataBean, BaseViewHolder> {
Context mcontext;
public DisListAdapter(Context context, List list) {
super(R.layout.disliat_item, list);
this.mcontext = context;
}
@Override
protected void convert(final BaseViewHolder helper, final XikeInfoBean.ResultBean.DataBean item) {
WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_01), "", item.getXike_remark());
WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_02), "", item.getTime());
WidgetTools.setTextfive((TextView) helper.getView(R.id.xike_tv_03), "", item.getXike_num());
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:type="linear"
android:useLevel="true"
android:startColor="#ff2680eb"
android:endColor="#ff70b1ff"
android:angle="135" />
<corners android:topLeftRadius="0dp" android:topRightRadius="0dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="0dp" />
</shape>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="2dp" android:color="#ff333333" />
<corners android:radius="16dp" />
</shape>

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
android:layout_height="99dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:id="@+id/rl_cus_01"
android:layout_width="match_parent"
android:layout_height="24dp">
<TextView
android:id="@+id/tv_cus_01"
android:layout_width="28dp"
android:layout_height="12dp"
android:layout_marginLeft="10.5dp"
android:layout_centerVertical="true"
android:background="@mipmap/icon_cus_new"
/>
<TextView
android:layout_toRightOf="@+id/tv_cus_01"
android:layout_width="wrap_content"
android:layout_height="17dp"
android:layout_marginLeft="10dp"
android:text="多喜爱家纺磨毛小猪佩奇...(云拼团)"
android:layout_centerVertical="true"
android:textColor="#ffababab"
android:textSize="13sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_below="@+id/rl_cus_01"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/yichengjhiao_rv"
android:layout_width="match_parent"
android:layout_height="75dp"
android:background="@color/colorWhite">
<com.example.administrator.seven.widget.CircleImageView
android:id="@+id/iv_dea_avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="16dp"
android:src="@mipmap/icon_default_head"
app:border_color="#70ffffff" />
<TextView
android:id="@+id/tv_dea_name"
android:layout_width="59dp"
android:layout_height="21dp"
android:layout_marginLeft="13.5dp"
android:layout_marginTop="19.5dp"
android:layout_toRightOf="@+id/iv_dea_avatar"
android:text="欧阳子文"
android:textColor="#ff333333"
android:textSize="15sp"
/>
<TextView
android:id="@+id/tv_dea_phone"
android:layout_width="67dp"
android:layout_height="16dp"
android:layout_marginTop="19.5dp"
android:layout_toRightOf="@+id/tv_dea_name"
android:text="18971614151"
android:textColor="#ff333333"
android:textSize="12sp"
/>
<ImageView
android:id="@+id/ima_dea_watch"
android:layout_width="16.5dp"
android:layout_toRightOf="@+id/iv_dea_avatar"
android:layout_marginLeft="13.5dp"
android:layout_marginTop="5dp"
android:layout_below="@+id/tv_dea_name"
android:background="@mipmap/ic_launcher"
android:layout_height="16.5dp"/>
<TextView
android:id="@+id/tv_dea_watch"
android:layout_width="67dp"
android:layout_height="16dp"
android:layout_toRightOf="@+id/ima_dea_watch"
android:layout_marginLeft="13.5dp"
android:layout_marginTop="5dp"
android:layout_below="@+id/tv_dea_name"
android:textColor="#ff333333"
android:textSize="12sp"
android:text="--"
/>
<TextView
android:layout_width="43dp"
android:layout_height="25dp"
android:text="操作"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="22dp"
android:textColor="#ff333333"
android:background="@drawable/share_tv_cus"
android:textSize="11sp"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dimen_2dp"
android:background="#F5F5F5"
/>
</RelativeLayout>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/yichengjhiao_rv"
android:layout_width="match_parent"
android:layout_height="75dp"
android:background="@color/colorWhite">
<TextView
android:layout_width="59.5dp"
android:layout_height="21.5dp"
android:layout_alignParentRight="true"
android:background="@drawable/shape_deal"
android:gravity="center"
android:text="已成交1单"
android:textColor="#ffffffff"
android:textSize="10sp" />
<com.example.administrator.seven.widget.CircleImageView
android:id="@+id/iv_dea_avatar"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="16dp"
android:src="@mipmap/icon_default_head"
app:border_color="#70ffffff" />
<TextView
android:id="@+id/tv_dea_name"
android:layout_width="59dp"
android:layout_height="21dp"
android:layout_marginLeft="13.5dp"
android:layout_marginTop="19.5dp"
android:layout_toRightOf="@+id/iv_dea_avatar"
android:text="欧阳子文"
android:textColor="#ff333333"
android:textSize="15sp"
/>
<TextView
android:id="@+id/tv_dea_phone"
android:layout_width="67dp"
android:layout_height="16dp"
android:layout_marginTop="19.5dp"
android:layout_toRightOf="@+id/tv_dea_name"
android:text="18971614151"
android:textColor="#ff333333"
android:textSize="12sp"
/>
<ImageView
android:id="@+id/ima_dea_watch"
android:layout_width="16.5dp"
android:layout_toRightOf="@+id/iv_dea_avatar"
android:layout_marginLeft="13.5dp"
android:layout_marginTop="5dp"
android:layout_below="@+id/tv_dea_name"
android:background="@mipmap/ic_launcher"
android:layout_height="16.5dp"/>
<TextView
android:id="@+id/tv_dea_watch"
android:layout_width="67dp"
android:layout_height="16dp"
android:layout_toRightOf="@+id/ima_dea_watch"
android:layout_marginLeft="13.5dp"
android:layout_marginTop="5dp"
android:layout_below="@+id/tv_dea_name"
android:textColor="#ff333333"
android:textSize="12sp"
android:text="--"
/>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dimen_2dp"
android:background="#F5F5F5"
/>
</RelativeLayout>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="74dp"
android:background="#F5F5F5">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="74dp"
android:background="@color/colorWhite"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp">
<TextView
android:id="@+id/xike_tv_01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="13dp"
android:layout_marginTop="18dp"
android:text="待成交客户成交"
android:textColor="@color/black"
android:textSize="@dimen/marking_13_sp" />
<TextView
android:id="@+id/xike_tv_02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/xike_tv_01"
android:layout_marginTop="8dp"
android:layout_marginLeft="13dp"
android:text="2020/07/07 11:23:56"
android:textColor="@color/color_838282"
android:textSize="@dimen/marking_13_sp" />
<TextView
android:id="@+id/xike_tv_03"
android:layout_width="wrap_content"
android:layout_height="27dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="+3"
android:layout_marginRight="13dp"
android:textColor="#ff3a3a3a"
android:textSize="14sp"/>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_below="@+id/xike_tv_02"
android:layout_marginTop="7dp"
android:background="@color/color_bfbfbf" />
</RelativeLayout>
</RelativeLayout>

View File

@@ -37,9 +37,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="追踪客户"
android:textColor="@color/colorWhite"
android:text="客户"
android:textColor="@color/black"
android:textSize="18sp" />
<RelativeLayout
android:id="@+id/enter_shop_shai"
@@ -79,6 +78,7 @@
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:background="@mipmap/marking_sousuo"
/>
</RelativeLayout>
</RelativeLayout>
@@ -88,11 +88,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/main_tab_layout"
android:layout_width="match_parent"
@@ -105,7 +100,7 @@
app:tabMode="fixed"
app:tabSelectedTextColor="@color/black"
app:tabTextColor="@color/black" />
</LinearLayout>
</RelativeLayout>
<androidx.viewpager.widget.ViewPager

View File

@@ -0,0 +1,25 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:omi="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="#F5F5F5">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/srl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/marking_fragment_recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F5F5F5" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,5 +1,5 @@
<resources>
<string name="app_name">NewJiaJieSong</string>
<string name="app_name">七月七</string>
<string name="text_commit_apply">提交申请</string>