Browse Source

RMS开发功能 商机详情

Arisono 9 years ago
parent
commit
f6430f3c1e
28 changed files with 1456 additions and 17 deletions
  1. 7 4
      WeiChat/src/main/AndroidManifest.xml
  2. 10 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/bean/crm/Business.java
  3. 76 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailInfoActivity.java
  4. 61 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessLessActivity.java
  5. 139 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessSelectCustomerActivity.java
  6. 147 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessTransferActivity.java
  7. 41 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/db/DBManager.java
  8. 2 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/db/DBOpenHelper.java
  9. 34 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/entity/B2BMsg.java
  10. 2 2
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/WorksFragment.java
  11. 9 3
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/Constants.java
  12. 19 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MessageFragment.java
  13. 423 0
      WeiChat/src/main/java/com/xzjmyk/pm/activity/view/SmoothCheckBox.java
  14. BIN
      WeiChat/src/main/res/drawable-hdpi/index.png
  15. BIN
      WeiChat/src/main/res/drawable-hdpi/index_u.png
  16. 13 0
      WeiChat/src/main/res/drawable/shape_btn_nomargin.xml
  17. 1 1
      WeiChat/src/main/res/drawable/shape_line_xuxian.xml
  18. 10 0
      WeiChat/src/main/res/drawable/shape_tv_color.xml
  19. 209 5
      WeiChat/src/main/res/layout/activity_business_detail_info.xml
  20. 58 0
      WeiChat/src/main/res/layout/activity_business_less.xml
  21. 12 0
      WeiChat/src/main/res/layout/activity_business_select_customer.xml
  22. 12 0
      WeiChat/src/main/res/layout/activity_business_transfer.xml
  23. 37 0
      WeiChat/src/main/res/layout/item_business_customer.xml
  24. 25 0
      WeiChat/src/main/res/layout/item_business_transfer.xml
  25. 83 0
      WeiChat/src/main/res/layout/message_header.xml
  26. 10 0
      WeiChat/src/main/res/values/attrs.xml
  27. 9 0
      WeiChat/src/main/res/values/strings.xml
  28. 7 1
      WeiChat/src/main/res/values/styles.xml

+ 7 - 4
WeiChat/src/main/AndroidManifest.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.xzjmyk.pm.activity"
-    android:versionCode="43"
-    android:versionName="4.3" >
+    android:versionCode="44"
+    android:versionName="4.4">
 
     <uses-sdk
         android:minSdkVersion="11"
@@ -418,10 +418,13 @@
         <activity
             android:name=".ui.erp.activity.StatisticsActivity"
             android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
-        <activity android:name=".ui.erp.activity.TextErpActivity"></activity>
+        <activity android:name=".ui.erp.activity.TextErpActivity" />
         <activity android:name=".ui.erp.activity.crm.BusinessActivity" />
         <activity android:name=".ui.erp.activity.crm.BusinessDetailActivty" />
-        <activity android:name=".ui.erp.activity.crm.BusinessDetailInfoActivity"></activity>
+        <activity android:name=".ui.erp.activity.crm.BusinessDetailInfoActivity" />
+        <activity android:name=".ui.erp.activity.crm.BusinessLessActivity"></activity>
+        <activity android:name=".ui.erp.activity.crm.BusinessTransferActivity"></activity>
+        <activity android:name=".ui.erp.activity.crm.BusinessSelectCustomerActivity"></activity>
     </application>
 
 </manifest>

+ 10 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/bean/crm/Business.java

@@ -18,6 +18,8 @@ public class Business {
     private String note;
     private String date;
     private int type;//抢,分配
+    public boolean isChecked;
+
 
     private final int BUSINESS_QIANG = 1;
     private final int BUSINESS_FENPEI = 2;
@@ -93,4 +95,12 @@ public class Business {
     public int getBUSINESS_FENPEI() {
         return BUSINESS_FENPEI;
     }
+
+    public boolean isChecked() {
+        return isChecked;
+    }
+
+    public void setIsChecked(boolean isChecked) {
+        this.isChecked = isChecked;
+    }
 }

+ 76 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessDetailInfoActivity.java

@@ -1,9 +1,18 @@
 package com.xzjmyk.pm.activity.ui.erp.activity.crm;
 
+import android.content.Intent;
 import android.support.v7.app.AppCompatActivity;
 import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
 
+import com.afollestad.materialdialogs.GravityEnum;
+import com.afollestad.materialdialogs.MaterialDialog;
+import com.lidroid.xutils.ViewUtils;
+import com.lidroid.xutils.view.annotation.ViewInject;
 import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.ui.base.BaseActivity;
+import com.xzjmyk.pm.activity.ui.erp.net.ViewUtil;
 
 /**
  * @功能:商机详情
@@ -11,12 +20,78 @@ import com.xzjmyk.pm.activity.R;
  * @param:
  * @return:
  */
-public class BusinessDetailInfoActivity extends AppCompatActivity {
+public class BusinessDetailInfoActivity extends BaseActivity implements View.OnClickListener {
 
+    @ViewInject(R.id.bt_manage_date)
+    private Button bt_manage_date;
+    @ViewInject(R.id.bt_manage_go)
+    private Button bt_manage_go;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_business_detail_info);
+        initView();
+        initData();
+        initListener();
+    }
+
+
+    private void initView() {
+        ViewUtils.inject(this);
+    }
+
+    private void initListener() {
+        bt_manage_date.setOnClickListener(this);
+        bt_manage_go.setOnClickListener(this);
+    }
+
+    private void initData() {
+
+    }
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.bt_manage_go:
+                new MaterialDialog.Builder(this)
+                        .items(R.array.crm_dialog_followup)
+                        .itemsGravity(GravityEnum.CENTER)
+                        .dividerColorRes(R.color.yellow_home)
+                        .backgroundColorRes(R.color.gray)
+                        .itemColorRes(R.color.yellow_home)
+                        .itemsCallback(new MaterialDialog.ListCallback() {
+                            @Override
+                            public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
+//                                showToast(which + ": " + text);
+                                switch (which) {
+                                    case 0:
+                                        ViewUtil.ToastMessage(BusinessDetailInfoActivity.this, text.toString());
+                                        break;
+                                    case 1:
+                                        startActivity(new Intent(BusinessDetailInfoActivity.this, BusinessLessActivity.class).putExtra("type", 1));
+                                        break;
+                                    case 2:
+                                        startActivity(new Intent(BusinessDetailInfoActivity.this, BusinessLessActivity.class).putExtra("type", 2));
+                                        break;
+                                    case 3:
+                                        startActivity(new Intent(BusinessDetailInfoActivity.this, BusinessTransferActivity.class));
+                                        break;
+                                    case 4:
+                                        ViewUtil.ToastMessage(BusinessDetailInfoActivity.this, text.toString());
+                                        break;
+                                    case 5:
+                                        startActivity(new Intent(BusinessDetailInfoActivity.this, BusinessSelectCustomerActivity.class));
+                                        break;
+                                }
+                            }
+                        })
+                        .show().getListView().setDivider(getResources().getDrawable(R.color.yellow_home));
+
+                break;
+            case R.id.bt_manage_date:
+
+                break;
+        }
     }
 }

