Commit b5fa1426 by mReturn

备件收发货列表页改版

parent 6b48e616
...@@ -27,6 +27,7 @@ import com.dayu.order.api.protocol.SopResult; ...@@ -27,6 +27,7 @@ import com.dayu.order.api.protocol.SopResult;
import com.dayu.order.api.protocol.Spu; import com.dayu.order.api.protocol.Spu;
import com.dayu.order.api.protocol.Tab; import com.dayu.order.api.protocol.Tab;
import com.dayu.order.api.protocol.TranCompanyBean; import com.dayu.order.api.protocol.TranCompanyBean;
import com.dayu.order.api.protocol.bean.OrderPartListBean;
import com.dayu.order.api.protocol.bean.ServiceProviderBean; import com.dayu.order.api.protocol.bean.ServiceProviderBean;
import com.dayu.order.api.protocol.bean.ServiceStationBean; import com.dayu.order.api.protocol.bean.ServiceStationBean;
import com.dayu.order.api.protocol.bean.SopListBean; import com.dayu.order.api.protocol.bean.SopListBean;
...@@ -468,15 +469,25 @@ public interface OrderService { ...@@ -468,15 +469,25 @@ public interface OrderService {
/** /**
* 备件物流列表 * 备件物流列表(旧版)
* *
* @param sendType 1服务商给师傅发货 2师傅给服务商发货 * @param sendType 1服务商给师傅发货 2师傅给服务商发货
*/ */
@GET(Constants.API_7200 + "/ordersLogistics") @GET(Constants.API_7200 + "/ordersLogistics")
Observable<BaseResponse<BasePageBean<OrderPartBean>>> getOrderPartList(@Query("orderId") int orderId, Observable<BaseResponse<BasePageBean<OrderPartBean>>> getOrderPartListOld(@Query("orderId") int orderId,
@Query("sendType") int sendType, @Query("sendType") int sendType,
@Query("page") int page, @Query("page") int page,
@Query("pageSize") int pageSize); @Query("pageSize") int pageSize);
/**
* 备件物流列表
*
* @param pointToPoint 1服务商给师傅发货 2师傅给服务商发货
*/
@GET(Constants.API_7700 + "/spSendOutGoods/orders")
Observable<BaseResponse<BasePageBean<OrderPartListBean>>> getOrderPartList(@Query("orderId") int orderId,
@Query("pointToPoint") int pointToPoint,
@Query("page") int page,
@Query("pageSize") int pageSize);
/** /**
* 查询物流公司 * 查询物流公司
......
package com.dayu.order.api.protocol.bean;
public class OrderPartListBean {
/**
* id : 35
* orderId : 4512
* orderNum : SP20201019140950000003
* sendType : 2
* sparePartId : null
* sparePartName : 16868949skdjfjjfjdkkdkddk
* sendNum : null
* sendMode : 1
* receiverName : 123
* receiverMobile : 12312345679
* receiverAddress : 北京市北京城区海淀区海淀区车公庄西路甲19号A510
* sendCourierCompany : 其他
* sendCourierNumber : dk19454
* sendShipperCode : other
* pointToPoint : 2
* sendPicUrl : http://dl.kf.ai/test/sp/mobile/android/business/checkApply/567ee9c1485e73ebe8df849d06375c27.jpg?x-oss-process=style/nowatermark
* sendTime : 2020-10-19 14:14:01
* receiveTime : null
* sendStoreId : 239
* sendStoreName : 孙路路
* sendStoreType : 1
* status : 2
* statusStr : null
* sendName : 孙路路
* sendMobile : 15001068191
* sendAddress : 北京市 北京市 海淀区 软件园
* orderBelongId : null
* orderBelongType : null
* comment : null
* receiverPicUrl : null
* totalPrice : null
* createTime : 2020-10-19 14:14:01
* key : null
*/
private int id;
private int orderId;
private String orderNum;
private int sendType;
private Object sparePartId;
private String sparePartName;
private Object sendNum;
private int sendMode;
private String receiverName;
private String receiverMobile;
private String receiverAddress;
private String sendCourierCompany;
private String sendCourierNumber;
private String sendShipperCode;
private int pointToPoint;
private String sendPicUrl;
private String sendTime;
private Object receiveTime;
private int sendStoreId;
private String sendStoreName;
private int sendStoreType;
private int status;
private Object statusStr;
private String sendName;
private String sendMobile;
private String sendAddress;
private Object orderBelongId;
private Object orderBelongType;
private Object comment;
private Object receiverPicUrl;
private Object totalPrice;
private String createTime;
private Object key;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getOrderId() {
return orderId;
}
public void setOrderId(int orderId) {
this.orderId = orderId;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public int getSendType() {
return sendType;
}
public void setSendType(int sendType) {
this.sendType = sendType;
}
public Object getSparePartId() {
return sparePartId;
}
public void setSparePartId(Object sparePartId) {
this.sparePartId = sparePartId;
}
public String getSparePartName() {
return sparePartName;
}
public void setSparePartName(String sparePartName) {
this.sparePartName = sparePartName;
}
public Object getSendNum() {
return sendNum;
}
public void setSendNum(Object sendNum) {
this.sendNum = sendNum;
}
public int getSendMode() {
return sendMode;
}
public void setSendMode(int sendMode) {
this.sendMode = sendMode;
}
public String getReceiverName() {
return receiverName;
}
public void setReceiverName(String receiverName) {
this.receiverName = receiverName;
}
public String getReceiverMobile() {
return receiverMobile;
}
public void setReceiverMobile(String receiverMobile) {
this.receiverMobile = receiverMobile;
}
public String getReceiverAddress() {
return receiverAddress;
}
public void setReceiverAddress(String receiverAddress) {
this.receiverAddress = receiverAddress;
}
public String getSendCourierCompany() {
return sendCourierCompany;
}
public void setSendCourierCompany(String sendCourierCompany) {
this.sendCourierCompany = sendCourierCompany;
}
public String getSendCourierNumber() {
return sendCourierNumber;
}
public void setSendCourierNumber(String sendCourierNumber) {
this.sendCourierNumber = sendCourierNumber;
}
public String getSendShipperCode() {
return sendShipperCode;
}
public void setSendShipperCode(String sendShipperCode) {
this.sendShipperCode = sendShipperCode;
}
public int getPointToPoint() {
return pointToPoint;
}
public void setPointToPoint(int pointToPoint) {
this.pointToPoint = pointToPoint;
}
public String getSendPicUrl() {
return sendPicUrl;
}
public void setSendPicUrl(String sendPicUrl) {
this.sendPicUrl = sendPicUrl;
}
public String getSendTime() {
return sendTime;
}
public void setSendTime(String sendTime) {
this.sendTime = sendTime;
}
public Object getReceiveTime() {
return receiveTime;
}
public void setReceiveTime(Object receiveTime) {
this.receiveTime = receiveTime;
}
public int getSendStoreId() {
return sendStoreId;
}
public void setSendStoreId(int sendStoreId) {
this.sendStoreId = sendStoreId;
}
public String getSendStoreName() {
return sendStoreName;
}
public void setSendStoreName(String sendStoreName) {
this.sendStoreName = sendStoreName;
}
public int getSendStoreType() {
return sendStoreType;
}
public void setSendStoreType(int sendStoreType) {
this.sendStoreType = sendStoreType;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Object getStatusStr() {
return statusStr;
}
public void setStatusStr(Object statusStr) {
this.statusStr = statusStr;
}
public String getSendName() {
return sendName;
}
public void setSendName(String sendName) {
this.sendName = sendName;
}
public String getSendMobile() {
return sendMobile;
}
public void setSendMobile(String sendMobile) {
this.sendMobile = sendMobile;
}
public String getSendAddress() {
return sendAddress;
}
public void setSendAddress(String sendAddress) {
this.sendAddress = sendAddress;
}
public Object getOrderBelongId() {
return orderBelongId;
}
public void setOrderBelongId(Object orderBelongId) {
this.orderBelongId = orderBelongId;
}
public Object getOrderBelongType() {
return orderBelongType;
}
public void setOrderBelongType(Object orderBelongType) {
this.orderBelongType = orderBelongType;
}
public Object getComment() {
return comment;
}
public void setComment(Object comment) {
this.comment = comment;
}
public Object getReceiverPicUrl() {
return receiverPicUrl;
}
public void setReceiverPicUrl(Object receiverPicUrl) {
this.receiverPicUrl = receiverPicUrl;
}
public Object getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(Object totalPrice) {
this.totalPrice = totalPrice;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public Object getKey() {
return key;
}
public void setKey(Object key) {
this.key = key;
}
}
package com.dayu.order.ui.adapter; package com.dayu.order.ui.adapter;
import android.view.View;
import com.dayu.base.ui.adapter.CoreAdapter; import com.dayu.base.ui.adapter.CoreAdapter;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.api.protocol.bean.OrderPartBean; import com.dayu.order.api.protocol.bean.OrderPartListBean;
import com.dayu.order.databinding.ItemOrderPartListBinding; import com.dayu.order.databinding.ItemOrderPartListBinding;
import com.dayu.order.presenter.orderpart.OrderPartPresenter; import com.dayu.order.presenter.orderpart.OrderPartPresenter;
import com.dayu.utils.CommonUtils;
public class OrderPartListAdapter extends CoreAdapter<OrderPartBean,ItemOrderPartListBinding> { public class OrderPartListAdapter extends CoreAdapter<OrderPartListBean,ItemOrderPartListBinding> {
int type; int type;
OrderPartPresenter presenter; OrderPartPresenter presenter;
...@@ -20,13 +23,16 @@ public class OrderPartListAdapter extends CoreAdapter<OrderPartBean,ItemOrderPar ...@@ -20,13 +23,16 @@ public class OrderPartListAdapter extends CoreAdapter<OrderPartBean,ItemOrderPar
} }
@Override @Override
protected void onBind(ItemOrderPartListBinding holder, OrderPartBean item, int position) { protected void onBind(ItemOrderPartListBinding holder, OrderPartListBean item, int position) {
super.onBind(holder, item, position); super.onBind(holder, item, position);
holder.tvCode.setText(item.getCourierNumber()); if (item.getStatus()>1){
holder.tvCompany.setText(item.getCourierCompany()); holder.tvCode.setText(item.getSendCourierNumber());
holder.tvDate.setText(item.getCreateTime()); holder.tvCompany.setText(item.getSendCourierCompany());
holder.btnStatus.setText(item.getStatus() == 1?R.string.to_be_received_goods:R.string.already_received_goods); holder.tvDate.setText(CommonUtils.getYearData(item.getSendTime()));
if (type == 1 && item.getStatus() == 1){ holder.btnStatus.setVisibility(View.VISIBLE);
holder.ivToBeSend.setVisibility(View.GONE);
holder.btnStatus.setText(item.getStatus() == 2?R.string.to_be_received_goods:R.string.already_received_goods);
if (type == 1 && item.getStatus() == 2){
holder.btnStatus.setBackgroundResource(R.drawable.btn_blue_commom); holder.btnStatus.setBackgroundResource(R.drawable.btn_blue_commom);
holder.btnStatus.setTextColor(mContext.getResources().getColor(R.color.white)); holder.btnStatus.setTextColor(mContext.getResources().getColor(R.color.white));
holder.btnStatus.setOnClickListener(view -> presenter.toDetail(true,item.getId())); holder.btnStatus.setOnClickListener(view -> presenter.toDetail(true,item.getId()));
...@@ -34,5 +40,12 @@ public class OrderPartListAdapter extends CoreAdapter<OrderPartBean,ItemOrderPar ...@@ -34,5 +40,12 @@ public class OrderPartListAdapter extends CoreAdapter<OrderPartBean,ItemOrderPar
holder.btnStatus.setTextColor(mContext.getResources().getColor(R.color.common_text_color)); holder.btnStatus.setTextColor(mContext.getResources().getColor(R.color.common_text_color));
holder.btnStatus.setBackgroundResource(R.drawable.btn_black_react); holder.btnStatus.setBackgroundResource(R.drawable.btn_black_react);
} }
}else {
holder.tvCode.setText("暂无快递单号");
holder.tvCompany.setText("暂无物流公司");
holder.tvDate.setText("暂无发货日期");
holder.btnStatus.setVisibility(View.GONE);
holder.ivToBeSend.setVisibility(View.VISIBLE);
}
} }
} }
...@@ -7,26 +7,19 @@ import com.dayu.base.ui.fragment.BaseFragment; ...@@ -7,26 +7,19 @@ import com.dayu.base.ui.fragment.BaseFragment;
import com.dayu.common.Constants; import com.dayu.common.Constants;
import com.dayu.order.R; import com.dayu.order.R;
import com.dayu.order.api.protocol.OrderDetail; import com.dayu.order.api.protocol.OrderDetail;
import com.dayu.order.api.protocol.bean.OrderPartBean;
import com.dayu.order.common.PartReceiverEvent; import com.dayu.order.common.PartReceiverEvent;
import com.dayu.order.common.PartSendEvent; import com.dayu.order.common.PartSendEvent;
import com.dayu.order.databinding.FragmentOrderApplicationPartBinding; import com.dayu.order.databinding.FragmentOrderApplicationPartBinding;
import com.dayu.order.databinding.ItemOrderPartListBinding;
import com.dayu.order.ui.adapter.OrderPartListAdapter;
import com.dayu.provider.event.RefreshApplyPart;
import com.dayu.order.presenter.orderpart.OrderPartContract; import com.dayu.order.presenter.orderpart.OrderPartContract;
import com.dayu.order.presenter.orderpart.OrderPartPresenter; import com.dayu.order.presenter.orderpart.OrderPartPresenter;
import com.dayu.order.ui.adapter.OrderPartAdapter; import com.dayu.order.ui.adapter.OrderPartListAdapter;
import com.dayu.widgets.listener.OnItemClickListener; import com.dayu.provider.event.RefreshApplyPart;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
/** /**
* Created by luofan on 2018/1/18. * Created by luofan on 2018/1/18.
*/ */
...@@ -55,7 +48,9 @@ public class ApplicationOrderPartFragment extends BaseFragment<OrderPartPresente ...@@ -55,7 +48,9 @@ public class ApplicationOrderPartFragment extends BaseFragment<OrderPartPresente
mBind.lvPart.setAdapter(adapter); mBind.lvPart.setAdapter(adapter);
adapter.setPresenter(mPresenter); adapter.setPresenter(mPresenter);
adapter.setOnItemClickListener((item, bind) -> { adapter.setOnItemClickListener((item, bind) -> {
if (mType == 1 && item.getStatus() ==1 ){ if (item.getStatus() == 1)
return;
if (mType == 1 && item.getStatus() ==2 ){
mPresenter.toDetail(true,item.getId()); mPresenter.toDetail(true,item.getId());
}else{ }else{
mPresenter.toDetail(false,item.getId()); mPresenter.toDetail(false,item.getId());
......
...@@ -4,20 +4,20 @@ ...@@ -4,20 +4,20 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="@dimen/dp_13.3" android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginRight="@dimen/dp_13.3" android:layout_marginRight="@dimen/dp_13.3"
android:layout_marginBottom="15dp"
android:background="@drawable/item_shape_gray" android:background="@drawable/item_shape_gray"
android:padding="@dimen/dp_10" android:padding="@dimen/dp_10">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical">
>
<LinearLayout style="@style/ll_course_content" <LinearLayout
android:layout_marginTop="10dp" style="@style/ll_course_content"
> android:layout_marginTop="10dp">
<TextView <TextView
style="@style/tv_course_left" style="@style/tv_course_left"
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<TextView <TextView
android:id="@+id/tv_code" android:id="@+id/tv_code"
style="@style/tv_part_content" style="@style/tv_part_content" />
/>
</LinearLayout> </LinearLayout>
<LinearLayout style="@style/ll_course_content"> <LinearLayout style="@style/ll_course_content">
<TextView <TextView
...@@ -36,12 +36,12 @@ ...@@ -36,12 +36,12 @@
<TextView <TextView
android:id="@+id/tv_company" android:id="@+id/tv_company"
style="@style/tv_part_content" style="@style/tv_part_content" />
/>
</LinearLayout> </LinearLayout>
<LinearLayout style="@style/ll_course_content"
android:layout_marginBottom="10dp" <LinearLayout
> style="@style/ll_course_content"
android:layout_marginBottom="10dp">
<TextView <TextView
style="@style/tv_course_left" style="@style/tv_course_left"
...@@ -49,20 +49,29 @@ ...@@ -49,20 +49,29 @@
<TextView <TextView
android:id="@+id/tv_date" android:id="@+id/tv_date"
style="@style/tv_part_content" style="@style/tv_part_content" />
/>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/btn_status" android:id="@+id/btn_status"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="40dp" android:layout_height="40dp"
android:background="@drawable/btn_black_react"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_margin="10dp" android:layout_margin="10dp"
android:text="@string/to_be_received_goods" android:background="@drawable/btn_black_react"
/> android:text="@string/to_be_received_goods" />
<ImageView
android:visibility="gone"
android:id="@+id/iv_to_be_send"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:src="@drawable/ic_part_to_be_send" />
</RelativeLayout> </RelativeLayout>
</layout> </layout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment