Commit 71169205 by 霍志良

feat:富文本相关标签联调

parent 1d9a3575
......@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
public static String appEnv = YDLConstants.ENV_PROD;
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -916,7 +916,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.subscribe(res -> {
if (res.data != null && res.data.size() > 0) {
if (getActivity() != null && expertConsultServiceListDialog == null) {
expertConsultServiceListDialog = new ExpertConsultServiceListDialog(getActivity(), res.data,isBusy,sessionId);
expertConsultServiceListDialog = new ExpertConsultServiceListDialog(getActivity(), res.data,isBusy,sessionId,
ActionHandlerStorage.getL(sessionId).getInfo().doctorId
);
expertConsultServiceListDialog.show();
}
} else {
......
......@@ -32,7 +32,7 @@ import kotlinx.android.synthetic.main.im_expert_consult_service_list_dialog_layo
*
* @param mIsBusy 咨询师是否是繁忙状态
*/
class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<ServiceItemBean>,val mIsBusy: Boolean,val toUid:String): Dialog(mContext, R.style.dialog_default_style) {
class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<ServiceItemBean>,val mIsBusy: Boolean,val toUid:String,val doctorID:String): Dialog(mContext, R.style.dialog_default_style) {
private var mConsultServiceListView: ExpertConsultServiceView? = null
private var mConsultServiceDetailView: ExpertConsultServiceDetailView? = null
......@@ -70,6 +70,7 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
// mConsultServiceDetailView?.updateData(serviceBean)
// dialog_bottom_scroll_view.currentItem = 1
// }
mWebviewView?.setData(serviceBean)
dialog_bottom_scroll_view.currentItem = 1
}
......@@ -107,7 +108,7 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
},mIsBusy,toUid)
// mViewList.add(mConsultServiceDetailView as View)
mWebviewView=ExpertConsultWebview(mContext)
mWebviewView= ExpertConsultWebview(mContext,doctorID =doctorID )
mViewList.add(mWebviewView as View)
dialog_bottom_scroll_view.adapter = ConsultServicePagerAdapter()
......
......@@ -17,32 +17,42 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.uikit.custom.http.response.ServiceItemBean
import com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback
class ExpertConsultWebview : RelativeLayout {
constructor(context: Context) : super(context) {
private var doctorID: String
private lateinit var productBean: ServiceItemBean.ProductsBean
private var jumpUrl = ""
private lateinit var wv_content:ProgressWebView
constructor(context: Context, doctorID: String) : super(context) {
mContext = context
this.doctorID = doctorID
initView()
}
private var mContext: Context? = null
private fun initView() {
val mWidth: Int = RxDeviceTool.getScreenWidth(mContext)
val mHeight: Int = LayoutParams.MATCH_PARENT
val params = LayoutParams(
mWidth,
mHeight
)
params.height = mHeight
layoutParams = params
var view = View.inflate(mContext, R.layout.im_expert_consult_webview_view, this)
wv_content= view.findViewById<ProgressWebView>(R.id.wv_content)
webViewInit(wv_content, doctorID)
}
var view=View.inflate(mContext, R.layout.im_expert_consult_webview_view, this)
webViewInit(view.findViewById<ProgressWebView>(R.id.wv_content))
fun setData(productBean: ServiceItemBean.ProductsBean) {
this.productBean = productBean
jumpUrl =
HttpConfig.MH5_URL + "wb/product/chat/template?doctorId=${doctorID}{&cateId=634&productId=${productBean.productDto.id}"
wv_content.loadUrl(jumpUrl)
}
private fun shouldOverridePayUrl(view: WebView, url: String): Boolean {
if (url.startsWith("weixin://")) {
return try {
......@@ -100,7 +110,8 @@ class ExpertConsultWebview : RelativeLayout {
}
return false
}
fun webViewInit(wv_content: ProgressWebView) {
fun webViewInit(wv_content: ProgressWebView, doctorID: String) {
val setting: WebSettings = wv_content?.settings!!
//支持js
//支持js
......@@ -121,11 +132,9 @@ class ExpertConsultWebview : RelativeLayout {
.getJavascripHandler(mContext as Activity, tellData = TellData())
wv_content!!.addJavascriptInterface(jtoJHandle, "javascriptHandler")
var jumpurl = HttpConfig.MH5_URL+"wb/product/chat/template?doctorId=${111}{&cateId=634&productId=${111}"
val url = WebUrlParamsUtils.getSuffix(jumpurl, jtoJHandle.getUriAppendSuffix())
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
wv_content.loadUrl(url)
// wv_content.loadUrl(jumpUrl)
wv_content.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(webview: WebView, url: String?): Boolean {
if (url.isNullOrBlank()) return false
......
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