Commit a002933e by 刘鹏

feat: 消息ui还原、倾诉支付

parent c312118b
......@@ -29,10 +29,12 @@ import com.ydl.webview.ProgressWebView
import com.ydl.webview.TellData
import com.ydl.webview.WebModularServiceUtils
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.ScreenUtil
import com.ydl.ydlcommon.utils.TimeUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService
......@@ -66,6 +68,8 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var layout_change_text: View
lateinit var layoutBottom: View
lateinit var itemView: View
var bottomSheet :FrameLayout?=null
private var behavior: BottomSheetBehavior<*>? = null
......@@ -194,7 +198,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
onShowReady()
......@@ -209,10 +212,17 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
FrameLayout.LayoutParams.WRAP_CONTENT
).apply { gravity = Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL }
dialog?.window?.addContentView(itemView, layoutParams)
val bottomSheet =
bottomSheet =
(it as BottomSheetDialog).findViewById<View>(com.google.android.material.R.id.design_bottom_sheet) as FrameLayout?
behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior?.peekHeight = (resources.displayMetrics.heightPixels * 0.7F).roundToInt()
if (jumpUrl?.contains("payPage=1")){
//支付70%高度
setMaxHeight(RxImageTool.dp2px(495f))
}else{
setMaxHeight(resources.displayMetrics.heightPixels)
}
//true是跳过peekHeight,直接滑下去,false是可以滑动到顶部还可以保持peekHeight在滑下去
// behavior?.skipCollapsed=true
behavior?.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
......@@ -242,7 +252,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
return dialog
}
private fun setMaxHeight(height : Int){
bottomSheet?.layoutParams?.height = height
bottomSheet?.requestLayout()
}
private fun callJsFun(wv_content: ProgressWebView, funcName: String) {
val sb = StringBuffer("javascript:")
sb.append(funcName)
......@@ -287,10 +300,8 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
private fun webViewInit(wv_content: ProgressWebView) {
val setting: WebSettings = wv_content?.settings!!
//支持js
//支持js
setting.setJavaScriptEnabled(true)
//设置字符编码
//设置字符编码
setting.setDefaultTextEncodingName("GBK")
setting.setDomStorageEnabled(true)
val appCachePath: String = context?.getCacheDir()?.getAbsolutePath().toString()
......
......@@ -220,7 +220,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
}
private fun showDoctorDetail(confideId: String,doctorId:String) {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId)
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId)+"&payPage=1"
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(this@ConfideHomeActivity, url, doctorId)
}
......
......@@ -60,7 +60,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
)
if (!item.confideId.isNullOrBlank()) {
ConfideWebServiceImpl().connectionJava(item.confideId!!.toInt(), 3, it.context as Activity, null) {
showDoctorDetail(item)
showDoctorDetail(item,true)
}
}
// showDoctorDetail(item)
......@@ -102,7 +102,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item.confideId ?: "",
"4"
)
showDoctorDetail(item)
showDoctorDetail(item,false)
}
binding.ivAvatar.setOnClickListener {
ActionCountUtils.record(
......@@ -118,7 +118,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
item.confideId ?: "",
"3"
)
showDoctorDetail(item)
showDoctorDetail(item,false)
}
binding.vDisableClick.setOnClickListener { }
binding.btnShare.setOnClickListener {
......@@ -278,9 +278,9 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
disposable?.dispose()
}
private fun showDoctorDetail(item: VideoViewModel) {
private fun showDoctorDetail(item: VideoViewModel,toPay:Boolean) {
item.confideId?.let {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it)
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it)+ if(toPay) "&payPage=1" else ""
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(itemView.context as FragmentActivity, url, item.doctorId!!)
}
......
......@@ -466,7 +466,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultPerfectData.class, MsgViewHolderPerfectConsultData.class);//完善咨询资料提醒消息
NimUIKit.registerMsgItemViewHolder(CustomAttachPleaseSubscribeConsultDate.class, MsgViewHolderPleaseSubscribeConsultDate.class);//请预约咨询时间
NimUIKit.registerMsgItemViewHolder(CustomCustomerServiceCardAttachment.class, MsgViewHolderCustomerServiceCard.class);//客服小壹名片
NimUIKit.registerMsgItemViewHolder(CustomAttachmentShareMsg.class, MsgViewHolderShareMsg.class);//分享推送
NimUIKit.registerMsgItemViewHolder(CustomAttachmentShareMsg.class, MsgViewHolderShareMsg.class);//分享推送30
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultCallStatus.class, MsgViewHolderConsultCallStatus.class);//咨询声网的拨打状态 32
NimUIKit.registerMsgItemViewHolder(CustomAttachAssistantReceivedMoney.class, MsgViewHolderAssistantReceivedMoney.class);
NimUIKit.registerMsgItemViewHolder(CustomAttachmentBusinessCard.class, MsgViewHolderBusinessCard.class);//专家自定义名片 ,TYPE=34
......
package com.yidianling.im.session.viewholder;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
......@@ -52,14 +51,11 @@ public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase {
typeImageRight.setVisibility(View.VISIBLE);
}
if (TextUtils.equals("1", customAttachTipMsg.getStatus())) {
statusLabel.setText(customAttachTipMsg.getDuration());
if (isReceivedMessage()) {
statusLabel.setText(customAttachTipMsg.getCallee());
} else {
if (isReceivedMessage()) {
statusLabel.setText(customAttachTipMsg.getCallee());
} else {
statusLabel.setText(customAttachTipMsg.getCaller());
}
statusLabel.setText(customAttachTipMsg.getCaller());
}
//只有倾诉加角标,咨询不加
if (!"true".equals(customAttachTipMsg.getIsConsultOrder())) {
......
......@@ -8,6 +8,7 @@
<TextView
android:padding="12dp"
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -20,9 +21,9 @@
android:id="@+id/message_layout"
android:layout_width="match_parent"
android:layout_height="88dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_below="@+id/tv_title"
android:layout_marginTop="10dp"
android:layout_marginBottom="11dp"
android:background="@drawable/im_bg_push_confide_content"
android:orientation="vertical"
android:padding="10dp">
......@@ -103,15 +104,15 @@
android:layout_below="@+id/message_layout"
android:layout_alignLeft="@+id/message_layout"
android:layout_weight="1"
android:padding="12dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:includeFontPadding="false"
android:text="¥"
android:textSize="8sp"
android:textStyle="bold" />
......
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