Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
HBHAndroid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨秀秀
HBHAndroid
Commits
aea96367
Commit
aea96367
authored
Sep 11, 2023
by
david
Committed by
杨秀秀
Nov 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
b3bc834e
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
84 additions
and
20 deletions
+84
-20
AvailableCouponAdapter.java
...va/com/xx/hbhconsumer/adapter/AvailableCouponAdapter.java
+1
-0
HomeViewModel.java
...c/main/java/com/xx/hbhconsumer/ui/home/HomeViewModel.java
+6
-1
LogoffSecondStepViewModel.java
...m/xx/hbhconsumer/ui/logoff/LogoffSecondStepViewModel.java
+1
-1
CouponGoodsListActivity.java
...m/xx/hbhconsumer/ui/mycoupon/CouponGoodsListActivity.java
+16
-9
MyCouponActivity.java
...java/com/xx/hbhconsumer/ui/mycoupon/MyCouponActivity.java
+8
-2
NewsDetailViewModel.java
.../java/com/xx/hbhconsumer/ui/news/NewsDetailViewModel.java
+2
-0
NewsListViewModel.java
...in/java/com/xx/hbhconsumer/ui/news/NewsListViewModel.java
+1
-0
PDFWebViewActivity.java
...in/java/com/xx/hbhconsumer/ui/pdf/PDFWebViewActivity.java
+4
-0
PhoneActivity.java
.../main/java/com/xx/hbhconsumer/ui/phone/PhoneActivity.java
+10
-1
PhoneViewModel.java
...main/java/com/xx/hbhconsumer/ui/phone/PhoneViewModel.java
+16
-0
activity_change_phone.xml
consumer/src/main/res/layout/activity_change_phone.xml
+1
-1
activity_coupon_goods_list.xml
consumer/src/main/res/layout/activity_coupon_goods_list.xml
+14
-3
activity_my_coupon.xml
consumer/src/main/res/layout/activity_my_coupon.xml
+3
-2
item_available_coupon.xml
consumer/src/main/res/layout/item_available_coupon.xml
+1
-0
No files found.
consumer/src/main/java/com/xx/hbhconsumer/adapter/AvailableCouponAdapter.java
View file @
aea96367
...
...
@@ -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
);
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/home/HomeViewModel.java
View file @
aea96367
...
...
@@ -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
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/logoff/LogoffSecondStepViewModel.java
View file @
aea96367
...
...
@@ -37,7 +37,7 @@ public class LogoffSecondStepViewModel extends BaseViewModel<LogoffRequest> {
@Override
public
void
call
()
{
model
.
logoff
(
accountClosure
Reason
,
accountClosureReason
)
model
.
logoff
(
accountClosure
Mark
,
accountClosureReason
)
.
compose
(
RxUtils
.
schedulersTransformer
())
//线程调度
// .compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换, 这里可以换成自己的ExceptionHandle
.
doOnSubscribe
(
LogoffSecondStepViewModel
.
this
)
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/mycoupon/CouponGoodsListActivity.java
View file @
aea96367
...
...
@@ -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
(
);
});
}
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/mycoupon/MyCouponActivity.java
View file @
aea96367
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
();
}
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/news/NewsDetailViewModel.java
View file @
aea96367
...
...
@@ -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
{
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/news/NewsListViewModel.java
View file @
aea96367
...
...
@@ -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
();
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/pdf/PDFWebViewActivity.java
View file @
aea96367
...
...
@@ -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
);
}
...
...
consumer/src/main/java/com/xx/hbhconsumer/ui/phone/PhoneActivity.java
View file @
aea96367
...
...
@@ -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
);
}
}
consumer/src/main/java/com/xx/hbhconsumer/ui/phone/PhoneViewModel.java
View file @
aea96367
...
...
@@ -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
...
...
consumer/src/main/res/layout/activity_change_phone.xml
View file @
aea96367
...
...
@@ -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"
/>
...
...
consumer/src/main/res/layout/activity_coupon_goods_list.xml
View file @
aea96367
...
...
@@ -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
consumer/src/main/res/layout/activity_my_coupon.xml
View file @
aea96367
...
...
@@ -83,9 +83,10 @@
binding:layoutManager=
"@{LayoutManagers.linear(1,false)}"
/>
<TextView
android:id=
"@+id/tv_
goods_
no_more"
android:layout_width=
"
wrap_cont
ent"
android:id=
"@+id/tv_no_more"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:layout_centerHorizontal=
"true"
android:layout_below=
"@id/rv_search_goods_list"
android:text=
"~ 没有更多啦 ~"
...
...
consumer/src/main/res/layout/item_available_coupon.xml
View file @
aea96367
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment