Commit 38678631 by fengquan

feat: 咨询师详情页改版

parent aa9ca9ae
......@@ -23,6 +23,7 @@ interface IImService : IProvider {
// 直接打开聊天页面,不走分配导医
fun startChatBySessionId(context: Activity, toUid: String)
// 打开信息前置收集页
fun startP2PSession(context: Activity, location: Int, ffrom2: String?)
......@@ -183,4 +184,8 @@ interface IImService : IProvider {
fun initIm(app: Application, activity: Class<out Activity>, imInitBean: IMInitConfigBean)
fun isWifiOr3G(activity: Activity): Boolean
fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String)
fun dismissConsultServiceDialog();
}
\ No newline at end of file
......@@ -23,6 +23,7 @@ import com.yidianling.muse.activity.ChooseMusicActivity;
//import static com.ydl.ydlcommon.router.IYDLRouterConstant.ROUTER_MUSE_PLAY;
import de.greenrobot.event.EventBus;
import com.yidianling.im.event.CloseBottomWebviewEvent;
import java.util.ArrayList;
......@@ -523,13 +524,18 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
.setData(mThumbViewInfoList)
.setCurrentIndex(params.getPreview_index())
.setFullscreen(true)
.setToUid(info.getToUid() +"")
.setToUid(info.getToUid() + "")
.setDoctorId(info.getDoctorId())
.setType(GPreviewBuilder.IndicatorType.Dot)
.start();
}
@Override
public void showDocBooking(H5JsBean.H5JsCmd.Params params) {
ModularServiceManager.INSTANCE.provide(IImService.class).showConsultServiceDialog(mContext, params.getToUid() + "", params.getDoctorId() + "");
}
@Override
public void switchSound(int mediaId, long meditationId, int meditationType, int businessType,
String buried, String mediaUrl, String mediaCoverUrl,
String title, String desc, int status) {
......@@ -541,9 +547,11 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status);
}
}
@Override
public void chatCloseBottomWebView() {
EventBus.getDefault().post(new CloseBottomWebviewEvent(true));
ModularServiceManager.INSTANCE.provide(IImService.class).dismissConsultServiceDialog();
}
......@@ -556,8 +564,8 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
@Override
public void setWebViewBG(String rgb, String alpha) {
if (mContext instanceof NewH5Activity){
((NewH5Activity)mContext).setBG(rgb, alpha);
if (mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).setBG(rgb, alpha);
}
}
}
......@@ -465,6 +465,11 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
wvEnventPro?.resourceToPreview(jsData.cmd?.params)
}
"doctor_booking" -> {
wvEnventPro?.showDocBooking(jsData.cmd?.params)
}
}
}
}
......@@ -205,4 +205,6 @@ public interface WebViewClientClickListener {
void switchPushStatus(H5JsBean.H5JsCmd.Params params);
void resourceToPreview(H5JsBean.H5JsCmd.Params params);
void showDocBooking(H5JsBean.H5JsCmd.Params params);
}
......@@ -382,6 +382,14 @@ class BasePhotoFragment : Fragment() {
fun actionCancel()
}
fun stopVideo() {
if (videoView != null && videoView!!.isPlaying) {
ivPlay!!.visibility = VISIBLE
stopTiming()
videoView!!.pause()
}
}
companion object {
/**
* 预览图片 类型
......
......@@ -12,16 +12,14 @@ import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.ViewPager
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.yidianling.consultant.R
import com.yidianling.consultant.preview.GPreviewBuilder.IndicatorType
import com.yidianling.consultant.preview.SmoothImageView.onTransformListener
import com.yidianling.im.api.service.IImService
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_image_preview_photo.*
import kotlinx.android.synthetic.main.fragment_image_photo_layout.*
import java.util.*
/**
......@@ -93,11 +91,26 @@ class GPreviewActivity : AppCompatActivity() {
if (!toUid.isNullOrBlank()) {
ARouter.getInstance().navigation(IImService::class.java)
?.startChatBySessionId(context = this, toUid = toUid!!)
Timer().schedule(object : TimerTask() {
override fun run() {
runOnUiThread {
if (fragments != null && currentIndex < fragments!!.size) {
fragments!![currentIndex].stopVideo()
}
}
}
}, 2000)
}
}
bookingBtn.setOnClickListener {
ModularServiceManager.provide(IImService::class.java)
.showConsultServiceDialog(activity = this, toUid = toUid!!, doctorId = doctorId!!)
}
......@@ -116,12 +129,34 @@ class GPreviewActivity : AppCompatActivity() {
}
override fun onPageSelected(position: Int) {
currentIndex = position;
selectPosition?.setText((position + 1).toString() + "")
}
override fun onPageScrollStateChanged(state: Int) {}
})
if (toUid != null) {
val unReadByUid =
ARouter.getInstance().navigation(IImService::class.java).getUnReadByUid(toUid!!)
when {
unReadByUid <= 0 -> {
un_read_num_ll.visibility = View.GONE
}
unReadByUid > 99 -> {
un_read_num_ll.visibility = View.VISIBLE
un_read_num.text = "99"
}
else -> {
un_read_num_ll.visibility = View.VISIBLE
un_read_num.text = unReadByUid.toString()
}
}
}
// viewPager.setOffscreenPageLimit(3);
}
......@@ -136,6 +171,8 @@ class GPreviewActivity : AppCompatActivity() {
val isScale = intent.getBooleanExtra("isScale", false)
SmoothImageView.setIsScale(isScale)
initFragment(imgUrls, currentIndex, BasePhotoFragment::class.java)
}
private fun initFragment(
......
......@@ -25,8 +25,8 @@
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/platform_dp_20"
android:background="@drawable/consultant_bg_btn_chat"
android:text="立即私聊"
android:gravity="center"
android:text="立即私聊"
android:textColor="@color/white"
android:textSize="17sp"
android:textStyle="bold" />
......@@ -39,26 +39,28 @@
android:layout_alignParentBottom="true"
android:layout_marginRight="@dimen/platform_dp_20"
android:background="@drawable/consultant_bg_btn_book"
android:text="立即预约"
android:gravity="center"
android:text="立即预约"
android:textColor="@color/white"
android:textSize="17sp"
android:textStyle="bold" />
<RelativeLayout
android:id="@+id/un_read_num_ll"
android:layout_width="@dimen/platform_dp_17"
android:layout_height="@dimen/platform_dp_17"
android:layout_alignTop="@+id/chatBtn"
android:layout_alignRight="@+id/chatBtn"
android:layout_marginTop="-10dp"
android:layout_marginRight="@dimen/platform_dp_10"
android:visibility="gone"
android:background="@drawable/consultant_bg_chat_unread_num">
<TextView
android:id="@+id/un_read_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="3"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
......
......@@ -43,6 +43,7 @@ import com.yidianling.im.ui.page.NewMultiMessageFragment
import com.yidianling.nimbase.common.media.picker.PickImageHelper
import com.yidianling.uikit.api.NimUIKit
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper
import com.yidianling.uikit.custom.widget.expertConsultService.view.ExpertConsultServiceListDialog2
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
......@@ -53,6 +54,8 @@ import io.reactivex.schedulers.Schedulers
@Route(path = "/im/ImService")
class IMServiceImpl : IImService {
private var expertConsultServiceListDialog2: ExpertConsultServiceListDialog2 ?= null
override fun isHasUnread(): Boolean {
return MsgReceiveHelper.isHasUnread
}
......@@ -411,4 +414,21 @@ class IMServiceImpl : IImService {
override fun isWifiOr3G(activity: Activity): Boolean {
return NetworkUtil.isWifiOr3G(activity)
}
override fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String) {
// 获取专家是否在繁忙状态
if (activity != null) {
expertConsultServiceListDialog2 =
ExpertConsultServiceListDialog2(
activity, null, false, toUid,
doctorId
)
expertConsultServiceListDialog2?.show()
}
}
override fun dismissConsultServiceDialog() {
expertConsultServiceListDialog2?.changeItem()
}
}
\ No newline at end of file
......@@ -55,6 +55,21 @@ class ExpertConsultServiceItemView : LinearLayout {
View.inflate(mContext, R.layout.im_expert_consult_service_item_view, this)
}
fun updateBusyStatus(isBusy: Boolean) {
mIsBusy = isBusy
if (mIsBusy) {
im_expert_service_list_btn.visibility = View.GONE
tv_add.visibility = View.VISIBLE
tv_add.setOnClickListener {
mListener?.addTime()
}
} else {
im_expert_service_list_btn.visibility = View.VISIBLE
tv_add.visibility = View.GONE
}
}
/**
* 设置数据
*/
......@@ -149,7 +164,7 @@ class ExpertConsultServiceItemView : LinearLayout {
null
)
)
}else{
} else {
//新增需求,如果没有绑定手机号,跳转到绑定手机号页面
bindPhoneDialog()
}
......
......@@ -4,7 +4,6 @@ import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.LinearLayout
import com.yidianling.avchatkit.common.log.LogUtil
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.im.R
import com.yidianling.uikit.custom.http.response.ServiceItemBean
......@@ -53,7 +52,6 @@ class ExpertConsultServiceView : LinearLayout {
private fun initView() {
val mWidth: Int = RxDeviceTool.getScreenWidth(mContext)
val mHeight: Int = LayoutParams.MATCH_PARENT
......@@ -68,6 +66,15 @@ class ExpertConsultServiceView : LinearLayout {
View.inflate(mContext, R.layout.im_expert_consult_service_view, this)
}
fun setBusyStatus(isBusy: Boolean){
this.mIsBusy = isBusy
for(i in 0 until expert_consult_service_service_list.childCount){
val view = expert_consult_service_service_list.getChildAt(i)
if (view is ExpertConsultServiceItemView) {
view.updateBusyStatus(mIsBusy)
}
}
}
/**
* typeList 类型列表
* serviceList 服务列表
......
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