Commit b9f2201e by konghaorui

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

parent 0052a112
......@@ -16,7 +16,9 @@ import com.yidianling.user.UserHelper
*/
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
constructor(listener: WebViewClientClickListener) : super() {
......
......@@ -47,11 +47,11 @@ ext {
"m-fm" : "0.0.29.2",
"m-user" : "0.0.59.17",
"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-muse" : "0.0.28.8",
"m-tests" : "0.0.23.10",
"m-tests" : "0.0.23.11",
"m-course" : "0.0.41.10",
//-------------- 业务模块 API 层 --------------
......@@ -72,7 +72,7 @@ ext {
"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-pay" : "0.0.18.5",
"m-audioim" : "0.0.48.0",
......@@ -118,7 +118,7 @@ ext {
"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-pay" : "0.0.18.4",
"m-audioim" : "0.0.48.0",
......
......@@ -15,7 +15,7 @@ public class FinalString {
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 = "电话连接需要绑定手机哦~";
......
......@@ -150,8 +150,8 @@ open class HomeBaseImpl : IHomeBaseEvent {
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_TELEPHONE_CUSTOMER_SERVICE_CLICK)
val tel =
if (PlatformRamImpl.getInstance().getGlobalInfo() == null) "400-114-1010'" else PlatformRamImpl.getInstance().getGlobalInfo()!!.info.tel
var con = "\n400-114-1010\n早8:30-凌晨2:00"
if (PlatformRamImpl.getInstance().getGlobalInfo() == null) "400-765-1010" else PlatformRamImpl.getInstance().getGlobalInfo()!!.info.tel
var con = "\n400-765-1010\n早8:30-凌晨2:00"
if (PlatformRamImpl.getInstance().getGlobalInfo() != null && PlatformRamImpl.getInstance().getGlobalInfo()!!.info != null) {
con =
PlatformRamImpl.getInstance().getGlobalInfo()?.info?.tel + "\n" + PlatformRamImpl.getInstance().getGlobalInfo()?.info?.work_time
......
......@@ -899,9 +899,9 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
private void showCallDialog() {
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) {
con = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.tel + "\n" + PlatformDataManager.INSTANCE.getRam().getGlobalInfo() .info.work_time;
......
......@@ -38,7 +38,7 @@ class ImConstants {
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 = "电话连接需要绑定手机哦~"
......
......@@ -4,6 +4,7 @@ import android.content.Context
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
......@@ -206,11 +207,10 @@ class ImCommentBannerView : LinearLayout {
//获取经过加密的名字 : 徐**
private fun getName(name: String?): String {
var nameBuffer = StringBuffer()
name?.let {
if (name!=null&&!TextUtils.isEmpty(name)){
nameBuffer.append(name[0])
nameBuffer.append("**:")
}
nameBuffer.append("**:")
return nameBuffer.toString()
}
......
......@@ -56,11 +56,11 @@ interface TestRetrofitApi {
fun fetchTopSearch(): Observable<BaseAPIResponse<MutableList<RecommendSearchItemBean>>>
//获取测试列表 - NEW
@GET("test-item/list-by-newTag")
@GET("test-item/list-by-cate")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun fetchTestListByTag(
//测试标签ID
@Query("testTagId") testTagId:String,
@Query("testCateId") testTagId:String,
//筛选条件免费付费 2免费 3付费
@Query("testPrice") testPrice:String = "",
//筛选条件测试人数 条件4
......
......@@ -35,7 +35,7 @@ public class ContactCustomerServiceActivity extends BaseActivity {
TextView tvServiceTime;
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;
private RxPermissions rxPermissions;
......@@ -58,7 +58,7 @@ public class ContactCustomerServiceActivity extends BaseActivity {
jtv_wechat = findViewById(R.id.jtv_wechat);
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) {
con = PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.tel + "\n" + PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time;
......
......@@ -55,7 +55,7 @@ class FeedBackActivity : BaseActivity(), View.OnClickListener {
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 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 {
return StatusBarOptions(true, true)
}
......
......@@ -23,7 +23,7 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att
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 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 {
View.inflate(mContext, R.layout.platform_ui_new_more, this)
......
......@@ -8,14 +8,15 @@ import android.view.WindowManager;
import android.widget.PopupWindow;
import com.ydl.view.MoreClickView;
import com.ydl.webview.IJavascriptHandler;
/**
* Created by Wi1ls on 2016/10/17;
*/
public class PopUtils {
public static PopupWindow showMoreItem(Context context, View view, int offX, int offY){
MoreClickView v= new MoreClickView(context);
public static PopupWindow showMoreItem(Context context, View view, IJavascriptHandler jtoJHandle){
MoreClickView v= new MoreClickView(context,jtoJHandle);
WindowManager windowManager= (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
final PopupWindow popupWindow=new PopupWindow(v, windowManager.getDefaultDisplay().getWidth(),
......
......@@ -72,7 +72,7 @@ public class WebUrlParamsUtils {
Map<String, String> map = new HashMap<>();
try {
if (url != null && !url.trim().equals("")) {
if (url.contains("?")) {
if (url.contains("?")||url.contains("&")) {
if (!url.endsWith("?")) {
//?号结尾表示没有参数
//有参数 取出所有参数加签
......
......@@ -4,10 +4,10 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import android.widget.PopupWindow
import android.widget.RelativeLayout
import com.ydl.webview.IJavascriptHandler
import com.ydl.webview.R
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
......@@ -19,26 +19,40 @@ import kotlinx.android.synthetic.main.web_ui_new_more.view.*
/**
* 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 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 {
View.inflate(mContext, R.layout.web_ui_new_more, this)
View.inflate(context, R.layout.web_ui_new_more, this)
init()
}
internal fun init() {
fl_main.setOnClickListener(this)
more_msg.setOnClickListener(this)
more_homepage.setOnClickListener(this)
more_service.setOnClickListener(this)
more_ray.setOnClickListener(this)
if(mJtoJHandle?.setMoreMsg()!=null){
more_msg.setOnClickListener(mJtoJHandle?.setMoreMsg())
}else{
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()) {
msg_new.setVisibility(View.VISIBLE)
} else {
......@@ -67,10 +81,18 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att
when (view.id) {
R.id.fl_main -> {
}
R.id.more_msg -> setMoreMsg()
R.id.more_homepage -> setMoreHomePage()
R.id.more_service -> setMoreService()
R.id.more_ray -> setMoreRay()
R.id.more_msg -> {
setMoreMsg()
}
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
private fun setMoreRay() {
CommonDialog(context)
.setMessage("欢迎致电壹点灵客服热线\n" + PlatformDataManager.getRam().getGlobalInfo()?.info?.tel + "\n服务时间:" + work_time)
.setMessage("欢迎致电壹点灵客服热线\n$tel\n服务时间:$work_time")
.setLeftOnclick("取消", null)
.setRightClick("拨打") {
if (null != tel && !TextUtils.isEmpty(tel)) {
......
package com.ydl.webview
import android.view.View
/**
* update by harvie on 2017/7/04
*/
......@@ -10,4 +12,18 @@ open class IJavascriptHandler {
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 {
public void openRightTopMenu() {
popupWindow = PopUtils.showMoreItem(this,
tb_title.getRootView(), 0, 0);
tb_title.getRootView(), jtoJHandle);
}
public void openShareMenu(H5JsBean.H5JsCmd.Params params) {
......@@ -589,7 +589,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
//要加"more"按钮
if (h5Params.isShowMenu()) {
tb_title.setRightImageListener(v -> popupWindow = PopUtils.showMoreItem(this,
tb_title.getRootView(), 0, 0));
tb_title.getRootView(), jtoJHandle));
tb_title.setRightImageIfShouldSee();
} else {
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