Explorar o código

Merge branch 'developer' of https://gitlab.com/Arisono/SkWeiChat-Baidu into feature

Arison %!s(int64=7) %!d(string=hai) anos
pai
achega
026404bfc9

+ 8 - 2
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java

@@ -610,7 +610,6 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
             restoreState(savedInstanceState);
         }
         initView(savedInstanceState);//---
-        getScheduleList();
         // 注册网络改变回调
         MyApplication.getInstance().registerNetWorkObserver(this);
         //更新版本已升级到最新版本
@@ -645,6 +644,7 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
                 mUserCheckHander.sendEmptyMessageDelayed(MSG_USER_CHECK, mRetryCheckDelay);
             }
         }
+        getScheduleList();
         mBind = bindService(CoreService.getIntent(), mServiceConnection, BIND_AUTO_CREATE);
 
         screenListener = new ScreenListener(this);
@@ -853,6 +853,8 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
                             try {
                                 analysisSchedule(o.toString());
                             } catch (Exception e) {
+                                clearBackgroundAlpha();
+                                CommonUtil.setSharedPreferences(mContext, com.core.app.Constants.CACHE.OBTAIN_SCHEDULE_DATE, 0);
                                 Log.e("mainschedule", e.toString());
                             }
                         }
@@ -921,8 +923,12 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
                 cal.set(Calendar.MILLISECOND, 0);
                 long startcal = cal.getTimeInMillis();
                 long endcal = cal.getTimeInMillis() + 24 * 60 * 60 * 1000;
