Commit aea96367 authored by david's avatar david Committed by 杨秀秀

bug修复

parent b3bc834e
......@@ -32,6 +32,7 @@ public class AvailableCouponAdapter extends xxBaseRecyclerViewAdapter<ItemAvaila
protected void covert(ItemAvailableCouponBinding dataBind, AvailableCoupon data, int position) {
// 将接口调出来的布局遍历上去
dataBind.setAvailableCoupon(data);
dataBind.tvCouponName.setText(data.getCouponName());
dataBind.tvDiscountAmount.setText("¥" + new BigDecimal(String.valueOf(data.getDiscountAmount())).stripTrailingZeros().toPlainString());
if (data.getCheckStatus()) {
dataBind.rbCheck.setChecked(true);
......
......@@ -207,7 +207,12 @@ public class HomeViewModel extends BaseViewModel<HomeRequest> {
}).subscribe(new ApiDisposableObserver<List<GuessLikeGoodsBean>>() {
@Override
public void onSuccess(List<GuessLikeGoodsBean> resultBean) {
GuessLikeGoodsList.postValue(resultBean);
if (resultBean != null && resultBean.size() <= 6) {
GuessLikeGoodsList.postValue(resultBean);
} else if (resultBean != null && resultBean.size() > 6) {
GuessLikeGoodsList.postValue(resultBean.subList(0, 6));
}
}
@Override
......
......@@ -37,7 +37,7 @@ public class LogoffSecondStepViewModel extends BaseViewModel<LogoffRequest> {
@Override
public void call() {
model.logoff(accountClosureReason, accountClosureReason)
model.logoff(accountClosureMark, accountClosureReason)
.compose(RxUtils.schedulersTransformer()) //线程调度
// .compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换, 这里可以换成自己的ExceptionHandle
.doOnSubscribe(LogoffSecondStepViewModel.this)
......
......@@ -93,17 +93,24 @@ public class CouponGoodsListActivity extends BaseActivity<ActivityCouponGoodsLis
binding.ivSortPriceAsc.setVisibility(View.VISIBLE);
}
});
//获取适配器上下文
CouponGoodsAdapter goodsAdapter = new CouponGoodsAdapter(CouponGoodsListActivity.this);
//获取适配器上下文
GridLayoutManager manager = new GridLayoutManager(CouponGoodsListActivity.this,2);
binding.rvGoodsList.setLayoutManager(manager);
//把adapterset进去
binding.rvGoodsList.setAdapter(goodsAdapter);
goodsAdapter.setOnItemClick((position, data) -> viewModel.goGoodsDetail(data.getBusinessId()));
viewModel.goodsBeanList.observe(this, goodsBeanList -> {
//获取适配器上下文
CouponGoodsAdapter goodsAdapter = new CouponGoodsAdapter(CouponGoodsListActivity.this);
//获取适配器上下文
GridLayoutManager manager = new GridLayoutManager(CouponGoodsListActivity.this,2);
binding.rvGoodsList.setLayoutManager(manager);
//把adapterset进去
binding.rvGoodsList.setAdapter(goodsAdapter);
if (goodsBeanList == null || goodsBeanList.isEmpty()) {
binding.rlNoData.setVisibility(View.VISIBLE);
binding.rvGoodsList.setVisibility(View.GONE);
} else {
binding.rlNoData.setVisibility(View.GONE);
binding.rvGoodsList.setVisibility(View.VISIBLE);
}
goodsAdapter.mList = goodsBeanList;
goodsAdapter.setOnItemClick((position, data) -> viewModel.goGoodsDetail(data.getBusinessId()));
goodsAdapter.notifyDataSetChanged();
});
}
......
package com.xx.hbhconsumer.ui.mycoupon;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.lifecycle.Observer;
......@@ -66,6 +67,11 @@ public class MyCouponActivity extends BaseActivity<ActivityMyCouponBinding, MyCo
binding.refresh.finishLoadMore();
}
if (viewModel.page == viewModel.totalPage) {
binding.refresh.setEnableLoadMore(false);
} else {
binding.refresh.setEnableLoadMore(true);
}
});
}
@Override
......@@ -89,11 +95,11 @@ public class MyCouponActivity extends BaseActivity<ActivityMyCouponBinding, MyCo
viewModel.page++;
if (viewModel.page > viewModel.totalPage) {
// binding.tvNoMore.setVisibility(View.VISIBLE);
binding.tvNoMore.setVisibility(View.VISIBLE);
} else if (viewModel.page == viewModel.totalPage) {
binding.refresh.setEnableLoadMore(false);
viewModel.loadData();
// binding.tvNoMore.setVisibility(View.VISIBLE);
binding.tvNoMore.setVisibility(View.VISIBLE);
} else {
viewModel.loadData();
}
......
......@@ -14,6 +14,7 @@ import com.xx.hbhconsumer.data.http.respons.OrderBean;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URLDecoder;
import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.utils.ToastUtils;
......@@ -33,6 +34,7 @@ public class NewsDetailViewModel extends BaseViewModel<NewsRequest> {
try {
String[] arr = url.split("/");
String fileName = arr[arr.length - 1];
fileName = URLDecoder.decode(fileName, "UTF-8");
String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getPath();
String filePath = path + "/" + fileName;
try {
......
......@@ -34,6 +34,7 @@ public class NewsListViewModel extends BaseViewModel<NewsRequest> {
if ("1".equals(children.isView())) {
Bundle bundle=new Bundle();
bundle.putString("url", children.getFileUrl());
bundle.putString("name", children.getInformationName());
startActivity(PDFWebViewActivity.class, bundle);
} else {
Bundle bundle=new Bundle();
......
......@@ -15,6 +15,7 @@ import androidx.annotation.Nullable;
import com.tencent.smtt.sdk.WebSettings;
import com.xx.hbhconsumer.R;
import com.xx.xxviewlibrary.witget.XxBar;
import wendu.dsbridge.DWebView;
......@@ -44,7 +45,10 @@ public class PDFWebViewActivity extends Activity implements View.OnClickListener
private void instantiation() {
webviewx5 = findViewById(R.id.webview);
XxBar xxBar = findViewById(R.id.bar);
url = getIntent().getStringExtra("url");
String name = getIntent().getStringExtra("name");
xxBar.tv_title.setText(name);
webviewDe(url);
}
......
......@@ -3,8 +3,11 @@ package com.xx.hbhconsumer.ui.phone;
import android.os.Bundle;
import com.xx.hbhconsumer.R;
import com.xx.hbhconsumer.data.http.requst.PhoneRequest;
import com.xx.hbhconsumer.data.http.requst.PwdRequest;
import com.xx.hbhconsumer.data.local.LocalData;
import com.xx.hbhconsumer.databinding.ActivityChangePhoneBinding;
import com.xx.hbhconsumer.ui.pwd.PwdViewModel;
import me.goldze.mvvmhabit.base.BaseActivity;
import me.tatarka.bindingcollectionadapter2.BR;
......@@ -23,6 +26,12 @@ public class PhoneActivity extends BaseActivity<ActivityChangePhoneBinding, Phon
@Override
public void initData() {
super.initData();
binding.etPhone.setText(LocalData.getUser().getPhonenumber());
}
@Override
public PhoneViewModel initViewModel() {
PhoneRequest lm = new PhoneRequest();
return new PhoneViewModel(getApplication(), lm);
}
}
......@@ -38,6 +38,22 @@ public class PhoneViewModel extends BaseViewModel<PhoneRequest> {
super(application, model);
}
@Override
public void onCreate() {
super.onCreate();
currentPhone.set(LocalData.getUser().getPhonenumber());
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onResume() {
super.onResume();
}
// 获取验证码
public BindingCommand getCode = new BindingCommand(new BindingAction() {
@Override
......
......@@ -62,7 +62,7 @@
android:layout_below="@id/tv_phone_label"
android:layout_marginTop="25dp"
style="@style/CommEdit"
android:text="13811551188"
android:text="@={phoneViewModel.currentPhone}"
android:textColor="#FF757575"
android:background="@null"
android:maxLines="1"/>
......
......@@ -142,9 +142,6 @@
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_goods_list"
android:layout_width="match_parent"
......@@ -340,5 +337,19 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_no_data"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/top_bar">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/zhanwei_img_wushuju" />
</RelativeLayout>
</RelativeLayout>
</layout>
\ No newline at end of file
......@@ -83,9 +83,10 @@
binding:layoutManager="@{LayoutManagers.linear(1,false)}"/>
<TextView
android:id="@+id/tv_goods_no_more"
android:layout_width="wrap_content"
android:id="@+id/tv_no_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_below="@id/rv_search_goods_list"
android:text="~ 没有更多啦 ~"
......
......@@ -121,6 +121,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/tv_coupon_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
......
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