Commit 2c6a1183 by 罗翻

服务详情修改

parent af566e4e
...@@ -12,24 +12,24 @@ public class Constants { ...@@ -12,24 +12,24 @@ public class Constants {
/** /**
* 测试环境配置. * 测试环境配置.
*/ */
// public static final int LOG_LEVEL = LogUtils.LEVEL_ALL; public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
// public static final String ENVIROMENT = "debug"; public static final String ENVIROMENT = "debug";
// public static final String BASE_URL = "http://47.94.101.239:3112"; 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 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_SOP = "http://47.94.101.239:9004/#/sop";
// public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail"; public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
// public static final boolean IS_DEBUG = true; public static final boolean IS_DEBUG = true;
/** /**
* uat环境配置. * uat环境配置.
*/ */
public static final String ENVIROMENT = "uat"; // public static final String ENVIROMENT = "uat";
public static final int LOG_LEVEL = LogUtils.LEVEL_ALL; // public static final int LOG_LEVEL = LogUtils.LEVEL_ALL;
public static final String BASE_URL = "http://47.95.223.6:3112"; // public static final String BASE_URL = "http://47.95.223.6:3112";
public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply"; // public final static String UP_PHOTO = "/file/uploadMore?targetPath=test/sp/mobile/android/business/checkApply";
public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop"; // public final static String WEB_SOP = "http://47.95.223.6:9004/#/sop";
public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail"; // public final static String WEB_ZHI_SHI = "http://47.95.223.6:9004/#/detail";
public static final boolean IS_DEBUG = true; // public static final boolean IS_DEBUG = true;
/** /**
* 正式环境. * 正式环境.
......
...@@ -106,19 +106,11 @@ public class BindingUtils { ...@@ -106,19 +106,11 @@ public class BindingUtils {
return; return;
} }
view.setPresenter(presenter); view.setPresenter(presenter);
setData(view,presenter);
presenter.getSourceDatas().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() { presenter.getSourceDatas().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
@Override @Override
public void onPropertyChanged(Observable observable, int i) { public void onPropertyChanged(Observable observable, int i) {
Object obj = presenter.getSourceDatas().get(); setData(view,presenter);
if (obj instanceof BasePageBean) {
view.setPageData((BasePageBean) obj);
} else if (obj instanceof List) {
view.setData((List) obj);
} else if (obj instanceof Integer) {
if ((int) obj == Constants.FAILED) {
view.setDataFail();
}
}
} }
}); });
if (presenter.getHeaderDatas() != null) { if (presenter.getHeaderDatas() != null) {
...@@ -132,6 +124,19 @@ public class BindingUtils { ...@@ -132,6 +124,19 @@ public class BindingUtils {
} }
} }
private static void setData(LRecyclerView view, BaseListPresenter presenter) {
Object obj = presenter.getSourceDatas().get();
if (obj instanceof BasePageBean) {
view.setPageData((BasePageBean) obj);
} else if (obj instanceof List) {
view.setData((List) obj);
} else if (obj instanceof Integer) {
if ((int) obj == Constants.FAILED) {
view.setDataFail();
}
}
}
/** /**
* Lrecycleview设置数据源. * Lrecycleview设置数据源.
* *
......
...@@ -9,7 +9,7 @@ buildscript { ...@@ -9,7 +9,7 @@ buildscript {
ext.verson_name = "1.4.0" ext.verson_name = "1.4.0"
ext.gradle_version = '3.0.1' ext.gradle_version = '3.0.1'
ext.isReleaseMinify = true ext.isReleaseMinify = true
ext.isDebugMinify = true ext.isDebugMinify = false
ext.arouter_api_version = '1.3.1' ext.arouter_api_version = '1.3.1'
ext.arouter_compiler_version = '1.1.4' ext.arouter_compiler_version = '1.1.4'
......
...@@ -61,5 +61,8 @@ ...@@ -61,5 +61,8 @@
<activity <activity
android:name=".ui.activity.PdfWebViewActivity" android:name=".ui.activity.PdfWebViewActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.CheckContentActivity"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>
...@@ -63,7 +63,7 @@ public class OrderDetail implements Serializable { ...@@ -63,7 +63,7 @@ public class OrderDetail implements Serializable {
private Object feedback; private Object feedback;
private Object complait; private Object complait;
private List<RecordBean> record; private List<RecordBean> record;
private List<?> pic; private List<Pics> pic;
private String sn; private String sn;
private String spuName; private String spuName;
private int spuId; private int spuId;
...@@ -520,11 +520,11 @@ public class OrderDetail implements Serializable { ...@@ -520,11 +520,11 @@ public class OrderDetail implements Serializable {
this.record = record; this.record = record;
} }
public List<?> getPic() { public List<Pics> getPic() {
return pic; return pic;
} }
public void setPic(List<?> pic) { public void setPic(List<Pics> pic) {
this.pic = pic; this.pic = pic;
} }
...@@ -576,6 +576,45 @@ public class OrderDetail implements Serializable { ...@@ -576,6 +576,45 @@ public class OrderDetail implements Serializable {
this.kaCompanyId = kaCompanyId; this.kaCompanyId = kaCompanyId;
} }
public static class Pics implements Serializable {
private int id;
private int orderId;
private int pictureType;
private String pictureUrl;
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 int getPictureType() {
return pictureType;
}
public void setPictureType(int pictureType) {
this.pictureType = pictureType;
}
public String getPictureUrl() {
return pictureUrl;
}
public void setPictureUrl(String pictureUrl) {
this.pictureUrl = pictureUrl;
}
}
public static class RecordBean implements Serializable { public static class RecordBean implements Serializable {
/** /**
* id : 174 * id : 174
...@@ -598,6 +637,9 @@ public class OrderDetail implements Serializable { ...@@ -598,6 +637,9 @@ public class OrderDetail implements Serializable {
private int serviceProgessTimeNum; private int serviceProgessTimeNum;
private String commentName; private String commentName;
private String commentInfo; private String commentInfo;
private String orderObj;
private double latitude;
private double longitude;
public int getId() { public int getId() {
return id; return id;
...@@ -670,9 +712,33 @@ public class OrderDetail implements Serializable { ...@@ -670,9 +712,33 @@ public class OrderDetail implements Serializable {
public void setCommentInfo(String commentInfo) { public void setCommentInfo(String commentInfo) {
this.commentInfo = commentInfo; this.commentInfo = commentInfo;
} }
public String getOrderObj() {
return orderObj;
}
public void setOrderObj(String orderObj) {
this.orderObj = orderObj;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
} }
public class accessories implements Serializable{ public class accessories implements Serializable {
private int id; private int id;
private String name; private String name;
private int orderId; private int orderId;
......
...@@ -3,7 +3,8 @@ package com.dayu.order.presenter; ...@@ -3,7 +3,8 @@ package com.dayu.order.presenter;
import com.dayu.base.ui.presenter.BaseListPresenter; import com.dayu.base.ui.presenter.BaseListPresenter;
/** /**
* Created by luofan on 2017/12/22. * Created by luofan
* on 2017/12/22.
*/ */
public abstract class BaseOrderPresenter<V> extends BaseListPresenter<V> { public abstract class BaseOrderPresenter<V> extends BaseListPresenter<V> {
......
package com.dayu.order.presenter.orderserver;
import com.dayu.base.ui.presenter.BaseListPresenter;
import com.dayu.common.BaseView;
/**
* Created by luo
* on 2016/8/4.
*/
public interface OrderServerContract {
interface View extends BaseView {
}
abstract class Presenter extends BaseListPresenter<View> {
public abstract void dumpToSop();
public abstract void dumpCheckContent(int postion);
}
}
package com.dayu.order.presenter.orderserver;
import android.databinding.ObservableField;
import android.os.Bundle;
import com.dayu.common.Constants;
import com.dayu.order.api.protocol.OrderDetail;
import com.dayu.order.ui.activity.CheckContentActivity;
import com.dayu.order.ui.activity.SopWebViewActivity;
import java.util.Collections;
import java.util.List;
import static com.dayu.common.Constants.ORDER_ID;
/**
* Created by luofan
* on 2017/11/8.
*/
public class OrderServerPresenter extends OrderServerContract.Presenter {
public ObservableField<Object> mDatas = new ObservableField<>();
public ObservableField<Boolean> isShowLine = new ObservableField<>();
private OrderDetail mDetails;
@Override
public void onAttached() {
mDetails = (OrderDetail) mView.getBundle().getSerializable(Constants.ORDER_DETAIL);
if (mDetails != null) {
List list = mDetails.getRecord();
Collections.reverse(list);
mDatas.set(list);
if (list.size() == 0) {
isShowLine.set(false);
} else {
isShowLine.set(true);
}
} else {
isShowLine.set(false);
}
}
@Override
public ObservableField<Object> getSourceDatas() {
return mDatas;
}
@Override
public void dumpToSop() {
Bundle bundle = new Bundle();
bundle.putInt(ORDER_ID, mDetails.getId());
mView.startActivity(SopWebViewActivity.class, bundle);
}
@Override
public void dumpCheckContent(int postion) {
Bundle bundle = new Bundle();
bundle.putSerializable(Constants.ORDER_DETAIL,mDetails);
bundle.putInt(Constants.ORDER_POSTION,postion);
mView.startActivity(CheckContentActivity.class,bundle);
}
}
...@@ -129,7 +129,6 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter { ...@@ -129,7 +129,6 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
@Override @Override
public void getOrderInfo(int orderId) { public void getOrderInfo(int orderId) {
OrderApiFactory.queryOrderInfo(orderId).subscribe(baseObserver(detail -> { OrderApiFactory.queryOrderInfo(orderId).subscribe(baseObserver(detail -> {
detail.setCreatedSource(3);
mOrderDetail = detail; mOrderDetail = detail;
if (detail.getCreatedSource() != 3) { if (detail.getCreatedSource() != 3) {
mView.setFoucesable(); mView.setFoucesable();
...@@ -168,6 +167,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter { ...@@ -168,6 +167,7 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
params.put("servicePrice", servicePrice); params.put("servicePrice", servicePrice);
params.put("servicePriceComment", ""); params.put("servicePriceComment", "");
// params.put("categoryName")
params.put("brandName", brandName); params.put("brandName", brandName);
params.put("productModel", productModel); params.put("productModel", productModel);
params.put("sn", sn); params.put("sn", sn);
...@@ -296,17 +296,27 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter { ...@@ -296,17 +296,27 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
} }
mView.getData(); mView.getData();
OrderInfo info = mOrderField.get(); OrderInfo info = mOrderField.get();
if (TextUtils.isEmpty(info.getPayer())) {
mView.showNoPayerDialog();
return;
}
if ("1".equals(mOrderInfo.getPayer())) { if ("1".equals(mOrderInfo.getPayer())) {
mPayer.set(UIUtils.getString(R.string.payer_baonei)); mPayer.set(UIUtils.getString(R.string.payer_baonei));
} else if ("2".equals(mOrderInfo.getPayer())) { } else if ("2".equals(mOrderInfo.getPayer())) {
mPayer.set(UIUtils.getString(R.string.payer_baowai)); mPayer.set(UIUtils.getString(R.string.payer_baowai));
} }
if (mOrderDetail.getCreatedSource() == 3) {
if (TextUtils.isEmpty(info.getPayer())) {
mView.showNoPayerDialog();
return;
}
mView.showSelectPayerDialog((dialog, confirm) -> { mView.showSelectPayerDialog((dialog, confirm) -> {
if (confirm) { if (confirm) {
commite(info);
}
});
} else {
commite(info);
}
}
private void commite(OrderInfo info) {
mView.showDialog(); mView.showDialog();
if (mImages.size() != 0 && mPayerImages.size() != 0) { if (mImages.size() != 0 && mPayerImages.size() != 0) {
mView.showDialog(); mView.showDialog();
...@@ -318,8 +328,6 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter { ...@@ -318,8 +328,6 @@ public class ProcessOrderPresenter extends ProcessOrderContract.Presenter {
} }
MobclickAgent.onEvent(BaseApplication.getContext(), "commite_order"); MobclickAgent.onEvent(BaseApplication.getContext(), "commite_order");
} }
});
}
@Override @Override
public void dumpToSop() { public void dumpToSop() {
......
package com.dayu.order.sqlbean;
/**
* Created by luofan
* on 2018/4/23.
*/
public class CheckContentOrder {
private String categoryName;
private String customerCheckComment;
private String doorPrice;
private String servicePrice;
private String materialCost;
private String otherPrice;
private String doorPriceComment;
private String brandName;
private String productModel;
private String sn;
private int repairType;
public String getCustomerCheckComment() {
return customerCheckComment;
}
public void setCustomerCheckComment(String customerCheckComment) {
this.customerCheckComment = customerCheckComment;
}
public String getDoorPrice() {
return doorPrice;
}
public void setDoorPrice(String doorPrice) {
this.doorPrice = doorPrice;
}
public String getServicePrice() {
return servicePrice;
}
public void setServicePrice(String serverPrice) {
this.servicePrice = servicePrice;
}
public String getMaterialCost() {
return materialCost;
}
public void setMaterialCost(String materialCost) {
this.materialCost = materialCost;
}
public String getOtherPrice() {
return otherPrice;
}
public void setOtherPrice(String otherPrice) {
this.otherPrice = otherPrice;
}
public String getDoorPriceComment() {
return doorPriceComment;
}
public void setDoorPriceComment(String otherPriceComment) {
this.doorPriceComment = otherPriceComment;
}
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName;
}
public String getProductModel() {
return productModel;
}
public void setProductModel(String productModel) {
this.productModel = productModel;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public int getRepairType() {
return repairType;
}
public void setRepairType(int
payer) {
this.repairType = payer;
}
public String getCategoryName() {
return this.categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
}
...@@ -46,6 +46,7 @@ public class OrderInfo extends BaseObservable { ...@@ -46,6 +46,7 @@ public class OrderInfo extends BaseObservable {
@Convert(columnType = String.class, converter = StringConverter.class) @Convert(columnType = String.class, converter = StringConverter.class)
private List<String> imgPayerPath; private List<String> imgPayerPath;
@Generated(hash = 1265702630) @Generated(hash = 1265702630)
public OrderInfo(long id, int engineerId, String serverRecord, String doorPrice, public OrderInfo(long id, int engineerId, String serverRecord, String doorPrice,
String serverPrice, String materialCost, String otherPrice, String serverPrice, String materialCost, String otherPrice,
...@@ -184,5 +185,4 @@ public class OrderInfo extends BaseObservable { ...@@ -184,5 +185,4 @@ public class OrderInfo extends BaseObservable {
public void setImgPayerPath(List<String> imgPayerPath) { public void setImgPayerPath(List<String> imgPayerPath) {
this.imgPayerPath = imgPayerPath; this.imgPayerPath = imgPayerPath;
} }
} }
package com.dayu.order.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.dayu.base.ui.activity.DataBindingActivity;
import com.dayu.common.Constants;
import com.dayu.order.R;
import com.dayu.order.api.protocol.OrderDetail;
import com.dayu.order.databinding.ActivityCheckContentBinding;
import com.dayu.order.sqlbean.CheckContentOrder;
import com.dayu.utils.GlideImageLoader;
import com.dayu.utils.ToastUtils;
import com.dayu.utils.UIUtils;
import com.dayu.utils.UtilsScreen;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.List;
/**
* Created by luofan
* on 2018/4/23.
*/
public class CheckContentActivity extends DataBindingActivity<ActivityCheckContentBinding> {
private ArrayList<String> payerUrl;
private ArrayList<String> serverUrl;
private int mdimension;
@Override
public int getLayoutId() {
return R.layout.activity_check_content;
}
@Override
public void initView() {
payerUrl = new ArrayList<>();
serverUrl = new ArrayList<>();
mdimension = (UtilsScreen.getScreenWidth(mActivity) - UtilsScreen.dip2px(mActivity, 20)) / 5;
Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE);
OrderDetail detail = (OrderDetail) bundle.getSerializable(Constants.ORDER_DETAIL);
int position = bundle.getInt(Constants.ORDER_POSTION);
String obj = detail.getRecord().get(position).getOrderObj();
if (obj == null) {
ToastUtils.showShortToast("没有数据");
return;
}
List<OrderDetail.Pics> pics = detail.getPic();
if (pics != null && pics.size() > 0) {
for (OrderDetail.Pics pic : pics) {
if (pic.getPictureType() == 1) {
payerUrl.add(pic.getPictureUrl());
} else {
serverUrl.add(pic.getPictureUrl());
}
}
}
Gson gson = new Gson();
CheckContentOrder info = gson.fromJson(obj, CheckContentOrder.class);
mBind.title.setText("验收内容");
mBind.tvBack.setOnClickListener(v -> finish());
if (!TextUtils.isEmpty(info.getCategoryName())) {
mBind.tvProduct.setText(info.getCategoryName());
} else {
mBind.tvProduct.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getBrandName())) {
mBind.tvBrand.setText(info.getBrandName());
} else {
mBind.tvBrand.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getProductModel())) {
mBind.etVersion.setText(info.getProductModel());
} else {
mBind.etVersion.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getSn())) {
mBind.etSerialNum.setText(info.getSn());
} else {
mBind.etSerialNum.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getCustomerCheckComment())) {
mBind.etServeInfo.setText(info.getCustomerCheckComment());
} else {
mBind.etServeInfo.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getDoorPrice())) {
mBind.etDoorPrice.setText(info.getDoorPrice());
} else {
mBind.etDoorPrice.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getServicePrice())) {
mBind.etServePrice.setText(info.getServicePrice());
} else {
mBind.etServePrice.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getMaterialCost())) {
mBind.etMaterialsPrice.setText(info.getMaterialCost());
} else {
mBind.etMaterialsPrice.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getOtherPrice())) {
mBind.etOtherPrice.setText(info.getOtherPrice());
} else {
mBind.etOtherPrice.setText(mActivity.getString(R.string.no_data));
}
if (!TextUtils.isEmpty(info.getDoorPriceComment())) {
mBind.etDoorInfo.setText(info.getDoorPriceComment());
} else {
mBind.etDoorInfo.setText(mActivity.getString(R.string.no_data));
}
if (TextUtils.isEmpty(info.getDoorPrice()) && TextUtils.isEmpty(info.getDoorPriceComment())
&& TextUtils.isEmpty(info.getMaterialCost()) && TextUtils.isEmpty(info.getOtherPrice())) {
mBind.ivSwitch.setSwitchButton(false);
mBind.rlPay.setVisibility(View.GONE);
} else {
mBind.ivSwitch.setSwitchButton(true);
}
if (1 == info.getRepairType()) {
mBind.tvPayer.setText(UIUtils.getString(R.string.payer_baonei));
} else if (2 == info.getRepairType()) {
mBind.tvPayer.setText(UIUtils.getString(R.string.payer_baowai));
}
if (payerUrl.size() == 0) {
mBind.rlPalyerProve.setVisibility(View.GONE);
} else {
for (String url : payerUrl) {
ImageView iv = new ImageView(mActivity);
iv.setLayoutParams(new ViewGroup.LayoutParams(mdimension, mdimension));
iv.setPadding(0, 0, 10, 0);
iv.setOnClickListener(v->dumpPic(payerUrl));
GlideImageLoader.load(mActivity, url, iv);
mBind.llPlayerImage.addView(iv);
}
}
if (serverUrl.size() == 0) {
mBind.photoView.setVisibility(View.GONE);
} else {
for (String url : serverUrl) {
ImageView iv = new ImageView(mActivity);
iv.setLayoutParams(new ViewGroup.LayoutParams(mdimension, mdimension));
iv.setPadding(0, 0, 10, 0);
iv.setOnClickListener(v->dumpPic(serverUrl));
GlideImageLoader.load(mActivity, url, iv);
mBind.llImage.addView(iv);
}
}
}
private void dumpPic(ArrayList<String> list) {
Intent intent = new Intent(this, PreviewActivty.class);
intent.putStringArrayListExtra(Constants.BUNDLE_KEY_ID, list);
int DELETECODE = 0;
startActivityForResult(intent, DELETECODE);
}
}
...@@ -211,11 +211,11 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac ...@@ -211,11 +211,11 @@ public class ProcessOrderActivity extends BaseActivity<ProcessOrderPresenter, Ac
@Override @Override
public void setFoucesable() { public void setFoucesable() {
mBind.tvBrand.setFocusable(false); mBind.tvBrand.setFocusable(false);
mBind.tvBrand.setFocusable(false);
mBind.etVersion.setFocusable(false); mBind.etVersion.setFocusable(false);
mBind.etSerialNum.setFocusable(false); mBind.etSerialNum.setFocusable(false);
mBind.ivPayer.setVisibility(View.GONE); mBind.ivPayer.setVisibility(View.GONE);
mBind.tvPayer.setClickable(false); mBind.tvPayer.setClickable(false);
mBind.rlPalyerProve.setVisibility(View.GONE);
} }
@Override @Override
......
...@@ -7,7 +7,8 @@ import com.dayu.order.databinding.ItemLogisticsLayoutBinding; ...@@ -7,7 +7,8 @@ import com.dayu.order.databinding.ItemLogisticsLayoutBinding;
import com.dayu.utils.UIUtils; import com.dayu.utils.UIUtils;
/** /**
* Created by luofan on 2018/1/23. * Created by luofan
* on 2018/1/23.
*/ */
public class LogisticsAdapter extends CoreAdapter<LogsticsInfo.Logistics, ItemLogisticsLayoutBinding> { public class LogisticsAdapter extends CoreAdapter<LogsticsInfo.Logistics, ItemLogisticsLayoutBinding> {
......
package com.dayu.order.ui.adapter;
import android.text.TextUtils;
import android.view.View;
import com.dayu.base.ui.adapter.CoreAdapter;
import com.dayu.order.R;
import com.dayu.order.api.protocol.OrderDetail;
import com.dayu.order.databinding.ServeDatailsItemBinding;
import com.dayu.order.presenter.orderserver.OrderServerPresenter;
import com.dayu.utils.ToastUtils;
import com.dayu.utils.UIUtils;
/**
* Created by luofan
* on 2018/4/23.
*/
public class OrderServerAdapter extends CoreAdapter<OrderDetail.RecordBean, ServeDatailsItemBinding> {
public OrderServerAdapter(boolean needFoot) {
super(needFoot);
}
@Override
protected void onBind(ServeDatailsItemBinding holder, OrderDetail.RecordBean item, int position) {
super.onBind(holder, item, position);
OrderServerPresenter presenter = (OrderServerPresenter) mPresenter;
if (position == 0) {
holder.ivCircle.setImageResource(R.drawable.icon_circle_blue);
holder.serverCheck.setBackgroundResource(R.drawable.tab_blue_react);
holder.serverCheck.setTextColor(UIUtils.getColor(R.color.white));
} else {
holder.ivCircle.setImageResource(R.drawable.icon_circle_gray);
holder.serverCheck.setBackground(null);
holder.serverCheck.setPadding(0, 0, 0, 0);
holder.serverCheck.setTextColor(UIUtils.getColor(R.color.cl_receiving_order_item_data));
}
holder.serverState.setText("【" + item.getOperation() + "】");
holder.serverComment.setText(item.getOperationComment());
if ((item.getCommentInfo() != null && item.getCommentInfo().contains("预约时间"))) {
holder.serverTimeComment.setText(item.getCommentInfo());
holder.serverCheck.setVisibility(View.GONE);
} else if ("工单备注".equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText("备注:暂无");
} else {
holder.serverTimeComment.setText("备注:" + item.getCommentInfo());
}
holder.serverCheck.setText("查看初始状态");
} else if ("改派原因".equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText("改派原因:暂无");
} else {
holder.serverTimeComment.setText("改派原因:"+item.getCommentInfo());
}
holder.serverCheck.setVisibility(View.GONE);
} else if ("取消原因".equals(item.getCommentName())) {
if (TextUtils.isEmpty(item.getCommentInfo())) {
holder.serverTimeComment.setText("取消原因:暂无");
} else {
holder.serverTimeComment.setText("取消原因:"+item.getCommentInfo());
}
} else {
holder.serverTimeComment.setVisibility(View.GONE);
if (TextUtils.isEmpty(item.getCommentName())) {
holder.serverCheck.setVisibility(View.GONE);
} else {
holder.serverCheck.setText(item.getCommentName());
}
}
if ("查看结果".equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpToSop());
}
if ("查看验收申请".equals(item.getCommentName()) || "工单备注".equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> presenter.dumpCheckContent(position));
}
if ("查看位置".equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> ToastUtils.showShortToast("longtitude" + item.getLongitude() + "latitude" + item.getLatitude()));
}
if ("查看结果".equals(item.getCommentName())) {
holder.serverCheck.setOnClickListener(v -> ToastUtils.showShortToast("查看结果"));
}
}
}
...@@ -2,22 +2,22 @@ package com.dayu.order.ui.fragment; ...@@ -2,22 +2,22 @@ package com.dayu.order.ui.fragment;
import android.os.Bundle; import android.os.Bundle;
import com.dayu.base.ui.fragment.DataBindingFragment; 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.databinding.FragmentOrderServeBinding; import com.dayu.order.databinding.FragmentOrderServeBinding;
import com.dayu.utils.UtilsDate; import com.dayu.order.presenter.orderserver.OrderServerContract;
import com.dayu.order.presenter.orderserver.OrderServerPresenter;
import com.dayu.order.ui.adapter.OrderServerAdapter;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import java.text.ParseException;
/** /**
* 服务记录的Fragment * 服务记录的Fragment
* on 2017/9/13. * on 2017/9/13.
*/ */
public class OrderDetailsServeFragment extends DataBindingFragment<FragmentOrderServeBinding> { public class OrderDetailsServeFragment extends BaseFragment<OrderServerPresenter, FragmentOrderServeBinding> implements OrderServerContract.View{
private static final String TAG = "OrderDetailsServeFragme"; private static final String TAG = "OrderDetailsServeFragme";
public static OrderDetailsServeFragment newInstance(OrderDetail detail) { public static OrderDetailsServeFragment newInstance(OrderDetail detail) {
...@@ -29,24 +29,19 @@ public class OrderDetailsServeFragment extends DataBindingFragment<FragmentOrder ...@@ -29,24 +29,19 @@ public class OrderDetailsServeFragment extends DataBindingFragment<FragmentOrder
} }
@Override @Override
public void setPresenter() {
mBind.setPresenter(mPresenter);
}
@Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_order_serve; return R.layout.fragment_order_serve;
} }
@Override @Override
public void initView() { public void initView() {
OrderDetail details = (OrderDetail) getArguments().getSerializable(Constants.ORDER_DETAIL); OrderServerAdapter adapter = new OrderServerAdapter(false);
if (details == null) { mBind.recyclerView.setAdapter(adapter);
return;
}
for (OrderDetail.RecordBean item : details.getRecord()) {
try {
item.setCreateTime(UtilsDate.changeFormat(item.getCreateTime(), UtilsDate.FORMAT_ONE, UtilsDate.FORMAT_FOURTH));
} catch (ParseException e) {
e.printStackTrace();
}
}
mBind.recyclerView.setData(details.getRecord());
} }
@Override @Override
......
...@@ -55,5 +55,8 @@ ...@@ -55,5 +55,8 @@
<activity <activity
android:name=".ui.activity.PdfWebViewActivity" android:name=".ui.activity.PdfWebViewActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.CheckContentActivity"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>
...@@ -2,13 +2,37 @@ ...@@ -2,13 +2,37 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="presenter"
type="com.dayu.order.presenter.orderserver.OrderServerPresenter" />
<import type="android.view.View" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.dayu.widgets.DottdeLineView
android:id="@+id/dl_line"
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginLeft="24dp"
android:layerType="software"
android:visibility="@{presenter.isShowLine?View.VISIBLE:View.GONE}" />
<com.dayu.widgets.LRecyclerView <com.dayu.widgets.LRecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
setPresenter="@{presenter}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/cl_home_listview_bg" android:background="@color/transparent"
app:isRefreshable="false" app:isRefreshable="false"
app:itemType="@layout/serve_datails_item" app:itemType="@layout/serve_datails_item"
app:needCoreAdapter="true" android:layout_marginBottom="@dimen/dp_10"
app:needFoot="false" /> />
</RelativeLayout>
</layout> </layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<data> <data>
...@@ -9,37 +9,89 @@ ...@@ -9,37 +9,89 @@
</data> </data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_54" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13.3" android:layout_marginLeft="17dp"
android:layout_marginRight="@dimen/dp_13.3" android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:background="@drawable/item_shape"
android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView
android:id="@+id/iv_circle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:src="@drawable/icon_circle_blue" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView <TextView
android:id="@+id/tv_time" android:id="@+id/server_state"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1" android:layout_weight="1"
android:text="@{item.createTime}" android:layout_height="wrap_content"
android:textColor="@color/cl_order_text_title" android:textSize="@dimen/sp_14"
android:textSize="@dimen/sp_13.3" /> android:textColor="@color/default_text_color"
android:layout_marginLeft="@dimen/dp_12"
android:text="【系统验收】"
/>
<TextView <TextView
android:id="@+id/item_text" android:id="@+id/server_time"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:textSize="@dimen/sp_12"
android:layout_marginRight="5dp" android:textColor="@color/default_text_color"
android:layout_weight="1" android:text="2017-08-04 14:47"
android:ellipsize="end" android:layout_marginRight="@dimen/dp_10"
android:maxLines="2" />
android:text="@{item.operationComment}"
android:textColor="@color/cl_tab_init"
android:textSize="@dimen/sp_10" />
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/server_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:text="系统进行了验收费"
android:textColor="@color/default_text_color"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_20"
android:textSize="12sp" />
<TextView
android:id="@+id/server_time_comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="预约时间:2017-12-11 18:30:00"
android:textColor="@color/default_text_color"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_10"
android:textSize="12sp"
/>
<TextView
android:id="@+id/server_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_12"
android:layout_marginLeft="@dimen/dp_20"
android:textColor="@color/default_text_color"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingRight="6dp"
android:paddingLeft="6dp"
/>
</LinearLayout>
</LinearLayout>
</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