Commit 959f8c3f by wukun

0406

parent d48831cc
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<solid android:color="@color/cl_tab_gray"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<solid android:color="@color/cl_order_item_date"/>
<stroke android:width="2dp" android:color="@color/light_grey"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<solid android:color="@color/white"/>
<stroke android:width="2dp" android:color="@color/green"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<solid android:color="@color/white"/>
<stroke android:width="2dp" android:color="@color/cl_order_text_title"/>
</shape>
\ No newline at end of file
......@@ -13,6 +13,7 @@
<color name="cl_order_item_line_bg">#e5e5e5</color>
<color name="cl_order_item_date">#00c45d</color>
<color name="text_common_green">#00c45d</color>
<color name="green">#329132</color>
<color name="cl_receiving_order_item_data">#3faafc</color>
<color name="cl_tab_yellow">#ffbe2d</color>
<color name="cl_tab_gray">#7f7f7f</color>
......
......@@ -155,16 +155,16 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
holder.tvOrderTime.setText("预约时间");
time = item.getAppointmentTime();
setTimeStatus(holder, item, time);
if (!TextUtils.isEmpty(teamId) && !isRedeploy) {
holder.redeploy.setVisibility(View.VISIBLE);
holder.redeploy.setOnClickListener(v -> {
if (mOnChildClickListener != null) {
mOnChildClickListener.OnChildClick(holder.redeploy, this, position);
}
});
} else {
// if (!TextUtils.isEmpty(teamId) && !isRedeploy) {
// holder.redeploy.setVisibility(View.VISIBLE);
// holder.redeploy.setOnClickListener(v -> {
// if (mOnChildClickListener != null) {
// mOnChildClickListener.OnChildClick(holder.redeploy, this, position);
// }
// });
// } else {
holder.redeploy.setVisibility(View.GONE);
}
// }
holder.itemTextDizhi.setPadding(0, 0, 0, UIUtils.dp2px(20));
break;
case 2://待预约
......@@ -529,7 +529,7 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
holder.itemTextWeixiu.setText(item.getSpus().get(0).getProviderTypeName());
holder.itemTextWeixiuLeixing.setText(item.getSpus().get(0).getCategoryThreeName());
if (!TextUtils.isEmpty(teamId) && isRedeploy) {
holder.tvTakeOrder.setVisibility(View.VISIBLE);
holder.tvTakeOrder.setVisibility(View.GONE);
holder.llOrderDoneBootom.setVisibility(View.GONE);
holder.llBottom.setVisibility(View.GONE);
holder.tvTakeOrder.setText("转派");
......
......@@ -63,7 +63,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.to_be_receive), mActivity.getString(R.string.waite_appointemnt), mActivity.getString(R.string.waite_server), "转派单", mActivity.getString(R.string.order_already_done)};
// 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_already_done)};
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_already_done)};
// 新建工单
// if (UserManager.getInstance().getRole() == Constants.ENGINEER) {
// mBind.createOrder.setVisibility(View.VISIBLE);
......@@ -94,7 +95,7 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
list_fragments.add(new OrderReceivingFragment());
list_fragments.add(new OrderFirstTabFragment());
list_fragments.add(new OrderSecondTabFragment());
list_fragments.add(new OrderRedeployFragment());
// list_fragments.add(new OrderRedeployFragment());
list_fragments.add(new OrderDoneFragment());
adapter = new FragmentAdapter(getFragmentManager(), list_fragments);
mBind.vpHome.setAdapter(adapter);
......@@ -145,7 +146,8 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
public void setTabNum(Tab tab, int myTabIndex) {
// String[] tabNum = new String[]{"tab.getReservation() + "", tab.getPendingservice() + "",
// tab.getError() + "", tab.getCanceled() + ""};
int[] tabNum = new int[]{tab.getWaits(), tab.getReservation(), tab.getPendingservice(), tab.getRedeploy(), tab.getComplete()};
// int[] tabNum = new int[]{tab.getWaits(), tab.getReservation(), tab.getPendingservice(), tab.getRedeploy(), tab.getComplete()};
int[] tabNum = new int[]{tab.getWaits(), tab.getReservation(), tab.getPendingservice(), tab.getComplete()};
EventBus.getDefault().post(new TabNumEvent(tab.getPendingservice() + tab.getWaits() + tab.getReservation()));
if (isFirstAddTab) {
mBind.tbHome.removeAllTabs();
......@@ -153,7 +155,7 @@ public class HomeOrderFragment extends BaseFragment<HomeOrderPresenter, Fragment
mBind.tbHome.addTab(mBind.tbHome.newTab().setCustomView(CreatTab(1, tabNum[1], tabDesc[1])));
mBind.tbHome.addTab(mBind.tbHome.newTab().setCustomView(CreatTab(2, tabNum[2], tabDesc[2])));
mBind.tbHome.addTab(mBind.tbHome.newTab().setCustomView(CreatTab(3, tabNum[3], tabDesc[3])));
mBind.tbHome.addTab(mBind.tbHome.newTab().setCustomView(CreatTab(4, tabNum[4], tabDesc[4])));
// mBind.tbHome.addTab(mBind.tbHome.newTab().setCustomView(CreatTab(4, tabNum[4], tabDesc[4])));
isFirstAddTab = false;
} else {
for (int i = 0; i < mBind.tbHome.getTabCount(); i++) {
......
......@@ -119,7 +119,7 @@ public class SaleProductFragment extends BaseFragment<SaleProductPresent, Fragme
}
});
mBind.llBussiness.setVisibility(View.VISIBLE);
mBind.llBussiness.setVisibility(View.GONE);
AnimationDrawable animation = (AnimationDrawable) mBind.ivBfcom.getBackground();
animation.start();
} else if (type == 2) {
......
......@@ -77,7 +77,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cl_bg"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<com.dayu.widgets.AutoPollRecyclerView
android:id="@+id/rv_reward"
......
......@@ -147,6 +147,50 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
}));
mBind.rlStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mBind.rlStart.setVisibility(View.GONE);
mBind.rlStop.setVisibility(View.VISIBLE);
int status = 2;
ToastUtils.showShortToast("接单开关已关闭,暂停接单");
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("accountId", mUserId);
jsonObject.put("workStatus", status);
} catch (JSONException e) {
e.printStackTrace();
}
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
Api.getService(UserService2.class).changeWorkStatus(requestBody).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(data -> {
}));
mBind.receiveOrder.setSwitchButton(!mBind.receiveOrder.switchButton);
}
});
mBind.rlStop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mBind.rlStart.setVisibility(View.VISIBLE);
mBind.rlStop.setVisibility(View.GONE);
int status = 1;
ToastUtils.showShortToast("接单开关已开启,开始接单");
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("accountId", mUserId);
jsonObject.put("workStatus", status);
} catch (JSONException e) {
e.printStackTrace();
}
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
Api.getService(UserService2.class).changeWorkStatus(requestBody).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(data -> {
}));
mBind.receiveOrder.setSwitchButton(!mBind.receiveOrder.switchButton);
}
});
mBind.receiveOrder.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -177,8 +221,12 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
.subscribe(mPresenter.baseObserver(data -> {
if (data.getWorkStatus() == 1) {
mBind.receiveOrder.setSwitchButton(true);
mBind.rlStart.setVisibility(View.VISIBLE);
mBind.rlStop.setVisibility(View.GONE);
} else {
mBind.receiveOrder.setSwitchButton(false);
mBind.rlStart.setVisibility(View.GONE);
mBind.rlStop.setVisibility(View.VISIBLE);
}
}));
}
......@@ -587,6 +635,13 @@ public class HomeUserFragment extends BaseFragment<HomeUserPresenter, FragmentHo
@Subscribe(threadMode = ThreadMode.MAIN)
public void receiveOrderSwitch(ReceiveOrderSwitchEvent event) {
mBind.receiveOrder.setSwitchButton(event.isSwitch());
if (event.isSwitch()){
mBind.rlStart.setVisibility(View.VISIBLE);
mBind.rlStop.setVisibility(View.GONE);
}else{
mBind.rlStart.setVisibility(View.GONE);
mBind.rlStop.setVisibility(View.VISIBLE);
}
}
......
......@@ -609,7 +609,8 @@
<LinearLayout
style="@style/ll_user_bottom"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
android:layout_marginBottom="10dp"
android:visibility="gone">
<LinearLayout
android:id="@+id/withTeam"
......@@ -659,32 +660,72 @@
<TextView
android:id="@+id/weChat"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/personal_center_selector"
android:layout_width="250dp"
android:layout_height="40dp"
android:background="@drawable/btn_blue_react_4"
android:gravity="center"
android:text="联系平台客服,加入接单交流群"
android:textColor="@color/default_text_color" />
android:text="加入接单交流群"
android:textColor="@color/white"
android:textSize="18dp"
android:layout_marginTop="15dp"/>
<TextView
android:id="@+id/transmitServer"
android:layout_width="250dp"
android:layout_height="30dp"
android:layout_height="40dp"
android:background="@drawable/btn_blue_react_4"
android:gravity="center"
android:text="转发服务名片"
android:text="转发我的电子名片"
android:textColor="@color/white"
android:textSize="18dp" />
android:textSize="18dp"
android:layout_marginTop="20dp"
/>
<RelativeLayout
android:id="@+id/rl_start"
android:layout_width="250dp"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:background="@drawable/btn_green_react_4"
android:visibility="gone">
<TextView
android:layout_width="125dp"
android:layout_height="match_parent"
android:text="开始接单"
android:gravity="center"
android:textSize="18dp"
android:textColor="@color/green"
android:background="@drawable/btn_white_react_4"
android:layout_alignParentRight="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_stop"
android:layout_width="250dp"
android:layout_height="40dp"
android:layout_marginTop="15dp"
android:background="@drawable/btn_gray_react_4"
android:visibility="gone">
<TextView
android:layout_width="125dp"
android:layout_height="match_parent"
android:text="暂停接单"
android:gravity="center"
android:textSize="18dp"
android:textColor="@color/cl_order_text_title"
android:background="@drawable/btn_white_react_4_black"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/receiveOrderRl"
android:layout_width="250dp"
android:layout_height="54dp"
android:gravity="center"
android:background="@color/cl_white">
android:background="@color/cl_white"
android:visibility="gone">
<TextView
android:layout_width="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