This commit is contained in:
2020-09-11 17:35:27 +08:00
parent 06202df955
commit 242e53b8b9
4 changed files with 319 additions and 4 deletions

View File

@@ -0,0 +1,115 @@
package com.fenghoo.seven.main.find.adapter.holder;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import com.fenghoo.seven.R;
import com.fenghoo.seven.main.find.mvp.contract.MarKQuestionItemviewOnClickListener;
import com.fenghoo.seven.main.kehu.Bean.fpOrderInfoBean;
import com.fenghoo.seven.utils.AbStrUtil;
import com.fenghoo.seven.utils.WidgetTools;
import com.fenghoo.seven.widget.ItemProView;
public class BottomViewtwoHolder extends TypeAbstractViewHolder {
private ItemProView itemProView;
private final TextView tv_time_01;
private final TextView tv_time_02;
private final TextView tv_fphy;
private final TextView tv_fpcs;
private final TextView tv_khys;
private final TextView tv_time_001;
private final TextView tv_time_002;
private final TextView tv_pl;
private final TextView tv_md;
private final TextView tv_qdr;
private final TextView tv_jzjd;
private final TextView tv_pp;
public BottomViewtwoHolder(View itemView) {
super(itemView);
itemProView = (ItemProView) itemView.findViewById(R.id.item_my_twitter);
tv_time_01 = (TextView) itemView.findViewById(R.id.tv_time_01);
tv_time_02 = (TextView) itemView.findViewById(R.id.tv_time_02);
tv_fphy = (TextView) itemView.findViewById(R.id.tv_fphy);
tv_fpcs = (TextView) itemView.findViewById(R.id.tv_fpcs);
tv_khys = (TextView) itemView.findViewById(R.id.tv_khys);
tv_time_001 = (TextView) itemView.findViewById(R.id.tv_time_001);
tv_time_002 = (TextView) itemView.findViewById(R.id.tv_time_002);
tv_pl = (TextView) itemView.findViewById(R.id.tv_pl);
tv_md = (TextView) itemView.findViewById(R.id.tv_md);
tv_qdr = (TextView) itemView.findViewById(R.id.tv_qdr);
// tv_time_00 = (TextView) itemView.findViewById(R.id.tv_time_00);
// tv_time_000 = (TextView) itemView.findViewById(R.id.tv_time_000);
tv_jzjd = (TextView) itemView.findViewById(R.id.tv_jzjd);
tv_pp = (TextView) itemView.findViewById(R.id.tv_pp);
}
/**
* 页面逻辑
* travel1:已分配2已被抢3已进店4已成交 4种类型的条目
* <p>
* order_state0未成交1已成交
* ygd_state0未被抢1已被抢
* enter_state:0未进店1已进店
* <p>
* type1已回收2已成交
*/
public void bindHolder(final fpOrderInfoBean.ResultBean.DataBean dataBean, int position, Context mContext, final MarKQuestionItemviewOnClickListener mviewListener) {
/**
* 三个字段有7种状态
*/
String ygd_state = dataBean.getYgd_state();//0未被抢1已被抢
String enter_state = dataBean.getEnter_state();//0未进店1已进店
String order_state = dataBean.getOrder_state();//0未成交1已成交
String ygd_enter = dataBean.getYgd_enter();//进店次数
String ygd_order = dataBean.getYgd_order();//成交次数
itemProView.refresh("0", ygd_state, enter_state,order_state,ygd_enter,ygd_order);
//_____________分配客户
String fp_time = dataBean.getFp_time();
settime(fp_time, tv_time_01, tv_time_02);
WidgetTools.setTextfive(tv_fphy, "分配行业:", dataBean.getIndustry());
String decoration = dataBean.getDecoration();//1毛坯2精装3旧房改造
switch (decoration) {
case "1":
WidgetTools.setTextfive(tv_jzjd, "家装阶段:", "毛胚");
break;
case "2":
WidgetTools.setTextfive(tv_jzjd, "家装阶段:", "精装");
break;
case "3":
WidgetTools.setTextfive(tv_jzjd, "家装阶段:", "旧房改造");
break;
}
WidgetTools.setTextfive(tv_fpcs, "分配城市:", dataBean.getCity());
WidgetTools.setTextfive(tv_khys, "客户预算:", dataBean.getBudget());
//_____________抢单客户
String rob_time = dataBean.getRob_time();
settime(rob_time, tv_time_001, tv_time_002);
WidgetTools.setTextfive(tv_pl, "品类:", dataBean.getYgd_brand_type());
WidgetTools.setTextfive(tv_pp, "品牌:", dataBean.getYgd_brand_name());
WidgetTools.setTextfive(tv_md, "门店:", dataBean.getYgd_store_name());
WidgetTools.setTextfive(tv_qdr, "抢单人:", dataBean.getYgd_brand_name());
}
private void settime(String rob_time, TextView tv_time_001, TextView tv_time_002) {
if (!AbStrUtil.isEmpty(rob_time)) {
String[] s = rob_time.split(" ");
if (s[1] != null) {
WidgetTools.setTextfive(tv_time_001, "", s[1]);
}
if (s[0] != null) {
WidgetTools.setTextfive(tv_time_002, "", s[0]);
}
} else {
WidgetTools.setTextfive(tv_time_001, "", "");
WidgetTools.setTextfive(tv_time_002, "", "");
}
}
}

