Commit 2b433e7f by fengquan

fix: 修复咨询师详情页兼容问题

parent ae311e9c
...@@ -110,7 +110,7 @@ class JsMethod(private val webView: WebView?) { ...@@ -110,7 +110,7 @@ class JsMethod(private val webView: WebView?) {
if (callback.isNullOrBlank()) return true if (callback.isNullOrBlank()) return true
webView?.post { webView?.post {
when (type) { when (type) {
1 -> {//检查音频权限能力 1,2 -> {//检查音频权限能力
webView.loadUrl("javascript:$callback(1)") webView.loadUrl("javascript:$callback(1)")
} }
else -> { else -> {
......
...@@ -95,9 +95,9 @@ class BasePhotoFragment : Fragment() { ...@@ -95,9 +95,9 @@ class BasePhotoFragment : Fragment() {
videoView!!.pause() videoView!!.pause()
if (ivPlay != null && beanViewInfo?.sourcesType == 2) { if (ivPlay != null && beanViewInfo?.sourcesType == 2) {
ivPlay?.visibility = VISIBLE ivPlay?.visibility = VISIBLE
if (ivImg != null) { // if (ivImg != null) {
ivImg?.visibility = VISIBLE // ivImg?.visibility = VISIBLE
} // }
} else if (ivPlay != null && beanViewInfo?.sourcesType == 1) { } else if (ivPlay != null && beanViewInfo?.sourcesType == 1) {
ivPlay?.visibility = GONE ivPlay?.visibility = GONE
if (ivImg != null) { if (ivImg != null) {
...@@ -105,6 +105,10 @@ class BasePhotoFragment : Fragment() { ...@@ -105,6 +105,10 @@ class BasePhotoFragment : Fragment() {
} }
} }
stopTiming() stopTiming()
}else if (isVisibleToUser && beanViewInfo != null && beanViewInfo?.sourcesType == 2) {
if (videoView != null) {
checkNetwork()
}
} }
if (!isVisiable) { if (!isVisiable) {
...@@ -212,7 +216,7 @@ class BasePhotoFragment : Fragment() { ...@@ -212,7 +216,7 @@ class BasePhotoFragment : Fragment() {
) )
} }
} else if (beanViewInfo?.sourcesType == 2) { } else if (beanViewInfo?.sourcesType == 2) {
ivPlay!!.visibility = VISIBLE // ivPlay!!.visibility = VISIBLE
videoContainer!!.visibility = VISIBLE videoContainer!!.visibility = VISIBLE
imageView!!.visibility = GONE imageView!!.visibility = GONE
ZoomMediaLoader.getInstance().loader.displayImage( ZoomMediaLoader.getInstance().loader.displayImage(
...@@ -248,6 +252,14 @@ class BasePhotoFragment : Fragment() { ...@@ -248,6 +252,14 @@ class BasePhotoFragment : Fragment() {
} }
true true
} }
if (isVisiable) {
ivPlay?.visibility = VISIBLE
checkNetwork()
}else {
ivPlay?.visibility = GONE
}
ivPlay!!.setOnClickListener { ivPlay!!.setOnClickListener {
checkNetwork() checkNetwork()
} }
...@@ -339,13 +351,13 @@ class BasePhotoFragment : Fragment() { ...@@ -339,13 +351,13 @@ class BasePhotoFragment : Fragment() {
.setMessage("当前处于非wifi环境下,播放会消耗流量,确定继续播放?") .setMessage("当前处于非wifi环境下,播放会消耗流量,确定继续播放?")
.setLeftOnclick("继续播放") { .setLeftOnclick("继续播放") {
if (!isPrepared) { if (!isPrepared) {
loading!!.visibility = VISIBLE loading?.visibility = VISIBLE
} }
ivImg!!.visibility = GONE ivImg?.visibility = GONE
ivPlay!!.visibility = GONE ivPlay?.visibility = GONE
startTiming() startTiming()
videoView?.visibility = VISIBLE videoView?.visibility = VISIBLE
videoView!!.start() videoView?.start()
isCompletion = false isCompletion = false
context?.getSharedPreferences("temp_test", Context.MODE_PRIVATE)?.edit() context?.getSharedPreferences("temp_test", Context.MODE_PRIVATE)?.edit()
...@@ -362,13 +374,13 @@ class BasePhotoFragment : Fragment() { ...@@ -362,13 +374,13 @@ class BasePhotoFragment : Fragment() {
dialog.show() dialog.show()
} else { } else {
if (!isPrepared) { if (!isPrepared) {
loading!!.visibility = VISIBLE loading?.visibility = VISIBLE
} }
ivImg!!.visibility = GONE ivImg?.visibility = GONE
ivPlay!!.visibility = GONE ivPlay?.visibility = GONE
startTiming() startTiming()
videoView?.visibility = VISIBLE videoView?.visibility = VISIBLE
videoView!!.start() videoView?.start()
isCompletion = false isCompletion = false
} }
} }
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
<ImageView <ImageView
android:id="@+id/ivImage" android:id="@+id/ivImage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
android:visibility="gone"/>
<ImageView <ImageView
......
...@@ -17,6 +17,7 @@ import com.yidianling.uikit.custom.http.response.ServiceItemBean ...@@ -17,6 +17,7 @@ import com.yidianling.uikit.custom.http.response.ServiceItemBean
import com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback import com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.main.im_expert_consult_service_item_view.view.* import kotlinx.android.synthetic.main.im_expert_consult_service_item_view.view.*
import java.text.DecimalFormat
/** /**
* 咨询服务, 预约item * 咨询服务, 预约item
...@@ -117,11 +118,12 @@ class ExpertConsultServiceItemView : LinearLayout { ...@@ -117,11 +118,12 @@ class ExpertConsultServiceItemView : LinearLayout {
val mBean: ServiceItemBean.ProductsBean.ProductSpecDtosBean = val mBean: ServiceItemBean.ProductsBean.ProductSpecDtosBean =
bean.productSpecDtos.sortedWith(mCompare).last() bean.productSpecDtos.sortedWith(mCompare).last()
//价格,取productSpecDtos数组最小价格,不保留小数 //价格,取productSpecDtos数组最小价格,不保留小数
service_item_price.text = String.format( // service_item_price.text = String.format(
"%.0f", // "%.0f",
mBean.price // mBean.price
) // )
val decimalFormat = DecimalFormat("###.##")
service_item_price.text = decimalFormat.format(mBean.price)
service_item_price.paint.isFakeBoldText = true service_item_price.paint.isFakeBoldText = true
//时间,取productSpecDtos数组最后一个的时间 //时间,取productSpecDtos数组最后一个的时间
......
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