Commit c0644d67 authored by 张释方's avatar 张释方

提交精选体验接口

parent eea467fc
package com.mints.street.adapter
import android.app.ActionBar
import android.content.Context
import android.icu.number.IntegerWidth
import android.view.WindowManager
import android.widget.ImageView
import com.alibaba.android.vlayout.LayoutHelper
import com.alibaba.android.vlayout.layout.GridLayoutHelper
import com.bumptech.glide.Glide
......@@ -12,6 +16,7 @@ import com.mints.street.bean.VrmapBean
import com.mints.street.databinding.ItemGridMapAdapterBinding
import com.mints.street.webview.MintsWebViewActivity
import me.goldze.mvvmhabit.utils.AppUtils
import me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/9.
......@@ -26,11 +31,11 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
) {
var a = holder.binding.bg.layoutParams
if (position % 2 == 0) {
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 10F), AppUtils.dp2Px(context, 10F),
AppUtils.dp2Px(context, 5F), 0, null, null, null)
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 20F), AppUtils.dp2Px(context, 20F),
AppUtils.dp2Px(context, 15F), 0, null, null, null)
} else {
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 5F), AppUtils.dp2Px(context, 10F),
AppUtils.dp2Px(context, 10F), 0, null, null, null)
holder.binding.bg.setMargin(AppUtils.dp2Px(context, 15F), AppUtils.dp2Px(context, 20F),
AppUtils.dp2Px(context, 20F), 0, null, null, null)
}
datalist?.let {
......@@ -39,12 +44,7 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
Glide.with(mContext).load(databean.img).into(holder.binding.image)
//设置标题
holder.binding.tvName.text = databean.name
// //设置星星数量
// var i = 0
// while (i < 5) {
// holder.binding.lyStar.addView(View.inflate(context, R.layout.include_start_show, null))
// i += 1
// }
//设置点击跳转
holder.itemView.setOnClickListener {
//页面跳转
......@@ -58,6 +58,8 @@ class GridMapAdapter(val context: Context, var list: List<VrmapBean.Internal>?)
}
override fun getItemCount() = list!!.size
override fun onCreateLayoutHelper(): LayoutHelper {
......
......@@ -19,7 +19,7 @@ import com.mints.street.main.vr.DetailedActivity
class ItemEnterDestinationAdapter(
val context: Context,
private val isMultipleLayout: Boolean,
val list: List<VrmapBean.Abroad>?
var list: List<VrmapBean.Abroad>?
) : AbstractVLayoutBaseAdapter<ItemEnterDestinationAdapterBinding, List<VrmapBean.Abroad>?>(
context,
list,
......
......@@ -117,4 +117,17 @@ interface MainApi {
*/
@POST("api/mpgah")
fun authorized():Observable<Response<BaseResponse<AuthorizedBean>>>
/**
* 精选体验展示图
*/
@POST("na/getChooseExperienceHeadData")
fun getChooseExperienceHeadData(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<Any>>>
/**
* 精选体验详情
*/
@POST("na/getChooseExperienceData")
fun getChooseExperienceData(@Body vo:@JvmSuppressWildcards Map<String,Any>):Observable<Response<BaseResponse<Any>>>
}
\ No newline at end of file
......@@ -132,7 +132,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
// 是否会员
if (userManager.getVipFlag()) {
tv_tips.text = "恭喜您,已经成为全球会员啦~"
tv_tips.text = "恭喜您,成为全球会员啦~"
bt_try.visibility = View.INVISIBLE
} else {
tv_tips.text = "恭喜你被全球会员卡砸中~"
......
......@@ -103,7 +103,4 @@ class MyViewModel(application: Application) : BaseViewModel(application) {
})
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.mints.street.main.my
import android.annotation.SuppressLint
import android.app.Dialog
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.TextUtils
......@@ -33,12 +34,14 @@ import kotlinx.android.synthetic.main.fragment_my.*
import kotlinx.android.synthetic.main.include_header.*
import me.goldze.mvvmhabit.base.AppManager
import me.goldze.mvvmhabit.utils.AppUtils
import me.goldze.mvvmhabit.utils.KLog
import me.goldze.mvvmhabit.utils.ToastUtils
import me.goldze.mvvmhabit.utils.systembar.StatusBarUtil
class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>(), View.OnClickListener {
private val userManager by lazy { UserManager.INSTANCE }
private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null
private var gridPaymentAdapter: GridPaymentAdapter? = null
......@@ -354,5 +357,19 @@ class OpenvipActivity : BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
}
override fun onResume() {
super.onResume()
KLog.e("OpenvipActivity","onResume")
// if(userManager.userIsLogin()&&userManager.getVipFlag()){
// finish()
// }
}
// override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
// super.onActivityResult(requestCode, resultCode, data)
// KLog.e("OpenvipActivity","onActivityResult")
// }
}
......@@ -11,6 +11,7 @@ import com.mints.street.BR
import com.mints.street.R
import com.mints.street.adapter.GridMapAdapter
import com.mints.street.adapter.GridVrMapAdapter
import com.mints.street.adapter.ItemEnterDestinationAdapter
import com.mints.street.databinding.ActivityDetailedBinding
import com.mints.street.databinding.ActivityMoresettingsBinding
import com.mints.street.main.my.MoresettingsViewModel
......@@ -60,4 +61,22 @@ class DetailedActivity : BaseActivity<ActivityDetailedBinding, DetailedViewModel
override fun onClick(v: View?) {
}
override fun onResume() {
super.onResume()
viewModel.getChooseExperienceData()
}
override fun initViewObservable() {
super.initViewObservable()
// viewModel.VrmapBean.observe(this, Observer {
//// mAdapter?.addAdapter(ItemEnterDestinationAdapter(context!!, false,it.abroad))
// if (gridVrMapAdapter == null){
// gridVrMapAdapter = ItemEnterDestinationAdapter(context!!, false,it.abroad)
// mAdapter?.addAdapter(gridVrMapAdapter)
// }
// gridVrMapAdapter?.list = it.abroad
// mAdapter?.notifyDataSetChanged()
// })
}
}
\ No newline at end of file
package com.mints.street.main.vr
import android.app.Application
import com.mints.street.bean.BaseResponse
import com.mints.street.model.ApiModel
import com.mints.street.netwrok.base.HttpSubscribeImpl
import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.utils.KLog
import java.util.HashMap
class DetailedViewModel(application: Application) : BaseViewModel(application) {
fun getChooseExperienceData(){
val vo = HashMap<String, Any>()
vo["area"] = "北京"
ApiModel.getChooseExperienceData(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<Any>>(
this@DetailedViewModel,true){
override fun onBusinessSuccess(response: BaseResponse<Any>) {
KLog.e("getChooseExperienceData","成功=================")
}
override fun onError(e: Throwable) {
KLog.e("getChooseExperienceData","请求失败 : $e")
}
}
)
}
}
......@@ -23,6 +23,7 @@ class FeaturedExperienceFragment:BaseFragment<FragmentFeaturedExperienceBinding
private var vLayout: VirtualLayoutManager? = null
private var mAdapter: DelegateAdapter? = null
private var itemEnterDestinationAdapter:ItemEnterDestinationAdapter?=null
override fun initContentView(
inflater: LayoutInflater?,
container: ViewGroup?,
......@@ -40,14 +41,25 @@ class FeaturedExperienceFragment:BaseFragment<FragmentFeaturedExperienceBinding
binding.listView.layoutManager = vLayout
binding.listView.adapter = mAdapter
viewModel.vrPlaces()
}
override fun initViewObservable() {
super.initViewObservable()
viewModel.VrmapBean.observe(this, Observer {
mAdapter?.addAdapter(ItemEnterDestinationAdapter(context!!, false,it.abroad))
// mAdapter?.addAdapter(ItemEnterDestinationAdapter(context!!, false,it.abroad))
if (itemEnterDestinationAdapter == null){
itemEnterDestinationAdapter = ItemEnterDestinationAdapter(context!!, false,it.abroad)
mAdapter?.addAdapter(itemEnterDestinationAdapter)
}
itemEnterDestinationAdapter?.list = it.abroad
mAdapter?.notifyDataSetChanged()
})
}
override fun onResume() {
super.onResume()
// viewModel.vrPlaces()
//设置数据请求
viewModel.getChooseExperienceHeadData()
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import com.mints.street.model.ApiModel
import com.mints.street.netwrok.base.HttpSubscribeImpl
import me.goldze.mvvmhabit.base.BaseViewModel
import me.goldze.mvvmhabit.utils.KLog
import java.util.HashMap
/**
* Created by 冯瑞雨 on 2021/7/9.
......@@ -38,4 +39,22 @@ class FeaturedExperienceViewModel(application: Application):BaseViewModel(applic
}
)
}
fun getChooseExperienceHeadData(){
val vo = HashMap<String, Any>()
vo["pageNum"] = 1
vo["pageSize"] = 2
ApiModel.getChooseExperienceHeadData(lifecycleProvider,vo).safeSubscribe(
object : HttpSubscribeImpl<BaseResponse<Any>>(
this@FeaturedExperienceViewModel,true){
override fun onBusinessSuccess(response: BaseResponse<Any>) {
KLog.e("getChooseExperienceHeadData","成功=================")
}
override fun onError(e: Throwable) {
KLog.e("getChooseExperienceHeadData","请求失败 : $e")
}
}
)
}
}
\ No newline at end of file
......@@ -53,10 +53,10 @@ class FreeZoneFragment : BaseFragment<FragmentFreeZoneBinding, FreeZoneViewModel
override fun initViewObservable() {
super.initViewObservable()
viewModel.VrmapBean.observe(this, Observer<VrmapBean> {
if(enterDestinationAdapter == null){
/*if(enterDestinationAdapter == null){
enterDestinationAdapter = EnterDestinationAdapter(context!!,it.abroad )
mAdapter?.addAdapter(enterDestinationAdapter)
}
}*/
if (gridMapAdapter == null){
gridMapAdapter = GridMapAdapter(context!!, it.internal)
mAdapter?.addAdapter(gridMapAdapter)
......
......@@ -61,7 +61,7 @@ class VRFragment : BaseFragment<FragmentVrBinding, VRViewModel>() {
binding.viewPager.init(this, fragments)
//初始化 magic_indicator
binding.magicIndicator.bindViewPager2(binding.viewPager, tabNames, {}, 20f, true)
binding.magicIndicator.bindViewPager2(binding.viewPager, tabNames, {}, 16f, true)
}
......
......@@ -94,6 +94,19 @@ object ApiModel {
.execute(lifecycleProvider,MainApi.newInstance().vrPlaces())
}
/**
* 精选体验展示图
*/
fun getChooseExperienceHeadData(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, Any>):Observable<Response<BaseResponse<Any>>>{
return HttpManager.getInstance().execute(lifecycleProvider,MainApi.newInstance().getChooseExperienceHeadData(map))
}
/**
* 精选体验详情
*/
fun getChooseExperienceData(lifecycleProvider: LifecycleProvider<Any>?, map: Map<String, Any>):Observable<Response<BaseResponse<Any>>>{
return HttpManager.getInstance().execute(lifecycleProvider,MainApi.newInstance().getChooseExperienceData(map))
}
/**
* 绑定手机号登录
*/
......
......@@ -19,7 +19,7 @@ class BackVipDialog(context: Context, private val listener: DialogListener) :
private val lp: WindowManager.LayoutParams
private val tv_payment: TextView
private val tv_close: TextView
private val tv_close: ImageView
init {
setContentView(R.layout.dialog_backvip)
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:endColor="#C19161"
android:startColor="#8E5832"
android:type="linear"
android:useLevel="true" />
</shape>
\ No newline at end of file
This diff is collapsed.
......@@ -14,7 +14,7 @@
android:layout_margin="15dp"
android:id="@+id/bg"
android:layout_width="100dp"
android:layout_height="230dp"
android:layout_height="210dp"
android:background="@drawable/shape_bg_vrdata"
android:elevation="5dp"
android:orientation="vertical">
......@@ -22,7 +22,7 @@
<com.mints.street.widget.XCRoundRectImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="160dp" />
android:layout_height="130dp" />
<TextView
android:id="@+id/tv_name"
......@@ -33,13 +33,13 @@
android:textColor="@color/black"
android:textSize="12sp" />
<LinearLayout
android:id="@+id/ly_star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
<com.mints.street.widget.RatingStar
android:id="@+id/llstart"
android:layout_marginStart="10dp"
android:layout_width="60dp"
android:layout_height="10dp"
app:starNormal="@mipmap/star_icon"
app:starNumber="5"/>
</LinearLayout>
</layout>
\ No newline at end of file
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