Browse Source

代码冲突

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

# Conflicts:
#	WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/message/MessageFragment.java
#	app_core/common/src/main/java/com/common/data/StringUtil.java
Arison 8 years ago
parent
commit
c930d3d891
24 changed files with 731 additions and 9 deletions
  1. 2 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/message/PersonalRegActivity.java
  2. 1 0
      app_core/common/src/main/java/com/core/net/http/ViewUtil.java
  3. 48 2
      app_modular/appbooking/src/main/java/com/modular/booking/activity/services/BServiceAddActivity.java
  4. 361 0
      app_modular/appbooking/src/main/java/com/modular/booking/widget/AddSubUtils.java
  5. 0 0
      app_modular/appbooking/src/main/res/com/modular/booking/adapter/ItemRoomsSelectAdapter.java
  6. BIN
      app_modular/appbooking/src/main/res/drawable-xxhdpi/addsubutils_ic_minus.png
  7. BIN
      app_modular/appbooking/src/main/res/drawable-xxhdpi/addsubutils_ic_plus.png
  8. 7 0
      app_modular/appbooking/src/main/res/drawable/addsubutils_add_sub_bg.xml
  9. 21 0
      app_modular/appbooking/src/main/res/drawable/addsubutils_left_selector.xml
  10. 21 0
      app_modular/appbooking/src/main/res/drawable/addsubutils_right_selector.xml
  11. 8 0
      app_modular/appbooking/src/main/res/drawable/divider_horizontal.xml
  12. 8 2
      app_modular/appbooking/src/main/res/layout/activity_bservice_add.xml
  13. 43 0
      app_modular/appbooking/src/main/res/layout/add_sub_end_layout.xml
  14. 43 0
      app_modular/appbooking/src/main/res/layout/add_sub_layout.xml
  15. 44 0
      app_modular/appbooking/src/main/res/layout/add_sub_start_layout.xml
  16. 29 0
      app_modular/appbooking/src/main/res/values/attrs.xml
  17. 17 0
      app_modular/appbooking/src/main/res/values/colors.xml
  18. 7 0
      app_modular/appbooking/src/main/res/values/dimens.xml
  19. 15 0
      app_modular/appbooking/src/main/res/values/styles.xml
  20. 1 1
      app_modular/applogin/src/main/java/com/modular/login/activity/PersonalRegActivity.java
  21. 29 0
      app_modular/applogin/src/main/res/values/attrs.xml
  22. 12 0
      app_modular/applogin/src/main/res/values/colors.xml
  23. 10 0
      app_modular/applogin/src/main/res/values/styles.xml
  24. 4 3
      version.gradle

+ 2 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/message/PersonalRegActivity.java

@@ -154,10 +154,11 @@ public class PersonalRegActivity extends BaseActivity implements View.OnClickLis
         }
 
     }
-
+    private static final String TAG = "PersonalRegActivity";
     private void doRegiter() {
         progressDialog.dismiss();
         String url = Constants.IM_BASE_URL() + "user/appRegister";
+        LogUtil.d(TAG,"url:"+url);
         Map<String, Object> params = new HashMap<>();
         params.put("telephone", phone_et.getText().toString());
         params.put("password", md5_password);

+ 1 - 0
app_core/common/src/main/java/com/core/net/http/ViewUtil.java

@@ -607,6 +607,7 @@ public class ViewUtil {
                     loginEntities.add(model);
                 } else if (model.getPlatform().equals("B2B")) {
                     List<LoginEntity.Spaces> sModel = model.getSpaces();
+                    b2b_uu=model.getAccount();
                     if (!ListUtils.isEmpty(sModel)){
                         for (int j = 0; j <sModel.size() ; j++) {
                             //去重逻辑

+ 48 - 2
app_modular/appbooking/src/main/java/com/modular/booking/activity/services/BServiceAddActivity.java

@@ -13,6 +13,7 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.afollestad.materialdialogs.MaterialDialog;
 import com.alibaba.fastjson.JSON;
@@ -51,6 +52,7 @@ import com.modular.booking.R;
 import com.modular.booking.activity.utils.GridSelectActivity;
 import com.modular.booking.model.SBListModel;
 import com.modular.booking.model.SBMenuModel;
+import com.modular.booking.widget.AddSubUtils;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -86,6 +88,7 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
     private String serviceName;//服务名称
     private String dataService;//详情数据
     private boolean isHasPerson;//是否指定了人员
+    private AddSubUtils addSubUtils;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -139,6 +142,40 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
         et_book_phone.setOnClickListener(this);
         tv_sub.setOnClickListener(this);
         tv_title.setOnClickListener(this);
+
+         addSubUtils = (AddSubUtils) findViewById(R.id.add_sub);
+        addSubUtils.setBuyMax(50)       // 最大购买数,默认为int的最大值
+                .setInventory(50)       // 库存,默认为int的最大值
+                .setCurrentNumber(1)    // 设置当前数,默认为1
+                .setStep(1)             // 步长,默认为1
+                .setBuyMin(1)           // 购买的最小值,默认为1
+                .setOnWarnListener(new AddSubUtils.OnWarnListener() {
+                    @Override
+                    public void onWarningForInventory(int inventory) {
+                       // Toast.makeText(mContext, "当前库存:" + inventory, Toast.LENGTH_SHORT).show();
+                        tv_food_peoples.setText(inventory);
+//                        tv_food_peoples.setVisibility(View.GONE);
+                    }
+
+                    @Override
+                    public void onWarningForBuyMax(int max) {
+                      //  Toast.makeText(mContext, "超过最大购买数:" + max, Toast.LENGTH_SHORT).show();
+                    }
+
+                    @Override
+                    public void onWarningForBuyMin(int min) {
+                       // Toast.makeText(mContext, "低于最小购买数:" + min, Toast.LENGTH_SHORT).show();
+                    }
+                })
+              .setOnChangeValueListener(new AddSubUtils.OnChangeValueListener() {
+                @Override
+                public void onChangeValue(int value, int position) {
+                   // Toast.makeText(mContext, "当前值:" + value, Toast.LENGTH_SHORT).show();
+                    tv_food_peoples.setText(String.valueOf(value));
+                    tv_food_peoples.setVisibility(View.GONE);
+                }
+        });
+ 
     }
 
     private boolean isEdited = true;
@@ -380,8 +417,9 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
                     , TIME_SELECT);
         }
         //人数选择(1~10以上)
-        else if (id == R.id.tv_food_peoples
-                || id == R.id.tv_ktv_peoples
+        else if (
+                //id == R.id.tv_food_people||
+        id == R.id.tv_ktv_peoples
                 || id == R.id.tv_club_peoples
                 || id == R.id.tv_sport_peoples) {
             ArrayList<SelectBean> formBeaan = new ArrayList<>();
@@ -962,6 +1000,8 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
                     tv_food_times.setOnClickListener(this);
                     tv_food_rooms.setOnClickListener(this);
                     tv_food_peoples.setOnClickListener(this);
+                    tv_food_peoples.setVisibility(View.GONE);
+                    addSubUtils.setVisibility(View.VISIBLE);
                 } else {
                     if(StringUtil.isEmpty(data.getString("sb_starttime"))){
                         tv_food_times.setText(data.getString("sb_endtime"));
@@ -971,6 +1011,8 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
                     }
                     tv_food_rooms.setText(data.getString("sb_stname"));
                     tv_food_peoples.setText(data.getString("sb_person"));
+                    tv_food_peoples.setVisibility(View.VISIBLE);
+                    addSubUtils.setVisibility(View.GONE);
                 }
                 break;
             case "美容美发"://  美容美发
@@ -1101,6 +1143,8 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
                     tv_food_times.setOnClickListener(this);
                     tv_food_rooms.setOnClickListener(this);
                     tv_food_peoples.setOnClickListener(this);
+                    addSubUtils.setVisibility(View.VISIBLE);
+                    tv_food_peoples.setVisibility(View.GONE);
                 } else {
                     if(StringUtil.isEmpty(data.getString("sb_starttime"))){
                         tv_food_times.setText(data.getString("sb_endtime"));
@@ -1110,6 +1154,8 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
                     }
                     tv_food_rooms.setText(data.getString("sb_spname"));
                     tv_food_peoples.setText(data.getString("sb_person"));
+                    tv_food_peoples.setVisibility(View.VISIBLE);
+                    addSubUtils.setVisibility(View.GONE);
                 }
                 break;
             case "10004"://美容美发

+ 361 - 0
app_modular/appbooking/src/main/java/com/modular/booking/widget/AddSubUtils.java

@@ -0,0 +1,361 @@
+package com.modular.booking.widget;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.support.annotation.RequiresApi;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.text.method.DigitsKeyListener;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+
+import com.modular.booking.R;
+
+
+/**
+ * Created by 贾梦飞 on 2017/8/10 10:55.
+ * QQ:821176301
+ * 微信:j821176301
+ * desc:类似购物车功能的增加和加减
+ */
+
+public class AddSubUtils extends LinearLayout implements View.OnClickListener, TextWatcher {
+
+    private int mBuyMax = Integer.MAX_VALUE;  // 最大购买数量,默认最大值
+    private int inputValue = 1; //购买数量
+    private int inventory = Integer.MAX_VALUE; //商品库存,默认最大值
+    private int mBuyMin = 1;// 商品最小购买数量,默认值为1
+    private int mStep = 1; // 步长--每次增加的个数,默认是1
+    private int mPosition = 0; // 设置改变的位置,默认是0; //集合数据中会用到
+
+    private OnWarnListener mOnWarnListener;
+    private OnChangeValueListener mOnChangeValueListener;
+
+    private EditText etInput;
+    private ImageView icPlus;
+    private ImageView icMinus;
+
+
+    public AddSubUtils(Context context) {
+        this(context, null);
+    }
+
+    @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
+    public AddSubUtils(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
+    public AddSubUtils(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init(context, attrs, defStyleAttr);
+    }
+
+    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+    private void init(Context context, AttributeSet attrs, int defStyleAttr) {
+        //得到属性
+        if (attrs != null) {
+            TypedArray typeArray = getContext().obtainStyledAttributes(attrs, R.styleable.AddSubUtils);
+            boolean editable = typeArray.getBoolean(R.styleable.AddSubUtils_editable, true);
+            String location = typeArray.getString(R.styleable.AddSubUtils_location);
+            // 左右两面的宽度
+            int ImageWidth = typeArray.getDimensionPixelSize(R.styleable.AddSubUtils_ImageWidth, -1);
+            // 中间内容框的宽度
+            int contentWidth = typeArray.getDimensionPixelSize(R.styleable.AddSubUtils_contentWidth, -1);
+            // 中间字体的大小
+            int contentTextSize = typeArray.getDimensionPixelSize(R.styleable.AddSubUtils_contentTextSize, -1);
+            // 中间字体的颜色
+            int contentTextColor = typeArray.getColor(R.styleable.AddSubUtils_contentTextColor, 0xff000000);
+            // 整个控件的background
+            Drawable background = typeArray.getDrawable(R.styleable.AddSubUtils_all_background);
+            // 左面控件的背景
+            Drawable leftBackground = typeArray.getDrawable(R.styleable.AddSubUtils_leftBackground);
+            // 右面控件的背景
+            Drawable rightBackground = typeArray.getDrawable(R.styleable.AddSubUtils_rightBackground);
+            // 中间控件的背景
+            Drawable contentBackground = typeArray.getDrawable(R.styleable.AddSubUtils_contentBackground);
+            // 左面控件的资源
+            Drawable leftResources = typeArray.getDrawable(R.styleable.AddSubUtils_leftResources);
+            // 右面控件的资源
+            Drawable rightResources = typeArray.getDrawable(R.styleable.AddSubUtils_rightResources);
+            // 资源回收
+            typeArray.recycle();
+
+            if("start".equals(location)) {
+                //把布局和当前类形成整体
+                LayoutInflater.from(context).inflate(R.layout.add_sub_start_layout, this);
+            }else if("end".equals(location)) {
+                //把布局和当前类形成整体
+                LayoutInflater.from(context).inflate(R.layout.add_sub_end_layout, this);
+            }else {
+                //把布局和当前类形成整体
+                LayoutInflater.from(context).inflate(R.layout.add_sub_layout, this);
+            }
+
+            icPlus = (ImageView) findViewById(R.id.ic_plus);
+            icMinus = (ImageView) findViewById(R.id.ic_minus);
+            etInput = (EditText) findViewById(R.id.et_input);
+
+            icPlus.setOnClickListener(this);
+            icMinus.setOnClickListener(this);
+            etInput.addTextChangedListener(this);
+
+            setEditable(editable);
+            etInput.setTextColor(contentTextColor);
+
+            // 设置两边按钮的宽度
+            if (ImageWidth > 0) {
+                LayoutParams textParams = new LayoutParams(ImageWidth, LayoutParams.MATCH_PARENT);
+                icPlus.setLayoutParams(textParams);
+                icMinus.setLayoutParams(textParams);
+            }
+
+            // 设置中间输入框的宽度
+            if (contentWidth > 0) {
+                LayoutParams textParams = new LayoutParams(contentWidth, LayoutParams.MATCH_PARENT);
+                etInput.setLayoutParams(textParams);
+            }
+            if (contentTextColor > 0) {
+                etInput.setTextSize(contentTextColor);
+            }
+            if(contentTextSize > 0) {
+                etInput.setTextSize(contentTextSize);
+            }
+            if (background != null) {
+                setBackgroundDrawable(background);
+            } else {
+                setBackgroundResource(R.drawable.addsubutils_add_sub_bg);
+            }
+
+            if (contentBackground != null) {
+                etInput.setBackground(contentBackground);
+            }
+
+            if(leftBackground != null) {
+                icMinus.setBackground(leftBackground);
+            }
+
+            if (rightBackground != null){
+                icPlus.setBackground(rightBackground);
+            }
+            if (leftResources != null){
+                icMinus.setImageDrawable(leftResources);
+            }
+            if(rightResources != null) {
+                icPlus.setImageDrawable(rightResources);
+            }
+        }
+    }
+
+    private void setEditable(boolean editable) {
+        if (editable) {
+            etInput.setFocusable(true);
+            etInput.setKeyListener(new DigitsKeyListener());
+        } else {
+            etInput.setFocusable(false);
+            etInput.setKeyListener(null);
+        }
+    }
+
+    @Override
+    public void onClick(View view) {
+        int id = view.getId();
+        if (id == R.id.ic_plus) {
+            // 加
+            if (inputValue < Math.min(mBuyMax, inventory)) {
+                inputValue += mStep;
+                //正常添加
+                etInput.setText("" + inputValue);
+            } else if (inventory < mBuyMax) {
+                //库存不足
+                warningForInventory();
+            } else {
+                //超过最大购买数
+                warningForBuyMax();
+            }
+        } else if (id == R.id.ic_minus) {
+            // 减
+            if (inputValue > mBuyMin) {
+                inputValue -= mStep;
+                etInput.setText(inputValue + "");
+            } else {
+                // 低于最小购买数
+                warningForBuyMin();
+            }
+        } else if (id == R.id.et_input) {
+            // 输入框
+            etInput.setSelection(etInput.getText().toString().length());
+        }
+    }
+
+    /**
+     * 低于最小购买数
+     * Warning for buy min.
+     */
+    private void warningForBuyMin() {
+        if (mOnWarnListener != null) mOnWarnListener.onWarningForBuyMin(mBuyMin);
+    }
+
+    /**
+     * 超过的最大购买数限制
+     * Warning for buy max.
+     */
+    private void warningForBuyMax() {
+        if (mOnWarnListener != null) mOnWarnListener.onWarningForBuyMax(mBuyMax);
+    }
+
+    /**
+     * 超过的库存限制
+     * Warning for inventory.
+     */
+    private void warningForInventory() {
+        if (mOnWarnListener != null) mOnWarnListener.onWarningForInventory(inventory);
+    }
+
+    @Override
+    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+    }
+
+    @Override
+    public void onTextChanged(CharSequence s, int start, int before, int count) {
+        onNumberInput();
+    }
+
+    /**
+     * 监听输入的数据变化
+     */
+    private void onNumberInput() {
+        //当前数量
+        int count = getNumber();
+        if (count < mBuyMin) {
+            //手动输入
+            inputValue = mBuyMin;
+            etInput.setText(inputValue + "");
+            if(mOnChangeValueListener != null) {
+                mOnChangeValueListener.onChangeValue(inputValue,mPosition);
+            }
+            return;
+        }
+        int limit = Math.min(mBuyMax, inventory);
+        if (count > limit) {
+            if (inventory < mBuyMax) {
+                //库存不足
+                warningForInventory();
+            } else {
+                //超过最大购买数
+                warningForBuyMax();
+            }
+        }else{
+           inputValue = count;
+            if(mOnChangeValueListener != null) {
+                mOnChangeValueListener.onChangeValue(inputValue,mPosition);
+            }
+        }
+    }
+
+    public AddSubUtils setCurrentNumber(int currentNumber) {
+        if (currentNumber < mBuyMin){
+            inputValue = mBuyMin;
+        } else {
+            inputValue = Math.min(Math.min(mBuyMax, inventory), currentNumber);
+        }
+        etInput.setText(inputValue + "");
+        return this;
+    }
+
+    public int getInventory() {
+        return inventory;
+    }
+
+    public AddSubUtils setInventory(int inventory) {
+        this.inventory = inventory;
+        return this;
+    }
+
+    public AddSubUtils setBean(Object bean) {
+        this.inventory = inventory;
+        return this;
+    }
+
+    public int getBuyMax() {
+        return mBuyMax;
+    }
+
+    public AddSubUtils setBuyMax(int buyMax) {
+        mBuyMax = buyMax;
+        return this;
+    }
+    public AddSubUtils setPosition(int position) {
+        mPosition = position;
+        return this;
+    }
+    public int getPosition() {
+        return mPosition;
+    }
+
+    public AddSubUtils setBuyMin(int buyMin) {
+        mBuyMin = buyMin;
+        return this;
+    }
+
+    public AddSubUtils setOnWarnListener(OnWarnListener onWarnListener) {
+        mOnWarnListener = onWarnListener;
+        return this;
+    }
+
+    public AddSubUtils setOnChangeValueListener(OnChangeValueListener onChangeValueListener) {
+        mOnChangeValueListener = onChangeValueListener;
+        return this;
+    }
+    public int getStep() {
+        return mStep;
+    }
+
+    public AddSubUtils setStep(int step) {
+        mStep = step;
+        return this;
+    }
+
+
+    @Override
+    public void afterTextChanged(Editable s) {
+
+    }
+
+    /**
+     * 得到输入框的数量
+     *
+     * @return
+     */
+    public int getNumber() {
+        try {
+            return Integer.parseInt(etInput.getText().toString());
+        } catch (NumberFormatException e) {
+
+        }
+        etInput.setText(mBuyMin + "");
+        return mBuyMin;
+    }
+
+    public interface OnWarnListener {
+
+        void onWarningForInventory(int inventory);
+
+        void onWarningForBuyMax(int max);
+
+        void onWarningForBuyMin(int min);
+    }
+
+    public interface OnChangeValueListener {
+
+        void onChangeValue(int value, int position);
+    }
+}

+ 0 - 0
app_modular/appbooking/src/main/res/com/modular/booking/adapter/ItemRoomsSelectAdapter.java


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


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


+ 7 - 0
app_modular/appbooking/src/main/res/drawable/addsubutils_add_sub_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="1dp"
+        android:color="@color/divider"/>
+    <corners android:radius="3dp"/>
+</shape>

+ 21 - 0
app_modular/appbooking/src/main/res/drawable/addsubutils_left_selector.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:enterFadeDuration="200" android:exitFadeDuration="200">
+    <item android:state_pressed="true" >
+        <shape>
+            <stroke android:color="@color/divider"
+                android:width="1dp"/>
+            <solid android:color="@color/divider"/>
+            <corners android:topLeftRadius="3dp"
+                android:bottomLeftRadius="3dp"/>
+        </shape>
+    </item>
+    <item android:state_pressed="false" >
+        <shape>
+            <stroke android:color="@color/divider"
+                android:width="1dp"/>
+            <corners android:topLeftRadius="3dp"
+                android:bottomLeftRadius="3dp"/>
+        </shape>
+    </item>
+</selector>

+ 21 - 0
app_modular/appbooking/src/main/res/drawable/addsubutils_right_selector.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:enterFadeDuration="200" android:exitFadeDuration="200">
+    <item android:state_pressed="true" >
+        <shape>
+            <stroke android:color="@color/divider"
+                android:width="1dp"/>
+            <solid android:color="@color/divider"/>
+            <corners android:topRightRadius="3dp"
+                android:bottomRightRadius="3dp"/>
+        </shape>
+    </item>
+    <item android:state_pressed="false" >
+        <shape>
+            <stroke android:color="@color/divider"
+                android:width="1dp"/>
+            <corners android:topRightRadius="3dp"
+                android:bottomRightRadius="3dp"/>
+        </shape>
+    </item>
+</selector>

+ 8 - 0
app_modular/appbooking/src/main/res/drawable/divider_horizontal.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <size
+        android:width="1dp"/>
+    <solid android:color="@color/divider"/>
+</shape>

+ 8 - 2
app_modular/appbooking/src/main/res/layout/activity_bservice_add.xml

@@ -466,7 +466,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical"
-            android:visibility="gone"
+      
             >
 
             <RelativeLayout
@@ -479,6 +479,7 @@
                     android:gravity="center_vertical"
                     android:text="@string/service_food_peoples"/>
 
+               
                 <TextView
                     android:id="@+id/tv_food_peoples"
                     style="@style/item_menu_input"
@@ -486,7 +487,12 @@
                     android:layout_toRightOf="@id/tag_food_peoples"
                     android:drawablePadding="6dp"
                     android:drawableRight="@drawable/oa_next"
-                    android:hint="@string/common_select"/>
+                    android:hint=""/>
+                <com.modular.booking.widget.AddSubUtils
+                    android:id="@+id/add_sub"
+                    android:layout_width="120dp"
+                    android:layout_height="50dp"
+                    android:layout_alignParentRight="true"/>
             </RelativeLayout>
 
             <RelativeLayout

+ 43 - 0
app_modular/appbooking/src/main/res/layout/add_sub_end_layout.xml

@@ -0,0 +1,43 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:divider="@drawable/divider_horizontal"
+    android:background="@drawable/addsubutils_add_sub_bg"
+    android:orientation="horizontal">
+
+    <ImageView
+        android:id="@+id/ic_minus"
+        android:layout_width="@dimen/addsubutils_btn_width"
+        android:layout_height="match_parent"
+        android:background="@drawable/addsubutils_left_selector"
+        android:clickable="true"
+        android:padding="@dimen/addsubutils_btn_padding"
+        android:scaleType="centerInside"
+        android:src="@drawable/addsubutils_ic_minus" />
+
+    <ImageView
+        android:id="@+id/ic_plus"
+        android:layout_width="@dimen/addsubutils_btn_width"
+        android:layout_height="match_parent"
+        android:background="@drawable/addsubutils_right_selector"
+        android:clickable="true"
+        android:padding="@dimen/addsubutils_btn_padding"
+        android:scaleType="centerInside"
+        android:src="@drawable/addsubutils_ic_plus" />
+
+    <EditText
+        android:id="@+id/et_input"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@null"
+        android:cursorVisible="true"
+        android:digits="0123456789"
+        android:gravity="center"
+        android:singleLine="true"
+        android:inputType="number"
+        android:minWidth="@dimen/addsubutils_et_minwidth"
+        android:text="1"
+        android:textColor="@color/addsubutils_text"
+        android:textCursorDrawable="@null"
+        android:textSize="@dimen/addsubutils_textsize"/>
+</LinearLayout>

+ 43 - 0
app_modular/appbooking/src/main/res/layout/add_sub_layout.xml

@@ -0,0 +1,43 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:divider="@drawable/divider_horizontal"
+    android:background="@drawable/addsubutils_add_sub_bg"
+    android:orientation="horizontal">
+
+    <ImageView
+        android:id="@+id/ic_minus"
+        android:layout_width="@dimen/addsubutils_btn_width"
+        android:layout_height="match_parent"
+        android:background="@drawable/addsubutils_left_selector"
+        android:clickable="true"
+        android:padding="@dimen/addsubutils_btn_padding"
+        android:scaleType="centerInside"
+        android:src="@drawable/addsubutils_ic_minus" />
+
+    <EditText
+        android:id="@+id/et_input"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@null"
+        android:cursorVisible="true"
+        android:digits="0123456789"
+        android:gravity="center"
+        android:singleLine="true"
+        android:inputType="number"
+        android:minWidth="@dimen/addsubutils_et_minwidth"
+        android:text="1"
+        android:textColor="@color/addsubutils_text"
+        android:textCursorDrawable="@null"
+        android:textSize="@dimen/addsubutils_textsize"/>
+
+    <ImageView
+        android:id="@+id/ic_plus"
+        android:layout_width="@dimen/addsubutils_btn_width"
+        android:layout_height="match_parent"
+        android:background="@drawable/addsubutils_right_selector"
+        android:clickable="true"
+        android:padding="@dimen/addsubutils_btn_padding"
+        android:scaleType="centerInside"
+        android:src="@drawable/addsubutils_ic_plus" />
+</LinearLayout>

+ 44 - 0
app_modular/appbooking/src/main/res/layout/add_sub_start_layout.xml

@@ -0,0 +1,44 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:divider="@drawable/divider_horizontal"
+    android:background="@drawable/addsubutils_add_sub_bg"
+    android:orientation="horizontal">
+    <EditText
+        android:id="@+id/et_input"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@null"
+        android:cursorVisible="true"
+        android:digits="0123456789"
+        android:gravity="center"
+        android:singleLine="true"
+        android:inputType="number"
+        android:minWidth="@dimen/addsubutils_et_minwidth"
+        android:text="1"
+        android:textColor="@color/addsubutils_text"
+        android:textCursorDrawable="@null"
+        android:textSize="@dimen/addsubutils_textsize"/>
+
+    <ImageView
+        android:id="@+id/ic_minus"
+        android:layout_width="@dimen/addsubutils_btn_width"
+        android:layout_height="match_parent"
+        android:background="@drawable/addsubutils_left_selector"
+        android:clickable="true"
+        android:padding="@dimen/addsubutils_btn_padding"
+        android:scaleType="centerInside"
+        android:src="@drawable/addsubutils_ic_minus" />
+
+
+
+    <ImageView
+        android:id="@+id/ic_plus"
+        android:layout_width="@dimen/addsubutils_btn_width"
+        android:layout_height="match_parent"
+        android:background="@drawable/addsubutils_right_selector"
+        android:clickable="true"
+        android:padding="@dimen/addsubutils_btn_padding"
+        android:scaleType="centerInside"
+        android:src="@drawable/addsubutils_ic_plus" />
+</LinearLayout>

+ 29 - 0
app_modular/appbooking/src/main/res/values/attrs.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <declare-styleable name="AddSubUtils">
+        <!--是否可以手动输入-->
+        <attr name="editable" format="boolean"></attr>
+        <!--输入框的位置-->
+        <attr name="location" format="string"></attr>
+        <!-- 左右2边+-按钮的宽度 -->
+        <attr name="ImageWidth" format="dimension" />
+        <!-- 中间EditText的宽度 -->
+        <attr name="contentWidth" format="dimension" />
+        <!--中间TextView的大小-->
+        <attr name="contentTextSize" format="dimension"/>
+        <!--中间字体的颜色-->
+        <attr name="contentTextColor" format="color"/>
+        <!--整个控件的background-->
+        <attr name="all_background" format="color|reference"/>
+        <!--左面控件的背景-->
+        <attr name="leftBackground" format="color|reference"/>
+        <!--右面控件的背景-->
+        <attr name="rightBackground" format="color|reference"/>
+        <!--中间控件的背景-->
+        <attr name="contentBackground" format="color|reference"/>
+        <!--左面控件的资源-->
+        <attr name="leftResources" format="color|reference"/>
+        <!--右面控件的资源-->
+        <attr name="rightResources" format="color|reference"/>
+    </declare-styleable>
+</resources>

+ 17 - 0
app_modular/appbooking/src/main/res/values/colors.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="industry_sub_pressed">#dadada</color>
+    <color name="industry_sub_unpressed">#ebe9e9</color>
+    <color name="divider">#999</color>
+    <color name="white">#fff</color>
+    <color name="material_amber_200">#FFE082</color>
+    <color name="material_amber_300">#FFD54F</color>
+    <color name="material_amber_400">#FFCA28</color>
+    <color name="material_light_green_200">#C5E1A5</color>
+    <color name="material_light_green_300">#AED581</color>
+    <color name="material_light_green_400">#9CCC65</color>
+    <color name="material_teal_200">#80CBC4</color>
+    <color name="material_teal_300">#4DB6AC</color>
+    <color name="material_teal_400">#26A69A</color>
+    <color name="addsubutils_text">#999</color>
+</resources>

+ 7 - 0
app_modular/appbooking/src/main/res/values/dimens.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="addsubutils_btn_width" >30dp</dimen>
+    <dimen name="addsubutils_btn_padding">10dp</dimen>
+    <dimen name="addsubutils_textsize" >15sp</dimen>
+    <dimen name="addsubutils_et_minwidth" >65dp</dimen>
+</resources>

+ 15 - 0
app_modular/appbooking/src/main/res/values/styles.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <style name="item_number_add_sub_style">
+        <item name="android:clickable">true</item>
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:paddingBottom">3dp</item>
+        <item name="android:paddingLeft">16dp</item>
+        <item name="android:paddingRight">16dp</item>
+        <item name="android:paddingTop">3dp</item>
+    </style>
+    
+   
+</resources>

+ 1 - 1
app_modular/applogin/src/main/java/com/modular/login/activity/PersonalRegActivity.java

@@ -94,7 +94,7 @@ public class PersonalRegActivity extends BaseActivity implements View.OnClickLis
 
     private void doRegiter() {
         progressDialog.dismiss();
-        String url = "http://113.105.74.140:8092/" + "user/appRegister";
+        String url = Constants.IM_BASE_URL() + "user/appRegister";
         Map<String, Object> params = new HashMap<>();
         params.put("telephone", phone_et.getText().toString());
         params.put("password", md5_password);

+ 29 - 0
app_modular/applogin/src/main/res/values/attrs.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <declare-styleable name="AddSubUtils">
+        <!--是否可以手动输入-->
+        <attr name="editable" format="boolean"></attr>
+        <!--输入框的位置-->
+        <attr name="location" format="string"></attr>
+        <!-- 左右2边+-按钮的宽度 -->
+        <attr name="ImageWidth" format="dimension" />
+        <!-- 中间EditText的宽度 -->
+        <attr name="contentWidth" format="dimension" />
+        <!--中间TextView的大小-->
+        <attr name="contentTextSize" format="dimension"/>
+        <!--中间字体的颜色-->
+        <attr name="contentTextColor" format="color"/>
+        <!--整个控件的background-->
+        <attr name="all_background" format="color|reference"/>
+        <!--左面控件的背景-->
+        <attr name="leftBackground" format="color|reference"/>
+        <!--右面控件的背景-->
+        <attr name="rightBackground" format="color|reference"/>
+        <!--中间控件的背景-->
+        <attr name="contentBackground" format="color|reference"/>
+        <!--左面控件的资源-->
+        <attr name="leftResources" format="color|reference"/>
+        <!--右面控件的资源-->
+        <attr name="rightResources" format="color|reference"/>
+    </declare-styleable>
+</resources>

+ 12 - 0
app_modular/applogin/src/main/res/values/colors.xml

@@ -2,4 +2,16 @@
 <resources>
     <color name="industry_sub_pressed">#dadada</color>
     <color name="industry_sub_unpressed">#ebe9e9</color>
+    <color name="divider">#999</color>
+    <color name="white">#fff</color>
+    <color name="material_amber_200">#FFE082</color>
+    <color name="material_amber_300">#FFD54F</color>
+    <color name="material_amber_400">#FFCA28</color>
+    <color name="material_light_green_200">#C5E1A5</color>
+    <color name="material_light_green_300">#AED581</color>
+    <color name="material_light_green_400">#9CCC65</color>
+    <color name="material_teal_200">#80CBC4</color>
+    <color name="material_teal_300">#4DB6AC</color>
+    <color name="material_teal_400">#26A69A</color>
+    <color name="addsubutils_text">#999</color>
 </resources>

+ 10 - 0
app_modular/applogin/src/main/res/values/styles.xml

@@ -1,6 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
+    <style name="item_number_add_sub_style">
+        <item name="android:clickable">true</item>
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:paddingBottom">3dp</item>
+        <item name="android:paddingLeft">16dp</item>
+        <item name="android:paddingRight">16dp</item>
+        <item name="android:paddingTop">3dp</item>
+    </style>
+    
     <style name="register_edittext_style">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">wrap_content</item>

+ 4 - 3
version.gradle

@@ -43,7 +43,8 @@ ext {
             jodatimeVersion         : '2.9.4',
             gifVersion              : '1.2.8',
             recyclerLib             : 'v1.0',
-            vlayoutVersion          : '1.2.1'
+            vlayoutVersion          : '1.2.1',
+            addSubUtilsVersion      : '1.5.0'
     ]
 
     deps = [
@@ -90,8 +91,8 @@ ext {
             jodatime           : 'joda-time:joda-time:' + depsVersion.jodatimeVersion,
             gif                : 'pl.droidsonroids.gif:android-gif-drawable:' + depsVersion.gifVersion,
             recyclerLib        : 'com.gxut.ui:recyclerlibrary:' + depsVersion.recyclerLib,
-            vlayout            : 'com.alibaba.android:vlayout:' + depsVersion.vlayoutVersion
-
+            vlayout            : 'com.alibaba.android:vlayout:' + depsVersion.vlayoutVersion,
+            addSubUtils        : 'com.mengfei:AddSubUtils:'+depsVersion.addSubUtilsVersion
     ]
 }