Commit 5db0dd03 by 罗翻

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

parent 24f6b543
Showing with 100 additions and 117 deletions
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
......@@ -24,6 +24,7 @@ public class Constants {
public static final String BASE_URL = "http://47.94.101.239:3112";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "http://47.94.101.239:9004/#/sop";
public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
public static final boolean UM_DEBUG = true;
// public final static String WEB_SOP = "http://192.168.1.132:8080/#/sop";
......@@ -135,7 +136,7 @@ public class Constants {
/**
* 获取服务说明.
*/
public final static String ORDER_INSTRUCTION = " /api-message/" + "hXMessage/count/hxAccount/{hxAccount}";
public final static String ORDER_INSTRUCTION = " /api-ka-base/" + "spuServiceDetail";
/**
* 获取厂商收货地址.
*/
......@@ -193,7 +194,7 @@ public class Constants {
/***********************其他配置**********************************/
public final static int PAGESIZE = 10;
public final static int PAGESIZE = 20;
public final static String BUNDLE = "bundle";
public final static String ID = "id";
//订单详情
......
......@@ -366,7 +366,8 @@ public interface APIService {
* @return
*/
@GET(Constants.ORDER_INSTRUCTION)
Observable<BaseResponse<List<ServerInstruction>>> getInstruction(@Path("id") int id);
Observable<BaseResponse<BasePageBean<ServerInstruction>>> getInstruction(@Query("kaSpuId") long id, @Query("page") int page,
@Query("pageSize") int pageSize);
/**
* 获取厂商收货地址.
......
......@@ -20,15 +20,15 @@ import java.lang.reflect.ParameterizedType;
/**
* Created by luofan on 17/11/02.
*/
public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBinding> extends DataBindingActivity<B> {
public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBinding> extends DataBindingActivity<B>
implements BaseView {
public P mPresenter;
private boolean isDialogShow = false;
@Override
protected void initPresenter() {
super.initPresenter();
if (this instanceof BaseView &&
this.getClass().getGenericSuperclass() instanceof ParameterizedType &&
if (this.getClass().getGenericSuperclass() instanceof ParameterizedType &&
((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments().length > 0) {
Class mPresenterClass = (Class) ((ParameterizedType) (this.getClass()
.getGenericSuperclass())).getActualTypeArguments()[0];
......@@ -73,8 +73,8 @@ public abstract class BaseActivity<P extends BasePresenter, B extends ViewDataBi
mActivity.finish();
}
public void dumpBack(int requestCode ,Intent intent) {
mActivity.setResult(requestCode,intent);
public void dumpBack(int requestCode, Intent intent) {
mActivity.setResult(requestCode, intent);
mActivity.finish();
}
......
......@@ -20,15 +20,15 @@ import java.lang.reflect.ParameterizedType;
/**
* Created by luo on 2017/11/14.
*/
public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBinding> extends DataBindingFragment<B> {
public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBinding> extends DataBindingFragment<B>
implements BaseView {
public P mPresenter;
private boolean isDialogShow = false;
@Override
protected void initPresenter() {
super.initPresenter();
if (this instanceof BaseView &&
this.getClass().getGenericSuperclass() instanceof ParameterizedType &&
if (this.getClass().getGenericSuperclass() instanceof ParameterizedType &&
((ParameterizedType) (this.getClass().getGenericSuperclass())).getActualTypeArguments().length > 0) {
Class mPresenterClass = (Class) ((ParameterizedType) (this.getClass()
.getGenericSuperclass())).getActualTypeArguments()[0];
......@@ -50,8 +50,8 @@ public abstract class BaseFragment<P extends BasePresenter, B extends ViewDataBi
mActivity.finish();
}
public void dumpBack(int requestCode ,Intent intent) {
mActivity.setResult(requestCode,intent);
public void dumpBack(int requestCode, Intent intent) {
mActivity.setResult(requestCode, intent);
mActivity.finish();
}
......
......@@ -44,7 +44,7 @@ public class Order {
private int subStatus;
private int anyContacts;
private String spuName;
private String spuId;
private int spuId;
private int excptionCode;
private String appointmentTime;
private int sopStatus;
......@@ -201,11 +201,11 @@ public class Order {
this.spuName = spuName;
}
public String getSpuId() {
public int getSpuId() {
return spuId;
}
public void setSpuId(String spuId) {
public void setSpuId(int spuId) {
this.spuId = spuId;
}
......
......@@ -66,7 +66,7 @@ public class OrderDetail implements Serializable {
private List<?> pic;
private String sn;
private String spuName;
private String spuId;
private int spuId;
private Integer anyContacts;
private Integer kaCompanyId;
private Integer createdSource; //1.服务商自己填写的工单2.厂商系统派3.ka系统4.小程序添加的工单
......@@ -544,11 +544,11 @@ public class OrderDetail implements Serializable {
this.spuName = spuName;
}
public String getSpuId() {
public int getSpuId() {
return spuId;
}
public void setSpuId(String spuId) {
public void setSpuId(int spuId) {
this.spuId = spuId;
}
......
......@@ -17,6 +17,7 @@ import io.reactivex.functions.Consumer;
public class LogisticsInfoPresenter extends LogisticsInfoContract.Presenter {
private ObservableField<Object> datas = new ObservableField<>();
private ObservableField<Object> headData = new ObservableField<>();
public ObservableField<Boolean> isShowLine = new ObservableField<>(false);
private String mCourierNum;
private String mShipperCode;
......@@ -51,7 +52,14 @@ public class LogisticsInfoPresenter extends LogisticsInfoContract.Presenter {
logsticsInfo -> {
datas.set(logsticsInfo.getLogistics());
headData.set(logsticsInfo);
},
responeThrowable -> datas.set(Constants.FAILED)));
if (logsticsInfo.getLogistics().size() == 0) {
isShowLine.set(false);
} else {
isShowLine.set(true);
}},
responeThrowable -> {
isShowLine.set(false);
datas.set(Constants.FAILED);
}));
}
}
......@@ -57,12 +57,14 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
private OrderInfo mOrderInfo;
private int isPay;//是否支付费用,默认=1 不支付费用
private int mAnyContacts;
private int mSpuId;
@Override
public void onAttached() {
Bundle bundle = mView.getBundle();
mOrderId = bundle.getInt(Constants.ORDER_ID, 0);
mPosition = bundle.getInt(Constants.ORDER_POSTION, 0);
mSpuId = bundle.getInt(Constants.ID, 0);
UserInfo userInfo = UserManager.getInstance().getUser();
mAccountId = Integer.parseInt(userInfo.getAccountId());
mOrderInfoDao = GreenDaoManager.getInstance().getmDaoSession().getOrderInfoDao();
......@@ -240,7 +242,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
@Override
public void dumpToServerInstruction() {
Bundle bundle = new Bundle();
bundle.putInt(Constants.ORDER_ID, mOrderId);
bundle.putInt(Constants.ID, mSpuId);
mView.startActivity(ServerInstructionActivity.class, bundle);
}
......
......@@ -68,6 +68,7 @@ public class ReturnPartPresenter extends ReturnPartContract.Presenter {
try {
jsonObject.put("courierNumber", courierNum.get());
jsonObject.put("spComment", spComent.get());
jsonObject.put("spRemarks", spComent.get());
jsonObject.put("courierServicesCompany", courierCompany.get());
jsonObject.put("shipperCode", mShipperCode);
jsonObject.put("kaRemarks", kaComent.get());
......
......@@ -19,6 +19,6 @@ public interface ServerInstructionContract {
*/
public abstract void getInstructs();
public abstract void dumpDetail();
public abstract void dumpDetail(String url);
}
}
......@@ -6,12 +6,10 @@ import android.os.Bundle;
import com.app.annotation.apt.InstanceFactory;
import com.apt.ApiFactory;
import com.dayu.bigfish.Constants;
import com.dayu.bigfish.base.BasePageBean;
import com.dayu.bigfish.bean.ServerInstruction;
import com.dayu.bigfish.ui.WebViewActivity;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.functions.Consumer;
/**
......@@ -20,8 +18,8 @@ import io.reactivex.functions.Consumer;
@InstanceFactory
public class ServerInstructionPresenter extends ServerInstructionContract.Presenter {
public ObservableField mDatas = new ObservableField();
private ArrayList<ServerInstruction> instructions;
private int mOrderId;
private int mSpuId;
private int mPage;
@Override
public ObservableField<Object> getSourceDatas() {
......@@ -31,20 +29,36 @@ public class ServerInstructionPresenter extends ServerInstructionContract.Presen
@Override
public void onAttached() {
Bundle bundle = mView.getBundle();
mOrderId = bundle.getInt(Constants.ORDER_ID);
getInstructs();
mSpuId = bundle.getInt(Constants.ID);
refresh();
}
@Override
public void getInstructs() {
ApiFactory.getInstruction(mOrderId).subscribe(baseObserver((Consumer<List<ServerInstruction>>)
serverInstructions -> mDatas.set(serverInstructions)));
ApiFactory.getInstruction(mSpuId, mPage, Constants.PAGESIZE).subscribe(baseObserver((Consumer<BasePageBean<ServerInstruction>>)
datas -> {
mPage++;
mDatas.set(datas);
}));
}
@Override
public void dumpDetail() {
public void dumpDetail(String url) {
Bundle bundle = new Bundle();
bundle.putString(Constants.URL, instructions.get(0).getUrl());
bundle.putInt(Constants.ID, mSpuId);
mView.startActivity(WebViewActivity.class, bundle);
}
@Override
public void refresh() {
super.refresh();
mPage = 1;
getInstructs();
}
@Override
public void loadMore() {
super.loadMore();
getInstructs();
}
}
......@@ -105,7 +105,7 @@ public class SubcribeTimePresenter extends SubcribeContract.Presenter {
} else if (mState == ORDER_YUYUE || mState == ORDER_DOING) {
EventBus.getDefault().post(new OrderState(ORDER_YUYUE, mPosition, mTime));
}
// mView.dumpBack();
mView.dumpBack();
}
}, responeThrowable -> {
if ("ORDER0004".equals(responeThrowable.subCode)) {
......
......@@ -44,7 +44,6 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
ValueCallback<Uri[]> uploadMessageAboveL;
int RESULT_CODE = 0;
int RESULT_CODE_FOR_Lollipop = 1;
private SopWebViewActivity mActivity;
private BridgeWebView mWebView;
@Override
......
......@@ -24,6 +24,7 @@ import java.io.File;
public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding> {
private BridgeWebView mWebView;
private String mUrl;
private int mOrderId;
@Override
public int getLayoutId() {
......@@ -33,7 +34,8 @@ public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding>
@Override
public void initView() {
Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE);
mUrl = bundle.getString(Constants.URL);
mOrderId = bundle.getInt(Constants.ID);
mUrl = Constants.WEB_ZHI_SHI + "?id=" + mOrderId;
mBind.tvTitle.setText(getResources().getString(R.string.order_instruction));
mBind.tvRightTitle.setText(getResources().getString(R.string.open_webview));
mBind.tvRightTitle.setVisibility(View.VISIBLE);
......
......@@ -247,15 +247,15 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
mItem = it;
mBind = h;
if (mItem.getStatus() == 4 && mItem.getSubStatus() == 3) {
dumpProcessActivity(mItem.getId(), posiiton);
dumpProcessActivity(mItem, posiiton);
} else if (mItem.getStatus() == 4 && mItem.getSubStatus() == 4) {
if (mItem.getSopStatus() == 1) {//sop启用
dumpSOPActivity(mItem.getId(), posiiton);
} else if (mItem.getSopStatus() == 0) {
dumpProcessActivity(mItem.getId(), posiiton);
dumpProcessActivity(mItem, posiiton);
}
} else if (mItem.getStatus() == 4 && mItem.getSubStatus() == 5) {
dumpProcessActivity(mItem.getId(), posiiton);
dumpProcessActivity(mItem, posiiton);
}
if (mItem.getStatus() == 4) {
return;
......@@ -325,10 +325,11 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
mContext.startActivity(intent);
}
private void dumpProcessActivity(int id, int adapterPosition) {
private void dumpProcessActivity(Order detail, int adapterPosition) {
Intent intent = new Intent(mContext, ProcessOrderActivity.class);
Bundle bundle = new Bundle();
bundle.putInt(Constants.ORDER_ID, id);
bundle.putInt(Constants.ORDER_ID, detail.getId());
bundle.putInt(Constants.ID, detail.getSpuId());
bundle.putInt(Constants.ORDER_POSTION, adapterPosition);
intent.putExtra(Constants.BUNDLE, bundle);
mContext.startActivity(intent);
......
......@@ -44,6 +44,7 @@ public class OrderPartAdapter extends CoreAdapter<OrderPart, ItemApplyPartLayout
holder.logisticsInfo.setText(UIUtils.getString(R.string.cannot_return));
holder.logisticsInfo.setOnClickListener(v -> presenter.dumpToRefusePart(item.getId()));
holder.receivePart.setText(UIUtils.getString(R.string.return_order_part));
holder.receivePart.setTextColor(UIUtils.getColor(R.color.cl_home_button));
holder.receivePart.setOnClickListener(v -> presenter.dumpToReturnPart(Constants.BYKA, item));
holder.lineTwo.setVisibility(View.GONE);
holder.lineOne.setVisibility(View.GONE);
......@@ -87,10 +88,12 @@ public class OrderPartAdapter extends CoreAdapter<OrderPart, ItemApplyPartLayout
})));
if (item.getSource() != null && item.getSource() == 1) {
holder.receivePart.setText(UIUtils.getString(R.string.receive_part));
holder.receivePart.setTextColor(UIUtils.getColor(R.color.cl_home_button));
if (TextUtils.isEmpty(item.getApplicant())) {
holder.llApplyInfo.setVisibility(View.GONE);
}
} else if (item.getSource() != null && item.getSource() == 2) {
holder.receivePart.setTextColor(UIUtils.getColor(R.color.cl_home_button));
holder.receivePart.setText(UIUtils.getString(R.string.modify_part_info));
holder.receivePart.setOnClickListener(v -> presenter.dumpToReturnPart(Constants.BY_MODIFY_PART, item));
holder.llApplyInfo.setVisibility(View.GONE);
......@@ -108,6 +111,7 @@ public class OrderPartAdapter extends CoreAdapter<OrderPart, ItemApplyPartLayout
holder.tvPartState.setText(UIUtils.getString(R.string.part_received));
holder.logisticsInfo.setText(UIUtils.getString(R.string.logistics_info));
holder.receivePart.setText(UIUtils.getString(R.string.receive_part));
holder.receivePart.setTextColor(UIUtils.getColor(R.color.cl_home_button));
holder.logisticsInfo.setVisibility(View.VISIBLE);
holder.logisticsInfo.setOnClickListener(v -> presenter.queryLogistics(item.getCourierNumber(), item.getShipperCode()));
if (item.getSource() != null && item.getSource() == 1) {
......@@ -167,6 +171,7 @@ public class OrderPartAdapter extends CoreAdapter<OrderPart, ItemApplyPartLayout
holder.logisticsInfo.setVisibility(View.GONE);
holder.receivePart.setVisibility(View.GONE);
holder.llNeedReturn.setVisibility(View.VISIBLE);
holder.receivePart.setTextColor(UIUtils.getColor(R.color.default_text_color));
}
private void showCancleDialog(OrderPart part, ItemApplyPartLayoutBinding holder) {
......
package com.dayu.bigfish.ui.fragment;
import android.os.Bundle;
import com.dayu.bigfish.Constants;
import com.dayu.bigfish.R;
import com.dayu.bigfish.base.BaseFragment;
import com.dayu.bigfish.bean.OrderDetail;
import com.dayu.bigfish.databinding.FragmentOrderApplicationPartBinding;
import com.dayu.bigfish.presenter.orderpart.OrderPartContract;
import com.dayu.bigfish.presenter.orderpart.OrderPartPresenter;
import com.dayu.bigfish.ui.adapter.OrderPartAdapter;
/**
* Created by luofan on 2018/1/18.
*/
public class ReturnOrderPartFragment extends BaseFragment<OrderPartPresenter, FragmentOrderApplicationPartBinding>
implements OrderPartContract.View {
public static ReturnOrderPartFragment newInstance(OrderDetail detail) {
Bundle args = new Bundle();
args.putSerializable(Constants.ORDER_DETAIL,detail);
ReturnOrderPartFragment fragment = new ReturnOrderPartFragment();
fragment.setArguments(args);
return fragment;
}
@Override
public void initView() {
mBind.applyPart.setText(getString(R.string.return_one_order_part));
OrderPartAdapter adapter = new OrderPartAdapter(false);
mBind.lvPart.setAdapter(adapter);
}
@Override
protected void lazyLoad() {
super.lazyLoad();
mPresenter.queryPartList();
}
@Override
public int getLayoutId() {
return R.layout.fragment_order_application_part;
}
}
......@@ -5,7 +5,6 @@ import android.content.SharedPreferences;
import com.dayu.bigfish.MyApplication;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
......@@ -154,9 +153,7 @@ public class SPUtils {
sApplyMethod.invoke(editor);
return;
}
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
} catch (Exception e) {
}
editor.commit();
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomLeftRadius="@dimen/dp_8"/>
<solid android:color="#f0f0f0"/>
<stroke
android:width="0.7dp"
android:color="#FF3A3A3A" />
<corners android:radius="33.3dp" />
<solid android:color="@color/cl_white" />
</shape>
\ No newline at end of file
......@@ -38,9 +38,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f5f5f5"
app:isRefreshable="false"
app:isRefreshable="true"
app:itemType="@layout/item_order_instruction"
app:needCoreAdapter="true"
app:needFoot="false" />
app:needFoot="true" />
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -6,6 +6,7 @@
<variable
name="presenter"
type="com.dayu.bigfish.presenter.logisticsinfo.LogisticsInfoPresenter" />
<import type="android.view.View"/>
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
......@@ -37,11 +38,13 @@
android:layout_height="match_parent">
<com.dayu.bigfish.ui.views.DottdeLineView
android:id="@+id/dl_line"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginLeft="34.5dp"
android:layout_marginTop="80dp"
android:layerType="software" />
android:visibility="@{presenter.isShowLine?View.VISIBLE:View.GONE}"
android:layerType="software"/>
<com.dayu.bigfish.ui.views.LRecyclerView
android:id="@+id/lv_part"
......
......@@ -55,6 +55,7 @@
</LinearLayout>
</LinearLayout>
<ImageView style="@style/card_line" />
<FrameLayout
android:id="@+id/fl_container"
......
......@@ -51,7 +51,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="38dp"
android:paddingRight="43dp"
android:paddingTop="@dimen/dp_20"
android:text="@string/ka_beizhu"
android:textColor="@color/default_text_color"
......@@ -63,6 +63,8 @@
android:layout_height="wrap_content"
android:paddingRight="@dimen/dp_15"
android:paddingTop="@dimen/dp_20"
android:maxLines="5"
android:ellipsize="end"
android:text="@{TextUtils.isEmpty(presenter.kaComent)?@string/no_data:presenter.kaComent}"
android:textColor="@color/default_text_color"
android:textSize="15sp" />
......
......@@ -10,7 +10,7 @@
<android.support.design.widget.TabLayout
android:id="@+id/tb_message"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_height="46dp"
app:tabIndicatorColor="@color/cl_receiving_order_item_data"
app:tabMaxWidth="0dp"
app:tabSelectedTextColor="@color/cl_receiving_order_item_data"
......
......@@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:onClick="@{()->presenter.dumpDetail()}"
android:onClick="@{()->presenter.dumpDetail(item.url)}"
android:orientation="horizontal">
<TextView
......
......@@ -28,7 +28,7 @@
<color name="text_color">#8a8a8a</color>
<color name="default_text_color">#FF2D2D2D</color>
<color name="default_editext_color">#FF959595</color>
<color name="cl_line">#FFE5E5E5</color>
<color name="cl_line">#FFE3E3E3</color>
<color name="cl_bg">#FFF5F5F5</color>
......
......@@ -224,13 +224,13 @@
<string name="tv_refuse_order_title">拒绝申请</string>
<string name="tv_apply_order_title">申请备件</string>
<string name="tv_apply_instruction">申请说明:</string>
<string name="tv_apply_name">申请人:&#160;&#160;&#160;&#160;</string>
<string name="tv_apply_name">申请人:</string>
<string name="tv_apply_mobile">联系方式:</string>
<string name="tv_apply_time">申请时间:</string>
<string name="refuse_apply_reason">拒绝原因:</string>
<string name="tv_ka_instruction">厂商说明:</string>
<string name="tv_sp_instruction">服务商说明:</string>
<string name="tv_ka_name">发货人:&#160;&#160;&#160;&#160;</string>
<string name="tv_ka_name">发货人:</string>
<string name="tv_need_return">需要寄回:</string>
<string name="tv_part_num">快递单号:</string>
<string name="ka_beizhu">厂商备注</string>
......
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