+ 61 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessLessActivity.java

@@ -0,0 +1,61 @@
+package com.xzjmyk.pm.activity.ui.erp.activity.crm;
+
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.LinearLayout;
+
+import com.lidroid.xutils.ViewUtils;
+import com.lidroid.xutils.view.annotation.ViewInject;
+import com.xzjmyk.pm.activity.R;
+
+/**
+ * @功能:商机失效
+ * @author:Arisono
+ * @param:
+ * @return:
+ */
+public class BusinessLessActivity extends AppCompatActivity {
+    @ViewInject(R.id.ll_moment)
+    private LinearLayout ll_moment;
+    @ViewInject(R.id.ll_leader)
+    private LinearLayout ll_leader;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_business_less);
+        initView();
+        initData();
+        initListener();
+    }
+
+
+    private void initView() {
+        ViewUtils.inject(this);
+    }
+
+    private void initListener() {
+
+    }
+
+    int type = 1;
+
+    private void initData() {
+        Intent intent = getIntent();
+        if (intent != null) {
+            type = intent.getIntExtra("type", 1);
+        }
+        switch (type) {
+            case 1:
+                ll_leader.setVisibility(View.VISIBLE);
+                ll_moment.setVisibility(View.GONE);
+                break;
+            case 2:
+                ll_leader.setVisibility(View.GONE);
+                ll_moment.setVisibility(View.VISIBLE);
+                break;
+        }
+    }
+}

+ 139 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessSelectCustomerActivity.java

@@ -0,0 +1,139 @@
+package com.xzjmyk.pm.activity.ui.erp.activity.crm;
+
+import android.content.Context;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import com.handmark.pulltorefresh.library.PullToRefreshBase;
+import com.handmark.pulltorefresh.library.PullToRefreshListView;
+import com.lidroid.xutils.ViewUtils;
+import com.lidroid.xutils.view.annotation.ViewInject;
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.bean.crm.Business;
+import com.xzjmyk.pm.activity.view.SmoothCheckBox;
+
+import java.util.ArrayList;
+
+public class BusinessSelectCustomerActivity extends AppCompatActivity {
+    private BussinessDetailAdapter mAdapter;
+    @ViewInject(R.id.list_business)
+    private PullToRefreshListView mlist;
+    private ArrayList<Business> mData = new ArrayList<Business>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_business_select_customer);
+        initView();
+        initData();
+        initListener();
+    }
+
+    private void initView() {
+        ViewUtils.inject(this);
+    }
+
+    private void initListener() {
+        mlist.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
+            @Override
+            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
+
+            }
+
+            @Override
+            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
+
+            }
+        });
+        mlist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                Business bean = (Business) parent.getAdapter().getItem(position);
+                bean.isChecked = !bean.isChecked;
+                SmoothCheckBox checkBox = (SmoothCheckBox) view.findViewById(R.id.cb_left);
+                checkBox.setChecked(bean.isChecked, true);
+            }
+        });
+        ;
+    }
+
+    private void initData() {
+        for (int i = 0; i < 22; i++) {
+            Business model = new Business();
+            model.setNum("013223" + i);
+            model.setName("xxx" + i);
+            model.setLeader("****" + i);
+            model.setNote("xxxxxxxxxxxx" + i);
+            model.setPhone("*********" + i);
+            model.setSource("####" + i);
+            mData.add(model);
+        }
+        mAdapter = new BussinessDetailAdapter(this, mData);
+        mlist.setAdapter(mAdapter);
+    }
+
+
+    private class BussinessDetailAdapter extends BaseAdapter {
+        private Context ct;
+        private ArrayList<Business> mdata = new ArrayList<>();
+        private LayoutInflater inflater;
+
+        public BussinessDetailAdapter(Context ct, ArrayList<Business> data) {
+            this.ct = ct;
+            this.mdata = data;
+            this.inflater = LayoutInflater.from(ct);
+        }
+
+        @Override
+        public int getCount() {
+            return mdata.size();
+        }
+
+        @Override
+        public Object getItem(int position) {
+            return mdata.get(position);
+        }
+
+        @Override
+        public long getItemId(int position) {
+            return position;
+        }
+
+        @Override
+        public View getView(final int position, View convertView, ViewGroup parent) {
+            ViewHolder holder = null;
+            if (convertView == null) {
+                convertView = inflater.inflate(R.layout.item_business_customer, null);
+                holder = new ViewHolder();
+                holder.cb_left = (SmoothCheckBox) convertView.findViewById(R.id.cb_left);
+                holder.tv_business_name = (TextView) convertView.findViewById(R.id.tv_business_name);
+                convertView.setTag(holder);
+            } else {
+                holder = (ViewHolder) convertView.getTag();
+            }
+            holder.cb_left.setOnCheckedChangeListener(new SmoothCheckBox.OnCheckedChangeListener() {
+                @Override
+                public void onCheckedChanged(SmoothCheckBox checkBox, boolean isChecked) {
+                    mdata.get(position).setIsChecked(isChecked);
+                }
+            });
+
+            holder.tv_business_name.setText(mdata.get(position).getName());
+            holder.cb_left.setChecked(mdata.get(position).isChecked());
+            return convertView;
+        }
+
+
+        class ViewHolder {
+            SmoothCheckBox cb_left;
+            TextView tv_business_name;
+        }
+    }
+}

+ 147 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/crm/BusinessTransferActivity.java

