Commit b9f2201e by konghaorui

添加H5页面更多按钮点击回调、更换测评分类列表接口

parent 0052a112
...@@ -16,7 +16,9 @@ import com.yidianling.user.UserHelper ...@@ -16,7 +16,9 @@ import com.yidianling.user.UserHelper
*/ */
class WebJavascriptHandler : IJavascriptHandler{ class WebJavascriptHandler : IJavascriptHandler{
override fun getUriAppendSuffix(): String {
return "platform_main_theme=00C9E2&platform_main_theme_light=00D4DF&platform_main_theme_bright=EAFAFC"
}
var wvEnventPro: WebViewClientClickListener? = null var wvEnventPro: WebViewClientClickListener? = null
constructor(listener: WebViewClientClickListener) : super() { constructor(listener: WebViewClientClickListener) : super() {
......
...@@ -47,11 +47,11 @@ ext { ...@@ -47,11 +47,11 @@ ext {
"m-fm" : "0.0.29.2", "m-fm" : "0.0.29.2",
"m-user" : "0.0.59.17", "m-user" : "0.0.59.17",
"m-home" : "0.0.20.3", "m-home" : "0.0.20.3",
"m-im" : "0.0.16.1", "m-im" : "0.0.16.5",
"m-dynamic" : "0.0.7.4", "m-dynamic" : "0.0.7.4",
"m-muse" : "0.0.28.8", "m-muse" : "0.0.28.8",
"m-tests" : "0.0.23.10", "m-tests" : "0.0.23.11",
"m-course" : "0.0.41.10", "m-course" : "0.0.41.10",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
...@@ -72,7 +72,7 @@ ext { ...@@ -72,7 +72,7 @@ ext {
"ydl-platform" : "0.0.39.10", "ydl-platform" : "0.0.39.10",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.11", "ydl-webview" : "0.0.38.13",
"ydl-media" : "0.0.21.3", "ydl-media" : "0.0.21.3",
"ydl-pay" : "0.0.18.5", "ydl-pay" : "0.0.18.5",
"m-audioim" : "0.0.48.0", "m-audioim" : "0.0.48.0",
...@@ -118,7 +118,7 @@ ext { ...@@ -118,7 +118,7 @@ ext {
"ydl-platform" : "0.0.39.9", "ydl-platform" : "0.0.39.9",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.11", "ydl-webview" : "0.0.38.12",
"ydl-media" : "0.0.21.3", "ydl-media" : "0.0.21.3",
"ydl-pay" : "0.0.18.4", "ydl-pay" : "0.0.18.4",
"m-audioim" : "0.0.48.0", "m-audioim" : "0.0.48.0",
......
...@@ -15,7 +15,7 @@ public class FinalString { ...@@ -15,7 +15,7 @@ public class FinalString {
public static final String MESSAGE_IN_NUM="请注意自我保护!向陌生人发送联系方式,隐私存在被传播泄漏风险,平台内所有联系方式均对双方匿名显示"; public static final String MESSAGE_IN_NUM="请注意自我保护!向陌生人发送联系方式,隐私存在被传播泄漏风险,平台内所有联系方式均对双方匿名显示";
public static final String CALL_PHONE = "\n400-114-1010\n(服务时间 早8:30-凌晨2:00)"; public static final String CALL_PHONE = "\n400-765-1010\n(服务时间 早8:30-凌晨2:00)";
//连接倾听未绑定手机提示 //连接倾听未绑定手机提示
public static final String TEL_BINDPHONE = "电话连接需要绑定手机哦~"; public static final String TEL_BINDPHONE = "电话连接需要绑定手机哦~";
......
...@@ -150,8 +150,8 @@ open class HomeBaseImpl : IHomeBaseEvent { ...@@ -150,8 +150,8 @@ open class HomeBaseImpl : IHomeBaseEvent {
} }
ActionCountUtils.count(HomeBIConstants.YDL_USER_TELEPHONE_CUSTOMER_SERVICE_CLICK) ActionCountUtils.count(HomeBIConstants.YDL_USER_TELEPHONE_CUSTOMER_SERVICE_CLICK)
val tel = val tel =
if (PlatformRamImpl.getInstance().getGlobalInfo() == null) "400-114-1010'" else PlatformRamImpl.getInstance().getGlobalInfo()!!.info.tel if (PlatformRamImpl.getInstance().getGlobalInfo() == null) "400-765-1010" else PlatformRamImpl.getInstance().getGlobalInfo()!!.info.tel
var con = "\n400-114-1010\n早8:30-凌晨2:00" var con = "\n400-765-1010\n早8:30-凌晨2:00"
if (PlatformRamImpl.getInstance().getGlobalInfo() != null && PlatformRamImpl.getInstance().getGlobalInfo()!!.info != null) { if (PlatformRamImpl.getInstance().getGlobalInfo() != null && PlatformRamImpl.getInstance().getGlobalInfo()!!.info != null) {
con = con =
PlatformRamImpl.getInstance().getGlobalInfo()?.info?.tel + "\n" + PlatformRamImpl.getInstance().getGlobalInfo()?.info?.work_time PlatformRamImpl.getInstance().getGlobalInfo()?.info?.tel + "\n" + PlatformRamImpl.getInstance().getGlobalInfo()?.info?.work_time
......
...@@ -899,9 +899,9 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler { ...@@ -899,9 +899,9 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
private void showCallDialog() { private void showCallDialog() {
try { try {
final String tel = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "400-114-1010'" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.tel; final String tel = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "400-765-1010" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.tel;
String con = "\n400-114-1010\n早8:30-凌晨2:00"; String con = "\n400-765-1010\n早8:30-凌晨2:00";
if (PlatformDataManager.INSTANCE.getRam().getGlobalInfo() != null && PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info != null) { if (PlatformDataManager.INSTANCE.getRam().getGlobalInfo() != null && PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info != null) {
con = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.tel + "\n" + PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.work_time; con = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.tel + "\n" + PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.work_time;
......
...@@ -38,7 +38,7 @@ class ImConstants { ...@@ -38,7 +38,7 @@ class ImConstants {
const val MESSAGE_IN_NUM = "请注意自我保护!向陌生人发送联系方式,隐私存在被传播泄漏风险,平台内所有联系方式均对双方匿名显示" const val MESSAGE_IN_NUM = "请注意自我保护!向陌生人发送联系方式,隐私存在被传播泄漏风险,平台内所有联系方式均对双方匿名显示"
const val CALL_PHONE = "\n400-114-1010\n(服务时间 早8:30-凌晨2:00)" const val CALL_PHONE = "\n400-765-1010\n(服务时间 早8:30-凌晨2:00)"
//连接倾听未绑定手机提示 //连接倾听未绑定手机提示
const val TEL_BINDPHONE = "电话连接需要绑定手机哦~" const val TEL_BINDPHONE = "电话连接需要绑定手机哦~"
......
...@@ -4,6 +4,7 @@ import android.content.Context ...@@ -4,6 +4,7 @@ import android.content.Context
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.os.Message import android.os.Message
import android.text.TextUtils
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
...@@ -206,11 +207,10 @@ class ImCommentBannerView : LinearLayout { ...@@ -206,11 +207,10 @@ class ImCommentBannerView : LinearLayout {
//获取经过加密的名字 : 徐** //获取经过加密的名字 : 徐**
private fun getName(name: String?): String { private fun getName(name: String?): String {
var nameBuffer = StringBuffer() var nameBuffer = StringBuffer()
name?.let { if (name!=null&&!TextUtils.isEmpty(name)){
nameBuffer.append(name[0]) nameBuffer.append(name[0])
nameBuffer.append("**:")
} }
nameBuffer.append("**:")
return nameBuffer.toString() return nameBuffer.toString()
} }
......
...@@ -56,11 +56,11 @@ interface TestRetrofitApi { ...@@ -56,11 +56,11 @@ interface TestRetrofitApi {
fun fetchTopSearch(): Observable<BaseAPIResponse<MutableList<RecommendSearchItemBean>>> fun fetchTopSearch(): Observable<BaseAPIResponse<MutableList<RecommendSearchItemBean>>>
//获取测试列表 - NEW //获取测试列表 - NEW
@GET("test-item/list-by-newTag") @GET("test-item/list-by-cate")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun fetchTestListByTag( fun fetchTestListByTag(
//测试标签ID //测试标签ID
@Query("testTagId") testTagId:String, @Query("testCateId") testTagId:String,
//筛选条件免费付费 2免费 3付费 //筛选条件免费付费 2免费 3付费
@Query("testPrice") testPrice:String = "", @Query("testPrice") testPrice:String = "",
//筛选条件测试人数 条件4 //筛选条件测试人数 条件4
......
...@@ -35,7 +35,7 @@ public class ContactCustomerServiceActivity extends BaseActivity { ...@@ -35,7 +35,7 @@ public class ContactCustomerServiceActivity extends BaseActivity {
TextView tvServiceTime; TextView tvServiceTime;
String work_time = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "早8:30-凌晨2:00" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time; String work_time = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "早8:30-凌晨2:00" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time;
final String tel = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "400-114-1010'" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.tel; final String tel = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "400-765-1010" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.tel;
String wechatAccount = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? " xinliyidianling" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.wechatAccount; String wechatAccount = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? " xinliyidianling" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.wechatAccount;
private RxPermissions rxPermissions; private RxPermissions rxPermissions;
...@@ -58,7 +58,7 @@ public class ContactCustomerServiceActivity extends BaseActivity { ...@@ -58,7 +58,7 @@ public class ContactCustomerServiceActivity extends BaseActivity {
jtv_wechat = findViewById(R.id.jtv_wechat); jtv_wechat = findViewById(R.id.jtv_wechat);
jtv_custom_service.setOnClickListener(v -> { jtv_custom_service.setOnClickListener(v -> {
String con = "\n400-114-1010\n(服务时间 早8:30-凌晨2:00)"; String con = "\n400-765-1010\n(服务时间 早8:30-凌晨2:00)";
if (PlatformDataManager.INSTANCE.getRam().getGlobalInfo() != null && PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info != null) { if (PlatformDataManager.INSTANCE.getRam().getGlobalInfo() != null && PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info != null) {
con = PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.tel + "\n" + PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time; con = PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.tel + "\n" + PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time;
......
...@@ -55,7 +55,7 @@ class FeedBackActivity : BaseActivity(), View.OnClickListener { ...@@ -55,7 +55,7 @@ class FeedBackActivity : BaseActivity(), View.OnClickListener {
private var imgFiles: MutableList<File>? = null private var imgFiles: MutableList<File>? = null
internal var work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time internal var work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
internal var tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010'" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel internal var tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
override fun getStatusViewOptions(): StatusBarOptions { override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true, true) return StatusBarOptions(true, true)
} }
......
...@@ -23,7 +23,7 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att ...@@ -23,7 +23,7 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att
private var mPopupWindow: PopupWindow? = null private var mPopupWindow: PopupWindow? = null
private val work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time private val work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
private val tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-114-1010'" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel private val tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
init { init {
View.inflate(mContext, R.layout.platform_ui_new_more, this) View.inflate(mContext, R.layout.platform_ui_new_more, this)
......
...@@ -8,14 +8,15 @@ import android.view.WindowManager; ...@@ -8,14 +8,15 @@ import android.view.WindowManager;
import android.widget.PopupWindow; import android.widget.PopupWindow;
import com.ydl.view.MoreClickView; import com.ydl.view.MoreClickView;
import com.ydl.webview.IJavascriptHandler;
/** /**
* Created by Wi1ls on 2016/10/17; * Created by Wi1ls on 2016/10/17;
*/ */
public class PopUtils { public class PopUtils {
public static PopupWindow showMoreItem(Context context, View view, int offX, int offY){ public static PopupWindow showMoreItem(Context context, View view, IJavascriptHandler jtoJHandle){
MoreClickView v= new MoreClickView(context); MoreClickView v= new MoreClickView(context,jtoJHandle);
WindowManager windowManager= (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); WindowManager windowManager= (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
final PopupWindow popupWindow=new PopupWindow(v, windowManager.getDefaultDisplay().getWidth(), final PopupWindow popupWindow=new PopupWindow(v, windowManager.getDefaultDisplay().getWidth(),
......
...@@ -72,7 +72,7 @@ public class WebUrlParamsUtils { ...@@ -72,7 +72,7 @@ public class WebUrlParamsUtils {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
try { try {
if (url != null && !url.trim().equals("")) { if (url != null && !url.trim().equals("")) {
if (url.contains("?")) { if (url.contains("?")||url.contains("&")) {
if (!url.endsWith("?")) { if (!url.endsWith("?")) {
//?号结尾表示没有参数 //?号结尾表示没有参数
//有参数 取出所有参数加签 //有参数 取出所有参数加签
......
...@@ -4,10 +4,10 @@ import android.content.Context ...@@ -4,10 +4,10 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import android.util.AttributeSet
import android.view.View import android.view.View
import android.widget.PopupWindow import android.widget.PopupWindow
import android.widget.RelativeLayout import android.widget.RelativeLayout
import com.ydl.webview.IJavascriptHandler
import com.ydl.webview.R import com.ydl.webview.R
import com.ydl.ydlcommon.data.PlatformDataManager import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
...@@ -19,26 +19,40 @@ import kotlinx.android.synthetic.main.web_ui_new_more.view.* ...@@ -19,26 +19,40 @@ import kotlinx.android.synthetic.main.web_ui_new_more.view.*
/** /**
* Created by Wi1ls on 2016/10/17; * Created by Wi1ls on 2016/10/17;
*/ */
class MoreClickView @JvmOverloads constructor(private val mContext: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : RelativeLayout(mContext, attrs, defStyleAttr), View.OnClickListener { class MoreClickView(context: Context, jtoJHandle: IJavascriptHandler) : RelativeLayout(context), View.OnClickListener {
private var mJtoJHandle: IJavascriptHandler?= jtoJHandle
private var mPopupWindow: PopupWindow? = null private var mPopupWindow: PopupWindow? = null
private val work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time private val work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
private val tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-114-1010'" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel private val tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
init { init {
View.inflate(mContext, R.layout.web_ui_new_more, this) View.inflate(context, R.layout.web_ui_new_more, this)
init() init()
} }
internal fun init() { internal fun init() {
fl_main.setOnClickListener(this) fl_main.setOnClickListener(this)
more_msg.setOnClickListener(this) if(mJtoJHandle?.setMoreMsg()!=null){
more_homepage.setOnClickListener(this) more_msg.setOnClickListener(mJtoJHandle?.setMoreMsg())
more_service.setOnClickListener(this) }else{
more_ray.setOnClickListener(this) more_msg.setOnClickListener(this)
}
if(mJtoJHandle?.setMoreHomePage()!=null){
more_homepage.setOnClickListener(mJtoJHandle?.setMoreHomePage())
}else{
more_homepage.setOnClickListener(this)
}
if(mJtoJHandle?.setMoreService()!=null){
more_service.setOnClickListener(mJtoJHandle?.setMoreService())
}else{
more_service.setOnClickListener(this)
}
if(mJtoJHandle?.setMoreCall()!=null){
more_ray.setOnClickListener(mJtoJHandle?.setMoreCall())
}else{
more_ray.setOnClickListener(this)
}
/* if (YdlCommonRouterManager.getYdlCommonRoute().isHasUnread()) { /* if (YdlCommonRouterManager.getYdlCommonRoute().isHasUnread()) {
msg_new.setVisibility(View.VISIBLE) msg_new.setVisibility(View.VISIBLE)
} else { } else {
...@@ -67,10 +81,18 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att ...@@ -67,10 +81,18 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att
when (view.id) { when (view.id) {
R.id.fl_main -> { R.id.fl_main -> {
} }
R.id.more_msg -> setMoreMsg() R.id.more_msg -> {
R.id.more_homepage -> setMoreHomePage() setMoreMsg()
R.id.more_service -> setMoreService() }
R.id.more_ray -> setMoreRay() R.id.more_homepage -> {
setMoreHomePage()
}
R.id.more_service -> {
setMoreService()
}
R.id.more_ray -> {
setMoreRay()
}
} }
} }
...@@ -93,7 +115,7 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att ...@@ -93,7 +115,7 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att
private fun setMoreRay() { private fun setMoreRay() {
CommonDialog(context) CommonDialog(context)
.setMessage("欢迎致电壹点灵客服热线\n" + PlatformDataManager.getRam().getGlobalInfo()?.info?.tel + "\n服务时间:" + work_time) .setMessage("欢迎致电壹点灵客服热线\n$tel\n服务时间:$work_time")
.setLeftOnclick("取消", null) .setLeftOnclick("取消", null)
.setRightClick("拨打") { .setRightClick("拨打") {
if (null != tel && !TextUtils.isEmpty(tel)) { if (null != tel && !TextUtils.isEmpty(tel)) {
......
package com.ydl.webview package com.ydl.webview
import android.view.View
/** /**
* update by harvie on 2017/7/04 * update by harvie on 2017/7/04
*/ */
...@@ -10,4 +12,18 @@ open class IJavascriptHandler { ...@@ -10,4 +12,18 @@ open class IJavascriptHandler {
return "" return ""
} }
open fun setMoreMsg():View.OnClickListener?{
return null
}
open fun setMoreHomePage():View.OnClickListener?{
return null
}
open fun setMoreService():View.OnClickListener?{
return null
}
open fun setMoreCall():View.OnClickListener?{
return null
}
} }
\ No newline at end of file
...@@ -507,7 +507,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -507,7 +507,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
public void openRightTopMenu() { public void openRightTopMenu() {
popupWindow = PopUtils.showMoreItem(this, popupWindow = PopUtils.showMoreItem(this,
tb_title.getRootView(), 0, 0); tb_title.getRootView(), jtoJHandle);
} }
public void openShareMenu(H5JsBean.H5JsCmd.Params params) { public void openShareMenu(H5JsBean.H5JsCmd.Params params) {
...@@ -589,7 +589,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -589,7 +589,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//要加"more"按钮 //要加"more"按钮
if (h5Params.isShowMenu()) { if (h5Params.isShowMenu()) {
tb_title.setRightImageListener(v -> popupWindow = PopUtils.showMoreItem(this, tb_title.setRightImageListener(v -> popupWindow = PopUtils.showMoreItem(this,
tb_title.getRootView(), 0, 0)); tb_title.getRootView(), jtoJHandle));
tb_title.setRightImageIfShouldSee(); tb_title.setRightImageIfShouldSee();
} else { } else {
tb_title.setRightImageIfNoSee(); tb_title.setRightImageIfNoSee();
......
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