Commit fcdebea6 by mReturn

order

parent c474ca90
......@@ -29,7 +29,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -3,6 +3,7 @@ package com.dayu.bigfish.ui;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
......@@ -35,6 +36,7 @@ import com.dayu.event.UserInfo;
import com.dayu.location.base.LocationUtils;
import com.dayu.managercenter.ui.fragment.ManagerFragment;
import com.dayu.message.ui.fragment.HomeMessageFragment;
import com.dayu.order.common.TabNumEvent;
import com.dayu.order.ui.activity.ReceivingActivity;
import com.dayu.order.ui.fragment.HomeOrderFragment;
import com.dayu.provider.event.RefreshHxNum;
......@@ -71,13 +73,14 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
private TextView[] mTabs;
private NotificationManager notificationManager;
private NotificationCompat.Builder builder;
private ManagerFragment managerFragment;
private HomeFirstTabFragment firstFragment;
// private ManagerFragment managerFragment;
// private HomeFirstTabFragment firstFragment;
private HomeOrderFragment secondFragment;
private HomeMessageFragment thirdFragment;
// private HomeMessageFragment thirdFragment;
private HomePersonFragment fourFragment;
private int mFirstPositon = 0;
private BadgeView mBadgeView;
private BadgeView mOrderBadgeView;
@Override
public int getLayoutId() {
......@@ -87,19 +90,23 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override
public void initView() {
secondFragment = HomeOrderFragment.newInstance();
thirdFragment = HomeMessageFragment.newInstance();
// thirdFragment = HomeMessageFragment.newInstance();
fourFragment = HomePersonFragment.newInstance();
if (UserManager.getInstance().getRole() == Constants.ENGINEER) {
firstFragment = HomeFirstTabFragment.newInstance();
mFragments = new Fragment[]{firstFragment, secondFragment, thirdFragment, fourFragment};
mFirstPositon = 1;
// firstFragment = HomeFirstTabFragment.newInstance();
// mFragments = new Fragment[]{firstFragment, secondFragment, thirdFragment, fourFragment};
// mFirstPositon = 1;
mFragments = new Fragment[]{secondFragment, fourFragment};
mFirstPositon = 0;
} else if (UserManager.getInstance().getRole() == Constants.MANAGER_ENGINEER) {
managerFragment = ManagerFragment.newInstance();
mFragments = new Fragment[]{managerFragment, secondFragment, thirdFragment, fourFragment};
// managerFragment = ManagerFragment.newInstance();
// mFragments = new Fragment[]{managerFragment, secondFragment, thirdFragment, fourFragment};
mFragments = new Fragment[]{ secondFragment, fourFragment};
mFirstPositon = 0;
mBind.tabFirst.setText(getString(R.string.send_order));
}
mTabs = new TextView[]{mBind.tabFirst, mBind.tabSecond, mBind.tabThird, mBind.tabFour};
// mTabs = new TextView[]{mBind.tabFirst, mBind.tabSecond, mBind.tabThird, mBind.tabFour};
mTabs = new TextView[]{mBind.tabSecond,mBind.tabFour};
addFragment();
initListener();
doAction(getIntent());
......@@ -113,12 +120,14 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
}
private void initListener() {
mBind.tabFirst.setOnClickListener(o -> showHideFragment(0, mPosition));
mBind.tabSecond.setOnClickListener(o -> showHideFragment(1, mPosition));
mBind.tabThird.setOnClickListener(o -> {
showHideFragment(2, mPosition);
});
mBind.tabFour.setOnClickListener(o -> showHideFragment(3, mPosition));
// mBind.tabFirst.setOnClickListener(o -> showHideFragment(0, mPosition));
// mBind.tabSecond.setOnClickListener(o -> showHideFragment(1, mPosition));
// mBind.tabThird.setOnClickListener(o -> {
// showHideFragment(2, mPosition);
// });
// mBind.tabFour.setOnClickListener(o -> showHideFragment(3, mPosition));
mBind.tabSecond.setOnClickListener(o -> showHideFragment(0, mPosition));
mBind.tabFour.setOnClickListener(o -> showHideFragment(1, mPosition));
}
/**
......@@ -176,21 +185,49 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
*/
@Override
public void isShowRedIcon(int num) {
num = (int) SPUtils.get(Constants.HX_NUM, 0);
if (mBadgeView == null) {
mBadgeView = new BadgeView(this);
mBadgeView.setTargetView(mBind.tabThird);
mBadgeView.setBadgeGravity(Gravity.CENTER);
mBadgeView.setBadgeMargin(12, 0, 0, 12);
// num = (int) SPUtils.get(Constants.HX_NUM, 0);
// if (mBadgeView == null) {
// mBadgeView = new BadgeView(this);
// mBadgeView.setTargetView(mBind.tabThird);
// mBadgeView.setBadgeGravity(Gravity.CENTER);
// mBadgeView.setBadgeMargin(12, 0, 0, 12);
// }
// if (num < 100) {
// mBadgeView.setText(num + "", TextView.BufferType.NORMAL);
// } else {
// mBadgeView.setText("99+");
// }
// thirdFragment.getNum(num);
}
@Subscribe
public void changeNum(TabNumEvent event){
if (event.num<=0)
return;
if (mOrderBadgeView == null) {
mOrderBadgeView = new BadgeView(this);
mOrderBadgeView.setTargetView(mBind.tabSecond);
mOrderBadgeView.setBadgeGravity(Gravity.CENTER);
mOrderBadgeView.setBadgeMargin(30, -8, 0, 0);
mOrderBadgeView.setBackground(0,Color.TRANSPARENT);
mOrderBadgeView.setTextColor(Color.parseColor("#FF5A4B"));
mOrderBadgeView.setTextSize(18);
}
if (num < 100) {
mBadgeView.setText(num + "", TextView.BufferType.NORMAL);
if (event.num < 100) {
mOrderBadgeView.setText("("+event.num + ")");
} else {
mBadgeView.setText("99+");
mOrderBadgeView.setText("(99+)");
}
thirdFragment.getNum(num);
// if (event.num < 100) {
// mBind.tabSecond.setText(getText(R.string.order)+"("+event.num + ")");
// } else {
// mBind.tabSecond.setText(getText(R.string.order)+"(99+)");
// }
}
@Override
public void showUpdateDialog(VersionInfo info) {
CustomDialog dialog = new CustomDialog(mActivity, R.style.CustomDialog, info.getUpgradePrompt(),
......@@ -275,26 +312,27 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
private void doAction(Intent intent) {
InformBean info = (InformBean) intent.getSerializableExtra(Constants.MESSAGE_INFO);
if (info != null) {
Map<String, String> map_ekv = new HashMap<>();
if (info.getCategory() == 1 && (info.getFunctionType() == 2)) {
dumpReceActivity();//待接单列表
map_ekv.put("type", mActivity.getString(com.dayu.order.R.string.receive_list));
} else {
int secondIndex = 0;
if (info.getCategory() == 1) {
secondIndex = 0; //系统通知
map_ekv.put("type", mActivity.getString(com.dayu.order.R.string.message_system));
} else if (info.getCategory() == 2) {
secondIndex = 1;//大鱼通知
map_ekv.put("type", mActivity.getString(com.dayu.order.R.string.message_dayu));
}
showHideFragment(2, mPosition);
if (thirdFragment != null) {
thirdFragment.setIndex(secondIndex);
thirdFragment.swtichFragment(secondIndex);
}
}
MobclickAgent.onEvent(mActivity, "notificaition_click", map_ekv);
// Map<String, String> map_ekv = new HashMap<>();
// if (info.getCategory() == 1 && (info.getFunctionType() == 2)) {
// dumpReceActivity();//待接单列表
// map_ekv.put("type", mActivity.getString(com.dayu.order.R.string.receive_list));
// } else {
// int secondIndex = 0;
// if (info.getCategory() == 1) {
// secondIndex = 0; //系统通知
// map_ekv.put("type", mActivity.getString(com.dayu.order.R.string.message_system));
// } else if (info.getCategory() == 2) {
// secondIndex = 1;//大鱼通知
// map_ekv.put("type", mActivity.getString(com.dayu.order.R.string.message_dayu));
// }
// showHideFragment(0, mPosition);
// if (thirdFragment != null) {
// thirdFragment.setIndex(secondIndex);
// thirdFragment.swtichFragment(secondIndex);
// }
// }
// MobclickAgent.onEvent(mActivity, "notificaition_click", map_ekv);
showHideFragment(0, mPosition);
}
}
......
......@@ -41,6 +41,7 @@
android:visibility="visible">
<TextView
android:visibility="gone"
android:id="@+id/tab_first"
android:layout_width="0dp"
android:layout_height="wrap_content"
......@@ -67,6 +68,7 @@
android:textSize="10sp" />
<LinearLayout
android:visibility="gone"
android:id="@+id/tab_get_order"
android:layout_width="0dp"
android:layout_height="42dp"
......@@ -94,6 +96,7 @@
</LinearLayout>
<TextView
android:visibility="gone"
android:id="@+id/tab_third"
android:layout_width="0dp"
android:layout_height="match_parent"
......
package com.dayu.event;
/**
* Created by mReturn
* on 2019/12/21
**/
public class EmptyEevent {
}
......@@ -40,6 +40,7 @@
<color name="blue_register">#FF0e15fb</color>
<color name="color_ee">#eeeeee</color>
......
......@@ -198,7 +198,8 @@
<string name="left_time">剩余时间</string>
<!--工单-->
<string name="order_title">我的工单</string>
<!--<string name="order_title">我的工单</string>-->
<string name="order_title">服务工单</string>
<string name="order_history">工单历史</string>
<string name="webview_title">SOP</string>
<string name="order_not_exite">该订单不存在</string>
......@@ -247,8 +248,10 @@
<string name="look_more">查看更多</string>
<string name="no_record">暂无记录</string>
<string name="order_detail">工单详情</string>
<string name="order_operate_help">操作指南</string>
<string name="server_record">服务记录</string>
<string name="order_part">备件信息</string>
<!--<string name="order_part">备件信息</string>-->
<string name="order_part">备件物流</string>
<string name="return_one_order_part">寄回一个备件</string>
<string name="apply_one_order_part">申请一个备件</string>
<string name="order_instruction">视频操作指南</string>
......@@ -760,5 +763,12 @@ C) 在甲方使用大鱼平å°æœåŠ¡è¿‡ç¨‹ä¸­äº§ç”Ÿçš„业务数æ®ï¼Œå®¢æˆ·æ•°æ
<string name="upload_avatar_fail">上传头像失败</string>
<string name="register_success">注册成功</string>
<string name="register_fail">注册失败</string>
<string name="to_be_receive">待接单</string>
<string name="order_sender">派单方</string>
<string name="order_send_info">派单信息</string>
<string name="order_send_company">派单商家</string>
<string name="order_take_price">接单费用</string>
<string name="contact_seller_support">联系商家技术支持</string>
<string name="stand_operate_step_">标准操作步骤:</string>
</resources>
package com.dayu.order.common;
/**
* Created by mReturn
* on 2020/1/5
**/
public class TabNumEvent {
public int num;
public TabNumEvent(int num) {
this.num = num;
}
}
......@@ -15,7 +15,7 @@ import com.dayu.order.ui.activity.WebViewActivity;
*/
public class ServerInstructionPresenter extends ServerInstructionContract.Presenter {
public ObservableField<Object> mDatas = new ObservableField<>();
private int mSpuId;
private int mSpuId = -1;
private int mPage;
@Override
......@@ -26,7 +26,9 @@ public class ServerInstructionPresenter extends ServerInstructionContract.Presen
@Override
public void onAttached() {
Bundle bundle = mView.getBundle();
mSpuId = bundle.getInt(Constants.ID);
if (bundle != null && bundle.containsKey(Constants.ID)){
mSpuId = bundle.getInt(Constants.ID);
}
refresh();
}
......
......@@ -15,6 +15,7 @@ import com.dayu.order.presenter.orderdetail.OrderDetailPresenter;
import com.dayu.order.ui.fragment.MultiOrderDetailFragment;
import com.dayu.order.ui.fragment.OrderDetaillsFragment;
import com.dayu.order.ui.fragment.OrderDetailsServeFragment;
import com.dayu.order.ui.fragment.OrderOperateFragment;
import com.dayu.order.ui.fragment.OrderPartFragment;
import com.dayu.provider.event.RefreshDetailEvent;
import com.dayu.provider.router.RouterPath;
......@@ -36,6 +37,7 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailPresenter, Act
private OrderDetaillsFragment orderDatailsFragment;
private OrderDetailsServeFragment orderDatailsServeFragment;
private OrderPartFragment mOrderPartFragment;
private OrderOperateFragment mOperateFragment;
private MultiOrderDetailFragment mMultiDetailFragment;
private FragmentManager mFragmentManger;
private ArrayList<Fragment> mFragments;
......@@ -62,6 +64,7 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailPresenter, Act
mFragments = new ArrayList<>();
orderDatailsFragment = OrderDetaillsFragment.newInstance(detail);
mMultiDetailFragment = MultiOrderDetailFragment.newInstance(detail);
mOperateFragment = new OrderOperateFragment();
orderDatailsServeFragment = OrderDetailsServeFragment.newInstance(detail);
mOrderPartFragment = OrderPartFragment.newInstance(detail);
if (detail.getCreatedSource() == 2 || detail.getCreatedSource() == 3 || detail.getCreatedSource() == 4) {
......@@ -69,10 +72,12 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailPresenter, Act
} else {
mFragments.add(orderDatailsFragment);
}
mFragments.add(mOperateFragment);
mFragments.add(orderDatailsServeFragment);
mFragments.add(mOrderPartFragment);
mBind.titleBack.setOnClickListener(v -> dumpBack());
mBind.btnDetail.setVisibility(View.VISIBLE);
mBind.btnOperate.setVisibility(View.VISIBLE);
mBind.btnServer.setVisibility(View.VISIBLE);
if (detail.getCreatedSource() == 1) {
mBind.btnServer.setBackgroundResource(R.drawable.detail_end_selector);
......@@ -93,17 +98,23 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailPresenter, Act
mBind.btnDetail.setTextColor(getResources().getColor(R.color.white));
showHideFragment(0, mPosition);
});
mBind.btnOperate.setOnClickListener((view) -> {
reSelected();
mBind.btnOperate.setSelected(true);
mBind.btnOperate.setTextColor(getResources().getColor(R.color.white));
showHideFragment(1, mPosition);
});
mBind.btnServer.setOnClickListener((view) -> {
reSelected();
mBind.btnServer.setTextColor(getResources().getColor(R.color.white));
mBind.btnServer.setSelected(true);
showHideFragment(1, mPosition);
showHideFragment(2, mPosition);
});
mBind.btnPart.setOnClickListener((view) -> {
reSelected();
mBind.btnPart.setTextColor(getResources().getColor(R.color.white));
mBind.btnPart.setSelected(true);
showHideFragment(2, mPosition);
showHideFragment(3, mPosition);
});
}
......@@ -133,9 +144,11 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailPresenter, Act
private void reSelected() {
mBind.btnDetail.setSelected(false);
mBind.btnOperate.setSelected(false);
mBind.btnServer.setSelected(false);
mBind.btnPart.setSelected(false);
mBind.btnDetail.setTextColor(getResources().getColor(R.color.cl_home_button));
mBind.btnOperate.setTextColor(getResources().getColor(R.color.cl_home_button));
mBind.btnServer.setTextColor(getResources().getColor(R.color.cl_home_button));
mBind.btnPart.setTextColor(getResources().getColor(R.color.cl_home_button));
}
......
......@@ -15,6 +15,7 @@ import com.dayu.base.ui.fragment.BaseFragment;
import com.dayu.common.Constants;
import com.dayu.order.R;
import com.dayu.order.api.protocol.Tab;
import com.dayu.order.common.TabNumEvent;
import com.dayu.order.databinding.FragmentOrderHomeBinding;
import com.dayu.order.presenter.homeorder.HomeOrderContract;
import com.dayu.order.presenter.homeorder.HomeOrderPresenter;
......@@ -61,7 +62,8 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
@Override
public void initView() {
tabDesc = new String[]{mActivity.getString(R.string.waite_appointemnt), mActivity.getString(R.string.waite_server), mActivity.getString(R.string.order_exception), mActivity.getString(R.string.cancle_order)};
// tabDesc = new String[]{mActivity.getString(R.string.waite_appointemnt), mActivity.getString(R.string.waite_server), mActivity.getString(R.string.order_exception), mActivity.getString(R.string.cancle_order)};
tabDesc = new String[]{mActivity.getString(R.string.to_be_receive),mActivity.getString(R.string.waite_appointemnt), mActivity.getString(R.string.waite_server), mActivity.getString(R.string.order_exception)};
if (UserManager.getInstance().getRole() == Constants.ENGINEER) {
mBind.createOrder.setVisibility(View.VISIBLE);
mBind.createOrder.setOnClickListener(v -> {
......@@ -88,10 +90,11 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
public void initData() {
list_fragments = new ArrayList<>();
list_fragments.add(new OrderReceivingFragment());
list_fragments.add(new OrderFirstTabFragment());
list_fragments.add(new OrderSecondTabFragment());
list_fragments.add(new OrderThreeTabFragment());
list_fragments.add(new OrderFourTabFragment());
// list_fragments.add(new OrderFourTabFragment());
adapter = new FragmentAdapter(getFragmentManager(), list_fragments);
mBind.vpHome.setAdapter(adapter);
mBind.tbHome.setupWithViewPager(mBind.vpHome);
......@@ -110,31 +113,36 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
mTabTextTv = tab.getCustomView().findViewById(R.id.tabicon);
switch (temp) {
case 0:
mTabNumTv.setTextColor(getResources().getColor(R.color.cl_order_item_date));
mTabTextTv.setTextColor(getResources().getColor(R.color.cl_order_item_date));
mTabNumTv.setTextColor(getResources().getColor(R.color.bg_button));
mTabTextTv.setTextColor(getResources().getColor(R.color.bg_button));
mBind.vpHome.setCurrentItem(0);
MobclickAgent.onPageStart("OrderFirstTabFragment");
mUmTag = "OrderFirstTabFragment";
break;
case 1:
mTabNumTv.setTextColor(getResources().getColor(R.color.cl_tab_yellow));
mTabTextTv.setTextColor(getResources().getColor(R.color.cl_tab_yellow));
mTabNumTv.setTextColor(getResources().getColor(R.color.cl_order_item_date));
mTabTextTv.setTextColor(getResources().getColor(R.color.cl_order_item_date));
mBind.vpHome.setCurrentItem(1);
mUmTag = "OrderSecondTabFragment";
MobclickAgent.onPageStart("OrderSecondTabFragment");
break;
case 2:
mTabNumTv.setTextColor(getResources().getColor(R.color.cl_tab_read));
mTabTextTv.setTextColor(getResources().getColor(R.color.cl_tab_read));
mTabNumTv.setTextColor(getResources().getColor(R.color.cl_tab_yellow));
mTabTextTv.setTextColor(getResources().getColor(R.color.cl_tab_yellow));
mBind.vpHome.setCurrentItem(2);
mUmTag = "OrderThreeTabFragment";
MobclickAgent.onPageStart("OrderThreeTabFragment");
break;
case 3:
mTabNumTv.setTextColor(getResources().getColor(R.color.cl_tab_read));
mTabTextTv.setTextColor(getResources().getColor(R.color.cl_tab_read));
mBind.vpHome.setCurrentItem(3);
mUmTag = "OrderFourTabFragment";
MobclickAgent.onPageStart("OrderFourTabFragment");
break;
// case 3:
// mBind.vpHome.setCurrentItem(3);
// break;
}
}
......@@ -178,8 +186,11 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
*/
@Override
public void setTabNum(Tab tab, int myTabIndex) {
String[] tabNum = new String[]{tab.getReservation() + "", tab.getPendingservice() + "",
tab.getError() + "", tab.getCanceled() + ""};
// String[] tabNum = new String[]{"tab.getReservation() + "", tab.getPendingservice() + "",
// tab.getError() + "", tab.getCanceled() + ""};
String[] tabNum = new String[]{"0",tab.getReservation() + "", tab.getPendingservice() + "",
tab.getError() + ""};
EventBus.getDefault().post(new TabNumEvent(tab.getPendingservice()+tab.getError()));
if (isFirstAddTab) {
mBind.tbHome.removeAllTabs();
mBind.tbHome.addTab(mBind.tbHome.newTab().setCustomView(CreatTab(tabNum[0], tabDesc[0])));
......
package com.dayu.order.ui.fragment;
import com.dayu.base.ui.fragment.BaseFragment;
import com.dayu.base.ui.fragment.DataBindingFragment;
import com.dayu.order.R;
import com.dayu.order.databinding.FragmentOrderOperateBinding;
import com.dayu.order.presenter.serverinstruction.ServerInstructionContract;
import com.dayu.order.presenter.serverinstruction.ServerInstructionPresenter;
import com.dayu.order.ui.adapter.OrderAdapter;
public class OrderOperateFragment extends BaseFragment<ServerInstructionPresenter,FragmentOrderOperateBinding>
implements ServerInstructionContract.View {
private OrderAdapter mAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_order_operate;
}
@Override
public void initView() {
}
@Override
public void setPresenter() {
mBind.setPresenter(mPresenter);
}
}
package com.dayu.order.ui.fragment;
import android.os.Bundle;
import com.alibaba.android.arouter.launcher.ARouter;
import com.dayu.base.ui.fragment.BaseFragment;
import com.dayu.common.Constants;
import com.dayu.order.R;
import com.dayu.order.api.protocol.Order;
import com.dayu.order.databinding.FragmentCommomRecycleBinding;
import com.dayu.order.databinding.FragmentOrderdoingItemBinding;
import com.dayu.order.presenter.orderdoing.OrderDoingPresenter;
import com.dayu.order.presenter.orderdoing.orderDoingContract;
import com.dayu.order.presenter.receivingorder.ReceivingContract;
import com.dayu.order.presenter.receivingorder.ReceivingPresenter;
import com.dayu.order.ui.adapter.OrderAdapter;
import com.dayu.provider.event.RefreshApoiment;
import com.dayu.provider.router.RouterPath;
import com.dayu.utils.ProgressUtil;
import com.dayu.utils.UserManager;
import com.dayu.widgets.CustomDialog;
import com.dayu.widgets.listener.OnItemClickListener;
import com.umeng.analytics.MobclickAgent;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
/**
* 待预约的Fragment
*/
public class OrderReceivingFragment extends BaseFragment<ReceivingPresenter, FragmentCommomRecycleBinding> implements
ReceivingContract.View {
private OrderAdapter mAdapter;
@Override
public int getLayoutId() {
return R.layout.fragment_commom_recycle;
}
@Override
public void initView() {
mAdapter = new OrderAdapter(true);
mAdapter.setViewType(R.layout.fragment_orderdoing_item);
mBind.recyclerView.setAdapter(mAdapter);
initListener();
mBind.recyclerView.setOnItemClickListener(new OnItemClickListener<Order, FragmentOrderdoingItemBinding>() {
@Override
public void OnItemClick(Order item, FragmentOrderdoingItemBinding bind) {
mPresenter.dumpDetail(item.getId());
}
});
}
@Override
public void setPresenter() {
mBind.setPresenter(mPresenter);
}
private void initListener() {
mAdapter.setOnChildClickListener((view, adapter, position) -> {
if (view.getId() == R.id.item_text_phone) {
int detectSatus = UserManager.getInstance().getUser().getDetectStatus();
if (detectSatus == 2 || detectSatus == 3) {
showCertificationDialog();
} else {
Order order = (Order) adapter.getItem(position);
mPresenter.receiveOrder(order.getId(), mPresenter.getmUserId());
MobclickAgent.onEvent(mActivity, "recevie_order");
}
}
});
}
private void showCertificationDialog() {
CustomDialog customDialog = new CustomDialog(mActivity, R.style.CustomDialog, getString(R.string.engineer_identity_not_audite)
, (dialog, confirm) -> {
if (confirm) {
Bundle bundle = new Bundle();
bundle.putInt(Constants.CETIFICATION_STATE, 1);
ARouter.getInstance().build(RouterPath.PATH_CERTIFICAITON).withBundle(Constants.BUNDLE, bundle).navigation();
}
});
customDialog.setTitle(getString(R.string.certification))
.setPositiveButton(getString(R.string.go_certification))
.setNegativeButton(getString(R.string.cancle));
customDialog.show();
}
@Override
public void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void RefreshApoiment(RefreshApoiment event) {
ProgressUtil.startLoad(mActivity);
mBind.recyclerView.Refresh();
}
}
......@@ -17,29 +17,39 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="15dp"
android:paddingRight="25dp"
android:paddingRight="15dp"
android:src="@drawable/back_btn_normal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginRight="50dp"
android:layout_marginRight="5dp"
android:layout_marginTop="@dimen/dp_12"
android:gravity="center">
<Button
android:id="@+id/btn_detail"
android:layout_width="90dp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="28dp"
android:background="@drawable/detail_first_selector"
android:gravity="center"
android:visibility="invisible"
android:text="@string/order_detail" />
<Button
android:id="@+id/btn_operate"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="28dp"
android:background="@drawable/detail_center_selector"
android:gravity="center"
android:visibility="invisible"
android:text="@string/order_operate_help" />
<Button
android:id="@+id/btn_server"
android:layout_width="90dp"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="28dp"
android:background="@drawable/detail_center_selector"
android:gravity="center"
......
......@@ -34,7 +34,7 @@
android:paddingLeft="15dp"
android:paddingTop="@dimen/dp_15"
android:text="@string/tv_order_eg"
android:textColor="@color/tv_cl"
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
<RelativeLayout
......@@ -410,7 +410,7 @@
android:paddingLeft="15dp"
android:paddingTop="@dimen/dp_15"
android:text="@string/money_info"
android:textColor="@color/tv_cl"
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
<LinearLayout
......@@ -438,6 +438,77 @@
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="43dp"
android:paddingLeft="15dp"
android:paddingTop="@dimen/dp_15"
android:text="@string/order_send_info"
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingBottom="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_15"
android:text="@string/order_send_company"
android:textColor="@color/tv_cl"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_15"
android:text="aaaaaa"
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingBottom="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_15"
android:text="@string/order_send_company"
android:textColor="@color/tv_cl"
android:textSize="14sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_15"
android:text="180元"
android:textColor="@color/cl_order_item_date"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:id="@+id/tv_contact_seller"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_margin="20dp"
android:background="@color/cl_home_button"
android:gravity="center"
android:text="@string/contact_seller_support"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
......
......@@ -75,6 +75,60 @@
android:layout_centerInParent="true"
android:layout_toRightOf="@id/item_line"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginTop="@dimen/dp_16.7"
android:ellipsize="end"
android:maxEms="3"
android:maxLines="1"
android:text="@string/order_sender"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/size_login_hint_text"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:text=" - "
android:textStyle="bold" />
<TextView
android:id="@+id/tv_order_sender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:ellipsize="end"
android:maxEms="7"
android:maxLines="1"
android:text="aaaaaaaaaaaaaa"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/size_login_hint_text"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:ellipsize="end"
android:maxEms="7"
android:maxLines="1"
android:text="180元"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:gravity="right"
android:textColor="@color/cl_order_item_date"
android:textSize="@dimen/size_login_hint_text"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_right"
......@@ -82,6 +136,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="presenter"
type="com.dayu.base.ui.presenter.BaseListPresenter" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:background="@color/color_ee"
android:layout_height="43dp"
android:paddingLeft="15dp"
android:paddingTop="@dimen/dp_15"
android:text="@string/stand_operate_step_"
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_contact_seller"
android:layout_width="140dp"
android:layout_height="30dp"
android:layout_marginRight="10dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:background="@color/cl_home_button"
android:gravity="center"
android:text="@string/contact_seller_support"
android:textColor="@color/white"
android:textSize="12sp" />
</RelativeLayout>
<com.dayu.widgets.LRecyclerView
android:id="@+id/recyclerView"
setPresenter="@{presenter}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f5f5f5"
app:isRefreshable="true"
app:itemType="@layout/item_order_instruction"
app:needCoreAdapter="true"
app:needFoot="true" />
</LinearLayout>
</layout>
\ No newline at end of file
......@@ -80,6 +80,9 @@
android:layout_marginTop="@dimen/dp_21.3"
android:background="@color/cl_order_item_line_bg" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -89,6 +92,61 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginTop="@dimen/dp_16.7"
android:ellipsize="end"
android:maxEms="3"
android:maxLines="1"
android:text="@string/order_sender"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/size_login_hint_text"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:text=" - "
android:textStyle="bold" />
<TextView
android:id="@+id/tv_order_sender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:ellipsize="end"
android:maxEms="7"
android:maxLines="1"
android:text="aaaaaaaaa"
android:textColor="@color/cl_home_title_text_color"
android:textSize="@dimen/size_login_hint_text"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:ellipsize="end"
android:maxEms="7"
android:maxLines="1"
android:text="180元"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:gravity="right"
android:textColor="@color/cl_order_item_date"
android:textSize="@dimen/size_login_hint_text"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
......@@ -102,7 +160,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_13.3"
android:layout_marginTop="@dimen/dp_16.7"
android:layout_marginTop="@dimen/dp_6"
android:ellipsize="end"
android:maxEms="3"
android:maxLines="1"
......@@ -115,7 +173,7 @@
android:id="@+id/text_line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:layout_marginTop="@dimen/dp_6"
android:text=" - "
android:textStyle="bold" />
......@@ -123,7 +181,7 @@
android:id="@+id/item_text_weixiu_leixing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16.7"
android:layout_marginTop="@dimen/dp_6"
android:ellipsize="end"
android:maxEms="7"
android:maxLines="1"
......@@ -138,7 +196,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginTop="@dimen/dp_16.7"
android:layout_marginTop="@dimen/dp_6"
android:textColor="@color/cl_tab_init"
android:textSize="@dimen/size_login_hint_text"
android:visibility="gone" />
......@@ -219,6 +277,7 @@
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<ImageView
......
......@@ -44,6 +44,7 @@
</LinearLayout>
<TextView
android:visibility="gone"
android:id="@+id/tv_server"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
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