Commit c371f1a8 authored by zhang_z's avatar zhang_z

Merge remote-tracking branch 'origin/master'

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