@@ -0,0 +1,147 @@
+package com.xzjmyk.pm.activity.ui.erp.activity.crm;
+
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import com.handmark.pulltorefresh.library.PullToRefreshBase;
+import com.handmark.pulltorefresh.library.PullToRefreshListView;
+import com.lidroid.xutils.ViewUtils;
+import com.lidroid.xutils.view.annotation.ViewInject;
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.bean.crm.Business;
+import com.xzjmyk.pm.activity.view.SmoothCheckBox;
+
+import java.util.ArrayList;
+
+/**
+ * @功能:商机转移
+ * @author:Arisono
+ * @param:
+ * @return:
+ */
+public class BusinessTransferActivity extends AppCompatActivity {
+
+    private BussinessDetailAdapter mAdapter;
+    @ViewInject(R.id.list_business)
+    private PullToRefreshListView mlist;
+    private ArrayList<Business> mData = new ArrayList<Business>();
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_business_transfer);
+        initView();
+        initData();
+        initListener();
+    }
+
+    private void initView() {
+        ViewUtils.inject(this);
+    }
+
+    private void initListener() {
+        mlist.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
+            @Override
+            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
+
+            }
+
+            @Override
+            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
+
+            }
+        });
+        mlist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                Business bean = (Business) parent.getAdapter().getItem(position);
+                bean.isChecked = !bean.isChecked;
+                SmoothCheckBox checkBox = (SmoothCheckBox) view.findViewById(R.id.cb_left);
+                checkBox.setChecked(bean.isChecked, true);
+            }
+        });
+        ;
+    }
+
+    private void initData() {
+        for (int i = 0; i < 22; i++) {
+            Business model = new Business();
+            model.setNum("013223" + i);
+            model.setName("xxx" + i);
+            model.setLeader("****" + i);
+            model.setNote("xxxxxxxxxxxx" + i);
+            model.setPhone("*********" + i);
+            model.setSource("####" + i);
+            mData.add(model);
+        }
+        mAdapter = new BussinessDetailAdapter(this, mData);
+        mlist.setAdapter(mAdapter);
+    }
+
+    private class BussinessDetailAdapter extends BaseAdapter {
+        private Context ct;
+        private ArrayList<Business> mdata = new ArrayList<>();
+        private LayoutInflater inflater;
+
+        public BussinessDetailAdapter(Context ct, ArrayList<Business> data) {
+            this.ct = ct;
+            this.mdata = data;
+            this.inflater = LayoutInflater.from(ct);
+        }
+
+        @Override
+        public int getCount() {
+            return mdata.size();
+        }
+
+        @Override
+        public Object getItem(int position) {
+            return mdata.get(position);
+        }
+
+        @Override
+        public long getItemId(int position) {
+            return position;
+        }
+
+        @Override
+        public View getView(final int position, View convertView, ViewGroup parent) {
+            ViewHolder holder = null;
+            if (convertView == null) {
+                convertView = inflater.inflate(R.layout.item_business_transfer, null);
+                holder = new ViewHolder();
+                holder.cb_left = (SmoothCheckBox) convertView.findViewById(R.id.cb_left);
+                holder.tv_business_name = (TextView) convertView.findViewById(R.id.tv_business_name);
+                convertView.setTag(holder);
+            } else {
+                holder = (ViewHolder) convertView.getTag();
+            }
+            holder.cb_left.setOnCheckedChangeListener(new SmoothCheckBox.OnCheckedChangeListener() {
+                @Override
+                public void onCheckedChanged(SmoothCheckBox checkBox, boolean isChecked) {
+                    mdata.get(position).setIsChecked(isChecked);
+                }
+            });
+
+            holder.tv_business_name.setText(mdata.get(position).getName());
+            holder.cb_left.setChecked(mdata.get(position).isChecked());
+            return convertView;
+        }
+
+
+        class ViewHolder {
+            SmoothCheckBox cb_left;
+            TextView tv_business_name;
+        }
+    }
+}

+ 41 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/db/DBManager.java

@@ -5,6 +5,7 @@ import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.database.sqlite.SQLiteStatement;
 
+import com.xzjmyk.pm.activity.ui.erp.entity.B2BMsg;
 import com.xzjmyk.pm.activity.ui.erp.entity.EmployeesEntity;
 import com.xzjmyk.pm.activity.ui.erp.entity.Hrorgs;
 import com.xzjmyk.pm.activity.ui.erp.entity.HrorgsEntity;
@@ -26,6 +27,46 @@ public class DBManager {
         db = helper.getWritableDatabase();
     }
 
+    public void saveB2bMsg(B2BMsg entity) {
+        String sql = "replace into B2BMSG"
+                + "(b2b_content,b2b_time,b2b_hasRead)"
+                + " values (?, ?, ?);";
+        SQLiteStatement sta = db.compileStatement(sql);
+        sta.bindString(1, entity.getContent());
+        sta.bindString(2, entity.getTime());
+        sta.bindLong(3, entity.getHasRead());
+        sta.execute();
+    }
+
+    public List<B2BMsg> queryB2bList(String[] selectionArgs, String selection) {
+        List<B2BMsg> entity = new ArrayList<B2BMsg>();
+        String table = "B2BMSG";
+        String groupBy = null;
+        String having = null;
+        String orderBy = null;
+        Cursor cursor = db.query(table, null, selection, selectionArgs, groupBy, having, orderBy);
+        while (cursor.moveToNext()) {
+            B2BMsg model = new B2BMsg();
+            model.setContent(cursor.getString(cursor.getColumnIndex("b2b_content")));
+            model.setHasRead(cursor.getInt(cursor.getColumnIndex("b2b_hasRead")));
+            model.setTime(cursor.getString(cursor.getColumnIndex("b2b_time")));
+            entity.add(model);
+        }
+        cursor.close();
+        return entity;
+
+    }
+
+    public void updateB2b(B2BMsg data) {
+        String sql = "update B2BMSG"
+                + " set b2b_hasRead=?"
+                + " where b2b_content=?;";
+        SQLiteStatement sta = db.compileStatement(sql);
+        sta.bindLong(1, data.getHasRead());
+        sta.bindString(2, data.getContent());
+        sta.executeInsert();
+    }
+
     /**
      * @author Administrator
      * @功能:增加组织架构---批量

+ 2 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/db/DBOpenHelper.java

@@ -32,6 +32,7 @@ public class DBOpenHelper extends SQLiteOpenHelper {
         db.execSQL(Constants.SQL_HRORGS_CREATETABLE);
         db.execSQL(Constants.SQL_EMPLOYEES_CREATETABLE);
         db.execSQL(Constants.SQL_empdate_CREATETABLE);
+        db.execSQL(Constants.SQL_B2B_MSG);
     }
 
     @Override
@@ -39,6 +40,7 @@ public class DBOpenHelper extends SQLiteOpenHelper {
         db.execSQL("DROP TABLE IF EXISTS HRORGS");
         db.execSQL("DROP TABLE IF EXISTS EMPLOYEES");
         db.execSQL("DROP TABLE IF EXISTS empdate");
+        db.execSQL("DROP TABLE IF EXISTS B2BMSG");
         onCreate(db);
     }
 

+ 34 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/entity/B2BMsg.java

@@ -0,0 +1,34 @@
+package com.xzjmyk.pm.activity.ui.erp.entity;
+
+/**
+ * Created by Arisono on 2016/6/28.
+ */
+public class B2BMsg {
+    private String content;
+    private String time;
+    private int hasRead;
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getTime() {
+        return time;
+    }
+
+    public void setTime(String time) {
+        this.time = time;
+    }
+
+    public int getHasRead() {
+        return hasRead;
+    }
+
+    public void setHasRead(int hasRead) {
+        this.hasRead = hasRead;
+    }
+}