-                List<Schedule> systemSchedule = ScheduleUtils.getSystemCalendar(MyApplication.getInstance(), startcal, endcal);
+                List<Schedule> systemSchedule =null;
+                try{
+                    ScheduleUtils.getSystemCalendar(MyApplication.getInstance(), startcal, endcal);
+                }catch (Exception e){
 
+                }
                 for (int i = 0; i < dataArray.size(); i++) {
                     JSONObject dataObject = dataArray.getJSONObject(i);
                     if (dataObject != null) {

+ 53 - 53
app_core/common/src/main/res/layout/activity_client.xml

@@ -115,61 +115,10 @@
             android:layout_height="match_parent"
             android:orientation="vertical">
 
-            <LinearLayout
-                style="@style/crm_ll_card"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="0dp"
-                android:layout_marginRight="0dp"
-                android:layout_marginTop="10dp">
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal"
-                    android:padding="10dp">
-
-                    <ImageView
-                        android:layout_width="56dp"
-                        android:layout_height="56dp"
-                        android:layout_marginLeft="10dp"
-                        android:src="@drawable/ic_sell_honor" />
-
-                    <TextView
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:padding="5dp"
-                        android:text="@string/Wall_of_Fame_description"
-                        android:textColor="#FF666666"
-                        android:textSize="12sp" />
-                </LinearLayout>
-
-                <FrameLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content">
-
-                    <android.support.v7.widget.RecyclerView
-                        android:id="@+id/client_sell_honor_rv"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content" />
-
-                    <TextView
-                        android:id="@+id/client_sell_honor_empty_tv"
-                        android:layout_width="match_parent"
-                        android:layout_height="200dp"
-                        android:background="@color/white"
-                        android:gravity="center"
-                        android:textSize="12sp"
-                        android:text="暂时没有数据"
-                        android:visibility="gone" />
-                </FrameLayout>
-
-            </LinearLayout>
-
             <!--我的排名-->
             <LinearLayout
                 style="@style/crm_ll_card"
-                android:layout_margin="0dp"
-                android:visibility="gone">
+                android:layout_margin="0dp">
 
                 <RelativeLayout
                     android:layout_width="match_parent"
@@ -987,7 +936,8 @@
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="0dp"
                 android:layout_marginRight="0dp"
-                android:layout_marginTop="10dp">
+                android:layout_marginTop="10dp"
+                android:visibility="gone">
 
                 <RelativeLayout
                     android:layout_width="match_parent"
@@ -1126,6 +1076,56 @@
 
             </LinearLayout>
 
+            <LinearLayout
+                style="@style/crm_ll_card"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="0dp"
+                android:layout_marginRight="0dp"
+                android:layout_marginTop="10dp">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+                    android:padding="10dp">
+
+                    <ImageView
+                        android:layout_width="56dp"
+                        android:layout_height="56dp"
+                        android:layout_marginLeft="10dp"
+                        android:src="@drawable/ic_sell_honor" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:padding="5dp"
+                        android:text="@string/Wall_of_Fame_description"
+                        android:textColor="#FF666666"
+                        android:textSize="12sp" />
+                </LinearLayout>
+
+                <FrameLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+
+                    <android.support.v7.widget.RecyclerView
+                        android:id="@+id/client_sell_honor_rv"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content" />
+
+                    <TextView
+                        android:id="@+id/client_sell_honor_empty_tv"
+                        android:layout_width="match_parent"
+                        android:layout_height="200dp"
+                        android:background="@color/white"
+                        android:gravity="center"
+                        android:text="暂时没有数据"
+                        android:textSize="12sp"
+                        android:visibility="gone" />
+                </FrameLayout>
+
+            </LinearLayout>
+
         </LinearLayout>
     </com.handmark.pulltorefresh.library.PullToRefreshScrollView>
 

+ 1 - 0
app_core/common/src/main/res/values/colors.xml

@@ -357,6 +357,7 @@
     <color name="meeting_start_status">#3BAE7E</color>
     <color name="meeting_before_status">#FF0000</color>
     <color name="empty_text_color">#999999</color>
+    <color name="dark_gray_97">#979797</color>
 
     <color name="b2b_quote_tab_selected">#4084f1</color>
     <color name="customer_tab_selected">#1084D1</color>

+ 6 - 1
app_modular/appworks/src/main/java/com/uas/appworks/activity/ScheduleActivity.java

@@ -222,7 +222,12 @@ public class ScheduleActivity extends BaseNetActivity {
         cal.set(Calendar.MILLISECOND, 0);
         long startTime = cal.getTimeInMillis();
         long endTime = cal.getTimeInMillis() + 24 * 60 * 60 * 1000;
-        List<Schedule> systemSchedule = ScheduleUtils.getSystemCalendar(MyApplication.getInstance(), startTime, endTime);
+        List<Schedule> systemSchedule =null;
+        try{
+          systemSchedule = ScheduleUtils.getSystemCalendar(MyApplication.getInstance(), startTime, endTime);
+        }catch (Exception e){
+
+        }
         if (!ListUtils.isEmpty(jsonArray)) {
             schedules = new ArrayList<>();
             Schedule chche = null;

+ 25 - 0
app_modular/appworks/src/main/java/com/uas/appworks/activity/businessManage/businessStage/BusinessStageActivity.java

@@ -136,6 +136,22 @@ public class BusinessStageActivity extends MvpBaseActivity<BusinessStageContract
         if (mBusinessStageBeans == null || mBusinessStageBeans.size() == 0) {
             mPresenter.requestStageList(this);
         } else {
+            int currentPos = -1;
+            if (mBusinessStageBeans != null) {
+                for (int i = 0; i < mBusinessStageBeans.size(); i++) {
+                    BusinessStageBean businessStageBean = mBusinessStageBeans.get(i);
+                    if (businessStageBean != null) {
+                        try {
+                            if (mCurrentBusinessStage.getBS_CODE().equals(businessStageBean.getBS_CODE())) {
+                                currentPos = i;
+                            }
+                        } catch (Exception e) {
+
+                        }
+                    }
+                }
+            }
+            mBusinessStageAdapter.setCurrentPos(currentPos);
             mBusinessStageAdapter.notifyDataSetChanged();
         }
     }
@@ -187,16 +203,25 @@ public class BusinessStageActivity extends MvpBaseActivity<BusinessStageContract
 
     @Override
     public void requestStageSuccess(List<BusinessStageBean> businessStageBeans) {
+        int currentPos = -1;
         if (businessStageBeans != null) {
             for (int i = 0; i < businessStageBeans.size(); i++) {
                 BusinessStageBean businessStageBean = businessStageBeans.get(i);
                 if (businessStageBean != null) {
                     if (mBctype != null && mBctype.equals(businessStageBean.getBS_TYPE())) {
                         mBusinessStageBeans.add(businessStageBean);
+                        try {
+                            if (mCurrentBusinessStage.getBS_CODE().equals(businessStageBean.getBS_CODE())) {
+                                currentPos = mBusinessStageBeans.size() - 1;
+                            }
+                        } catch (Exception e) {
+
+                        }
                     }
                 }
             }
         }
+        mBusinessStageAdapter.setCurrentPos(currentPos);
         mBusinessStageAdapter.notifyDataSetChanged();
         mBusinessStageMenuAdapter.notifyDataSetChanged();
         if (mBusinessStageBeans.size() == 0) {

+ 32 - 0
app_modular/appworks/src/main/java/com/uas/appworks/adapter/BusinessStageAdapter.java

@@ -16,14 +16,46 @@ import java.util.List;
  * @date 2018/9/17 17:04
  */
 public class BusinessStageAdapter extends BaseQuickAdapter<BusinessStageBean, BaseViewHolder> {
+    private int currentPos = -1;
 
     public BusinessStageAdapter(@Nullable List<BusinessStageBean> data) {
         super(R.layout.item_business_stage, data);
     }
 
+    public int getCurrentPos() {
+        return currentPos;
+    }
+
+    public void setCurrentPos(int currentPos) {
+        this.currentPos = currentPos;
+    }
+
     @Override
     protected void convert(BaseViewHolder helper, BusinessStageBean item) {
         int adapterPosition = helper.getAdapterPosition();
+        if (adapterPosition < currentPos) {
+            helper.setBackgroundRes(R.id.item_business_stage_parent_ll, R.drawable.shape_b2b_change_account_past);
+            helper.setTextColor(R.id.item_business_stage_no_tv, mContext.getResources().getColor(R.color.empty_text_color));
+            helper.setTextColor(R.id.item_business_stage_name_tv, mContext.getResources().getColor(R.color.dark_gray_97));
+            helper.setTextColor(R.id.item_business_stage_explore_tv, mContext.getResources().getColor(R.color.dark_gray_97));
+            helper.setTextColor(R.id.item_business_stage_point_tv, mContext.getResources().getColor(R.color.dark_gray_97));
+            helper.setTextColor(R.id.item_business_stage_point_capiton_tv, mContext.getResources().getColor(R.color.dark_gray_97));
+        } else if (adapterPosition == currentPos) {
+            helper.setBackgroundRes(R.id.item_business_stage_parent_ll, R.drawable.shape_b2b_change_account_current);
+            helper.setTextColor(R.id.item_business_stage_no_tv, mContext.getResources().getColor(R.color.white));
+            helper.setTextColor(R.id.item_business_stage_name_tv, mContext.getResources().getColor(R.color.white));
+            helper.setTextColor(R.id.item_business_stage_explore_tv, mContext.getResources().getColor(R.color.white));
+            helper.setTextColor(R.id.item_business_stage_point_tv, mContext.getResources().getColor(R.color.white));
+            helper.setTextColor(R.id.item_business_stage_point_capiton_tv, mContext.getResources().getColor(R.color.white));
+        } else {
+            helper.setBackgroundRes(R.id.item_business_stage_parent_ll, R.drawable.shape_b2b_change_account);
+            helper.setTextColor(R.id.item_business_stage_no_tv, mContext.getResources().getColor(R.color.main_text_color));
+            helper.setTextColor(R.id.item_business_stage_name_tv, mContext.getResources().getColor(R.color.gray_default_dark));
+            helper.setTextColor(R.id.item_business_stage_explore_tv, mContext.getResources().getColor(R.color.gray_default_dark));
+            helper.setTextColor(R.id.item_business_stage_point_tv, mContext.getResources().getColor(R.color.gray_default_dark));
+            helper.setTextColor(R.id.item_business_stage_point_capiton_tv, mContext.getResources().getColor(R.color.gray_default_dark));
+        }
+
         helper.setText(R.id.item_business_stage_no_tv, "阶段" + item.getBS_DETNO());
         helper.setText(R.id.item_business_stage_name_tv, item.getBS_NAME());
         helper.setText(R.id.item_business_stage_explore_tv, "本阶段可停留" + item.getBS_DAYS() + "天");

+ 7 - 0
app_modular/appworks/src/main/res/drawable/shape_b2b_change_account_current.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+
+    <corners android:radius="10dp" />
+    <solid android:color="#60D982" />
+</shape>

+ 7 - 0
app_modular/appworks/src/main/res/drawable/shape_b2b_change_account_past.xml

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

+ 5 - 3
app_modular/appworks/src/main/res/layout/item_business_stage.xml

@@ -11,6 +11,7 @@
     android:paddingTop="5dp">
 
     <LinearLayout
+        android:id="@+id/item_business_stage_parent_ll"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@drawable/shape_b2b_change_account"
@@ -26,14 +27,14 @@
             <View
                 android:layout_width="4dp"
                 android:layout_height="16dp"
-                android:background="#FF333333" />
+                android:background="#333333" />
 
             <TextView
                 android:id="@+id/item_business_stage_no_tv"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="10dp"
-                android:textColor="#FF333333"
+                android:textColor="@color/main_text_color"
                 android:textSize="15sp"
                 tools:text="阶段1"
                 />
@@ -79,11 +80,12 @@
             android:padding="8dp">
 
             <TextView
+                android:id="@+id/item_business_stage_point_capiton_tv"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_weight="2"
                 android:text="阶段要点:"
-                android:textColor="#FF666666"
+                android:textColor="#666666"
                 android:textSize="12sp" />
 
             <TextView