Commit ec0f006f by 万齐军

merge release

parents 9de31709 801171a4
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.12" componentVersion = "0.3.0.16"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -54,7 +54,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers ...@@ -54,7 +54,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import java.io.UnsupportedEncodingException import java.io.UnsupportedEncodingException
import java.net.URLDecoder import java.net.URLDecoder
import java.util.*
import kotlin.math.roundToInt import kotlin.math.roundToInt
class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
...@@ -97,6 +96,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -97,6 +96,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
var shouldShow: Boolean? = false var shouldShow: Boolean? = false
var uid: String? = null var uid: String? = null
var listen_free: Boolean = false var listen_free: Boolean = false
private var hasOnResume = false
fun showBottomSheetDialog( fun showBottomSheetDialog(
activity: FragmentActivity, activity: FragmentActivity,
jumpUrl: String, jumpUrl: String,
...@@ -367,6 +367,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -367,6 +367,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
fun onEventMainThread(event: ConfideDialogEvent) { fun onEventMainThread(event: ConfideDialogEvent) {
if(!hasOnResume) return
// 第一位表示拨打按钮,第二位代表再换一位按钮 // 第一位表示拨打按钮,第二位代表再换一位按钮
val show = event.show val show = event.show
// if (show == 0) { // if (show == 0) {
...@@ -568,8 +569,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -568,8 +569,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
return false return false
} }
override fun onPause() {
super.onPause()
hasOnResume = false
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
hasOnResume = true
if (doctorId.isNotBlank() && layoutCall.visibility == View.VISIBLE) { if (doctorId.isNotBlank() && layoutCall.visibility == View.VISIBLE) {
onLoadDialStatus(doctorId) onLoadDialStatus(doctorId)
} }
......
...@@ -72,7 +72,6 @@ import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.* ...@@ -72,7 +72,6 @@ import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject import org.json.JSONObject
import java.util.concurrent.Executors import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import kotlin.collections.ArrayList
@Route(path = "/consultant/consultant") @Route(path = "/consultant/consultant")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(), class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(),
...@@ -1485,20 +1484,20 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1485,20 +1484,20 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
needRefresh = true needRefresh = true
} }
// val orderToPayTime = SharedPreferencesEditor.getString("orderToPayTime") val orderToPayTime = SharedPreferencesEditor.getString("orderToPayTime")
//
// var timeLimit = if (TextUtils.isEmpty(orderToPayTime)) { val timeLimit = if (TextUtils.isEmpty(orderToPayTime)) {
// 0L 0L
// } else { } else {
// orderToPayTime.toLong() orderToPayTime.toLong()
// } }
//
//
// if (isShow && !(consultSubPayDialog != null && consultSubPayDialog?.isShowing == true)) { if (isShow && !(consultSubPayDialog != null && consultSubPayDialog?.isShowing == true)) {
// if (findRouteService(IUserService::class.java).isLogin() && System.currentTimeMillis() > timeLimit) { if (findRouteService(IUserService::class.java).isLogin() && System.currentTimeMillis() > timeLimit) {
// getPresenter().fetchPromptPayment() getPresenter().fetchPromptPayment()
// } }
// } }
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT) ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_PAGE_VISIT)
ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6") ActionCountUtils.count("daoyi_advertisement_page|daoyi_advertisement_visit", "6")
......
...@@ -60,7 +60,8 @@ class ConsultSubPayDialog( ...@@ -60,7 +60,8 @@ class ConsultSubPayDialog(
findViewById<TextView>(R.id.priceTv).text = "¥$price" findViewById<TextView>(R.id.priceTv).text = "¥$price"
var format = SimpleDateFormat("HH:mm:ss"); var format = SimpleDateFormat("HH:mm:ss");
format.timeZone = TimeZone.getTimeZone("GMT+0"); format.timeZone = TimeZone.getTimeZone("GMT+0");
var millisInFuture = promptPaymentBean.currentTime?:0 - (promptPaymentBean.toPayTime?:0L) var millisInFuture =
promptPaymentBean.toPayTime?.minus(promptPaymentBean.currentTime ?: 0) ?: 0
mTimer = CountDownTimerSupport(millisInFuture, 1000) mTimer = CountDownTimerSupport(millisInFuture, 1000)
mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener { mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
...@@ -69,7 +70,8 @@ class ConsultSubPayDialog( ...@@ -69,7 +70,8 @@ class ConsultSubPayDialog(
} }
override fun onFinish() { override fun onFinish() {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
dismiss() dismiss()
} }
...@@ -80,7 +82,8 @@ class ConsultSubPayDialog( ...@@ -80,7 +82,8 @@ class ConsultSubPayDialog(
}) })
mTimer?.start() mTimer?.start()
findViewById<TextView>(R.id.tv_close).setOnClickListener { findViewById<TextView>(R.id.tv_close).setOnClickListener {
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
mTimer?.stop() mTimer?.stop()
dismiss() dismiss()
...@@ -96,7 +99,8 @@ class ConsultSubPayDialog( ...@@ -96,7 +99,8 @@ class ConsultSubPayDialog(
ToastUtil.toastShort("跳转失败") ToastUtil.toastShort("跳转失败")
dismiss() dismiss()
} }
var nextShowTime = System.currentTimeMillis() + 24 * 60 * 60 * 1000 var nextShowTime =
System.currentTimeMillis() + ((promptPaymentBean.orderToPayTime ?: 1) * 1000)
SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString()) SharedPreferencesEditor.putString("orderToPayTime", nextShowTime.toString())
} }
} }
......
package com.yidianling.home
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.yidianling.home.test", appContext.packageName)
}
}
...@@ -1048,6 +1048,9 @@ ...@@ -1048,6 +1048,9 @@
"type": 10004 "type": 10004
}, },
{ {
"type": 10005
},
{
"courseBean": { "courseBean": {
"pageNum": 1, "pageNum": 1,
"pageSize": 3, "pageSize": 3,
...@@ -1303,7 +1306,7 @@ ...@@ -1303,7 +1306,7 @@
} }
] ]
}, },
"type": 10005 "type": 10006
}, },
{ {
"askBean": { "askBean": {
...@@ -5568,8 +5571,9 @@ ...@@ -5568,8 +5571,9 @@
} }
] ]
}, },
"type": 10006 "type": 10007
}, },
{ "type": 1000101},
{ {
"articleBean": { "articleBean": {
"list": [ "list": [
...@@ -5740,9 +5744,9 @@ ...@@ -5740,9 +5744,9 @@
} }
] ]
}, },
"type": 10007 "type": 10008
}, },
{ {
"type": 10008 "type": 10009
} }
] ]
\ No newline at end of file
...@@ -21,7 +21,6 @@ import com.yidianling.home.R ...@@ -21,7 +21,6 @@ import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_fragment.*
class MeditationTypeAdapter( class MeditationTypeAdapter(
private val context: Context, private val context: Context,
......
...@@ -102,4 +102,7 @@ class HomeBaseHttp { ...@@ -102,4 +102,7 @@ class HomeBaseHttp {
return RxUtils.mapObservable(cmd).flatMap { getHomePagerApi().askFocus(it) } return RxUtils.mapObservable(cmd).flatMap { getHomePagerApi().askFocus(it) }
} }
fun getMeditationInfo(): Observable<BaseAPIResponse<MeditationModuleBean>> {
return getHomePagerApi().getMeditation()
}
} }
\ No newline at end of file
...@@ -111,5 +111,8 @@ interface HomeBasePagerApi { ...@@ -111,5 +111,8 @@ interface HomeBasePagerApi {
@POST("sq-active/focus") @POST("sq-active/focus")
fun askFocus(@FieldMap params: Map<String, String>): Observable<BaseResponse<AskResultBean>> fun askFocus(@FieldMap params: Map<String, String>): Observable<BaseResponse<AskResultBean>>
@GET("cms/meditation/index")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getMeditation(): Observable<BaseAPIResponse<MeditationModuleBean>>
} }
\ No newline at end of file
package com.yidianling.home.ui.view package com.yidianling.home.view
import android.content.Context import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import com.yidianling.home.R import com.yidianling.home.R
import kotlinx.android.synthetic.ydl.home_common_title_view.view.* import kotlinx.android.synthetic.main.home_common_title_view.view.*
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
......
package com.yidianling.home.ui.view package com.yidianling.home.view
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
...@@ -21,10 +21,8 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils ...@@ -21,10 +21,8 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.adapter.MeditationViewPagerAdapter import com.yidianling.home.adapter.MeditationViewPagerAdapter
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.constract.HomeViewConfig
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
import kotlinx.android.synthetic.ydl.home_muse_view.view.* import kotlinx.android.synthetic.main.home_muse_view.view.*
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...@@ -33,7 +31,7 @@ import kotlinx.android.synthetic.ydl.home_muse_view.view.* ...@@ -33,7 +31,7 @@ import kotlinx.android.synthetic.ydl.home_muse_view.view.*
* @Company 壹点灵 * @Company 壹点灵
* @date 2019/09/10 * @date 2019/09/10
*/ */
class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEvent?) : class HomeMuseView(private val mContext: Context) :
LinearLayout(mContext) { LinearLayout(mContext) {
private val meditationTitles = mutableListOf<String>() private val meditationTitles = mutableListOf<String>()
...@@ -51,7 +49,7 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv ...@@ -51,7 +49,7 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
) )
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_muse_view, this) View.inflate(mContext, R.layout.home_muse_view, this)
homeModuleMuseViewHomeCommonTitleView.setTitle(HomeViewConfig.getOrder().museTitle) homeModuleMuseViewHomeCommonTitleView.setTitle("助眠·冥想")
} }
fun initData(bean: MeditationModuleBean?) { fun initData(bean: MeditationModuleBean?) {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
android:orientation="vertical" android:orientation="vertical"
tools:parentTag="android.widget.LinearLayout"> tools:parentTag="android.widget.LinearLayout">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleMuseViewHomeCommonTitleView" android:id="@+id/homeModuleMuseViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="white_60">#99FFFFFF</color>
</resources>
...@@ -10,7 +10,14 @@ ...@@ -10,7 +10,14 @@
<item name="colorPrimaryDark">@color/platform_main_theme</item> <item name="colorPrimaryDark">@color/platform_main_theme</item>
<item name="colorAccent">@color/platform_main_theme</item> <item name="colorAccent">@color/platform_main_theme</item>
</style> </style>
<style name="MeditationTabLayoutStyle" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@color/white</item>
<item name="tabIndicatorHeight">2dp</item>
<item name="tabIndicatorFullWidth">false</item>
<item name="tabSelectedTextColor">@color/white</item>
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/white_60</item>
</style>
</resources> </resources>
\ No newline at end of file
package com.yidianling.home
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
package com.yidianling.home.adapter package com.yidianling.home.adapter
import android.content.Context import android.content.Context
import android.graphics.Color
import android.media.MediaPlayer
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.data.PlatformDataManager
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.constract.YdlHomeViewHolderConstract import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.event.HomeImpl import com.yidianling.home.event.HomeImpl
...@@ -17,6 +17,8 @@ import com.yidianling.home.model.bean.HomeConfideBean ...@@ -17,6 +17,8 @@ import com.yidianling.home.model.bean.HomeConfideBean
import com.yidianling.home.model.bean.HomeConsultBean import com.yidianling.home.model.bean.HomeConsultBean
import com.yidianling.home.model.bean.HomePagerDataBean import com.yidianling.home.model.bean.HomePagerDataBean
import com.yidianling.home.ui.view.* import com.yidianling.home.ui.view.*
import com.yidianling.home.view.HomeMuseView
import kotlinx.android.synthetic.main.home_muse_view.view.*
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...@@ -126,6 +128,11 @@ class YdlHomeAdapter( ...@@ -126,6 +128,11 @@ class YdlHomeAdapter(
YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW -> { YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW -> {
return HomeAssuageGriefViewHolder(HomeAssuageGriefView(mContext, homeEvent)) return HomeAssuageGriefViewHolder(HomeAssuageGriefView(mContext, homeEvent))
} }
//壹点*冥想模块
YdlHomeViewHolderConstract.MUSE_VIEW -> {
return HomeMuseViewHolder(HomeMuseView(mContext))
}
//文章*阅读模块 //文章*阅读模块
YdlHomeViewHolderConstract.ARTICLE_VIEW -> { YdlHomeViewHolderConstract.ARTICLE_VIEW -> {
return HomeArticleViewHolder(HomeArticleView(mContext, homeEvent)) return HomeArticleViewHolder(HomeArticleView(mContext, homeEvent))
...@@ -157,21 +164,6 @@ class YdlHomeAdapter( ...@@ -157,21 +164,6 @@ class YdlHomeAdapter(
list[position].headerBean?.askCategoryData list[position].headerBean?.askCategoryData
) )
} }
//倾诉*排解模块
// is HomeConfideViewHolder -> {
// if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
// val parm = holder.itemView.layoutParams
// parm.height = 0
// holder.itemView.layoutParams = parm
// } else {
// holder.confideViewView.setTitle(
// list[position].headerBean?.listenCategoryDate,
// confideSelectPosition
// )
// holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
// confidePosition = position
// }
// }
//课程*成长模块 //课程*成长模块
is HomeCourseViewHolder -> { is HomeCourseViewHolder -> {
holder.courseViewView.initData(list[position].courseBean?.list) holder.courseViewView.initData(list[position].courseBean?.list)
...@@ -202,6 +194,17 @@ class YdlHomeAdapter( ...@@ -202,6 +194,17 @@ class YdlHomeAdapter(
is HomeTestViewHolder -> { is HomeTestViewHolder -> {
holder.testView.initData(list[position].testListBean) holder.testView.initData(list[position].testListBean)
} }
is HomeMuseViewHolder -> {
holder.museViewView.video_view?.setOnInfoListener { mp, what, extra ->
if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
holder.museViewView.video_view?.setBackgroundColor(Color.TRANSPARENT)
}
true
}
holder.museViewView.video_view?.start()
holder.museViewView.initData(list[position].meditationBean)
}
} }
} }
...@@ -255,6 +258,10 @@ class YdlHomeAdapter( ...@@ -255,6 +258,10 @@ class YdlHomeAdapter(
*/ */
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) : inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) :
RecyclerView.ViewHolder(articleViewView) RecyclerView.ViewHolder(articleViewView)
/**
* 解忧*问答模块 ViewHolder
*/
inner class HomeMuseViewHolder(val museViewView: HomeMuseView) : RecyclerView.ViewHolder(museViewView)
/** /**
* 底部提示语模块 ViewHolder * 底部提示语模块 ViewHolder
......
...@@ -62,6 +62,6 @@ class IHomeContract { ...@@ -62,6 +62,6 @@ class IHomeContract {
*/ */
fun getCoupons(uid: String): Observable<BaseResponse<List<CouponBean>>> fun getCoupons(uid: String): Observable<BaseResponse<List<CouponBean>>>
fun getMeditation(): Observable<MeditationModuleBean>
} }
} }
\ No newline at end of file
...@@ -29,26 +29,32 @@ class YdlHomeViewHolderConstract { ...@@ -29,26 +29,32 @@ class YdlHomeViewHolderConstract {
* 测试模块 * 测试模块
*/ */
val TEST_VIEW = 10004 val TEST_VIEW = 10004
/**
* 冥想模块
*/
val MUSE_VIEW = 10005
/** /**
* 课程*成长模块 * 课程*成长模块
*/ */
val COURSE_VIEW = 10005 val COURSE_VIEW = 10006
/** /**
* 解忧*问答模块 * 解忧*问答模块
*/ */
val ASSUAGE_GRIEF_VIEW = 10006 val ASSUAGE_GRIEF_VIEW = 10007
/** /**
* 文章*阅读模块 * 文章*阅读模块
*/ */
val ARTICLE_VIEW = 10007 val ARTICLE_VIEW = 10008
/** /**
* 底部提示语模块 * 底部提示语模块
*/ */
val FOOTER_VIEW = 10008 val FOOTER_VIEW = 10009
/** /**
* 倾诉*排解模块 * 倾诉*排解模块
*/ */
val CONFIDE_VIEW = 1000100 val CONFIDE_VIEW = 1000100
} }
} }
\ No newline at end of file
...@@ -2,9 +2,13 @@ package com.yidianling.home.model ...@@ -2,9 +2,13 @@ package com.yidianling.home.model
import com.yidianling.home.http.HomeHttp import com.yidianling.home.http.HomeHttp
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.home.constract.IHomeContract import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.http.HomeBaseHttp
import com.yidianling.home.model.bean.* import com.yidianling.home.model.bean.*
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...@@ -26,5 +30,9 @@ class HomeModelImpl: BaseHomeModelImpl(), IHomeContract.Model { ...@@ -26,5 +30,9 @@ class HomeModelImpl: BaseHomeModelImpl(), IHomeContract.Model {
return HomeHttp.getInstance().getCoupons(uid) return HomeHttp.getInstance().getCoupons(uid)
} }
override fun getMeditation(): Observable<MeditationModuleBean> {
return HomeBaseHttp.getInstance().getMeditationInfo().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { MeditationModuleBean(true) }
}
} }
\ No newline at end of file
...@@ -145,10 +145,15 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -145,10 +145,15 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
if (dataBean.isRealEmpty || dataBean !is HomeAskBean) homeTempData.askBean else dataBean if (dataBean.isRealEmpty || dataBean !is HomeAskBean) homeTempData.askBean else dataBean
mHomeAskBean = item.askBean mHomeAskBean = item.askBean
} }
YdlHomeViewHolderConstract.MUSE_VIEW -> {
item.meditationBean =
if (dataBean.isRealEmpty || dataBean !is MeditationModuleBean) homeTempData.meditationBean else dataBean
}
YdlHomeViewHolderConstract.ARTICLE_VIEW -> { YdlHomeViewHolderConstract.ARTICLE_VIEW -> {
item.articleBean = item.articleBean =
if (dataBean.isRealEmpty || dataBean !is HomeArticleBean) homeTempData.articleBean else dataBean if (dataBean.isRealEmpty || dataBean !is HomeArticleBean) homeTempData.articleBean else dataBean
} }
} }
return item return item
} }
...@@ -220,6 +225,11 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -220,6 +225,11 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
) )
) )
}, },
mModel.getMeditation()
.compose(RxUtils.applySchedulers(mView)).map {
//首页问答数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.MUSE_VIEW))
},
mModel.askRequest() mModel.askRequest()
.compose(RxUtils.applySchedulers(mView)).map { .compose(RxUtils.applySchedulers(mView)).map {
//首页问答数据 //首页问答数据
...@@ -243,7 +253,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -243,7 +253,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
mView.homeDataFail(msg) mView.homeDataFail(msg)
} }
}, Action { }, Action {
if (homeList.size != 9){ if (homeList.size != 10){
mView.homeDataFail("") mView.homeDataFail("")
return@Action return@Action
} }
......
...@@ -346,23 +346,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -346,23 +346,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
override fun setUserVisibleHint(isVisibleToUser: Boolean) { override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser) super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && isResumed) { if (isVisibleToUser && isResumed) {
showConsultAssistantDialog()
} else {
hideConsultAssistantDialog()
}
if (isVisibleToUser && isResumed) {
onResume() onResume()
} }
} }
private fun showConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java)
.showConsultAssistantDialog(mActivity!!)
}
private fun hideConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
override fun onStop() { override fun onStop() {
super.onStop() super.onStop()
endTime = System.currentTimeMillis() endTime = System.currentTimeMillis()
...@@ -381,10 +368,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -381,10 +368,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition) mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
} }
mPresenter?.prepareCoupon(mActivity!!) mPresenter?.prepareCoupon(mActivity)
//走咨询助理浮层展示逻辑,是否展示由内部条件与接口判断
showConsultAssistantDialog()
} }
} }
......
...@@ -14,7 +14,8 @@ import com.yidianling.home.constract.HomeViewConfig ...@@ -14,7 +14,8 @@ import com.yidianling.home.constract.HomeViewConfig
import com.yidianling.home.event.HomeImpl import com.yidianling.home.event.HomeImpl
import com.yidianling.home.model.bean.* import com.yidianling.home.model.bean.*
import com.yidianling.home.ui.view.* import com.yidianling.home.ui.view.*
import kotlinx.android.synthetic.ydl.home_muse_view.view.* import com.yidianling.home.view.HomeMuseView
import kotlinx.android.synthetic.main.home_muse_view.view.*
/** /**
...@@ -178,7 +179,7 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -178,7 +179,7 @@ class YdlHomeAdapter(private val mContext: Context,
} }
//壹点*冥想模块 //壹点*冥想模块
HomeViewConfig.getOrder().museIndex -> { HomeViewConfig.getOrder().museIndex -> {
return HomeMuseViewHolder(HomeMuseView(mContext, homeEvent),viewType) return HomeMuseViewHolder(HomeMuseView(mContext), viewType)
} }
//底部提示语模块 //底部提示语模块
else -> { else -> {
...@@ -301,7 +302,7 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -301,7 +302,7 @@ class YdlHomeAdapter(private val mContext: Context,
/** /**
* 文章*阅读模块 ViewHolder * 文章*阅读模块 ViewHolder
*/ */
inner class HomeMuseViewHolder(val museViewView: HomeMuseView,val viewType:Int) : RecyclerView.ViewHolder(museViewView) inner class HomeMuseViewHolder(val museViewView: HomeMuseView, val viewType:Int) : RecyclerView.ViewHolder(museViewView)
/** /**
* 文章*阅读模块 ViewHolder * 文章*阅读模块 ViewHolder
......
...@@ -22,6 +22,6 @@ class IHomeContract { ...@@ -22,6 +22,6 @@ class IHomeContract {
*/ */
fun museRequest(): Observable<MuseModuleBean> fun museRequest(): Observable<MuseModuleBean>
fun getMeditation():Observable<MeditationModuleBean> fun getMeditation(): Observable<MeditationModuleBean>
} }
} }
\ No newline at end of file
...@@ -39,8 +39,5 @@ class HomeHttp { ...@@ -39,8 +39,5 @@ class HomeHttp {
return getHomePagerApi().getMuseData() return getHomePagerApi().getMuseData()
} }
fun getMeditationInfo():Observable<BaseAPIResponse<MeditationModuleBean>>{
return getHomePagerApi().getMeditation()
}
} }
\ No newline at end of file
...@@ -23,8 +23,5 @@ interface HomePagerApi { ...@@ -23,8 +23,5 @@ interface HomePagerApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getMuseData(): Observable<BaseAPIResponse<MuseModuleBean>> fun getMuseData(): Observable<BaseAPIResponse<MuseModuleBean>>
@GET("cms/meditation/index")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getMeditation(): Observable<BaseAPIResponse<MeditationModuleBean>>
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yidianling.home.model ...@@ -2,6 +2,7 @@ package com.yidianling.home.model
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.home.constract.IHomeContract import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.http.HomeBaseHttp
import com.yidianling.home.http.HomeHttp import com.yidianling.home.http.HomeHttp
import com.yidianling.home.model.bean.MeditationModuleBean import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.home.model.bean.MuseModuleBean import com.yidianling.home.model.bean.MuseModuleBean
...@@ -28,7 +29,7 @@ class HomeModelImpl : BaseHomeModelImpl(), IHomeContract.Model { ...@@ -28,7 +29,7 @@ class HomeModelImpl : BaseHomeModelImpl(), IHomeContract.Model {
} }
override fun getMeditation(): Observable<MeditationModuleBean> { override fun getMeditation(): Observable<MeditationModuleBean> {
return HomeHttp.getInstance().getMeditationInfo().compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().getMeditationInfo().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { MeditationModuleBean(true) } .onErrorReturn { MeditationModuleBean(true) }
} }
......
...@@ -47,10 +47,9 @@ import io.reactivex.Observable ...@@ -47,10 +47,9 @@ import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.home_muse_view.*
import kotlinx.android.synthetic.ydl.home_fragment.* import kotlinx.android.synthetic.ydl.home_fragment.*
import kotlinx.android.synthetic.ydl.home_fragment.tab_layout import kotlinx.android.synthetic.ydl.home_fragment.tab_layout
import kotlinx.android.synthetic.ydl.home_muse_view.*
import kotlinx.android.synthetic.ydl.home_muse_view.view.*
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleArticleViewHomeCommonTitleView" android:id="@+id/homeModuleArticleViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleAssuageGriefViewHomeCommonTitleView" android:id="@+id/homeModuleAssuageGriefViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleConfideViewHomeCommonTitleView" android:id="@+id/homeModuleConfideViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleCourseViewHomeCommonTitleView" android:id="@+id/homeModuleCourseViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
> >
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView" android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
> >
<com.yidianling.home.ui.view.HomeCommonTitleView <com.yidianling.home.view.HomeCommonTitleView
android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView" android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="white_60">#99FFFFFF</color>
<color name="white">#FFFFFF</color> <color name="white">#FFFFFF</color>
<color name="home_confide_61CEAC">#61CEAC</color> <color name="home_confide_61CEAC">#61CEAC</color>
......
...@@ -11,13 +11,5 @@ ...@@ -11,13 +11,5 @@
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
</style> </style>
<style name="MeditationTabLayoutStyle" parent="Widget.Design.TabLayout">
<item name="tabIndicatorColor">@color/white</item>
<item name="tabIndicatorHeight">2dp</item>
<item name="tabIndicatorFullWidth">false</item>
<item name="tabSelectedTextColor">@color/white</item>
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/white_60</item>
</style>
</resources> </resources>
\ No newline at end of file
...@@ -71,7 +71,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -71,7 +71,7 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
if (ActionHandlerStorage.getL(contactId) != null) { if (ActionHandlerStorage.getL(contactId) != null) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
} else if (contactId.equals(ImConstants.KEFUXIAOYI)) { } else if (contactId.equals(ImConstants.KEFUXIAOYI)) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} }
ActionHandlerStorage.setL(contactId, l); ActionHandlerStorage.setL(contactId, l);
......
...@@ -168,7 +168,7 @@ class ExpertConsultServiceItemView : LinearLayout { ...@@ -168,7 +168,7 @@ class ExpertConsultServiceItemView : LinearLayout {
NewH5Activity.start( NewH5Activity.start(
mContext, mContext,
H5Params( H5Params(
HttpConfig.MH5_URL + "consult/#/pages/jieyou/DownOrder?product_id=" + bean.productDto.id, HttpConfig.MH5_URL + "consult/#/pages/jieyou/DownOrder?product_id=${bean.productDto.id}&hideNavBar=1",
null null
) )
) )
......
...@@ -14,6 +14,7 @@ import com.ydl.webview.ProgressWebView ...@@ -14,6 +14,7 @@ import com.ydl.webview.ProgressWebView
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.webview.WebModularServiceUtils import com.ydl.webview.WebModularServiceUtils
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R import com.yidianling.im.R
...@@ -54,6 +55,7 @@ class ExpertConsultWebview : RelativeLayout { ...@@ -54,6 +55,7 @@ class ExpertConsultWebview : RelativeLayout {
val jtoJHandle = WebModularServiceUtils.getWebService() val jtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(mContext as Activity, wv_content, tellData = TellData()) .getJavascripHandler(mContext as Activity, wv_content, tellData = TellData())
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix()) val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
LogUtil.e(url)
wv_content.loadUrl(url) wv_content.loadUrl(url)
} }
......
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="74dp" android:layout_width="74dp"
android:layout_height="@dimen/platform_dp_32"> android:layout_height="@dimen/platform_dp_32">
<TextView <TextView
android:id="@+id/im_expert_service_list_btn" android:id="@+id/im_expert_service_list_btn"
android:layout_width="74dp" android:layout_width="74dp"
...@@ -172,32 +173,32 @@ ...@@ -172,32 +173,32 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="1dp"
android:text="¥" android:text="¥"
android:textFontWeight="800"
android:textColor="#EB892C" android:textColor="#EB892C"
android:textSize="12sp" android:textFontWeight="800"
android:layout_marginBottom="1dp"/> android:textSize="12sp" />
<TextView <TextView
android:id="@+id/service_item_price" android:id="@+id/service_item_price"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="bottom" android:gravity="bottom"
android:textStyle="normal"
android:textFontWeight="1500"
android:text="0" android:text="0"
android:textColor="#EB892C" android:textColor="#EB892C"
android:textSize="@dimen/im_text_size_18" /> android:textFontWeight="1500"
android:textSize="@dimen/im_text_size_18"
android:textStyle="normal" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/platform_dp_3" android:layout_marginLeft="@dimen/platform_dp_3"
android:layout_marginBottom="@dimen/platform_dp_1"
android:gravity="bottom" android:gravity="bottom"
android:layout_gravity="bottom"
android:text="起" android:text="起"
android:textColor="#9D9EA7" android:textColor="#9D9EA7"
android:layout_marginBottom="@dimen/platform_dp_1"
android:textSize="12sp" /> android:textSize="12sp" />
...@@ -205,12 +206,12 @@ ...@@ -205,12 +206,12 @@
android:id="@+id/service_item_low_buy_time" android:id="@+id/service_item_low_buy_time"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="#9D9EA7"
android:textSize="@dimen/sp_12"
android:visibility="gone"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/platform_dp_1" android:layout_marginBottom="@dimen/platform_dp_1"
android:text="(8次起售)" /> android:text="(8次起售)"
android:textColor="#9D9EA7"
android:textSize="@dimen/sp_12"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -43,6 +43,7 @@ import com.yidianling.user.api.event.RefreshRecentContactListEvent ...@@ -43,6 +43,7 @@ import com.yidianling.user.api.event.RefreshRecentContactListEvent
import com.yidianling.user.api.service.IAppService import com.yidianling.user.api.service.IAppService
import com.yidianling.user.constants.UserBIConstants.UserMyPageEvent import com.yidianling.user.constants.UserBIConstants.UserMyPageEvent
import com.yidianling.user.mine.bean.CouponNumBean import com.yidianling.user.mine.bean.CouponNumBean
import com.yidianling.user.mine.bean.UpdateTabMeNumBean
import com.yidianling.user.mine.data.AppDataManager.getHttp import com.yidianling.user.mine.data.AppDataManager.getHttp
import com.yidianling.user.mine.data.AppDataManager.getLocal import com.yidianling.user.mine.data.AppDataManager.getLocal
import com.yidianling.user.mine.http.MineHttpImpl import com.yidianling.user.mine.http.MineHttpImpl
...@@ -146,6 +147,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -146,6 +147,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateUI() updateUI()
refreshCouponData()
} }
override fun setUserVisibleHint(isVisibleToUser: Boolean) { override fun setUserVisibleHint(isVisibleToUser: Boolean) {
...@@ -212,28 +214,34 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -212,28 +214,34 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
val orderNum = response.data?.consultOrderNum ?: 0 val orderNum = response.data?.consultOrderNum ?: 0
if (orderNum > 0) { if (orderNum > 0) {
iv_order_tip.visibility = View.VISIBLE iv_order_tip.visibility = View.VISIBLE
if (orderNum > 99) { val numberStr = if (orderNum > 99) {
iv_order_tip.text = "99+" "99+"
} else { } else {
iv_order_tip.text = "$orderNum" "$orderNum"
} }
iv_order_tip.text = numberStr
getLocal().setConsult(true) getLocal().setConsult(true)
getLocal().setConsultNum(orderNum)
} else { } else {
iv_order_tip.visibility = View.GONE iv_order_tip.visibility = View.GONE
getLocal().setConsult(false) getLocal().setConsult(false)
getLocal().setConsultNum(0)
} }
}else{ }else {
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(false)
getLocal().setConsultNum(0)
} }
}else{ }else {
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(false)
getLocal().setConsultNum(0)
} }
EventBus.getDefault().post(UpdateTabMeNumBean())
},{ },{
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(false)
getLocal().setConsultNum(0)
}) })
} }
...@@ -246,6 +254,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -246,6 +254,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
getLocal().setCoupon(false) getLocal().setCoupon(false)
getLocal().setConfide(false) getLocal().setConfide(false)
getLocal().setConsult(false) getLocal().setConsult(false)
getLocal().setConsultNum(0)
val userInfo = getUserInfo() val userInfo = getUserInfo()
......
package com.yidianling.user.mine.bean;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/5/7
*/
public class UpdateTabMeNumBean {
}
...@@ -18,15 +18,19 @@ interface AppLocal { ...@@ -18,15 +18,19 @@ interface AppLocal {
fun putUpdate(update: Boolean) fun putUpdate(update: Boolean)
fun getCoupon():Boolean fun getCoupon(): Boolean
fun setCoupon(have:Boolean) fun setCoupon(have: Boolean)
fun getConsult():Boolean fun getConsult(): Boolean
fun setConsult(have: Boolean) fun setConsult(have: Boolean)
fun getConfide():Boolean fun getConsultNum(): Int
fun setConsultNum(num: Int)
fun getConfide(): Boolean
fun setConfide(have: Boolean) fun setConfide(have: Boolean)
......
...@@ -22,6 +22,7 @@ internal class AppLocalImpl private constructor(): AppLocal { ...@@ -22,6 +22,7 @@ internal class AppLocalImpl private constructor(): AppLocal {
private const val CONFIDE = "confide" private const val CONFIDE = "confide"
private const val CONSULT = "consult" private const val CONSULT = "consult"
private const val CONSULT_NUM = "consult_num"
private const val COUPON = "coupon" private const val COUPON = "coupon"
} }
...@@ -58,6 +59,14 @@ internal class AppLocalImpl private constructor(): AppLocal { ...@@ -58,6 +59,14 @@ internal class AppLocalImpl private constructor(): AppLocal {
getAppSP().edit().putBoolean(CONSULT, have).apply() getAppSP().edit().putBoolean(CONSULT, have).apply()
} }
override fun getConsultNum(): Int {
return getAppSP().getInt(CONSULT_NUM, 0)
}
override fun setConsultNum(num: Int) {
getAppSP().edit().putInt(CONSULT_NUM, num).apply()
}
override fun getConfide(): Boolean { override fun getConfide(): Boolean {
return getAppSP().getBoolean(CONFIDE, false) return getAppSP().getBoolean(CONFIDE, false)
} }
......
...@@ -417,18 +417,18 @@ ...@@ -417,18 +417,18 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
tools:text="11"
android:id="@+id/iv_order_tip" android:id="@+id/iv_order_tip"
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:background="@drawable/user_mine_background_red_point_new_coupon"
android:gravity="center" android:gravity="center"
android:textSize="8dp"
android:textColor="@color/white" android:textColor="@color/white"
android:background="@drawable/user_mine_background_red_point_new_coupon" android:textSize="6sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintCircle="@id/iv_trade_order" app:layout_constraintCircle="@id/iv_trade_order"
app:layout_constraintCircleAngle="45" app:layout_constraintCircleAngle="45"
app:layout_constraintCircleRadius="10dp" app:layout_constraintCircleRadius="10dp"
tools:text="9"
tools:visibility="visible" /> tools:visibility="visible" />
<TextView <TextView
......
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