Commit eeba7f1c by 王佳洋

Merge remote-tracking branch 'origin/d/v4.4.07' into feat/wjy/audioPlay

# Conflicts:
#	app/src/main/java/com/ydl/component/service/web/WVClickAbstractListener.java
#	build.gradle
parents 247503d2 200515d3
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.audioim.api">
</manifest>
\ No newline at end of file
package com.ydl.audioim.api
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.template.IProvider
/**
* Created by Ykai on 2022/7/26.
*/
interface IAudioImService : IProvider{
/**
* YDLavManager初始化方法
*/
fun yDLAvManagerInit(context: Context, appId: String)
/**
* 获取rtm是否在线
*/
fun getIsOnlineRtm(): Boolean
/**
* rtm登录返回并登录状态
*/
fun loginRtm(userId:String?,event: (isSuccess: Boolean, msg: String?) -> Unit)
/**
* rtm登录
*/
fun loginRtm(userId:String?)
/**
* 拨打语音电话转axb弹窗
*/
fun openAxbDialog(activity: Activity?, type:Int, phoneNumber: String?)
/**
* 事件上报
*/
fun callEventSave(status: String, res: String, session: String?, line: String)
}
\ No newline at end of file
...@@ -18,7 +18,7 @@ public class ExpertInfoBean { ...@@ -18,7 +18,7 @@ public class ExpertInfoBean {
public String listenerIsOpen; public String listenerIsOpen;
public String listenOrderStatus; public String listenOrderStatus;
public String channelId; public String channelId;
public ExpertInfoBean.ListenRemainingTime remainingTime; public ListenRemainingTime remainingTime;
public String totalDuration; public String totalDuration;
public String commentUrl; public String commentUrl;
......
package com.ydl.audioim; package com.ydl.audioim.listener;
/** /**
* @author jiucheng * @author jiucheng
......
...@@ -38,7 +38,5 @@ interface IConfideService : IProvider { ...@@ -38,7 +38,5 @@ interface IConfideService : IProvider {
uid: String uid: String
) )
fun isOnlineRtm():Boolean
fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?) fun requestConfidePermission(activity: FragmentActivity, call: ((Boolean) -> Unit)?)
} }
\ No newline at end of file
package com.ydl.confide.home.event package com.ydl.confide.event
data class ChangeAnotherExpertEvent( data class ChangeAnotherExpertEvent(
var doctorID: String, var doctorID: String,
var title: String, var title: String,
var uid: String, var uid: String,
var linkUrl: String var linkUrl: String
) )
\ No newline at end of file
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
package com.ydl.confide.event
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
...@@ -30,4 +30,6 @@ android { ...@@ -30,4 +30,6 @@ android {
dependencies { dependencies {
implementation "com.alibaba:arouter-api:$arouter_api" implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compileOnly(project(":ydl-webview"))
} }
\ No newline at end of file
...@@ -4,9 +4,10 @@ import android.app.Activity ...@@ -4,9 +4,10 @@ import android.app.Activity
import android.content.Context import android.content.Context
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider import com.alibaba.android.arouter.facade.template.IProvider
import com.ydl.webview.H5JsBean
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.bean.GuideBean import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.OnBottomWordListener
/** /**
* Created by xj on 2019/11/14. * Created by xj on 2019/11/14.
...@@ -51,4 +52,7 @@ interface IConsultantService: IProvider { ...@@ -51,4 +52,7 @@ interface IConsultantService: IProvider {
//获取底纹词 //获取底纹词
fun getbottomWord(type: Int, listener: OnBottomWordListener) fun getbottomWord(type: Int, listener: OnBottomWordListener)
// 预览资源
fun resourceToPreview(dataList: List<H5JsBean.MediaInfo>?, params: H5JsBean.H5JsCmd.Params, activity: Activity)
} }
\ No newline at end of file
package com.yidianling.im.event package com.yidianling.im.api.event
data class CloseBottomWebviewEvent( var close:Boolean) data class CloseBottomWebviewEvent( var close:Boolean)
\ No newline at end of file
...@@ -188,4 +188,6 @@ interface IImService : IProvider { ...@@ -188,4 +188,6 @@ interface IImService : IProvider {
fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String) fun showConsultServiceDialog(activity: Activity, toUid: String, doctorId: String)
fun dismissConsultServiceDialog(); fun dismissConsultServiceDialog();
/**群聊*/
fun startTeamSession(activity: Activity, tid: String, doctorId: String)
} }
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.js.api">
</manifest>
\ No newline at end of file
package com.ydl.js.api
import com.alibaba.android.arouter.facade.template.IProvider
interface IJsService : IProvider {
fun isH5Open(): Boolean
fun isMainOpen(): Boolean
fun setH5Open(open: Boolean)
fun setMainOpen(open: Boolean)
}
\ No newline at end of file
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply from: "../../publish.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "com.google.code.gson:gson:2.8.5"
implementation "com.alibaba:arouter-api:$arouter_api"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.muse.api">
</manifest>
\ No newline at end of file
package com.ydl.muse.api
import android.app.Activity
import com.alibaba.android.arouter.facade.template.IProvider
interface IMuseService : IProvider {
fun switchSound(activity: Activity,
mediaId: Int, meditationId: Long, meditationType: Int, businessType: Int,
buried: String?, mediaUrl: String?, mediaCoverUrl: String?,
title: String?, desc: String?, status: Int
)
}
\ No newline at end of file
...@@ -221,6 +221,8 @@ dependencies { ...@@ -221,6 +221,8 @@ dependencies {
implementation project(':m-fm') implementation project(':m-fm')
implementation project(":api:fm") implementation project(":api:fm")
implementation project(':ydl-tuicore') implementation project(':ydl-tuicore')
implementation project(':m-js')
implementation project(':api:js')
implementation rootProject.ext.dependencies["retrofit-url-manager"] implementation rootProject.ext.dependencies["retrofit-url-manager"]
......
package com.ydl.component.service;
import android.app.Activity;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.tencent.smtt.sdk.WebView;
import com.ydl.component.service.web.WVClickAbstractListener;
import com.ydl.component.service.web.WebJavascriptHandler;
import com.ydl.webview.IJavascriptHandler;
import com.ydl.webview.IWebService;
import com.ydl.webview.TellData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Created by haorui on 2019-10-10.
* Des:
*/
@Route(path = "/web/webservice")
public class WebServiceImpl implements IWebService {
@Override
public void init(Context context) {
}
@NotNull
@Override
public IJavascriptHandler getJavascripHandler(@NotNull Activity activity, @Nullable WebView webView, @NotNull TellData tellData) {
return new WebJavascriptHandler(webView, new WVClickAbstractListener(activity));
}
}
/build
\ No newline at end of file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.cxzapp.yidianling"
minSdk 21
targetSdk 28
versionCode 1
versionName "1.0"
flavorDimensions "versionCode"
ndk {
abiFilters "arm64-v8a"
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "e4b0d0bb7ef01053c93e25ba", //JPush上注册的包名对应的appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
XIAOMI_APPKEY : "MI-5241743243980",//小米平台注册的appkey
XIAOMI_APPID : "MI-2882303761517432980",//小米平台注册的appid
HUAWEI_APPID : "10444675",//华为平台注册的appid
OPPO_APPKEY : "OP-afk71f35VogGw0w0wKsookksc", // OPPO平台注册的appkey
OPPO_APPID : "OP-3245516", // OPPO平台注册的appid
OPPO_APPSECRET: "OP-691184F044acA7a6851F578451f67616",//OPPO平台注册的appsecret
VIVO_APPKEY : '67d79734-c9c5-4916-a6f4-ba2ef4df09a4',
VIVO_APPID : '14298',
MEIZU_APPKEY : "MZ-00d268d7228748479036f202d45b4ef2",//魅族平台注册的appkey
MEIZU_APPID : "MZ-120344",//魅族平台注册的appid
qqappid : "1105070461",
APPLICATIONID : rootProject.ext.ydl_app["applicationId"]
]
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
exclude 'META-INF/proguard/coroutines.pro'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
signingConfigs {
release {
storeFile file("../app/keystore.jks")
storePassword "123456"
keyAlias "ydl"
keyPassword "123456"
}
}
buildTypes {
debug{
signingConfig signingConfigs.release
}
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
signingConfigs {
release {
storeFile file("keystore.jks")
storePassword "123456"
keyAlias "ydl"
keyPassword "123456"
}
}
productFlavors {
ydl{}
xlzx{}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
repositories {
flatDir {
dirs 'aar'
}
}
dependencies {
implementation fileTree(dir: 'aar', include: ['*.aar'])
implementation(project(":ydl-flutter-base"))
implementation(project(":ydl-media"))
implementation(project(":ydl-net"))
implementation(project(":ydl-pay"))
implementation(project(":ydl-platform"))
implementation(project(":ydl-tuicore"))
implementation(project(":ydl-utils"))
implementation(project(":ydl-webview"))
implementation(project(":m-article"))
implementation(project(":m-audioim"))
implementation(project(":m-confide"))
implementation(project(":m-consultant"))
implementation(project(":m-course"))
implementation(project(":m-dynamic"))
implementation(project(":m-fm"))
implementation(project(":m-home"))
implementation(project(":m-im"))
implementation(project(":m-js"))
implementation(project(":m-muse"))
implementation(project(":m-tests"))
implementation(project(":m-user"))
implementation('com.ydl.debugkit:debugkit:1.0.0')
implementation('com.ydl.aar:heytap:3.0.0')
implementation "com.ydl.lib:smart_spa:0.0.4"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
implementation 'com.volcengine:apm_insight_crash:1.4.5'
implementation 'com.meituan.android.walle:library:1.1.5'
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
// 权限库
implementation 'com.hjq:xxpermissions:10.2'
// 时间选择器
implementation 'com.contrarywind:Android-PickerView:4.1.9'
// sophix hotfix
implementation 'com.aliyun.ams:alicloud-android-hotfix:3.3.5'
implementation 'com.github.feeeei:CircleSeekbar:v1.1.2'
//====================极光推送====================
implementation 'cn.jiguang.sdk:jpush:4.6.4'
implementation 'cn.jiguang.sdk:jcore:3.2.4'
implementation 'cn.jiguang.sdk.plugin:oppo:4.6.4'
implementation 'cn.jiguang.sdk.plugin:vivo:4.6.4'
implementation 'cn.jiguang.sdk.plugin:meizu:4.6.4'
implementation 'cn.jiguang.sdk.plugin:huawei:4.6.4'
implementation 'cn.jiguang.sdk.plugin:meizu:4.6.4'
implementation 'cn.jiguang.sdk.plugin:xiaomi:4.6.4'
implementation 'com.huawei.hms:push:5.3.0.304'
//====================云信基础库====================
implementation 'com.ydl:nim-base:1.1.0.7'
implementation 'com.netease.nimlib:basesdk:9.1.1'
implementation 'com.netease.nimlib:avchat:9.1.1'
implementation 'com.netease.nimlib:nrtc:9.1.1'
//OPPO推送需要单独引入
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'commons-codec:commons-codec:1.6'
implementation 'androidx.annotation:annotation:1.1.0'
//====================YDL 功能库====================
implementation "com.ydl.aar:resource:0.0.1-ydl"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.cxzapp.yidianling">
</manifest>
\ No newline at end of file
...@@ -14,7 +14,7 @@ buildscript { ...@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3' ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
componentVersion = "0.3.0.26-SNAPSHOT" componentVersion = "0.3.0.18"
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -75,4 +75,5 @@ dependencies { ...@@ -75,4 +75,5 @@ dependencies {
api project(':ydl-webview') api project(':ydl-webview')
implementation project(":api:user") implementation project(":api:user")
implementation project(":api:im") implementation project(":api:im")
implementation project(":api:audioim")
} }
...@@ -32,6 +32,7 @@ import com.ydl.audioim.http.command.ConnectCommand ...@@ -32,6 +32,7 @@ import com.ydl.audioim.http.command.ConnectCommand
import com.ydl.audioim.http.command.ConnectExceptionCommand import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.http.command.NoticePushCommand import com.ydl.audioim.http.command.NoticePushCommand
import com.ydl.audioim.http.command.PayLoad import com.ydl.audioim.http.command.PayLoad
import com.ydl.audioim.listener.IntentConstants
import com.ydl.audioim.player.AudioPlayer import com.ydl.audioim.player.AudioPlayer
import com.ydl.audioim.presenter.AudioHomePresenterImpl import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.router.AudioImIn import com.ydl.audioim.router.AudioImIn
...@@ -673,12 +674,12 @@ class AudioHomeActivity : ...@@ -673,12 +674,12 @@ class AudioHomeActivity :
tv_name.text = expertName tv_name.text = expertName
// tv_tips.text = expertTips // tv_tips.text = expertTips
var time = totalDuration?.minus(remainTime!!.toInt()) val time = totalDuration?.minus(remainTime!!.toInt())
tv_remain_time.text = DateUtils.formatTime((time).toString()) tv_remain_time.text = DateUtils.formatTime((time).toString())
val timeTotal= totalDuration?.div(60); val timeTotal= totalDuration?.div(60);
tv_totalDuration.text="(满${timeTotal}分钟自动挂断,限24小时内拨打)" tv_totalDuration.text="(满${timeTotal}分钟自动挂断,限24小时内拨打)"
if (!TextUtils.isEmpty(expertHeadUrl)) { if (!TextUtils.isEmpty(expertHeadUrl)) {
var option = SimpleImageOpConfiger() val option = SimpleImageOpConfiger()
option.errorPic = R.drawable.audioim_head_place_hold_pic option.errorPic = R.drawable.audioim_head_place_hold_pic
option.loadingPic = R.drawable.audioim_head_place_hold_pic option.loadingPic = R.drawable.audioim_head_place_hold_pic
option.transform = 0 option.transform = 0
...@@ -1425,7 +1426,7 @@ class AudioHomeActivity : ...@@ -1425,7 +1426,7 @@ class AudioHomeActivity :
null, null,
channelId channelId
) )
var cmd = NoticePushCommand() val cmd = NoticePushCommand()
cmd.data = msgBean cmd.data = msgBean
cmd.pushId = listenerUid cmd.pushId = listenerUid
if (isCall) { if (isCall) {
...@@ -1452,6 +1453,8 @@ class AudioHomeActivity : ...@@ -1452,6 +1453,8 @@ class AudioHomeActivity :
LogUtil.e("播放结束音频") LogUtil.e("播放结束音频")
//播放结束音频 //播放结束音频
playFinishMusic() playFinishMusic()
// 声网离开房间
voiceManage?.getVoiceApi()?.leaveChannel()
} }
} }
...@@ -1577,11 +1580,11 @@ class AudioHomeActivity : ...@@ -1577,11 +1580,11 @@ class AudioHomeActivity :
eventType: String = "99", eventType: String = "99",
callback: YDLavManager.UploadExceptionCallback? callback: YDLavManager.UploadExceptionCallback?
) { ) {
var time: String = (System.currentTimeMillis() / 1000).toString() val time: String = (System.currentTimeMillis() / 1000).toString()
var uid: String = val uid: String =
ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!! ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid!!
var payLoad = PayLoad(channelId ?: "0", time, uid, "1", "999", message) val payLoad = PayLoad(channelId ?: "0", time, uid, "1", "999", message)
var connectException = val connectException =
ConnectExceptionCommand(time + zhu, "2", eventType, payLoad, callStatus) ConnectExceptionCommand(time + zhu, "2", eventType, payLoad, callStatus)
YDLavManager.instances.uploadException(connectException, callback) YDLavManager.instances.uploadException(connectException, callback)
} }
...@@ -1597,10 +1600,6 @@ class AudioHomeActivity : ...@@ -1597,10 +1600,6 @@ class AudioHomeActivity :
} }
} }
override fun finishActivity() {
leaveChannel()
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
findRouteService(IImService::class.java).unregisterObserveCustomNotification(notificationCallback) findRouteService(IImService::class.java).unregisterObserveCustomNotification(notificationCallback)
...@@ -1640,7 +1639,10 @@ class AudioHomeActivity : ...@@ -1640,7 +1639,10 @@ class AudioHomeActivity :
localPowerManager = null localPowerManager = null
if (null != voiceManage && null != voiceManage?.getVoiceApi()) { if (null != voiceManage && null != voiceManage?.getVoiceApi()) {
voiceManage?.getVoiceApi()?.leaveChannel() if (!isLeavelChannel) {
// 声网离开房间
voiceManage?.getVoiceApi()?.leaveChannel()
}
voiceManage?.getVoiceApi()?.destroy() voiceManage?.getVoiceApi()?.destroy()
voiceManage = null voiceManage = null
} }
......
...@@ -398,7 +398,7 @@ class YDLavManager { ...@@ -398,7 +398,7 @@ class YDLavManager {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) { fun login(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
if (TextUtils.isEmpty(userId) || userId ?: "0" <= "0") { if (TextUtils.isEmpty(userId) || (userId ?: "0") <= "0") {
//如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录 //如果uid为空或小于等于0 ,则不进行登录,因为uid为0也会登录成功,会导致后面uid正确时无法登录
LogUtil.e("[agora]login-uid:$userId") LogUtil.e("[agora]login-uid:$userId")
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
......
...@@ -4,7 +4,6 @@ import com.ydl.audioim.bean.ConnectBean ...@@ -4,7 +4,6 @@ import com.ydl.audioim.bean.ConnectBean
import com.ydl.audioim.http.command.* import com.ydl.audioim.http.command.*
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.mvp.base.IModel import com.ydl.ydlcommon.mvp.base.IModel
import com.ydl.ydlcommon.mvp.base.IPresenter import com.ydl.ydlcommon.mvp.base.IPresenter
import com.ydl.ydlcommon.mvp.base.IView import com.ydl.ydlcommon.mvp.base.IView
...@@ -29,10 +28,6 @@ interface IAudioHomeActivityContract { ...@@ -29,10 +28,6 @@ interface IAudioHomeActivityContract {
*/ */
fun dismissProgressView() fun dismissProgressView()
/**
* 关闭窗口
*/
fun finishActivity()
/** /**
*切换axb回调 *切换axb回调
......
package com.ydl.audioim.modular
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.widget.AxbConfirmDialog
/**
* Created by Ykai on 2022/7/26.
*/
@Route(path = "/audioim/AudioImService")
class AudioImServiceImp : IAudioImService {
override fun yDLAvManagerInit(context: Context, appId: String) {
YDLavManager.instances.init(context, appId)
}
override fun getIsOnlineRtm(): Boolean {
return YDLavManager.isOnlineRtm
}
override fun loginRtm(userId: String?, event: (isSuccess: Boolean, msg: String?) -> Unit) {
YDLavManager.instances.login(userId, event)
}
override fun loginRtm(userId: String?) {
YDLavManager.instances.login(userId)
}
override fun openAxbDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() {
phoneNumber?.let {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$phoneNumber"))
activity?.startActivity(phoneIntent)
}
}
override fun onClose() {
}
})
dialog.show()
}
override fun callEventSave(status: String, res: String, session: String?, line: String) {
YDLavManager.instances.callEventSave(status, res, session, line)
}
override fun init(context: Context?) {
}
}
\ No newline at end of file
# 声网module
\ No newline at end of file
...@@ -71,10 +71,10 @@ dependencies { ...@@ -71,10 +71,10 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
api project(':ydl-media') api project(':ydl-media')
api project(':ydl-platform') api project(':ydl-platform')
api project(':m-audioim')
api project(":ydl-pay") api project(":ydl-pay")
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-utils') api project(':ydl-utils')
implementation project(":api:audioim")
implementation project(":api:im") implementation project(":api:im")
implementation project(":api:user") implementation project(":api:user")
implementation project(":api:consultant") implementation project(":api:consultant")
......
...@@ -27,8 +27,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment ...@@ -27,8 +27,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.tencent.smtt.export.external.interfaces.JsResult import com.tencent.smtt.export.external.interfaces.JsResult
import com.tencent.smtt.sdk.* import com.tencent.smtt.sdk.*
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.event.ChangeAnotherExpertEvent import com.ydl.confide.event.ConfideDialogEvent
import com.ydl.confide.home.event.ConfideDialogEvent import com.ydl.confide.event.ChangeAnotherExpertEvent
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
......
...@@ -24,7 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco ...@@ -24,7 +24,7 @@ import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController import com.facebook.drawee.interfaces.DraweeController
import com.jcodecraeer.xrecyclerview.ProgressStyle import com.jcodecraeer.xrecyclerview.ProgressStyle
import com.jcodecraeer.xrecyclerview.XRecyclerView import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.home.adapter.ConfideHomeAdapter import com.ydl.confide.home.adapter.ConfideHomeAdapter
...@@ -248,10 +248,8 @@ class ConfideHomeActivity : ...@@ -248,10 +248,8 @@ class ConfideHomeActivity :
} }
if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) { if (!confidedId.isNullOrBlank() && !doctorId.isNullOrBlank()) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login( findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { _: Boolean, _ ->
PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ ->
showPayOrDetail(confidedId, doctorId) showPayOrDetail(confidedId, doctorId)
} }
} else { } else {
......
...@@ -4,14 +4,12 @@ import android.app.Activity ...@@ -4,14 +4,12 @@ import android.app.Activity
import android.app.Application import android.app.Application
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.DialogFragment import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.confide.api.IConfideService import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.ConfideBottomSheetDialogFragment import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.ConfideHomeActivity import com.ydl.confide.home.ConfideHomeActivity
...@@ -20,6 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse ...@@ -20,6 +18,7 @@ import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.webview.TellData import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
/** /**
...@@ -73,7 +72,7 @@ class ConfdieServiceImpl : IConfideService { ...@@ -73,7 +72,7 @@ class ConfdieServiceImpl : IConfideService {
override fun ydlAvManagerLogin(uid: String?) { override fun ydlAvManagerLogin(uid: String?) {
YDLavManager.instances.login(uid) findRouteService(IAudioImService::class.java).loginRtm(uid)
} }
override fun startCondifeHomePage(context: Context, isSplash: Boolean) { override fun startCondifeHomePage(context: Context, isSplash: Boolean) {
...@@ -91,17 +90,17 @@ class ConfdieServiceImpl : IConfideService { ...@@ -91,17 +90,17 @@ class ConfdieServiceImpl : IConfideService {
//debug包根据url判断使用正式或者测试key //debug包根据url判断使用正式或者测试key
val cacheAppEnv = YDLCacheUtils.getCacheApi() val cacheAppEnv = YDLCacheUtils.getCacheApi()
if (!TextUtils.isEmpty(cacheAppEnv)) { avManagerKey = if (!TextUtils.isEmpty(cacheAppEnv)) {
if (YDLConstants.ENV_TEST == cacheAppEnv) { if (YDLConstants.ENV_TEST == cacheAppEnv) {
avManagerKey = "13b1536698f64905a1e7e5bb978ba821" "13b1536698f64905a1e7e5bb978ba821"
} else { } else {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" "3387e9b251f3491e9221a9877e8f7830"
} }
} else { } else {
if (YDLConstants.ENV_TEST == appEnv || YDLConstants.ENV_AUTO_TEST == appEnv) { if (YDLConstants.ENV_TEST == appEnv || YDLConstants.ENV_AUTO_TEST == appEnv) {
avManagerKey = "13b1536698f64905a1e7e5bb978ba821" "13b1536698f64905a1e7e5bb978ba821"
} else { } else {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" "3387e9b251f3491e9221a9877e8f7830"
} }
} }
} else { } else {
...@@ -109,27 +108,11 @@ class ConfdieServiceImpl : IConfideService { ...@@ -109,27 +108,11 @@ class ConfdieServiceImpl : IConfideService {
avManagerKey = "3387e9b251f3491e9221a9877e8f7830" avManagerKey = "3387e9b251f3491e9221a9877e8f7830"
} }
YDLavManager.instances.init(app, avManagerKey) findRouteService(IAudioImService::class.java).yDLAvManagerInit(app, avManagerKey)
}
override fun isOnlineRtm(): Boolean {
return YDLavManager.isOnlineRtm
} }
override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) { override fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?) {
val dialog = AxbConfirmDialog(activity, type, object : AxbConfirmDialog.OnClickEnsureListener { findRouteService(IAudioImService::class.java).openAxbDialog(activity, type, phoneNumber)
override fun onClickEnsure() {
phoneNumber?.let {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber!!))
activity?.startActivity(phoneIntent)
}
}
override fun onClose() {
}
})
dialog.show()
} }
override fun closePlayer() { override fun closePlayer() {
......
...@@ -3,15 +3,12 @@ package com.ydl.confide.home.modular.service ...@@ -3,15 +3,12 @@ package com.ydl.confide.home.modular.service
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.audioim.IntentConstants import com.ydl.audioim.api.IAudioImService
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.bean.ExpertInfoBean import com.ydl.audioim.bean.ExpertInfoBean
import com.ydl.audioim.widget.AxbConfirmDialog import com.ydl.audioim.listener.IntentConstants
import com.ydl.confide.home.ConfidePermissionDialog import com.ydl.confide.home.ConfidePermissionDialog
import com.ydl.confide.home.bean.ConfideConnectResponse import com.ydl.confide.home.bean.ConfideConnectResponse
import com.ydl.confide.home.bean.ConnectParamJava import com.ydl.confide.home.bean.ConnectParamJava
...@@ -109,7 +106,7 @@ class ConfideWebServiceImpl { ...@@ -109,7 +106,7 @@ class ConfideWebServiceImpl {
data: ConfideConnectResponse? data: ConfideConnectResponse?
) { ) {
val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return val expertInfo = data?.dialDetail?.agoraExpertInfo ?: return
if (!YDLavManager.isOnlineRtm) { // 判断如果账号在其它设备登录rtm是否在线 if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) { // 判断如果账号在其它设备登录rtm是否在线
ToastUtil.toastShort("网络通话错误代码001") ToastUtil.toastShort("网络通话错误代码001")
return return
} }
...@@ -128,21 +125,9 @@ class ConfideWebServiceImpl { ...@@ -128,21 +125,9 @@ class ConfideWebServiceImpl {
* axb 通话 * axb 通话
* */ * */
fun axb(activity: Activity, phone: String?) { fun axb(activity: Activity, phone: String?) {
if (phone.isNullOrEmpty()) return if (phone.isNullOrEmpty())
val dialog = AxbConfirmDialog( return
activity, findRouteService(IAudioImService::class.java).openAxbDialog(activity,1,phone)
1,
object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:${phone}"))
activity.startActivity(phoneIntent)
}
override fun onClose() {
}
})
dialog.show()
} }
//java版axb和声网接口 //java版axb和声网接口
...@@ -154,8 +139,8 @@ class ConfideWebServiceImpl { ...@@ -154,8 +139,8 @@ class ConfideWebServiceImpl {
tellData: TellData?, tellData: TellData?,
callType: String? callType: String?
) { ) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ -> findRouteService(IAudioImService::class.java).loginRtm(PhoneCallIn.getUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) { if (isSuccess) {
toDial(id, type, callType, activity, tellData) toDial(id, type, callType, activity, tellData)
} else { } else {
...@@ -340,7 +325,7 @@ class ConfideWebServiceImpl { ...@@ -340,7 +325,7 @@ class ConfideWebServiceImpl {
expertInfo.remainingTime = expertInfo.remainingTime =
ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration); ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration);
} }
YDLavManager.instances.callEventSave("10", "用户点击拨打", expertInfo.channelId, "7") findRouteService(IAudioImService::class.java).callEventSave("10", "用户点击拨打", expertInfo.channelId, "7")
Loading.close() Loading.close()
ARouter.getInstance().build("/av/AudioHomeActivity") ARouter.getInstance().build("/av/AudioHomeActivity")
.withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl) .withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl)
......
...@@ -398,8 +398,10 @@ class ConfideHomeUtils { ...@@ -398,8 +398,10 @@ class ConfideHomeUtils {
} }
} }
} else { } else {
for (bodyItem in item.body!!) { if (item.body != null) {
bodyItem.confideIsPlay = false for (bodyItem in item.body) {
bodyItem.confideIsPlay = false
}
} }
} }
} }
......
...@@ -16,7 +16,7 @@ import com.alibaba.android.arouter.launcher.ARouter ...@@ -16,7 +16,7 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.dou361.ijkplayer.widget.IjkVideoView import com.dou361.ijkplayer.widget.IjkVideoView
import com.facebook.drawee.backends.pipeline.Fresco import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController import com.facebook.drawee.interfaces.DraweeController
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding import com.ydl.confide.databinding.ItemExpertIntroBinding
...@@ -36,7 +36,6 @@ import io.reactivex.Observable ...@@ -36,7 +36,6 @@ 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
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.confide_home_activity.*
import tv.danmaku.ijk.media.player.IjkMediaPlayer import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.io.UnsupportedEncodingException import java.io.UnsupportedEncodingException
import java.net.URLDecoder import java.net.URLDecoder
...@@ -123,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) : ...@@ -123,8 +122,8 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
} }
else -> { else -> {
if (!item.confideId.isNullOrBlank()) { if (!item.confideId.isNullOrBlank()) {
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
YDLavManager.instances.login( findRouteService(IAudioImService::class.java).loginRtm(
PhoneCallIn.getUserService().getUserInfo()?.uid PhoneCallIn.getUserService().getUserInfo()?.uid
) { _: Boolean, _ -> ) { _: Boolean, _ ->
showPayOrDetail(item, it) showPayOrDetail(item, it)
......
...@@ -4,25 +4,30 @@ import android.annotation.SuppressLint ...@@ -4,25 +4,30 @@ import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.fragment.app.Fragment import android.graphics.Rect
import android.text.TextUtils import android.text.TextUtils
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ScreenUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.ydl.webview.H5JsBean
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.consultant.ExpertSearchActivity import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.ExpertSearchFragment import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.api.IConsultantService import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.GuideBean import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.data.ConsultantDataManager import com.yidianling.consultant.data.ConsultantDataManager
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.model.SearchApi import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import com.yidianling.consultant.preview.GPreviewBuilder
import com.yidianling.consultant.preview.UserViewInfo
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
...@@ -149,6 +154,32 @@ class ConsultantServiceImp : IConsultantService { ...@@ -149,6 +154,32 @@ class ConsultantServiceImp : IConsultantService {
}) })
} }
override fun resourceToPreview(dataList: List<H5JsBean.MediaInfo>?, params: H5JsBean.H5JsCmd.Params, activity: Activity) {
val mThumbViewInfoList: MutableList<UserViewInfo> = ArrayList()
dataList?.let {
for (mediaInfo in it) {
val userViewInfo =
UserViewInfo(mediaInfo.cover, mediaInfo.url, mediaInfo.sourcesType)
val bounds = Rect()
bounds.left = ScreenUtils.getScreenWidth() / 2
bounds.top = ScreenUtils.getScreenHeight() / 2
bounds.right = ScreenUtils.getScreenWidth() / 2
bounds.bottom = ScreenUtils.getScreenHeight() / 2
userViewInfo.bounds = bounds
mThumbViewInfoList.add(userViewInfo)
}
GPreviewBuilder.form(activity)
.setData(mThumbViewInfoList)
.setCurrentIndex(params.preview_index)
.setFullscreen(true)
.setToUid(params.info?.toUid.toString() + "")
.setDoctorId(params.info?.doctorId)
.setType(GPreviewBuilder.IndicatorType.Dot)
.start()
}
}
override fun resetConsultAssistantDialogStatus() { override fun resetConsultAssistantDialogStatus() {
ConsultAssistantDialogUtils.INSTANCE.resetStatus() ConsultAssistantDialogUtils.INSTANCE.resetStatus()
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
android:layout_width="307dp" android:layout_width="307dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/white" android:background="@color/white"
app:cardCornerRadius="12dp" app:cardCornerRadius="12dp"
android:layout_centerInParent="true"> android:layout_centerInParent="true">
...@@ -64,7 +65,7 @@ ...@@ -64,7 +65,7 @@
android:id="@+id/ll_content" android:id="@+id/ll_content"
android:layout_below="@+id/ll_time" android:layout_below="@+id/ll_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="66dp" android:layout_height="wrap_content"
android:background="@drawable/consultant_bg_sub_pay" android:background="@drawable/consultant_bg_sub_pay"
android:layout_marginTop="@dimen/platform_dp_16" android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_marginLeft="@dimen/platform_dp_16"
...@@ -76,7 +77,9 @@ ...@@ -76,7 +77,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginTop="8dp"
android:layout_marginRight="@dimen/platform_dp_8" android:layout_marginRight="@dimen/platform_dp_8"
android:layout_marginBottom="8dp"
app:cardCornerRadius="4dp"> app:cardCornerRadius="4dp">
<ImageView <ImageView
...@@ -88,33 +91,33 @@ ...@@ -88,33 +91,33 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/nameTv" android:id="@+id/nameTv"
android:layout_marginTop="@dimen/platform_dp_11"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14" android:layout_marginTop="@dimen/platform_dp_11"
android:textColor="#1C1F28"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginRight="@dimen/platform_dp_12" android:layout_marginRight="@dimen/platform_dp_12"
/> android:ellipsize="end"
android:maxLines="1"
android:textColor="#1C1F28"
android:textSize="@dimen/platform_sp_14"
tools:text="fadjjfladj" />
<TextView <TextView
android:id="@+id/desTv" android:id="@+id/desTv"
android:layout_marginTop="@dimen/platform_dp_6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="@dimen/platform_sp_14" android:layout_marginTop="@dimen/platform_dp_6"
android:textColor="#62636F"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginBottom="@dimen/platform_dp_11"
android:layout_marginRight="@dimen/platform_dp_12" android:layout_marginRight="@dimen/platform_dp_12"
/> android:layout_marginBottom="@dimen/platform_dp_11"
android:ellipsize="end"
android:maxLines="2"
android:textColor="#62636F"
android:textSize="@dimen/platform_sp_14"
tools:text="fadjjfladjfljasf;ljdsl;fj;fadjjfladjfljasffadjfadjjfladjfljasffadjjfladjfljasffadjjfladjfljasffadjjfladjfljasfjfladjfljasf" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -150,7 +150,6 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -150,7 +150,6 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
var id: String? = "0" var id: String? = "0"
trendsDatas?.let { trendsDatas -> trendsDatas?.let { trendsDatas ->
if (trendsDatas.size > 0) { if (trendsDatas.size > 0) {
LogUtil.i("TAG get last content: " + trendsDatas[trendsDatas.size].toString())
id = trendsDatas[trendsDatas.size - 1].id id = trendsDatas[trendsDatas.size - 1].id
return if (id == null || id == "") { return if (id == null || id == "") {
0 0
......
...@@ -431,4 +431,13 @@ class IMServiceImpl : IImService { ...@@ -431,4 +431,13 @@ class IMServiceImpl : IImService {
override fun dismissConsultServiceDialog() { override fun dismissConsultServiceDialog() {
expertConsultServiceListDialog2?.changeItem() expertConsultServiceListDialog2?.changeItem()
} }
override fun startTeamSession(activity: Activity, tid: String, doctorId: String) {
SessionHelper.startTeamSession(
activity,
tid + "",
null,
P2PCustomActionHandlerImpl(doctorId + "")
)
}
} }
\ No newline at end of file
...@@ -61,7 +61,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog; ...@@ -61,7 +61,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
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.config.constants.ImConstants; import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.event.CloseBottomWebviewEvent; import com.yidianling.im.api.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;
import com.yidianling.im.helper.IMChatUtil; import com.yidianling.im.helper.IMChatUtil;
......
/build
\ No newline at end of file
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply from: "../publish.gradle"
kapt {
arguments {
arg("AROUTER_MODULE_NAME", "js")
}
}
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: "js"]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled true
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.alibaba:arouter-api:$arouter_api"
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
// 时间选择器
implementation 'com.contrarywind:Android-PickerView:4.1.9'
api rootProject.ext.dependencies["ydl-user-router"]
api project(':ydl-webview')
api project(':ydl-platform')
implementation project(':ydl-media')
implementation project(":ydl-pay")
implementation project(":api:im")
implementation project(":api:user")
implementation project(":api:consultant")
implementation project(":api:confide")
implementation project(":api:dynamic")
implementation project(":api:tests")
implementation project(":api:fm")
implementation project(":api:course")
implementation project(':api:muse')
implementation project(':api:js')
implementation project(':api:audioim')
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.js">
</manifest>
\ No newline at end of file
package com.ydl.component.service.web package com.ydl.js
import android.Manifest import android.Manifest
import com.blankj.utilcode.util.PermissionUtils import com.blankj.utilcode.util.PermissionUtils
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.google.gson.JsonParser import com.google.gson.JsonParser
import com.tencent.smtt.sdk.WebView import com.tencent.smtt.sdk.WebView
import com.ydl.audioim.YDLavManager import com.ydl.audioim.api.IAudioImService
import com.ydl.confide.api.IConfideService import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.event.ConfideDialogEvent import com.ydl.confide.event.ConfideDialogEvent
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseActivityMgr import com.ydl.ydlcommon.base.BaseActivityMgr
import com.ydl.ydlcommon.modular.findRouteService import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.ui.Loading import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.Utils
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.common.tools.asFragmentActivity import com.yidianling.common.tools.asFragmentActivity
import com.yidianling.user.UserHelper
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
class JsMethod(private val webView: WebView?) { class JsMethod(private val webView: WebView?) {
fun handle(param: String): Boolean { fun handle(param: String): Boolean {
try { try {
val obj = JsonParser().parse(param).asJsonObject val obj = JsonParser().parse(param).asJsonObject
...@@ -50,6 +51,7 @@ class JsMethod(private val webView: WebView?) { ...@@ -50,6 +51,7 @@ class JsMethod(private val webView: WebView?) {
} }
"close_loading" -> { "close_loading" -> {
// Loading.close() // Loading.close()
return true return true
} }
"open_app_eval_list" -> { "open_app_eval_list" -> {
...@@ -83,18 +85,19 @@ class JsMethod(private val webView: WebView?) { ...@@ -83,18 +85,19 @@ class JsMethod(private val webView: WebView?) {
} }
return true return true
} }
"confide_dial" -> { "confide_dial" -> {
//倾诉链接 java接口,支持axb和声网 //倾诉链接 java接口,支持axb和声网
val id = param.getAsJsonPrimitive("id").asInt val id = param.getAsJsonPrimitive("id").asInt
val data = param.getAsJsonObject("data").toString() val data = param.getAsJsonObject("data").toString()
val topActivity = BaseActivityMgr.INST.topActivity val topActivity = BaseActivityMgr.INST.topActivity
if (!YDLavManager.isOnlineRtm) { if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
//异常退出或者账号被顶掉,重新登录并拨打 //异常退出或者账号被顶掉,重新登录并拨打
YDLavManager.instances.login(UserHelper.getUserInfo()?.uid) { isSuccess: Boolean, _ -> findRouteService(IAudioImService::class.java).loginRtm(JsModularService.getIUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) { if (isSuccess) {
findRouteService(IConfideService::class.java).confideDial(id, data, topActivity) findRouteService(IConfideService::class.java).confideDial(id,
data,
topActivity)
} else { } else {
ToastUtil.toastShort("请重新拨打") ToastUtil.toastShort("请重新拨打")
} }
...@@ -120,6 +123,32 @@ class JsMethod(private val webView: WebView?) { ...@@ -120,6 +123,32 @@ class JsMethod(private val webView: WebView?) {
} }
return true return true
} }
"startCms" ->{
if (Utils.isFastClick()) {
return true
}
val activity = BaseActivityMgr.INST.topActivity
if (JsModularService.getIUserService().loginByOneKeyLogin(activity, true)) {
val location = param.getAsJsonPrimitive("location").asInt
JsModularService.getImService().startP2PSession(activity, location, null)
}
return true
}
"to_search_list" ->{
if (Utils.isFastClick()) {
return true
}
val cateId = param.getAsJsonPrimitive("cateId").asString
val cateTitle = param.getAsJsonPrimitive("cateTitle").asString
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_CONSULT_LIST,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_CATEID, cateId)
.putExtra(IYDLRouterConstant.EXTRA_CATETITLE, cateTitle)
.putExtra(IYDLRouterConstant.EXTRA_SHOWTYPE, "0")
)
return true
}
else -> { else -> {
return false return false
} }
......
package com.ydl.js
import com.ydl.confide.api.IConfideService
import com.ydl.course.api.ICourseService
import com.ydl.muse.api.IMuseService
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.fm.api.service.IFMService
import com.yidianling.im.api.service.IImService
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
class JsModularService {
companion object{
fun getIConfideService(): IConfideService{
return ModularServiceManager.provide(IConfideService::class.java)
}
fun getIUserService(): IUserService{
return ModularServiceManager.provide(IUserService::class.java)
}
fun getIAppService(): IAppService{
return ModularServiceManager.provide(IAppService::class.java)
}
fun getIDynamicService(): IDynamicService{
return ModularServiceManager.provide(IDynamicService::class.java)
}
fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun getITestsApiService(): ITestsApiService {
return ModularServiceManager.provide(ITestsApiService::class.java)
}
fun getIFMService(): IFMService {
return ModularServiceManager.provide(IFMService::class.java)
}
fun getICourseService(): ICourseService {
return ModularServiceManager.provide(ICourseService::class.java)
}
fun getIMuseService(): IMuseService {
return ModularServiceManager.provide(IMuseService::class.java)
}
}
}
\ No newline at end of file
package com.ydl.component.service.web package com.ydl.js
import android.webkit.JavascriptInterface import android.webkit.JavascriptInterface
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
...@@ -12,18 +12,20 @@ import com.ydl.webview.IJavascriptHandler ...@@ -12,18 +12,20 @@ import com.ydl.webview.IJavascriptHandler
import com.ydl.ydl_router.manager.YDLRouterManager import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseActivityMgr import com.ydl.ydlcommon.base.BaseActivityMgr
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.user.UserHelper import com.yidianling.user.api.service.IUserService
/** /**
* update by harvie on 2017/7/04 * update by harvie on 2017/7/04
*/ */
class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPro: WebViewClientClickListener?) : IJavascriptHandler() { class NewH5_JavascriptHandler(private val webView: WebView?, private val wvEnventPro: NewH5_WebViewClientClickListener?) : IJavascriptHandler() {
private val js = JsMethod(webView) private val js = JsMethod(webView)
...@@ -33,9 +35,8 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -33,9 +35,8 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
@JavascriptInterface @JavascriptInterface
fun sendDataToOC(params: String) { fun sendDataToOC(params: String) {
LogUtil.i("js", params) LogUtil.e("js", params)
LogUtil.d("sendDataToOC") AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.WEB, "params:$params")
//js交互路由 后期会去除掉这个路由 统一使用下面的路由 //js交互路由 后期会去除掉这个路由 统一使用下面的路由
//该路由只有测试记录h5页面在使用 - 测试题支付/测试题详情/测试题结果 //该路由只有测试记录h5页面在使用 - 测试题支付/测试题详情/测试题结果
val webViewRouter = WebViewRouterManager() val webViewRouter = WebViewRouterManager()
...@@ -47,7 +48,6 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -47,7 +48,6 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
if (YDLRouterManager.router(params)) { if (YDLRouterManager.router(params)) {
return return
} }
if (js.handle(params)) return if (js.handle(params)) return
val jsData = Gson().fromJson(params, H5JsBean::class.java) val jsData = Gson().fromJson(params, H5JsBean::class.java)
//是否登录 //是否登录
...@@ -60,10 +60,13 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -60,10 +60,13 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
if (jsData.cmd?.params?.toUid != 0) { if (jsData.cmd?.params?.toUid != 0) {
wvEnventPro?.chat( wvEnventPro?.chat(
UserHelper.getUserInfo()?.uid?.toInt() findRouteService(IUserService::class.java).getUserInfo()?.uid?.toInt() ?: 0,
?: 0, jsData.cmd?.params?.toUid jsData.cmd?.params?.toUid ?: 0,
?: 0, 0, UserHelper.getUserInfo()?.accessToken, jsData.cmd?.params?.isFromQingShu 0,
?: 0) findRouteService(IUserService::class.java).getUserInfo()?.accessToken,
jsData.cmd?.params?.isFromQingShu ?: 0,
jsData.cmd?.params?.closeReplaceChat ?: false
)
} else { } else {
wvEnventPro?.openH5(jsData.cmd?.params) wvEnventPro?.openH5(jsData.cmd?.params)
} }
...@@ -123,12 +126,22 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -123,12 +126,22 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
"chat" -> "chat" ->
//私聊 //私聊
if (wvEnventPro != null) { if (wvEnventPro != null) {
wvEnventPro!!.chat(ModularServiceManager.getPlatformUserService()?.getUser()?.userId?.toInt()?:0, jsData.cmd!!.params!!.toUid, 0, ModularServiceManager.getPlatformUserService()?.getUser()?.token, jsData.cmd!!.params!!.isFromQingShu) wvEnventPro?.chat(findRouteService(IUserService::class.java).getUserResponse()?.uid?.toInt() ?: 0,
jsData.cmd!!.params!!.toUid, 0,
JsModularService.getIUserService().getUserInfo()?.accessToken,
jsData.cmd!!.params!!.isFromQingShu,
jsData.cmd!!.params!!.closeReplaceChat
)
// 埋点
ActionCountUtils.count("ydl_user_main_page|private_chat_click")
} }
"chat_send_message" -> "chat_send_message" ->
//跳转私聊:并发送消息 //跳转私聊:并发送消息
if (wvEnventPro != null) { if (wvEnventPro != null) {
wvEnventPro!!.chatSendMessage(ModularServiceManager.getPlatformUserService()?.getUser()?.userId?.toInt()?:0, jsData.cmd!!.params!!.toUid, 0, ModularServiceManager.getPlatformUserService()?.getUser()?.token, jsData.cmd!!.params!!.isFromQingShu) wvEnventPro!!.chatSendMessage(findRouteService(IUserService::class.java).getUserResponse()?.uid?.toInt() ?: 0,
jsData.cmd!!.params!!.toUid,
0, JsModularService.getIUserService().getUserInfo()?.accessToken,
jsData.cmd!!.params!!.isFromQingShu)
} }
"chat_team" -> "chat_team" ->
//群聊 //群聊
...@@ -379,6 +392,9 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -379,6 +392,9 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
"chatUnread" -> { "chatUnread" -> {
wvEnventPro?.sendUnReadNum(jsData.cmd!!.params?.callBack, jsData.cmd!!.params?.uid.toString()) wvEnventPro?.sendUnReadNum(jsData.cmd!!.params?.callBack, jsData.cmd!!.params?.uid.toString())
} }
"switch_push_status" -> {
wvEnventPro?.switchPushStatus(jsData.cmd?.params)
}
"showTitleBar" -> { "showTitleBar" -> {
jsData.cmd!!.params?.let { jsData.cmd!!.params?.let {
wvEnventPro?.shouldShowTitleBar(it.isShowTitleBar!!) wvEnventPro?.shouldShowTitleBar(it.isShowTitleBar!!)
...@@ -389,10 +405,23 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -389,10 +405,23 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
wvEnventPro?.setSelfPageType(it.selfPageType) wvEnventPro?.setSelfPageType(it.selfPageType)
} }
} }
"chat_close_bottom_webview" -> { "setBootomFitViewColor" -> {
jsData.cmd!!.params?.let { wvEnventPro?.setBootomFitViewColor(jsData.cmd?.params?.bottomfitViewColor ?: "")
wvEnventPro?.chatCloseBottomWebView() }
// 打开时间选择器
"requestSelectTime"->{
if (Utils.isFastClick()){
return
} }
wvEnventPro?.openTimePicker(jsData.cmd?.params?.callBack,jsData.cmd?.params?.day,jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.orderId)
}
// 返回上一页并刷新
"goBackAndReload"->{
wvEnventPro?.goBackAndReload(jsData.cmd?.params?.url)
}
// 跳转到第三方app
"toThirdApp" ->{
wvEnventPro?.toThirdApp(jsData.cmd?.params?.url)
} }
...@@ -438,7 +467,7 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -438,7 +467,7 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
jsData.cmd?.params?.let{ jsData.cmd?.params?.let{
val rgb = it.color val rgb = it.color
val alpha = it.alpha val alpha = it.alpha
wvEnventPro?.setWebViewBG(rgb,alpha) wvEnventPro?.setBG(rgb,alpha)
} }
} }
...@@ -457,15 +486,10 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -457,15 +486,10 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
findRouteService(IConfideService::class.java).showExpertDetailDialog(topActivity, url, doctorId, uid ?: "") findRouteService(IConfideService::class.java).showExpertDetailDialog(topActivity, url, doctorId, uid ?: "")
} }
} }
"switch_push_status" -> { "chat_close_bottom_webview" -> {
wvEnventPro?.switchPushStatus(jsData.cmd?.params) jsData.cmd!!.params?.let {
} wvEnventPro?.chatCloseBottomWebView()
// 打开时间选择器
"requestSelectTime"->{
if (Utils.isFastClick()){
return
} }
wvEnventPro?.openTimePicker(jsData.cmd?.params?.callBack,jsData.cmd?.params?.day,jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.orderId)
} }
"open_article_comment_dialog" -> { "open_article_comment_dialog" -> {
...@@ -481,7 +505,6 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr ...@@ -481,7 +505,6 @@ class WebJavascriptHandler(private val webView: WebView?, private val wvEnventPr
wvEnventPro?.showDocBooking(jsData.cmd?.params) wvEnventPro?.showDocBooking(jsData.cmd?.params)
} }
} }
} }
} }
package com.ydl.component.service.web; package com.ydl.js;
import com.ydl.webview.H5JsBean; import com.ydl.webview.H5JsBean;
...@@ -8,7 +8,7 @@ import com.ydl.webview.H5JsBean; ...@@ -8,7 +8,7 @@ import com.ydl.webview.H5JsBean;
* Created by harvie on 2017/7/4 0004. * Created by harvie on 2017/7/4 0004.
*/ */
public interface WebViewClientClickListener { public interface NewH5_WebViewClientClickListener {
void openH5(H5JsBean.H5JsCmd.Params jsData); void openH5(H5JsBean.H5JsCmd.Params jsData);
...@@ -36,7 +36,8 @@ public interface WebViewClientClickListener { ...@@ -36,7 +36,8 @@ public interface WebViewClientClickListener {
void openTest(H5JsBean.H5JsCmd.Params params); void openTest(H5JsBean.H5JsCmd.Params params);
void chat(int id, int toUid, int canTalk, String accessToken, int isFromQingShu); //注册引导页--跳转私聊界面
void chat(int id, int toUid, int canTalk, String accessToken, int isFromQingShu,boolean closeReplaceChat);
void chatSendMessage(int id, int toUid, int canTalk, String accessToken, int isFromQingShu); void chatSendMessage(int id, int toUid, int canTalk, String accessToken, int isFromQingShu);
...@@ -170,49 +171,63 @@ public interface WebViewClientClickListener { ...@@ -170,49 +171,63 @@ public interface WebViewClientClickListener {
//关闭页面 //关闭页面
void closeWebKit(); void closeWebKit();
void goHome(H5JsBean.H5JsCmd.Params params); void goHome(H5JsBean.H5JsCmd.Params params);
//保存图片
// void storePic();
/**
* 向h5发送对那个uid的未读数
* @param callbackFuncName
* @param uid
*/
void sendUnReadNum(String callbackFuncName, String uid); void sendUnReadNum(String callbackFuncName, String uid);
//h5页面是否需要打开推送
void switchPushStatus(H5JsBean.H5JsCmd.Params params);
//是否展示标题栏 //是否展示标题栏
void shouldShowTitleBar(boolean isShowTitleBar); void shouldShowTitleBar(boolean isShowTitleBar);
//设置当前页面类型 //设置当前页面类型
void setSelfPageType(int selfType); void setSelfPageType(int selfType);
//关闭私聊窗口立即咨询webview void setBootomFitViewColor(String color);
void chatCloseBottomWebView();
/**打开时间选择器*/
void openTimePicker(String jsCallBackName, String day, String doctorId, String orderId);
default void playMeditation(int mediaId,long meditationId,int meditationType,String mediaCoverUrl){} /**返回上一页并刷新*/
void goBackAndReload(String url);
default void switchSound(int mediaId,long meditationId,int meditationType,int businessType, /**跳转第三方APP*/
String buried,String mediaUrl,String mediaCoverUrl,String title, void toThirdApp(String url);
String desc,int status){
} /**页面内跳转url*/
//页面内跳转url
void reloadUrl(String url); void reloadUrl(String url);
default void setWebViewBG(String rgb,String alpha){}
default void playMeditation(int mediaId, long meditationId, int meditationType, String mediaCoverUrl) {
}
default void switchSound(int mediaId, long meditationId, int meditationType, int businessType,
String buried, String mediaUrl, String mediaCoverUrl, String title,
String desc, int status) {
}
default void setBG(String rgb, String alpha) {
}
void getNextExpertStatus(String doctorID, String title, String uid, String linkUrl); void getNextExpertStatus(String doctorID, String title, String uid, String linkUrl);
//h5页面是否需要打开推送 /**
void switchPushStatus(H5JsBean.H5JsCmd.Params params); * 关闭私聊窗口立即咨询webview
*/
void chatCloseBottomWebView();
//显示评论弹窗
void showCommentArticleDialog(H5JsBean.H5JsCmd.Params params); void showCommentArticleDialog(H5JsBean.H5JsCmd.Params params);
void resourceToPreview(H5JsBean.H5JsCmd.Params params); void resourceToPreview(H5JsBean.H5JsCmd.Params params);
void showDocBooking(H5JsBean.H5JsCmd.Params params); void showDocBooking(H5JsBean.H5JsCmd.Params params);
// 打开时间选择器
void openTimePicker(String jsCallBackName,String day,String doctorId,String orderId);
} }
package com.ydl.js
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.text.TextUtils
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.tencent.smtt.sdk.WebView
import com.ydl.audioim.api.IAudioImService
import com.ydl.webview.*
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.Utils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.ydl_pay.pay.payDialog.CallBack
import com.yidianling.ydl_pay.pay.payDialog.ConfidePayParams
import com.yidianling.ydl_pay.pay.payDialog.PayDialog
/**
* Created by haorui on 2019-10-10.
* Des:
*/
@Route(path = "/web/webservice")
class WebServiceImpl : IWebService {
override fun getJavascripHandler(activity: Activity, webView:WebView?, tellData: TellData): IJavascriptHandler {
return NewH5_JavascriptHandler(webView, object : NewH5_WVClickAbstractListener(activity) {
override fun setTitle(jsData: H5JsBean.H5JsCmd.Params?) {
//设置webview标题
if (activity is NewH5Activity) {
activity.setWebViewTitle(jsData?.title)
}
}
//倾诉链接java接口
override fun confideConnect(jsData: H5JsBean.H5JsCmd.Params?) {
if (Utils.isFastClick()) {
//防止连击
return
}
if (!findRouteService(IAudioImService::class.java).getIsOnlineRtm()) {
//异常退出或者账号被顶掉,重新登录并拨打
findRouteService(IAudioImService::class.java).loginRtm(JsModularService.getIUserService().getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) {
connectionJava(jsData?.id ?: 0, jsData?.confideType ?: 1, activity, tellData, jsData?.callType)
} else {
ToastUtil.toastShort("请重新拨打")
}
}
} else {
connectionJava(jsData?.id ?: 0, jsData?.confideType ?: 1, activity, tellData, jsData?.callType)
}
}
//php线路已废除
override fun listenTel(jsData: H5JsBean.H5JsCmd.Params?) {
}
override fun listenAgora(jsData: H5JsBean.H5JsCmd.Params?) {
if (Utils.isFastClick()) {
//防止连击
return
}
//声网路线
connectionJava(jsData?.id ?: 0, 3, activity, tellData, jsData?.callType)
}
override fun confidePay(jsData: H5JsBean.H5JsCmd.Params?) {
//倾诉支付
val confidePay = ConfidePayParams(
jsData?.payTitle ?: "倾诉服务", jsData?.orderPrice, jsData?.coupnPrice ?: 0.00,
jsData?.avliableMoney ?: 0.00, jsData?.payId ?: "", jsData?.confideUrl ?: "", jsData?.merchantType
)
confidePayDialog(jsData?.id, jsData?.confideType, activity, confidePay, jsData?.callType)
}
override fun back() {
if (activity is NewH5Activity) {
activity.goBack()
}
}
})
}
//倾诉支付弹窗
private fun confidePayDialog(id: Int?, type : Int?, activity: Activity, confidePay : ConfidePayParams, callType:String?){
PayDialog(activity)
.setCallback(object : CallBack {
override fun onSuccess() {
//支付成功,直接拨打
if (TextUtils.isEmpty(confidePay.confideUrl)) {
connectionJava(id ?: 0, type ?: 1, activity, null, callType)
} else {
//倾诉订单列表页面过来,会有confideUrl值,则直接跳转此url
NewH5Activity.start(activity, H5Params(confidePay.confideUrl!!, ""))
}
}
override fun onError() {
}
})
.show(confidePay)
}
//java版axb和声网接口
@SuppressLint("CheckResult")
private fun connectionJava(id: Int, type: Int, activity: Activity, tellData: TellData?, callType: String?) {
try {
JsModularService.getIConfideService().connectionJava(
id, type, activity, Gson().toJson(tellData), callType
)
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun init(context: Context) {
}
}
package com.ydl.js.bean
data class TimeDataBean(
var serviceTime:Int, // 咨询时长
var times:ArrayList<String> // 时间集合
)
\ No newline at end of file
package com.ydl.js.http
import com.ydl.js.bean.TimeDataBean
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseResponse
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Query
interface JsApi {
/**
* 获取时间选择器数据
*/
@GET("consult/user/order/selectWorriesReducibleTime")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getTimePickerData(
@Query("day") day: String,
@Query("doctorId") doctorId: String,
@Query("orderId") orderId: String
): Observable<BaseResponse<ArrayList<TimeDataBean>>>
}
\ No newline at end of file
package com.ydl.js.http
import com.ydl.js.bean.TimeDataBean
import com.ydl.ydlcommon.data.http.BaseResponse
import io.reactivex.Observable
interface JsHttp {
// 获取时间选择器数据
fun getTimePickerData(day:String,doctorId:String,orderId:String): Observable<BaseResponse<ArrayList<TimeDataBean>>>
}
package com.ydl.js.http
import com.ydl.js.bean.TimeDataBean
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils
import io.reactivex.Observable
class JsHttpImpl private constructor() : JsHttp{
companion object {
fun getInstance(): JsHttpImpl {
return Holder.INSTANCE
}
fun clearAppApi() {
Holder.INSTANCE.appApi = null
}
}
private var appApi: JsApi? = null
private fun getAppApi(): JsApi {
if (appApi == null) {
appApi = YDLHttpUtils.obtainApi(JsApi::class.java)
}
return appApi!!
}
object Holder {
val INSTANCE = JsHttpImpl()
}
override fun getTimePickerData(
day: String,
doctorId: String,
orderId: String
): Observable<BaseResponse<ArrayList<TimeDataBean>>> {
return getAppApi().getTimePickerData(day,doctorId,orderId)
}
}
\ No newline at end of file
package com.ydl.js.moduler.service
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.js.api.IJsService
@Route(path = "/js/JsService")
class JsImpl : IJsService {
companion object {
var isH5Open = true
var isMainOpen = true
}
override fun init(context: Context?) {
}
override fun isH5Open(): Boolean {
return isH5Open
}
override fun isMainOpen(): Boolean {
return isMainOpen
}
override fun setH5Open(open: Boolean) {
isH5Open = open
}
override fun setMainOpen(open: Boolean) {
isMainOpen = open
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromYDelta="0"
android:toYDelta="100%p" />
</set>
\ No newline at end of file
...@@ -59,6 +59,7 @@ dependencies { ...@@ -59,6 +59,7 @@ dependencies {
api project(":ydl-platform") api project(":ydl-platform")
implementation project(':ydl-media') implementation project(':ydl-media')
implementation project(":api:user") implementation project(":api:user")
implementation project(":api:muse")
implementation project(':ydl-flutter-base') implementation project(':ydl-flutter-base')
implementation project(':ydl-webview') implementation project(':ydl-webview')
......
package com.yidianling.muse.moduler.service
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.muse.api.IMuseService
import com.yidianling.muse.activity.ChooseMusicActivity
@Route(path = "/muse/MuseService")
class MuseImpl : IMuseService {
override fun init(context: Context?) {
}
override fun switchSound(
activity: Activity,
mediaId: Int,
meditationId: Long,
meditationType: Int,
businessType: Int,
buried: String?,
mediaUrl: String?,
mediaCoverUrl: String?,
title: String?,
desc: String?,
status: Int
) {
(activity as ChooseMusicActivity).switchSound(
mediaId, meditationId, meditationType,
businessType, buried, mediaUrl, mediaCoverUrl, title, desc, status
)
}
}
\ No newline at end of file
package com.yidianling.user.bean
data class EffectivityBean(
//1.测评在会员权益并生效中,2.该会员没有对应权益,3.权益过期
val isEffect: Int,
//0.下架,1.上架
val status: Int,
//权益包名称
val packageName: String,
//权益包id
val packageId: Int,
//到期时间
val overdue: String
)
\ No newline at end of file
...@@ -92,6 +92,8 @@ class UserMyPageEvent{ ...@@ -92,6 +92,8 @@ class UserMyPageEvent{
const val YDL_USER_MY_PAGE_STAY_VISIT=YDL_USER_MY_PAGE+"YDL_USER_MY_PAGE_STAY_VISIT" const val YDL_USER_MY_PAGE_STAY_VISIT=YDL_USER_MY_PAGE+"YDL_USER_MY_PAGE_STAY_VISIT"
const val YDL_USER_MY_TOP_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_top_type_click" const val YDL_USER_MY_TOP_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_top_type_click"
const val YDL_USER_MY_MIDDLE_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_middle_type_click" const val YDL_USER_MY_MIDDLE_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_middle_type_click"
//app我的页_会员中心区域点击
const val YDL_USER_MY_MEMBER_CENTRE_CLICK = YDL_USER_MY_PAGE + "member_centre_click"
const val YDL_USER_MY_BOTTOM_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_bottom_type_click" const val YDL_USER_MY_BOTTOM_TYPE_CLICK= YDL_USER_MY_PAGE+"ydl_user_my_bottom_type_click"
} }
} }
......
...@@ -118,6 +118,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -118,6 +118,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
rootView.findViewById<View>(R.id.ll_service).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_service).setOnClickListener(this)
//冥想 //冥想
rootView.findViewById<View>(R.id.ll_meditation).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_meditation).setOnClickListener(this)
rootView.findViewById<View>(R.id.me_card_vip).setOnClickListener(this)
//心理百科 //心理百科
rootView.findViewById<View>(R.id.ll_wiki).setOnClickListener(this) rootView.findViewById<View>(R.id.ll_wiki).setOnClickListener(this)
...@@ -276,6 +277,34 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -276,6 +277,34 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
getLocal().setCoupon(false) getLocal().setCoupon(false)
} }
} }
MineHttpImpl.getInstance().effectivity()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe ({ response ->
if ("200" == response.code && response.data.isNotEmpty()) {
val effectivityBean = response.data[0]
if (effectivityBean.status == 1) {
//上架
me_card_vip.visibility = View.VISIBLE
if (effectivityBean.isEffect == 1) {
me_vip_des.text =
"${effectivityBean.packageName} 有效期至${effectivityBean.overdue}"
tv_open_vip.text = "查看详情"
} else {
me_vip_des.text = "您当前不是会员,开通立享会员特权"
tv_open_vip.text = "开通会员"
}
} else {
//下架
me_card_vip.visibility = View.GONE
}
} else {
me_card_vip.visibility = View.GONE
}
}, {
me_card_vip.visibility = View.GONE
})
} }
/** /**
...@@ -564,6 +593,19 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -564,6 +593,19 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
NewH5Activity.start(it, h5Params3) NewH5Activity.start(it, h5Params3)
} }
} else if (id == R.id.me_card_vip) {
count(UserMyPageEvent.YDL_USER_MY_MEMBER_CENTRE_CLICK)
//测评vip
mActivity?.let {
if (!startLoginByStatus(it, true)) {
return
}
mActivity?.let {
val h5Params3 = H5Params(MH5_URL + "ceshi/vip/detail", null)
NewH5Activity.start(it, h5Params3)
}
}
} }
} }
...@@ -606,6 +648,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View. ...@@ -606,6 +648,7 @@ class MineFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener, View.
val changeFlag = event.isChange_flag val changeFlag = event.isChange_flag
if (changeFlag) { if (changeFlag) {
initdata() initdata()
refreshCouponData()
try { try {
provide( provide(
IImService::class.java IImService::class.java
......
...@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.bean.MustUP ...@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.bean.MustUP
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EffectivityBean
import com.yidianling.user.bean.EvaluateOrderBean import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.bean.FundData import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge import com.yidianling.user.bean.Recharge
...@@ -104,4 +105,12 @@ interface MineApi { ...@@ -104,4 +105,12 @@ interface MineApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun hasConfideOrder(@Body body: RequestBody):Observable<BaseAPIResponse<EvaluateOrderBean>> fun hasConfideOrder(@Body body: RequestBody):Observable<BaseAPIResponse<EvaluateOrderBean>>
/**
* 检查该用户是否是会员
*/
@GET("user/equity/effectivity")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun effectivity(): Observable<BaseAPIResponse<MutableList<EffectivityBean>>>
} }
\ No newline at end of file
...@@ -5,11 +5,15 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse ...@@ -5,11 +5,15 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseCommand import com.ydl.ydlcommon.data.http.BaseCommand
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.im.message.param.MsgListParam import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EffectivityBean
import com.yidianling.user.bean.EvaluateOrderBean import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.mine.* import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge
import com.yidianling.user.mine.APPWillUpParam
import com.yidianling.user.mine.FeedBackParam
import com.yidianling.user.mine.FundListParam
import com.yidianling.user.mine.RechargeParam
import com.yidianling.user.mine.bean.AccountBean import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean import com.yidianling.user.mine.bean.BalanceBean
import com.yidianling.user.mine.bean.CouponNumBean import com.yidianling.user.mine.bean.CouponNumBean
...@@ -50,4 +54,6 @@ interface MineHttp { ...@@ -50,4 +54,6 @@ interface MineHttp {
fun getHasConfideOrder(uid: String): Observable<BaseAPIResponse<EvaluateOrderBean>> fun getHasConfideOrder(uid: String): Observable<BaseAPIResponse<EvaluateOrderBean>>
//获取测评vip数据
fun effectivity(): Observable<BaseAPIResponse<MutableList<EffectivityBean>>>
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.ydl.ydlcommon.utils.NetworkParamsUtils ...@@ -7,6 +7,7 @@ import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.message.param.MsgListParam import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.EffectivityBean
import com.yidianling.user.bean.EvaluateOrderBean import com.yidianling.user.bean.EvaluateOrderBean
import com.yidianling.user.bean.FundData import com.yidianling.user.bean.FundData
import com.yidianling.user.bean.Recharge import com.yidianling.user.bean.Recharge
...@@ -140,6 +141,10 @@ class MineHttpImpl private constructor() : MineHttp { ...@@ -140,6 +141,10 @@ class MineHttpImpl private constructor() : MineHttp {
return getAppApi().hasConfideOrder(body) return getAppApi().hasConfideOrder(body)
} }
override fun effectivity(): Observable<BaseAPIResponse<MutableList<EffectivityBean>>> {
return getAppApi().effectivity()
}
object Holder { object Holder {
val INSTANCE = MineHttpImpl() val INSTANCE = MineHttpImpl()
} }
......
...@@ -9,7 +9,9 @@ import android.widget.ImageView; ...@@ -9,7 +9,9 @@ import android.widget.ImageView;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.base.config.ChannelConfig;
import com.ydl.ydlcommon.bean.StatusBarOptions; import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.data.PlatformDataManager;
import com.yidianling.common.tools.RxNetTool; import com.yidianling.common.tools.RxNetTool;
import com.yidianling.user.R; import com.yidianling.user.R;
...@@ -58,11 +60,15 @@ public class H5Activity extends BaseActivity { ...@@ -58,11 +60,15 @@ public class H5Activity extends BaseActivity {
// 开启 DOM storage API 功能 // 开启 DOM storage API 功能
web_view.getSettings().setDomStorageEnabled(true); web_view.getSettings().setDomStorageEnabled(true);
if (getIntent().getBooleanExtra(INTENT_PRIVACY, false)) { if (getIntent().getBooleanExtra(INTENT_PRIVACY, false)) {
String ffrom = PlatformDataManager.INSTANCE.getRam().getChannelName();
//隐私政策 //隐私政策
if (!RxNetTool.isConnected(BaseApp.Companion.getApp())){ if (!RxNetTool.isConnected(BaseApp.Companion.getApp())) {
//无网络 读取本地文件 //无网络 读取本地文件
web_view.loadUrl("file:///android_asset/html/yinsi.html"); web_view.loadUrl("file:///android_asset/html/yinsi.html");
}else { } else if (ffrom.startsWith(ChannelConfig.ATK_4.name())) {
//心理测试包更改隐私协议地址
web_view.loadUrl("https://m.ydl.com/Protol/yinsi/shdh/test");
} else {
web_view.loadUrl("https://m.ydl.com/Protol/yinsi/shdh");//加载url web_view.loadUrl("https://m.ydl.com/Protol/yinsi/shdh");//加载url
} }
} else { } else {
......
...@@ -17,6 +17,8 @@ import com.mobile.auth.gatewayauth.model.TokenRet ...@@ -17,6 +17,8 @@ import com.mobile.auth.gatewayauth.model.TokenRet
import com.ydl.ydlcommon.app.Apm import com.ydl.ydlcommon.app.Apm
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.ChannelConfig
import com.ydl.ydlcommon.data.PlatformDataManager.getRam
import com.ydl.ydlcommon.utils.JPushUtils import com.ydl.ydlcommon.utils.JPushUtils
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
...@@ -307,7 +309,7 @@ object OneKeyLoginHelp { ...@@ -307,7 +309,7 @@ object OneKeyLoginHelp {
val appName= mActivity.resources.getString(R.string.user_login_name_start) val appName= mActivity.resources.getString(R.string.user_login_name_start)
var appPrivacyOneTip = "${appName}用户使用协议" 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/shdh" var appPrivacyTwo = getPrivacyUrl()
if (mAppType == YDL_EXPERT_APP) { if (mAppType == YDL_EXPERT_APP) {
loginLogo = "ic_expert_login_logo" loginLogo = "ic_expert_login_logo"
loginHeight = 60 loginHeight = 60
...@@ -394,7 +396,7 @@ object OneKeyLoginHelp { ...@@ -394,7 +396,7 @@ object OneKeyLoginHelp {
// 每次打开页面前先清空所有的自定义控件,再重新设置 // 每次打开页面前先清空所有的自定义控件,再重新设置
phoneNumberAuthHelper.removeAuthRegisterXmlConfig() phoneNumberAuthHelper.removeAuthRegisterXmlConfig()
phoneNumberAuthHelper.removeAuthRegisterViewConfig() phoneNumberAuthHelper.removeAuthRegisterViewConfig()
var appPrivacyTwo = getPrivacyUrl()
val dialogHeight = RxImageTool.px2dp((RxDeviceTool.getScreenHeight(mActivity) * 0.45f)) val dialogHeight = RxImageTool.px2dp((RxDeviceTool.getScreenHeight(mActivity) * 0.45f))
phoneNumberAuthHelper.setAuthUIConfig( phoneNumberAuthHelper.setAuthUIConfig(
AuthUIConfig.Builder() AuthUIConfig.Builder()
...@@ -422,7 +424,7 @@ object OneKeyLoginHelp { ...@@ -422,7 +424,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/shdh") .setAppPrivacyTwo("隐私协议", appPrivacyTwo)
.setAppPrivacyColor(Color.parseColor("#bfbfbf"), Color.parseColor("#991da1f2")) .setAppPrivacyColor(Color.parseColor("#bfbfbf"), Color.parseColor("#991da1f2"))
.setCheckboxHidden(checkBoxHidden) // 设置是否同意协议的checkbox隐藏 .setCheckboxHidden(checkBoxHidden) // 设置是否同意协议的checkbox隐藏
.setCheckBoxHeight(22) .setCheckBoxHeight(22)
...@@ -439,6 +441,16 @@ object OneKeyLoginHelp { ...@@ -439,6 +441,16 @@ object OneKeyLoginHelp {
) )
} }
private fun getPrivacyUrl(): String {
val ffrom = getRam().getChannelName()
var appPrivacyTwo = "https://m.ydl.com/Protol/yinsi/shdh"
if (ffrom.startsWith(ChannelConfig.ATK_4.name)) {
//心理测试包更改隐私协议地址
appPrivacyTwo = "https://m.ydl.com/Protol/yinsi/shdh/test"
}
return appPrivacyTwo
}
// 一键登录token监听器 // 一键登录token监听器
private var mTokenListener: TokenResultListener = object : TokenResultListener { private var mTokenListener: TokenResultListener = object : TokenResultListener {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="19dp" />
<gradient
android:endColor="#ffb95f"
android:startColor="#ffc57d"
android:type="linear" />
</shape>
\ No newline at end of file
...@@ -5,4 +5,6 @@ include ':app', ...@@ -5,4 +5,6 @@ include ':app',
':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course", ':m-consultant', ':m-muse', ':m-fm', ':m-tests', ":m-course",
":m-im",":m-dynamic",":m-article",":m-audioim",":m-user", ":m-confide" ":m-im",":m-dynamic",":m-article",":m-audioim",":m-user", ":m-confide"
include ':ydl-tuicore', ':api:confide', ':api:dynamic', ':api:fm', ':api:consultant', include ':ydl-tuicore', ':api:confide', ':api:dynamic', ':api:fm', ':api:consultant',
':api:course', ':api:user', ':api:tests', ':api:im',':api:home' ':api:course', ':api:user', ':api:tests', ':api:im',':api:home',':api:muse',':api:js',':api:audioim'
include ':m-js'
include ':app2'
...@@ -4,6 +4,11 @@ apply plugin: 'kotlin-android-extensions' ...@@ -4,6 +4,11 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply from: "../publish.gradle" apply from: "../publish.gradle"
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
android { android {
compileSdkVersion 28 compileSdkVersion 28
...@@ -42,6 +47,9 @@ dependencies { ...@@ -42,6 +47,9 @@ dependencies {
api(rootProject.ext.dependencies["ydl-ijkplayer-jjdxm"]) { api(rootProject.ext.dependencies["ydl-ijkplayer-jjdxm"]) {
exclude group: 'com.android.support', module: 'appcompat-v7' exclude group: 'com.android.support', module: 'appcompat-v7'
} }
implementation "com.alibaba:arouter-api:$arouter_api"
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api project(':ydl-platform') api project(':ydl-platform')
......
...@@ -28,7 +28,7 @@ import okio.BufferedSource; ...@@ -28,7 +28,7 @@ import okio.BufferedSource;
* Des: 解析框架中的网络请求和响应结果并打印 * Des: 解析框架中的网络请求和响应结果并打印
*/ */
public class RequestLogInterceptor implements Interceptor { public class RequestLogInterceptor implements Interceptor {
private DefaultFormatPrinter mPrinter = new DefaultFormatPrinter(); // private DefaultFormatPrinter mPrinter = new DefaultFormatPrinter();
private boolean mIsDebug; private boolean mIsDebug;
private RequestHandler mRequestHandler; private RequestHandler mRequestHandler;
...@@ -40,18 +40,18 @@ public class RequestLogInterceptor implements Interceptor { ...@@ -40,18 +40,18 @@ public class RequestLogInterceptor implements Interceptor {
@Override @Override
public Response intercept(Chain chain) throws IOException { public Response intercept(Chain chain) throws IOException {
Request request = chain.request(); Request request = chain.request();
//
//打印请求信息 // //打印请求信息
if (request.body() != null && isParseable(request.body().contentType())) { // if (request.body() != null && isParseable(request.body().contentType())) {
mPrinter.printJsonRequest(request, parseParams(request)); // mPrinter.printJsonRequest(request, parseParams(request));
} else { // } else {
mPrinter.printFileRequest(request); // mPrinter.printFileRequest(request);
} // }
//
if (mRequestHandler != null) { // if (mRequestHandler != null) {
request = mRequestHandler.onHttpRequestBefore(chain, request); // request = mRequestHandler.onHttpRequestBefore(chain, request);
} // }
long t1 = System.nanoTime(); // long t1 = System.nanoTime();
Response originalResponse; Response originalResponse;
try { try {
originalResponse = chain.proceed(request); originalResponse = chain.proceed(request);
...@@ -59,35 +59,35 @@ public class RequestLogInterceptor implements Interceptor { ...@@ -59,35 +59,35 @@ public class RequestLogInterceptor implements Interceptor {
NetLogUtils.debugInfo("Http Error: " + e); NetLogUtils.debugInfo("Http Error: " + e);
throw e; throw e;
} }
long t2 = System.nanoTime(); // long t2 = System.nanoTime();
ResponseBody responseBody = originalResponse.body(); // ResponseBody responseBody = originalResponse.body();
//打印响应结果 //打印响应结果
String bodyString = null; // String bodyString = null;
if (responseBody != null && isParseable(responseBody.contentType())) { // if (responseBody != null && isParseable(responseBody.contentType())) {
bodyString = printResult(request, originalResponse); // bodyString = printResult(request, originalResponse);
if (mRequestHandler != null) { // if (mRequestHandler != null) {
mRequestHandler.onHttpResultResponse(bodyString, chain, originalResponse); // mRequestHandler.onHttpResultResponse(bodyString, chain, originalResponse);
} // }
} // }
//
if (mIsDebug) { // if (mIsDebug) {
final List<String> segmentList = request.url().encodedPathSegments(); // final List<String> segmentList = request.url().encodedPathSegments();
final String header = originalResponse.headers().toString(); // final String header = originalResponse.headers().toString();
final int code = originalResponse.code(); // final int code = originalResponse.code();
final boolean isSuccessful = originalResponse.isSuccessful(); // final boolean isSuccessful = originalResponse.isSuccessful();
final String message = originalResponse.message(); // final String message = originalResponse.message();
final String url = originalResponse.request().url().toString(); // final String url = originalResponse.request().url().toString();
//
if (responseBody != null && isParseable(responseBody.contentType())) { // if (responseBody != null && isParseable(responseBody.contentType())) {
mPrinter.printJsonResponse(TimeUnit.NANOSECONDS.toMillis(t2 - t1), isSuccessful, // mPrinter.printJsonResponse(TimeUnit.NANOSECONDS.toMillis(t2 - t1), isSuccessful,
code, header, responseBody.contentType(), bodyString, segmentList, message, url); // code, header, responseBody.contentType(), bodyString, segmentList, message, url);
} else { // } else {
mPrinter.printFileResponse(TimeUnit.NANOSECONDS.toMillis(t2 - t1), // mPrinter.printFileResponse(TimeUnit.NANOSECONDS.toMillis(t2 - t1),
isSuccessful, code, header, segmentList, message, url); // isSuccessful, code, header, segmentList, message, url);
} // }
} // }
return originalResponse; return originalResponse;
} }
......
...@@ -35,8 +35,6 @@ import okio.BufferedSink ...@@ -35,8 +35,6 @@ import okio.BufferedSink
import java.io.EOFException import java.io.EOFException
import java.nio.charset.Charset import java.nio.charset.Charset
import java.util.* import java.util.*
import kotlin.collections.ArrayList
import kotlin.collections.HashMap
/** /**
...@@ -142,8 +140,8 @@ class HttpConfig { ...@@ -142,8 +140,8 @@ class HttpConfig {
commonParams(), commonParams(),
requestHead(appName), requestHead(appName),
addEncryptionHeaderParamsInterceptor(), addEncryptionHeaderParamsInterceptor(),
responseErrorInterceptor() responseErrorInterceptor(),
// respErrorInterceptor() respErrorInterceptor(),
) )
.setRequestHandler(getRequestHandler()) .setRequestHandler(getRequestHandler())
.setReadTimeout(15) .setReadTimeout(15)
...@@ -193,22 +191,29 @@ class HttpConfig { ...@@ -193,22 +191,29 @@ class HttpConfig {
val code = resp.code() val code = resp.code()
val message = resp.message() val message = resp.message()
val api = req.url().encodedPath() val api = req.url().encodedPath()
if (api.contains("data/bigdata/maidian/writeMaiDianData")) {
return@Interceptor resp
}
if (!resp.isSuccessful) { if (!resp.isSuccessful) {
Apm.reportEventWithExt("network_api", "resp_fail", api, mapOf("code" to code.toString(), "msg" to message)) Apm.reportEventWithExt("network_api_android", "resp_fail", api, mapOf("code" to code.toString(), "msg" to message))
} else { } else {
try { try {
val body = resp.body() ?: return@Interceptor resp val body = resp.body() ?: return@Interceptor resp
val buffer = body.source().buffer() val source = body.source()
source.request(Long.MAX_VALUE)
val buffer = source.buffer()
if (!isPlaintext(buffer)) return@Interceptor resp if (!isPlaintext(buffer)) return@Interceptor resp
val readString = buffer.clone().readString(Charset.forName("UTF-8")) val readString = buffer.clone().readString(Charset.forName("UTF-8"))
val fromJson = Gson().fromJson<BaseAPIResponse<Any>>(readString, BaseAPIResponse::class.java) val fromJson = Gson().fromJson<BaseAPIResponse<Any>>(readString, BaseAPIResponse::class.java)
if (fromJson == null) {
return@Interceptor resp
}
if (fromJson.code != "200" && fromJson.code != "0") { if (fromJson.code != "200" && fromJson.code != "0") {
Apm.reportEventWithExt("network_api", "business_fail", api, mapOf("code" to code.toString(), "msg" to message)) Apm.reportEventWithExt("network_api_android", "business_fail", api, mapOf("code" to code.toString(), "msg" to message))
} }
} catch (throwable: Throwable) { } catch (throwable: Throwable) {
LogUtil.e(throwable.message) Apm.reportEventWithExt("network_api_android", "throwable", api, mapOf("msg" to (throwable.message ?: "")))
} }
} }
return@Interceptor resp return@Interceptor resp
} }
......
...@@ -76,10 +76,16 @@ object ModularServiceManager { ...@@ -76,10 +76,16 @@ object ModularServiceManager {
private val routerMap: HashMap<String, IProvider> = HashMap() private val routerMap: HashMap<String, IProvider> = HashMap()
@Deprecated("使用findRouteService代替",
ReplaceWith("findRouteService(IPlatformUserModuleService::class.java)", "import com.ydl.ydlcommon.modular.findRouteService")
)
fun getPlatformUserService(): IPlatformUserModuleService? { fun getPlatformUserService(): IPlatformUserModuleService? {
return provide(IPlatformUserModuleService::class.java) return provide(IPlatformUserModuleService::class.java)
} }
@Deprecated("使用findRouteService代替",
ReplaceWith("findRouteService(clz)", "import com.ydl.ydlcommon.modular.findRouteService")
)
fun <T : IProvider> provide(clz: Class<T>, path: String): T { fun <T : IProvider> provide(clz: Class<T>, path: String): T {
var provider: IProvider? = null var provider: IProvider? = null
...@@ -106,6 +112,9 @@ object ModularServiceManager { ...@@ -106,6 +112,9 @@ object ModularServiceManager {
return provider as T return provider as T
} }
@Deprecated("使用findRouteService代替",
ReplaceWith("findRouteService(clz)", "import com.ydl.ydlcommon.modular.findRouteService")
)
fun <T : IProvider> provide(clz: Class<T>): T { fun <T : IProvider> provide(clz: Class<T>): T {
var provider: IProvider? = null var provider: IProvider? = null
......
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