Commit bcf86cc5 authored by 杨秀秀's avatar 杨秀秀

基础搭建

功能开发
1:完善商品列表
2:添加扫描
parent 8d34d96d
...@@ -8,6 +8,13 @@ android { ...@@ -8,6 +8,13 @@ android {
namespace 'com.xx.merchanthbh' namespace 'com.xx.merchanthbh'
compileSdk 31 compileSdk 31
android.applicationVariants.all {
variant ->
variant.outputs.all {
//这里修改apk文件名
outputFileName = "merchant_v${defaultConfig.versionName}_${buildType.name}.apk"
}
}
defaultConfig { defaultConfig {
applicationId "com.xx.merchanthbh" applicationId "com.xx.merchanthbh"
minSdk 23 minSdk 23
...@@ -64,6 +71,6 @@ dependencies { ...@@ -64,6 +71,6 @@ dependencies {
implementation project(path: ':dsbridge') implementation project(path: ':dsbridge')
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'androidx.test.espresso:espresso-core:2.2.2'
implementation rootProject.ext.dependencies["AutoLayout"] implementation rootProject.ext.dependencies["AutoLayout"]
} }
\ No newline at end of file
...@@ -38,6 +38,7 @@ import me.goldze.mvvmhabit.base.BaseViewModel; ...@@ -38,6 +38,7 @@ import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.http.ApiDisposableObserver; import me.goldze.mvvmhabit.http.ApiDisposableObserver;
import me.goldze.mvvmhabit.utils.RxUtils; import me.goldze.mvvmhabit.utils.RxUtils;
import me.goldze.mvvmhabit.utils.StringUtils; import me.goldze.mvvmhabit.utils.StringUtils;
import me.goldze.mvvmhabit.utils.ToastUtils;
public class AddProductViewModel extends BaseViewModel<AddProductRequest> { public class AddProductViewModel extends BaseViewModel<AddProductRequest> {
...@@ -191,22 +192,12 @@ public class AddProductViewModel extends BaseViewModel<AddProductRequest> { ...@@ -191,22 +192,12 @@ public class AddProductViewModel extends BaseViewModel<AddProductRequest> {
*/ */
public void saveDrafts(View view) public void saveDrafts(View view)
{ {
List<CategoryBean> list=new ArrayList();
String productImgss=StringUtils.join(list,",",(data) -> data.getCategoryName());
/*if (productAdapter.mList.get(productAdapter.mList.size()-1).getId()==null)
{
productAdapter.mList.remove(productAdapter.mList.size()-1);
}
if (detailAdapter.mList.get(detailAdapter.mList.size()-1).getId()==null)
{
detailAdapter.mList.remove(detailAdapter.mList.size()-1);
}*/
//获取图片数据
String productImgs=StringUtils.join(productAdapter.mList,",",(data) -> data.getId()).replace(",null","").replace("null",""); String productImgs=StringUtils.join(productAdapter.mList,",",(data) -> data.getId()).replace(",null","").replace("null","");
String describeImgs=StringUtils.join(detailAdapter.mList,",",(data) -> data.getId()).replace(",null","").replace("null",""); String describeImgs=StringUtils.join(detailAdapter.mList,",",(data) -> data.getId()).replace(",null","").replace("null","");
//分辨放入草稿和提交
String staticSttr; String staticSttr;
if (view.getId()==R.id.btn_aap_draft) if (view.getId()==R.id.btn_aap_draft)
{ {
...@@ -215,6 +206,11 @@ public class AddProductViewModel extends BaseViewModel<AddProductRequest> { ...@@ -215,6 +206,11 @@ public class AddProductViewModel extends BaseViewModel<AddProductRequest> {
staticSttr="2"; staticSttr="2";
} }
if (TextUtils.isEmpty(pPrice.get()))
{
ToastUtils.showShort("请输入价格!");
return;
}
model.addProduct(pNumber.get(),pNumber.get(),productImgs,describeImgs,typeId,pPrice.get(),pDescribe.get(),brandID,staticSttr).compose(RxUtils.schedulersTransformer()) //线程调度 model.addProduct(pNumber.get(),pNumber.get(),productImgs,describeImgs,typeId,pPrice.get(),pDescribe.get(),brandID,staticSttr).compose(RxUtils.schedulersTransformer()) //线程调度
.doOnSubscribe(AddProductViewModel.this) .doOnSubscribe(AddProductViewModel.this)
.doOnSubscribe (new Consumer<Disposable>() { .doOnSubscribe (new Consumer<Disposable>() {
......
...@@ -3,6 +3,7 @@ package com.xx.merchanthbh.ui.appeallist; ...@@ -3,6 +3,7 @@ package com.xx.merchanthbh.ui.appeallist;
import android.app.Application; import android.app.Application;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
...@@ -11,6 +12,7 @@ import com.xx.merchanthbh.data.http.requst.AppealListRequest; ...@@ -11,6 +12,7 @@ import com.xx.merchanthbh.data.http.requst.AppealListRequest;
import com.xx.merchanthbh.data.http.respons.AppealListBean; import com.xx.merchanthbh.data.http.respons.AppealListBean;
import com.xx.merchanthbh.ui.appeal.AppealActivity; import com.xx.merchanthbh.ui.appeal.AppealActivity;
import com.xx.merchanthbh.ui.appeal.AppealEditActivity; import com.xx.merchanthbh.ui.appeal.AppealEditActivity;
import com.xx.merchanthbh.ui.assistant.AssistantAddActivity;
import com.xx.merchanthbh.ui.msg.MessageDetailActivity; import com.xx.merchanthbh.ui.msg.MessageDetailActivity;
import java.util.List; import java.util.List;
...@@ -99,4 +101,14 @@ public class AppealListViewModel extends ListBaseViewModel<AppealListRequest> { ...@@ -99,4 +101,14 @@ public class AppealListViewModel extends ListBaseViewModel<AppealListRequest> {
}); });
} }
/**
* 跳转诉求添加
*/
public View.OnClickListener goAssistantAdd = new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(AssistantAddActivity.class);
}
};
} }
...@@ -29,6 +29,7 @@ import me.goldze.mvvmhabit.binding.command.BindingAction; ...@@ -29,6 +29,7 @@ import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand; import me.goldze.mvvmhabit.binding.command.BindingCommand;
import me.goldze.mvvmhabit.http.ApiDisposableObserver; import me.goldze.mvvmhabit.http.ApiDisposableObserver;
import me.goldze.mvvmhabit.utils.RxUtils; import me.goldze.mvvmhabit.utils.RxUtils;
import me.goldze.mvvmhabit.utils.SPUtils;
import me.goldze.mvvmhabit.utils.ToastUtils; import me.goldze.mvvmhabit.utils.ToastUtils;
public class LoginViewModel extends BaseViewModel<LoginRequest> { public class LoginViewModel extends BaseViewModel<LoginRequest> {
...@@ -129,10 +130,7 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> { ...@@ -129,10 +130,7 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
}).subscribe(new ApiDisposableObserver<UserInfoBean>() { }).subscribe(new ApiDisposableObserver<UserInfoBean>() {
@Override @Override
public void onSuccess(UserInfoBean resultBean) { public void onSuccess(UserInfoBean resultBean) {
// 判断是否是店长 SPUtils.getInstance().clear();
if (resultBean.getUser().getRoles().get(0).getRoleName().equals("店长")) {
StaticData.personType = 0;
}
//将用户信息存储到本地 //将用户信息存储到本地
LocalData.saveUser(resultBean.getUser()); LocalData.saveUser(resultBean.getUser());
dismissDialog(); dismissDialog();
...@@ -151,6 +149,11 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> { ...@@ -151,6 +149,11 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
bundle.putInt("pageStep", R.id.registerMaterialFragment); bundle.putInt("pageStep", R.id.registerMaterialFragment);
startActivity(MerchantEnterActivity.class,bundle); startActivity(MerchantEnterActivity.class,bundle);
}else { }else {
LocalData.saveMerchant(resultBean.getMerchant());
// 判断是否是店长
if (resultBean.getUser().getRoles().get(0).getRoleName().equals("店长")) {
StaticData.personType = 0;
}
LocalData.saveMerchant(resultBean.getMerchant()); LocalData.saveMerchant(resultBean.getMerchant());
startActivity(HomeActivity.class); startActivity(HomeActivity.class);
} }
......
...@@ -182,7 +182,8 @@ public class MerchantEnterViewModel extends BaseViewModel<MerchantEnterRequst> { ...@@ -182,7 +182,8 @@ public class MerchantEnterViewModel extends BaseViewModel<MerchantEnterRequst> {
}).subscribe(new ApiDisposableObserver<String>() { }).subscribe(new ApiDisposableObserver<String>() {
@Override @Override
public void onSuccess(String resultBean) { public void onSuccess(String resultBean) {
ToastUtils.showShort("已经发送成功"); // ToastUtils.showShort("已经发送成功");
ToastUtils.showShort(resultBean);
dismissDialog(); dismissDialog();
} }
......
package com.xx.merchanthbh.ui.productmanager package com.xx.merchanthbh.ui.productmanager
import android.os.Bundle import android.os.Bundle
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import com.scwang.smart.refresh.layout.api.RefreshLayout
import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener
import com.xx.merchanthbh.BR import com.xx.merchanthbh.BR
import com.xx.merchanthbh.R import com.xx.merchanthbh.R
import com.xx.merchanthbh.data.http.requst.ProductManagerRequst import com.xx.merchanthbh.data.http.requst.ProductManagerRequst
import com.xx.merchanthbh.databinding.ActivityProductListBinding import com.xx.merchanthbh.databinding.ActivityProductListBinding
import me.goldze.mvvmhabit.base.BaseActivity import me.goldze.mvvmhabit.base.BaseActivity
class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductManagerViewModel>() { class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductManagerViewModel>(),OnRefreshListener,OnLoadMoreListener{
override fun initContentView(savedInstanceState: Bundle?): Int { override fun initContentView(savedInstanceState: Bundle?): Int {
return R.layout.activity_product_list return R.layout.activity_product_list
} }
...@@ -21,11 +24,27 @@ class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductMa ...@@ -21,11 +24,27 @@ class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductMa
super.initData() super.initData()
viewModel.listAdapter= ProductListAdapter(this,viewModel) viewModel.listAdapter= ProductListAdapter(this,viewModel)
binding.rvProductList.adapter= viewModel.listAdapter binding.rvProductList.adapter= viewModel.listAdapter
//控制加载控件
viewModel.loadMoreStatic.observe(
this
) {
if (it == 1) {
binding.refresh.finishLoadMore();
} else if (it == 2) {
binding.refresh.finishLoadMore();
binding.refresh.setEnableLoadMore(false);
}
binding.refresh.finishRefresh()
}
viewModel.getProductList() viewModel.getProductList()
//分类控制
binding.tabs.addOnTabSelectedListener(object: TabLayout.OnTabSelectedListener binding.tabs.addOnTabSelectedListener(object: TabLayout.OnTabSelectedListener
{ {
override fun onTabSelected(tab: TabLayout.Tab?) { override fun onTabSelected(tab: TabLayout.Tab?) {
viewModel.pageNum=1 viewModel.page=1
viewModel.listAdapter.mList.clear() viewModel.listAdapter.mList.clear()
when(tab?.position) when(tab?.position)
{ {
...@@ -47,6 +66,23 @@ class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductMa ...@@ -47,6 +66,23 @@ class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductMa
}) })
binding.llAplTime.setOnClickListener()
{
if ("0".equals(viewModel.sortRules))
{
viewModel.timeStr.set("时间升序");
viewModel.sortRules="1";
}else{
viewModel.timeStr.set("时间降序");
viewModel.sortRules="0";
}
viewModel.page=1
viewModel.getProductList()
}
} }
override fun initViewModel(): ProductManagerViewModel { override fun initViewModel(): ProductManagerViewModel {
...@@ -54,5 +90,16 @@ class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductMa ...@@ -54,5 +90,16 @@ class ProductManagerActivity: BaseActivity<ActivityProductListBinding, ProductMa
return ProductManagerViewModel(application,lm) return ProductManagerViewModel(application,lm)
} }
override fun onLoadMore(refreshLayout: RefreshLayout) {
viewModel.page++;
viewModel.getProductList();
}
override fun onRefresh() {
viewModel.page = 1;
viewModel.getProductList();
binding.refresh.setEnableLoadMore(true)
}
} }
\ No newline at end of file
...@@ -4,10 +4,13 @@ import android.app.Application; ...@@ -4,10 +4,13 @@ import android.app.Application;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;
import com.xx.merchanthbh.app.ListBaseViewModel;
import com.xx.merchanthbh.data.http.requst.ProductManagerRequst; import com.xx.merchanthbh.data.http.requst.ProductManagerRequst;
import com.xx.merchanthbh.data.http.respons.ProductListBean; import com.xx.merchanthbh.data.http.respons.ProductListBean;
import com.xx.merchanthbh.data.http.respons.UserInfoBean; import com.xx.merchanthbh.data.http.respons.UserInfoBean;
import com.xx.merchanthbh.ui.addproduct.AddProductActivity;
import com.xx.merchanthbh.ui.login.LoginViewModel; import com.xx.merchanthbh.ui.login.LoginViewModel;
import com.xx.xxviewlibrary.comm.CommTextDialog; import com.xx.xxviewlibrary.comm.CommTextDialog;
import com.xx.xxviewlibrary.comm.RefuseDialogBean; import com.xx.xxviewlibrary.comm.RefuseDialogBean;
...@@ -21,14 +24,17 @@ import me.goldze.mvvmhabit.http.ApiDisposableObserver; ...@@ -21,14 +24,17 @@ import me.goldze.mvvmhabit.http.ApiDisposableObserver;
import me.goldze.mvvmhabit.http.ApiDisposablePageObserver; import me.goldze.mvvmhabit.http.ApiDisposablePageObserver;
import me.goldze.mvvmhabit.utils.RxUtils; import me.goldze.mvvmhabit.utils.RxUtils;
public class ProductManagerViewModel extends BaseViewModel<ProductManagerRequst> { public class ProductManagerViewModel extends ListBaseViewModel<ProductManagerRequst> {
public int pageNum=1;
public String listStatic=null; public String listStatic=null;
public ProductListAdapter listAdapter; public ProductListAdapter listAdapter;
//时间顺序标识 0-时间降序,1-时间升序
public String sortRules="0";
public ObservableField<String> timeStr=new ObservableField<>("时间降序");
public ProductManagerViewModel(@NonNull Application application, ProductManagerRequst model) { public ProductManagerViewModel(@NonNull Application application, ProductManagerRequst model) {
super(application, model); super(application, model);
} }
...@@ -39,7 +45,9 @@ public class ProductManagerViewModel extends BaseViewModel<ProductManagerRequst> ...@@ -39,7 +45,9 @@ public class ProductManagerViewModel extends BaseViewModel<ProductManagerRequst>
*/ */
public void getProductList() public void getProductList()
{ {
model.getProductList(listStatic,"0",1).compose(RxUtils.schedulersTransformer()) //线程调度
model.getProductList(listStatic,sortRules,page).compose(RxUtils.schedulersTransformer()) //线程调度
// .compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换, 这里可以换成自己的ExceptionHandle // .compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换, 这里可以换成自己的ExceptionHandle
.doOnSubscribe(ProductManagerViewModel.this) .doOnSubscribe(ProductManagerViewModel.this)
.doOnSubscribe(new Consumer<Disposable>() { .doOnSubscribe(new Consumer<Disposable>() {
...@@ -50,7 +58,12 @@ public class ProductManagerViewModel extends BaseViewModel<ProductManagerRequst> ...@@ -50,7 +58,12 @@ public class ProductManagerViewModel extends BaseViewModel<ProductManagerRequst>
@Override @Override
public void onSuccess(List<ProductListBean> resultBean) { public void onSuccess(List<ProductListBean> resultBean) {
listAdapter.mList=resultBean; if (page==1)
{
listAdapter.mList=resultBean;
}else {
listAdapter.mList.addAll(resultBean);
}
listAdapter.notifyDataSetChanged(); listAdapter.notifyDataSetChanged();
} }
...@@ -156,7 +169,12 @@ public class ProductManagerViewModel extends BaseViewModel<ProductManagerRequst> ...@@ -156,7 +169,12 @@ public class ProductManagerViewModel extends BaseViewModel<ProductManagerRequst>
} }
public View.OnClickListener goadd=new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(AddProductActivity.class);
}
};
} }
...@@ -129,19 +129,38 @@ ...@@ -129,19 +129,38 @@
android:onClick="@{viewModel.showCategoryDialog}" android:onClick="@{viewModel.showCategoryDialog}"
ed_title='@{@string/product_type}' ed_title='@{@string/product_type}'
/> />
<com.xx.xxviewlibrary.witget.XxFormEdit <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:onClick="@{viewModel.saveDrafts}" <com.xx.xxviewlibrary.witget.XxFormEdit
ed_content="@={viewModel.pPrice}" android:layout_width="match_parent"
ed_title='@{@string/product_price}' android:layout_height="wrap_content"
/> android:onClick="@{viewModel.saveDrafts}"
ed_content="@={viewModel.pPrice}"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:id="@+id/xfe_aap_price"
android:inputType="numberDecimal"
ed_title='@{@string/product_price}'
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="元"
app:layout_constraintBottom_toBottomOf="@+id/xfe_aap_price"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginRight="13dp"
app:layout_constraintTop_toTopOf="@+id/xfe_aap_price" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.xx.xxviewlibrary.witget.XxFormEdit <com.xx.xxviewlibrary.witget.XxFormEdit
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="@{viewModel.saveDrafts}" android:onClick="@{viewModel.saveDrafts}"
ed_content="@={viewModel.pDescribe}" ed_content="@={viewModel.pDescribe}"
app:content_type="3" app:content_type="3"
app:necessary="false"
ed_title='@{@string/product_describe}' ed_title='@{@string/product_describe}'
/> />
...@@ -162,16 +181,6 @@ ...@@ -162,16 +181,6 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
android:id="@+id/tv_aap_title_detail_img" android:id="@+id/tv_aap_title_detail_img"
android:textSize="16sp"/> android:textSize="16sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/xx_text_red"
app:layout_constraintTop_toTopOf="@+id/tv_aap_title_detail_img"
app:layout_constraintLeft_toRightOf="@+id/tv_aap_title_detail_img"
android:id="@+id/tv_aap_detail_necessary"
android:textSize="16sp"
android:text="*"/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
...@@ -198,6 +207,7 @@ ...@@ -198,6 +207,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:content_type="2" app:content_type="2"
app:necessary="false"
android:visibility="@{viewModel.brandGone}" android:visibility="@{viewModel.brandGone}"
android:onClick="@{viewModel.openBrankDialog}" android:onClick="@{viewModel.openBrankDialog}"
ed_content="@{viewModel.pBrand}" ed_content="@{viewModel.pBrand}"
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
on_click="@{viewModel.clickFinish}" on_click="@{viewModel.clickFinish}"
app:right_click="@{viewModel.goAssistantAdd}"
app:right_src='@{@drawable/dianyuanguanli_icon_xinzeng}' app:right_src='@{@drawable/dianyuanguanli_icon_xinzeng}'
app:bar_title='@{@string/appeal_manager}' /> app:bar_title='@{@string/appeal_manager}' />
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
<com.xx.xxviewlibrary.witget.XxBar <com.xx.xxviewlibrary.witget.XxBar
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp" android:layout_height="55dp"
app:right_click="@{viewModel.goadd}"
app:right_src='@{@drawable/dianyuanguanli_icon_xinzeng}'
on_click="@{viewModel.clickFinish}" on_click="@{viewModel.clickFinish}"
app:bar_title='@{@string/goods_management}' /> app:bar_title='@{@string/goods_management}' />
...@@ -75,21 +77,36 @@ ...@@ -75,21 +77,36 @@
android:layout_gravity="right" android:layout_gravity="right"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="17dp" android:paddingTop="17dp"
android:id="@+id/ll_apl_time"
android:paddingRight="17dp" android:paddingRight="17dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
style="@style/xxTextContent" style="@style/xxTextContent"
android:text="时间降序"/> android:text="@{viewModel.timeStr}"/>
</LinearLayout> </LinearLayout>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.scwang.smart.refresh.header.BezierRadarHeader
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_product_list" android:id="@+id/rv_product_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
binding:layoutManager="@{LayoutManagers.linear(1,false)}" binding:layoutManager="@{LayoutManagers.linear(1,false)}"
android:layout_margin="17dp"/> android:layout_margin="17dp"/>
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout> </LinearLayout>
</layout> </layout>
\ No newline at end of file
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:background="@drawable/bg_white_radius_12" android:background="@drawable/bg_white_radius_12"
android:padding="13dp" android:padding="13dp"
android:visibility="gone"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
......
...@@ -69,8 +69,9 @@ ext { ...@@ -69,8 +69,9 @@ ext {
//刷新加载 //刷新加载
"SmartRefreshBase":"io.github.scwang90:refresh-layout-kernel:2.0.6", "SmartRefreshBase":"io.github.scwang90:refresh-layout-kernel:2.0.6",
"SmartRefreshHeader":"io.github.scwang90:refresh-header-radar:2.0.6", "SmartRefreshHeader":"io.github.scwang90:refresh-header-radar:2.0.6",
"SmartRefreshFooter":"io.github.scwang90:refresh-footer-classics:2.0.6" "SmartRefreshFooter":"io.github.scwang90:refresh-footer-classics:2.0.6",
"mylhyl" : 'com.mylhyl:zxingscanner:2.1.6',
"Xzing":'com.github.bingoogolapple.BGAQRCode-Android:zxing:1.3.8',
] ]
} }
......
...@@ -63,6 +63,6 @@ dependencies { ...@@ -63,6 +63,6 @@ dependencies {
implementation project(path: ':dsbridge') implementation project(path: ':dsbridge')
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'androidx.test.espresso:espresso-core:2.2.2'
implementation rootProject.ext.dependencies["AutoLayout"] implementation rootProject.ext.dependencies["AutoLayout"]
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<com.xx.xxviewlibrary.witget.XxBar <com.xx.xxviewlibrary.witget.XxBar
android:id="@+id/bar" android:id="@+id/bar"
bar_title="@{@string/navigation_sea}" bar_title="@{@string/navigation_sea}"
on_click="@{hbhViewModel.clickFinish}" app:on_click="@{hbhViewModel.clickFinish}"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="55dp"/> android:layout_height="55dp"/>
......
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
android:text="店铺等级" android:text="店铺等级"
/> />
<RatingBar <RatingBar
android:id="@+id/rb_level" android:id="@+id/rb_level"
style="?android:attr/ratingBarStyleSmall" style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -6,12 +6,20 @@ plugins { ...@@ -6,12 +6,20 @@ plugins {
android { android {
namespace 'com.xx.hbhbcompany' namespace 'com.xx.hbhbcompany'
compileSdk 33 compileSdk 31
android.applicationVariants.all {
variant ->
variant.outputs.all {
//这里修改apk文件名
outputFileName = "company_v${defaultConfig.versionName}_${buildType.name}.apk"
}
}
defaultConfig { defaultConfig {
applicationId "com.xx.hbhbcompany" applicationId "com.xx.hbhbcompany"
minSdk 24 minSdk 24
targetSdk 33 targetSdk 31
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
...@@ -60,6 +68,7 @@ dependencies { ...@@ -60,6 +68,7 @@ dependencies {
implementation project(path: ':dsbridge') implementation project(path: ':dsbridge')
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'androidx.test.espresso:espresso-core:2.2.2'
implementation rootProject.ext.dependencies["AutoLayout"] implementation rootProject.ext.dependencies["AutoLayout"]
// implementation rootProject.ext.dependencies["mylhyl"]
} }
\ No newline at end of file
...@@ -125,9 +125,10 @@ ...@@ -125,9 +125,10 @@
<activity android:name=".ui.productlist.ProductListActivity" <activity android:name=".ui.productlist.ProductListActivity"
android:exported="true"> android:exported="true">
</activity> </activity>
<!--商品列表-->
<activity android:name=".ui.scan.ScanActivity"
android:exported="true"/>
<activity android:name=".ui.productInfo.ProductInfoActivity" <activity android:name=".ui.productInfo.ProductInfoActivity"
android:exported="true"> android:exported="true">
......
...@@ -18,6 +18,7 @@ import com.xx.hbhbcompany.ui.appeal.AppealDetailActivity; ...@@ -18,6 +18,7 @@ import com.xx.hbhbcompany.ui.appeal.AppealDetailActivity;
import com.xx.hbhbcompany.ui.consult.ConsultationActivity; import com.xx.hbhbcompany.ui.consult.ConsultationActivity;
import com.xx.hbhbcompany.ui.msg.MessageActivity; import com.xx.hbhbcompany.ui.msg.MessageActivity;
import com.xx.hbhbcompany.ui.recruitment.RecruitmentActivity; import com.xx.hbhbcompany.ui.recruitment.RecruitmentActivity;
import com.xx.hbhbcompany.ui.scan.ScanActivity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -201,4 +202,13 @@ public class HomeViewModel extends BaseViewModel<HomeRequest> { ...@@ -201,4 +202,13 @@ public class HomeViewModel extends BaseViewModel<HomeRequest> {
}); });
//跳转招聘信息界面
public BindingCommand goScan = new BindingCommand(new BindingAction() {
@Override
public void call() {
startActivity(ScanActivity.class);
}
});
} }
...@@ -42,7 +42,7 @@ public class MerchantAuditItemViewModel extends BaseViewModel<MerchantAuditListR ...@@ -42,7 +42,7 @@ public class MerchantAuditItemViewModel extends BaseViewModel<MerchantAuditListR
title.set(data.getStoreName()); title.set(data.getStoreName());
person.set("商户负责人:"+data.getResponsiblePerson()); person.set("商户负责人:"+data.getResponsiblePerson());
phone.set("负责人手机:"+data.getPersonPhone()); phone.set("负责人手机:"+data.getPersonPhone());
img.set(baseImgUrl+data.getLogeFile()); img.set(data.getLogoFile().getUrl());
id=data.getBusinessId(); id=data.getBusinessId();
} }
......
...@@ -2,6 +2,7 @@ package com.xx.hbhbcompany.ui.productlist; ...@@ -2,6 +2,7 @@ package com.xx.hbhbcompany.ui.productlist;
import android.app.Application; import android.app.Application;
import android.os.Bundle; import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.databinding.ObservableField; import androidx.databinding.ObservableField;
...@@ -88,4 +89,5 @@ public class ProductListViewModel extends ListBaseViewModel<ProductListRequest> ...@@ -88,4 +89,5 @@ public class ProductListViewModel extends ListBaseViewModel<ProductListRequest>
} }
package com.xx.hbhbcompany.ui.scan
import android.os.Bundle
import com.xx.hbhbcompany.BR
import com.xx.hbhbcompany.R
import com.xx.hbhbcompany.databinding.ActivityScanBinding
import me.goldze.mvvmhabit.base.BaseActivity
class ScanActivity: BaseActivity<ActivityScanBinding, ScanViewModel>() {
override fun initContentView(savedInstanceState: Bundle?): Int {
return R.layout.activity_scan
}
override fun initVariableId(): Int {
return BR.viewModel
}
}
\ No newline at end of file
package com.xx.hbhbcompany.ui.scan;
import android.app.Application;
import androidx.annotation.NonNull;
import com.xx.hbhbcompany.data.http.BaseRespons;
import me.goldze.mvvmhabit.base.BaseViewModel;
public class ScanViewModel extends BaseViewModel<BaseRespons> {
public ScanViewModel(@NonNull Application application) {
super(application);
}
}
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="viewModel"
type="com.xx.hbhbcompany.ui.scan.ScanViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.xx.xxviewlibrary.witget.XxBar
android:id="@+id/bar"
android:layout_width="match_parent"
android:layout_height="55dp"
on_click="@{viewModel.clickFinish}"
app:bar_title='@{@string/scan_title}'
app:layout_constraintTop_toTopOf="parent" />
<cn.bingoogolapple.qrcode.zxing.ZXingView
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/zv_scan"
app:layout_constraintTop_toBottomOf="@+id/bar"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
binding:layout_constraintBottom_toBottomOf="parent" binding:layout_constraintBottom_toBottomOf="parent"
binding:layout_constraintRight_toLeftOf="@+id/iv_bar_msg" binding:layout_constraintRight_toLeftOf="@+id/iv_bar_msg"
android:layout_marginRight="30.5dp" android:layout_marginRight="30.5dp"
onClickCommand="@{homeViewModel.goScan}"
android:src="@mipmap/home_icon_saoyisao" android:src="@mipmap/home_icon_saoyisao"
/> />
......
...@@ -34,15 +34,16 @@ ...@@ -34,15 +34,16 @@
<ImageView <ImageView
android:id="@+id/iv_ima_img"
android:layout_width="88dp" android:layout_width="88dp"
android:layout_height="88dp" android:layout_height="88dp"
app:layout_constraintTop_toBottomOf="@+id/v_ima_line1" android:layout_marginLeft="16dp"
android:layout_marginTop="12dp"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="13dp" app:layout_constraintTop_toBottomOf="@+id/v_ima_line1"
binding:url="@{viewModel.img}" binding:url="@{viewModel.img}" />
android:id="@+id/iv_ima_img"/>
<TextView <TextView
style="@style/xxTextTitle" style="@style/xxTextTitle"
android:textStyle="bold" android:textStyle="bold"
android:id="@+id/tv_ima_title" android:id="@+id/tv_ima_title"
......
<resources> <resources>
<string name="app_name">HbhBCompany</string> <string name="app_name">企业APP</string>
<string name="title_activity_main">MainActivity</string> <string name="title_activity_main">MainActivity</string>
<!-- Strings used for fragments for navigation --> <!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string> <string name="first_fragment_label">First Fragment</string>
...@@ -155,4 +155,6 @@ ...@@ -155,4 +155,6 @@
<string name="appeal_manager">诉求管理</string> <string name="appeal_manager">诉求管理</string>
<string name="scan_title">二维码/条码</string>
</resources> </resources>
\ No newline at end of file
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle. # Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
#Tue Aug 01 13:16:31 CST 2023 #Wed Aug 16 17:46:22 CST 2023
sdk.dir=D\:\\develop\\Android\\Sdk sdk.dir=D\:\\workSoft\\SDK
...@@ -4,7 +4,7 @@ pluginManagement { ...@@ -4,7 +4,7 @@ pluginManagement {
mavenCentral() mavenCentral()
gradlePluginPortal() gradlePluginPortal()
maven { url 'https://jitpack.io' } maven { url 'https://jitpack.io' }
maven { url "https://s01.oss.sonatype.org/content/groups/public" } maven { url 'https://maven.google.com'}
} }
} }
dependencyResolutionManagement { dependencyResolutionManagement {
...@@ -13,7 +13,7 @@ dependencyResolutionManagement { ...@@ -13,7 +13,7 @@ dependencyResolutionManagement {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://jitpack.io' } maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com'}
} }
} }
......
...@@ -51,7 +51,7 @@ dependencies { ...@@ -51,7 +51,7 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation rootProject.ext.dependencies["AutoLayout"] implementation rootProject.ext.dependencies["AutoLayout"]
implementation rootProject.ext.dependencies["glide"] implementation rootProject.ext.dependencies["glide"]
api 'io.github.youth5201314:banner:2.2.2' api 'io.github.youth5201314:banner:2.2.2'
...@@ -65,5 +65,6 @@ dependencies { ...@@ -65,5 +65,6 @@ dependencies {
api rootProject.ext.dependencies["SmartRefreshBase"] api rootProject.ext.dependencies["SmartRefreshBase"]
api rootProject.ext.dependencies["SmartRefreshHeader"] api rootProject.ext.dependencies["SmartRefreshHeader"]
api rootProject.ext.dependencies["SmartRefreshFooter"] api rootProject.ext.dependencies["SmartRefreshFooter"]
api rootProject.ext.dependencies["Xzing"]
} }
\ No newline at end of file
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