+ 2 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/fragment/WorksFragment.java

@@ -99,8 +99,8 @@ public class WorksFragment extends XutilsFragment implements View.OnClickListene
                 //  ct.startActivity(new Intent(ct, OAActivity.class));
                 break;
             case R.id.my_client_rl:
-              /*  ct.startActivity(new Intent(ct, ClientActivity.class));*/
-                ToastUtil.showToast(getActivity(), "抱歉,该功能尚未完善");
+                ct.startActivity(new Intent(ct, ClientActivity.class));
+//                ToastUtil.showToast(getActivity(), "抱歉,该功能尚未完善");
                 break;
             case R.id.my_friend_rl:
                 iv_remain.setVisibility(View.GONE);

+ 9 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/util/Constants.java

@@ -31,7 +31,7 @@ public class Constants {
     public final static int APP_SOCKETIMEOUTEXCEPTION=99;//网络请求超时,错误,404响应
 
 
-    //员工信息
+    //组织架构 员工信息
     public static final String SQL_EMPLOYEES_CREATETABLE = "CREATE TABLE EMPLOYEES "
             + "(id integer primary key autoincrement,"
             + "em_id integer,"
@@ -66,7 +66,7 @@ public class Constants {
             + "or_headmancode varchar(50),"
             + "or_remark integer"+
            ")";
-    //更新时间表
+    //组织架构 更新时间表
     public static final String SQL_empdate_CREATETABLE = "CREATE TABLE empdate "
             + "(id integer primary key autoincrement,"
             + "ed_lastdate varchar(50),"
@@ -74,7 +74,13 @@ public class Constants {
             + "ed_company varchar(50),"
             + "ed_whichsys varchar(50)"
             + ")";
-
+    //b2b消息通知表
+    public static final String SQL_B2B_MSG = "CREATE TABLE B2BMSG "
+            + "(id integer primary key autoincrement,"
+            + "b2b_content varchar(50),"
+            + "b2b_time varchar(50),"
+            + "b2b_hasRead integer"
+            + ")";
 
     /**
      * 检测网络是否可用

+ 19 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MessageFragment.java

@@ -15,6 +15,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ImageView;
+import android.widget.RelativeLayout;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
@@ -252,6 +253,8 @@ public class MessageFragment extends EasyFragment {
     private TextView task_num_tv, task_content_tv, task_time_tv;
     private TextView notice_num_tv, notice_content_tv, notice_time_tv;
     private TextView num_tv, content_tv, time_tv;
+    private TextView b2b_num_tv, b2b_content_tv, b2b_time_tv;
+    private RelativeLayout rl_b2b;
 
     private View getHeaderView() {
         View view = LayoutInflater.from(mActivity).inflate(R.layout.message_header, null);
@@ -271,6 +274,12 @@ public class MessageFragment extends EasyFragment {
         content_tv = (TextView) view.findViewById(R.id.content_tv);
         time_tv = (TextView) view.findViewById(R.id.time_tv);
 
+        b2b_num_tv = (TextView) view.findViewById(R.id.b2b_num_tv);
+        b2b_content_tv = (TextView) view.findViewById(R.id.b2b_content_tv);
+        b2b_time_tv = (TextView) view.findViewById(R.id.b2b_time_tv);
+
+        rl_b2b = (RelativeLayout) view.findViewById(R.id.rl_b2b_business);
+
         view.findViewById(R.id.schedule_rl).setOnClickListener(listener);
         view.findViewById(R.id.task_rl).setOnClickListener(listener);
         view.findViewById(R.id.notice_rl).setOnClickListener(listener);
@@ -651,6 +660,16 @@ public class MessageFragment extends EasyFragment {
         ViewUtil.httpSendRequest(ct, url, param, handler, headers, Constants.SUCCESS_INITDATA, null, null, "get");
     }
 
+    /**
+     * @功能:加载商务信息-本地数据库
+     * @author:Arisono
+     * @param:
+     * @return:
+     */
+    public void loadB2bMessageNum() {
+        //erp数据库中取数据
+    }
+
 
     private final int load_success_erpMsgNum = 5;
     private Handler handler = new Handler() {

+ 423 - 0
WeiChat/src/main/java/com/xzjmyk/pm/activity/view/SmoothCheckBox.java

@@ -0,0 +1,423 @@
+/**
+ * * Copyright 2016 andy
+ * <p/>
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.xzjmyk.pm.activity.view;
+
+import android.animation.ValueAnimator;
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.graphics.Point;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.animation.LinearInterpolator;
+import android.widget.Checkable;
+
+import com.xzjmyk.pm.activity.R;
+import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
+
+/**
+ * Author : andy
+ * Date   : 16/1/21 11:28
+ * Email  : andyxialm@gmail.com
+ * Github : github.com/andyxialm
+ * Description : A custom CheckBox with animation for Android
+ */
+
+public class SmoothCheckBox extends View implements Checkable {
+    private static final String KEY_INSTANCE_STATE = "InstanceState";
+
+    private static final int COLOR_TICK = Color.WHITE;
+    private static final int COLOR_UNCHECKED = Color.WHITE;
+    private static final int COLOR_CHECKED = Color.parseColor("#FB4846");
+    private static final int COLOR_FLOOR_UNCHECKED = Color.parseColor("#DFDFDF");
+
+    private static final int DEF_DRAW_SIZE = 25;
+    private static final int DEF_ANIM_DURATION = 300;
+
+    private Paint mPaint, mTickPaint, mFloorPaint;
+    private Point[] mTickPoints;
+    private Point mCenterPoint;
+    private Path mTickPath;
+
+    private float mLeftLineDistance, mRightLineDistance, mDrewDistance;
+    private float mScaleVal = 1.0f, mFloorScale = 1.0f;
+    private int mWidth, mAnimDuration, mStrokeWidth;
+    private int mCheckedColor, mUnCheckedColor, mFloorColor, mFloorUnCheckedColor;
+
+    private boolean mChecked;
+    private boolean mTickDrawing;
+    private OnCheckedChangeListener mListener;
+
+    public SmoothCheckBox(Context context) {
+        this(context, null);
+    }
+
+    public SmoothCheckBox(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public SmoothCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init(attrs);
+    }
+
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+    public SmoothCheckBox(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+        init(attrs);
+    }
+
+    private void init(AttributeSet attrs) {
+
+        TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.SmoothCheckBox);
+        int tickColor = ta.getColor(R.styleable.SmoothCheckBox_color_tick, COLOR_TICK);
+        mAnimDuration = ta.getInt(R.styleable.SmoothCheckBox_duration, DEF_ANIM_DURATION);
+        mFloorColor = ta.getColor(R.styleable.SmoothCheckBox_color_unchecked_stroke, COLOR_FLOOR_UNCHECKED);
+        mCheckedColor = ta.getColor(R.styleable.SmoothCheckBox_color_checked, COLOR_CHECKED);
+        mUnCheckedColor = ta.getColor(R.styleable.SmoothCheckBox_color_unchecked, COLOR_UNCHECKED);
+        mStrokeWidth = ta.getDimensionPixelSize(R.styleable.SmoothCheckBox_stroke_width, CommonUtil.convertDip2Px(getContext(), 0));
+        ta.recycle();
+
+        mFloorUnCheckedColor = mFloorColor;
+        mTickPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+        mTickPaint.setStyle(Paint.Style.STROKE);
+        mTickPaint.setStrokeCap(Paint.Cap.ROUND);
+        mTickPaint.setColor(tickColor);
+
+        mFloorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+        mFloorPaint.setStyle(Paint.Style.FILL);
+        mFloorPaint.setColor(mFloorColor);
+
+        mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+        mPaint.setStyle(Paint.Style.FILL);
+        mPaint.setColor(mCheckedColor);
+
+        mTickPath = new Path();
+        mCenterPoint = new Point();
+        mTickPoints = new Point[3];
+        mTickPoints[0] = new Point();
+        mTickPoints[1] = new Point();
+        mTickPoints[2] = new Point();
+
+        setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                toggle();
+                mTickDrawing = false;
+                mDrewDistance = 0;
+                if (isChecked()) {
+                    startCheckedAnimation();
+                } else {
+                    startUnCheckedAnimation();
+                }
+            }
+        });
+    }
+
+    @Override
+    protected Parcelable onSaveInstanceState() {
+        Bundle bundle = new Bundle();
+        bundle.putParcelable(KEY_INSTANCE_STATE, super.onSaveInstanceState());
+        bundle.putBoolean(KEY_INSTANCE_STATE, isChecked());
+        return bundle;
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Parcelable state) {
+        if (state instanceof Bundle) {
+            Bundle bundle = (Bundle) state;
+            boolean isChecked = bundle.getBoolean(KEY_INSTANCE_STATE);
+            setChecked(isChecked);
+            super.onRestoreInstanceState(bundle.getParcelable(KEY_INSTANCE_STATE));
+            return;
+        }
+        super.onRestoreInstanceState(state);
+    }
+
+    @Override
+    public boolean isChecked() {
+        return mChecked;
+    }
+
+    @Override
+    public void toggle() {
+        this.setChecked(!isChecked());
+    }
+
+    @Override
+    public void setChecked(boolean checked) {
+        mChecked = checked;
+        reset();
+        invalidate();
+        if (mListener != null) {
+            mListener.onCheckedChanged(SmoothCheckBox.this, mChecked);
+        }
+    }
+
+    /**
+     * checked with animation
+     * @param checked checked
+     * @param animate change with animation
+     */
+    public void setChecked(boolean checked, boolean animate) {
+        if (animate) {
+            mTickDrawing = false;
+            mChecked = checked;
+            mDrewDistance = 0f;
+            if (checked) {
+                startCheckedAnimation();
+            } else {
+                startUnCheckedAnimation();
+            }
+            if (mListener != null) {
+                mListener.onCheckedChanged(SmoothCheckBox.this, mChecked);
+            }
+
+        } else {
+            this.setChecked(checked);
+        }
+    }
+
+    private void reset() {
+        mTickDrawing = true;
+        mFloorScale = 1.0f;
+        mScaleVal = isChecked() ? 0f : 1.0f;
+        mFloorColor = isChecked() ? mCheckedColor : mFloorUnCheckedColor;
+        mDrewDistance = isChecked() ? (mLeftLineDistance + mRightLineDistance) : 0;
+    }
+
+    private int measureSize(int measureSpec) {
+        int defSize = CommonUtil.convertDip2Px(getContext(), DEF_DRAW_SIZE);
+        int specSize = MeasureSpec.getSize(measureSpec);
+        int specMode = MeasureSpec.getMode(measureSpec);
+
+        int result = 0;
+        switch (specMode) {
+            case MeasureSpec.UNSPECIFIED:
+            case MeasureSpec.AT_MOST:
+                result = Math.min(defSize, specSize);
+                break;
+            case MeasureSpec.EXACTLY:
+                result = specSize;
+                break;
+        }
+        return result;
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        setMeasuredDimension(measureSize(widthMeasureSpec), measureSize(heightMeasureSpec));
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+        mWidth = getMeasuredWidth();
+        mStrokeWidth = (mStrokeWidth == 0 ? getMeasuredWidth() / 10 : mStrokeWidth);
+        mStrokeWidth = mStrokeWidth > getMeasuredWidth() / 5 ? getMeasuredWidth() / 5 : mStrokeWidth;
+        mStrokeWidth = (mStrokeWidth < 3) ? 3 : mStrokeWidth;
+        mCenterPoint.x = mWidth / 2;
+        mCenterPoint.y = getMeasuredHeight() / 2;
+
+        mTickPoints[0].x = Math.round((float) getMeasuredWidth() / 30 * 7);
+        mTickPoints[0].y = Math.round((float) getMeasuredHeight() / 30 * 14);
+        mTickPoints[1].x = Math.round((float) getMeasuredWidth() / 30 * 13);
+        mTickPoints[1].y = Math.round((float) getMeasuredHeight() / 30 * 20);
+        mTickPoints[2].x = Math.round((float) getMeasuredWidth() / 30 * 22);
+        mTickPoints[2].y = Math.round((float) getMeasuredHeight() / 30 * 10);
+
+        mLeftLineDistance = (float) Math.sqrt(Math.pow(mTickPoints[1].x - mTickPoints[0].x, 2) +
+                Math.pow(mTickPoints[1].y - mTickPoints[0].y, 2));
+        mRightLineDistance = (float) Math.sqrt(Math.pow(mTickPoints[2].x - mTickPoints[1].x, 2) +
+                Math.pow(mTickPoints[2].y - mTickPoints[1].y, 2));
+        mTickPaint.setStrokeWidth(mStrokeWidth);
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        drawBorder(canvas);
+        drawCenter(canvas);
+        drawTick(canvas);
+    }
+
+    private void drawCenter(Canvas canvas) {
+        mPaint.setColor(mUnCheckedColor);
+        float radius = (mCenterPoint.x - mStrokeWidth) * mScaleVal;
+        canvas.drawCircle(mCenterPoint.x, mCenterPoint.y, radius, mPaint);
+    }
+
+    private void drawBorder(Canvas canvas) {
+        mFloorPaint.setColor(mFloorColor);
+        int radius = mCenterPoint.x;
+        canvas.drawCircle(mCenterPoint.x, mCenterPoint.y, radius * mFloorScale, mFloorPaint);
+    }
+
+    private void drawTick(Canvas canvas) {
+        if (mTickDrawing && isChecked()) {
+            drawTickPath(canvas);
+        }
+    }
+
+    private void drawTickPath(Canvas canvas) {
+        mTickPath.reset();
+        // draw left of the tick
+        if (mDrewDistance < mLeftLineDistance) {
+            float step = (mWidth / 20.0f) < 3 ? 3 : (mWidth / 20.0f);
+            mDrewDistance += step;
+            float stopX = mTickPoints[0].x + (mTickPoints[1].x - mTickPoints[0].x) * mDrewDistance / mLeftLineDistance;
+            float stopY = mTickPoints[0].y + (mTickPoints[1].y - mTickPoints[0].y) * mDrewDistance / mLeftLineDistance;
+
+            mTickPath.moveTo(mTickPoints[0].x, mTickPoints[0].y);
+            mTickPath.lineTo(stopX, stopY);
+            canvas.drawPath(mTickPath, mTickPaint);
+
+            if (mDrewDistance > mLeftLineDistance) {
+                mDrewDistance = mLeftLineDistance;
+            }
+        } else {
+
+            mTickPath.moveTo(mTickPoints[0].x, mTickPoints[0].y);
+            mTickPath.lineTo(mTickPoints[1].x, mTickPoints[1].y);
+            canvas.drawPath(mTickPath, mTickPaint);
+
+            // draw right of the tick
+            if (mDrewDistance < mLeftLineDistance + mRightLineDistance) {
+                float stopX = mTickPoints[1].x + (mTickPoints[2].x - mTickPoints[1].x) * (mDrewDistance - mLeftLineDistance) / mRightLineDistance;
+                float stopY = mTickPoints[1].y - (mTickPoints[1].y - mTickPoints[2].y) * (mDrewDistance - mLeftLineDistance) / mRightLineDistance;
+
+                mTickPath.reset();
+                mTickPath.moveTo(mTickPoints[1].x, mTickPoints[1].y);
+                mTickPath.lineTo(stopX, stopY);
+                canvas.drawPath(mTickPath, mTickPaint);
+
+                float step = (mWidth / 20) < 3 ? 3 : (mWidth / 20);
+                mDrewDistance += step;
+            } else {
+                mTickPath.reset();
+                mTickPath.moveTo(mTickPoints[1].x, mTickPoints[1].y);
+                mTickPath.lineTo(mTickPoints[2].x, mTickPoints[2].y);
+                canvas.drawPath(mTickPath, mTickPaint);
+            }
+        }
+
+        // invalidate
+        if (mDrewDistance < mLeftLineDistance + mRightLineDistance) {
+            postDelayed(new Runnable() {
+                @Override
+                public void run() {
+                    postInvalidate();
+                }
+            }, 10);
+        }
+    }
+
+    private void startCheckedAnimation() {
+        ValueAnimator animator = ValueAnimator.ofFloat(1.0f, 0f);
+        animator.setDuration(mAnimDuration / 3 * 2);
+        animator.setInterpolator(new LinearInterpolator());
+        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                mScaleVal = (float) animation.getAnimatedValue();
+                mFloorColor = getGradientColor(mUnCheckedColor, mCheckedColor, 1 - mScaleVal);
+                postInvalidate();
+            }
+        });
+        animator.start();
+
+        ValueAnimator floorAnimator = ValueAnimator.ofFloat(1.0f, 0.8f, 1.0f);
+        floorAnimator.setDuration(mAnimDuration);
+        floorAnimator.setInterpolator(new LinearInterpolator());
+        floorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                mFloorScale = (float) animation.getAnimatedValue();
+                postInvalidate();
+            }
+        });
+        floorAnimator.start();
+
+        drawTickDelayed();
+    }
+
+    private void startUnCheckedAnimation() {
+        ValueAnimator animator = ValueAnimator.ofFloat(0f, 1.0f);
+        animator.setDuration(mAnimDuration);
+        animator.setInterpolator(new LinearInterpolator());
+        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                mScaleVal = (float) animation.getAnimatedValue();
+                mFloorColor = getGradientColor(mCheckedColor, mFloorUnCheckedColor, mScaleVal);
+                postInvalidate();
+            }
+        });
+        animator.start();
+
+        ValueAnimator floorAnimator = ValueAnimator.ofFloat(1.0f, 0.8f, 1.0f);
+        floorAnimator.setDuration(mAnimDuration);
+        floorAnimator.setInterpolator(new LinearInterpolator());
+        floorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                mFloorScale = (float) animation.getAnimatedValue();
+                postInvalidate();
+            }
+        });
+        floorAnimator.start();
+    }
+
+    private void drawTickDelayed() {
+        postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                mTickDrawing = true;
+                postInvalidate();
+            }
+        }, mAnimDuration);
+    }
+
+    private static int getGradientColor(int startColor, int endColor, float percent) {
+        int sr = (startColor & 0xff0000) >> 0x10;
+        int sg = (startColor & 0xff00) >> 0x8;
+        int sb = (startColor & 0xff);
+
+        int er = (endColor & 0xff0000) >> 0x10;
+        int eg = (endColor & 0xff00) >> 0x8;
+        int eb = (endColor & 0xff);
+
+        int cr = (int) (sr * (1 - percent) + er * percent);
+        int cg = (int) (sg * (1 - percent) + eg * percent);
+        int cb = (int) (sb * (1 - percent) + eb * percent);
+        return Color.argb(0xff, cr, cg, cb);
+    }
+
+    public void setOnCheckedChangeListener(OnCheckedChangeListener l) {
+        this.mListener = l;
+    }
+
+    public interface OnCheckedChangeListener {
+        void onCheckedChanged(SmoothCheckBox checkBox, boolean isChecked);
+    }
+}