View File

@@ -75,11 +75,11 @@ public class markquestions extends BaseModel {
public static class DataBean {
public static final int ITEM_TYPE_HEADER = 0;
public static final int ITEM_TYPE_CONTENT = 1;
public static final int ITEM_TYPE_CONTENT = 1;//已分配
public static final int ITEM_TYPE_BOTTOM = 2;//已被抢
public static final int ITEM_TYPE_CALENDAR = 3;//已进店
public static final int ITEM_TYPE_BEIZHU = 4;//已成交
public static final int ITEM_TYPE_MULTIPLE = 5;//多选
public static final int ITEM_TYPE_MULTIPLE = 5;//已被抢 用type 分两种 type不为1或者2
public static final int ITEM_TYPE_PIC = 6;//6代表上传图片只能上传一张
/**
* ord : 140

View File

@@ -7,6 +7,7 @@ import android.view.ViewGroup;
import com.fenghoo.seven.R;
import com.fenghoo.seven.main.find.adapter.holder.BeizhuViewHolder;
import com.fenghoo.seven.main.find.adapter.holder.BottomViewHolder;
import com.fenghoo.seven.main.find.adapter.holder.BottomViewtwoHolder;
import com.fenghoo.seven.main.find.adapter.holder.CalendarViewHolder;
import com.fenghoo.seven.main.find.adapter.holder.ContentViewHolder;
import com.fenghoo.seven.main.find.adapter.holder.HeaderViewHolder;
@@ -45,12 +46,28 @@ public class FpOrderInfoAdaptertwo extends RecyclerView.Adapter<RecyclerView.Vie
this.data = data;
}
// @Override
// public int getItemViewType(int position) {
// if (position == 0) { // 头部
// return 0;
// } else {
// if(Integer.parseInt(data.get(position - 1).getTravel())==2&&!data.get(position - 1).getType().equals("1")&&!data.get(position - 1).getType().equals("2")){
// return 5;
// }
// return Integer.parseInt(data.get(position - 1).getTravel());
// }
// }
@Override
public int getItemViewType(int position) {
int num;
if (position == 0) { // 头部
return 0;
return num=0;
} else {
return Integer.parseInt(data.get(position - 1).getTravel());
if(Integer.parseInt(data.get(position - 1).getTravel())==2&&!data.get(position - 1).getType().equals("1")&&!data.get(position - 1).getType().equals("2")){
return num=5;
}else {
return num=Integer.parseInt(data.get(position - 1).getTravel());
}
}
}
@@ -67,6 +84,9 @@ public class FpOrderInfoAdaptertwo extends RecyclerView.Adapter<RecyclerView.Vie
return new CalendarViewHolder(mLayoutInflater.inflate(R.layout.dingdan_rv_threetwo, parent, false));
case markquestions.ResultBean.DataBean.ITEM_TYPE_BEIZHU:
return new BeizhuViewHolder(mLayoutInflater.inflate(R.layout.dingdan_rv_four, parent, false));
case markquestions.ResultBean.DataBean.ITEM_TYPE_MULTIPLE:
return new BottomViewtwoHolder(mLayoutInflater.inflate(R.layout.dingdan_five, parent, false));
}
return null;
}

View File

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
android:layout_height="206dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorWhite"
xmlns:android="http://schemas.android.com/apk/res/android">
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#F5F5F5"
/>
<RelativeLayout
android:id="@+id/rl_par_01"
android:layout_width="match_parent"
android:layout_below="@+id/rl_par_00"
android:layout_marginTop="12dp"
android:layout_height="55dp">
<RelativeLayout
android:id="@+id/rl_001"
android:layout_width="130dp"
android:layout_height="55dp">
<View
android:layout_width="@dimen/dimen_1dp"
android:layout_height="10dp"
android:background="#D4D4D4"
android:layout_centerHorizontal="true"
/>
<TextView
android:id="@+id/tv_time_001"
android:layout_width="wrap_content"
android:layout_height="21dp"
android:text="12:47"
android:layout_marginTop="15dp"
android:layout_centerHorizontal="true"
android:textColor="#ff545454"
android:textSize="15sp"
/>
<TextView
android:id="@+id/tv_time_002"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:text="2020-07-01"
android:layout_centerHorizontal="true"
android:layout_below="@+id/tv_time_001"
android:textColor="#ffbfbfbf"
android:textSize="11sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_toRightOf="@+id/rl_001"
android:layout_width="match_parent"
android:layout_height="55dp">
<TextView
android:id="@+id/tv_pl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="品类:"
android:textColor="#ff545454"
android:textSize="13sp"
/>
<TextView
android:id="@+id/tv_pp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tv_pl"
android:layout_marginLeft="10dp"
android:text="品牌:"
android:textColor="#ff545454"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_md"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_pl"
android:text="门店:"
android:textColor="#ff545454"
android:textSize="13sp"
/>
<TextView
android:id="@+id/tv_qdr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_md"
android:text="抢单人:"
android:textColor="#ff545454"
android:textSize="13sp"
/>
</RelativeLayout>
</RelativeLayout>
<com.fenghoo.seven.widget.ItemProView
android:id="@+id/item_my_twitter"
android:layout_below="@+id/rl_par_01"
android:layout_width="300dp"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content"
app:iv_icon_01="@drawable/shape_pro_yuan"
app:iv_icon_02="@drawable/shape_pro_yuan"
app:iv_icon_03="@drawable/shape_pro_yuan"
/>
<RelativeLayout
android:layout_below="@+id/item_my_twitter"
android:layout_width="match_parent"
android:layout_marginTop="20dp"
android:layout_height="60dp">
<RelativeLayout
android:id="@+id/rl_01"
android:layout_width="130dp"
android:layout_height="60dp">
<TextView
android:id="@+id/tv_time_01"
android:layout_width="wrap_content"
android:layout_height="21dp"
android:text="12:47"
android:layout_centerHorizontal="true"
android:textColor="#ff545454"
android:textSize="15sp"
/>
<TextView
android:id="@+id/tv_time_02"
android:layout_width="wrap_content"
android:layout_height="15dp"
android:text="2020-07-01"
android:layout_centerHorizontal="true"
android:layout_below="@+id/tv_time_01"
android:textColor="#ffbfbfbf"
android:textSize="11sp"
/>
</RelativeLayout>
<RelativeLayout
android:layout_toRightOf="@+id/rl_01"
android:layout_width="match_parent"
android:layout_height="60dp">
<TextView
android:id="@+id/tv_fphy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="分配行业:"
android:textColor="#ff545454"
android:textSize="13sp"
/>
<TextView
android:id="@+id/tv_jzjd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tv_fphy"
android:layout_marginLeft="10dp"
android:text="家装阶段:"
android:textColor="#ff545454"
android:textSize="13sp" />
<TextView
android:id="@+id/tv_fpcs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_fphy"
android:text="分配城市:"
android:textColor="#ff545454"
android:textSize="13sp"
/>
<TextView
android:id="@+id/tv_khys"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_fpcs"
android:text="客户预算:"
android:textColor="#ff545454"
android:textSize="13sp"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>