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
cdbdea53
Commit
cdbdea53
authored
Jan 16, 2024
by
小费同学阿
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础搭建
功能开发 1:bug 修复
parent
abd82090
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
7 deletions
+14
-7
ApiService.kt
app/src/main/java/com/xx/merchanthbh/data/http/ApiService.kt
+1
-1
LoginRequest.kt
.../java/com/xx/merchanthbh/data/http/requst/LoginRequest.kt
+1
-1
LoginViewModel.java
...main/java/com/xx/merchanthbh/ui/login/LoginViewModel.java
+2
-0
ApiService.kt
.../src/main/java/com/xx/hbhbcompany/data/http/ApiService.kt
+1
-1
LoginRequest.kt
.../java/com/xx/hbhbcompany/data/http/requst/LoginRequest.kt
+1
-1
LoginActivity.kt
...rc/main/java/com/xx/hbhbcompany/ui/login/LoginActivity.kt
+1
-1
LoginViewModel.java
...main/java/com/xx/hbhbcompany/ui/login/LoginViewModel.java
+1
-0
CommTextAgreeDialog.kt
...ain/java/com/xx/xxviewlibrary/comm/CommTextAgreeDialog.kt
+6
-2
No files found.
app/src/main/java/com/xx/merchanthbh/data/http/ApiService.kt
View file @
cdbdea53
...
...
@@ -529,7 +529,7 @@ interface ApiService {
* 获取协议
*/
@Headers
(
"Content-type:application/json"
)
@POST
(
"app/agreement/get
StaticPage
List"
)
@POST
(
"app/agreement/get
Basic
List"
)
open
fun
getProtocols
(
@Body
requestBody
:
RequestBody
):
Observable
<
BaseResponse
<
List
<
String
>>>
...
...
app/src/main/java/com/xx/merchanthbh/data/http/requst/LoginRequest.kt
View file @
cdbdea53
...
...
@@ -39,7 +39,7 @@ class LoginRequest: BaseRespons() {
fun
getProtocols
():
Observable
<
BaseResponse
<
List
<
String
>>>
{
return
apiService
.
getProtocols
(
ApiParams
<
Array
<
String
>>().
setParams
(
arrayOf
(
"
6"
,
"7"
,
"8"
,
"9"
,
"10
"
)))
return
apiService
.
getProtocols
(
ApiParams
<
Array
<
String
>>().
setParams
(
arrayOf
(
"
1"
,
"2"
,
"3"
,
"4"
,
"5
"
)))
}
...
...
app/src/main/java/com/xx/merchanthbh/ui/login/LoginViewModel.java
View file @
cdbdea53
...
...
@@ -6,6 +6,7 @@ import android.app.Application;
import
android.os.Bundle
;
import
android.text.Html
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
androidx.databinding.ObservableField
;
...
...
@@ -205,6 +206,7 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"title"
,
"隐私条款"
);
bundle
.
putString
(
"URL"
,
RetrofitClient
.
baseH5Url
+
StaticData
.
Protocols
.
get
(
2
));
Log
.
v
(
"路径路径啊"
,
bundle
.
toString
());
CharSequence
htmlText
=
Html
.
fromHtml
(
bundle
.
toString
());
/*为隐私条款赋值*/
agreeContent
.
setValue
(
htmlText
.
toString
());
...
...
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/http/ApiService.kt
View file @
cdbdea53
...
...
@@ -539,7 +539,7 @@ interface ApiService {
* 获取协议
*/
@Headers
(
"Content-type:application/json"
)
@POST
(
"app/agreement/get
StaticPage
List"
)
@POST
(
"app/agreement/get
Basic
List"
)
open
fun
getProtocols
(
@Body
requestBody
:
RequestBody
):
Observable
<
BaseResponse
<
List
<
String
>>>
/**
...
...
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/http/requst/LoginRequest.kt
View file @
cdbdea53
...
...
@@ -52,6 +52,6 @@ class LoginRequest: BaseRespons() {
fun
getProtocols
():
Observable
<
BaseResponse
<
List
<
String
>>>
{
return
apiService
.
getProtocols
(
ApiParams
<
Array
<
String
>>().
setParams
(
arrayOf
(
"
6"
,
"7"
,
"8"
,
"9"
,
"10
"
)))
return
apiService
.
getProtocols
(
ApiParams
<
Array
<
String
>>().
setParams
(
arrayOf
(
"
1"
,
"2"
,
"3"
,
"4"
,
"5
"
)))
}
}
\ No newline at end of file
hbhbcompany/src/main/java/com/xx/hbhbcompany/ui/login/LoginActivity.kt
View file @
cdbdea53
...
...
@@ -47,7 +47,7 @@ class LoginActivity() : BaseActivity<ActivityLoginBinding, LoginViewModel>() {
if
(
isFirstRun
)
{
// 如果是第一次打开应用,执行相应的操作
ToastUtils
.
showShort
(
"第一次登录"
)
//
ToastUtils.showShort("第一次登录")
viewModel
.
agreeContent
.
observe
(
this
)
{
agreeContent
:
String
?
->
if
(
agreeContent
!=
null
)
{
agreementContext
=
agreeContent
...
...
hbhbcompany/src/main/java/com/xx/hbhbcompany/ui/login/LoginViewModel.java
View file @
cdbdea53
...
...
@@ -255,6 +255,7 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
CharSequence
htmlText
=
Html
.
fromHtml
(
bundle
.
toString
());
/*为隐私条款赋值*/
agreeContent
.
setValue
(
htmlText
.
toString
());
}
}
...
...
xxviewlibrary/src/main/java/com/xx/xxviewlibrary/comm/CommTextAgreeDialog.kt
View file @
cdbdea53
...
...
@@ -45,13 +45,15 @@ class CommTextAgreeDialog(
val
urlRegex
=
"URL=(.*?),"
.
toRegex
()
val
matchResult
=
urlRegex
.
find
(
beanMain
?:
""
)
val
url
=
matchResult
?.
groupValues
?.
get
(
1
)
// http://49.232.201.130:7005/api/app/agreement/getContent/
9
// http://49.232.201.130:7005/api/app/agreement/getContent/
8
Log
.
v
(
"打印隐私条款地址"
,
url
.
toString
())
//获得控件
val
webView
=
findViewById
<
View
>(
binding
.
webComm
.
id
)
as
WebView
//访问网页
webView
.
settings
.
javaScriptEnabled
=
true
// 启用JavaScript
webView
.
loadUrl
(
url
.
toString
())
//
系统默认会通过手机浏览器打开网页,为了能够直接通过WebView显示网页,则必须设置
//
设置WebView客户端
webView
.
webViewClient
=
object
:
WebViewClient
()
{
override
fun
shouldOverrideUrlLoading
(
view
:
WebView
,
url
:
String
):
Boolean
{
//使用WebView加载显示url
...
...
@@ -61,6 +63,7 @@ class CommTextAgreeDialog(
}
}
/*关闭弹窗监听事件,使其手机返回上一级功能和取消功能一致*/
setOnDismissListener
{
if
(
dismissBack
)
{
...
...
@@ -70,6 +73,7 @@ class CommTextAgreeDialog(
}
}
fun
refuseClick
(
view
:
View
)
{
callback
.
refuseBack
()
dismissBack
=
false
...
...
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