Commit ddb1c4a8 by yang.kai

feat: 无可用时间ui调整,增加埋点

parent d0eee34e
......@@ -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());
......
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.04",
"m-user" : "0.0.61.82",
"m-home" : "0.0.22.84",
"m-im" : "0.0.20.07",
"m-im" : "0.0.20.75",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10",
......@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.50",
"ydl-platform" : "0.0.40.64",
//第二步 若干
"ydl-webview" : "0.0.38.47",
......@@ -93,7 +93,7 @@ ext {
"m-fm" : "0.0.30.07",
"m-user" : "0.0.61.82",
"m-home" : "0.0.22.83",
"m-im" : "0.0.20.07",
"m-im" : "0.0.20.75",
"m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.8",
......@@ -115,7 +115,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.50",
"ydl-platform" : "0.0.40.64",
//第二步 若干
"ydl-webview" : "0.0.38.47",
......
......@@ -866,10 +866,17 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
mHandler.sendEmptyMessageDelayed(1, 1000);
}
boolean isBusy = false; // 是否繁忙
//初始化聊天顶部快捷菜单
@SuppressLint("CheckResult")
private void initMenu() {
ServiceImpl.Companion.getInstance().queryDoctorIsBusy(ActionHandlerStorage.getL(sessionId).getInfo().doctorId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
isBusy = res.data;
}, throwable -> {
});
rela_zixun.setOnClickListener(view -> {
if (sessionId != null && ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
if (expertConsultServiceListDialog == null) {
......@@ -879,7 +886,7 @@ 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);
expertConsultServiceListDialog = new ExpertConsultServiceListDialog(getActivity(), res.data,isBusy,sessionId);
expertConsultServiceListDialog.show();
}
} else {
......
......@@ -78,6 +78,11 @@ interface ServiceApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun serviceList(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<List<ServiceItemBean>>>
//查询咨询师是否在繁忙状态
@GET("counselor/doctor/v1/doctor/isBusy")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun queryDoctorIsBusy(@Query("id") doctorId: String): Observable<BaseAPIResponse<Boolean>>
//获取输入框的hint内容
@GET("systemconfig/get-chat-view-config")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
......
......@@ -118,6 +118,13 @@ class ServiceImpl private constructor() {
}
/**
* 查询咨询师是否在繁忙状态
*/
fun queryDoctorIsBusy(doctorId: String): Observable<BaseAPIResponse<Boolean>>{
return YDLHttpUtils.obtainApi(ServiceApi::class.java).queryDoctorIsBusy(doctorId)
}
/**
* 获取输入框的hint内容
*/
fun getChatViewConfig(): Observable<BaseAPIResponse<SystemInfoBean>> {
......
......@@ -6,4 +6,5 @@ interface ConsultServiceViewCallback {
fun onCloseClick() {}//关闭按钮点击
fun onBackClick() {}//返回列表点击
fun onItemClick(serviceId: ServiceItemBean.ProductsBean) {} //服务列表点击
fun addTime(){} // 提醒添加时间点击
}
\ No newline at end of file
......@@ -10,8 +10,10 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.config.GlobalConfig
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.GlobalInfo
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.im.R
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage
import com.yidianling.uikit.custom.http.response.ServiceItemBean
import com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback
import kotlinx.android.synthetic.main.im_expert_consult_service_detail_view.view.*
......@@ -19,14 +21,18 @@ import kotlinx.android.synthetic.main.im_expert_consult_service_detail_view.view
class ExpertConsultServiceDetailView : RelativeLayout {
constructor(context: Context, listener: ConsultServiceViewCallback) : super(context) {
constructor(context: Context, listener: ConsultServiceViewCallback,isBusy:Boolean,toUid:String) : super(context) {
mListener = listener
mContext = context
mIsBusy = isBusy
mToUid = toUid
initView()
}
private var mListener: ConsultServiceViewCallback? = null
private var mContext: Context? = null
private var mIsBusy:Boolean = false
private var mToUid:String = ""
private fun initView() {
......@@ -128,8 +134,18 @@ class ExpertConsultServiceDetailView : RelativeLayout {
}
consult_service_service_type.text = serviceTypeStr.toString()
if (mIsBusy){
consult_service_btn.background.alpha = 200
}
consult_service_btn.setOnClickListener {
NewH5Activity.start(mContext, H5Params(HttpConfig.MH5_URL + "consult/#/pages/DownOrder/DownOrder?product_id=" + bean.productDto.id, null))
if (mIsBusy){
// 埋点
ActionCountUtils.baiDuCountSign3("ydl_user_product_page","reserve_now_click",mToUid, ActionHandlerStorage.getL(mToUid).info.name,"1")
}else{
// 埋点
ActionCountUtils.baiDuCountSign3("ydl_user_product_page","reserve_now_click",mToUid, ActionHandlerStorage.getL(mToUid).info.name,"0")
NewH5Activity.start(mContext, H5Params(HttpConfig.MH5_URL + "consult/#/pages/DownOrder/DownOrder?product_id=" + bean.productDto.id, null))
}
}
}
......
......@@ -15,15 +15,17 @@ import kotlinx.android.synthetic.main.im_expert_consult_service_item_view.view.*
class ExpertConsultServiceItemView : LinearLayout {
constructor(context: Context, listener: ConsultServiceViewCallback?) : super(context) {
constructor(context: Context, listener: ConsultServiceViewCallback?,isBusy:Boolean) : super(context) {
mListener = listener
mContext = context
mIsBusy = isBusy
initView()
}
private var mContext: Context? = null
private var mListener: ConsultServiceViewCallback? = null
private var mIsBusy:Boolean = false
private fun initView() {
......@@ -47,6 +49,16 @@ class ExpertConsultServiceItemView : LinearLayout {
*/
@SuppressLint("SetTextI18n")
fun setData(bean: ServiceItemBean.ProductsBean) {
if (mIsBusy){ // 是否繁忙 true繁忙
ll_not_busy.visibility = View.GONE
ll_busy.visibility = View.VISIBLE
tv_add.setOnClickListener {
mListener?.addTime()
}
}else{
ll_not_busy.visibility = View.VISIBLE
ll_busy.visibility = View.GONE
}
//是否是套餐
if (bean.productDto.isPackage == 2) {
//展示左上角套餐布局
......
package com.yidianling.uikit.custom.widget.expertConsultService.view
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import androidx.viewpager.widget.PagerAdapter
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.view.animation.TranslateAnimation
import android.widget.LinearLayout
import android.widget.ScrollView
import androidx.viewpager.widget.PagerAdapter
import com.netease.nimlib.sdk.NIMClient
import com.netease.nimlib.sdk.RequestCallback
import com.netease.nimlib.sdk.msg.MessageBuilder
import com.netease.nimlib.sdk.msg.MsgService
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachSubScriptTime
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage
import com.yidianling.uikit.custom.http.response.ServiceItemBean
import com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback
import kotlinx.android.synthetic.main.im_expert_consult_service_list_dialog_layout.*
......@@ -23,8 +27,10 @@ import kotlinx.android.synthetic.main.im_expert_consult_service_list_dialog_layo
/**
* 专家咨询服务列表弹框
* Created by xj on 2019/8/7.
*
* @param mIsBusy 咨询师是否是繁忙状态
*/
class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<ServiceItemBean>): Dialog(mContext, R.style.dialog_default_style) {
class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<ServiceItemBean>,val mIsBusy: Boolean,val toUid:String): Dialog(mContext, R.style.dialog_default_style) {
private var mConsultServiceListView: ExpertConsultServiceView? = null
private var mConsultServiceDetailView: ExpertConsultServiceDetailView? = null
......@@ -66,7 +72,30 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
}
}
})
override fun addTime() { // 提醒添加时间回调
// 发送提醒消息
val customTime = CustomAttachSubScriptTime("请尽快添加可预约时间")
val message = MessageBuilder.createCustomMessage(toUid, SessionTypeEnum.P2P, "请尽快添加可预约时间", customTime)
NIMClient.getService(MsgService::class.java).sendMessage(message, false).setCallback(object :
RequestCallback<Void> {
override fun onSuccess(param: Void?) {
MessageListPanelHelper.getInstance().notifyAddMessage(message)
}
override fun onException(exception: Throwable?) {
}
override fun onFailed(code: Int) {
}
})
// 埋点
ActionCountUtils.baiDuCountSign3("ydl_user_product_page","remind_add_click",toUid,ActionHandlerStorage.getL(toUid).info.name,"")
dismiss()
}
},mIsBusy)
mViewList.add(mConsultServiceListView as View)
......@@ -76,7 +105,7 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
override fun onBackClick() {
dialog_bottom_scroll_view.currentItem = 0
}
})
},mIsBusy,toUid)
mViewList.add(mConsultServiceDetailView as View)
......
......@@ -17,6 +17,7 @@ class ExpertConsultServiceView : LinearLayout {
private var mServiceList: ArrayList<ServiceItemBean> = ArrayList()
private var mListener: ConsultServiceViewCallback? = null
private var mIsBusy = false
val mCompare: Comparator<ServiceItemBean.ProductsBean> = Comparator { o1, o2 ->
val res = o1.productDto.sortOrder.compareTo(o2.productDto.sortOrder)
......@@ -72,10 +73,11 @@ class ExpertConsultServiceView : LinearLayout {
fun setDataAndClick(
typeList: ArrayList<String>,
allServiceList: List<ServiceItemBean>,
listener: ConsultServiceViewCallback?
listener: ConsultServiceViewCallback?,
isBusy:Boolean
) {
mListener = listener
mIsBusy = isBusy
consult_service_dialog_close.setOnClickListener {
mListener?.onCloseClick()
}
......@@ -131,7 +133,7 @@ class ExpertConsultServiceView : LinearLayout {
sortedList.sortedWith(mCompare).forEach {
val item = ExpertConsultServiceItemView(mContext!!, mListener)
val item = ExpertConsultServiceItemView(mContext!!, mListener,mIsBusy)
item.setData(it)
expert_consult_service_service_list.addView(item)
}
......
......@@ -121,34 +121,68 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|center"
android:paddingLeft="31dp"
android:paddingRight="18dp"
android:orientation="vertical">
<TextView
android:id="@+id/im_expert_service_list_btn"
android:layout_width="68dp"
android:layout_height="27dp"
android:background="@drawable/im_expert_service_list_btn_bg"
android:gravity="center"
android:text="预约"
android:textColor="#ffffff"
android:textSize="14dp"
android:textStyle="bold" />
android:layout_height="match_parent">
<TextView
android:id="@+id/service_item_saleout_num"
<LinearLayout
android:id="@+id/ll_not_busy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="销量0"
android:textColor="#999999"
android:textSize="10dp" />
</LinearLayout>
android:layout_height="match_parent"
android:gravity="center_vertical|center"
android:paddingLeft="31dp"
android:paddingRight="18dp"
android:visibility="gone"
tools:visibility="visible"
android:orientation="vertical">
<TextView
android:id="@+id/im_expert_service_list_btn"
android:layout_width="68dp"
android:layout_height="27dp"
android:background="@drawable/im_expert_service_list_btn_bg"
android:gravity="center"
android:text="预约"
android:textColor="#ffffff"
android:textSize="14dp"
android:textStyle="bold" />
<TextView
android:id="@+id/service_item_saleout_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="销量0"
android:textColor="#999999"
android:textSize="10dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_busy"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingRight="18dp"
android:gravity="center"
android:visibility="gone"
tools:visibility="visible"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="预约时间已满" />
<TextView
android:id="@+id/tv_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="@color/platform_color_1DA1F2"
android:text="提醒添加" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
......@@ -359,6 +359,52 @@ class ActionCountUtils {
request(actionDataParams.build())
}
/**
* 埋点,3个参数
* @param partId
* @param position
* @param sign1
* @param sign2
* @param sign3
*/
fun baiDuCountSign3(
partId: String,
position: String,
sign1: String,
sign2: String,
sign3: String
) {
val actionDataParams = ActionDataBean.Builder()
actionDataParams.partId = partId
actionDataParams.position = position
actionDataParams.sign1 = sign1
actionDataParams.sign2 = sign2
actionDataParams.sign3 = sign3
actionDataParams.appVersion(RxDeviceTool.getAppVersionName(BaseApp.getApp()))
val deviceId = if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
val topTaskActivity = ActivityManager.getInstance().getTopTaskActivity()
//获取imei
Utils.getIMEI(topTaskActivity)
} else {
//android Q及以上取oaid
DeviceIDHelper.getInstance().deviceId
}
actionDataParams.deviceId=deviceId
actionDataParams.time(System.currentTimeMillis())
actionDataParams.appId(appId)
actionDataParams.manufacturer(Build.BRAND.trim().toUpperCase())
actionDataParams.model(Build.MODEL)
actionDataParams.os(BIConstants.OS)
actionDataParams.osVersion(Build.VERSION.RELEASE)
actionDataParams.wifi(if (isWifi()) 0 else 1)
actionDataParams.uid = ModularServiceManager.getPlatformUserService()!!.getUser()?.userId
//请求
request(actionDataParams.build())
}
/**
* 传入ActionDataParams参数,访问接口
*/
......
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