Commit cdbdea53 authored by 小费同学阿's avatar 小费同学阿 💬

基础搭建

功能开发
1:bug 修复
parent abd82090
......@@ -529,7 +529,7 @@ interface ApiService {
* 获取协议
*/
@Headers("Content-type:application/json")
@POST("app/agreement/getStaticPageList")
@POST("app/agreement/getBasicList")
open fun getProtocols(@Body requestBody: RequestBody): Observable<BaseResponse<List<String>>>
......
......@@ -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")))
}
......
......@@ -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());
......
......@@ -539,7 +539,7 @@ interface ApiService {
* 获取协议
*/
@Headers("Content-type:application/json")
@POST("app/agreement/getStaticPageList")
@POST("app/agreement/getBasicList")
open fun getProtocols(@Body requestBody: RequestBody): Observable<BaseResponse<List<String>>>
/**
......
......@@ -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
......@@ -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
......
......@@ -255,6 +255,7 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
CharSequence htmlText = Html.fromHtml(bundle.toString());
/*为隐私条款赋值*/
agreeContent.setValue(htmlText.toString());
}
}
......
......@@ -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
......
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