1
This commit is contained in:
@@ -50,6 +50,12 @@ public class AddAddressActivity extends BaseActivity<ActivityAddAddressBinding>
|
||||
// | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
|
||||
//.barColor(R.color.colorPrimary)
|
||||
.init();
|
||||
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
context = this;
|
||||
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -136,6 +136,16 @@ public class AddressListActivity extends BaseActivity<ActivityAddressListBinding
|
||||
});
|
||||
}
|
||||
});
|
||||
adapter.setOnItemClickListener(new BaseRecycleViewAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View itemView, int position) {
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("data", new Gson().toJson(list.get(position)));
|
||||
setResult(200,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
mDataBinding.rec.setAdapter(adapter);
|
||||
mDataBinding.rec.setLayoutManager(new LinearLayoutManager(context));
|
||||
|
||||
|
||||
@@ -128,6 +128,13 @@ public class AmountView extends LinearLayout implements View.OnClickListener, Te
|
||||
//// }
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public interface OnAmountChangeListener {
|
||||
void onAmountChange(View view, int amount);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sl.house_property.cart;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
@@ -21,11 +22,13 @@ import com.sl.house_property.R;
|
||||
import com.sl.house_property.databinding.FragmentCartBinding;
|
||||
import com.sl.house_property.databinding.ItemCartBinding;
|
||||
import com.sl.house_property.databinding.ItemCartCartBinding;
|
||||
import com.sl.house_property.order.SettleActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -132,6 +135,62 @@ public class CartFragment extends BaseFragment<FragmentCartBinding> {
|
||||
|
||||
}
|
||||
});
|
||||
mDataBinding.cbAll.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
|
||||
String amount = "0.00";
|
||||
int goodsNum = 0;
|
||||
for (int i = 0; i < cartEntities.size(); i++) {
|
||||
cartEntities.get(i).setCheck(mDataBinding.cbAll.isChecked());
|
||||
for (int j = 0; j < cartEntities.get(i).getList().size(); j++) {
|
||||
cartEntities.get(i).getList().get(j).setCheck(mDataBinding.cbAll.isChecked());
|
||||
if (cartEntities.get(i).getList().get(j).isCheck()) {
|
||||
BigDecimal bigDecimal = new BigDecimal(amount);
|
||||
BigDecimal price = new BigDecimal(cartEntities.get(i).getList().get(j).getSale_price());
|
||||
BigDecimal num = new BigDecimal(cartEntities.get(i).getList().get(j).getSale_num());
|
||||
BigDecimal multiply = price.multiply(num);
|
||||
amount = bigDecimal.add(multiply).toPlainString();
|
||||
goodsNum = goodsNum + Integer.parseInt(cartEntities.get(i).getList().get(j).getSale_num());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mDataBinding.tvAmount.setText(amount);
|
||||
mDataBinding.btnSettle.setText("结算(" + goodsNum + ")");
|
||||
mDataBinding.cbAll.setChecked(mDataBinding.cbAll.isChecked());
|
||||
BaseRecycleViewAdapter baseRecycleViewAdapter = (BaseRecycleViewAdapter) mDataBinding.rec.getAdapter();
|
||||
baseRecycleViewAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
mDataBinding.btnSettle.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!cartEntities.isEmpty()) {
|
||||
StringBuilder id = new StringBuilder();
|
||||
for (int i = 0; i < cartEntities.size(); i++) {
|
||||
for (int j = 0; j < cartEntities.get(i).getList().size(); j++) {
|
||||
if (cartEntities.get(i).getList().get(j).isCheck()) {
|
||||
if (id.toString().equals("")) {
|
||||
id = new StringBuilder(cartEntities.get(i).getList().get(j).getCart_id());
|
||||
} else {
|
||||
id.append(",").append(cartEntities.get(i).getList().get(j).getCart_id());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!id.toString().equals("")) {
|
||||
Intent intent = new Intent(getContext(), SettleActivity.class);
|
||||
intent.putExtra("goodsType", 2);
|
||||
intent.putExtra("cart_id", id.toString());
|
||||
startActivityForResult(intent, 19);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getData() {
|
||||
@@ -237,34 +296,54 @@ public class CartFragment extends BaseFragment<FragmentCartBinding> {
|
||||
}
|
||||
adapter.notifyDataSetChanged();
|
||||
mDataBinding.cbAll.setChecked(isAllCheck);
|
||||
|
||||
|
||||
String amount = "0.00";
|
||||
int goodsNum = 0;
|
||||
for (int i = 0; i < cartEntities.size(); i++) {
|
||||
for (int j = 0; j < cartEntities.get(i).getList().size(); j++) {
|
||||
if (cartEntities.get(i).getList().get(j).isCheck()) {
|
||||
BigDecimal bigDecimal = new BigDecimal(amount);
|
||||
BigDecimal price = new BigDecimal(cartEntities.get(i).getList().get(j).getSale_price());
|
||||
BigDecimal num = new BigDecimal(cartEntities.get(i).getList().get(j).getSale_num());
|
||||
BigDecimal multiply = price.multiply(num);
|
||||
amount = bigDecimal.add(multiply).toPlainString();
|
||||
goodsNum = goodsNum + Integer.parseInt(cartEntities.get(i).getList().get(j).getSale_num());
|
||||
}
|
||||
}
|
||||
}
|
||||
mDataBinding.tvAmount.setText(amount);
|
||||
mDataBinding.btnSettle.setText("结算(" + goodsNum + ")");
|
||||
}
|
||||
});
|
||||
itemAdapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView<ItemCartCartBinding>() {
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ItemCartCartBinding b, final int position) {
|
||||
if (!(position >= cartEntity.getList().size())) {
|
||||
b.cb.setChecked(cartEntity.getList().get(position).isCheck());
|
||||
b.tvGoodsName.setText(cartEntity.getList().get(position).getGoods_detail());
|
||||
b.tvInfo2.setText(cartEntity.getList().get(position).getProperty());
|
||||
public void onBindViewHolder(ItemCartCartBinding b, final int itemPosition) {
|
||||
if (!(itemPosition >= cartEntity.getList().size())) {
|
||||
|
||||
b.cb.setChecked(cartEntity.getList().get(itemPosition).isCheck());
|
||||
b.tvGoodsName.setText(cartEntity.getList().get(itemPosition).getGoods_detail());
|
||||
b.tvInfo2.setText(cartEntity.getList().get(itemPosition).getProperty());
|
||||
RequestOptions requestOptions = new RequestOptions();
|
||||
requestOptions.placeholder(R.mipmap.icon_default_rectangle);
|
||||
requestOptions.error(R.mipmap.icon_default_rectangle);
|
||||
|
||||
Glide.with(getContext()).load(cartEntity.getList().get(position).getThumb())
|
||||
Glide.with(getContext()).load(cartEntity.getList().get(itemPosition).getThumb())
|
||||
.apply(requestOptions)
|
||||
.into(b.ivGoods);
|
||||
b.tvPrice.setText("¥" + cartEntity.getList().get(position).getSale_price());
|
||||
if (!cartEntity.getList().get(position).getSale_num().isEmpty()) {
|
||||
b.amountView.changeAmount(Integer.parseInt(cartEntity.getList().get(position).getSale_num()));
|
||||
b.tvPrice.setText("¥" + cartEntity.getList().get(itemPosition).getSale_price());
|
||||
if (!cartEntity.getList().get(itemPosition).getSale_num().isEmpty()) {
|
||||
b.amountView.changeAmount(Integer.parseInt(cartEntity.getList().get(itemPosition).getSale_num()));
|
||||
|
||||
}
|
||||
b.amountView.setOnAmountChangeListener(new AmountView.OnAmountChangeListener() {
|
||||
@Override
|
||||
public void onAmountChange(View view, int amount) {
|
||||
editGoods(2, cartEntity.getList().get(position).getCart_id(), amount);
|
||||
editGoods(2, cartEntity.getList().get(itemPosition).getCart_id(), amount);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -288,6 +367,7 @@ public class CartFragment extends BaseFragment<FragmentCartBinding> {
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
cartEntities.get(position).getList().get(x).setCheck(!cartEntities.get(position).getList().get(x).isCheck());
|
||||
|
||||
itemAdapter.notifyDataSetChanged();
|
||||
@@ -312,7 +392,22 @@ public class CartFragment extends BaseFragment<FragmentCartBinding> {
|
||||
isAllCheck = false;
|
||||
}
|
||||
mDataBinding.cbAll.setChecked(isAllCheck);
|
||||
|
||||
String amount = "0.00";
|
||||
int goodsNum = 0;
|
||||
for (int i = 0; i < cartEntities.size(); i++) {
|
||||
for (int j = 0; j < cartEntities.get(i).getList().size(); j++) {
|
||||
if (cartEntities.get(i).getList().get(j).isCheck()) {
|
||||
BigDecimal bigDecimal = new BigDecimal(amount);
|
||||
BigDecimal price = new BigDecimal(cartEntities.get(i).getList().get(j).getSale_price());
|
||||
BigDecimal num = new BigDecimal(cartEntities.get(i).getList().get(j).getSale_num());
|
||||
BigDecimal multiply = price.multiply(num);
|
||||
amount = bigDecimal.add(multiply).toPlainString();
|
||||
goodsNum = goodsNum + Integer.parseInt(cartEntities.get(i).getList().get(j).getSale_num());
|
||||
}
|
||||
}
|
||||
}
|
||||
mDataBinding.tvAmount.setText(amount);
|
||||
mDataBinding.btnSettle.setText("结算(" + goodsNum + ")");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,29 +2,54 @@ package com.sl.house_property.discovery;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.view.View;
|
||||
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.sl.house_property.BaseActivity;
|
||||
import com.sl.house_property.R;
|
||||
import com.sl.house_property.databinding.ActivityAddDiscoveryBinding;
|
||||
import com.sl.house_property.databinding.ItemAddGoodsBinding;
|
||||
import com.zhihu.matisse.Matisse;
|
||||
import com.zhihu.matisse.MimeType;
|
||||
import com.zhihu.matisse.engine.impl.PicassoEngine;
|
||||
import com.zhihu.matisse.internal.entity.CaptureStrategy;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import imageselector.utils.ImageSelector;
|
||||
import adapter.BaseRecycleViewAdapter;
|
||||
import entity.RegisterUser;
|
||||
import http.ApiConfig;
|
||||
import http.FileUpLoad.retrofit.HttpStaticApi;
|
||||
import http.FileUpLoad.retrofit.RetrofitCallBack;
|
||||
import http.FileUpLoad.retrofit.RetrofitHttpUpLoad;
|
||||
import my_loader.Resultcode;
|
||||
import okhttp3.RequestBody;
|
||||
import retrofit2.Response;
|
||||
import tools.Config;
|
||||
import utils.Md5;
|
||||
|
||||
public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBinding> {
|
||||
|
||||
private static final int REQUEST_CODE_SELECT_PICTURE = 300;
|
||||
private int type;
|
||||
private AdditionImageWrapper additionImageWrapper;
|
||||
private ArrayList<String> strings;
|
||||
private String goodsInfo = "";
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
@@ -38,10 +63,15 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
.keyboardEnable(true) //解决软键盘与底部输入框冲突问题
|
||||
// .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
|
||||
// | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
|
||||
.barColor(R.color.backcolorAccent)
|
||||
.init();
|
||||
mDataBinding.rec2.setNestedScrollingEnabled(false);
|
||||
mDataBinding.rvDynamicImage.setNestedScrollingEnabled(false);
|
||||
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
type = getIntent().getIntExtra("type", 0);
|
||||
if (type == 0) {
|
||||
mDataBinding.tvCover.setVisibility(View.GONE);
|
||||
@@ -54,13 +84,59 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
mDataBinding.vi.setVisibility(View.VISIBLE);
|
||||
mDataBinding.rec2.setVisibility(View.VISIBLE);
|
||||
mDataBinding.tvGoods.setVisibility(View.VISIBLE);
|
||||
final BaseRecycleViewAdapter<String, ItemAddGoodsBinding> adapter = new BaseRecycleViewAdapter<>(AddDiscoveryActivity.this, R.layout.item_add_goods);
|
||||
strings = new ArrayList<>();
|
||||
strings.add("+");
|
||||
adapter.setData(strings);
|
||||
adapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView<ItemAddGoodsBinding>() {
|
||||
@Override
|
||||
public void onBindViewHolder(ItemAddGoodsBinding b, int position) {
|
||||
b.tv.setText(strings.get(position));
|
||||
}
|
||||
});
|
||||
adapter.setOnItemClickListener(new BaseRecycleViewAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View itemView, int position) {
|
||||
if (strings.get(position).equals("+")) {
|
||||
//添加
|
||||
AddGoodsDialog addGoodsDialog = new AddGoodsDialog(AddDiscoveryActivity.this);
|
||||
addGoodsDialog.setOnAddGoodsInputListener(new AddGoodsDialog.OnAddGoodsInputListener() {
|
||||
@Override
|
||||
public void onConfirm(String info, String s) {
|
||||
if (goodsInfo.equals("")) {
|
||||
goodsInfo = info;
|
||||
} else {
|
||||
goodsInfo = goodsInfo + "|" + info;
|
||||
}
|
||||
|
||||
strings.remove(strings.size() - 1);
|
||||
strings.add(s);
|
||||
strings.add("+");
|
||||
adapter.setData(strings);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
new XPopup.Builder(AddDiscoveryActivity.this).asCustom(addGoodsDialog).show();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
mDataBinding.rec2.setAdapter(adapter);
|
||||
mDataBinding.rec2.setLayoutManager(new GridLayoutManager(AddDiscoveryActivity.this, 4));
|
||||
mDataBinding.tvCover.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
checkAlbumPermission(411, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
additionImageWrapper = new AdditionImageWrapper(this, mDataBinding.rvDynamicImage);
|
||||
additionImageWrapper.wrap(new AdditionImageWrapper.OnAdditionLayoutItemClick() {
|
||||
@Override
|
||||
public void onAdditionItemClick() {
|
||||
//
|
||||
checkAlbumPermission();
|
||||
checkAlbumPermission(REQUEST_CODE_SELECT_PICTURE, additionImageWrapper.getRemainCount());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -77,8 +153,16 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
startActivityForResult(intent, 111);
|
||||
}
|
||||
});
|
||||
mDataBinding.tvSend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
File file;
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
@@ -90,34 +174,57 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
}
|
||||
additionImageWrapper.setData(files);
|
||||
|
||||
} else if (requestCode == REQUEST_CODE_SELECT_PICTURE && data != null) {
|
||||
ArrayList<String> images = data.getStringArrayListExtra(ImageSelector.SELECT_RESULT);
|
||||
} else if (requestCode == REQUEST_CODE_SELECT_PICTURE && resultCode == RESULT_OK && data != null) {
|
||||
List<String> strings = Matisse.obtainPathResult(data);
|
||||
ArrayList<File> files = new ArrayList<>();
|
||||
files.addAll(additionImageWrapper.getImageList());
|
||||
for (int i = 0; i < images.size(); i++) {
|
||||
files.add(new File(images.get(i)));
|
||||
for (int i = 0; i < strings.size(); i++) {
|
||||
files.add(new File(strings.get(i)));
|
||||
}
|
||||
additionImageWrapper.setData(files);
|
||||
|
||||
} else if (requestCode == 411 && resultCode == RESULT_OK && data != null) {
|
||||
List<String> strings = Matisse.obtainPathResult(data);
|
||||
if (!strings.isEmpty()) {
|
||||
file = new File(strings.get(0));
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(file.toString());
|
||||
mDataBinding.tvCover.setBackground(new BitmapDrawable(getResources(), bitmap));
|
||||
mDataBinding.tvCover.setText("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void selectImage() {
|
||||
ImageSelector.builder()
|
||||
.useCamera(false) // 设置是否使用拍照
|
||||
.setSingle(false) //设置是否单选
|
||||
.setViewImage(true) //是否点击放大图片查看,,默认为true
|
||||
.setMaxSelectCount(additionImageWrapper.getRemainCount()) // 图片的最大选择数量,小于等于0时,不限数量。
|
||||
.start(AddDiscoveryActivity.this, REQUEST_CODE_SELECT_PICTURE); // 打开相册
|
||||
private void selectImage(int requestCode, int max) {
|
||||
Matisse
|
||||
.from(this)
|
||||
//选择视频和图片
|
||||
.choose(MimeType.ofAll())
|
||||
|
||||
//这两行要连用 是否在选择图片中展示照相 和适配安卓7.0 FileProvider
|
||||
.capture(true)
|
||||
.captureStrategy(new CaptureStrategy(true, "PhotoPicker"))
|
||||
//有序选择图片 123456...
|
||||
.countable(true)
|
||||
//最大选择数量为9
|
||||
.maxSelectable(max)
|
||||
//选择方向
|
||||
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
|
||||
//界面中缩略图的质量
|
||||
.thumbnailScale(0.8f)
|
||||
//蓝色主题
|
||||
.theme(R.style.Matisse_Zhihu)
|
||||
//Picasso加载方式
|
||||
.imageEngine(new PicassoEngine())
|
||||
//请求码
|
||||
.forResult(requestCode);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 检查访问相册权限
|
||||
* */
|
||||
private void checkAlbumPermission() {
|
||||
private void checkAlbumPermission(int requestCode, int max) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
selectImage();
|
||||
selectImage(requestCode, max);
|
||||
return;
|
||||
}
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||
@@ -127,7 +234,72 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
}
|
||||
|
||||
} else {
|
||||
selectImage();
|
||||
selectImage(requestCode, max);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void submit() {
|
||||
RetrofitHttpUpLoad retrofitHttpUpLoad = RetrofitHttpUpLoad.getInstance();
|
||||
retrofitHttpUpLoad.clear();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
RegisterUser user =
|
||||
Config.getInstance(this).getUser();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Goods");
|
||||
map.put("class", "AddGoodsInfo");
|
||||
map.put("sign", Md5.md5("Goods" + "AddGoodsInfo" + Md5.secret));
|
||||
map.put("file_count", additionImageWrapper.getImageList().size() + "");
|
||||
map.put("goods_detail", mDataBinding.etInfo.getText().toString().trim());
|
||||
map.put("type", type + 1 + "");
|
||||
for (int i = 0; i < additionImageWrapper.getImageList().size(); i++) {
|
||||
if (additionImageWrapper.getImageList().get(i) != null) {
|
||||
map.put("pic" + i, additionImageWrapper.getImageList().get(i));
|
||||
}
|
||||
}
|
||||
|
||||
map.put("thumb", file);
|
||||
if (type == 1) {
|
||||
if (goodsInfo.isEmpty()) {
|
||||
setToast("请添加商品规格");
|
||||
return;
|
||||
}
|
||||
map.put("property", goodsInfo);
|
||||
if (file == null || !file.isFile()) {
|
||||
setToast("请上传商品封面图");
|
||||
return;
|
||||
}
|
||||
}
|
||||
progressDialog.setMessage("提交中");
|
||||
progressDialog.show();
|
||||
Map<String, RequestBody> params = retrofitHttpUpLoad.addParameter(map).bulider();
|
||||
retrofitHttpUpLoad.addToEnqueue(retrofitHttpUpLoad.mHttpService.upLoadAgree(ApiConfig.BASE_URL, params),
|
||||
new RetrofitCallBack() {
|
||||
@Override
|
||||
public void onResponse(Response response, int method) {
|
||||
progressDialog.dismiss();
|
||||
if (method == HttpStaticApi.HTTP_UPLOADIMAGE) {
|
||||
Resultcode resultcode = (Resultcode) response.body();
|
||||
if (0 == (resultcode.status)) {
|
||||
setToast(getString(R.string.addSuccess));
|
||||
setResult(200);
|
||||
finish();
|
||||
} else {
|
||||
setToast(resultcode.msg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Response response, int method) {
|
||||
progressDialog.dismiss();
|
||||
setToast("提交失败");
|
||||
}
|
||||
}, HttpStaticApi.HTTP_UPLOADIMAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.sl.house_property.discovery;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.sl.house_property.R;
|
||||
|
||||
public class AddGoodsDialog extends CenterPopupView {
|
||||
|
||||
private EditText etInfo;
|
||||
private EditText etPrice;
|
||||
private EditText etNum;
|
||||
private OnAddGoodsInputListener mListener=null;
|
||||
|
||||
|
||||
public AddGoodsDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
etInfo = findViewById(R.id.et_info);
|
||||
etPrice = findViewById(R.id.et_price);
|
||||
etNum = findViewById(R.id.et_num);
|
||||
findViewById(R.id.btn_submit2).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mListener != null) {
|
||||
mListener.onConfirm(etInfo.getText().toString().trim() + ":" + etPrice.getText().toString().trim() + ":" +
|
||||
etNum.getText().toString().trim(),etInfo.getText().toString().trim());
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_add_goods;
|
||||
}
|
||||
|
||||
public void setOnAddGoodsInputListener(OnAddGoodsInputListener listener) {
|
||||
this.mListener = listener;
|
||||
|
||||
}
|
||||
|
||||
interface OnAddGoodsInputListener {
|
||||
void onConfirm(String s, String info);
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.interfaces.OnSelectListener;
|
||||
import com.lzy.ninegrid.ImageInfo;
|
||||
import com.lzy.ninegrid.preview.NineGridViewClickAdapter;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
@@ -34,15 +35,21 @@ import com.sl.house_property.R;
|
||||
import com.sl.house_property.databinding.FragmentDiscoveryBinding;
|
||||
import com.sl.house_property.databinding.ItemCommentBinding;
|
||||
import com.sl.house_property.databinding.ItemDiscoveryBinding;
|
||||
import com.sl.house_property.order.SettleActivity;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import com.squareup.picasso.Target;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import adapter.BaseRecycleViewAdapter;
|
||||
import entity.DiscoveryListEntity;
|
||||
import entity.GoodsDetailEntity;
|
||||
import entity.RegisterUser;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
@@ -85,6 +92,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
super.onCreateVew(inflater, savedInstanceState);
|
||||
baseActivity = (BaseActivity) getActivity();
|
||||
progressDialog = new ProgressDialog(baseActivity);
|
||||
intRecycleView();
|
||||
mDataBinding.dw.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
@@ -98,15 +106,22 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
}
|
||||
});
|
||||
mDataBinding.dw.autoRefresh();
|
||||
intRecycleView();
|
||||
MainTabActivity activity = (MainTabActivity) getActivity();
|
||||
|
||||
final MainTabActivity activity = (MainTabActivity) getActivity();
|
||||
activity.registerMyOnTouchListener(this);
|
||||
final String[] data = {"发布说说", "发布商品"};
|
||||
mDataBinding.ivAdd.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(getContext(), AddDiscoveryActivity.class);
|
||||
intent.putExtra("type",0);
|
||||
startActivity(intent);
|
||||
new XPopup.Builder(activity).atView(mDataBinding.ivAdd).asAttachList(data, null, new OnSelectListener() {
|
||||
@Override
|
||||
public void onSelect(int position, String text) {
|
||||
Intent intent = new Intent(getContext(), AddDiscoveryActivity.class);
|
||||
intent.putExtra("type", position);
|
||||
startActivity(intent);
|
||||
}
|
||||
}).show();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -182,6 +197,45 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.requsting), mypage);
|
||||
}
|
||||
|
||||
private void addCart(String goods_id, String product_code, String goodsNum) {
|
||||
RegisterUser user =
|
||||
Config.getInstance(getContext()).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Goods");
|
||||
map.put("class", "AddCart");
|
||||
map.put("goods_id", goods_id);
|
||||
map.put("product_code", product_code);
|
||||
map.put("num", goodsNum);
|
||||
map.put("sign", Md5.md5("Goods" + "AddCart" + Md5.secret));
|
||||
progressDialog.setMessage("提交中");
|
||||
progressDialog.setCancelable(false);
|
||||
mGankLoader = new Loader();
|
||||
Subscription subscribe = mGankLoader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
if (resultcode.status == 0) {
|
||||
baseActivity.setToast(0, "成功加入购物车");
|
||||
} else {
|
||||
baseActivity.setToast(3, resultcode.msg);
|
||||
}
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
baseActivity.setToast(2, "提交失败");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
baseActivity.addSubscription(subscribe);
|
||||
}
|
||||
|
||||
private void like(String goodsId, final int position) {
|
||||
final RegisterUser user =
|
||||
Config.getInstance(getContext()).getUser();
|
||||
@@ -305,7 +359,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
public void onClick(View v) {
|
||||
Log.e("click", "comment");
|
||||
MainTabActivity activity = (MainTabActivity) getActivity();
|
||||
CommonUtils.hideSoftInput(getContext(),mDataBinding.etComment);
|
||||
CommonUtils.hideSoftInput(getContext(), mDataBinding.etComment);
|
||||
mDataBinding.llComment.setVisibility(View.GONE);
|
||||
activity.visibilyBottom(View.VISIBLE);
|
||||
comment(discoveryListEntity.getGoods_id(), position, "", mDataBinding.etComment.getText().toString());
|
||||
@@ -346,6 +400,14 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
}, 300);
|
||||
|
||||
|
||||
} else if (type == 4) {
|
||||
// addCart(discoveryListEntity.getGoods_id(),discoveryListEntity.)
|
||||
getGoodsDetail(discoveryListEntity.getGoods_id(), discoveryListEntity, type);
|
||||
commentDialog.dismiss();
|
||||
|
||||
} else if (type == 5) {
|
||||
getGoodsDetail(discoveryListEntity.getGoods_id(), discoveryListEntity, type);
|
||||
commentDialog.dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -421,13 +483,13 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
|
||||
if (discoveryListEntity.getPic().size() > 0) {
|
||||
|
||||
|
||||
Log.e("pic", discoveryListEntity.getPic().get(0));
|
||||
for (int i = 0; i < discoveryListEntity.getPic().size(); i++) {
|
||||
if (discoveryListEntity.getPic().get(i).endsWith(".mp4")) {
|
||||
ImageInfo imageInfo = new ImageInfo();
|
||||
imageInfo.setType(2);
|
||||
imageInfo.setBigImageUrl(discoveryListEntity.getPic().get(i));
|
||||
imageInfo.setThumbnailUrl(discoveryListEntity.getThumb());
|
||||
imageInfo.setThumbnailUrl(discoveryListEntity.getPic().get(i));
|
||||
imageInfos.add(imageInfo);
|
||||
} else {
|
||||
ImageInfo imageInfo = new ImageInfo();
|
||||
@@ -439,12 +501,19 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
|
||||
}
|
||||
|
||||
}else {
|
||||
ImageInfo imageInfo = new ImageInfo();
|
||||
imageInfo.setType(1);
|
||||
imageInfo.setBigImageUrl(discoveryListEntity.getThumb());
|
||||
imageInfo.setThumbnailUrl(discoveryListEntity.getThumb());
|
||||
imageInfos.add(imageInfo);
|
||||
}
|
||||
homeGridAdapterItemBinding.nineGrid.setAdapter(new NineGridViewClickAdapter(getContext(), imageInfos));
|
||||
}
|
||||
}
|
||||
});
|
||||
mDataBinding.recyView.setAdapter(baseRecycleViewAdapter);
|
||||
|
||||
baseRecycleViewAdapter.setData(discoveryListEntities);
|
||||
}
|
||||
|
||||
@@ -467,6 +536,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
baseActivity.setToast(1, resultcode.msg);
|
||||
}
|
||||
if (resultcode.status == 0) {
|
||||
intRecycleView();
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
@@ -492,6 +562,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
} else {
|
||||
ArrayList<DiscoveryListEntity> o = new Gson().fromJson(array.toString(), type);
|
||||
discoveryListEntities.addAll(o);
|
||||
|
||||
BaseRecycleViewAdapter baseRecycleViewAdapter = (BaseRecycleViewAdapter) mDataBinding.recyView.getAdapter();
|
||||
baseRecycleViewAdapter.setData(discoveryListEntities);
|
||||
int count = jsonObject.getInt("count");
|
||||
@@ -569,12 +640,12 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
//点击空白处隐藏键盘,隐藏输入框相关
|
||||
if (getActivity().getCurrentFocus()!=null&&getActivity().getCurrentFocus().getId() == R.id.tv_send_comment) {
|
||||
if (getActivity().getCurrentFocus() != null && getActivity().getCurrentFocus().getId() == R.id.tv_send_comment) {
|
||||
return false;
|
||||
}
|
||||
boolean b = UtilHelpers.hideKeyboard(ev, getActivity().getCurrentFocus(), getActivity());
|
||||
if (b) {
|
||||
CommonUtils.hideSoftInput( mDataBinding.etComment.getContext(), mDataBinding.etComment);
|
||||
CommonUtils.hideSoftInput(mDataBinding.etComment.getContext(), mDataBinding.etComment);
|
||||
MainTabActivity activity = (MainTabActivity) getActivity();
|
||||
activity.visibilyBottom(View.VISIBLE);
|
||||
mDataBinding.llComment.setVisibility(View.GONE);
|
||||
@@ -584,6 +655,77 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
return false;
|
||||
}
|
||||
|
||||
private void getGoodsDetail(final String goodsId, final DiscoveryListEntity entity, final int goodtype) {
|
||||
final RegisterUser user =
|
||||
Config.getInstance(getContext()).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Goods");
|
||||
map.put("class", "GoodsInfo");
|
||||
map.put("goods_id", goodsId);
|
||||
map.put("sign", Md5.md5("Goods" + "GoodsInfo" + Md5.secret));
|
||||
progressDialog.setMessage("获取信息中");
|
||||
progressDialog.setCancelable(false);
|
||||
mGankLoader = new Loader();
|
||||
Subscription subscription = mGankLoader.getMovie(ApiConfig.BASE_URL, map)
|
||||
.subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
if (resultcode.status == 0) {
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
|
||||
try {
|
||||
|
||||
JSONObject jsonObject = new JSONObject(s);
|
||||
org.json.JSONArray array = jsonObject.getJSONArray("info");
|
||||
final Type type = new TypeToken<ArrayList<GoodsDetailEntity>>() {
|
||||
}.getType();
|
||||
ArrayList<GoodsDetailEntity> o = gs.fromJson(array.toString(), type);
|
||||
|
||||
GoodsInfoDialog goodsInfoDialog = new GoodsInfoDialog(baseActivity, entity, o);
|
||||
goodsInfoDialog.setOnConfirmListener(new GoodsInfoDialog.OnGoodsSelectPropertyListener() {
|
||||
@Override
|
||||
public void onSelect(String code, int num) {
|
||||
if (goodtype == 4) {
|
||||
Intent intent = new Intent(baseActivity, SettleActivity.class);
|
||||
intent.putExtra("goodsType", 1);
|
||||
intent.putExtra("goods_id", goodsId);
|
||||
intent.putExtra("product_code", code);
|
||||
intent.putExtra("sale_num", num + "");
|
||||
startActivity(intent);
|
||||
} else if (goodtype == 5) {
|
||||
addCart(goodsId, code, num + "");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
new XPopup.Builder(baseActivity).asCustom(goodsInfoDialog).show();
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
baseActivity.setToast(resultcode.msg);
|
||||
}
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
baseActivity.setToast(2, "获取信息失败");
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
baseActivity.addSubscription(subscription);
|
||||
}
|
||||
|
||||
private void comment(String goodsId, final int position, String reply_id, final String content) {
|
||||
final RegisterUser user =
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.sl.house_property.discovery;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.sl.house_property.R;
|
||||
import com.sl.house_property.cart.AmountView;
|
||||
import com.sl.house_property.databinding.ItemAddGoodsBinding;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import adapter.BaseRecycleViewAdapter;
|
||||
import entity.DiscoveryListEntity;
|
||||
import entity.GoodsDetailEntity;
|
||||
|
||||
public class GoodsInfoDialog extends BottomPopupView {
|
||||
|
||||
private final ArrayList<GoodsDetailEntity> list;
|
||||
private DiscoveryListEntity entity;
|
||||
private RecyclerView rv;
|
||||
private AmountView amountView;
|
||||
private TextView tvPrice;
|
||||
private GoodsDetailEntity goodsDetailEntity = null;
|
||||
private TextView tvAmount;
|
||||
private OnGoodsSelectPropertyListener listener;
|
||||
private int num = 1;
|
||||
|
||||
public GoodsInfoDialog(@NonNull Context context, DiscoveryListEntity entity, ArrayList<GoodsDetailEntity> list) {
|
||||
super(context);
|
||||
this.entity = entity;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.btn).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
if (goodsDetailEntity==null){
|
||||
Toast.makeText(getContext(),"请选择商品规格",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
listener.onSelect(goodsDetailEntity.getProduct_code(), num);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
tvPrice = findViewById(R.id.tv_price);
|
||||
findViewById(R.id.iv_close).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
tvAmount = findViewById(R.id.tv_amount);
|
||||
rv = findViewById(R.id.rv);
|
||||
amountView = findViewById(R.id.amount_view);
|
||||
ImageView image = findViewById(R.id.imageview);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
|
||||
|
||||
rv.setLayoutManager(gridLayoutManager);
|
||||
RequestOptions requestOptions = new RequestOptions();
|
||||
requestOptions.placeholder(R.mipmap.icon_default_rectangle);
|
||||
requestOptions.error(R.mipmap.icon_default_rectangle);
|
||||
|
||||
Glide.with(getContext()).load(entity.getThumb())
|
||||
.apply(requestOptions)
|
||||
.into(image);
|
||||
final BaseRecycleViewAdapter<GoodsDetailEntity, ItemAddGoodsBinding> adapter = new BaseRecycleViewAdapter<>(getContext(), R.layout.item_add_goods);
|
||||
adapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView<ItemAddGoodsBinding>() {
|
||||
@Override
|
||||
public void onBindViewHolder(ItemAddGoodsBinding b, int position) {
|
||||
b.tv.setText(list.get(position).getProperty());
|
||||
}
|
||||
});
|
||||
adapter.setOnItemClickListener(new BaseRecycleViewAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View itemView, int position) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(position).setCheck(!list.get(position).isCheck());
|
||||
if (list.get(position).isCheck()) {
|
||||
list.get(position).setCheck(false);
|
||||
amountView.setGoods_storage(Integer.parseInt(list.get(position).getNum()));
|
||||
goodsDetailEntity = list.get(position);
|
||||
tvPrice.setText("¥" + goodsDetailEntity.getPrice());
|
||||
amountView.changeAmount(1);
|
||||
num = 1;
|
||||
BigDecimal bigDecimal = new BigDecimal(goodsDetailEntity.getPrice());
|
||||
BigDecimal bigDecimal1 = new BigDecimal(amountView.getAmount());
|
||||
BigDecimal multiply = bigDecimal.multiply(bigDecimal1);
|
||||
tvAmount.setText("已选 " + list.get(position).getProperty() + " 合计:¥" + multiply.toPlainString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
adapter.setData(list);
|
||||
rv.setAdapter(adapter);
|
||||
amountView.setOnAmountChangeListener(new AmountView.OnAmountChangeListener() {
|
||||
@Override
|
||||
public void onAmountChange(View view, int amount) {
|
||||
if (goodsDetailEntity == null) {
|
||||
Toast.makeText(getContext(), "请选择商品规格", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
num = amount;
|
||||
BigDecimal bigDecimal = new BigDecimal(goodsDetailEntity.getPrice());
|
||||
BigDecimal bigDecimal1 = new BigDecimal(amount);
|
||||
BigDecimal multiply = bigDecimal.multiply(bigDecimal1);
|
||||
tvAmount.setText("合计:¥" + multiply.toPlainString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void setOnConfirmListener(OnGoodsSelectPropertyListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_goods_info;
|
||||
|
||||
}
|
||||
|
||||
interface OnGoodsSelectPropertyListener {
|
||||
void onSelect(String code, int num);
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,10 @@ public class ImageViewerAndDeleteActivity extends BaseActivity<ActivityImagePrev
|
||||
public void onClick(View v) {
|
||||
if (mList.size() == 1) {
|
||||
mList.remove(index);
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.putStringArrayListExtra("images", mList);
|
||||
setResult(111, intent);
|
||||
finish();
|
||||
} else {
|
||||
mList.remove(index);
|
||||
adapter.notifyDataSetChanged();
|
||||
@@ -72,7 +75,7 @@ public class ImageViewerAndDeleteActivity extends BaseActivity<ActivityImagePrev
|
||||
//返回操作后的数据
|
||||
Intent intent = new Intent();
|
||||
intent.putStringArrayListExtra("images", mList);
|
||||
setResult(200, intent);
|
||||
setResult(111, intent);
|
||||
super.onBackPressed();
|
||||
|
||||
}
|
||||
|
||||
@@ -71,7 +71,12 @@ public class OrderActivity extends BaseActivity<ActivityOrderBinding> {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
type = getIntent().getIntExtra("type", -1);
|
||||
orderType = getIntent().getIntExtra("orderType", -1);
|
||||
initRec();
|
||||
|
||||
166
app/src/main/java/com/sl/house_property/order/PayActivity.java
Normal file
166
app/src/main/java/com/sl/house_property/order/PayActivity.java
Normal file
@@ -0,0 +1,166 @@
|
||||
package com.sl.house_property.order;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.view.View;
|
||||
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.sl.house_property.BaseActivity;
|
||||
import com.sl.house_property.R;
|
||||
import com.sl.house_property.databinding.ActivityPayBinding;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import entity.RegisterUser;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
import my_loader.Resultcode;
|
||||
import rx.functions.Action1;
|
||||
import tools.Config;
|
||||
import utils.Md5;
|
||||
|
||||
public class PayActivity extends BaseActivity<ActivityPayBinding> {
|
||||
private Context context;
|
||||
private String goods_id;
|
||||
private String product_code;
|
||||
private String goods_num;
|
||||
private String sale_price;
|
||||
private String consignee_id;
|
||||
private String total_amount;
|
||||
private String payment_amount;
|
||||
private String goods_user_id;
|
||||
private String order_number;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.activity_pay;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
context = this;
|
||||
progressDialog = new ProgressDialog(this);
|
||||
ImmersionBar.with(this)
|
||||
.keyboardEnable(true) //解决软键盘与底部输入框冲突问题
|
||||
// .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
|
||||
// | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
|
||||
.init();
|
||||
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
Intent intent = getIntent();
|
||||
mDataBinding.tvTitle.setText("支付");
|
||||
goods_id = intent.getStringExtra("goods_id");
|
||||
product_code = intent.getStringExtra("product_code");
|
||||
goods_num = intent.getStringExtra("goods_num");
|
||||
sale_price = intent.getStringExtra("sale_price");
|
||||
consignee_id = intent.getStringExtra("consignee_id");
|
||||
total_amount = intent.getStringExtra("total_amount");
|
||||
payment_amount = intent.getStringExtra("payment_amount");
|
||||
goods_user_id = intent.getStringExtra("goods_user_id");
|
||||
order_number = intent.getStringExtra("order_number");
|
||||
String wallet = intent.getStringExtra("wallet");
|
||||
mDataBinding.tv.setText("钱包支付(余额 ¥" + wallet + ")");
|
||||
mDataBinding.tvAmount.setText(payment_amount);
|
||||
mDataBinding.rlAlipay.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mDataBinding.alpay.setChecked(!mDataBinding.alpay.isChecked());
|
||||
if (mDataBinding.alpay.isChecked()) {
|
||||
mDataBinding.wxpaly.setChecked(false);
|
||||
mDataBinding.qianbao2.setChecked(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mDataBinding.rlWxpay.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mDataBinding.wxpaly.setChecked(!mDataBinding.wxpaly.isChecked());
|
||||
if (mDataBinding.wxpaly.isChecked()) {
|
||||
mDataBinding.alpay.setChecked(false);
|
||||
mDataBinding.qianbao2.setChecked(false);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mDataBinding.rlQianbao.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mDataBinding.qianbao2.setChecked(!mDataBinding.qianbao2.isChecked());
|
||||
if (mDataBinding.qianbao2.isChecked()) {
|
||||
mDataBinding.wxpaly.setChecked(false);
|
||||
mDataBinding.alpay.setChecked(false);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mDataBinding.confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mDataBinding.alpay.isChecked()) {
|
||||
setToast("支付宝支付" + payment_amount + "元");
|
||||
return;
|
||||
}
|
||||
if (mDataBinding.wxpaly.isChecked()) {
|
||||
setToast("微信支付" + payment_amount + "元");
|
||||
return;
|
||||
}
|
||||
if (mDataBinding.qianbao2.isChecked()) {
|
||||
pay();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loader loader = new Loader();
|
||||
|
||||
private void pay() {
|
||||
progressDialog.setMessage("支付中");
|
||||
progressDialog.show();
|
||||
RegisterUser user =
|
||||
Config.getInstance(context).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Order");
|
||||
map.put("class", "PayBalance");
|
||||
map.put("order_number", order_number);
|
||||
map.put("sign", Md5.md5("Order" + "PayBalance" + Md5.secret));
|
||||
loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
if (resultcode.status == 0) {
|
||||
Intent intent = new Intent(context, OrderActivity.class);
|
||||
intent.putExtra("type", 1);
|
||||
intent.putExtra("orderType", 2);
|
||||
startActivityForResult(intent, 0);
|
||||
} else {
|
||||
setToast(resultcode.msg);
|
||||
}
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
setToast("提交失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,54 @@
|
||||
package com.sl.house_property.order;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.view.View;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.sl.house_property.BaseActivity;
|
||||
import com.sl.house_property.R;
|
||||
import com.sl.house_property.cart.AddressListActivity;
|
||||
import com.sl.house_property.databinding.ActivitySettleBinding;
|
||||
import com.sl.house_property.databinding.ItemOrderItemBinding;
|
||||
import com.sl.house_property.databinding.ItemSubmitOrderBinding;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import adapter.BaseRecycleViewAdapter;
|
||||
import entity.AddressEntity;
|
||||
import entity.RegisterUser;
|
||||
import entity.SettleEntity;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
import my_loader.Resultcode;
|
||||
import rx.functions.Action1;
|
||||
import tools.Config;
|
||||
import utils.Md5;
|
||||
|
||||
public class SettleActivity extends BaseActivity<ActivitySettleBinding> {
|
||||
private String goods_id;
|
||||
private String product_code;
|
||||
private int goodsType;
|
||||
private String sale_num;
|
||||
private String cart_id;
|
||||
private Context context;
|
||||
private ProgressDialog progressDialog;
|
||||
private String wallet;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.activity_settle;
|
||||
@@ -16,6 +57,264 @@ public class SettleActivity extends BaseActivity<ActivitySettleBinding> {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
context = this;
|
||||
progressDialog = new ProgressDialog(this);
|
||||
ImmersionBar.with(this)
|
||||
.keyboardEnable(true) //解决软键盘与底部输入框冲突问题
|
||||
// .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
|
||||
// | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
|
||||
.init();
|
||||
goodsType = getIntent().getIntExtra("goodsType", 0);
|
||||
if (goodsType == 2) {
|
||||
cart_id = getIntent().getStringExtra("cart_id");
|
||||
} else {
|
||||
goods_id = getIntent().getStringExtra("goods_id");
|
||||
product_code = getIntent().getStringExtra("product_code");
|
||||
sale_num = getIntent().getStringExtra("sale_num");
|
||||
}
|
||||
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
initRec();
|
||||
getData();
|
||||
mDataBinding.rlAddress.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(context, AddressListActivity.class);
|
||||
startActivityForResult(intent, 150);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 150 && resultCode == 200 && data != null) {
|
||||
String data1 = data.getStringExtra("data");
|
||||
AddressEntity addressEntity = new Gson().fromJson(data1, AddressEntity.class);
|
||||
consignee_id = addressEntity.getConsignee_id();
|
||||
mDataBinding.tvName.setText(addressEntity.getName());
|
||||
mDataBinding.tvPhone.setText(addressEntity.getMobile());
|
||||
mDataBinding.tvAddress.setText(addressEntity.getRegion() + addressEntity.getAddress());
|
||||
}
|
||||
}
|
||||
|
||||
private void initRec() {
|
||||
mDataBinding.rv.setLayoutManager(new LinearLayoutManager(context));
|
||||
BaseRecycleViewAdapter<SettleEntity.Goods, ItemSubmitOrderBinding> adapter = new BaseRecycleViewAdapter<>(context, R.layout.item_submit_order);
|
||||
adapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView<ItemSubmitOrderBinding>() {
|
||||
@Override
|
||||
public void onBindViewHolder(final ItemSubmitOrderBinding b, int position) {
|
||||
if (list != null && list.size() > 0) {
|
||||
final SettleEntity.Goods goods = list.get(position);
|
||||
RequestOptions requestOptions = new RequestOptions();
|
||||
requestOptions.placeholder(R.mipmap.head);
|
||||
requestOptions.error(R.mipmap.head);
|
||||
Glide.with(context).load(goods.getAvatar())
|
||||
.apply(requestOptions)
|
||||
.into(b.ivHead);
|
||||
b.tvUsername.setText(goods.getNickname());
|
||||
|
||||
int num = 0;
|
||||
for (int i = 0; i < goods.getList().size(); i++) {
|
||||
num = num + Integer.parseInt(goods.getList().get(i).getSale_num());
|
||||
BigDecimal bigDecimal = new BigDecimal(totalAmount);
|
||||
BigDecimal bigDecimal1 = new BigDecimal(goods.getList().get(i).getSale_num());
|
||||
BigDecimal bigDecimal2 = new BigDecimal(goods.getList().get(i).getSale_price());
|
||||
BigDecimal multiply = bigDecimal1.multiply(bigDecimal2);
|
||||
totalAmount = bigDecimal.add(multiply).toPlainString();
|
||||
if (i == 0) {
|
||||
goods_id = goods.getList().get(i).getGoods_id();
|
||||
product_code = goods.getList().get(i).getProduct_code();
|
||||
goods_num = goods.getList().get(i).getSale_num();
|
||||
sale_price = goods.getList().get(i).getSale_price();
|
||||
goods_user_id = goods.getList().get(i).getGoods_user_id();
|
||||
} else {
|
||||
goods_id = goods_id + "," + goods.getList().get(i).getGoods_id();
|
||||
product_code = product_code + "," + goods.getList().get(i).getProduct_code();
|
||||
goods_num = goods_num + "," + goods.getList().get(i).getSale_num();
|
||||
sale_price = sale_price + "," + goods.getList().get(i).getSale_price();
|
||||
goods_user_id = goods_user_id + "," + goods.getList().get(i).getGoods_user_id();
|
||||
|
||||
}
|
||||
}
|
||||
b.tvNum.setText("共" + num + "件");
|
||||
list.get(position).setNum(num);
|
||||
b.tvAmount.setText("¥" + totalAmount);
|
||||
list.get(position).setAmount(totalAmount);
|
||||
BaseRecycleViewAdapter<SettleEntity.Goods.GoodsList, ItemOrderItemBinding> itemAdapter = new BaseRecycleViewAdapter<>(context, R.layout.item_order_item);
|
||||
itemAdapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView<ItemOrderItemBinding>() {
|
||||
@Override
|
||||
public void onBindViewHolder(ItemOrderItemBinding b, int position) {
|
||||
if (!(position >= goods.getList().size())) {
|
||||
SettleEntity.Goods.GoodsList content_info = goods.getList().get(position);
|
||||
b.tvGoodsName.setText(content_info.getGoods_detail());
|
||||
b.tvInfo2.setText(content_info.getProperty());
|
||||
b.tvPrice.setText("¥" + content_info.getSale_price());
|
||||
b.tvNum.setText("x" + content_info.getSale_num());
|
||||
RequestOptions requestOptions = new RequestOptions();
|
||||
requestOptions.placeholder(R.mipmap.icon_default_rectangle);
|
||||
requestOptions.error(R.mipmap.icon_default_rectangle);
|
||||
Glide.with(context).load(content_info.getThumb())
|
||||
.apply(requestOptions)
|
||||
.into(b.ivGoods);
|
||||
}
|
||||
}
|
||||
});
|
||||
itemAdapter.setData(list.get(position).getList());
|
||||
b.rv.setLayoutManager(new LinearLayoutManager(context));
|
||||
b.rv.setAdapter(itemAdapter);
|
||||
int totalNum = 0;
|
||||
String totalAmount = "0.00";
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
totalNum += list.get(i).getNum();
|
||||
BigDecimal bigDecimal = new BigDecimal(totalAmount);
|
||||
BigDecimal bigDecimal1 = new BigDecimal(list.get(i).getAmount());
|
||||
totalAmount = bigDecimal.add(bigDecimal1).toPlainString();
|
||||
}
|
||||
mDataBinding.tvTotalNum.setText("共" + totalNum + "件");
|
||||
mDataBinding.tvAmount.setText("¥" + totalAmount);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
mDataBinding.rv.setAdapter(adapter);
|
||||
mDataBinding.btnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ArrayList<SettleEntity.Goods> list = new ArrayList();
|
||||
|
||||
private void setViewData(SettleEntity orderListBean) {
|
||||
mDataBinding.tvName.setText(orderListBean.getAddress().getName());
|
||||
mDataBinding.tvPhone.setText(orderListBean.getAddress().getMobile());
|
||||
mDataBinding.tvAddress.setText(orderListBean.getAddress().getRegion() + orderListBean.getAddress().getAddress());
|
||||
list = orderListBean.getGoods();
|
||||
BaseRecycleViewAdapter adapter = (BaseRecycleViewAdapter) mDataBinding.rv.getAdapter();
|
||||
adapter.setData(list);
|
||||
consignee_id = orderListBean.getAddress().getConsignee_id();
|
||||
wallet = orderListBean.getWallet();
|
||||
}
|
||||
|
||||
Loader loader = new Loader();
|
||||
|
||||
private void getData() {
|
||||
progressDialog.setMessage("获取数据中");
|
||||
progressDialog.show();
|
||||
RegisterUser user =
|
||||
Config.getInstance(context).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Goods");
|
||||
map.put("class", "GoodsSettle");
|
||||
if (goodsType == 2) {
|
||||
map.put("cart_id", cart_id);
|
||||
} else {
|
||||
map.put("goods_id", goods_id);
|
||||
map.put("product_code", product_code);
|
||||
map.put("sale_num", sale_num);
|
||||
}
|
||||
map.put("sign", Md5.md5("Goods" + "GoodsSettle" + Md5.secret));
|
||||
loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
if (resultcode.status == 0) {
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = new Gson().toJson(adta);
|
||||
SettleEntity orderListBean = new Gson().fromJson(s, SettleEntity.class);
|
||||
setViewData(orderListBean);
|
||||
} else {
|
||||
setToast(resultcode.msg);
|
||||
}
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
setToast("获取数据失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String goods_num;
|
||||
private String sale_price;
|
||||
private String totalAmount = "0.00";
|
||||
private String consignee_id;
|
||||
private String goods_user_id;
|
||||
|
||||
private void submit() {
|
||||
progressDialog.setMessage("下单中");
|
||||
progressDialog.show();
|
||||
RegisterUser user =
|
||||
Config.getInstance(context).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Order");
|
||||
map.put("class", "AddOrder");
|
||||
map.put("goods_id", goods_id);
|
||||
map.put("product_code", product_code);
|
||||
map.put("goods_num", goods_num);
|
||||
map.put("sale_price", sale_price);
|
||||
map.put("consignee_id", consignee_id);
|
||||
map.put("total_amount", totalAmount);
|
||||
map.put("payment_amount", totalAmount);
|
||||
map.put("goods_user_id", goods_user_id);
|
||||
map.put("sign", Md5.md5("Order" + "AddOrder" + Md5.secret));
|
||||
loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
if (resultcode.status == 0) {
|
||||
setToast(resultcode.msg);
|
||||
|
||||
Intent intent = new Intent(context, PayActivity.class);
|
||||
intent.putExtra("goods_id", goods_id);
|
||||
intent.putExtra("product_code", product_code);
|
||||
intent.putExtra("goods_num", goods_num);
|
||||
intent.putExtra("sale_price", sale_price);
|
||||
intent.putExtra("consignee_id", consignee_id);
|
||||
intent.putExtra("total_amount", totalAmount);
|
||||
intent.putExtra("payment_amount", totalAmount);
|
||||
intent.putExtra("goods_user_id", goods_user_id);
|
||||
intent.putExtra("wallet", wallet);
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(s);
|
||||
String order_number = jsonObject.getString("order_number");
|
||||
intent.putExtra("order_number", order_number);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
startActivityForResult(intent, 18);
|
||||
} else {
|
||||
setToast(resultcode.msg);
|
||||
}
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
setToast("下单失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user