Browse Source

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

# Conflicts:
#	WeiChat/version.properties
Arison 8 years ago
parent
commit
0bc5a216da
20 changed files with 258 additions and 42 deletions
  1. 3 3
      WeiChat/version.properties
  2. 0 2
      app_core/common/src/main/res/layout/activity_simple_pinned_list.xml
  3. 1 1
      app_modular/appbooking/build.gradle
  4. 32 5
      app_modular/appbooking/src/main/java/com/modular/booking/activity/services/DishSelectActivity.java
  5. 63 3
      app_modular/appbooking/src/main/java/com/modular/booking/adapter/ItemDishCategoryListAdapter.java
  6. 38 4
      app_modular/appbooking/src/main/java/com/modular/booking/adapter/ItemDishPinnedListAdapter.java
  7. BIN
      app_modular/appbooking/src/main/res/drawable-hdpi/icon_shop_car.png
  8. BIN
      app_modular/appbooking/src/main/res/drawable-hdpi/icon_shop_empty.png
  9. BIN
      app_modular/appbooking/src/main/res/drawable-xhdpi/icon_shop_car.png
  10. BIN
      app_modular/appbooking/src/main/res/drawable-xhdpi/icon_shop_empty.png
  11. BIN
      app_modular/appbooking/src/main/res/drawable-xxhdpi/icon_shop_car.png
  12. BIN
      app_modular/appbooking/src/main/res/drawable-xxhdpi/icon_shop_empty.png
  13. 18 0
      app_modular/appbooking/src/main/res/drawable/shape_btn_blue_gradient.xml
  14. 3 7
      app_modular/appbooking/src/main/res/layout/activity_book_service_search.xml
  15. 78 2
      app_modular/appbooking/src/main/res/layout/activity_dish_select.xml
  16. 1 0
      app_modular/appbooking/src/main/res/layout/include_add_top.xml
  17. 7 1
      app_modular/appbooking/src/main/res/layout/item_dish_catagory_list.xml
  18. 1 10
      app_modular/appcontact/src/main/java/com/uas/appcontact/ui/activity/CompanyContactsActivity.java
  19. 6 2
      app_modular/appme/src/main/java/com/uas/appme/other/activity/SelectAreaActivity.java
  20. 7 2
      version.gradle

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Thu Jan 25 09:46:21 CST 2018
-debugName=157
+#Fri Jan 26 17:01:44 CST 2018
+debugName=177
 versionName=613
-debugCode=157
+debugCode=177
 versionCode=152

+ 0 - 2
app_core/common/src/main/res/layout/activity_simple_pinned_list.xml

@@ -3,12 +3,10 @@
     android:layout_height="match_parent"
     android:background="@color/normal_bg"
     android:orientation="vertical" >
-
     <com.core.widget.PinnedSectionListView
         android:id="@+id/list_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:cacheColorHint="#00000000"
         android:gravity="fill" />
-
 </LinearLayout>

+ 1 - 1
app_modular/appbooking/build.gradle

@@ -21,9 +21,9 @@ android {
 dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
     compile deps.appcompatV7
+    compile deps.bottomsheet
     testCompile deps.junit
     compile project(':common')
     compile project(':appcontact')
-    compile 'com.android.support.constraint:constraint-layout:+'
     compile project(path: ':apputils')
 }

+ 32 - 5
app_modular/appbooking/src/main/java/com/modular/booking/activity/services/DishSelectActivity.java

@@ -1,32 +1,52 @@
 package com.modular.booking.activity.services;
 
 import android.os.Bundle;
+import android.widget.ListView;
+import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.common.LogUtil;
 import com.core.base.OABaseActivity;
+import com.core.widget.PinnedSectionListView;
+import com.flipboard.bottomsheet.BottomSheetLayout;
 import com.me.network.app.http.HttpClient;
 import com.me.network.app.http.Method;
 import com.me.network.app.http.rx.ResultListener;
 import com.me.network.app.http.rx.ResultSubscriber;
 import com.modular.booking.R;
+import com.modular.booking.adapter.ItemDishCategoryListAdapter;
+import com.modular.booking.adapter.ItemDishPinnedListAdapter;
 import com.modular.booking.model.Product;
 import com.modular.booking.model.ProductCategory;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import de.hdodenhof.circleimageview.CircleImageView;
+
 /**
   * @desc:选择菜品
   * @author:Arison on 2018/1/24
   */
 public class DishSelectActivity extends OABaseActivity {
-  private static final String TAG = "DishSelectActivity";
+    
+    private static final String TAG = "DishSelectActivity";
+    private CircleImageView mCircleImage;
+    private TextView tv_title;
+    private TextView tv_sub;
+    private BottomSheetLayout  mBottmSheetLayout;
+    private ListView lv_product_category;
+    private PinnedSectionListView lv_product;
+    
+    private List<ProductCategory> productCategories=new ArrayList<>();
+    private ItemDishCategoryListAdapter itemDishCategoryListAdapter;
+    private ItemDishPinnedListAdapter itemDishPinnedListAdapter;
+    
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_dish_select);
-        
         initView();
         initEvent();
         initData();
@@ -34,14 +54,18 @@ public class DishSelectActivity extends OABaseActivity {
     
     private void initView(){
         getSupportActionBar().setTitle("选菜");
+        lv_product_category= findViewById(R.id.lv_product_category);
+        lv_product=findViewById(R.id.lv_dish_product);
+        itemDishCategoryListAdapter=new ItemDishCategoryListAdapter(mContext,productCategories);
+        lv_product_category.setAdapter( itemDishCategoryListAdapter);
     }
     
     private void initEvent(){}
-    
+ 
     private void initData(){
-          HttpClient httpClient=new HttpClient.Builder("http://www.haidiyun.top:9908/").build();
+          HttpClient httpClient=new HttpClient.Builder("http://192.168.253.200:8080/Chapter/").build();
                  httpClient.Api().send(new HttpClient.Builder()
-                 .url("api?client=DAFFF430FA37&handler=Hdy&method=GetBasicData")
+                 .url("data/dish")
                  .method(Method.GET)
                  .build(),new ResultSubscriber<Object>(new ResultListener<Object>() {
           
@@ -67,6 +91,9 @@ public class DishSelectActivity extends OABaseActivity {
                                  }
                              }
 
+                             productCategories.addAll(productCategorys);
+                             itemDishCategoryListAdapter.notifyDataSetChanged();
+                             
                             
                             LogUtil.prinlnLongMsg(TAG,JSON.toJSONString(productCategorys));
                           

+ 63 - 3
app_modular/appbooking/src/main/java/com/modular/booking/adapter/ItemDishCategoryListAdapter.java

@@ -1,10 +1,70 @@
 package com.modular.booking.adapter;
 
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.modular.booking.R;
+import com.modular.booking.model.ProductCategory;
+
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Created by Arison on 2018/1/24.
  */
 
-public class ItemDishCategoryListAdapter {
-    
-    
+public class ItemDishCategoryListAdapter extends BaseAdapter {
+   
+    private List<ProductCategory> productCategories=new ArrayList<>();
+    private Context ct;
+    private LayoutInflater layoutInflater;
+    public ItemDishCategoryListAdapter(Context ct,List<ProductCategory> datas){
+        this.ct=ct;
+        this.productCategories=datas;  
+        this.layoutInflater = LayoutInflater.from(ct);
+        
+    }
+
+    @Override
+    public int getCount() {
+        return productCategories.size();
+    }
+
+    @Override
+    public Object getItem(int i) {
+        return productCategories.get(i);
+    }
+
+    @Override
+    public long getItemId(int i) {
+        return i;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        if (convertView == null) {
+            convertView = layoutInflater.inflate(R.layout.item_dish_catagory_list, null);
+            convertView.setTag(new ViewHolder(convertView));
+        }
+        initializeViews((ProductCategory)getItem(position), (ViewHolder) convertView.getTag());
+        return convertView;
+    }
+
+    private void initializeViews(ProductCategory object, ViewHolder holder) {
+        holder.tvName.setText(object.getName());
+        holder.modle=object;
+    }
+
+    protected class ViewHolder {
+        private TextView tvName;
+        private ProductCategory modle;
+
+        public ViewHolder(View view) {
+            tvName = (TextView) view.findViewById(R.id.tv_name);
+        }
+    }
 }

+ 38 - 4
app_modular/appbooking/src/main/java/com/modular/booking/adapter/ItemDishPinnedListAdapter.java

@@ -1,11 +1,45 @@
 package com.modular.booking.adapter;
 
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+
+import com.core.widget.PinnedSectionListView;
+
 /**
  * Created by Arison on 2018/1/24.
  */
 
-public class ItemDishPinnedListAdapter {
-    
-    
-    
+public class ItemDishPinnedListAdapter extends BaseAdapter implements PinnedSectionListView.PinnedSectionListAdapter{
+
+
+    @Override
+    public boolean isItemViewTypePinned(int viewType) {
+        return false;
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return super.getItemViewType(position);
+    }
+
+    @Override
+    public int getCount() {
+        return 0;
+    }
+
+    @Override
+    public Object getItem(int i) {
+        return null;
+    }
+
+    @Override
+    public long getItemId(int i) {
+        return 0;
+    }
+
+    @Override
+    public View getView(int i, View view, ViewGroup viewGroup) {
+        return null;
+    }
 }

BIN
app_modular/appbooking/src/main/res/drawable-hdpi/icon_shop_car.png


BIN
app_modular/appbooking/src/main/res/drawable-hdpi/icon_shop_empty.png


BIN
app_modular/appbooking/src/main/res/drawable-xhdpi/icon_shop_car.png


BIN
app_modular/appbooking/src/main/res/drawable-xhdpi/icon_shop_empty.png


BIN
app_modular/appbooking/src/main/res/drawable-xxhdpi/icon_shop_car.png


BIN
app_modular/appbooking/src/main/res/drawable-xxhdpi/icon_shop_empty.png


+ 18 - 0
app_modular/appbooking/src/main/res/drawable/shape_btn_blue_gradient.xml

@@ -0,0 +1,18 @@
+<?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>
+    <gradient
+        android:startColor="#8ee7f0"
+        android:endColor="#3297e9">
+    </gradient>
+    <padding
+        android:left="15dp"
+        android:top="15dp"
+        android:right="15dp"
+        android:bottom="15dp" />
+</shape>

+ 3 - 7
app_modular/appbooking/src/main/res/layout/activity_book_service_search.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout
+<RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
@@ -11,9 +11,5 @@
         android:layout_width="0dp"
         android:layout_height="0dp"
         android:divider="@color/item_line"
-        android:dividerHeight="@dimen/line"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-</android.support.constraint.ConstraintLayout>
+        android:dividerHeight="@dimen/line" />
+</RelativeLayout>

+ 78 - 2
app_modular/appbooking/src/main/res/layout/activity_dish_select.xml

@@ -1,9 +1,85 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:orientation="vertical"
     tools:context="com.modular.booking.activity.services.DishSelectActivity">
+    <include layout="@layout/include_add_top"
+        android:id="@+id/dish_layout_top"></include>
 
-</android.support.constraint.ConstraintLayout>
+    <com.flipboard.bottomsheet.BottomSheetLayout
+        android:id="@+id/bottom_sheet_layout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_below="@+id/dish_layout_top"
+     >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <ListView
+            android:id="@+id/lv_product_category"
+            android:layout_width="100dp"
+            android:layout_height="match_parent"
+            android:fadingEdge="none"
+            android:scrollbars="none"
+            android:divider="@null"
+            android:choiceMode="singleChoice"/>
+        <View
+            android:layout_width="1px"
+            android:layout_height="match_parent"
+            android:background="@color/divider"
+            />
+        <com.core.widget.PinnedSectionListView
+            android:id="@+id/lv_dish_product"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:cacheColorHint="#00000000"
+            android:gravity="fill" />
+    </LinearLayout>
+    
+    </com.flipboard.bottomsheet.BottomSheetLayout>
+    <!--底部购物车布局-->
+    <RelativeLayout
+        android:id="@+id/rl_bottom"
+        android:layout_width="match_parent"
+        android:layout_alignParentBottom="true"
+        android:layout_height="60dp">
+
+        <LinearLayout
+            android:id="@+id/ll_bottom"
+            android:background="#CC000000"
+            android:layout_width="match_parent"
+            android:orientation="horizontal"
+          
+            android:layout_alignParentBottom="true"
+            android:layout_height="50dp"
+            android:weightSum="3">
+            <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="70dp"
+            android:textColor="@color/gray_light"
+            android:gravity="center_vertical"
+                android:layout_weight="2"
+            android:text="您的购物车空空如洗哦"/>
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:background="@drawable/shape_btn_blue_gradient"
+                android:textColor="@color/white"
+                android:layout_gravity="right"
+                android:gravity="center"
+                android:text="选好了"/>
+        </LinearLayout>
+        <ImageView
+            android:layout_width="60dp"
+            android:layout_height="60dp"
+            android:layout_marginLeft="7dp"
+            android:layout_marginBottom="7dp"
+            android:src="@drawable/icon_shop_empty"/>
+        
+    </RelativeLayout>
+</RelativeLayout>

+ 1 - 0
app_modular/appbooking/src/main/res/layout/include_add_top.xml

@@ -72,6 +72,7 @@
                 android:id="@+id/tv_sub"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_marginLeft="2dp"
                 android:drawableLeft="@drawable/icon_map"
                 android:drawablePadding="6dp"
                 android:elevation="2dp"

+ 7 - 1
app_modular/appbooking/src/main/res/layout/item_dish_catagory_list.xml

@@ -1,7 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent" 
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:paddingLeft="10dp"
+    android:paddingRight="10dp"
+    android:paddingTop="8dp"
+    android:background="@drawable/list_selector_background"
+    android:paddingBottom="8dp">
     <TextView
         android:id="@+id/tv_name"
         android:layout_width="match_parent"
@@ -15,4 +20,5 @@
         android:text="热销榜"
         android:textSize="@dimen/sp_14"
         android:textColor="#9e9e9e" />
+
 </RelativeLayout>

+ 1 - 10
app_modular/appcontact/src/main/java/com/uas/appcontact/ui/activity/CompanyContactsActivity.java

@@ -406,7 +406,6 @@ public class CompanyContactsActivity extends BaseActivity {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.act_staff_query_list);
-
         getSupportActionBar().setTitle(getString(R.string.contact_company));
         ct = this;
         manager = new DBManager(ct);
@@ -443,15 +442,7 @@ public class CompanyContactsActivity extends BaseActivity {
         rl_empty.setVisibility(View.GONE);
 //        reScrollView = (SuperSwipeRefreshLayout) findViewById(R.id.refresh_top);
         mRefreshLayout = (RefreshLayout) findViewById(R.id.act_staff_query_refresh_layout);
-
         initListener();
-        mHandler.post(new Runnable() {
-            @Override
-            public void run() {
-//                reScrollView.setRefreshing(true);
-                mRefreshLayout.autoRefresh(300, 1f);
-            }
-        });
         mHandler.postDelayed(new Runnable() {
             @Override
             public void run() {
@@ -613,6 +604,7 @@ public class CompanyContactsActivity extends BaseActivity {
         mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
             @Override
             public void onRefresh(RefreshLayout refreshLayout) {
+                LogUtil.d("RefreshLayout","---------onRefresh()-----------");
                 manager.deleteData(CommonUtil.getSharedPreferences(ct, "erp_master"));
                 LoadServerData(CommonUtil.getSharedPreferences(ct, "erp_master"), null);
             }
@@ -774,7 +766,6 @@ public class CompanyContactsActivity extends BaseActivity {
      */
     public void LoadServerData(String master, String lastdate) {
         if (StringUtil.isEmpty(master)) {
-//            reScrollView.setRefreshing(false);
             if (mRefreshLayout.isRefreshing()) {
                 mRefreshLayout.finishRefresh(0);
             }

+ 6 - 2
app_modular/appme/src/main/java/com/uas/appme/other/activity/SelectAreaActivity.java

@@ -11,6 +11,8 @@ import android.widget.AdapterView;
 import android.widget.BaseAdapter;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSON;
+import com.common.LogUtil;
 import com.core.app.ActionBackActivity;
 import com.core.app.MyApplication;
 import com.core.widget.PinnedSectionListView;
@@ -76,7 +78,7 @@ public class SelectAreaActivity extends ActionBackActivity {
 		}
 
 		prepareData();
-
+  
 		setContentView(R.layout.activity_simple_pinned_list);
 		initView();
 		if (hasAddtionCity()) {
@@ -107,13 +109,15 @@ public class SelectAreaActivity extends ActionBackActivity {
 				mItems.add(new Item(area));
 			}
 		}
+		LogUtil.d(TAG,"mItems:"+ JSON.toJSONString(mItems));
 	}
 
+	private static final String TAG = "SelectAreaActivity";
 	private boolean hasAddtionCity() {
 		return mAreaType == Area.AREA_TYPE_PROVINCE;
 	}
 
-	private class Item {
+	public static class Item {
 		public static final int ITEM = 0;
 		public static final int SECTION = 1;
 		public int type;

+ 7 - 2
version.gradle

@@ -49,7 +49,8 @@ ext {
             bannerVersion                       : '1.4.10',
             smartRefreshLayoutVersion           : '1.0.4',
             rxJava2Version                      : '2.0.7',
-            rxAndroid2Version                   : '2.0.1'
+            rxAndroid2Version                   : '2.0.1',
+            bottomsheetVersion                  : '1.5.0'
     ]
 
     deps = [
@@ -104,7 +105,11 @@ ext {
             smartRefreshHeader           : 'com.scwang.smartrefresh:SmartRefreshHeader:' + depsVersion.smartRefreshLayoutVersion,
             wechatSdk                    : 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+',
             rxjava2                      : 'io.reactivex.rxjava2:rxjava:' + depsVersion.rxJava2Version,
-            rxandroid2                   : 'io.reactivex.rxjava2:rxandroid:' + depsVersion.rxAndroid2Version
+            rxandroid2                   : 'io.reactivex.rxjava2:rxandroid:' + depsVersion.rxAndroid2Version,
+
+
+            bottomsheet                :'com.flipboard:bottomsheet-core:'+depsVersion.bottomsheetVersion
+            
     ]
 }