BIN
WeiChat/src/main/res/drawable-hdpi/index.png


BIN
WeiChat/src/main/res/drawable-hdpi/index_u.png


+ 13 - 0
WeiChat/src/main/res/drawable/shape_btn_nomargin.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners
+        android:topLeftRadius="0dp"
+        android:topRightRadius="0dp"
+        android:bottomRightRadius="0dp"
+        android:bottomLeftRadius="0dp"></corners>
+    <stroke
+        android:width="1dp"
+        android:color="#e3e3e3"></stroke>
+    <solid android:color="#ffffff"></solid>
+</shape>

+ 1 - 1
WeiChat/src/main/res/drawable/shape_line_xuxian.xml

@@ -5,7 +5,7 @@
         android:dashGap="6px"
         android:dashWidth="6px"
         android:width="3dp"
-        android:color="#38943f"></stroke>
+        android:color="@color/wheat"></stroke>
     <!-- 虚线的高度 -->
     <size android:height="1dp" />
 </shape>

+ 10 - 0
WeiChat/src/main/res/drawable/shape_tv_color.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners
+        android:topLeftRadius="0dp"
+        android:topRightRadius="0dp"
+        android:bottomRightRadius="0dp"
+        android:bottomLeftRadius="0dp"></corners>
+    <solid android:color="#ff8000"></solid>
+</shape>

