添加提现记录
This commit is contained in:
parent
c2ffd60060
commit
aa789c3da3
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
// ndkVersion '23.0.7123448'
|
||||
ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -0,0 +1,73 @@
|
||||
package com.navinfo.outdoor.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.bean.WithdrawalBean;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WithdrawalAdapter extends RecyclerView.Adapter<WithdrawalAdapter.OnViewHolder> {
|
||||
private List<WithdrawalBean.BodyBean.ListBean> dataBeans = new ArrayList<>();
|
||||
private Context context;
|
||||
|
||||
public void setDataBeans(List<WithdrawalBean.BodyBean.ListBean> dataBeans) {
|
||||
this.dataBeans.addAll(dataBeans);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
public WithdrawalAdapter(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
public void withClearData(){
|
||||
if (dataBeans!=null){
|
||||
dataBeans.clear();
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@NonNull
|
||||
@NotNull
|
||||
@Override
|
||||
public OnViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
|
||||
View inflate = LayoutInflater.from(context).inflate(R.layout.task_prefecture_item, parent, false);
|
||||
return new OnViewHolder(inflate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull @NotNull OnViewHolder holder, int position) {
|
||||
if (dataBeans != null && dataBeans.size() > position) {
|
||||
WithdrawalBean.BodyBean.ListBean listBean = dataBeans.get(position);
|
||||
holder.tvTitle.setText(listBean.getExchangePrice() + "");
|
||||
holder.tvTime.setText(listBean.getCommitDate());
|
||||
holder.tvDec.setText(listBean.getAdminConfirm() == 0 ? "未审核" : "已审核");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return dataBeans.size();
|
||||
}
|
||||
|
||||
public class OnViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView tvTitle, tvDec, tvTime;
|
||||
|
||||
public OnViewHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
tvTitle = itemView.findViewById(R.id.tv_title);
|
||||
tvDec = itemView.findViewById(R.id.tv_dest);
|
||||
tvTime = itemView.findViewById(R.id.tv_time);
|
||||
}
|
||||
}
|
||||
}
|
121
app/src/main/java/com/navinfo/outdoor/bean/WithdrawalBean.java
Normal file
121
app/src/main/java/com/navinfo/outdoor/bean/WithdrawalBean.java
Normal file
@ -0,0 +1,121 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WithdrawalBean {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private BodyBean body;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BodyBean getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(BodyBean body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private Integer totalPage;
|
||||
private Integer total;
|
||||
private List<ListBean> list;
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(Integer totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public Integer getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Integer total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<ListBean> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<ListBean> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public static class ListBean {
|
||||
private String name;
|
||||
private Double exchangePrice;
|
||||
private String commitDate;
|
||||
private int adminConfirm;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Double getExchangePrice() {
|
||||
return exchangePrice;
|
||||
}
|
||||
|
||||
public void setExchangePrice(Double exchangePrice) {
|
||||
this.exchangePrice = exchangePrice;
|
||||
}
|
||||
|
||||
public String getCommitDate() {
|
||||
return commitDate;
|
||||
}
|
||||
|
||||
public void setCommitDate(String commitDate) {
|
||||
this.commitDate = commitDate;
|
||||
}
|
||||
|
||||
public int getAdminConfirm() {
|
||||
return adminConfirm;
|
||||
}
|
||||
|
||||
public void setAdminConfirm(int adminConfirm) {
|
||||
this.adminConfirm = adminConfirm;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,24 +1,46 @@
|
||||
package com.navinfo.outdoor.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.adapter.TaskPrefectureAdapter;
|
||||
import com.navinfo.outdoor.adapter.WithdrawalAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.bean.WithdrawalBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 提现记录:
|
||||
*/
|
||||
public class WithdrawalRecordFragment extends BaseFragment implements View.OnClickListener{
|
||||
public class WithdrawalRecordFragment extends BaseFragment implements View.OnClickListener {
|
||||
|
||||
private ImageView ivWithdraw;
|
||||
private XRecyclerView rxlWithdraw;
|
||||
private WithdrawalAdapter withdrawalAdapter;
|
||||
private int withPage = 1;
|
||||
|
||||
public static WithdrawalRecordFragment newInstance(Bundle bundle) {
|
||||
WithdrawalRecordFragment fragment = new WithdrawalRecordFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.withdrawal_record_fragment;
|
||||
@ -29,16 +51,74 @@ public class WithdrawalRecordFragment extends BaseFragment implements View.OnCli
|
||||
super.initView();
|
||||
ivWithdraw = findViewById(R.id.iv_withdraw);
|
||||
ivWithdraw.setOnClickListener(this);
|
||||
rxlWithdraw = (XRecyclerView) findViewById(R.id.rxl_withdraw);
|
||||
rxlWithdraw.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
rxlWithdraw.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
|
||||
rxlWithdraw.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
|
||||
rxlWithdraw.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
|
||||
//取消上拉加载,刷新功能。
|
||||
// taskRecycler.setPullRefreshEnabled(false);
|
||||
// taskRecycler.setLoadingMoreEnabled(false);
|
||||
withdrawalAdapter = new WithdrawalAdapter(getContext());
|
||||
rxlWithdraw.setAdapter(withdrawalAdapter);
|
||||
rxlWithdraw.getDefaultFootView().setNoMoreHint("已全部加载完毕");
|
||||
rxlWithdraw.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
withdrawalAdapter.withClearData();
|
||||
withPage=1;
|
||||
initNetwork();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
initNetwork();
|
||||
}
|
||||
});
|
||||
initNetwork();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
super.initData();
|
||||
}
|
||||
private void initNetwork() {
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("pageNum",withPage);
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.PRICE_EXCHANGE)
|
||||
.cls(WithdrawalBean.class)
|
||||
.params(httpParams)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.getRequest(new Callback<WithdrawalBean>() {
|
||||
@Override
|
||||
public void onSuccess(WithdrawalBean withdrawalBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (withdrawalBean.getCode() == 200){
|
||||
withdrawalAdapter.setDataBeans(withdrawalBean.getBody().getList());
|
||||
withPage++;
|
||||
}else {
|
||||
Toast.makeText(getActivity(), withdrawalBean.getMessage()+"", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
rxlWithdraw.loadMoreComplete();
|
||||
rxlWithdraw.refreshComplete();
|
||||
Log.d("TAG", "onSuccess: " + withdrawalBean.getMessage() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
rxlWithdraw.loadMoreComplete();
|
||||
rxlWithdraw.refreshComplete();
|
||||
dismissLoadingDialog();
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
switch (v.getId()) {
|
||||
case R.id.iv_withdraw:
|
||||
getActivity().finish();
|
||||
break;
|
||||
|
@ -66,6 +66,8 @@ public class HttpInterface {
|
||||
public static final String GET_PRICE = IP +PRICE_PATH+ "userPrice/"+USERID+"/getPrice";//我的-总资产
|
||||
//http://172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
|
||||
public static final String USER_PRICE_EXCHANGE =IP +PRICE_PATH+ "userPrice/"+USERID+"/userPriceExchange";//我的-财务信息-提现
|
||||
//dtxbmaps.navinfo.com/dtxb/m4/price/priceExchange/1/getList?datetime=1628647356815
|
||||
public static final String PRICE_EXCHANGE=IP+PRICE_PATH+"priceExchange/"+USERID+"/getList";//提现记录
|
||||
/**
|
||||
* 任务
|
||||
*Path=/m4/task/**
|
||||
|
@ -34,4 +34,13 @@
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.jcodecraeer.xrecyclerview.XRecyclerView
|
||||
android:id="@+id/rxl_withdraw"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_withdraw" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
x
Reference in New Issue
Block a user