Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_freeworld
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
0
Merge Requests
0
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
android
android_freeworld
Commits
13e339fb
Commit
13e339fb
authored
Jul 31, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页的跳转h5 已完成
搜索的境内和境外跳转h5 已完成
parent
c520d1f0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
6 deletions
+73
-6
m.html
app/src/main/assets/web/m.html
+2
-1
PopularSceneAdapter.kt
...main/java/com/mints/street/adapter/PopularSceneAdapter.kt
+19
-2
HomeButtonItemVM.kt
.../main/java/com/mints/street/main/home/HomeButtonItemVM.kt
+1
-2
HomeViewModel.kt
...src/main/java/com/mints/street/main/home/HomeViewModel.kt
+16
-0
SearchMapActivity.kt
...main/java/com/mints/street/main/home/SearchMapActivity.kt
+1
-1
SearchMapViewModel.kt
...ain/java/com/mints/street/main/home/SearchMapViewModel.kt
+26
-0
MintsWebViewActivity.kt
...ain/java/com/mints/street/webview/MintsWebViewActivity.kt
+8
-0
No files found.
app/src/main/assets/web/m.html
View file @
13e339fb
...
...
@@ -46,6 +46,7 @@
var
lng
=
getParam
(
"lng"
);
//39.915表示纬度
var
d
=
getParam
(
"d"
);
//39.915表示纬度
console
.
log
(
"baiduinit"
,
lat
,
lng
,
d
)
var
panorama
=
new
BMap
.
Panorama
(
'panorama'
,
{
linksControl
:
false
,
//显示道路指示控件
...
...
@@ -61,7 +62,7 @@
// a=116.316169
// b=40.005567
// panorama.setPosition(new BMap.Point(a,b));
if
(
d
==
null
||
d
=
=
""
)
{
if
(
d
!=
null
&&
d
!
=
""
)
{
panorama
.
setId
(
d
);
//根据全景id展示全景图
}
else
{
panorama
.
setPosition
(
new
BMap
.
Point
(
lng
,
lat
));
...
...
app/src/main/java/com/mints/street/adapter/PopularSceneAdapter.kt
View file @
13e339fb
package
com.mints.street.adapter
import
android.content.Context
import
android.content.Intent
import
android.view.View
import
com.alibaba.android.vlayout.layout.LinearLayoutHelper
import
com.bumptech.glide.GlideBuilder
...
...
@@ -10,6 +11,9 @@ import com.fry.base.utils.ImageLoader
import
com.mints.street.R
import
com.mints.street.bean.Places
import
com.mints.street.databinding.ItemPopularSceneAdapterBinding
import
com.mints.street.main.home.SearchMapViewModel
import
com.mints.street.main.my.OpenvipActivity
import
com.mints.street.manager.UserManager
import
com.mints.street.webview.MintsWebViewActivity
import
me.goldze.mvvmhabit.utils.ImageUtils
import
me.goldze.mvvmhabit.utils.KLog
...
...
@@ -19,7 +23,7 @@ import me.goldze.mvvmhabit.utils.RxUtils
* Created by 冯瑞雨 on 2021/7/14.
* 热门景区的adapter
*/
class
PopularSceneAdapter
(
val
context
:
Context
,
var
list
:
List
<
Places
>?
=
null
)
:
class
PopularSceneAdapter
(
val
context
:
Context
,
var
list
:
List
<
Places
>?
=
null
,
val
viewMode
:
SearchMapViewModel
)
:
AbstractVLayoutBaseAdapter
<
ItemPopularSceneAdapterBinding
,
List
<
Places
>>(
context
,
list
,
2
)
{
fun
setData
(
list
:
List
<
Places
>?){
...
...
@@ -32,7 +36,20 @@ class PopularSceneAdapter(val context: Context, var list: List<Places>? = null)
position
:
Int
)
{
RxUtils
.
onMultiClick
(
holder
.
binding
.
bg
){
MintsWebViewActivity
.
startWebView
(
list
?.
get
(
position
)
?.
name
)
if
(
viewMode
.
index
.
value
==
0
){
viewMode
.
authorized
(
list
?.
get
(
position
)
?.
name
,
list
?.
get
(
position
)
?.
latitude
.
toString
()
,
list
?.
get
(
position
)
?.
longitude
.
toString
())
}
else
{
if
(
UserManager
.
INSTANCE
.
userIsLogin
())
{
//是会员
viewMode
.
authorized
(
list
?.
get
(
position
)
?.
name
,
list
?.
get
(
position
)
?.
latitude
.
toString
()
,
list
?.
get
(
position
)
?.
longitude
.
toString
())
}
else
{
context
.
startActivity
(
Intent
(
context
,
OpenvipActivity
::
class
.
java
))
}
}
}
holder
.
binding
.
tvName
.
text
=
list
?.
get
(
position
)
?.
name
...
...
app/src/main/java/com/mints/street/main/home/HomeButtonItemVM.kt
View file @
13e339fb
...
...
@@ -13,8 +13,7 @@ class HomeButtonItemVM(viewModel: HomeViewModel,val name:String?,val image1:Stri
var
latitude
:
String
?,
var
longitude
:
String
?)
:
ItemViewModel
<
HomeViewModel
?
>(
viewModel
)
{
val
onItemClick
=
BindingCommand
<
Any
?>(
BindingAction
{
//SearchMapActivity.startSearchMapActivity()
MintsWebViewActivity
.
startWebView
(
name
)
viewModel
.
authorized
(
name
,
latitude
,
longitude
)
})
}
\ No newline at end of file
app/src/main/java/com/mints/street/main/home/HomeViewModel.kt
View file @
13e339fb
...
...
@@ -13,6 +13,7 @@ import com.mints.street.manager.oaid.OaidManager
import
com.mints.street.model.ApiModel
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.utils.DeviceUuidFactory
import
com.mints.street.webview.MintsWebViewActivity
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.BaseViewModel
import
me.goldze.mvvmhabit.binding.command.BindingAction
...
...
@@ -50,6 +51,21 @@ class HomeViewModel(application: Application):BaseViewModel(application) {
})
}
fun
authorized
(
name
:
String
?=
null
,
lat
:
String
?,
lng
:
String
?)
{
ApiModel
.
authorized
().
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
AuthorizedBean
>>(
this
@HomeViewModel
,
false
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
AuthorizedBean
>)
{
if
(!
Gson
().
toJson
(
response
.
result
).
equals
(
Gson
().
toJson
(
authorizedBean
.
value
))){
authorizedBean
.
value
=
response
.
result
}
MintsWebViewActivity
.
startWebView
(
name
,
MintsWebViewActivity
.
toBaduVR
(
lat
,
lng
,
response
.
result
?.
bk
))
}
})
}
fun
getMapBean
(){
val
assets
=
AppManager
.
getAppManager
().
currentActivity
.
assets
val
stringBuilder
=
StringBuilder
()
...
...
app/src/main/java/com/mints/street/main/home/SearchMapActivity.kt
View file @
13e339fb
...
...
@@ -85,7 +85,7 @@ class SearchMapActivity : BaseActivity<ActivitySearchMapBinding, SearchMapViewMo
historyRecordAdapter
=
HistoryRecordAdapter
(
this
,
viewModel
)
//热门景点
popularSceneAdapter
=
PopularSceneAdapter
(
this
)
popularSceneAdapter
=
PopularSceneAdapter
(
this
,
viewMode
=
viewModel
)
mAdapter
?.
addAdapter
(
historyRecordAdapter
)
mAdapter
?.
addAdapter
(
popularSceneAdapter
)
...
...
app/src/main/java/com/mints/street/main/home/SearchMapViewModel.kt
View file @
13e339fb
...
...
@@ -10,8 +10,10 @@ import com.google.gson.Gson
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.bean.*
import
com.mints.street.model.ApiModel
import
com.mints.street.model.BaiduModel
import
com.mints.street.netwrok.base.HttpSubscribeImpl
import
com.mints.street.webview.MintsWebViewActivity
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.base.BaseViewModel
import
me.goldze.mvvmhabit.binding.command.BindingAction
...
...
@@ -112,5 +114,29 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application)
}
)
}
fun
authorized
(
name
:
String
?=
null
,
lat
:
String
?,
lng
:
String
?)
{
ApiModel
.
authorized
().
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
AuthorizedBean
>>(
this
@SearchMapViewModel
,
false
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
AuthorizedBean
>)
{
if
(
index
.
value
==
0
){
MintsWebViewActivity
.
startWebView
(
name
,
MintsWebViewActivity
.
toBaduVR
(
lat
,
lng
,
response
.
result
?.
bk
))
}
else
{
MintsWebViewActivity
.
startWebView
(
name
,
MintsWebViewActivity
.
toGoogleVR
(
response
.
result
.
u
,
response
.
result
.
gk
,
response
.
result
.
base
,
lat
,
lng
,
response
.
result
.
ut
))
}
}
})
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/webview/MintsWebViewActivity.kt
View file @
13e339fb
...
...
@@ -32,12 +32,20 @@ class MintsWebViewActivity : BaseActivity<ActivityMintsWebViewBinding, MintsWebV
}
}
fun
toGoogleVR
(
u
:
String
?,
gk
:
String
?,
base
:
String
?,
lat
:
String
?,
lng
:
String
?,
ut
:
String
?):
String
{
KLog
.
i
(
"MintsWebViewActivity"
,
"file:///android_asset/web/streets.html?u=${u
}&
gk
=
$
{
gk
}&
base
=
$
{
base
}&
lat
=
$
{
lat
}&
lng
=
$
{
lng
}&
ut
=
$
{
ut
}
")
return
"file:///android_asset/web/streets.html?u=${u
}&
gk
=
$
{
gk
}&
base
=
$
{
base
}&
lat
=
$
{
lat
}&
lng
=
$
{
lng
}&
ut
=
$
{
ut
}
"
}
fun
toBaduVR
(
d
:
String
?,
bk
:
String
?):
String
{
KLog
.
i
(
"MintsWebViewActivity"
,
"file:///android_asset/web/m.html?d=${d}&bk=${bk}"
)
return
"file:///android_asset/web/m.html?d=${d}&bk=${bk}"
}
fun
toBaduVR
(
lat
:
String
?,
lng
:
String
?,
bk
:
String
?):
String
{
KLog
.
i
(
"MintsWebViewActivity"
,
"file:///android_asset/web/m.html?lat=${lat}&lng=${lng}&bk=${bk}"
)
return
"file:///android_asset/web/m.html?lat=${lat}&lng=${lng}&bk=${bk}"
}
}
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_mints_web_view
...
...
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