+ 209 - 5
WeiChat/src/main/res/layout/activity_business_detail_info.xml

@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<com.xzjmyk.pm.activity.ui.erp.view.CustomerScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<?xml version="1.0" encoding="utf-8"?><!--    com.xzjmyk.pm.activity.ui.erp.view.CustomerScrollView-->
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -29,6 +29,7 @@
             <ImageView
                 android:layout_width="50dp"
                 android:layout_height="50dp"
+                android:layout_marginTop="20dp"
                 android:layout_gravity="center_horizontal"
                 android:background="@drawable/shape_crm_round" />
 
@@ -58,6 +59,7 @@
             <ImageView
                 android:layout_width="50dp"
                 android:layout_height="50dp"
+                android:layout_marginTop="20dp"
                 android:layout_gravity="center_horizontal"
                 android:background="@drawable/shape_crm_round" />
 
@@ -86,6 +88,7 @@
             <ImageView
                 android:layout_width="50dp"
                 android:layout_height="50dp"
+                android:layout_marginTop="20dp"
                 android:layout_gravity="center_horizontal"
                 android:background="@drawable/shape_crm_round" />
 
@@ -99,8 +102,209 @@
 
     </RelativeLayout>
 
-        <LinearLayout style="@style/crm_ll_card"></LinearLayout>
+        <LinearLayout
+            style="@style/crm_ll_card"
+            android:layout_height="wrap_content">
+
+            <LinearLayout style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:layout_width="10dp"
+                    android:layout_height="15dp"
+                    android:layout_gravity="center_vertical"
+                    android:background="@drawable/shape_tv_color"
+                    android:textColor="#FF8E57" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:textSize="15sp"
+                    android:textColor="#FF8E57"
+                    android:text="基本信息" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="来源"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="会议销售"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="联系方式"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="158********"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="备注"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="行业交流大会,****************************************"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            style="@style/crm_ll_card"
+            android:layout_height="wrap_content">
+
+            <LinearLayout style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:layout_width="10dp"
+                    android:layout_height="15dp"
+                    android:layout_gravity="center_vertical"
+                    android:background="@drawable/shape_tv_color"
+                    android:textColor="#FF8E57" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="10dp"
+                    android:textSize="15sp"
+                    android:textColor="#FF8E57"
+                    android:text="其它" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="状态"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
 
-        <LinearLayout style="@style/crm_ll_card"></LinearLayout>
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="已分配"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="商机库"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="深圳商机库"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="创建人"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="***"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="创建时间"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="2016-06-27 14:43"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_margin="10dp"
+                style="@style/LinearLayout_horizontal">
+
+                <TextView
+                    android:text="最后变化时间"
+                    android:textColor="@color/gray_light"
+                    android:layout_marginLeft="10dp"
+                    android:layout_width="70dp"
+                    style="@style/TextView_VerticalCenter" />
+
+                <TextView
+                    android:layout_marginLeft="5dp"
+                    android:text="2016-06-27 14:43"
+                    style="@style/TextView_VerticalCenter" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            style="@style/crm_ll_card"
+            android:layout_height="wrap_content">
+
+            <LinearLayout
+                style="@style/LinearLayout_horizontal"
+                android:weightSum="2">
+
+                <Button
+                    android:id="@+id/bt_manage_date"
+                    android:layout_weight="1"
+                    android:text="添加日程"
+                    style="@style/crm_business_btn_nomargin" />
+
+                <Button
+                    android:id="@+id/bt_manage_go"
+                    android:layout_weight="1"
+                    android:text="跟进"
+                    style="@style/crm_business_btn_nomargin" />
+            </LinearLayout>
+        </LinearLayout>
     </LinearLayout>
-</com.xzjmyk.pm.activity.ui.erp.view.CustomerScrollView>
+
+</ScrollView>

+ 58 - 0
WeiChat/src/main/res/layout/activity_business_less.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    style="@style/crm_ll_card"
+    android:layout_height="wrap_content"
+    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.crm.BusinessLessActivity">
+
+    <TextView
+        android:text="处理结果:"
+        android:layout_margin="10dp"
+        style="@style/TextView_Basic"></TextView>
+
+    <EditText
+        android:layout_width="match_parent"
+        android:layout_height="120dp"
+        android:layout_marginLeft="10dp"
+        android:layout_marginRight="10dp"
+        android:background="@drawable/shape_from_edit" />
+
+    <LinearLayout
+        android:id="@+id/ll_leader"
+        style="@style/LinearLayout_horizontal">
+
+        <TextView
+            android:text="直属领导:"
+            android:layout_margin="10dp"
+            style="@style/TextView_Basic" />
+    </LinearLayout>
+
+    <LinearLayout style="@style/LinearLayout_horizontal">
+
+        <TextView
+            android:text="处理时间:"
+            android:layout_margin="10dp"
+            style="@style/TextView_Basic" />
+
+        <TextView
+            android:text="2016年06月28日 11:23"
+            android:layout_margin="10dp"
+            style="@style/TextView_Basic" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/ll_moment"
+        style="@style/LinearLayout_horizontal">
+
+        <TextView
+            android:text="商机阶段:"
+            android:layout_margin="10dp"
+            style="@style/TextView_Basic" />
+
+        <TextView
+            android:text="未分配"
+            android:layout_margin="10dp"
+            style="@style/TextView_Basic" />
+    </LinearLayout>
+</LinearLayout>
+

+ 12 - 0
WeiChat/src/main/res/layout/activity_business_select_customer.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.crm.BusinessSelectCustomerActivity">
+
+    <com.handmark.pulltorefresh.library.PullToRefreshListView
+        android:id="@+id/list_business"
+        android:dividerHeight="5dp"
+        style="@style/ListViewBasic"></com.handmark.pulltorefresh.library.PullToRefreshListView>
+</RelativeLayout>

