Commit daec8624 authored by fengruiyu's avatar fengruiyu

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

首次安装推荐的弹出框的集合排序问题
parent 783ec8b5
......@@ -51,6 +51,16 @@
"latitude": 31.243627,
"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": [
"http://cdn.xinzhi.space/default/B6E64CB2606BB5ED1855DDFE80CA55F1.jpg",
......@@ -58,7 +68,7 @@
"http://cdn.xinzhi.space/default/6C39DDC648F72FDF3ECD88AAE936EB72.jpg"
],
"name": "杭州灵隐寺",
"latitude":30.246009,
"latitude": 30.246009,
"longitude": 120.108616
},
{
......@@ -71,16 +81,6 @@
"latitude": 40.049087,
"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": [
"http://cdn.xinzhi.space/default/7A10F9C4B92BFEDAAA53D1EDDE742295.jpg",
......@@ -123,7 +123,7 @@
"http://cdn.xinzhi.space/default/BB6A5F3DE940636273988464B796AC46.jpg"
],
"name": "长沙橘子洲景区",
"latitude":28.192888,
"latitude": 28.192888,
"longitude": 112.968618
},
{
......
......@@ -50,13 +50,7 @@ class GridBenfitAdapter(val context: Context, val viewMode: HomeViewModel?, plac
}
override fun getItemCount(): Int {
return if (datalist == null) {
0
} else {
datalist!!.size
}
}
override fun getItemCount() = 6
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
if (viewMode.index.value==0){
viewMode.authorized(list?.get(position)?.name
,list?.get(position)?.latitude.toString()
,list?.get(position)?.longitude.toString())
,list?.get(position)?.longitude.toString(),true)
}else{
if (UserManager.INSTANCE.userIsLogin()) {//是会员
viewMode.authorized(list?.get(position)?.name
,list?.get(position)?.latitude.toString()
,list?.get(position)?.longitude.toString())
,list?.get(position)?.longitude.toString(),false)
}else{
context.startActivity(Intent(context, OpenvipActivity::class.java))
}
......
......@@ -119,7 +119,7 @@ class HomeViewModel(application: Application) : BaseViewModel(application) {
}
mapBean = Gson().fromJson(stringBuilder.toString(), MapBean::class.java)
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)
}
......
......@@ -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
: HttpSubscribeImpl<BaseResponse<AuthorizedBean>>(
this@SearchMapViewModel,false
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,
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,
......@@ -128,11 +147,13 @@ class SearchMapViewModel(application: Application) : BaseViewModel(application)
lat,
lng,
response.result.ut
))
)
)
}
}
})
}
}
}
\ No newline at end of file
......@@ -59,7 +59,7 @@ class ShowBenfitDialog(context: Context, val viewMode: HomeViewModel, places: Li
if (gridbenfitAdapter == null){
//展示 推荐套餐内容
gridbenfitAdapter= GridBenfitAdapter(context,viewMode,places?.shuffled()?.take(6))
gridbenfitAdapter= GridBenfitAdapter(context,viewMode,places)
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