Commit 320deecd by 罗翻

增加备件列表,物流信息等页面

parent 1619ccba
...@@ -17,6 +17,9 @@ public interface OrderPartContract { ...@@ -17,6 +17,9 @@ public interface OrderPartContract {
} }
abstract class Presenter extends BaseListPresenter<View> { abstract class Presenter extends BaseListPresenter<View> {
/**
* 查询备件列表
*/
public abstract void queryPartList(); public abstract void queryPartList();
/** /**
......
...@@ -63,7 +63,9 @@ public class OrderPartPresenter extends OrderPartContract.Presenter { ...@@ -63,7 +63,9 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
@Override @Override
public void queryPartList() { public void queryPartList() {
ApiFactory.queryPart(mOrderId, mType).subscribe(baseObserver( ApiFactory.queryPart(mOrderId, mType).subscribe(baseObserver(
(Consumer<List<OrderPart>>) orderPart -> datas.set(orderPart) (Consumer<List<OrderPart>>) orderPart -> {
datas.set(orderPart);
}
, responeThrowable -> datas.set(Constants.FAILED))); , responeThrowable -> datas.set(Constants.FAILED)));
} }
...@@ -74,7 +76,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter { ...@@ -74,7 +76,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
bundle.putInt(Constants.ORDER_ID, mOrderId); bundle.putInt(Constants.ORDER_ID, mOrderId);
bundle.putInt(Constants.TYPE, Constants.APPLY_PART); bundle.putInt(Constants.TYPE, Constants.APPLY_PART);
mView.startActivity(CommonSubmiteActivity.class, bundle); mView.startActivity(CommonSubmiteActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"applyApply"); MobclickAgent.onEvent(MyApplication.getContext(), "applyApply");
} else if (mType == 2) { } else if (mType == 2) {
dumpToReturnPart(Constants.BYMYSELF, null); dumpToReturnPart(Constants.BYMYSELF, null);
} }
...@@ -87,7 +89,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter { ...@@ -87,7 +89,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
bundle.putInt(Constants.PART_ID, partId); bundle.putInt(Constants.PART_ID, partId);
bundle.putInt(Constants.TYPE, Constants.REFUSE_PART); bundle.putInt(Constants.TYPE, Constants.REFUSE_PART);
mView.startActivity(CommonSubmiteActivity.class, bundle); mView.startActivity(CommonSubmiteActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"refuseApply"); MobclickAgent.onEvent(MyApplication.getContext(), "refuseApply");
} }
@Override @Override
...@@ -102,7 +104,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter { ...@@ -102,7 +104,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
} }
bundle.putInt(Constants.TYPE, type); bundle.putInt(Constants.TYPE, type);
mView.startActivity(ReturnPartActivity.class, bundle); mView.startActivity(ReturnPartActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"returnApply"); MobclickAgent.onEvent(MyApplication.getContext(), "returnApply");
} }
@Override @Override
...@@ -111,19 +113,19 @@ public class OrderPartPresenter extends OrderPartContract.Presenter { ...@@ -111,19 +113,19 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
bundle.putString(Constants.COURIER_NUM, courierNum); bundle.putString(Constants.COURIER_NUM, courierNum);
bundle.putString(Constants.SHIPPER_CODE, shipperCode); bundle.putString(Constants.SHIPPER_CODE, shipperCode);
mView.startActivity(LogisticsInfoActivity.class, bundle); mView.startActivity(LogisticsInfoActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"queryLogistics"); MobclickAgent.onEvent(MyApplication.getContext(), "queryLogistics");
} }
public Observable<Boolean> cancleApply(int partId) { public Observable<Boolean> cancleApply(int partId) {
mView.showDialog(); mView.showDialog();
MobclickAgent.onEvent(MyApplication.getContext(),"cancleApply"); MobclickAgent.onEvent(MyApplication.getContext(), "cancleApply");
return ApiFactory.cancleApply(partId, mUserName); return ApiFactory.cancleApply(partId, mUserName);
} }
@Override @Override
public Observable receivePart(int partId) { public Observable receivePart(int partId) {
mView.showDialog(); mView.showDialog();
MobclickAgent.onEvent(MyApplication.getContext(),"receiveApply"); MobclickAgent.onEvent(MyApplication.getContext(), "receiveApply");
return ApiFactory.receivePart(partId, mUserName); return ApiFactory.receivePart(partId, mUserName);
} }
} }
...@@ -82,9 +82,9 @@ public class ReceivingPresenter extends ReceivingContract.Presenter { ...@@ -82,9 +82,9 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
public void receiveOrderSuccess() { public void receiveOrderSuccess() {
int num = mTotalRows - 1; int num = mTotalRows - 1;
mView.showToast(R.string.receive_order_success); mView.showToast(R.string.receive_order_success);
EventBus.getDefault().post(new SwtichFragment(1));
mView.dumpBack(); mView.dumpBack();
mDisPosable = Observable.timer(300, TimeUnit.MILLISECONDS).subscribe(aLong -> { mDisPosable = Observable.timer(300, TimeUnit.MILLISECONDS).subscribe(aLong -> {
EventBus.getDefault().post(new SwtichFragment(1));
EventBus.getDefault().post(new RefreshTab(0)); EventBus.getDefault().post(new RefreshTab(0));
EventBus.getDefault().post(new RefreshReceivingNum(num < 0 ? 0 : num)); EventBus.getDefault().post(new RefreshReceivingNum(num < 0 ? 0 : num));
EventBus.getDefault().post(new RefreshApoiment(-1)); EventBus.getDefault().post(new RefreshApoiment(-1));
......
...@@ -308,4 +308,11 @@ public class LRecyclerView<M, B> extends FrameLayout { ...@@ -308,4 +308,11 @@ public class LRecyclerView<M, B> extends FrameLayout {
public List<M> getDatas() { public List<M> getDatas() {
return mCoreAdapter.getDatas(); return mCoreAdapter.getDatas();
} }
/**
* 滑动到底部.
*/
public void scrollBottom() {
recyclerview.smoothScrollToPosition(mCoreAdapter.getItemCount() - 1);
}
} }
...@@ -73,6 +73,8 @@ ...@@ -73,6 +73,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:textColor="@color/default_text_color" android:textColor="@color/default_text_color"
android:ellipsize="end"
android:maxLines="5"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
...@@ -163,6 +165,8 @@ ...@@ -163,6 +165,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:textColor="@color/default_text_color" android:textColor="@color/default_text_color"
android:ellipsize="end"
android:maxLines="5"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
......
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