+ 12 - 0
WeiChat/src/main/res/layout/activity_business_transfer.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="com.xzjmyk.pm.activity.ui.erp.activity.crm.BusinessTransferActivity">
+
+    <com.handmark.pulltorefresh.library.PullToRefreshListView
+        android:id="@+id/list_business"
+        android:dividerHeight="5dp"
+        style="@style/ListViewBasic"></com.handmark.pulltorefresh.library.PullToRefreshListView>
+</RelativeLayout>

+ 37 - 0
WeiChat/src/main/res/layout/item_business_customer.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="horizontal"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    style="@style/crm_ll_card"
+    android:layout_height="wrap_content">
+
+    <com.xzjmyk.pm.activity.view.SmoothCheckBox
+        android:id="@+id/cb_left"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        android:layout_gravity="center_vertical|left"
+        android:layout_margin="5dp"
+        app:color_checked="#149A45" />
+
+    <LinearLayout style="@style/LinearLayout_vertical">
+
+        <TextView
+            android:id="@+id/tv_business_name"
+            android:layout_marginLeft="10dp"
+            android:textSize="20sp"
+            android:textColor="@color/black"
+            android:text="xxxx商机库"
+            style="@style/TextView_VerticalCenter" />
+
+        <TextView
+            android:id="@+id/tv_business_leader"
+            android:layout_marginLeft="10dp"
+            android:text="负责人:胡大大"
+            style="@style/TextView_VerticalCenter" />
+    </LinearLayout>
+
+</LinearLayout>

+ 25 - 0
WeiChat/src/main/res/layout/item_business_transfer.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="horizontal"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    style="@style/crm_ll_card"
+    android:layout_height="wrap_content">
+
+    <com.xzjmyk.pm.activity.view.SmoothCheckBox
+        android:id="@+id/cb_left"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        android:layout_gravity="center_vertical|left"
+        android:layout_margin="5dp"
+        app:color_checked="#149A45" />
+
+    <TextView
+        android:id="@+id/tv_business_name"
+        android:layout_marginLeft="10dp"
+        android:text="xxxx商机库"
+        style="@style/TextView_VerticalCenter" />
+</LinearLayout>

+ 83 - 0
WeiChat/src/main/res/layout/message_header.xml

@@ -332,4 +332,87 @@
         </RelativeLayout>
 
     </RelativeLayout>
+
+
+    <RelativeLayout
+        android:id="@+id/rl_b2b_business"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/item_height"
+        android:background="@color/item_color2"
+        android:descendantFocusability="blocksDescendants"
+        android:minHeight="@dimen/item_height"
+        android:paddingLeft="15dp"
+        android:paddingRight="15dp">
+        <!--android:background="@color/item_color1"-->
+        <FrameLayout
+            android:id="@+id/b2b_head_area"
+            android:layout_width="57dp"
+            android:layout_height="64dp"
+            android:layout_centerVertical="true">
+
+            <ImageView
+                android:id="@+id/b2b_avatar_img"
+                android:layout_width="@dimen/item_img_height"
+                android:layout_height="@dimen/item_img_width"
+                android:layout_gravity="center_vertical"
+                android:background="@color/transparent"
+                android:contentDescription="@string/app_name"
+                android:padding="1dp"
+                android:src="@drawable/tingyue" />
+
+            <TextView
+                android:id="@+id/b2b_num_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="top|right"
+                android:background="@drawable/tab_unread_bg"
+                android:gravity="center"
+                android:textColor="@android:color/white"
+                android:textSize="10.0dip"
+                android:visibility="gone" />
+        </FrameLayout>
+
+        <RelativeLayout
+            android:id="@+id/b2b_content"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="3dp"
+            android:layout_toRightOf="@id/b2b_head_area"
+            android:gravity="center_vertical">
+
+            <TextView
+                android:id="@+id/b2b_nick_name_tv"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_toLeftOf="@+id/b2b_time_tv"
+                android:ellipsize="end"
+                android:singleLine="true"
+                android:text="我的商务"
+                android:textColor="@color/text_main"
+                android:textSize="16sp" />
+
+            <TextView
+                android:id="@+id/b2b_time_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignParentRight="true"
+                android:ellipsize="end"
+                android:singleLine="true"
+                android:textColor="@color/text_hine"
+                android:textSize="14sp" />
+
+            <TextView
+                android:id="@+id/b2b_content_tv"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/b2b_nick_name_tv"
+                android:layout_marginTop="8dp"
+                android:ellipsize="end"
+                android:singleLine="true"
+                android:textColor="@color/text_hine"
+                android:textSize="14sp" />
+        </RelativeLayout>
+
+    </RelativeLayout>
 </LinearLayout>

+ 10 - 0
WeiChat/src/main/res/values/attrs.xml

@@ -81,4 +81,14 @@
         <attr name="numOfDays" format="integer" />
     </declare-styleable>
     <!--end gongpengming-->
+
+    <!--SmoothCheckBox-->
+    <declare-styleable name="SmoothCheckBox">
+        <attr name="duration" format="integer" />
+        <attr name="stroke_width" format="dimension" />
+        <attr name="color_tick" format="color" />
+        <attr name="color_checked" format="color" />
+        <attr name="color_unchecked" format="color" />
+        <attr name="color_unchecked_stroke" format="color" />
+    </declare-styleable>
 </resources>

+ 9 - 0
WeiChat/src/main/res/values/strings.xml

@@ -1,5 +1,14 @@
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
 
+    <string-array name="crm_dialog_followup">
+        <item>商机释放</item>
+        <item>商机失效</item>
+        <item>继续跟进</item>
+        <item>转移</item>
+        <item>转为预录入客户</item>
+        <item>转为已有客户</item>
+    </string-array>
+
     <string name="crm_sale_num">****元  (第**名)</string>
 
 

+ 7 - 1
WeiChat/src/main/res/values/styles.xml

@@ -642,10 +642,16 @@
         <item name="android:layout_weight">1</item>
         <item name="android:padding">10dp</item>
         <item name="android:layout_margin">5dp</item>
-
         <item name="android:background">@drawable/shape_btn_bussine</item>
     </style>
 
+    <style name="crm_business_btn_nomargin">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:layout_weight">1</item>
+        <item name="android:padding">10dp</item>
+        <item name="android:background">@drawable/shape_btn_nomargin</item>
+    </style>
 
     <style name="crm_business_btn_single">
         <item name="android:layout_width">wrap_content</item>