Commit c371f1a8 authored by zhang_z's avatar zhang_z

Merge remote-tracking branch 'origin/master'

parents cbbdd4e5 bcafe356
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<activity <activity
android:name=".ui.splash.SplashActivity" android:name=".ui.splash.SplashActivity"
android:configChanges="keyboard|orientation|screenSize|keyboardHidden" android:configChanges="keyboard|orientation|screenSize|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
......
package com.xingdata.zzdpos.ui.manage.otherselect; package com.xingdata.zzdpos.ui.manage.otherselect;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View;
import com.blankj.utilcode.util.FragmentUtils;
import com.blankj.utilcode.util.KeyboardUtils; import com.blankj.utilcode.util.KeyboardUtils;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
...@@ -9,11 +11,16 @@ import com.xingdata.zzdpos.base.BaseActivity; ...@@ -9,11 +11,16 @@ import com.xingdata.zzdpos.base.BaseActivity;
import com.xingdata.zzdpos.databinding.ActivityOtherSelectBinding; import com.xingdata.zzdpos.databinding.ActivityOtherSelectBinding;
import com.xingdata.zzdpos.model.Ossku; import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager; import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.dialog.LoadingDialog;
import com.xingdata.zzdpos.ui.manage.otherselect.fragment.OtherDetailFragment;
import com.xingdata.zzdpos.ui.manage.otherselect.fragment.OtherListFragment; import com.xingdata.zzdpos.ui.manage.otherselect.fragment.OtherListFragment;
import com.xingdata.zzdpos.util.OnClickListener;
public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, ActivityOtherSelectBinding> implements OtherSelectContract.View { public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, ActivityOtherSelectBinding> implements OtherSelectContract.View {
private OtherListFragment mOtherListFragment = new OtherListFragment(); private OtherListFragment mOtherListFragment = new OtherListFragment();
private OtherDetailFragment mOtherDetailFragment = new OtherDetailFragment();
LoadingDialog mLoadingDialog = new LoadingDialog();
@Override @Override
public int getLayoutId() { public int getLayoutId() {
...@@ -22,26 +29,57 @@ public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, Acti ...@@ -22,26 +29,57 @@ public class OtherSelectActivity extends BaseActivity<OtherSelectPresenter, Acti
@Override @Override
public void initView() { public void initView() {
loadRootFragment(R.id.fragment_container, mOtherListFragment, false, false); mViewBinding.lyTitle.ivRight.setVisibility(View.GONE);
FragmentUtils.add(getSupportFragmentManager(), mOtherListFragment, mViewBinding.fragmentContainer.getId(), false, true);
mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> { mViewBinding.lyTitle.edTitle.setOnKeyListener((v, keyCode, event) -> {
if (keyCode == KeyEvent.KEYCODE_ENTER) if (keyCode == KeyEvent.KEYCODE_ENTER)
search(mViewBinding.lyTitle.edTitle.getText().toString().trim()); search(mViewBinding.lyTitle.edTitle.getText().toString().trim());
return false; return false;
}); });
mViewBinding.lyTitle.setOnClickListener(new OnClickListener() {
@Override
protected void myOnClickListener(View v) {
if (mViewBinding.lyTitle.edTitle.isFocused()) {
mViewBinding.lyTitle.edTitle.clearFocus();
}
if (mOtherDetailFragment.isAdded()) {
mOtherDetailFragment.pop();
return;
}
finish();
}
});
} }
@Override @Override
public void isShowLoading(Boolean is) { public void isShowLoading(Boolean is) {
if (is) {
mLoadingDialog.show((BaseActivity) mContext);
} else {
if (mLoadingDialog.isShowing) {
mLoadingDialog.dismiss();
}
}
} }
@Override @Override
public void loadOssku(Pager<Ossku> osskuList, boolean isRefresh) { public void loadOssku(Pager<Ossku> osskuList, boolean isRefresh) {
if (mOtherDetailFragment.isAdded()) {
mOtherDetailFragment.pop();
}
mOtherListFragment.setData(osskuList, isRefresh); mOtherListFragment.setData(osskuList, isRefresh);
} }
@Override
public void showOsskuDetail(Ossku ossku) {
mOtherDetailFragment.setOssku(ossku);
FragmentUtils.add(getSupportFragmentManager(), mOtherDetailFragment, mViewBinding.fragmentContainer.getId(), false, true);
}
@Override @Override
protected void onPause() { protected void onPause() {
KeyboardUtils.hideSoftInput(this); KeyboardUtils.hideSoftInput(this);
......
...@@ -21,10 +21,13 @@ public interface OtherSelectContract { ...@@ -21,10 +21,13 @@ public interface OtherSelectContract {
* 加载列表 * 加载列表
*/ */
void loadOssku(Pager<Ossku> osskuList, boolean isRefresh); void loadOssku(Pager<Ossku> osskuList, boolean isRefresh);
void showOsskuDetail(Ossku ossku);
} }
abstract class Presenter extends BasePresenter<View> { abstract class Presenter extends BasePresenter<View> {
public abstract void clickOsskuItem(Ossku ossku);
/** /**
* 临库查询界面 - 查找 * 临库查询界面 - 查找
* *
......
...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.ui.manage.otherselect; ...@@ -3,6 +3,7 @@ package com.xingdata.zzdpos.ui.manage.otherselect;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory; import com.xingdata.zzdpos.api.ApiFactory;
import com.xingdata.zzdpos.model.Ossku;
public class OtherSelectPresenter extends OtherSelectContract.Presenter { public class OtherSelectPresenter extends OtherSelectContract.Presenter {
...@@ -18,6 +19,11 @@ public class OtherSelectPresenter extends OtherSelectContract.Presenter { ...@@ -18,6 +19,11 @@ public class OtherSelectPresenter extends OtherSelectContract.Presenter {
} }
@Override
public void clickOsskuItem(Ossku ossku) {
mView.showOsskuDetail(ossku);
}
@Override @Override
public void searchGoodsFirst(String keyword) { public void searchGoodsFirst(String keyword) {
wd = keyword; wd = keyword;
......
...@@ -7,11 +7,13 @@ import android.widget.TextView; ...@@ -7,11 +7,13 @@ import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.xingdata.zzdpos.R; import com.xingdata.zzdpos.R;
import com.xingdata.zzdpos.base.BaseFragment; import com.xingdata.zzdpos.base.BaseFragment;
import com.xingdata.zzdpos.databinding.FragmentOtherDetailBinding;
import com.xingdata.zzdpos.databinding.FragmentOtherListBinding; import com.xingdata.zzdpos.databinding.FragmentOtherListBinding;
import com.xingdata.zzdpos.model.Ossku; import com.xingdata.zzdpos.model.Ossku;
import com.xingdata.zzdpos.model.Pager; import com.xingdata.zzdpos.model.Pager;
import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectPresenter; import com.xingdata.zzdpos.ui.manage.otherselect.OtherSelectPresenter;
import com.xingdata.zzdpos.ui.manage.otherselect.adpter.OtherSelectAdapter; import com.xingdata.zzdpos.ui.manage.otherselect.adpter.OtherSelectAdapter;
import com.xingdata.zzdpos.util.ConvertUtil;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -19,71 +21,32 @@ import java.util.ArrayList; ...@@ -19,71 +21,32 @@ import java.util.ArrayList;
* Created by Administrator on 2017/11/23. * Created by Administrator on 2017/11/23.
*/ */
public class OtherDetailFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherListBinding> { public class OtherDetailFragment extends BaseFragment<OtherSelectPresenter, FragmentOtherDetailBinding> {
private OtherSelectAdapter mOtherSelectAdapter; private Ossku ossku;
@Override @Override
public int getLayoutId() { public int getLayoutId() {
return R.layout.fragment_other_list; return R.layout.fragment_other_detail;
} }
@Override @Override
public void initView() { public void initView() {
if (ossku != null) {
mViewBinding.tvGoodsName.setText(ossku.getSpuName());
mOtherSelectAdapter = new OtherSelectAdapter(new ArrayList<>()); mViewBinding.tvGoodsCode.setText(ossku.getSpuBarcode() + "");
mOtherSelectAdapter.setEmptyView(getEmptyView(R.string.empty_other_select)); mViewBinding.tvPrice.setText(ConvertUtil.fenToYuan(ossku.getSkuRetailPrice1(), false));
mViewBinding.recyclerOtherSelcet.setLayoutManager(new LinearLayoutManager(getActivity())); mViewBinding.tvGoodsSize.setText("规格/" + ossku.getSpuUnitName());
mViewBinding.recyclerOtherSelcet.setAdapter(mOtherSelectAdapter); mViewBinding.imgGoods.setImageURI(ossku.getSpuImg());
mViewBinding.setStock("库存:" + ossku.getSkuStock());
mViewBinding.setShopName(ossku.getShopName());
mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mViewBinding.setAddress(ossku.getCityAddress());
@Override mViewBinding.setPhone(ossku.getContactTel());
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class);
// intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
// ActivityUtils.startActivity(intent);
}
});
mViewBinding.srlProduct.setOnRefreshListener(this::onRefresh);
mOtherSelectAdapter.setOnLoadMoreListener(this::onLoadMore, mViewBinding.recyclerOtherSelcet);
}
private void onRefresh() {
mPresenter.refresh();
}
private void onLoadMore() {
mPresenter.loadMore();
}
/**
* 设置数据
*
* @param pager 数据
* @param isRefresh 是否刷新
*/
public void setData(Pager<Ossku> pager, boolean isRefresh) {
if (isRefresh) {
mOtherSelectAdapter.setEnableLoadMore(true);
mViewBinding.srlProduct.setRefreshing(false);
} }
if (isRefresh) mOtherSelectAdapter.setNewData(pager.getList());
else if (pager.getList().size() > 0) mOtherSelectAdapter.addData(pager.getList());
if (pager.isLastPage()) mOtherSelectAdapter.loadMoreEnd(isRefresh);
else mOtherSelectAdapter.loadMoreComplete();
} }
private View getEmptyView(int resHint) { public void setOssku(Ossku ossku) {
View view = getLayoutInflater().inflate(R.layout.view_empty, null); this.ossku = ossku;
view.setBackgroundResource(R.color.white_caocao);
((TextView) view.findViewById(R.id.tv_empty)).setText(resHint);
return view;
} }
......
...@@ -51,9 +51,7 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme ...@@ -51,9 +51,7 @@ public class OtherListFragment extends BaseFragment<OtherSelectPresenter, Fragme
mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() { mOtherSelectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
// Intent intent = new Intent(getActivity(), StatisticsDetailActivity.class); mPresenter.clickOsskuItem(mOtherSelectAdapter.getData().get(position));
// intent.putExtra(Saleorder.class.getName(), mStatisticsAdapter.getData().get(position).getId());
// ActivityUtils.startActivity(intent);
} }
}); });
......
...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment; ...@@ -2,6 +2,7 @@ package com.xingdata.zzdpos.ui.manage.replenishment;
import android.util.Log; import android.util.Log;
import android.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xingdata.zzdpos.api.ApiFactory; import com.xingdata.zzdpos.api.ApiFactory;
...@@ -31,7 +32,12 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter { ...@@ -31,7 +32,12 @@ public class ReplenishmentPresenter extends ReplenishmentContract.Presenter {
mView.isShowLoading(false); mView.isShowLoading(false);
}) })
.subscribe(ssskuPager -> { .subscribe(ssskuPager -> {
mView.openReplenishmentDetailFragment(ssskuPager.getList()); if (ssskuPager.getList().size() == 0) {
ToastUtils.showShort("库存正常,无需补货");
} else {
mView.openReplenishmentDetailFragment(ssskuPager.getList());
}
}, throwable -> { }, throwable -> {
ToastUtils.showShort(throwable.getMessage()); ToastUtils.showShort(throwable.getMessage());
}); });
......
package com.xingdata.zzdpos.ui.marketing.integral.fragment; package com.xingdata.zzdpos.ui.marketing.integral.fragment;
import android.app.IntentService;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
......
...@@ -243,6 +243,7 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter, ...@@ -243,6 +243,7 @@ public class SendTickerFragment extends BaseFragment<SendTicketPresenter,
private boolean isNull() { private boolean isNull() {
if (nowtype == 0) { if (nowtype == 0) {
//单个会员发券 //单个会员发券
if (null == nowVip || nowTickerItemId < 0) { if (null == nowVip || nowTickerItemId < 0) {
ToastUtils.showLong("请选择会员或优惠券"); ToastUtils.showLong("请选择会员或优惠券");
return false; return false;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding_left_right"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
......
...@@ -3,6 +3,24 @@ ...@@ -3,6 +3,24 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="shopName"
type="String" />
<variable
name="address"
type="String" />
<variable
name="phone"
type="String" />
<variable
name="stock"
type="String" />
</data>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -78,14 +96,25 @@ ...@@ -78,14 +96,25 @@
app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint" app:layout_constraintStart_toStartOf="@id/tv_goods_code_hint"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" /> app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥"
android:layout_marginBottom="@dimen/view_line_L2"
android:textColor="@color/red_lvzhi"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintBottom_toBottomOf="@id/tv_price"
app:layout_constraintEnd_toStartOf="@id/tv_price"
/>
<TextView <TextView
android:id="@+id/tv_price" android:id="@+id/tv_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/all_padding_left_right" android:layout_marginEnd="@dimen/all_padding_left_right"
android:padding="@dimen/dp_4" android:textColor="@color/red_lvzhi"
android:textColor="@color/black_baozheng" android:textSize="@dimen/big_text_size"
android:textSize="@dimen/all_text_size_small"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" /> app:layout_constraintTop_toBottomOf="@id/tv_goods_code_hint" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
...@@ -97,9 +126,61 @@ ...@@ -97,9 +126,61 @@
android:weightSum="2"> android:weightSum="2">
<TextView <TextView
android:layout_width="wrap_content" style="@style/textView_body"
android:layout_height="wrap_content" /> android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/singleline_white_gray"
android:text="邻库" />
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/singleline_white_gray"
android:gravity="right"
android:padding="@dimen/all_padding"
android:text="@{stock}"
android:textColor="@color/red_lvzhi" />
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_caocao"
android:drawablePadding="@dimen/all_padding"
android:drawableStart="@mipmap/icon_stores"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right"
android:text="@{shopName}"
android:textSize="@dimen/all_text_size_low" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_padding"
android:background="@color/white_caocao"
android:drawableStart="@mipmap/icon_address"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right"
android:text="@{address}"
android:textSize="@dimen/all_text_size_low" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="@dimen/all_padding"
android:background="@color/white_caocao"
android:drawableStart="@mipmap/icon_telephone"
android:paddingStart="@dimen/all_padding_left_right"
android:paddingEnd="@dimen/all_padding_left_right"
android:paddingTop="@dimen/all_padding_left_right"
android:paddingBottom="@dimen/all_padding_left_right"
android:text="@{phone}"
android:textSize="@dimen/all_text_size_low" />
</LinearLayout> </LinearLayout>
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding_left_right" android:layout_marginTop="@dimen/all_padding_left_right"
android:background="@color/white" android:background="@color/white"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -28,10 +28,9 @@ ...@@ -28,10 +28,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/iv" android:layout_toLeftOf="@+id/iv"
android:paddingTop="@dimen/all_padding"
android:paddingBottom="@dimen/all_padding" android:paddingBottom="@dimen/all_padding"
android:paddingStart="@dimen/all_padding_left_right" android:paddingStart="@dimen/all_padding_left_right"
> android:paddingTop="@dimen/all_padding">
<ImageView <ImageView
android:id="@+id/iv_logo" android:id="@+id/iv_logo"
...@@ -55,6 +54,7 @@ ...@@ -55,6 +54,7 @@
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:background="@color/gray_kongming" /> android:background="@color/gray_kongming" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/view_line_L050" android:layout_height="@dimen/view_line_L050"
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
</data> </data>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/all_padding" android:layout_marginTop="@dimen/all_padding"
android:orientation="horizontal"> android:orientation="horizontal">
......
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