Commit d893913e authored by 陈前's avatar 陈前

Merge remote-tracking branch 'origin/master'

parents d6e44077 f3c8e65f
...@@ -28,6 +28,7 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog; ...@@ -28,6 +28,7 @@ import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.dialog.PromptDialog; import com.xingdata.zzdpos.ui.dialog.PromptDialog;
import com.xingdata.zzdpos.ui.manage.bale.BalePresenter; import com.xingdata.zzdpos.ui.manage.bale.BalePresenter;
import com.xingdata.zzdpos.ui.manage.bale.adpter.EditFragmentImgShopAdapter; import com.xingdata.zzdpos.ui.manage.bale.adpter.EditFragmentImgShopAdapter;
import com.xingdata.zzdpos.ui.scan.ScanFragment;
import com.xingdata.zzdpos.util.ConvertUtil; import com.xingdata.zzdpos.util.ConvertUtil;
import com.xingdata.zzdpos.util.InputFilters; import com.xingdata.zzdpos.util.InputFilters;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
...@@ -155,6 +156,23 @@ public class BaleEditFragment extends BaseFragment<BalePresenter, FragmentBaleEd ...@@ -155,6 +156,23 @@ public class BaleEditFragment extends BaseFragment<BalePresenter, FragmentBaleEd
}).show((BaseActivity) getActivity()); }).show((BaseActivity) getActivity());
}
break;
case R.id.btn_scan: {
ScanFragment mScanFragment = new ScanFragment();
mScanFragment.setOnScanCompletedListener(new ScanFragment
.OnScanCompletedListener() {
@Override
public void OnScanCompleted(String barcode) {
pop();
mPresenter.mBaleSeachShopFragment.seachBarcode(barcode);
start(mPresenter.mBaleSeachShopFragment);
}
});
if (!mScanFragment.isAdded()) {
start(mScanFragment);
}
} }
break; break;
} }
......
...@@ -18,6 +18,7 @@ import com.xingdata.zzdpos.model.Ussku; ...@@ -18,6 +18,7 @@ import com.xingdata.zzdpos.model.Ussku;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog; import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.bale.BalePresenter; import com.xingdata.zzdpos.ui.manage.bale.BalePresenter;
import com.xingdata.zzdpos.ui.manage.bale.adpter.BaleIndexAdapter; import com.xingdata.zzdpos.ui.manage.bale.adpter.BaleIndexAdapter;
import com.xingdata.zzdpos.ui.scan.ScanFragment;
import com.xingdata.zzdpos.util.OnClickListener; import com.xingdata.zzdpos.util.OnClickListener;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -74,6 +75,28 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI ...@@ -74,6 +75,28 @@ public class BaleIndexFragment extends BaseFragment<BalePresenter, FragmentBaleI
ActivityUtils.finishActivity(getActivity()); ActivityUtils.finishActivity(getActivity());
} }
break; break;
case R.id.btn_scan: {
ScanFragment mScanFragment = new
ScanFragment();
mScanFragment.setOnScanCompletedListener
(new ScanFragment
.OnScanCompletedListener() {
@Override
public void OnScanCompleted
(String barcode) {
pop();
loadingDialog.show(
(BaseActivity)
getActivity());
mPresenter.usskuQuery
(barcode, loadingDialog);
}
});
if (!mScanFragment.isAdded()) {
start(mScanFragment);
}
}
break;
default: { default: {
} }
......
...@@ -5,7 +5,6 @@ import android.view.KeyEvent; ...@@ -5,7 +5,6 @@ import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import com.blankj.utilcode.util.KeyboardUtils;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseActivity; import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
...@@ -39,13 +38,8 @@ public class BaleSeachFragment extends BaseFragment<BalePresenter, FragmentBaleS ...@@ -39,13 +38,8 @@ public class BaleSeachFragment extends BaseFragment<BalePresenter, FragmentBaleS
} }
break; break;
case R.id.btn_seach: { case R.id.btn_seach: {
loadingDialog.show((BaseActivity) seach(mViewBinding.etKeyword
getActivity()); .getText().toString());
mPresenter.usskuQuery(mViewBinding
.etKeyword.getText()
.toString(),
loadingDialog);
pop();
} }
break; break;
default: { default: {
...@@ -61,14 +55,8 @@ public class BaleSeachFragment extends BaseFragment<BalePresenter, FragmentBaleS ...@@ -61,14 +55,8 @@ public class BaleSeachFragment extends BaseFragment<BalePresenter, FragmentBaleS
public boolean onEditorAction public boolean onEditorAction
(TextView textView, int i, (TextView textView, int i,
KeyEvent keyEvent) { KeyEvent keyEvent) {
loadingDialog.show((BaseActivity) seach(mViewBinding.etKeyword
getActivity()); .getText().toString());
mPresenter.usskuQuery(mViewBinding
.etKeyword
.getText()
.toString(),
loadingDialog);
pop();
return false; return false;
} }
} }
...@@ -77,4 +65,10 @@ public class BaleSeachFragment extends BaseFragment<BalePresenter, FragmentBaleS ...@@ -77,4 +65,10 @@ public class BaleSeachFragment extends BaseFragment<BalePresenter, FragmentBaleS
Global.setFocus(mViewBinding.etKeyword, getActivity()); Global.setFocus(mViewBinding.etKeyword, getActivity());
} }
public void seach(String str) {
loadingDialog.show((BaseActivity)
getActivity());
mPresenter.usskuQuery(str, loadingDialog);
pop();
}
} }
...@@ -34,6 +34,7 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter, ...@@ -34,6 +34,7 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter,
private boolean isAddData = false; private boolean isAddData = false;
private List<Sssku> nowData = new ArrayList<>(); private List<Sssku> nowData = new ArrayList<>();
public String barCode = null;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -61,7 +62,16 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter, ...@@ -61,7 +62,16 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter,
getEmptyView("没有数据"); getEmptyView("没有数据");
} }
loadingDialog.show((BaseActivity) getActivity()); loadingDialog.show((BaseActivity) getActivity());
mPresenter.queryShopItem(mViewBinding.etKeyword.getText().toString(), true, loadingDialog); if (barCode != null) {
mViewBinding.etKeyword.setText(barCode);
mPresenter.queryShopItem(barCode, true,
loadingDialog);
} else {
mPresenter.queryShopItem(mViewBinding.etKeyword.getText().toString(), true,
loadingDialog);
}
mViewBinding.setOnClickListener(new OnClickListener() { mViewBinding.setOnClickListener(new OnClickListener() {
@Override @Override
protected void myOnClickListener(View v) { protected void myOnClickListener(View v) {
...@@ -170,6 +180,9 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter, ...@@ -170,6 +180,9 @@ public class BaleSeachShopFragment extends BaseFragment<BalePresenter,
} }
} }
public void seachBarcode(String barCode) {
this.barCode = barCode;
}
/** /**
* 获取空页面 * 获取空页面
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
android:id="@+id/btn_scan" android:id="@+id/btn_scan"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="@{OnClickListener}"
android:background="@color/transparent" android:background="@color/transparent"
android:contentDescription="@string/store_scan" android:contentDescription="@string/store_scan"
android:foreground="?android:attr/actionBarItemBackground" android:foreground="?android:attr/actionBarItemBackground"
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/transparent" android:background="@color/transparent"
android:onClick="@{OnClickListener}"
android:contentDescription="@string/store_scan" android:contentDescription="@string/store_scan"
android:foreground="?android:attr/actionBarItemBackground" android:foreground="?android:attr/actionBarItemBackground"
android:src="@mipmap/but_sweep_yard"/> android:src="@mipmap/but_sweep_yard"/>
......
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