Commit daec8624 authored by fengruiyu's avatar fengruiyu

搜索页面的境内可以免费访问已完成

首次安装推荐的弹出框的集合排序问题
parent 783ec8b5
...@@ -51,6 +51,16 @@ ...@@ -51,6 +51,16 @@
"latitude": 31.243627, "latitude": 31.243627,
"longitude": 121.497028 "longitude": 121.497028
}, },
{
"images": [
"http://cdn.xinzhi.space/default/1C3C454A9EA79FBCC4027116D1D280A5.jpg",
"http://cdn.xinzhi.space/default/DFD557DB2242B99E9314D02407C10F18.jpg",
"http://cdn.xinzhi.space/default/8ACBA2D5DFFE96A56BD02E6F8DBB0319.jpg"
],
"name": "西安大唐不夜城",
"latitude": 34.210359,
"longitude": 108.970516
},
{ {
"images": [ "images": [
"http://cdn.xinzhi.space/default/B6E64CB2606BB5ED1855DDFE80CA55F1.jpg", "http://cdn.xinzhi.space/default/B6E64CB2606BB5ED1855DDFE80CA55F1.jpg",
...@@ -58,7 +68,7 @@ ...@@ -58,7 +68,7 @@
"http://cdn.xinzhi.space/default/6C39DDC648F72FDF3ECD88AAE936EB72.jpg" "http://cdn.xinzhi.space/default/6C39DDC648F72FDF3ECD88AAE936EB72.jpg"
], ],
"name": "杭州灵隐寺", "name": "杭州灵隐寺",
"latitude":30.246009, "latitude": 30.246009,
"longitude": 120.108616 "longitude": 120.108616
}, },
{ {
...@@ -71,16 +81,6 @@ ...@@ -71,16 +81,6 @@
"latitude": 40.049087, "latitude": 40.049087,
"longitude": 94.81471 "longitude": 94.81471
}, },
{
"images": [
"http://cdn.xinzhi.space/default/1C3C454A9EA79FBCC4027116D1D280A5.jpg",
"http://cdn.xinzhi.space/default/DFD557DB2242B99E9314D02407C10F18.jpg",
"http://cdn.xinzhi.space/default/8ACBA2D5DFFE96A56BD02E6F8DBB0319.jpg"
],
"name": "西安大唐不夜城",
"latitude": 34.210359,
"longitude": 108.970516
},
{ {
"images": [ "images": [
"http://cdn.xinzhi.space/default/7A10F9C4B92BFEDAAA53D1EDDE742295.jpg", "http://cdn.xinzhi.space/default/7A10F9C4B92BFEDAAA53D1EDDE742295.jpg",
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
"http://cdn.xinzhi.space/default/BB6A5F3DE940636273988464B796AC46.jpg" "http://cdn.xinzhi.space/default/BB6A5F3DE940636273988464B796AC46.jpg"
], ],
"name": "长沙橘子洲景区", "name": "长沙橘子洲景区",
"latitude":28.192888, "latitude": 28.192888,
"longitude": 112.968618 "longitude": 112.968618
}, },
{ {
......
...@@ -50,13 +50,7 @@ class GridBenfitAdapter(val context: Context, val viewMode: HomeViewModel?, plac ...@@ -50,13 +50,7 @@ class GridBenfitAdapter(val context: Context, val viewMode: HomeViewModel?, plac
} }
override fun getItemCount(): Int { override fun getItemCount() = 6
return if (datalist == null) {
0
} else {
datalist!!.size
}
}
override fun getLayoutId(viewType: Int) = R.layout.item_grid_benfit_adpater override fun getLayoutId(viewType: Int) = R.layout.item_grid_benfit_adpater
......
...@@ -39,12 +39,12 @@ class PopularSceneAdapter(val context: Context, var list: List<Places>? = null,v ...@@ -39,12 +39,12 @@ class PopularSceneAdapter(val context: Context, var list: List<Places>? = null,v
if (viewMode.index.value==0){ if (viewMode.index.value==0){
viewMode.authorized(list?.get(position)?.name viewMode.authorized(list?.get(position)?.name
,list?.get(position)?.latitude.toString() ,list?.get(position)?.latitude.toString()
,list?.get(position)?.longitude.toString()) ,list?.get(position)?.longitude.toString(),true)
}else{ }else{
if (UserManager.INSTANCE.userIsLogin()) {//是会员 if (UserManager.INSTANCE.userIsLogin()) {//是会员
viewMode.authorized(list?.get(position)?.name viewMode.authorized(list?.get(position)?.name
,list?.get(position)?.latitude.toString() ,list?.get(position)?.latitude.toString()
,list?.get(position)?.longitude.toString()) ,list?.get(position)?.longitude.toString(),false)
}else{ }else{
context.startActivity(Intent(context, OpenvipActivity::class.java)) context.startActivity(Intent(context, OpenvipActivity::class.java))
} }
......
...@@ -119,7 +119,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) { ...@@ -119,7 +119,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
} }
mapBean = Gson().fromJson(stringBuilder.toString(), MapBean::class.java) mapBean = Gson().fromJson(stringBuilder.toString(), MapBean::class.java)
if ( SPUtils.getInstance().decodeBoolean(HomeFragment.IS_FIRST_OPEN,true)){ if ( SPUtils.getInstance().decodeBoolean(HomeFragment.IS_FIRST_OPEN,true)){
mapbeanData.value = Gson().fromJson(stringBuilder.toString(), MapBean::class.java) mapbeanData.value = mapBean
SPUtils.getInstance().encode(HomeFragment.IS_FIRST_OPEN,false) SPUtils.getInstance().encode(HomeFragment.IS_FIRST_OPEN,false)
} }
......
...@@ -110,17 +110,36 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application) ...@@ -110,17 +110,36 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application)
} }
) )
} }
fun authorized(name:String?=null,lat:String?,lng:String?) { fun authorized(name:String?=null,lat:String?,lng:String?,isLook :Boolean) {
if (isLook) {
ApiModel.authorizedA().safeSubscribe(object
: HttpSubscribeImpl<BaseResponse<AuthorizedBean>>(
this@SearchMapViewModel, false
) {
override fun onBusinessSuccess(response: BaseResponse<AuthorizedBean>) {
MintsWebViewActivity.startWebView(
name,
MintsWebViewActivity.toBaduVR(lat, lng, response.result?.bk)
)
}
})
} else {
ApiModel.authorized().safeSubscribe(object ApiModel.authorized().safeSubscribe(object
: HttpSubscribeImpl<BaseResponse<AuthorizedBean>>( : HttpSubscribeImpl<BaseResponse<AuthorizedBean>>(
this@SearchMapViewModel,false this@SearchMapViewModel, false
) { ) {
override fun onBusinessSuccess(response: BaseResponse<AuthorizedBean>) { override fun onBusinessSuccess(response: BaseResponse<AuthorizedBean>) {
if(index.value == 0){ if (index.value == 0) {
MintsWebViewActivity.startWebView(name, MintsWebViewActivity.startWebView(
MintsWebViewActivity.toBaduVR(lat,lng,response.result?.bk)) name,
}else{ MintsWebViewActivity.toBaduVR(lat, lng, response.result?.bk)
MintsWebViewActivity.startWebView(name, )
} else {
MintsWebViewActivity.startWebView(
name,
MintsWebViewActivity.toGoogleVR( MintsWebViewActivity.toGoogleVR(
response.result.u, response.result.u,
response.result.gk, response.result.gk,
...@@ -128,11 +147,13 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application) ...@@ -128,11 +147,13 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application)
lat, lat,
lng, lng,
response.result.ut response.result.ut
)) )
)
} }
} }
}) })
} }
}
} }
\ No newline at end of file
...@@ -59,7 +59,7 @@ class ShowBenfitDialog(context: Context, val viewMode: HomeViewModel, places: Li ...@@ -59,7 +59,7 @@ class ShowBenfitDialog(context: Context, val viewMode: HomeViewModel, places: Li
if (gridbenfitAdapter == null){ if (gridbenfitAdapter == null){
//展示 推荐套餐内容 //展示 推荐套餐内容
gridbenfitAdapter= GridBenfitAdapter(context,viewMode,places?.shuffled()?.take(6)) gridbenfitAdapter= GridBenfitAdapter(context,viewMode,places)
mAdapter?.addAdapter(gridbenfitAdapter) mAdapter?.addAdapter(gridbenfitAdapter)
} }
......
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