| | |
| | | |
| | | Const.SOCKET_METHOD.REASSIGN_CONFIRM_REQUEST -> { |
| | | val info = Gson().fromJson(data, ReassignConfirmInfo::class.java) |
| | | if (reassignIds != info.reassignIds) { |
| | | reassignIds = info.reassignIds |
| | | if (reassignIds != info.reassignIds&&!info.reassignIds.isNullOrEmpty()) { |
| | | reassignIds = info.reassignIds!! |
| | | val act = activities[activities.size - 1] |
| | | act?.startActivity( |
| | | CityOrderReassignConfirmActivity.getIntent( |
| | |
| | | import androidx.fragment.app.FragmentActivity; |
| | | import androidx.fragment.app.FragmentTransaction; |
| | | |
| | | |
| | | import com.fangxinxing.xxfxx.R; |
| | | import com.fangxinxing.xxfxx.ui.DialogUtil; |
| | | import com.fangxinxing.xxfxx.utils.EasePopup.EasyPopup; |
| | |
| | | @Override |
| | | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | // View view = inflater.inflate(layoutId(),container,false); |
| | | View view = LayoutInflater.from(getActivity()).inflate(layoutId(),container,false); |
| | | View view = LayoutInflater.from(getActivity()).inflate(layoutId(), container, false); |
| | | mContext = getActivity(); |
| | | EventBus.getDefault().register(this); |
| | | return view; |
| | |
| | | public abstract void initView(); |
| | | |
| | | |
| | | public void startActivity(Class tClass){ |
| | | startActivity(new Intent(mContext,tClass)); |
| | | public void startActivity(Class tClass) { |
| | | startActivity(new Intent(mContext, tClass)); |
| | | } |
| | | |
| | | @Override |
| | | public void showDialog() { |
| | | // super.showDialog(); |
| | | if (easyPopup == null){ |
| | | if (easyPopup == null) { |
| | | easyPopup = DialogUtil.INSTANCE.getPopupwindow(getActivity(), R.layout.progress_dialog_main); |
| | | } |
| | | if (easyPopup.isShowing()){ |
| | | if (easyPopup.isShowing()) { |
| | | return; |
| | | } |
| | | FragmentActivity activity = getActivity(); |
| | | if (activity != null && activity.getWindow() != null) { |
| | | if (activity != null && !activity.isFinishing() && !activity.isDestroyed() && activity.getWindow() != null) { |
| | | try { |
| | | getActivity().getWindow().getDecorView().post(() -> easyPopup.showCenter(getActivity().getWindow().getDecorView())); |
| | | }catch (Exception e){ |
| | | |
| | | getActivity().getWindow().getDecorView().post(() -> { |
| | | FragmentActivity activity1 = getActivity(); |
| | | if (activity1 != null && !activity1.isFinishing() && !activity1.isDestroyed() && activity1.getWindow() != null) { |
| | | easyPopup.showCenter(getActivity().getWindow().getDecorView()); |
| | | } |
| | | }); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void onPause() { |
| | | super.onPause(); |
| | | if (easyPopup != null && easyPopup.isShowing()){ |
| | | if (easyPopup != null && easyPopup.isShowing()) { |
| | | easyPopup.dismiss(); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public void dismissDialog() { |
| | | // super.dismissDialog();? |
| | | if (easyPopup == null){ |
| | | easyPopup = DialogUtil.INSTANCE.getPopupwindow(getActivity(),R.layout.progress_dialog_main); |
| | | if (easyPopup != null && easyPopup.isShowing()) { |
| | | easyPopup.dismiss(); |
| | | } |
| | | easyPopup.dismiss(); |
| | | } |
| | | |
| | | @Override |
| | | public void onDestroyView() { |
| | | dismissDialog(); |
| | | super.onDestroyView(); |
| | | EventBus.getDefault().unregister(this); |
| | | } |
| | |
| | | //改派确认信息 |
| | | @Parcelize |
| | | data class ReassignConfirmInfo( |
| | | var reassignIds: String,//逗号分隔的改派记录ID |
| | | var orderIds: String,//订单ID值,逗号分隔 |
| | | var startSite: String,//起始站点 |
| | | var endSite: String,//结束站点 |
| | | var routeInfo: String,//起始站点 → 结束站点 |
| | | var totalPeopleNumber: String,//总人数 |
| | | var travelTime: String,//开始时间 |
| | | var expireTime: String,//过期时间 |
| | | var reassignIds: String?=null,//逗号分隔的改派记录ID |
| | | var orderIds: String?=null,//订单ID值,逗号分隔 |
| | | var startSite: String?=null,//起始站点 |
| | | var endSite: String?=null,//结束站点 |
| | | var routeInfo: String?=null,//起始站点 → 结束站点 |
| | | var totalPeopleNumber: String?=null,//总人数 |
| | | var travelTime: String?=null,//开始时间 |
| | | var expireTime: String?=null,//过期时间 |
| | | ) : Parcelable |
| | |
| | | HttpManager.getInstance() |
| | | .post(api, map, object : MyObserver(this) { |
| | | override fun success(responseString: String?) { |
| | | if (view == null) { |
| | | return |
| | | } |
| | | dismissDialog() |
| | | clickAction(responseString) |
| | | } |
| | | |
| | | override fun onError(code: Int, msg: String?, resposeString: String?) { |
| | | super.onError(code, msg, resposeString) |
| | | if (view == null) { |
| | | return |
| | | } |
| | | dismissDialog() |
| | | } |
| | | |
| | |
| | | HttpManager.getInstance() |
| | | .post(api, map, object : MyObserver(this) { |
| | | override fun success(responseString: String?) { |
| | | if(view==null){ |
| | | return |
| | | } |
| | | dismissDialog() |
| | | clickAction(responseString) |
| | | } |
| | | |
| | | override fun onError(code: Int, msg: String?, resposeString: String?) { |
| | | super.onError(code, msg, resposeString) |
| | | |
| | | if(view==null){ |
| | | return |
| | | } |
| | | clickActionError(msg) |
| | | } |
| | | }) |
| | |
| | | } |
| | | } |
| | | |
| | | fun getSelectId(): com.fangxinxing.xxfxx.bean.AllCarBean.DataBean { |
| | | fun getSelectId(): AllCarBean.DataBean { |
| | | return data[selectPosition] |
| | | } |
| | | } |
| | |
| | | |
| | | fun showFloater() { |
| | | if (floater == null) { |
| | | floater = EasyFloat.with(requireActivity()) |
| | | val activity = requireActivity() |
| | | floater = EasyFloat.with(activity) |
| | | .setLayout(R.layout.layout_floter, OnInvokeView { |
| | | it.setOnClickListener { |
| | | requireActivity().startActivity<MainTabActivity>() |
| | | activity.startActivity<MainTabActivity>() |
| | | } |
| | | }) |
| | | .setShowPattern(ShowPattern.ALL_TIME) |
| | | .setSidePattern(SidePattern.RESULT_LEFT) |
| | | .setGravity(Gravity.START or Gravity.BOTTOM, 0, requireActivity().dip(-180)) |
| | | .setGravity(Gravity.START or Gravity.BOTTOM, 0, activity.dip(-180)) |
| | | .setDragEnable(true) |
| | | .setTag(EasyFloatTag) |
| | | .setMatchParent(widthMatch = false, heightMatch = false) |
| | |
| | | |
| | | return buf.toString(); |
| | | |
| | | } catch (NoSuchAlgorithmException e) { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |