Commit 54b07d31 by 罗翻

增加客户验收二维码页面

parent 5db0dd03
Showing with 349 additions and 66 deletions
......@@ -72,7 +72,6 @@
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
......@@ -151,7 +150,7 @@
android:name=".ui.AboutUsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.FeedBackActivity"
android:name=".ui.CommonSubmiteActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.AccountBalanceActivity"
......@@ -196,6 +195,9 @@
<activity
android:name=".ui.LogisticsInfoActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.QrCodeActivity"
android:screenOrientation="portrait" />
<service android:name=".api.DownloadService" />
......
......@@ -3,7 +3,8 @@ package com.dayu.bigfish;
import com.dayu.bigfish.utils.LogUtils;
/**
* Created by MrWang on 2017/8/20.
* Created by MrWang
* on 2017/8/20.
*/
public class Constants {
......@@ -23,8 +24,9 @@ public class Constants {
public static final int DEBUGLEVEL = LogUtils.LEVEL_ALL;
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_SOP = "http://192.168.1.135:8080/#/detail?id=9";
public final static String WEB_ZHI_SHI = "http://47.94.101.239:9004/#/detail";
// public final static String WEB_ZHI_SHI = "http://192.168.1.135:8080/#/detail";
public static final boolean UM_DEBUG = true;
// public final static String WEB_SOP = "http://192.168.1.132:8080/#/sop";
......
package com.dayu.bigfish.api;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
......@@ -15,8 +16,6 @@ import java.io.IOException;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.ObservableSource;
import io.reactivex.ObservableTransformer;
import io.reactivex.android.schedulers.AndroidSchedulers;
......@@ -82,7 +81,7 @@ public class Api {
.writeTimeout(600, TimeUnit.SECONDS)
.addNetworkInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
public Response intercept(@NonNull Chain chain) throws IOException {
Response response = chain.proceed(chain.request());
return response
.newBuilder()
......@@ -111,9 +110,7 @@ public class Api {
* @return
*/
public static <T> Observable<T> flatResponse(final BaseResponse<T> response) {
return Observable.create(new ObservableOnSubscribe<T>() {
@Override
public void subscribe(ObservableEmitter<T> e) {
return Observable.create(e -> {
if (response.isSuccess()) {
if (!e.isDisposed()) {
e.onNext(response.getData());
......@@ -127,7 +124,6 @@ public class Api {
if (!e.isDisposed()) {
e.onComplete();
}
}
});
}
......@@ -139,7 +135,6 @@ public class Api {
@Override
public Response intercept(Chain chain) throws IOException {
//TODO token可能会有错.
Request request = chain.request();
UserInfo userInfo = UserManager.getInstance().getUser();
if (userInfo != null) {
......
......@@ -45,6 +45,9 @@ public class ServerException extends Exception {
case "ORDER0006":
message = MyApplication.getContext().getString(R.string.order_cancle_not_process);
break;
case "LOGISTICS0001":
message = MyApplication.getContext().getString(R.string.query_logistics_failed);
break;
/** 用户相关错误*/
case "USER0002":
......
package com.dayu.bigfish.bean;
/**
* Created by luofan on 2018/1/19.
* Created by luofan
* on 2018/1/19.
*/
public class ServerInstruction {
private String title;
private String url;
private Integer id;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUrl() {
return url;
......
package com.dayu.bigfish.presenter.feedback;
package com.dayu.bigfish.presenter.commonSubmite;
import com.dayu.bigfish.base.BasePresenter;
......@@ -6,9 +6,10 @@ import com.dayu.bigfish.base.BaseView;
/**
* Created by luo on 2016/8/4.
* Created by luo
* on 2016/8/4.
*/
public interface FeedBackContract {
public interface CommonSubmiteContract {
interface View extends BaseView {
}
......
package com.dayu.bigfish.presenter.feedback;
package com.dayu.bigfish.presenter.commonSubmite;
import android.databinding.ObservableField;
import android.os.Bundle;
......@@ -24,10 +24,11 @@ import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
* Created by luofan on 2017/11/8.
* Created by luofan
* on 2017/11/8.
*/
@InstanceFactory
public class FeedBackPresenter extends FeedBackContract.Presenter {
public class CommonSubmitePresenter extends CommonSubmiteContract.Presenter {
private String mUserName;
private String mUserMobile;
public ObservableField<String> mComment = new ObservableField<>();
......
......@@ -6,7 +6,8 @@ import com.dayu.bigfish.base.BaseView;
import com.dayu.bigfish.bean.OrderDetail;
/**
* Created by luo on 2016/8/4.
* Created by luo
* on 2016/8/4.
*/
public interface OrderDetailContract {
......@@ -23,6 +24,10 @@ public interface OrderDetailContract {
}
abstract class Presenter extends BasePresenter<View> {
/**
*
* @param orderId 工单id.
*/
public abstract void getOrderDetailInfo(int orderId);
public abstract int getOrderId();
......
......@@ -8,7 +8,8 @@ import com.dayu.bigfish.bean.OrderPart;
import io.reactivex.Observable;
/**
* Created by luo on 2016/8/4.
* Created by luo
* on 2016/8/4.
*/
public interface OrderPartContract {
......@@ -24,6 +25,7 @@ public interface OrderPartContract {
public abstract void applyOrReturnPart();
/**
* @param partId 备件id.
* 跳转到拒绝申请页面.
*/
public abstract void dumpToRefusePart(int partId);
......@@ -34,16 +36,20 @@ public interface OrderPartContract {
public abstract void dumpToReturnPart(int type, OrderPart part);
/**
* @param courierNum 快递单号.
* @param shipperCode 物流公司编号.
* 查询物流信息.
*/
public abstract void queryLogistics(String courierNum, String shipperCode);
/**
* @param partId 备件id.
* 取消申请.
*/
public abstract Observable<Boolean> cancleApply(int partId);
public abstract Observable cancleApply(int partId);
/**
* @param partId 备件id.
* 收到备件.
*/
public abstract Observable receivePart(int partId);
......
......@@ -6,14 +6,16 @@ import android.os.Bundle;
import com.app.annotation.apt.InstanceFactory;
import com.apt.ApiFactory;
import com.dayu.bigfish.Constants;
import com.dayu.bigfish.MyApplication;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.OrderDetail;
import com.dayu.bigfish.bean.OrderPart;
import com.dayu.bigfish.ui.FeedBackActivity;
import com.dayu.bigfish.ui.CommonSubmiteActivity;
import com.dayu.bigfish.ui.LogisticsInfoActivity;
import com.dayu.bigfish.ui.ReturnPartActivity;
import com.dayu.bigfish.utils.UIUtils;
import com.dayu.bigfish.utils.managers.UserManager;
import com.umeng.analytics.MobclickAgent;
import java.util.List;
......@@ -21,11 +23,12 @@ import io.reactivex.Observable;
import io.reactivex.functions.Consumer;
/**
* Created by luofan on 2017/11/8.
* Created by luofan
* on 2017/11/8.
*/
@InstanceFactory
public class OrderPartPresenter extends OrderPartContract.Presenter {
public ObservableField datas = new ObservableField();
private ObservableField<Object> datas = new ObservableField<>();
public ObservableField<String> title = new ObservableField<>(UIUtils.getString(R.string.apply_one_order_part));
private int mOrderId;
private String mUserName;
......@@ -59,9 +62,9 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
@Override
public void queryPartList() {
ApiFactory.queryPart(mOrderId, mType).subscribe(baseObserver((Consumer<List<OrderPart>>) orderPart -> {
datas.set(orderPart);
}, responeThrowable -> datas.set(Constants.FAILED)));
ApiFactory.queryPart(mOrderId, mType).subscribe(baseObserver(
(Consumer<List<OrderPart>>) orderPart -> datas.set(orderPart)
, responeThrowable -> datas.set(Constants.FAILED)));
}
@Override
......@@ -70,7 +73,8 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
Bundle bundle = new Bundle();
bundle.putInt(Constants.ORDER_ID, mOrderId);
bundle.putInt(Constants.TYPE, Constants.APPLY_PART);
mView.startActivity(FeedBackActivity.class, bundle);
mView.startActivity(CommonSubmiteActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"applyApply");
} else if (mType == 2) {
dumpToReturnPart(Constants.BYMYSELF, null);
}
......@@ -82,7 +86,8 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
bundle.putInt(Constants.ORDER_ID, mOrderId);
bundle.putInt(Constants.PART_ID, partId);
bundle.putInt(Constants.TYPE, Constants.REFUSE_PART);
mView.startActivity(FeedBackActivity.class, bundle);
mView.startActivity(CommonSubmiteActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"refuseApply");
}
@Override
......@@ -97,6 +102,7 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
}
bundle.putInt(Constants.TYPE, type);
mView.startActivity(ReturnPartActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"returnApply");
}
@Override
......@@ -105,16 +111,19 @@ public class OrderPartPresenter extends OrderPartContract.Presenter {
bundle.putString(Constants.COURIER_NUM, courierNum);
bundle.putString(Constants.SHIPPER_CODE, shipperCode);
mView.startActivity(LogisticsInfoActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(),"queryLogistics");
}
public Observable<Boolean> cancleApply(int partId) {
mView.showDialog();
MobclickAgent.onEvent(MyApplication.getContext(),"cancleApply");
return ApiFactory.cancleApply(partId, mUserName);
}
@Override
public Observable receivePart(int partId) {
mView.showDialog();
MobclickAgent.onEvent(MyApplication.getContext(),"receiveApply");
return ApiFactory.receivePart(partId, mUserName);
}
}
......@@ -72,6 +72,7 @@ public class ReturnPartPresenter extends ReturnPartContract.Presenter {
jsonObject.put("courierServicesCompany", courierCompany.get());
jsonObject.put("shipperCode", mShipperCode);
jsonObject.put("kaRemarks", kaComent.get());
jsonObject.put("spOrderId", mOrderId);
jsonObject.put("operater", mInfo.getAccountName());
jsonObject.put("operaterId", mInfo.getAccountId());
if (mType == Constants.BY_MODIFY_PART) {
......@@ -79,7 +80,6 @@ public class ReturnPartPresenter extends ReturnPartContract.Presenter {
} else {
jsonObject.put("partsId", mPartId);
}
jsonObject.put("spOrderId", mOrderId);
} catch (JSONException e) {
e.printStackTrace();
}
......
......@@ -5,7 +5,8 @@ import com.dayu.bigfish.base.BaseListPresenter;
import com.dayu.bigfish.base.BaseView;
/**
* Created by luo on 2016/8/4.
* Created by luo
* on 2016/8/4.
*/
public interface ServerInstructionContract {
......@@ -19,6 +20,9 @@ public interface ServerInstructionContract {
*/
public abstract void getInstructs();
public abstract void dumpDetail(String url);
/**
* @param id 服务说明id.
*/
public abstract void dumpDetail(int id);
}
}
......@@ -10,14 +10,13 @@ import com.dayu.bigfish.base.BasePageBean;
import com.dayu.bigfish.bean.ServerInstruction;
import com.dayu.bigfish.ui.WebViewActivity;
import io.reactivex.functions.Consumer;
/**
* Created by luofan on 2017/11/8.
* Created by luofan
* on 2017/11/8.
*/
@InstanceFactory
public class ServerInstructionPresenter extends ServerInstructionContract.Presenter {
public ObservableField mDatas = new ObservableField();
public ObservableField<Object> mDatas = new ObservableField<>();
private int mSpuId;
private int mPage;
......@@ -35,17 +34,16 @@ public class ServerInstructionPresenter extends ServerInstructionContract.Presen
@Override
public void getInstructs() {
ApiFactory.getInstruction(mSpuId, mPage, Constants.PAGESIZE).subscribe(baseObserver((Consumer<BasePageBean<ServerInstruction>>)
datas -> {
ApiFactory.getInstruction(mSpuId, mPage, Constants.PAGESIZE).subscribe(baseObserver((BasePageBean<ServerInstruction> datas) -> {
mPage++;
mDatas.set(datas);
}));
}
@Override
public void dumpDetail(String url) {
public void dumpDetail(int id) {
Bundle bundle = new Bundle();
bundle.putInt(Constants.ID, mSpuId);
bundle.putInt(Constants.ID, id);
mView.startActivity(WebViewActivity.class, bundle);
}
......
......@@ -14,7 +14,7 @@ import com.dayu.bigfish.MyApplication;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.UserInfo;
import com.dayu.bigfish.ui.AboutUsActivity;
import com.dayu.bigfish.ui.FeedBackActivity;
import com.dayu.bigfish.ui.CommonSubmiteActivity;
import com.dayu.bigfish.ui.LoginActivity;
import com.dayu.bigfish.utils.AppUtils;
import com.dayu.bigfish.utils.DataCleanManager;
......@@ -141,7 +141,7 @@ public class SettingPresenter extends SettingContract.Presenter {
public void dumpToFeed() {
Bundle bundle = new Bundle();
bundle.putInt(Constants.TYPE, Constants.FEED_BACK);
mView.startActivity(FeedBackActivity.class, bundle);
mView.startActivity(CommonSubmiteActivity.class, bundle);
MobclickAgent.onEvent(MyApplication.getContext(), "feed_back");
}
......
......@@ -6,7 +6,8 @@ import com.dayu.bigfish.base.BasePresenter;
import com.dayu.bigfish.base.BaseView;
/**
* Created by luo on 2016/8/4.
* Created by luo
* on 2016/8/4.
*/
public interface SubcribeContract {
......@@ -19,6 +20,12 @@ public interface SubcribeContract {
}
abstract class Presenter extends BasePresenter<View> {
/**
*
* @param orderId 订单id.
* @param doorTime 上门时间.
* @param doorComment 备注.
*/
public abstract void subcribeTime(int orderId, String doorTime, String doorComment);
......
......@@ -3,17 +3,16 @@ package com.dayu.bigfish.ui;
import com.dayu.bigfish.R;
import com.dayu.bigfish.base.BaseActivity;
import com.dayu.bigfish.databinding.ActivityFeedbackBinding;
import com.dayu.bigfish.presenter.feedback.FeedBackContract;
import com.dayu.bigfish.presenter.feedback.FeedBackPresenter;
import com.dayu.bigfish.presenter.commonSubmite.CommonSubmiteContract;
import com.dayu.bigfish.presenter.commonSubmite.CommonSubmitePresenter;
/**
* 设置页面 --反馈提交
* on 2017/9/26.
* Created by yu
* Created by luofan
* on 2017/11/8.
*/
public class FeedBackActivity extends BaseActivity<FeedBackPresenter, ActivityFeedbackBinding>
implements FeedBackContract.View {
public class CommonSubmiteActivity extends BaseActivity<CommonSubmitePresenter, ActivityFeedbackBinding>
implements CommonSubmiteContract.View {
@Override
public int getLayoutId() {
......
......@@ -45,7 +45,8 @@ import org.greenrobot.eventbus.ThreadMode;
import java.io.File;
/**
* Created by luofan on 2017/11/20.
* Created by luofan
* on 2017/11/20.
*/
public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBinding> implements MainContract.View {
......
......@@ -19,7 +19,7 @@ import com.umeng.analytics.MobclickAgent;
import java.util.ArrayList;
/**
* 工单详情信息页面,包含工单详情和服务记录
* 工单详情信息页面,包含工单详情、服务记录、备件信息.
* on 2017/9/13.
*/
......
package com.dayu.bigfish.ui;
import com.dayu.bigfish.R;
import com.dayu.bigfish.base.DataBindingActivity;
import com.dayu.bigfish.databinding.QrCodeLayoutBinding;
/**
* Created by luofan
* on 2018/1/31.
*/
public class QrCodeActivity extends DataBindingActivity<QrCodeLayoutBinding> {
@Override
public int getLayoutId() {
return R.layout.qr_code_layout;
}
@Override
public void initView() {
mBind.titleBack.setOnClickListener(v -> finish());
}
}
......@@ -18,6 +18,7 @@ import com.dayu.bigfish.base.DataBindingActivity;
import com.dayu.bigfish.bean.UserInfo;
import com.dayu.bigfish.bean.event.OrderState;
import com.dayu.bigfish.databinding.ActivityWebviewBinding;
import com.dayu.bigfish.utils.ProgressUtil;
import com.dayu.bigfish.utils.ToastUtils;
import com.dayu.bigfish.utils.managers.UserManager;
import com.github.lzyzsd.jsbridge.BridgeHandler;
......@@ -125,10 +126,13 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100) {
ProgressUtil.stopLoad();
}
}
});
mWebView.loadUrl(Constants.WEB_SOP);
ProgressUtil.startLoad(mActivity);
mWebView.loadUrl(Constants.WEB_ZHI_SHI + "?id=9");
JSONObject jsonObject = new JSONObject();
try {
......
package com.dayu.bigfish.ui;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.LinearLayout;
import com.dayu.bigfish.Constants;
import com.dayu.bigfish.R;
import com.dayu.bigfish.base.DataBindingActivity;
import com.dayu.bigfish.bean.UserInfo;
import com.dayu.bigfish.databinding.ActivityWebviewBinding;
import com.dayu.bigfish.utils.ProgressUtil;
import com.dayu.bigfish.utils.managers.UserManager;
import com.github.lzyzsd.jsbridge.BridgeHandler;
import com.github.lzyzsd.jsbridge.BridgeWebView;
import com.github.lzyzsd.jsbridge.CallBackFunction;
import java.io.File;
/**
* Created by luofan on 2018/1/19.
* Created by luofan
* on 2017/11/27.
*/
public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding> {
private String mToken;
ValueCallback<Uri> mUploadMessage;
ValueCallback<Uri[]> uploadMessageAboveL;
int RESULT_CODE = 0;
int RESULT_CODE_FOR_Lollipop = 1;
private BridgeWebView mWebView;
private int mId;
private String mUrl;
private int mOrderId;
@Override
public int getLayoutId() {
......@@ -34,8 +49,8 @@ public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding>
@Override
public void initView() {
Bundle bundle = getIntent().getBundleExtra(Constants.BUNDLE);
mOrderId = bundle.getInt(Constants.ID);
mUrl = Constants.WEB_ZHI_SHI + "?id=" + mOrderId;
mId = bundle.getInt(Constants.ID);
mUrl = Constants.WEB_ZHI_SHI + "?id=" + mId;
mBind.tvTitle.setText(getResources().getString(R.string.order_instruction));
mBind.tvRightTitle.setText(getResources().getString(R.string.open_webview));
mBind.tvRightTitle.setVisibility(View.VISIBLE);
......@@ -47,6 +62,8 @@ public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding>
intent.setData(content_url);
startActivity(Intent.createChooser(intent, getResources().getString(R.string.select_webview)));
});
UserInfo userInfo = UserManager.getInstance().getUser();
mToken = userInfo.getToken();
mWebView = new BridgeWebView(mActivity);
mWebView.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
......@@ -54,6 +71,7 @@ public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding>
initWebView();
}
@SuppressLint("SetJavaScriptEnabled")
private void initWebView() {
WebSettings settings = mWebView.getSettings();
// >= 19(SDK4.4)启动硬件加速,否则启动软件加速
......@@ -73,7 +91,7 @@ public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding>
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setAppCachePath(getFilesDir().getAbsolutePath() + "/Android/data/com.dayu.bigfish/cache");
// settings.setJavaScriptEnabled(true); //启用支持javascript
settings.setJavaScriptEnabled(true); //启用支持javascript
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setSupportZoom(true);//设定支持缩放
......@@ -88,10 +106,109 @@ public class WebViewActivity extends DataBindingActivity<ActivityWebviewBinding>
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); // 取消WebView中滚动或拖动到顶部、底部时的阴影
mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); // 取消滚动条白边效果
mWebView.requestFocus();
mWebView.setDefaultHandler(new MyHandler());
mWebView.loadUrl(mUrl);
mWebView.setWebChromeClient(new WebChromeClient() {
public void openFileChooser(ValueCallback<Uri> uploadMsg, String AcceptType, String capture) {
this.openFileChooser(uploadMsg);
}
public void openFileChooser(ValueCallback<Uri> uploadMsg, String AcceptType) {
this.openFileChooser(uploadMsg);
}
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
openFileChooserImpl(uploadMsg);
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> uploadMsg, FileChooserParams fileChooserParams) {
openFileChooserImplForAndroid5(uploadMsg);
return true;
}
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100) {
ProgressUtil.stopLoad();
}
}
});
ProgressUtil.startLoad(mActivity);
mWebView.loadUrl(Constants.WEB_ZHI_SHI + "?id=" + mId);
}
private void openFileChooserImpl(ValueCallback<Uri> uploadMsg) {
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
startActivityForResult(Intent.createChooser(i, getString(R.string.choose_file)), RESULT_CODE);
}
/*android 5.0*/
private void openFileChooserImplForAndroid5(ValueCallback<Uri[]> uploadMsg) {
uploadMessageAboveL = uploadMsg;
Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT);
contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE);
contentSelectionIntent.setType("image/*");
Intent chooserIntent = new Intent(Intent.ACTION_CHOOSER);
chooserIntent.putExtra(Intent.EXTRA_INTENT, contentSelectionIntent);
chooserIntent.putExtra(Intent.EXTRA_TITLE, getString(R.string.choose_pic));
startActivityForResult(chooserIntent, RESULT_CODE_FOR_Lollipop);
}
/**
* 上传文件回调
*/
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == RESULT_CODE) {
onActivityResultBelowL(intent, resultCode);
} else if (requestCode == RESULT_CODE_FOR_Lollipop) {
onActivityResultAboveL(intent, resultCode);
}
}
/**
* 5.0 L 以下 上传图片成功后的回调
*/
public void onActivityResultBelowL(Intent intent, int resultCode) {
if (null == mUploadMessage)
return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
}
/**
* 5.0 L以上 上传图片成功后的回调
*/
public void onActivityResultAboveL(Intent intent, int resultCode) {
if (null == uploadMessageAboveL)
return;
Uri result = (intent == null || resultCode != RESULT_OK) ? null : intent.getData();
if (result != null) {
uploadMessageAboveL.onReceiveValue(new Uri[]{result});
} else {
uploadMessageAboveL.onReceiveValue(new Uri[]{});
}
uploadMessageAboveL = null;
}
private class MyHandler implements BridgeHandler {
@Override
public void handler(String data, CallBackFunction function) {
if (function != null) {
function.onCallBack("DefaultHandler response data");
}
}
}
//返回
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
......
......@@ -11,6 +11,7 @@ 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;
import com.umeng.analytics.MobclickAgent;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
......@@ -55,4 +56,20 @@ public class ApplicationOrderPartFragment extends BaseFragment<OrderPartPresente
public void RefreshApplyPart(RefreshApplyPart event) {
mPresenter.queryPartList();
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
String tag;
if (getArguments().getInt(Constants.TYPE) == 1) {
tag = "ApplyPartFragment";
} else {
tag = "ReturnPartFragment";
}
if (getUserVisibleHint()) {
MobclickAgent.onPageEnd(tag);
} else {
MobclickAgent.onPageStart(tag);
}
}
}
package com.dayu.bigfish.ui.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
......@@ -10,6 +11,7 @@ import com.dayu.bigfish.base.CoreAdapter;
import com.dayu.bigfish.base.DataBindingFragment;
import com.dayu.bigfish.bean.OrderDetail;
import com.dayu.bigfish.databinding.FragmentOrderDatailsBinding;
import com.dayu.bigfish.ui.QrCodeActivity;
import com.dayu.bigfish.utils.UIUtils;
import com.umeng.analytics.MobclickAgent;
......@@ -50,6 +52,15 @@ public class OrderDetaillsFragment extends DataBindingFragment<FragmentOrderData
public void initDataView(OrderDetail dataBean) {
mBind.tvOrderState.setText(getStaus(dataBean.getStatus()));
mBind.tvLookMore.setOnClickListener(o -> lookMore());
if (dataBean.getStatus() == 4 && dataBean.getSubStatus() == 6) {
mBind.customerAcceptance.setVisibility(View.VISIBLE);
} else {
mBind.customerAcceptance.setVisibility(View.GONE);
}
mBind.customerAcceptance.setOnClickListener(v -> {
startActivity(new Intent(mActivity, QrCodeActivity.class));
MobclickAgent.onEvent(mActivity, "customer_apponitment");
});
mBind.tvOrderRmark.post(() -> {
if (UIUtils.isOverFlowed(mBind.tvOrderRmark)) {
mBind.tvLookMore.setVisibility(View.VISIBLE);
......
......@@ -3,11 +3,10 @@
<data>
<import type="com.dayu.bigfish.presenter.feedback.FeedBackPresenter" />
<variable
name="presenter"
type="FeedBackPresenter" />
type="com.dayu.bigfish.presenter.commonSubmite.CommonSubmitePresenter" />
</data>
<LinearLayout
......@@ -28,7 +27,8 @@
<ImageView
android:id="@+id/title_back"
style="@style/title_image_back"
android:onClick="@{()->presenter.dumpBack()}" />
android:onClick="@{()->presenter.dumpBack()}"
/>
<TextView
android:id="@+id/tv_right_title"
......
......@@ -12,9 +12,15 @@
type="com.dayu.bigfish.bean.OrderDetail" />
</data>
<ScrollView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scrollbars="none">
<RelativeLayout
......@@ -684,4 +690,15 @@
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<TextView
android:id="@+id/customer_acceptance"
android:layout_width="match_parent"
android:layout_height="49dp"
android:background="@color/cl_home_button"
android:gravity="center"
android:text="@string/customer_acceptance"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:onClick="@{()->presenter.dumpDetail(item.url)}"
android:onClick="@{()->presenter.dumpDetail(item.id)}"
android:orientation="horizontal">
<TextView
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/title_back"
style="@style/title">
<TextView
android:id="@+id/tv_title"
style="@style/text_title"
android:text="@string/customer_acceptance" />
<ImageView
android:id="@+id/receiving_back"
style="@style/title_image_back" />
</RelativeLayout>
<ImageView style="@style/card_line" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/icon_appointment_code" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_15"
android:text="@string/scan_code_for_appointment"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -256,6 +256,8 @@
<string name="part">备件</string>
<string name="send_already">已发货</string>
<string name="modify_part_info">修改信息</string>
<string name="customer_acceptance">客户验收</string>
<string name="scan_code_for_appointment">请扫描二维码验收</string>
<!--消息-->
......@@ -365,6 +367,7 @@
<string name="order_cancle_not_subcribe">工单已取消,无法预约时间</string>
<string name="order_cancle_not_begin">工单已取消,不能上门了</string>
<string name="order_cancle_not_process">工单已取消,不能处理了</string>
<string name="query_logistics_failed">查询物流信息失败</string>
<string name="order_receive_already">已被接单,请选择其他工单</string>
<string name="perameter_is_null">参数为空</string>
<string name="identity_is_error">身份证号不合法</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