Commit 06b0acb5 authored by 杨秀秀's avatar 杨秀秀

基础搭建

功能开发
商户端店铺信息bug
parent 87cb65f6
This diff is collapsed.
...@@ -57,7 +57,7 @@ android { ...@@ -57,7 +57,7 @@ android {
minifyEnabled false minifyEnabled false
debuggable true debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "URL", URL_DEBUG buildConfigField "String", "URL", URL_RELEASE
buildConfigField "String", "URL_H5", URL_DEBUG_H5 buildConfigField "String", "URL_H5", URL_DEBUG_H5
} }
} }
......
...@@ -219,7 +219,7 @@ public class HomeViewModel extends BaseViewModel<HomeRequest> { ...@@ -219,7 +219,7 @@ public class HomeViewModel extends BaseViewModel<HomeRequest> {
} }
} else { } else {
ToastUtils.showShort("版本已是最新!");
} }
......
...@@ -199,7 +199,6 @@ public class HuanBoHaiViewModel extends ListBaseViewModel<HuanBoHaiRequest> { ...@@ -199,7 +199,6 @@ public class HuanBoHaiViewModel extends ListBaseViewModel<HuanBoHaiRequest> {
} }
} else { } else {
ToastUtils.showShort("版本已是最新!");
} }
......
...@@ -153,7 +153,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> { ...@@ -153,7 +153,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
} else { } else {
/*强制更新标识位变更--重置用户登录*/ /*强制更新标识位变更--重置用户登录*/
StaticData.updateLogin = 1; StaticData.updateLogin = 1;
ToastUtils.showShort("版本已是最新!");
} }
...@@ -328,7 +327,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> { ...@@ -328,7 +327,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
} else { } else {
/*强制更新标识位变更--重置用户登录*/ /*强制更新标识位变更--重置用户登录*/
StaticData.updateLogin = 1; StaticData.updateLogin = 1;
ToastUtils.showShort("版本已是最新!");
} }
......
package com.xx.merchanthbh.ui.merchantinfo package com.xx.merchanthbh.ui.merchantinfo
import android.os.Bundle import android.os.Bundle
import android.util.Log
import android.view.View import android.view.View
import com.xx.merchanthbh.BR import com.xx.merchanthbh.BR
import com.xx.merchanthbh.R import com.xx.merchanthbh.R
...@@ -24,6 +25,30 @@ class MaterialInfoActivity : BaseActivity<ActivityMaterialInfoBinding, MerchantI ...@@ -24,6 +25,30 @@ class MaterialInfoActivity : BaseActivity<ActivityMaterialInfoBinding, MerchantI
super.initData() super.initData()
viewModel.adapter=AddBrankAdapter(this,1) viewModel.adapter=AddBrankAdapter(this,1)
binding.rvFrmBrankList.adapter= viewModel.adapter binding.rvFrmBrankList.adapter= viewModel.adapter
viewModel.brandVisibility.observe(this){
it->
if (it)
{
binding.llBrand.visibility=View.VISIBLE
}else{
binding.llBrand.visibility=View.GONE
}
}
viewModel.imgVisibility.observe(this){
it->
when(it)
{
0-> {}
1-> {binding.llBusinessLicense.visibility=View.VISIBLE }
2-> {binding.llBusinessLicense.visibility=View.GONE }
3-> {binding.llOperatingPermit.visibility=View.VISIBLE }
4-> {binding.llOperatingPermit.visibility=View.GONE }
}
}
viewModel.getMerchantInfo() viewModel.getMerchantInfo()
...@@ -39,6 +64,7 @@ class MaterialInfoActivity : BaseActivity<ActivityMaterialInfoBinding, MerchantI ...@@ -39,6 +64,7 @@ class MaterialInfoActivity : BaseActivity<ActivityMaterialInfoBinding, MerchantI
} }
} }
......
...@@ -3,6 +3,7 @@ package com.xx.merchanthbh.ui.merchantinfo; ...@@ -3,6 +3,7 @@ package com.xx.merchanthbh.ui.merchantinfo;
import android.app.Application; import android.app.Application;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
...@@ -60,6 +61,18 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> { ...@@ -60,6 +61,18 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> {
public ObservableField<String> supervisors=new ObservableField<>(""); public ObservableField<String> supervisors=new ObservableField<>("");
//品牌是否显示
public MutableLiveData<Boolean> brandVisibility=new MutableLiveData<>(true);
/**
* 1:营业执照显示
* 2:营业执照隐藏
* 3:经营许可证显示
* 4:经营许可证隐藏
*/
public MutableLiveData<Integer> imgVisibility=new MutableLiveData<>(0);
public MutableLiveData<MerchantBean> merchantInfos=new MutableLiveData<>(); public MutableLiveData<MerchantBean> merchantInfos=new MutableLiveData<>();
public MerchantInfoViewModel(@NonNull Application application) { public MerchantInfoViewModel(@NonNull Application application) {
...@@ -131,6 +144,7 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> { ...@@ -131,6 +144,7 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> {
public void addBrank(View view) public void addBrank(View view)
{ {
brandVisibility.postValue(true);
adapter.mList.add(new Brankbody(new ObservableField(""),new ArrayList(),null,true)); adapter.mList.add(new Brankbody(new ObservableField(""),new ArrayList(),null,true));
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} }
...@@ -248,11 +262,34 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> { ...@@ -248,11 +262,34 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> {
public void onSuccess(MerchantBean resultBean) { public void onSuccess(MerchantBean resultBean) {
merchantInfo.setMerchantInfo(resultBean); merchantInfo.setMerchantInfo(resultBean);
merchantInfos.postValue(resultBean); merchantInfos.postValue(resultBean);
adapter.mList=merchantInfo.reBrankbody(resultBean.getBrandAuthorizationList());
if (resultBean.getBrandAuthorizationList().size()<=0)
{
brandVisibility.postValue(false);
}else {
brandVisibility.postValue(true);
}
adapter.mList=merchantInfo.reBrankbody(resultBean.getBrandAuthorizationList());
supervisors.set( StringUtils.join(resultBean.getSupervisorsUserInfoList(),",",supervisorsUserInfo -> supervisorsUserInfo.getNickName())); supervisors.set( StringUtils.join(resultBean.getSupervisorsUserInfoList(),",",supervisorsUserInfo -> supervisorsUserInfo.getNickName()));
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
//营业执照图片
if (TextUtils.isEmpty(resultBean.getBusinessLicense()))
{
imgVisibility.setValue(2);
}else {
imgVisibility.setValue(1);
}
//营业许可证
if (TextUtils.isEmpty(resultBean.getOperatingPermit()))
{
imgVisibility.setValue(4);
}else {
imgVisibility.setValue(3);
}
} }
@Override @Override
......
...@@ -121,7 +121,7 @@ public class MineFragment extends BaseFragment<FragmentMineBinding, MineViewMode ...@@ -121,7 +121,7 @@ public class MineFragment extends BaseFragment<FragmentMineBinding, MineViewMode
// 检查版本 // 检查版本
viewModel.rxPermissions = new RxPermissions(this); viewModel.rxPermissions = new RxPermissions(this);
/*检查版本*/ /*检查版本*/
viewModel.checkVersion(binding.getRoot().getRootView()); // viewModel.checkVersion(binding.getRoot().getRootView());
// 安装新版本 // 安装新版本
viewModel.openInstall.observe(this, new Observer<String>() { viewModel.openInstall.observe(this, new Observer<String>() {
......
...@@ -244,7 +244,11 @@ public class MineViewModel extends BaseViewModel<MineRequest> { ...@@ -244,7 +244,11 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
} }
} else { } else {
ToastUtils.showShort("版本已是最新!"); if (view!=null)
{
ToastUtils.showShort("版本已是最新!");
}
} }
...@@ -252,7 +256,6 @@ public class MineViewModel extends BaseViewModel<MineRequest> { ...@@ -252,7 +256,6 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
@Override @Override
public void onError(String Error) { public void onError(String Error) {
Log.e("归根究底的错误", "归根究底的错误: " + Error);
} }
}); });
} }
......
...@@ -223,6 +223,7 @@ ...@@ -223,6 +223,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="134dp" android:layout_height="134dp"
android:paddingLeft="13dp" android:paddingLeft="13dp"
android:id="@+id/ll_business_license"
android:paddingRight="13dp" android:paddingRight="13dp"
android:background="#00000000"> android:background="#00000000">
...@@ -241,7 +242,6 @@ ...@@ -241,7 +242,6 @@
android:layout_width="106dp" android:layout_width="106dp"
android:layout_height="80dp" android:layout_height="80dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
android:onClick="@{viewModel.uploadPic}"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
pic_url="@{viewModel.merchantInfo.businessLicense}" pic_url="@{viewModel.merchantInfo.businessLicense}"
...@@ -264,6 +264,7 @@ ...@@ -264,6 +264,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="134dp" android:layout_height="134dp"
android:paddingLeft="13dp" android:paddingLeft="13dp"
android:id="@+id/ll_operating_permit"
android:paddingRight="13dp" android:paddingRight="13dp"
android:background="#00000000"> android:background="#00000000">
...@@ -284,7 +285,6 @@ ...@@ -284,7 +285,6 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
android:onClick="@{viewModel.uploadPic}"
pic_url="@{viewModel.merchantInfo.operatingPermit}" pic_url="@{viewModel.merchantInfo.operatingPermit}"
android:id="@+id/xup_frm_licence" android:id="@+id/xup_frm_licence"
android:layout_marginLeft="129dp" android:layout_marginLeft="129dp"
...@@ -302,6 +302,7 @@ ...@@ -302,6 +302,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:background="@drawable/bg_white_radius_12" android:background="@drawable/bg_white_radius_12"
android:orientation="vertical"> android:orientation="vertical">
...@@ -335,12 +336,11 @@ ...@@ -335,12 +336,11 @@
android:text="添加品牌授权" android:text="添加品牌授权"
android:id="@+id/tv_ami_add_brand" android:id="@+id/tv_ami_add_brand"
android:textSize="16sp"/> android:textSize="16sp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:id="@+id/ll_brand"
android:background="@color/line_grey" android:background="@color/line_grey"
android:layout_marginLeft="14dp" android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"/> android:layout_marginRight="14dp"/>
......
...@@ -340,7 +340,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> { ...@@ -340,7 +340,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
} else { } else {
/*强制更新标识位变更--重置用户登录*/ /*强制更新标识位变更--重置用户登录*/
StaticData.updateLogin = 1; StaticData.updateLogin = 1;
ToastUtils.showShort("版本已是最新!");
} }
......
...@@ -59,7 +59,7 @@ android { ...@@ -59,7 +59,7 @@ android {
debug { debug {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "URL", URL_DEBUG buildConfigField "String", "URL", URL_RELEASE
buildConfigField "String", "URL_H5", URL_DEBUG_H5 buildConfigField "String", "URL_H5", URL_DEBUG_H5
} }
} }
......
...@@ -178,7 +178,6 @@ public class HomeViewModel extends ListBaseViewModel<HomeRequest> { ...@@ -178,7 +178,6 @@ public class HomeViewModel extends ListBaseViewModel<HomeRequest> {
} }
} else { } else {
ToastUtils.showShort("版本已是最新!");
} }
} }
......
...@@ -155,7 +155,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> { ...@@ -155,7 +155,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
/*强制更新标识位变更--重置用户登录*/ /*强制更新标识位变更--重置用户登录*/
StaticData.updateLogin = 1; StaticData.updateLogin = 1;
ToastUtils.showShort("版本已是最新!");
} }
...@@ -307,7 +306,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> { ...@@ -307,7 +306,6 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
} else { } else {
/*强制更新标识位变更--重置用户登录*/ /*强制更新标识位变更--重置用户登录*/
StaticData.updateLogin = 1; StaticData.updateLogin = 1;
ToastUtils.showShort("版本已是最新!");
} }
......
...@@ -104,8 +104,7 @@ public class MineFragment extends BaseFragment<FragmentMineBinding, MineViewMode ...@@ -104,8 +104,7 @@ public class MineFragment extends BaseFragment<FragmentMineBinding, MineViewMode
super.onResume(); super.onResume();
// 检查版本 // 检查版本
viewModel.rxPermissions = new RxPermissions(this); viewModel.rxPermissions = new RxPermissions(this);
/*检查版本*/
viewModel.checkVersion(binding.getRoot().getRootView());
// 安装新版本 // 安装新版本
viewModel.openInstall.observe(this, new Observer<String>() { viewModel.openInstall.observe(this, new Observer<String>() {
@Override @Override
......
...@@ -229,7 +229,11 @@ public class MineViewModel extends BaseViewModel<MineRequest> { ...@@ -229,7 +229,11 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
} }
} else { } else {
ToastUtils.showShort("版本已是最新!"); if(view!=null)
{
ToastUtils.showShort("版本已是最新!");
}
} }
} }
......
...@@ -139,7 +139,6 @@ public class WorkViewModel extends BaseViewModel<WorkRequest> { ...@@ -139,7 +139,6 @@ public class WorkViewModel extends BaseViewModel<WorkRequest> {
} }
} else { } else {
ToastUtils.showShort("版本已是最新!");
} }
} }
......
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