Commit b9b56cc8 by fengquan

Merge remote-tracking branch 'origin/d/v4.3.98' into feat/fq/confide_search

# Conflicts:
#	config.gradle
parents 392d23b1 80e3afd0
...@@ -53,9 +53,6 @@ ...@@ -53,9 +53,6 @@
<meta-data <meta-data
android:name="com.ydl.component.base.DemoGlobalConfig" android:name="com.ydl.component.base.DemoGlobalConfig"
android:value="ModuleConfig" /> android:value="ModuleConfig" />
<meta-data
android:name="com.openinstall.APP_KEY"
android:value="jz0d0s"/>
<activity <activity
android:name="com.tencent.tauth.AuthActivity" android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
......
...@@ -12,10 +12,10 @@ import android.provider.Settings ...@@ -12,10 +12,10 @@ import android.provider.Settings
import android.util.Log import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.fm.openinstall.OpenInstall
import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper
import com.tbruyelle.rxpermissions2.RxPermissions import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent import com.umeng.analytics.MobclickAgent
import com.ydl.audioim.YDLavManager
import com.ydl.component.music.FragmentContainerActivity import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter import com.ydl.component.mvp.DemoPresenter
...@@ -35,6 +35,7 @@ import com.yidianling.muse.helper.MediaPlayerManager ...@@ -35,6 +35,7 @@ import com.yidianling.muse.helper.MediaPlayerManager
import com.yidianling.muse.service.MeditationWindowService import com.yidianling.muse.service.MeditationWindowService
import com.yidianling.tests.home.NewTestHomeActivity import com.yidianling.tests.home.NewTestHomeActivity
import com.yidianling.user.StatusUtils import com.yidianling.user.StatusUtils
import com.yidianling.user.api.service.IUserService
import com.yidianling.user.ui.collect.CollectSexAndBirthActivity import com.yidianling.user.ui.collect.CollectSexAndBirthActivity
import com.yidianling.user.ui.login.OneKeyLoginHelp import com.yidianling.user.ui.login.OneKeyLoginHelp
import com.yidianling.user.widget.SecretDescriptionDialog import com.yidianling.user.widget.SecretDescriptionDialog
...@@ -84,11 +85,12 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -84,11 +85,12 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override fun initDataAndEvent() { override fun initDataAndEvent() {
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
//线上
// YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830") // YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830")
//测试
YDLavManager.instances.init(this, "13b1536698f64905a1e7e5bb978ba821")
YdlCommonRouterManager.initYdlCommonRoute(PlatformTempCommonRouteImpl()) YdlCommonRouterManager.initYdlCommonRoute(PlatformTempCommonRouteImpl())
OpenInstall.init(this);// TODO: 1/29/21 统计渠道测试
StatusUtils.isUseOpenInstall = true
// 初始化一键登录sdk // 初始化一键登录sdk
OneKeyLoginHelp.sdkInit(this, OneKeyLoginHelp.YDL_USER_APP, PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN) OneKeyLoginHelp.sdkInit(this, OneKeyLoginHelp.YDL_USER_APP, PhoneNumberAuthHelper.SERVICE_TYPE_LOGIN)
bindService() bindService()
...@@ -159,7 +161,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -159,7 +161,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
startActivity(Intent(this, CollectSexAndBirthActivity::class.java)) startActivity(Intent(this, CollectSexAndBirthActivity::class.java))
} }
bt_to_confide.setOnClickListener { bt_to_confide.setOnClickListener {
// YDLavManager.instances.login("1193016") YDLavManager.instances.login(ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid)
startActivity(Intent(this, ConfideHomeActivity::class.java)) startActivity(Intent(this, ConfideHomeActivity::class.java))
} }
......
...@@ -20,10 +20,10 @@ import java.util.List; ...@@ -20,10 +20,10 @@ import java.util.List;
*/ */
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; 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;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
@Override @Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) { public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles()); lifecycles.add(new DemoAppLifecycles());
......
...@@ -137,7 +137,6 @@ ...@@ -137,7 +137,6 @@
android:id="@+id/bt_to_tests" android:id="@+id/bt_to_tests"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:text="测评" /> android:text="测评" />
......
...@@ -5,46 +5,30 @@ ext { ...@@ -5,46 +5,30 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.50.33", "m-confide" : "0.0.50.37",
"m-consultant" : "0.0.60.66", "m-consultant" : "0.0.60.68",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.48", "m-user" : "0.0.62.54",
"m-home" : "0.0.23.90", "m-home" : "0.0.23.90",
"m-im" : "0.0.21.57", "m-im" : "0.0.21.58",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
"m-muse" : "0.0.28.81",
"m-muse" : "0.0.28.76",
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.18",
"m-course" : "0.0.43.39", "m-course" : "0.0.43.39",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.24",
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.40",
"ydl-platform" : "0.0.41.33",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.92", "ydl-webview" : "0.0.38.93",
"ydl-media" : "0.0.21.52", "ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.30.15", "m-audioim" : "0.0.49.30.19",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
...@@ -52,6 +36,20 @@ ext { ...@@ -52,6 +36,20 @@ ext {
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3.94", "ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8", "ydl-utils" : "0.0.3.8",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.24",
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
] ]
ydl_app = [ ydl_app = [
appName : "壹点灵心理咨询", appName : "壹点灵心理咨询",
...@@ -93,49 +91,49 @@ ext { ...@@ -93,49 +91,49 @@ ext {
ydlCompileVersion = [ ydlCompileVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.50.33", "m-confide" : "0.0.50.37",
"m-consultant" : "0.0.60.66", "m-consultant" : "0.0.60.68",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.48", "m-user" : "0.0.62.54",
"m-home" : "0.0.23.90", "m-home" : "0.0.23.90",
"m-im" : "0.0.21.57", "m-im" : "0.0.21.58",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
"m-muse" : "0.0.28.76", "m-muse" : "0.0.28.81",
"m-tests" : "0.0.24.18", "m-tests" : "0.0.24.18",
"m-course" : "0.0.43.39", "m-course" : "0.0.43.39",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.24",
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.33", "ydl-platform" : "0.0.41.40",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.92", "ydl-webview" : "0.0.38.93",
"ydl-media" : "0.0.21.52", "ydl-media" : "0.0.21.52",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.30.15", "m-audioim" : "0.0.49.30.19",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3.94", "ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8", "ydl-utils" : "0.0.3.8",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.24",
"m-home-api" : "0.0.4.4",
"m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71",
] ]
dependencies = [ dependencies = [
......
...@@ -4,9 +4,7 @@ import android.annotation.SuppressLint ...@@ -4,9 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.Handler import android.os.Handler
import android.text.TextUtils import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.bytedance.apm.insight.ApmInsightAgent
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraInvitationBean import com.ydl.audioim.bean.AgoraInvitationBean
import com.ydl.audioim.http.AudioApiRequestUtil import com.ydl.audioim.http.AudioApiRequestUtil
...@@ -25,6 +23,7 @@ import com.ydl.ydl_av.messge_service.callback.LoginCallback ...@@ -25,6 +23,7 @@ import com.ydl.ydl_av.messge_service.callback.LoginCallback
import com.ydl.ydl_av.messge_service.request.LoginParam import com.ydl.ydl_av.messge_service.request.LoginParam
import com.ydl.ydl_av.messge_service.response.CallLocalResponse import com.ydl.ydl_av.messge_service.response.CallLocalResponse
import com.ydl.ydl_av.messge_service.response.CallRemoteResponse import com.ydl.ydl_av.messge_service.response.CallRemoteResponse
import com.ydl.ydlcommon.app.Apm
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
...@@ -43,7 +42,6 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO ...@@ -43,7 +42,6 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import org.json.JSONObject
import java.util.* import java.util.*
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
...@@ -326,53 +324,6 @@ class YDLavManager { ...@@ -326,53 +324,6 @@ class YDLavManager {
toUid: String, toUid: String,
content: String content: String
) { ) {
// LogUtil.e("[agora]收到云信的通知消息:$content")
// val agoraInvitationBean = Gson().fromJson(content, AgoraInvitationBean::class.java)
//1发起呼叫 2接受呼叫 3取消呼叫 4拒绝呼叫邀请 5呼叫超时
// when (agoraInvitationBean.callType) {
// "1" -> {
// writeAgoraLog("1收到云信消息通知电话-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// receivedCall(agoraInvitationBean.data, "来自云信")
// }
// "2" -> {
// writeAgoraLog("对方接受了通话邀请,主叫开始加入频道:callType${agoraInvitationBean.callType}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}",
// FILE_NAME
// )
// val act = ActivityManager.getInstance().getTopTaskActivity()
// if (act is AudioHomeActivity) {
// act.runOnUiThread {
// act.joinChannel()
// }
// }
// }
// "3" -> {
// writeAgoraLog("呼叫邀请被取消:主叫主动取消-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// closePage()
// }
// "4" -> {
// writeAgoraLog("被叫拒绝了通话邀请-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// val act = ActivityManager.getInstance().getTopTaskActivity()
// if (act is AudioHomeActivity) {
// act.runOnUiThread {
// ToastUtil.toastShort("对方已挂断")
// //通话结束或挂断时,上传日志文件
// act.uploadLog()
// act.leaveChannel()
// }
// }
// }
// "5" -> {
// writeAgoraLog("呼叫邀请被取消:呼叫邀请过期-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// //关闭页面
// closePage()
// }
// else -> {
// writeAgoraLog("其它AgoraInvitationBean,${agoraInvitationBean.callType}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", FILE_NAME)
// }
// }
} }
}) })
} }
...@@ -498,6 +449,7 @@ class YDLavManager { ...@@ -498,6 +449,7 @@ class YDLavManager {
} }
override fun onFailure(msg: String?) { override fun onFailure(msg: String?) {
Apm.reportCustom("agora_login_error", msg ?: "", Exception(msg))
LogUtil.e("[agora]实时消息登录失败:$msg") LogUtil.e("[agora]实时消息登录失败:$msg")
writeAgoraLog( writeAgoraLog(
"声网rtm登录失败:$msg-------Time:${ "声网rtm登录失败:$msg-------Time:${
...@@ -714,6 +666,8 @@ class YDLavManager { ...@@ -714,6 +666,8 @@ class YDLavManager {
* https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e * https://docs.agora.io/cn/Voice/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a31b2974a574ec45e62bb768e17d1f49e
* */ * */
override fun onConnectionStateChanged(state: Int, reason: Int) { override fun onConnectionStateChanged(state: Int, reason: Int) {
val msg = "state:${state},reason:${reason}"
Apm.reportCustom("agora_connectionstate_error", msg, Exception(msg))
sdkStatus = state sdkStatus = state
writeAgoraLog( writeAgoraLog(
"声网rtm登录状态:${state}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}", "声网rtm登录状态:${state}-------Time:${AudioLogUtils.format.format(Calendar.getInstance().time)}",
......
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tv_totalDuration"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tv_notes" android:layout_below="@+id/tv_notes"
...@@ -232,7 +233,7 @@ ...@@ -232,7 +233,7 @@
android:layout_width="66dp" android:layout_width="66dp"
android:layout_height="66dp" android:layout_height="66dp"
android:layout_marginTop="1dp" android:layout_marginTop="1dp"
android:src="@drawable/audiohome_muteon" android:src="@drawable/audioim_home_muteon_enable"
android:visibility="visible" /> android:visibility="visible" />
<TextView <TextView
...@@ -302,11 +303,12 @@ ...@@ -302,11 +303,12 @@
android:src="@drawable/audioim_img_hands_free_unuse" /> android:src="@drawable/audioim_img_hands_free_unuse" />
<TextView <TextView
android:id="@+id/hands_free_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/iv_hands_free" android:layout_below="@+id/iv_hands_free"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="免提" android:text="扬声器已关"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
......
...@@ -31,6 +31,7 @@ import com.ydl.confide.home.event.ConfideDialogEvent ...@@ -31,6 +31,7 @@ import com.ydl.confide.home.event.ConfideDialogEvent
import com.ydl.confide.home.http.ConfideHomeApi import com.ydl.confide.home.http.ConfideHomeApi
import com.ydl.confide.router.PhoneCallIn import com.ydl.confide.router.PhoneCallIn
import com.ydl.utils.WebUrlParamsUtils import com.ydl.utils.WebUrlParamsUtils
import com.ydl.webview.IJavascriptHandler
import com.ydl.webview.ProgressWebView import com.ydl.webview.ProgressWebView
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.webview.WebModularServiceUtils import com.ydl.webview.WebModularServiceUtils
...@@ -42,6 +43,8 @@ import com.ydl.ydlnet.YDLHttpUtils ...@@ -42,6 +43,8 @@ import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.service.IImService import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.event.UserBindPhoneEvent
import com.yidianling.user.api.event.UserLoginEvent
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
...@@ -75,7 +78,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -75,7 +78,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var layoutBottom: View lateinit var layoutBottom: View
lateinit var itemView: View lateinit var itemView: View
var bottomSheet :FrameLayout?=null var bottomSheet :FrameLayout?=null
var mJtoJHandle:IJavascriptHandler?=null
private var behavior: BottomSheetBehavior<*>? = null private var behavior: BottomSheetBehavior<*>? = null
...@@ -345,14 +348,13 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -345,14 +348,13 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
setting.setAllowFileAccess(true) setting.setAllowFileAccess(true)
setting.setBlockNetworkImage(false) setting.setBlockNetworkImage(false)
wv_content!!.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上 wv_content?.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
val jtoJHandle = WebModularServiceUtils.getWebService() mJtoJHandle = WebModularServiceUtils.getWebService()
.getJavascripHandler(requireActivity(), tellData = TellData()) .getJavascripHandler(requireActivity(), tellData = TellData())
wv_content!!.addJavascriptInterface(jtoJHandle, "javascriptHandler") wv_content?.addJavascriptInterface(mJtoJHandle, "javascriptHandler")
// var jumpurl = "http://192.168.210.152/jy/listenMask?listenerId=257&isFromApp=1" // var jumpurl = "http://192.168.210.152/jy/listenMask?listenerId=257&isFromApp=1"
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix()) loadUrl()
wv_content.loadUrl(url)
// wv_content.loadUrl(jumpUrl) // wv_content.loadUrl(jumpUrl)
wv_content.setOnTouchListener { p0, p1 -> //canScrollVertically(-1)的值表示是否能向下滚动,false表示已经滚动到顶部 wv_content.setOnTouchListener { p0, p1 -> //canScrollVertically(-1)的值表示是否能向下滚动,false表示已经滚动到顶部
...@@ -418,6 +420,11 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -418,6 +420,11 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
} }
private fun loadUrl() {
val url = WebUrlParamsUtils.getSuffix(jumpUrl, mJtoJHandle?.getUriAppendSuffix())
wv_content?.loadUrl(url)
}
private fun shouldOverridePayUrl(view: WebView, url: String): Boolean { private fun shouldOverridePayUrl(view: WebView, url: String): Boolean {
if (url.startsWith("weixin://")) { if (url.startsWith("weixin://")) {
return try { return try {
...@@ -574,4 +581,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -574,4 +581,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
wv_content.destroy() wv_content.destroy()
EventBus.getDefault().unregister(this) EventBus.getDefault().unregister(this)
} }
//登录成功
fun onEvent(event: UserLoginEvent) {
loadUrl()
}
//绑定成功
fun onEvent(event: UserBindPhoneEvent) {
loadUrl()
}
} }
\ No newline at end of file
...@@ -99,7 +99,7 @@ class ExpertIntroActivity : AppCompatActivity() { ...@@ -99,7 +99,7 @@ class ExpertIntroActivity : AppCompatActivity() {
binding.viewPager.adapter = adapter binding.viewPager.adapter = adapter
binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() { binding.viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
adapter.onSelect(position) adapter.onSelect(position, lastSelectPos)
if (position == data.size - 1 && lastSelectPos < position) { if (position == data.size - 1 && lastSelectPos < position) {
loadMore() loadMore()
} }
......
...@@ -166,7 +166,7 @@ internal class IntroAdapter( ...@@ -166,7 +166,7 @@ internal class IntroAdapter(
ijkVideoView?.pause() ijkVideoView?.pause()
} }
fun onSelect(position: Int) { fun onSelect(position: Int, lastPos:Int) {
curPos = position curPos = position
onLoadDialStatus(position) onLoadDialStatus(position)
if (!ConfideNetworkUtil.isWifi(context) && !hasAgreePlayWithoutWiFi) { if (!ConfideNetworkUtil.isWifi(context) && !hasAgreePlayWithoutWiFi) {
...@@ -177,6 +177,15 @@ internal class IntroAdapter( ...@@ -177,6 +177,15 @@ internal class IntroAdapter(
// entry.value.seekTo(0) // entry.value.seekTo(0)
entry.value.start() entry.value.start()
} else { } else {
if (entry.key == lastPos) {
ActionCountUtils.record(
"listen_counselor_content_play_page",
"listen_counselor_content_playtime_click",
data[lastPos].confideId ?: "",
if (data[lastPos].isVideo) "1" else "2",
(entry.value.currentPosition / 1000F).toString()
)
}
entry.value.seekTo(0) entry.value.seekTo(0)
entry.value.pause() entry.value.pause()
} }
......
...@@ -577,6 +577,7 @@ class ExpertSearchAdapter( ...@@ -577,6 +577,7 @@ class ExpertSearchAdapter(
doctor.id ?: "" doctor.id ?: ""
) )
} }
onExpertClick?.onExpertClick()
//判断是否已登录 //判断是否已登录
if (!ConsultantIn.getUserImpl().loginByOneKeyLogin(context, true)) { if (!ConsultantIn.getUserImpl().loginByOneKeyLogin(context, true)) {
return@setOnClickListener return@setOnClickListener
......
...@@ -38,6 +38,7 @@ class HomeConfideBean : HomeItemBaseBean { ...@@ -38,6 +38,7 @@ class HomeConfideBean : HomeItemBaseBean {
var confideLine: Int = 0 var confideLine: Int = 0
var confideAddress: String? = null var confideAddress: String? = null
var confidePraise: String? = null var confidePraise: String? = null
var confidePraiseScore:String?=null
/** /**
* 实际费用 * 实际费用
*/ */
......
package com.yidianling.home.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.model.bean.MeditationModuleBean
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_fragment.*
class HomeConfideAdapter(
private val context: Context,
private val data: List<MeditationModuleBean.MeditationDetail>?,
private val moreLink: String?,
private val homeLink: String? = null,
private val cateId: Long? = null,
private val buried: String? = null,
private val mark: Int? = null,
private val meditationType: Int? = null
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return when (viewType) {
CONTENT_TYPE -> {
MeditationTypeViewHolder(
LayoutInflater.from(context)
.inflate(R.layout.home_layout_meditation_item, parent, false)
)
}
else -> {
MeditationTypeMoreViewHolder(
LayoutInflater.from(context)
.inflate(R.layout.home_layout_meditation_more_type, parent, false)
)
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder) {
is MeditationTypeViewHolder -> {
holder.ivType?.let {
Glide.with(context)
.load(data?.get(position)?.coverImageUrl)
.thumbnail(0.1f)
.transition(DrawableTransitionOptions.withCrossFade())
.into(it)
}
holder.tvName?.let {
it.text = data?.get(position)?.title ?: ""
}
holder.cvLayout?.setOnClickListener {
ActionCountUtils.baiDuCountSign3(
HomeBIConstants.YDL_USER_MAIN_PAGE_MUSE,
HomeBIConstants.YDL_HOME_MEDITATION_CLICK,
buried ?: "",
(position + 1).toString(),
""
)
if (meditationType == 0) {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if (!ModularServiceManager.provide(IUserService::class.java)
.loginByOneKeyLogin(context, true)
) {
return@setOnClickListener
}
if (data == null) {
return@setOnClickListener
}
ARouter.getInstance().build("/muse/play")
.withLong("MEDITATION_ID", data[position]?.meditationId)
.withInt("MEDITATION_TYPE", meditationType)
.withFloat("MEDIA_DURATION", data[position].duration ?: 0.0f)
.withString("MEDIA_URL", data[position].mediaIdCoverImageUrl)
.withString("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl)
.navigation()
// YDLRouterManager.router(ROUTER_MUSE_PLAY,
// YDLRouterParams().putExtra("MEDITATION_ID" , data[position]?.meditationId.toString())
// .putExtra("MEDITATION_TYPE", meditationType.toString())
// .putExtra("MEDIA_DURATION", (data[position].duration?:0).toString())
// .putExtra("MEDIA_URL", data[position].mediaIdCoverImageUrl.toString())
// .putExtra("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl.toString()))
} else {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if (data == null) {
return@setOnClickListener
}
val homeLink =
"${homeLink}mark=$mark&cateId=$cateId&meditationId=${data[position]?.meditationId}"
if (!homeLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(homeLink, null))
}
}
}
}
is MeditationTypeMoreViewHolder -> {
holder.llMoreLayout?.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
//冥想助眠更多点击事件
ActionCountUtils.count(
HomeBIConstants.YDL_HOME_MEDITATION_VOICE_MORE_CLICK,
buried ?: ""
)
val moreLink = "${moreLink}mark=$mark&cateId=$cateId"
if (!moreLink.isNullOrBlank()) {
NewH5Activity.start(context, H5Params(moreLink, null))
}
}
}
}
}
override fun getItemCount(): Int {
return if (data?.isNotEmpty() == true) {
data.size + 1
} else {
0
}
}
override fun getItemId(position: Int) = position.toLong()
override fun getItemViewType(position: Int): Int {
return if (data?.isNotEmpty() == true && position == data.size) {
FOOTER_TYPE
} else {
CONTENT_TYPE
}
}
inner class MeditationTypeViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val cvLayout: FrameLayout? = itemView.findViewById(R.id.fl_layout)
val ivType: ImageView? = itemView.findViewById(R.id.iv_meditation_type)
val tvName: TextView? = itemView.findViewById(R.id.tv_meditation_type)
}
inner class MeditationTypeMoreViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val llMoreLayout: LinearLayout? = itemView.findViewById(R.id.ll_more_type)
}
companion object {
const val CONTENT_TYPE = 0
const val FOOTER_TYPE = 1
}
}
\ No newline at end of file
...@@ -7,13 +7,17 @@ import android.text.TextUtils ...@@ -7,13 +7,17 @@ import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import com.blankj.utilcode.util.SpanUtils
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.ydl.ydl_image.config.SimpleImageOpConfiger import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConfideBean import com.yidianling.home.model.bean.HomeConfideBean
import kotlinx.android.synthetic.ydl.home_confide_expert_info_view.view.* import kotlinx.android.synthetic.ydl.home_confide_item_layout.view.*
/** /**
* @author jiucheng * @author jiucheng
...@@ -34,7 +38,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE ...@@ -34,7 +38,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
private fun initView() { private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params layoutParams = params
View.inflate(context, R.layout.home_confide_expert_info_view, this) View.inflate(context, R.layout.home_confide_item_layout, this)
} }
fun setData(bean: HomeConfideBean.BodyBean?, position: Int, isLast: Boolean) { fun setData(bean: HomeConfideBean.BodyBean?, position: Int, isLast: Boolean) {
...@@ -44,12 +48,19 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE ...@@ -44,12 +48,19 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
} }
//设置头像 //设置头像
setHead(bean) setHead(bean)
setListenAndScore(bean)
setConfideTag(bean)
setLineStatus(bean)
//设置名称 //设置名称
tv_name.text = bean.confidedName tv_name.text = bean.confidedName
//设置倾诉标签View的最大宽度 //设置倾诉标签View的最大宽度
tag_view.setConfideWidth() // tag_view.setConfideWidth()
//咨询师标签 //咨询师标签
tag_view.initData(bean.confidedTag as MutableList<String>) // tag_view.initData(bean.confidedTag as MutableList<String>)
//设置向TA倾诉人数 //设置向TA倾诉人数
setConfideNum(bean) setConfideNum(bean)
//设置接通率文案 //设置接通率文案
...@@ -58,11 +69,15 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE ...@@ -58,11 +69,15 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
setConfideButton(bean) setConfideButton(bean)
//设置红包、原价 //设置红包、原价
setCoupon(bean) setCoupon(bean)
//设置咨询师简介
tv_content.text = bean.confideContent
//最后一项显示分割线 //最后一项显示分割线
if (isLast) { if (isLast) {
view_line.visibility = View.GONE // view_line.visibility = View.GONE
} else { } else {
view_line.visibility = View.VISIBLE // view_line.visibility = View.VISIBLE
} }
this.setOnClickListener { this.setOnClickListener {
homeEvent!!.confideClick(bean.linkUrl, bean.confidedId.toString(), bean.doctorId, bean.uid.toString()) homeEvent!!.confideClick(bean.linkUrl, bean.confidedId.toString(), bean.doctorId, bean.uid.toString())
...@@ -73,11 +88,22 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE ...@@ -73,11 +88,22 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
* 设置头像 * 设置头像
*/ */
private fun setHead(bean: HomeConfideBean.BodyBean) { private fun setHead(bean: HomeConfideBean.BodyBean) {
val op = SimpleImageOpConfiger() // val op = SimpleImageOpConfiger()
op.errorPic = R.drawable.platform_head_place_hold_pic // op.errorPic = R.drawable.platform_head_place_hold_pic
op.loadingPic = R.drawable.platform_head_place_hold_pic // op.loadingPic = R.drawable.platform_head_place_hold_pic
op.transform = 0 // op.transform = 0
YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op) // YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op)
//这样处理 是防止 滑动过程中 反复去加载图片
if (!TextUtils.isEmpty(bean.confidedIcon) && img_head.getTag(R.id.img_head) != bean.confidedIcon) {
GlideApp.with(context)
.load(bean.confidedIcon)
// .override(dp96, dp96)
.into(img_head)
img_head.setTag(R.id.img_head, bean.confidedIcon)
}
} }
/** /**
...@@ -135,41 +161,99 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE ...@@ -135,41 +161,99 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
} }
} }
private fun setListenAndScore(bodyBean: HomeConfideBean.BodyBean) {
SpanUtils.with(price_content).append(bodyBean.confideFee)
.setForegroundColor(resources.getColor(R.color.home_confide_fe6040)).setFontSize(18, true)
.append("元").setForegroundColor(resources.getColor(R.color.home_confide_fe6040))
.setFontSize(11, true)
.append("/25分钟").setForegroundColor(resources.getColor(R.color.home_confide_aaaeba))
.setFontSize(11, true)
.create()
tv_score.text = bodyBean.confidePraiseScore
if (bodyBean.confideFee == "0" && bodyBean.confideLine == 1) {
confide_free_logo.visibility = VISIBLE
Glide.with(context)
.load(R.drawable.home_confide__free)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.into(confide_free_logo)
} else {
confide_free_logo.visibility = GONE
}
}
/**
* 设置在线状态
*/
private fun setLineStatus(bodyBean: HomeConfideBean.BodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 4 -> {
tv_online.text = "在线"
tv_online.setBackgroundResource(R.drawable.home_confide_online_main)
}
2 -> {
tv_online.text = "离线"
tv_online.setBackgroundResource(R.drawable.home_confide_offline_bg)
}
3 -> {
tv_online.text = "通话中"
tv_online.setBackgroundResource(R.drawable.home_confide_online_main)
}
}
}
private fun setConfideTag(bodyBean: HomeConfideBean.BodyBean) {
if (null == bodyBean.confidedTag || bodyBean.confidedTag!!.isEmpty()) {
return
}
var i = 0
val sb = StringBuilder()
for (tag in bodyBean.confidedTag!!) {
if (i > 4) break
sb.append(tag).append(" | ")
i++
}
if (sb.length > 3) {
sb.setLength(sb.length - 3)
}
flowlayout_tag.text = sb.toString()
}
/** /**
* 设置红包、原价 * 设置红包、原价
*/ */
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
private fun setCoupon(bodyBean: HomeConfideBean.BodyBean) { private fun setCoupon(bodyBean: HomeConfideBean.BodyBean) {
if(!TextUtils.isEmpty(bodyBean.couponText)){ // if(!TextUtils.isEmpty(bodyBean.couponText)){
tvCoupon.text = bodyBean.couponText // tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE // tvCoupon.visibility = View.VISIBLE
}else{ // }else{
tvCoupon.visibility = View.GONE // tvCoupon.visibility = View.GONE
} // }
if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){ // if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){
tvOriginalPrice.visibility = View.GONE // tvOriginalPrice.visibility = View.GONE
}else{ // }else{
tvOriginalPrice.visibility = View.VISIBLE // tvOriginalPrice.visibility = View.VISIBLE
val originalBuffer = StringBuffer() // val originalBuffer = StringBuffer()
originalBuffer.append(bodyBean.confideFee).append("元/次") // originalBuffer.append(bodyBean.confideFee).append("元/次")
tvOriginalPrice.text = originalBuffer.toString() // tvOriginalPrice.text = originalBuffer.toString()
//添加删除线 // //添加删除线
tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG // tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
} // }
try { // try {
val couponMoney = bodyBean.couponMoney!!.toFloat().toInt() // val couponMoney = bodyBean.couponMoney!!.toFloat().toInt()
val confideFee = bodyBean.confideFee!!.toFloat().toInt() // val confideFee = bodyBean.confideFee!!.toFloat().toInt()
//
if (couponMoney >= confideFee){ // if (couponMoney >= confideFee){
tv_price.text = "¥0" // tv_price.text = "¥0"
}else{ // }else{
val price = confideFee - couponMoney // val price = confideFee - couponMoney
tv_price.text = "¥"+price.toString() // tv_price.text = "¥"+price.toString()
} // }
}catch (e:Exception){ // }catch (e:Exception){
//防止数据类型变化引起奔溃 // //防止数据类型变化引起奔溃
} // }
} }
} }
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#4d000000" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:bottomRightRadius="6dp"/>
<solid android:color="#4d000000" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topRightRadius="100dp"
android:bottomRightRadius="100dp"/>
<solid android:color="#40FFFFFF" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white"
tools:ignore="MissingDefaultResource">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginTop="20dp"
android:layout_marginStart="15dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:layout_width="96dp"
android:layout_height="96dp">
<ImageView
android:id="@+id/img_head"
android:layout_width="96dp"
android:layout_height="96dp"
android:scaleType="fitXY"/>
<TextView
android:id="@+id/tv_online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="9dp"
android:paddingRight="9dp"
android:paddingTop="1dp"
android:paddingBottom="1dp"
android:textSize="10sp"
android:textColor="@color/white"
android:background="@drawable/home_confide_recommend_expert_line_bg"
tools:text="在线"/>
<ImageView
android:id="@+id/iv_play"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"/>
</FrameLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:textColor="#333333"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/card_view"
app:layout_constraintTop_toTopOf="@id/card_view"
tools:text="姚雨晴" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_confide_data"
app:layout_constraintTop_toBottomOf="@id/tv_name"
app:layout_constraintStart_toEndOf="@id/card_view"
android:layout_marginStart="12dp"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
>
<TextView
android:id="@+id/tv_Connection"
android:layout_marginTop="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="#555555"
android:textStyle="bold"
tools:text="83%"
/>
<TextView
android:id="@+id/tv_ConnectionContent"
android:layout_marginTop="3dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="#69696A"
android:text="接通率" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginStart="25dp"
>
<TextView
android:id="@+id/tv_confideNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#555555"
android:textStyle="bold"
android:layout_marginTop="12dp"
tools:text="8000人"
/>
<TextView
android:id="@+id/tv_tv_confideNumContent"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_12"
android:textColor="#69696A"
android:text="倾诉人次"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginStart="25dp"
>
<TextView
android:id="@+id/tv_score"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14"
android:textColor="#555555"
android:textStyle="bold"
android:layout_marginTop="12dp"
tools:text="4.9"
/>
<TextView
android:id="@+id/tv_tv_ScoreContent"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_12"
android:textColor="#69696A"
android:text="评分"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/price_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginRight="16dp"
android:text="50元/25分钟"
android:textSize="@dimen/platform_sp_12"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ll_confide_data" />
<TextView
android:id="@+id/flowlayout_tag"
android:layout_width="0dp"
android:layout_height="16dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:textColor="#9495A0"
android:maxLines="1"
android:ellipsize="end"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/card_view"
app:layout_constraintEnd_toStartOf="@+id/price_content"
app:layout_constraintStart_toEndOf="@+id/card_view" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="#919190"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintTop_toBottomOf="@id/card_view"
app:layout_constraintStart_toStartOf="@id/card_view"
android:layout_marginTop="@dimen/platform_dp_15"
tools:text="没有人一出生就是完美的,只有不断的相信自...己…才能成就自己的梦想。"
/>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<TextView
android:id="@+id/tv_confide"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginEnd="@dimen/platform_dp_15"
android:gravity="center"/>
<ImageView
android:layout_width="42dp"
android:layout_height="21dp"
android:id="@+id/confide_free_logo"
android:layout_marginTop="@dimen/platform_dp_5"
android:layout_marginStart="@dimen/platform_dp_8"/>
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
app:layout_constraintTop_toBottomOf="@id/tv_content"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginLeft="15dp"
android:background="#F0F0F0"/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -4,5 +4,9 @@ ...@@ -4,5 +4,9 @@
<color name="white_60">#99FFFFFF</color> <color name="white_60">#99FFFFFF</color>
<color name="white">#FFFFFF</color> <color name="white">#FFFFFF</color>
<color name="home_confide_61CEAC">#61CEAC</color>
<color name="home_confide_48CC95">#48CC95</color>
<color name="home_confide_fe6040">#fe6040</color>
<color name="home_confide_aaaeba">#aaaeba</color>
</resources> </resources>
...@@ -11,6 +11,7 @@ import android.os.Build; ...@@ -11,6 +11,7 @@ import android.os.Build;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.text.TextUtils; import android.text.TextUtils;
import com.ydl.ydlcommon.utils.DeviceTool;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig; import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper; import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.yidianling.avchatkit.common.log.LogUtil; import com.yidianling.avchatkit.common.log.LogUtil;
...@@ -543,6 +544,9 @@ public class NetworkUtil { ...@@ -543,6 +544,9 @@ public class NetworkUtil {
*/ */
public static String getActiveMacAddress(Context context) { public static String getActiveMacAddress(Context context) {
if (!DeviceTool.checkHasAgreeSecret()) {
return "";
}
WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo info = wifi.getConnectionInfo(); WifiInfo info = wifi.getConnectionInfo();
......
package com.yidianling.im.bean
data class CanViewConsult(
val canViewConsult: Boolean = false
)
...@@ -8,8 +8,6 @@ import android.graphics.Color; ...@@ -8,8 +8,6 @@ import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.provider.MediaStore; import android.provider.MediaStore;
import androidx.viewpager.widget.PagerAdapter;
import androidx.core.view.ViewCompat;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -17,6 +15,9 @@ import android.view.View; ...@@ -17,6 +15,9 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import androidx.core.view.ViewCompat;
import androidx.viewpager.widget.PagerAdapter;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.luck.picture.lib.photoview.PhotoView; import com.luck.picture.lib.photoview.PhotoView;
import com.netease.nimlib.sdk.AbortableFuture; import com.netease.nimlib.sdk.AbortableFuture;
...@@ -31,6 +32,7 @@ import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; ...@@ -31,6 +32,7 @@ import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum;
import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum; import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum;
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum; import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.ydlcommon.app.Apm;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.nimbase.common.ToastHelper; import com.yidianling.nimbase.common.ToastHelper;
import com.yidianling.nimbase.common.activity.ToolBarOptions; import com.yidianling.nimbase.common.activity.ToolBarOptions;
...@@ -335,6 +337,22 @@ public class WatchMessagePictureActivity extends UI { ...@@ -335,6 +337,22 @@ public class WatchMessagePictureActivity extends UI {
onDownloadStart(msg); onDownloadStart(msg);
message = msg; // 下载成功之后,判断是否是同一条消息时需要使用 message = msg; // 下载成功之后,判断是否是同一条消息时需要使用
downloadFuture = NIMClient.getService(MsgService.class).downloadAttachment(msg, false); downloadFuture = NIMClient.getService(MsgService.class).downloadAttachment(msg, false);
downloadFuture.setCallback(new RequestCallback<Void>() {
@Override
public void onSuccess(Void o) {
}
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
}
});
} }
private boolean isOriginImageHasDownloaded(final IMMessage message) { private boolean isOriginImageHasDownloaded(final IMMessage message) {
......
...@@ -10,7 +10,6 @@ import android.media.MediaPlayer.OnPreparedListener; ...@@ -10,7 +10,6 @@ import android.media.MediaPlayer.OnPreparedListener;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import androidx.appcompat.app.ActionBar;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
...@@ -23,21 +22,25 @@ import android.widget.ImageView; ...@@ -23,21 +22,25 @@ import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import com.netease.nimlib.sdk.AbortableFuture; import com.netease.nimlib.sdk.AbortableFuture;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MsgService; import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.MsgServiceObserve; import com.netease.nimlib.sdk.msg.MsgServiceObserve;
import com.netease.nimlib.sdk.msg.attachment.VideoAttachment; import com.netease.nimlib.sdk.msg.attachment.VideoAttachment;
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum;
import com.netease.nimlib.sdk.msg.model.AttachmentProgress; import com.netease.nimlib.sdk.msg.model.AttachmentProgress;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.ydlcommon.app.Apm;
import com.yidianling.im.R;
import com.yidianling.nimbase.common.ToastHelper; import com.yidianling.nimbase.common.ToastHelper;
import com.yidianling.nimbase.common.activity.ToolBarOptions; import com.yidianling.nimbase.common.activity.ToolBarOptions;
import com.yidianling.nimbase.common.activity.UI; import com.yidianling.nimbase.common.activity.UI;
import com.yidianling.nimbase.common.util.file.FileUtil; import com.yidianling.nimbase.common.util.file.FileUtil;
import com.yidianling.nimbase.common.util.sys.TimeUtil; import com.yidianling.nimbase.common.util.sys.TimeUtil;
import com.yidianling.im.R;
import com.yidianling.uikit.custom.config.YDLToolBarOptions; import com.yidianling.uikit.custom.config.YDLToolBarOptions;
/** /**
...@@ -499,6 +502,21 @@ public class WatchVideoActivity extends UI implements Callback { ...@@ -499,6 +502,21 @@ public class WatchVideoActivity extends UI implements Callback {
// async download original image // async download original image
onDownloadStart(message); onDownloadStart(message);
downloadFuture = NIMClient.getService(MsgService.class).downloadAttachment(message, false); downloadFuture = NIMClient.getService(MsgService.class).downloadAttachment(message, false);
downloadFuture.setCallback(new RequestCallback<Void>() {
@Override
public void onSuccess(Void o) {
}
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
}
});
downloading = true; downloading = true;
} }
} }
......
...@@ -4,13 +4,9 @@ import android.animation.Animator; ...@@ -4,13 +4,9 @@ import android.animation.Animator;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.media.AudioManager; import android.media.AudioManager;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
...@@ -30,7 +26,6 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -30,7 +26,6 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.SPUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.Observer;
...@@ -49,28 +44,20 @@ import com.netease.nimlib.sdk.uinfo.model.NimUserInfo; ...@@ -49,28 +44,20 @@ import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
import com.ydl.webview.H5Params; import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity; import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.config.HttpConfig; import com.ydl.ydlcommon.app.Apm;
import com.ydl.ydlcommon.data.PlatformDataManager;
import com.ydl.ydlcommon.data.http.RxUtils; import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.modular.ModularServiceManager; import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.ui.LoadingDialogFragment;
import com.ydl.ydlcommon.utils.AnimUtils; import com.ydl.ydlcommon.utils.AnimUtils;
import com.ydl.ydlcommon.utils.LogUtil; import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.NetworkParamsUtils;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils; import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig; import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper; import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.ydl.ydlcommon.utils.log.LogHelper; import com.ydl.ydlcommon.utils.log.LogHelper;
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils;
import com.ydl.ydlcommon.view.CircleImageView; import com.ydl.ydlcommon.view.CircleImageView;
import com.ydl.ydlcommon.view.dialog.CommonDialog; import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.ydl.ydlcommon.view.dialog.ListDialog;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.bean.RemoveHistory;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.event.CloseBottomWebviewEvent; import com.yidianling.im.event.CloseBottomWebviewEvent;
import com.yidianling.im.event.MultipleAnswerBean; import com.yidianling.im.event.MultipleAnswerBean;
import com.yidianling.im.event.MultipleSelectedEvent; import com.yidianling.im.event.MultipleSelectedEvent;
...@@ -97,7 +84,6 @@ import com.yidianling.uikit.api.NimUIKitImpl; ...@@ -97,7 +84,6 @@ import com.yidianling.uikit.api.NimUIKitImpl;
import com.yidianling.uikit.business.ait.AitManager; import com.yidianling.uikit.business.ait.AitManager;
import com.yidianling.uikit.business.session.activity.YDLBaseMessageActivity; import com.yidianling.uikit.business.session.activity.YDLBaseMessageActivity;
import com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper; import com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper;
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper;
import com.yidianling.uikit.business.session.module.input.InputPanel; import com.yidianling.uikit.business.session.module.input.InputPanel;
import com.yidianling.uikit.business.session.module.list.MessageListPanelEx; import com.yidianling.uikit.business.session.module.list.MessageListPanelEx;
import com.yidianling.uikit.business.session.view.ChatPrivateTips; import com.yidianling.uikit.business.session.view.ChatPrivateTips;
...@@ -294,11 +280,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -294,11 +280,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//做灵犀2.0 去掉常用语逻辑 //做灵犀2.0 去掉常用语逻辑
//rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE); //rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() != 2) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).isNotPrepare()) { if (null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).isNotPrepare()) {
IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(), sessionId, (expertInfo) -> { IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(), sessionId, (expertInfo) -> {
String toUid = expertInfo.shareData.toUid; String toUid = expertInfo.shareData.toUid;
...@@ -319,7 +301,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -319,7 +301,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//如果是群聊 //如果是群聊
if (SessionTypeEnum.Team==sessionType){ if (SessionTypeEnum.Team==sessionType){
titleBar.setRightIcon(getContext().getDrawable(R.drawable.platform_common_more)); titleBar.setRightIcon(getContext().getDrawable(R.drawable.platform_common_more));
rela_zixun.setVisibility(View.GONE);
titleBar.setTitleRightDraw(null); titleBar.setTitleRightDraw(null);
} }
} }
...@@ -342,6 +323,22 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -342,6 +323,22 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}); });
} }
boolean isExpert = null!=ActionHandlerStorage.getL(sessionId)&&ActionHandlerStorage.getL(sessionId).getUserType() == 2;
ServiceImpl.Companion.getInstance().canViewConsult("")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if (response.code.equals("200")){
if (response.data!=null && response.data.getCanViewConsult()){
if (isExpert && sessionType != SessionTypeEnum.Team) {
rela_zixun.setVisibility(View.VISIBLE);
}
}
}
}
);
//有未完成订单或者有未评价订单时,显示订单布局 //有未完成订单或者有未评价订单时,显示订单布局
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) { if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
if (ActionHandlerStorage.getL(sessionId).getInfo().hasAvailableListenOrder == 2 || ActionHandlerStorage.getL(sessionId).getInfo().listenOrderCommentStatus == 1) { if (ActionHandlerStorage.getL(sessionId).getInfo().hasAvailableListenOrder == 2 || ActionHandlerStorage.getL(sessionId).getInfo().listenOrderCommentStatus == 1) {
...@@ -1336,6 +1333,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1336,6 +1333,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
public void onFailed(int code) { public void onFailed(int code) {
if (msg != null) { if (msg != null) {
sendFailWithBlackList(code, msg); sendFailWithBlackList(code, msg);
Apm.INSTANCE.reportCustom("yx_sendmessage_error", "sessionId:" + msg.getSessionId(), new Exception(String.valueOf(code)));
} }
} }
......
...@@ -7,14 +7,15 @@ import android.graphics.Bitmap; ...@@ -7,14 +7,15 @@ import android.graphics.Bitmap;
import android.net.Uri; import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.provider.MediaStore; import android.provider.MediaStore;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.util.Pair; import android.util.Pair;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.NIMSDK; import com.netease.nimlib.sdk.NIMSDK;
import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.Observer;
...@@ -40,6 +41,7 @@ import com.netease.nimlib.sdk.msg.model.TeamMessageReceipt; ...@@ -40,6 +41,7 @@ import com.netease.nimlib.sdk.msg.model.TeamMessageReceipt;
import com.netease.nimlib.sdk.robot.model.RobotAttachment; import com.netease.nimlib.sdk.robot.model.RobotAttachment;
import com.netease.nimlib.sdk.team.constant.TeamMemberType; import com.netease.nimlib.sdk.team.constant.TeamMemberType;
import com.netease.nimlib.sdk.team.model.TeamMember; import com.netease.nimlib.sdk.team.model.TeamMember;
import com.ydl.ydlcommon.app.Apm;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachLingxiWhichQuestion; import com.yidianling.im.session.extension.CustomAttachLingxiWhichQuestion;
...@@ -838,7 +840,23 @@ public class MessageListPanelEx { ...@@ -838,7 +840,23 @@ public class MessageListPanelEx {
public void doOkAction() { public void doOkAction() {
// 正常情况收到消息后附件会自动下载。如果下载失败,可调用该接口重新下载 // 正常情况收到消息后附件会自动下载。如果下载失败,可调用该接口重新下载
if (message.getAttachment() != null && message.getAttachment() instanceof FileAttachment) if (message.getAttachment() != null && message.getAttachment() instanceof FileAttachment)
NIMClient.getService(MsgService.class).downloadAttachment(message, true); NIMClient.getService(MsgService.class).downloadAttachment(message, true)
.setCallback(new RequestCallback<Void>() {
@Override
public void onSuccess(Void o) {
}
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
}
});
} }
}; };
...@@ -1145,6 +1163,8 @@ public class MessageListPanelEx { ...@@ -1145,6 +1163,8 @@ public class MessageListPanelEx {
@Override @Override
public void onFailed(int code) { public void onFailed(int code) {
String sessionId = item.getSessionId();
Apm.INSTANCE.reportCustom("yx_revoke_error", "sessionId:" + sessionId, new Exception(String.valueOf(code)));
if (code == ResponseCode.RES_OVERDUE) { if (code == ResponseCode.RES_OVERDUE) {
ToastHelper.showToast(container.activity, R.string.im_revoke_failed); ToastHelper.showToast(container.activity, R.string.im_revoke_failed);
} else { } else {
......
...@@ -10,18 +10,20 @@ import android.widget.ImageView; ...@@ -10,18 +10,20 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MsgService; import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.attachment.AudioAttachment; import com.netease.nimlib.sdk.msg.attachment.AudioAttachment;
import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum;
import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum; import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum;
import com.netease.nimlib.sdk.msg.constant.MsgStatusEnum; import com.netease.nimlib.sdk.msg.constant.MsgStatusEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.ydlcommon.app.Apm;
import com.yidianling.im.R;
import com.yidianling.nimbase.business.session.audio.MessageAudioControl; import com.yidianling.nimbase.business.session.audio.MessageAudioControl;
import com.yidianling.nimbase.common.media.audioplayer.Playable; import com.yidianling.nimbase.common.media.audioplayer.Playable;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter; import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.nimbase.common.util.sys.ScreenUtil; import com.yidianling.nimbase.common.util.sys.ScreenUtil;
import com.yidianling.nimbase.common.util.sys.TimeUtil; import com.yidianling.nimbase.common.util.sys.TimeUtil;
import com.yidianling.im.R;
import com.yidianling.uikit.api.NimUIKitImpl; import com.yidianling.uikit.api.NimUIKitImpl;
/** /**
...@@ -71,7 +73,24 @@ public class MsgViewHolderAudio extends MsgViewHolderBase { ...@@ -71,7 +73,24 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
if (audioControl != null) { if (audioControl != null) {
if (message.getDirect() == MsgDirectionEnum.In && message.getAttachStatus() != AttachStatusEnum.transferred) { if (message.getDirect() == MsgDirectionEnum.In && message.getAttachStatus() != AttachStatusEnum.transferred) {
if (message.getAttachStatus() == AttachStatusEnum.fail || message.getAttachStatus() == AttachStatusEnum.def) { if (message.getAttachStatus() == AttachStatusEnum.fail || message.getAttachStatus() == AttachStatusEnum.def) {
NIMClient.getService(MsgService.class).downloadAttachment(message, false); NIMClient.getService(MsgService.class).downloadAttachment(message, false)
.setCallback(new RequestCallback<Void>() {
@Override
public void onSuccess(Void o) {
}
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
}
});
} }
return; return;
} }
......
...@@ -13,12 +13,14 @@ import android.widget.TextView; ...@@ -13,12 +13,14 @@ import android.widget.TextView;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.NIMSDK; import com.netease.nimlib.sdk.NIMSDK;
import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MsgService; import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.attachment.FileAttachment; import com.netease.nimlib.sdk.msg.attachment.FileAttachment;
import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum; import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum;
import com.netease.nimlib.sdk.msg.constant.MsgStatusEnum; import com.netease.nimlib.sdk.msg.constant.MsgStatusEnum;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum; import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.ydlcommon.app.Apm;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.nimbase.common.ui.imageview.HeadImageView; import com.yidianling.nimbase.common.ui.imageview.HeadImageView;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter; import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
...@@ -140,7 +142,23 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem ...@@ -140,7 +142,23 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
*/ */
protected void downloadAttachment() { protected void downloadAttachment() {
if (message.getAttachment() != null && message.getAttachment() instanceof FileAttachment) if (message.getAttachment() != null && message.getAttachment() instanceof FileAttachment)
NIMClient.getService(MsgService.class).downloadAttachment(message, true); NIMClient.getService(MsgService.class).downloadAttachment(message, true)
.setCallback(new RequestCallback<Void>() {
@Override
public void onSuccess(Void o) {
}
@Override
public void onFailed(int i) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", new Exception(String.valueOf(i)));
}
@Override
public void onException(Throwable throwable) {
Apm.INSTANCE.reportCustom("yx_attchment_error", "", throwable);
}
});
} }
// 设置FrameLayout子控件的gravity参数 // 设置FrameLayout子控件的gravity参数
......
...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN ...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.im.bean.BusyBean import com.yidianling.im.bean.BusyBean
import com.yidianling.im.bean.CanViewConsult
import com.yidianling.im.bean.FirstQuestionBean import com.yidianling.im.bean.FirstQuestionBean
import com.yidianling.uikit.custom.http.response.* import com.yidianling.uikit.custom.http.response.*
import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
...@@ -125,4 +126,10 @@ interface ServiceApi { ...@@ -125,4 +126,10 @@ interface ServiceApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"X-App-Id: crm_cloud") @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"X-App-Id: crm_cloud")
fun getFirstQuestion( @Body map: Map<String,@JvmSuppressWildcards Any>): Observable<BaseAPIResponse<FirstQuestionBean>> fun getFirstQuestion( @Body map: Map<String,@JvmSuppressWildcards Any>): Observable<BaseAPIResponse<FirstQuestionBean>>
//倾诉2.0迭代 是否显示立即咨询按钮
@GET("consult/expert-page/canViewConsult")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun canViewConsult(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<CanViewConsult>>
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.bean.BusyBean import com.yidianling.im.bean.BusyBean
import com.yidianling.im.bean.CanViewConsult
import com.yidianling.im.bean.FirstQuestionBean import com.yidianling.im.bean.FirstQuestionBean
import com.yidianling.im.http.ImRetrofitApi import com.yidianling.im.http.ImRetrofitApi
import com.yidianling.uikit.custom.http.response.* import com.yidianling.uikit.custom.http.response.*
...@@ -200,4 +201,11 @@ class ServiceImpl private constructor() { ...@@ -200,4 +201,11 @@ class ServiceImpl private constructor() {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getFirstQuestion(map) return YDLHttpUtils.obtainApi(ServiceApi::class.java).getFirstQuestion(map)
} }
/**
* 是否显示立即咨询
*/
fun canViewConsult(doctorId: String):Observable<BaseAPIResponse<CanViewConsult>>{
return YDLHttpUtils.obtainApi(ServiceApi::class.java).canViewConsult(doctorId)
}
} }
\ No newline at end of file
...@@ -9,12 +9,18 @@ import android.widget.ImageView; ...@@ -9,12 +9,18 @@ import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallback; import com.netease.nimlib.sdk.RequestCallback;
import com.netease.nimlib.sdk.msg.MessageBuilder; import com.netease.nimlib.sdk.msg.MessageBuilder;
import com.netease.nimlib.sdk.msg.MsgService; import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum; import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.confide.api.ConfideRoute;
import com.ydl.confide.api.IConfideService;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.utils.Utils;
import com.yidianling.common.tools.RxImageTool; import com.yidianling.common.tools.RxImageTool;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
...@@ -27,6 +33,10 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager; ...@@ -27,6 +33,10 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager;
import com.ydl.ydlcommon.utils.StringUtils; import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.YDLCacheUtils; import com.ydl.ydlcommon.utils.YDLCacheUtils;
import static com.ydl.ydlcommon.modular.ModularServiceManagerKt.findRouteService;
/** /**
* Created by haorui on 2019/5/22. * Created by haorui on 2019/5/22.
* Des: * Des:
...@@ -129,10 +139,29 @@ public class ConfideOrderInfoView extends RelativeLayout { ...@@ -129,10 +139,29 @@ public class ConfideOrderInfoView extends RelativeLayout {
//点击整个view,跳转订单详情页面 //点击整个view,跳转订单详情页面
setOnClickListener(view -> { setOnClickListener(view -> {
if (Utils.isFastClick()){
return;
}
String remainTime = ActionHandlerStorage.getL(mSessionId).getInfo().listenOrderRemainTime;
if(TextUtils.isEmpty(remainTime)){
if (!TextUtils.isEmpty(info.listenOrderUrl)) {//订单详情 if (!TextUtils.isEmpty(info.listenOrderUrl)) {//订单详情
H5Params h5Params = new H5Params(info.listenOrderUrl, "订单详情"); H5Params h5Params = new H5Params(info.listenOrderUrl, "订单详情");
NewH5Activity.start(mContext, h5Params); NewH5Activity.start(mContext, h5Params);
} }
}else {
if (info!=null){
String confideId = info.listenerId;
findRouteService(IConfideService.class)
.showExpertDetailDialog(
(FragmentActivity)mContext,
HttpConfig.Companion.getMH5_URL() + ConfideRoute.INSTANCE.h5ConfideIntro(confideId),
info.doctorId,
info.toUid);
}
}
}); });
} }
......
...@@ -487,12 +487,14 @@ ...@@ -487,12 +487,14 @@
android:background="@drawable/im_bg_im_consult_action" android:background="@drawable/im_bg_im_consult_action"
android:gravity="center" android:gravity="center"
android:paddingLeft="17dp" android:paddingLeft="17dp"
android:paddingRight="11dp"> android:paddingRight="11dp"
android:visibility="gone"
tools:visibility="visible">
<TextView <TextView
android:id="@+id/action_yuyue" android:id="@+id/action_yuyue"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="36dp"
android:gravity="center" android:gravity="center"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:text="立即咨询" android:text="立即咨询"
......
...@@ -45,7 +45,7 @@ class MediaPlayerManager private constructor() { ...@@ -45,7 +45,7 @@ class MediaPlayerManager private constructor() {
mTime = time mTime = time
} }
fun setAudioPath(path: String,isLoop:Boolean = false){ fun setAudioPath(path: String){
val attrs = AudioAttributes.Builder() val attrs = AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
...@@ -60,9 +60,6 @@ class MediaPlayerManager private constructor() { ...@@ -60,9 +60,6 @@ class MediaPlayerManager private constructor() {
mMediaPlayer?.prepareAsync() mMediaPlayer?.prepareAsync()
mMediaPlayer?.setOnPreparedListener { mMediaPlayer?.setOnPreparedListener {
listener?.onPrepared(it) listener?.onPrepared(it)
if (isLoop){
mMediaPlayer?.seekTo(0)
}
} }
} }
......
...@@ -28,7 +28,7 @@ class MediaPlayerTimeUtil { ...@@ -28,7 +28,7 @@ class MediaPlayerTimeUtil {
"$minute:$second" "$minute:$second"
} }
} }
}else if (time in 1..59){ }else if (time in 0..59){
second = time second = time
return if (second in 0..9){ return if (second in 0..9){
"00:0$second" "00:0$second"
......
...@@ -118,19 +118,15 @@ object LoginUtils { ...@@ -118,19 +118,15 @@ object LoginUtils {
val size = ActivityManager.getActivitySize() val size = ActivityManager.getActivitySize()
if (size <= 2) {//当前stack只有两个页面,必然没有MainActivity if (size <= 2) {//当前stack只有两个页面,必然没有MainActivity
ActivityManager.finishAll() ActivityManager.finishAll()
if (StatusUtils.isFirstLogin && StatusUtils.isFirstStartApp) {
UserIn.mainIntent(activity) UserIn.mainIntent(activity)
// activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
} else {
UserIn.mainIntent(activity)
}
} else {//需要判断stack中是否有MainActivity } else {//需要判断stack中是否有MainActivity
//这里不能引用到MainActivity 想别的办法 //这里不能引用到MainActivity 想别的办法
var flag = 0 var flag = 0
//判断stack中activity是否属于登录相关的三个页面 //判断stack中activity是否属于登录相关的三个页面
var containMainActivity = false var containMainActivity = false
for (activity in ActivityManager.getInstance().getActivitys()) { for (activity in ActivityManager.getInstance().getActivitys()) {
if (activity.javaClass.name == "com.cxzapp.yidianling.activity.MainActivity") { if (activity.javaClass.name == "com.cxzapp.yidianling.activity.MainActivity"
|| activity.javaClass.name == "com.cxzapp.xinlizixun.activity.MainActivity") {
containMainActivity = true containMainActivity = true
} }
if (activity is RegisterAndLoginActivity if (activity is RegisterAndLoginActivity
...@@ -155,12 +151,7 @@ object LoginUtils { ...@@ -155,12 +151,7 @@ object LoginUtils {
} }
} else { } else {
ActivityManager.finishAll() ActivityManager.finishAll()
if (StatusUtils.isFirstLogin && StatusUtils.isFirstStartApp) {
UserIn.mainIntent(activity) UserIn.mainIntent(activity)
// activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
} else {
UserIn.mainIntent(activity)
}
} }
} }
} }
......
...@@ -13,7 +13,4 @@ public class StatusUtils { ...@@ -13,7 +13,4 @@ public class StatusUtils {
// 是否第一次启动App // 是否第一次启动App
public static boolean isFirstStartApp = false; public static boolean isFirstStartApp = false;
// 是否使用openInstall
public static boolean isUseOpenInstall = false;
} }
...@@ -229,13 +229,22 @@ interface UserApi { ...@@ -229,13 +229,22 @@ interface UserApi {
fun unBindThirdLogin(@Body body: RequestBody): Observable<BaseResponse<Any>> fun unBindThirdLogin(@Body body: RequestBody): Observable<BaseResponse<Any>>
/** /**
* 用户注销账号 * 用户注销账号(原有禁止登录逻辑)
*/ */
@FormUrlEncoded @FormUrlEncoded
@POST("user/forbid_login") @POST("user/forbid_login")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun userForbidLogin(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>> fun userForbidLogin(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>>
/**
* 用户注销账号
*/
@FormUrlEncoded
@POST("login/v2/accountLogOff")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun accountLogOff(@FieldMap params: Map<String, String>): Observable<BaseAPIResponse<Boolean>>
/** /**
* 是否需要强绑定手机号 * 是否需要强绑定手机号
*/ */
......
...@@ -79,6 +79,9 @@ interface UserHttp { ...@@ -79,6 +79,9 @@ interface UserHttp {
fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>> fun getNewUserJumpUrl(): Observable<BaseAPIResponse<String>>
/**用户注销账号*/ /**用户注销账号(禁止登录)*/
fun userForbidLogin(param: UserForbidLoginParam):Observable<BaseAPIResponse<Boolean>> fun userForbidLogin(param: UserForbidLoginParam):Observable<BaseAPIResponse<Boolean>>
/**用户注销账号*/
fun accountLogOff(param: UserForbidLoginParam):Observable<BaseAPIResponse<Boolean>>
} }
\ No newline at end of file
...@@ -231,13 +231,21 @@ class UserHttpImpl private constructor() : UserHttp { ...@@ -231,13 +231,21 @@ class UserHttpImpl private constructor() : UserHttp {
} }
/** /**
* 用户注销账号调用接口 * 用户注销账号调用接口(禁止登陆)
* */ * */
override fun userForbidLogin(param: UserForbidLoginParam): Observable<BaseAPIResponse<Boolean>> { override fun userForbidLogin(param: UserForbidLoginParam): Observable<BaseAPIResponse<Boolean>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getUserApi().userForbidLogin(it) } .flatMap { getUserApi().userForbidLogin(it) }
} }
/**
* 用户注销账号调用接口
* */
override fun accountLogOff(param: UserForbidLoginParam): Observable<BaseAPIResponse<Boolean>> {
return RxUtils.mapObservable(param)
.flatMap { getUserApi().accountLogOff(it) }
}
private object Holder { private object Holder {
val INSTANCE = UserHttpImpl() val INSTANCE = UserHttpImpl()
} }
......
...@@ -38,9 +38,10 @@ class AccountUnRegisterActivity : BaseActivity() { ...@@ -38,9 +38,10 @@ class AccountUnRegisterActivity : BaseActivity() {
.setTitle_color(R.color.platform_color_242424) .setTitle_color(R.color.platform_color_242424)
.setMessage( .setMessage(
""" """
1.您的账号内如有剩余金额,如未用完,视为放弃将被清零; 为了保护您的账户、财产安全,在您提交注销前,需同时满足以下条件:
1.账号财产已清零,即账户余额为0;
2.您的订单(已购买的咨询、课程、测评等)将被终止且无法继续接受服务; 2.不存在交易中的订单,即咨询订单状态均为交易成功或交易关闭;
3.无退款中的订单。
""".trimIndent() """.trimIndent()
) )
.setMessageTextGravity(Gravity.LEFT) .setMessageTextGravity(Gravity.LEFT)
...@@ -60,15 +61,18 @@ class AccountUnRegisterActivity : BaseActivity() { ...@@ -60,15 +61,18 @@ class AccountUnRegisterActivity : BaseActivity() {
private fun userForbidLogin() { private fun userForbidLogin() {
val param = UserForbidLoginParam() val param = UserForbidLoginParam()
param.userPort = 1; param.userPort = 1;
UserHttpImpl.getInstance().userForbidLogin(param) UserHttpImpl.getInstance().accountLogOff(param)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe { .subscribe {
if (!isFinishing && it.data) { if (it.code == "200" && !isFinishing && it.data) {
ToastUtil.toastShort("账号已注销") ToastUtil.toastLong(this@AccountUnRegisterActivity,"账号已注销")
EventBus.getDefault().post(UnRegisterEvent()) EventBus.getDefault().post(UnRegisterEvent())
finish() finish()
} else {
ToastUtil.toastLong(this@AccountUnRegisterActivity,it.msg)
} }
} }
} }
} }
\ No newline at end of file
...@@ -5,7 +5,6 @@ import android.content.Intent ...@@ -5,7 +5,6 @@ import android.content.Intent
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import com.fm.openinstall.OpenInstall
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
...@@ -32,7 +31,6 @@ import com.yidianling.user.route.UserIn ...@@ -32,7 +31,6 @@ import com.yidianling.user.route.UserIn
import com.yidianling.user.safePrivate.FingerPrintCheckActivity import com.yidianling.user.safePrivate.FingerPrintCheckActivity
import com.yidianling.user.safePrivate.FingerPrintUtil import com.yidianling.user.safePrivate.FingerPrintUtil
import com.yidianling.user.safePrivate.HandUnlockCheckActivity import com.yidianling.user.safePrivate.HandUnlockCheckActivity
import com.yidianling.user.ui.login.OneKeyLoginHelp
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
...@@ -187,23 +185,12 @@ class SmsLoginActivity : BaseActivity() { ...@@ -187,23 +185,12 @@ class SmsLoginActivity : BaseActivity() {
* 注册流程成功之后,进行百度监测 注册埋点 * 注册流程成功之后,进行百度监测 注册埋点
*/ */
fun baiduActionBury() { fun baiduActionBury() {
if (OneKeyLoginHelp.openInstallKey.isNotEmpty() && StatusUtils.isUseOpenInstall) {
ActionCountUtils.baiduCount(
UserBIConstants.APP_REGISTER_PAGE,
UserBIConstants.POSITION_CODE_REGISTER_CLICK,
25,
OneKeyLoginHelp.openInstallKey
)
// 用户注册成功后调用
OpenInstall.reportRegister();
} else {
ActionCountUtils.baiduCount( ActionCountUtils.baiduCount(
UserBIConstants.APP_REGISTER_PAGE, UserBIConstants.APP_REGISTER_PAGE,
UserBIConstants.POSITION_CODE_REGISTER_CLICK, UserBIConstants.POSITION_CODE_REGISTER_CLICK,
25 25
) )
} }
}
//关闭手势解锁页面与指纹解锁页面 //关闭手势解锁页面与指纹解锁页面
private fun finishFinger() { private fun finishFinger() {
......
...@@ -63,7 +63,7 @@ public class H5Activity extends BaseActivity { ...@@ -63,7 +63,7 @@ public class H5Activity extends BaseActivity {
//无网络 读取本地文件 //无网络 读取本地文件
web_view.loadUrl("file:///android_asset/html/yinsi.html"); web_view.loadUrl("file:///android_asset/html/yinsi.html");
}else { }else {
web_view.loadUrl("https://m.ydl.com/Protol/yinsi");//加载url web_view.loadUrl("https://m.ydl.com/Protol/yinsi/shdh");//加载url
} }
} else { } else {
//用户协议0 //用户协议0
......
...@@ -11,7 +11,6 @@ import android.text.method.HideReturnsTransformationMethod ...@@ -11,7 +11,6 @@ import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod import android.text.method.PasswordTransformationMethod
import android.view.View import android.view.View
import android.view.animation.AnimationUtils import android.view.animation.AnimationUtils
import com.fm.openinstall.OpenInstall
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
...@@ -21,7 +20,6 @@ import com.yidianling.common.tools.RxKeyboardTool ...@@ -21,7 +20,6 @@ import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.StatusUtils
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.ui.login.contract.IInputPassWordContract import com.yidianling.user.ui.login.contract.IInputPassWordContract
import com.yidianling.user.ui.login.presenter.InputPassWordPresenterImpl import com.yidianling.user.ui.login.presenter.InputPassWordPresenterImpl
...@@ -152,17 +150,6 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -152,17 +150,6 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
UserBIConstants.POSITION_PHONE_REGISTER_CLICK, UserBIConstants.POSITION_PHONE_REGISTER_CLICK,
25 25
) )
if (OneKeyLoginHelp.openInstallKey.isNotEmpty() && StatusUtils.isUseOpenInstall) {
ActionCountUtils.baiduCount(
UserBIConstants.APP_REGISTER_PAGE,
UserBIConstants.POSITION_PHONE_REGISTER_CLICK,
25,
OneKeyLoginHelp.openInstallKey
)
// 用户注册成功后调用
OpenInstall.reportRegister();
}
} }
......
...@@ -12,10 +12,7 @@ import android.view.View ...@@ -12,10 +12,7 @@ import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import com.fm.openinstall.OpenInstall import com.blankj.utilcode.util.ToastUtils
import com.fm.openinstall.listener.AppInstallAdapter
import com.fm.openinstall.model.AppData
import com.meituan.android.walle.WalleChannelReader
import com.mobile.auth.gatewayauth.* import com.mobile.auth.gatewayauth.*
import com.mobile.auth.gatewayauth.model.TokenRet import com.mobile.auth.gatewayauth.model.TokenRet
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
...@@ -32,6 +29,7 @@ import com.yidianling.common.tools.RxDeviceTool ...@@ -32,6 +29,7 @@ import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.R
import com.yidianling.user.StatusUtils import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
...@@ -71,7 +69,6 @@ object OneKeyLoginHelp { ...@@ -71,7 +69,6 @@ object OneKeyLoginHelp {
private var checkBoxHidden = false // 协议勾选框是否展示m-user private var checkBoxHidden = false // 协议勾选框是否展示m-user
var mPrivacyBeforeText = "登录即代表您同意" // 隐私协议文案 var mPrivacyBeforeText = "登录即代表您同意" // 隐私协议文案
private lateinit var mActivity: BaseActivity private lateinit var mActivity: BaseActivity
var openInstallKey = ""
fun sdkInit(activity: BaseActivity, appType: Int, authType: Int) { fun sdkInit(activity: BaseActivity, appType: Int, authType: Int) {
mActivity = activity mActivity = activity
...@@ -101,15 +98,10 @@ object OneKeyLoginHelp { ...@@ -101,15 +98,10 @@ object OneKeyLoginHelp {
} }
} }
// 获取渠道 // 获取渠道
// val channel = WalleChannelReader.getChannel(activity.applicationContext)
// checkBoxHidden = !(channel == "huawei" || channel == "vivo")
LogUtil.e("checkBoxHidde:$checkBoxHidden") LogUtil.e("checkBoxHidde:$checkBoxHidden")
if (!checkBoxHidden) { if (!checkBoxHidden) {
mPrivacyBeforeText = "同意" mPrivacyBeforeText = "同意"
} }
if (appType == YDL_USER_APP) {
getOpenInstallKey()
}
} }
/** /**
...@@ -306,9 +298,10 @@ object OneKeyLoginHelp { ...@@ -306,9 +298,10 @@ object OneKeyLoginHelp {
var loginLogo = "ic_ydl_login_logo" var loginLogo = "ic_ydl_login_logo"
var loginHeight = 40 var loginHeight = 40
var loginWidth = 118 var loginWidth = 118
var appPrivacyOneTip = "壹点灵用户使用协议" val appName= mActivity.resources.getString(R.string.user_login_name_start)
var appPrivacyOneTip = "${appName}用户使用协议"
var appPrivacyOne = "https://h5.ydl.com/SDUserProtol" var appPrivacyOne = "https://h5.ydl.com/SDUserProtol"
var appPrivacyTwo = "https://m.ydl.com/Protol/yinsi" var appPrivacyTwo = "https://m.ydl.com/Protol/yinsi/shdh"
if (mAppType == YDL_EXPERT_APP) { if (mAppType == YDL_EXPERT_APP) {
loginLogo = "ic_expert_login_logo" loginLogo = "ic_expert_login_logo"
loginHeight = 60 loginHeight = 60
...@@ -340,6 +333,7 @@ object OneKeyLoginHelp { ...@@ -340,6 +333,7 @@ object OneKeyLoginHelp {
.setRootViewId(AuthRegisterViewConfig.RootViewId.ROOT_VIEW_ID_BODY) .setRootViewId(AuthRegisterViewConfig.RootViewId.ROOT_VIEW_ID_BODY)
.setCustomInterface { .setCustomInterface {
UserIn.mainIntent(mActivity) UserIn.mainIntent(mActivity)
quitLoginPage()
} }
.build() .build()
) )
...@@ -422,7 +416,7 @@ object OneKeyLoginHelp { ...@@ -422,7 +416,7 @@ object OneKeyLoginHelp {
.setSwitchAccTextColor(Color.parseColor("#999999")) .setSwitchAccTextColor(Color.parseColor("#999999"))
.setSwitchOffsetY_B(80) .setSwitchOffsetY_B(80)
.setAppPrivacyOne("壹点灵用户使用协议", "https://h5.ydl.com/SDUserProtol") .setAppPrivacyOne("壹点灵用户使用协议", "https://h5.ydl.com/SDUserProtol")
.setAppPrivacyTwo("隐私协议", "https://m.ydl.com/Protol/yinsi") .setAppPrivacyTwo("隐私协议", "https://m.ydl.com/Protol/yinsi/shdh")
.setAppPrivacyColor(Color.parseColor("#bfbfbf"), Color.parseColor("#991da1f2")) .setAppPrivacyColor(Color.parseColor("#bfbfbf"), Color.parseColor("#991da1f2"))
.setCheckboxHidden(checkBoxHidden) // 设置是否同意协议的checkbox隐藏 .setCheckboxHidden(checkBoxHidden) // 设置是否同意协议的checkbox隐藏
.setCheckBoxHeight(22) .setCheckBoxHeight(22)
...@@ -483,12 +477,8 @@ object OneKeyLoginHelp { ...@@ -483,12 +477,8 @@ object OneKeyLoginHelp {
"", "",
"", "",
25, 25,
openInstallKey ""
) )
if (OneKeyLoginHelp.openInstallKey.isNotEmpty() && StatusUtils.isUseOpenInstall) {
// 用户注册成功后调用
OpenInstall.reportRegister()
}
} else { } else {
ActionCountUtils.countUid( ActionCountUtils.countUid(
UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,
...@@ -595,21 +585,6 @@ object OneKeyLoginHelp { ...@@ -595,21 +585,6 @@ object OneKeyLoginHelp {
} }
/** /**
* CPA(CPS)推广渠道统计
* 获取安装携带的参数
* 注:1、不要在 init 之后,紧接着调用 getInstall,防止网络等问题导致 getInstall 超时,从而获取数据失败
*/
private fun getOpenInstallKey() {
OpenInstall.getInstall(object : AppInstallAdapter() {
override fun onInstall(appData: AppData) {
// 获取渠道数据 转换值同步IOS "AppData{channel='" + this.channel + '\'' + ", data='" + this.data + '\'' + '}'
openInstallKey =
appData.toString().replace("AppData", "").replace("channel", "channelCode")
}
})
}
/**
* @param isOpenDialog true: 使用弹窗展示一键登录 * @param isOpenDialog true: 使用弹窗展示一键登录
* false: 使用全页面展示一键登录 * false: 使用全页面展示一键登录
* @return true:登录。false:未登录 * @return true:登录。false:未登录
......
...@@ -13,7 +13,6 @@ import android.view.View ...@@ -13,7 +13,6 @@ import android.view.View
import android.view.animation.AnimationUtils import android.view.animation.AnimationUtils
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.fm.openinstall.OpenInstall
import com.meituan.android.walle.WalleChannelReader import com.meituan.android.walle.WalleChannelReader
import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper
import com.mobile.auth.gatewayauth.ResultCode import com.mobile.auth.gatewayauth.ResultCode
...@@ -56,8 +55,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers ...@@ -56,8 +55,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.user_activity_register_and_login_bottom.* import kotlinx.android.synthetic.main.user_activity_register_and_login_bottom.*
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.* import kotlinx.android.synthetic.main.user_activity_register_and_login_new.*
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.img_reg_back
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.view_lin
/** /**
* @author jiucheng * @author jiucheng
...@@ -160,12 +157,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -160,12 +157,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
"", "",
"", "",
25, 25,
OneKeyLoginHelp.openInstallKey ""
) )
if (OneKeyLoginHelp.openInstallKey.isNotEmpty() && StatusUtils.isUseOpenInstall) {
// 用户注册成功后调用
OpenInstall.reportRegister();
}
} }
...@@ -198,7 +191,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -198,7 +191,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
} }
private fun initView() { private fun initView() {
val str = "壹点灵用户使用协议、隐私保护政策" val name = resources.getString(R.string.user_login_name_start)
val str = "${name}用户使用协议、隐私保护政策"
var start = name.length
val spannableString = SpannableString(str) val spannableString = SpannableString(str)
spannableString.setSpan(object : ClickableSpan() { spannableString.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
...@@ -217,7 +212,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -217,7 +212,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
) )
} }
} }
}, 3, 9, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) }, start, start+6, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
spannableString.setSpan(object : ClickableSpan() { spannableString.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds) super.updateDrawState(ds)
...@@ -235,7 +230,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -235,7 +230,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
) )
} }
} }
}, 10, str.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) }, start + 7, str.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
tv_protocol.text = spannableString tv_protocol.text = spannableString
tv_protocol.movementMethod = LinkMovementMethod.getInstance() tv_protocol.movementMethod = LinkMovementMethod.getInstance()
...@@ -494,21 +489,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -494,21 +489,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
} }
/** /**
* 三方登录成功后绑定手机号
*/
private fun umengLoginBindPhone(accessCode: String?) {
val param = BindPhoneJavaParam(
accessCode!!,
countryCode!!,
userPhoneNumber!!,
"",
UserHelper.getUserInfo()!!.uid!!
)
mPresenter.bindPhone(param)
}
/**
* 动画 * 动画
*/ */
private fun startAnim() { private fun startAnim() {
......
...@@ -6,13 +6,12 @@ import android.content.Context ...@@ -6,13 +6,12 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import androidx.core.content.ContextCompat
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.view.animation.AnimationUtils import android.view.animation.AnimationUtils
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.EditText import android.widget.EditText
import com.fm.openinstall.OpenInstall import androidx.core.content.ContextCompat
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
...@@ -22,7 +21,6 @@ import com.yidianling.common.tools.RxKeyboardTool ...@@ -22,7 +21,6 @@ import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper import com.yidianling.user.UserHelper
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.request.BindPhoneJavaParam import com.yidianling.user.http.request.BindPhoneJavaParam
...@@ -271,23 +269,12 @@ class VerificationCodeActivity : ...@@ -271,23 +269,12 @@ class VerificationCodeActivity :
override fun baiduActionBury() { override fun baiduActionBury() {
if (StatusUtils.isUseOpenInstall) {
ActionCountUtils.baiduCount(
UserBIConstants.APP_REGISTER_PAGE,
UserBIConstants.POSITION_CODE_REGISTER_CLICK,
25,
OneKeyLoginHelp.openInstallKey
)
// 用户注册成功后调用
OpenInstall.reportRegister();
} else {
ActionCountUtils.baiduCount( ActionCountUtils.baiduCount(
UserBIConstants.APP_REGISTER_PAGE, UserBIConstants.APP_REGISTER_PAGE,
UserBIConstants.POSITION_CODE_REGISTER_CLICK, UserBIConstants.POSITION_CODE_REGISTER_CLICK,
25 25
) )
} }
}
override fun verificationErrorCode() { override fun verificationErrorCode() {
//验证码异常回调 //验证码异常回调
......
...@@ -3,7 +3,6 @@ package com.yidianling.user.ui.login.presenter ...@@ -3,7 +3,6 @@ package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.text.TextUtils import android.text.TextUtils
import com.fm.openinstall.OpenInstall
import com.umeng.socialize.bean.SHARE_MEDIA import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
...@@ -230,7 +229,7 @@ class LoginPresenterImpl(view: ILoginContract.View) : ...@@ -230,7 +229,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
"", "",
"", "",
25, 25,
OneKeyLoginHelp.openInstallKey ""
) )
} else { } else {
mView.baiduActionBury( mView.baiduActionBury(
...@@ -244,11 +243,9 @@ class LoginPresenterImpl(view: ILoginContract.View) : ...@@ -244,11 +243,9 @@ class LoginPresenterImpl(view: ILoginContract.View) :
"", "",
"", "",
25, 25,
OneKeyLoginHelp.openInstallKey ""
) )
} }
// 用户注册成功后调用
OpenInstall.reportRegister()
} else { } else {
ActionCountUtils.countUid( ActionCountUtils.countUid(
UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK, UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,
......
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ResourceName">
<string name="user_login_name_start">心理咨询</string>
</resources>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ResourceName">
<string name="user_login_name_start">壹点灵</string>
</resources>
package com.ydl.ydlcommon.app
import android.content.Context
import com.apm.insight.MonitorCrash
import com.apm.insight.log.VLog
import com.bytedance.apm.insight.ApmInsight
import com.bytedance.apm.insight.ApmInsightInitConfig
import com.bytedance.apm.insight.IDynamicParams
import com.meituan.android.walle.WalleChannelReader
object Apm {
private var crash: MonitorCrash? = null
fun initApm(context: Context, appId: String, vCode: Long, vName: String, debug: Boolean, uidCall: () -> String?) {
val channel = if (debug) "debug" else WalleChannelReader.getChannel(context)
crash = MonitorCrash.init(
context,
appId,
vCode,
vName
)
crash?.config()?.setChannel(channel)
val builder = ApmInsightInitConfig.builder()
.aid(appId)
//.batteryMonitor(true)
//.cpuMonitor(true)
//.fpsMonitor(true)
//.seriousBlockDetect(true)
.blockDetect(true)
// .enableWebViewMonitor(true)
.channel(channel)
.debugMode(debug)
.enableLogRecovery(true)
.setDynamicParams(ApmParams(crash, uidCall))
ApmInsight.getInstance().init(context, builder.build())
VLog.init(context, 20)
}
fun reportCustom(type: String, msg: String, throwable: Throwable) {
crash?.reportCustomErr(msg, type, throwable)
}
}
private class ApmParams(val crash: MonitorCrash?, val uidCall: () -> String?) : IDynamicParams() {
override fun getUserUniqueID(): String? {
return null
}
override fun getAbSdkVersion(): String? {
return null
}
override fun getSsid(): String? {
return null
}
override fun getDid(): String? {
return null
}
override fun getUserId(): String? {
val uid = uidCall.invoke()
crash?.config()?.setUID(uid)
return uid
}
}
\ No newline at end of file
...@@ -4,7 +4,9 @@ import android.annotation.SuppressLint ...@@ -4,7 +4,9 @@ import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.text.TextUtils import android.text.TextUtils
import com.facebook.stetho.okhttp3.StethoInterceptor import com.facebook.stetho.okhttp3.StethoInterceptor
import com.google.gson.Gson
import com.ydl.pushserver.pushagent.YdlPushAgent import com.ydl.pushserver.pushagent.YdlPushAgent
import com.ydl.ydlcommon.app.Apm
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.bean.AuthBean import com.ydl.ydlcommon.bean.AuthBean
import com.ydl.ydlcommon.bean.GatewayRequestDTO import com.ydl.ydlcommon.bean.GatewayRequestDTO
...@@ -15,6 +17,7 @@ import com.ydl.ydlcommon.data.http.GsonProvider ...@@ -15,6 +17,7 @@ import com.ydl.ydlcommon.data.http.GsonProvider
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.api.ApiRequestUtil import com.ydl.ydlcommon.data.http.api.ApiRequestUtil
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.AliYunLogConfig import com.ydl.ydlcommon.utils.log.AliYunLogConfig
...@@ -23,7 +26,6 @@ import com.ydl.ydlnet.builder.config.OkHttpConfig ...@@ -23,7 +26,6 @@ import com.ydl.ydlnet.builder.config.OkHttpConfig
import com.ydl.ydlnet.builder.factory.ApiFactory import com.ydl.ydlnet.builder.factory.ApiFactory
import com.ydl.ydlnet.builder.interceptor.log.RequestHandler import com.ydl.ydlnet.builder.interceptor.log.RequestHandler
import com.ydl.ydlnet.builder.interceptor.log.RequestLogInterceptor import com.ydl.ydlnet.builder.interceptor.log.RequestLogInterceptor
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxAppTool import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
...@@ -31,6 +33,8 @@ import io.reactivex.functions.Action ...@@ -31,6 +33,8 @@ import io.reactivex.functions.Action
import okhttp3.* import okhttp3.*
import okio.Buffer import okio.Buffer
import okio.BufferedSink import okio.BufferedSink
import java.io.EOFException
import java.nio.charset.Charset
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
import kotlin.collections.HashMap import kotlin.collections.HashMap
...@@ -141,7 +145,8 @@ class HttpConfig { ...@@ -141,7 +145,8 @@ class HttpConfig {
commonParams(), commonParams(),
requestHead(appName), requestHead(appName),
addEncryptionHeaderParamsInterceptor(), addEncryptionHeaderParamsInterceptor(),
responseErrorInterceptor() responseErrorInterceptor(),
respErrorInterceptor()
) )
.setRequestHandler(getRequestHandler()) .setRequestHandler(getRequestHandler())
.setReadTimeout(15) .setReadTimeout(15)
...@@ -183,6 +188,53 @@ class HttpConfig { ...@@ -183,6 +188,53 @@ class HttpConfig {
} }
} }
private fun respErrorInterceptor(): Interceptor {
return Interceptor {
val req = it.request()
val resp = it.proceed(req)
if (appDebug) return@Interceptor resp
val code = resp.code()
val message = resp.message()
val api = req.url().encodedPath()
if (!resp.isSuccessful) {
Apm.reportCustom("network_request_error", "${api}(${code},${message})", Exception("${api}(${code},${message})"))
} else {
try {
val body = resp.body() ?: return@Interceptor resp
val buffer = body.source().buffer()
if(!isPlaintext(buffer)) return@Interceptor resp
val readString = buffer.clone().readString(Charset.forName("UTF-8"))
val fromJson = Gson().fromJson<BaseAPIResponse<Any>>(readString, BaseAPIResponse::class.java)
if (fromJson.code != "200") {
Apm.reportCustom("network_business_error", "${api}(${fromJson.code},${fromJson.msg})", Exception("${api}(${fromJson.code},${fromJson.msg})"))
}
} catch (throwable: Throwable) {
LogUtil.e(throwable.message)
}
}
return@Interceptor resp
}
}
private fun isPlaintext(buffer: Buffer): Boolean {
return try {
val prefix = Buffer()
val byteCount = if (buffer.size() < 64L) buffer.size() else 64L
buffer.copyTo(prefix, 0L, byteCount)
var i = 0
while (i < 16 && !prefix.exhausted()) {
val codePoint = prefix.readUtf8CodePoint()
if (Character.isISOControl(codePoint) && !Character.isWhitespace(codePoint)) {
return false
}
++i
}
true
} catch (var6: EOFException) {
false
}
}
/** /**
* 接口返回错误日志埋点 * 接口返回错误日志埋点
*/ */
......
...@@ -122,7 +122,9 @@ public class DeviceTool { ...@@ -122,7 +122,9 @@ public class DeviceTool {
@SuppressLint("MissingPermission") @SuppressLint("MissingPermission")
public static final String getIMEI() { public static final String getIMEI() {
Activity topTaskActivity = ActivityManager.Companion.getInstance().getTopTaskActivity(); Activity topTaskActivity = ActivityManager.Companion.getInstance().getTopTaskActivity();
if (!checkHasAgreeSecret()) {
return "";
}
try { try {
String imei = ""; String imei = "";
RxPermissions rxPermissions = new RxPermissions(topTaskActivity); RxPermissions rxPermissions = new RxPermissions(topTaskActivity);
...@@ -147,9 +149,22 @@ public class DeviceTool { ...@@ -147,9 +149,22 @@ public class DeviceTool {
} }
} }
/**
* 检查是否同意隐私协议
* */
public static boolean checkHasAgreeSecret() {
if (BuildConfig.DEBUG){
LogUtil.e("合规化:设备数据获取");
}
String hasAgreeSecret = SharedPreferencesEditor.getString("hasAgreeSecret");
return "true".equals(hasAgreeSecret);
}
public static String getEncryptionAndroidID() { public static String getEncryptionAndroidID() {
if (!checkHasAgreeSecret()) {
return "";
}
try { try {
@SuppressLint("HardwareIds") String id = Settings.Secure.getString( @SuppressLint("HardwareIds") String id = Settings.Secure.getString(
RxTool.getContext().getContentResolver(), RxTool.getContext().getContentResolver(),
...@@ -161,6 +176,9 @@ public class DeviceTool { ...@@ -161,6 +176,9 @@ public class DeviceTool {
} }
} }
public static String getAndroidID() { public static String getAndroidID() {
if (!checkHasAgreeSecret()) {
return "";
}
try { try {
@SuppressLint("HardwareIds") String id = Settings.Secure.getString( @SuppressLint("HardwareIds") String id = Settings.Secure.getString(
RxTool.getContext().getContentResolver(), RxTool.getContext().getContentResolver(),
...@@ -251,7 +269,9 @@ public class DeviceTool { ...@@ -251,7 +269,9 @@ public class DeviceTool {
} }
public static String getMac(Context context) { public static String getMac(Context context) {
if (!checkHasAgreeSecret()) {
return "02:00:00:00:00:00";
}
String strMac = null; String strMac = null;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
...@@ -281,6 +301,9 @@ public class DeviceTool { ...@@ -281,6 +301,9 @@ public class DeviceTool {
*GPRS链接和WIFI链接返回同一个MAC地址 *GPRS链接和WIFI链接返回同一个MAC地址
* */ * */
public static String getMacFromHardware() { public static String getMacFromHardware() {
if (!checkHasAgreeSecret()) {
return "02:00:00:00:00:00";
}
try { try {
List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces()); List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface nif : all) { for (NetworkInterface nif : all) {
...@@ -328,6 +351,9 @@ public class DeviceTool { ...@@ -328,6 +351,9 @@ public class DeviceTool {
* @return * @return
*/ */
public static String getLocalWifiIpAddress(Context context) { public static String getLocalWifiIpAddress(Context context) {
if (!checkHasAgreeSecret()) {
return "隐私协议未同意,不让获取";
}
try { try {
WifiManager wifiManager = (WifiManager) context WifiManager wifiManager = (WifiManager) context
...@@ -343,6 +369,9 @@ public class DeviceTool { ...@@ -343,6 +369,9 @@ public class DeviceTool {
//GPRS连接下的ip //GPRS连接下的ip
public static String getLocalGPRSIpAddress() { public static String getLocalGPRSIpAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {
NetworkInterface intf = en.nextElement(); NetworkInterface intf = en.nextElement();
...@@ -364,6 +393,9 @@ public class DeviceTool { ...@@ -364,6 +393,9 @@ public class DeviceTool {
* @return * @return
*/ */
public static String getNewMac() { public static String getNewMac() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces()); List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface nif : all) { for (NetworkInterface nif : all) {
...@@ -390,6 +422,9 @@ public class DeviceTool { ...@@ -390,6 +422,9 @@ public class DeviceTool {
return null; return null;
} }
public static String getLocalMacAddressFromWifiInfo(Context context) { public static String getLocalMacAddressFromWifiInfo(Context context) {
if (!checkHasAgreeSecret()) {
return null;
}
WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo winfo = wifi.getConnectionInfo(); WifiInfo winfo = wifi.getConnectionInfo();
String mac = winfo.getMacAddress(); String mac = winfo.getMacAddress();
...@@ -400,6 +435,9 @@ public class DeviceTool { ...@@ -400,6 +435,9 @@ public class DeviceTool {
* 获取IPV6地址 * 获取IPV6地址
* */ * */
public static String getLocalIpV6() { public static String getLocalIpV6() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
for (Enumeration<NetworkInterface> en = NetworkInterface for (Enumeration<NetworkInterface> en = NetworkInterface
.getNetworkInterfaces(); en.hasMoreElements(); ) { .getNetworkInterfaces(); en.hasMoreElements(); ) {
...@@ -425,7 +463,9 @@ public class DeviceTool { ...@@ -425,7 +463,9 @@ public class DeviceTool {
return null; return null;
} }
public static String getMacAddress(Context context) { public static String getMacAddress(Context context) {
if (!checkHasAgreeSecret()) {
return null;
}
// 如果是6.0以下,直接通过wifimanager获取 // 如果是6.0以下,直接通过wifimanager获取
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
String macAddress0 = getMacAddress0(context); String macAddress0 = getMacAddress0(context);
...@@ -465,6 +505,10 @@ public class DeviceTool { ...@@ -465,6 +505,10 @@ public class DeviceTool {
} }
private static String getMacAddress0(Context context) { private static String getMacAddress0(Context context) {
if (!checkHasAgreeSecret()) {
return null;
}
if (isAccessWifiStateAuthorized(context)) { if (isAccessWifiStateAuthorized(context)) {
WifiManager wifiMgr = (WifiManager) context WifiManager wifiMgr = (WifiManager) context
.getSystemService(Context.WIFI_SERVICE); .getSystemService(Context.WIFI_SERVICE);
...@@ -494,9 +538,10 @@ public class DeviceTool { ...@@ -494,9 +538,10 @@ public class DeviceTool {
Log.e("----->" + "NetInfoManager", "isAccessWifiStateAuthorized:" Log.e("----->" + "NetInfoManager", "isAccessWifiStateAuthorized:"
+ "access wifi state is enabled"); + "access wifi state is enabled");
return true; return true;
} else } else {
return false; return false;
} }
}
private static String loadFileAsString(String fileName) throws Exception { private static String loadFileAsString(String fileName) throws Exception {
FileReader reader = new FileReader(fileName); FileReader reader = new FileReader(fileName);
...@@ -522,6 +567,9 @@ public class DeviceTool { ...@@ -522,6 +567,9 @@ public class DeviceTool {
* @return * @return
*/ */
public static String getMacAddress() { public static String getMacAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
String strMacAddr = null; String strMacAddr = null;
try { try {
// 获得IpD地址 // 获得IpD地址
...@@ -547,6 +595,9 @@ public class DeviceTool { ...@@ -547,6 +595,9 @@ public class DeviceTool {
* @return * @return
*/ */
private static InetAddress getLocalInetAddress() { private static InetAddress getLocalInetAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
InetAddress ip = null; InetAddress ip = null;
try { try {
// 列举 // 列举
...@@ -582,6 +633,9 @@ public class DeviceTool { ...@@ -582,6 +633,9 @@ public class DeviceTool {
* @return * @return
*/ */
public static String getLocalIpAddress() { public static String getLocalIpAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
for (Enumeration<NetworkInterface> en = NetworkInterface for (Enumeration<NetworkInterface> en = NetworkInterface
.getNetworkInterfaces(); en.hasMoreElements(); ) { .getNetworkInterfaces(); en.hasMoreElements(); ) {
...@@ -601,6 +655,9 @@ public class DeviceTool { ...@@ -601,6 +655,9 @@ public class DeviceTool {
} }
public static String getMachineHardwareAddress() { public static String getMachineHardwareAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
Enumeration<NetworkInterface> interfaces = null; Enumeration<NetworkInterface> interfaces = null;
try { try {
interfaces = NetworkInterface.getNetworkInterfaces(); interfaces = NetworkInterface.getNetworkInterfaces();
...@@ -646,6 +703,9 @@ public class DeviceTool { ...@@ -646,6 +703,9 @@ public class DeviceTool {
} }
public static String getLocalMacAddressFromBusybox() { public static String getLocalMacAddressFromBusybox() {
if (!checkHasAgreeSecret()) {
return "";
}
String result = ""; String result = "";
String Mac = ""; String Mac = "";
result = callCmd("busybox ifconfig", "HWaddr"); result = callCmd("busybox ifconfig", "HWaddr");
......
...@@ -434,6 +434,10 @@ class ActionCountUtils { ...@@ -434,6 +434,10 @@ class ActionCountUtils {
* @return * @return
*/ */
fun getIpAddress(context: Context): String { fun getIpAddress(context: Context): String {
if (!DeviceTool.checkHasAgreeSecret()) {
return ""
}
// 获取WiFi服务 // 获取WiFi服务
val wifiManager = context.getSystemService(Context.WIFI_SERVICE) as WifiManager val wifiManager = context.getSystemService(Context.WIFI_SERVICE) as WifiManager
// 判断WiFi是否开启 // 判断WiFi是否开启
......
...@@ -3,7 +3,6 @@ package com.ydl.webview; ...@@ -3,7 +3,6 @@ package com.ydl.webview;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog;
import android.content.ClipData; import android.content.ClipData;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
...@@ -35,7 +34,6 @@ import com.tencent.smtt.sdk.WebView; ...@@ -35,7 +34,6 @@ import com.tencent.smtt.sdk.WebView;
import com.tencent.smtt.sdk.WebViewClient; import com.tencent.smtt.sdk.WebViewClient;
import com.umeng.socialize.UMShareAPI; import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA; import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ydl.event.ReloadUrlEvent;
import com.ydl.utils.PopUtils; import com.ydl.utils.PopUtils;
import com.ydl.utils.ProxyCheckUtils; import com.ydl.utils.ProxyCheckUtils;
import com.ydl.utils.WebUrlParamsUtils; import com.ydl.utils.WebUrlParamsUtils;
...@@ -534,7 +532,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -534,7 +532,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
public void openShareMenu(H5JsBean.H5JsCmd.Params params) { public void openShareMenu(H5JsBean.H5JsCmd.Params params) {
if (params.getShare() != null) { if (params.getShare() != null) {
if (params.getShare().getType().equals("Meditation")){ if ("Meditation".equals(params.getShare().getType())){
shareUrl = params.getShare().getShare_url(); shareUrl = params.getShare().getShare_url();
shareTitle = params.getShare().getTitle(); shareTitle = params.getShare().getTitle();
shareDesc = params.getShare().getDesc(); shareDesc = params.getShare().getDesc();
...@@ -1388,7 +1386,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -1388,7 +1386,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
super.onDestroy(); super.onDestroy();
cancelSendNetLossMessage(); cancelSendNetLossMessage();
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
super.onDestroy();
if (wv_content != null) { if (wv_content != null) {
wv_content.destroy(); wv_content.destroy();
} }
......
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