Commit a465a7bd authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

parents 34daf316 cfaaeaaa
......@@ -141,11 +141,7 @@ public class SettleActivity extends BaseActivity<SettlePresenter, ActivitySettle
break;
case C.PAY_CHANNEL.BANK:
case C.PAY_CHANNEL.ALI:
mScanFragment.setOnScanCompletedListener(barcode -> {
this.pop();
mPresenter.payInAli(barcode);
});
this.start(mScanFragment);
showMsg("暂时无法使用");
break;
case C.PAY_CHANNEL.WECHAT:
mScanFragment.setOnScanCompletedListener(barcode -> {
......
......@@ -36,8 +36,7 @@ import java.util.ArrayList;
import java.util.List;
public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBinding> implements
StoreContract.View {
public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBinding> implements StoreContract.View {
private StoreFragment mStoreFragment = new StoreFragment();
private SearchFragment mSearchFragment = new SearchFragment();
......@@ -165,7 +164,17 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
mViewBinding.setTitleMode(C.TITLE_MODE.SKU);
mViewBinding.etSearch.setText("");
mViewBinding.etSearch.requestFocus();
this.start(mSearchFragment);
this.start(mSearchFragment.setKeyword(""));
}
}
@Override
public void showSearchFragment(String keyword) {
if (!mSearchFragment.isAdded()) {
mViewBinding.setTitleMode(C.TITLE_MODE.SKU);
mViewBinding.etSearch.setText(keyword);
mViewBinding.etSearch.requestFocus();
this.start(mSearchFragment.setKeyword(keyword));
}
}
......@@ -194,28 +203,28 @@ public class StoreActivity extends BaseActivity<StorePresenter, ActivityStoreBin
* @param scaleLarge 放大比例
* @param duration 时间
*/
private void startShakeByPropertyAnim(View view, float scaleSmall, float scaleLarge, long
duration) {
private void startShakeByPropertyAnim(View view, float scaleSmall, float scaleLarge, long duration) {
if (view == null) {
return;
}
//先变小后变大
PropertyValuesHolder scaleXValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_X,
PropertyValuesHolder scaleXValuesHolder = PropertyValuesHolder.ofKeyframe(
View.SCALE_X,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
PropertyValuesHolder scaleYValuesHolder = PropertyValuesHolder.ofKeyframe(View.SCALE_Y,
PropertyValuesHolder scaleYValuesHolder = PropertyValuesHolder.ofKeyframe(
View.SCALE_Y,
Keyframe.ofFloat(0f, 1.0f),
Keyframe.ofFloat(0.25f, scaleSmall),
Keyframe.ofFloat(0.5f, scaleLarge),
Keyframe.ofFloat(0.75f, scaleLarge),
Keyframe.ofFloat(1.0f, 1.0f)
);
ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(view,
scaleXValuesHolder, scaleYValuesHolder);
ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(view, scaleXValuesHolder, scaleYValuesHolder);
objectAnimator.setDuration(duration);
objectAnimator.start();
}
......
......@@ -102,6 +102,13 @@ interface StoreContract {
*/
void showSearchFragment();
/**
* 显示搜索页面
*
* @param keyword 搜索内容
*/
void showSearchFragment(String keyword);
/**
* 显示扫码页面
*/
......
......@@ -354,8 +354,7 @@ public class StorePresenter extends StoreContract.Presenter {
.equalTo("skuStatus", 0)
.findAll());
if (ssskus.size() + usskus.size() > 1) {
mView.showSearchFragment();
this.searchSku(barcode);
mView.showSearchFragment(barcode);
} else if (ssskus.size() == 1 && usskus.size() == 0) {
this.clickAddSku(ssskus.get(0), 1);
} else if (ssskus.size() == 0 && usskus.size() == 1) {
......
......@@ -12,6 +12,7 @@ import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.StringUtils;
import com.xingdata.zzdpos.C;
import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment;
......@@ -26,7 +27,9 @@ import java.util.List;
public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSearchBinding> {
private SkuAdapter mSkuAdapter;
private List<Saledetail> mSaledetails;
private String mKeyword;
@Override
public int getLayoutId() {
......@@ -52,6 +55,9 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe
@SuppressLint("InflateParams") View view = getLayoutInflater().inflate(R.layout.view_empty, null);
mSkuAdapter.setEmptyView(view);
mSkuAdapter.isUseEmpty(false);
//init
if (!StringUtils.isEmpty(mKeyword)) mPresenter.searchSku(mKeyword);
}
......@@ -108,6 +114,16 @@ public class SearchFragment extends BaseFragment<StorePresenter, FragmentStoreSe
}
/**
* 设置搜索关键字
*
* @param keyword 关键字
*/
public SearchFragment setKeyword(String keyword) {
this.mKeyword = keyword;
return this;
}
/**
* 点击添加按钮
*
......
......@@ -31,9 +31,8 @@ import java.util.List;
public class StoreFragment extends BaseFragment<StorePresenter, FragmentStoreBinding> {
private SkugrpAdapter mSkugrpAdapter;
private SkuAdapter mSkuAdapter;
private SkugrpAdapter mSkugrpAdapter;
public interface OnCountChangeListener {
void onCountChange(View view, BaseSku sku, int value);
......
package com.xingdata.zzdpos;
public class zxpay {
static {
System.loadLibrary("jsonpay");
}
public static native String jsonpay(String string);
}
......@@ -123,6 +123,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_padding"
android:text="积分面值:"
android:textColor="@color/black_baozheng"
......@@ -173,6 +175,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:gravity="left"
android:paddingLeft="@dimen/all_padding"
android:text="订单实收满 "
......@@ -221,6 +225,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:gravity="left"
android:paddingLeft="@dimen/all_padding"
android:text="可以使用 "
......@@ -250,6 +256,7 @@
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
......
......@@ -196,6 +196,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_bounced_padding"
android:text="会员等级:"
android:textColor="@color/black_baozheng"
......@@ -341,6 +343,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_bounced_padding"
android:text="积分比例:"
android:textColor="@color/black_baozheng"
......@@ -392,6 +396,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_bounced_padding"
android:text="有效期限:"
android:textColor="@color/black_baozheng"
......@@ -445,6 +451,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_bounced_padding"
android:text="商品品类:"
android:textColor="@color/black_baozheng"
......@@ -542,6 +550,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_bounced_padding"
android:text="积分比例:"
android:textColor="@color/black_baozheng"
......@@ -592,6 +602,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_bounced_padding"
android:text="有效期限:"
android:textColor="@color/black_baozheng"
......@@ -638,6 +650,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:paddingLeft="@dimen/all_bounced_padding"
android:text="有效期限:"
android:textColor="@color/black_baozheng"
......
......@@ -118,12 +118,14 @@
android:textSize="@dimen/et_textsize"/>
</RadioGroup>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:background="@color/gray1"></View>
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
......@@ -159,6 +161,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:text="优惠券面值:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
......@@ -184,12 +188,14 @@
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:background="@color/gray1"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -200,6 +206,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:text="券有效期:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
......@@ -222,12 +230,14 @@
android:layout_weight="2"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:background="@color/gray1"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -238,6 +248,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:text="订单金额满:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
......@@ -263,12 +275,14 @@
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
android:layout_marginLeft="@dimen/all_padding"
android:layout_marginRight="@dimen/all_padding"
android:background="@color/gray1"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -279,6 +293,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:text="每单使用:"
android:textColor="@color/black_baozheng"
android:textSize="@dimen/et_textsize"/>
......@@ -308,6 +324,7 @@
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/all_line_width"
......
......@@ -125,8 +125,7 @@
android:layout_height="wrap_content"
android:layout_below="@+id/cl_title"
android:background="@color/white"
android:orientation="horizontal"
>
android:orientation="horizontal">
<TextView
android:id="@+id/tv_keyword"
......@@ -154,13 +153,19 @@
/>
</LinearLayout>
<View
android:id="@+id/vw"
android:layout_width="match_parent"
android:layout_height="@dimen/all_bounced_padding"
android:layout_below="@+id/ll_keyword"
android:background="@drawable/up_down_line_gray"></View>
<LinearLayout
android:id="@+id/ll_left"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_keyword"
android:orientation="vertical"
>
android:layout_below="@+id/vw"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
......@@ -222,6 +227,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:text="名称:"
android:textColor="@color/black"/>
......@@ -258,6 +265,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:drawableLeft="@mipmap/point"
android:drawablePadding="@dimen/all_bounced_spacing"
android:text="价格:"
android:textColor="@color/black"/>
......
......@@ -126,7 +126,7 @@
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/singleline_white_gray"
android:background="@drawable/up_down_line_gray"
android:gravity="center"
android:onClick="@{OnClickListener}"
android:orientation="horizontal"
......
......@@ -10,7 +10,11 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_sku"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
......@@ -81,7 +81,7 @@
android:foreground="?android:attr/actionBarItemBackground"
android:padding="@dimen/all_spacing"
android:src="@mipmap/but_reduce"
android:visibility="visible" />
android:visibility="gone" />
<TextView
android:id="@+id/tv_count"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment