Commit e82dfb9b authored by jyx's avatar jyx

添加QQ客服

parent 4cee66a6
......@@ -7,9 +7,6 @@ import android.content.Intent
import cn.jpush.android.api.BasicPushNotificationBuilder
import cn.jpush.android.api.JPushInterface
import com.mints.goodmoney.manager.BxmManager.initBxm
import com.mints.goodmoney.manager.LiebaoManager
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.ZhangyueManager
import com.mints.library.utils.CommonUtils
import com.mob.MobSDK
import com.orhanobut.logger.AndroidLogAdapter
......
......@@ -11,23 +11,16 @@ import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication;
import com.bun.miitmdid.core.JLibrary;
import com.component.dly.xzzq_ywsdk.YwSDK;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.LiebaoManager;
import com.mints.goodmoney.manager.MiitHelper;
import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.manager.YlVideoManager;
import com.mints.goodmoney.manager.YlhAdManager;
import com.mints.goodmoney.manager.ZhangyueManager;
import com.mints.goodmoney.net.LoanService;
import com.mints.goodmoney.utils.ForegroundOrBackground;
import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.SystemUtils;
import com.yilan.sdk.ui.YLUIInit;
import com.yilan.sdk.ui.configs.CommentConfig;
import com.yilan.sdk.ui.configs.FeedConfig;
import com.yilan.sdk.ui.configs.YLUIConfig;
import rx.Scheduler;
import rx.schedulers.Schedulers;
......
package com.mints.goodmoney.manager
import android.app.Activity
import android.content.Intent
import android.net.Uri
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.utils.ToastUtil
/**
* 客服管理
*/
object CustomerServiceManager {
private const val QQCustomerNum = "2504421942"
/**
* 跳转QQ聊天界面
*/
fun joinQQ(activity: Activity) {
try {
//第二种方式:可以跳转到添加好友,如果qq号是好友了,直接聊天
val url = "mqqwpa://im/chat?chat_type=wpa&uin=$QQCustomerNum" //uin是发送过去的qq号码
// val url = "mqq://im/chat?chat_type=wap&uin=$QQCustomerNum&version=1&src_type=web" //uin是发送过去的qq号码
activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
} catch (e: Exception) {
// 未安装手Q或安装的版本不支持
ToastUtil.show(MintsApplication.getContext(), "您还没有安装QQ,请先安装软件")
}
}
/****************
*
* 发起添加群流程。群号:淘金空间官方6群(882880585) 的 key 为: qzUgFmCBsQxVAyPUm8Mi7-UtJu9m5-m8
* 调用 joinQQGroup(qzUgFmCBsQxVAyPUm8Mi7-UtJu9m5-m8) 即可发起手Q客户端申请加群 淘金空间官方6群(882880585)
*
* @param key 由官网生成的key
* @return 返回true表示呼起手Q成功,返回fals表示呼起失败
*/
fun joinQQGroup(key: String, activity: Activity) {
val intent = Intent()
intent.data = Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D$key")
// 此Flag可根据具体产品需要自定义,如设置,则在加群界面按返回,返回手Q主界面,不设置,按返回会返回到呼起产品界面 //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
try {
activity.startActivity(intent)
} catch (e: java.lang.Exception) {
// 未安装手Q或安装的版本不支持
ToastUtil.show(MintsApplication.getContext(), "您还没有安装QQ,请先安装软件")
}
}
}
\ No newline at end of file
......@@ -25,7 +25,6 @@ import com.mints.library.utils.json.JsonUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import com.tbruyelle.rxpermissions.RxPermissions
import kotlinx.android.synthetic.main.activity_login.*
import net.grandcentrix.tray.AppPreferences
import java.util.*
/**
......
......@@ -85,11 +85,11 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
when (keyCode) {
KeyEvent.KEYCODE_VOLUME_UP -> {
audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FX_FOCUS_NAVIGATION_UP);
audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FX_FOCUS_NAVIGATION_UP)
return true
}
KeyEvent.KEYCODE_VOLUME_DOWN -> {
audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FX_FOCUS_NAVIGATION_UP);
audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FX_FOCUS_NAVIGATION_UP)
return true
}
KeyEvent.KEYCODE_BACK -> {
......
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.inputmethod.InputMethodManager
......@@ -9,8 +8,6 @@ import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.login.LoginApi
......@@ -256,29 +253,32 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
}
private fun clearDialog() {
val dialog = AlertDialog.Builder(this)
.setTitle("确定清除缓存吗?")
.setPositiveButton("确定") { dialog, _ ->
try {
CacheUtil.clearAllCache(context)
item_cleanCache.findViewById<TextView>(R.id.tv_right).text = "0KB"
} catch (e: Exception) {
e.printStackTrace()
} finally {
dialog.dismiss()
}
}
.setNegativeButton("取消") { dialog, _ ->
dialog.dismiss()
cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) {
if (cdaa.isShowing) {
cdaa.dismiss()
}
.create()
val window = dialog.window
window?.setGravity(Gravity.CENTER)
window?.setWindowAnimations(R.style.DialogAnimBottom)
when (v.id) {
R.id.dialog_btn_left -> {
dialog.show()
}
R.id.dialog_btn_right -> {
try {
CacheUtil.clearAllCache(context)
item_cleanCache.findViewById<TextView>(R.id.tv_right).text = "0KB"
} catch (e: Exception) {
e.printStackTrace()
} finally {
}
}
}
}
})
cdaa.setTitle("提示")
cdaa.setContent("确定清除缓存吗?")
cdaa.setLeft("取消")
cdaa.setRight("确定")
cdaa.show()
}
override fun onLogin(platform: String?, res: HashMap<String, Any>): Boolean {
......
......@@ -96,7 +96,7 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
* 校验App签名
*/
private fun checkAppSign() {
val deviceInfo: DeviceInfo = DeviceInfo.instance!!
val deviceInfo: DeviceInfo = DeviceInfo.instance
if (!deviceInfo.signInfo) {
baseApplication.exitApp()
} else {
......
......@@ -29,19 +29,20 @@ import com.mints.goodmoney.ui.adapter.GvMyAdapter
import com.mints.goodmoney.ui.adapter.MainMyAdapter
import com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import com.mints.goodmoney.ui.widgets.DialogListener
import com.mints.goodmoney.utils.ImageUtil
import com.mints.goodmoney.utils.SpanUtils
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.ConstantUtil
import com.mints.library.utils.GlideUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_main_my.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.item_fragment_main_my_bottom.*
import kotlinx.android.synthetic.main.item_fragment_main_my_clock.*
import kotlinx.android.synthetic.main.item_fragment_main_my_customer_service.*
import kotlinx.android.synthetic.main.item_fragment_main_my_promotions.*
import kotlinx.android.synthetic.main.item_fragment_main_my_title.*
import kotlinx.android.synthetic.main.view_title.*
......@@ -78,6 +79,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 轮播图只展示一次
private var bannerFlag = false
// 轮播图只展示一次
private var cdaa: CustomDialogAsApple? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_my
override fun initViewsAndEvents() {
......@@ -102,8 +106,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
view_title.text = "每日任务"
iv_right_icon.visibility = View.VISIBLE
iv_right_icon.setImageResource(R.mipmap.ic_settings)
iv_right_icon2.visibility = View.VISIBLE
iv_right_icon2.setImageResource(R.mipmap.icon_customer_service)
// item_iv_settings.setOnClickListener(this)
iv_right_icon2.setOnClickListener(this)
item_title_id.setOnClickListener(this)
iv_right_icon.setOnClickListener(this)
btn_withdraw.setOnClickListener(this)
......@@ -111,9 +117,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
item_title_invitecode.setOnClickListener(this)
item_title_invitecode_copy.setOnClickListener(this)
ll_my_login.setOnClickListener(this)
item_bottom_text.setOnClickListener(this)
item_promotions_egv.onItemClickListener = this
item_bottom_version.text = "v" + ConstantUtil.getVersionName(mContext)
}
/**
......@@ -394,7 +400,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
val allcoinBig = BigDecimal(userConfig!!.userMsg.coin.toString())
val rateBig = BigDecimal("10000")
val cashStr: String = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
item_title_gold_about.setText("约" + cashStr + "元")
item_title_gold_about.text = "约" + cashStr + "元"
}
/**
......@@ -538,6 +544,14 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
readyGo(LoginActivity::class.java)
}
}
R.id.iv_right_icon2 -> {
// 跳转QQ客服
jumpQQ()
}
// R.id.item_bottom_text -> {
// 跳转加入QQ群
// CustomerServiceManager.joinQQ(activity!!)
// }
R.id.item_title_id -> {
if (!userManager.userIsLogin()) {
readyGo(LoginActivity::class.java)
......@@ -702,4 +716,30 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
}
}
/**
* 跳转QQ弹框
*/
private fun jumpQQ() {
cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) {
if (cdaa != null && cdaa!!.isShowing) {
cdaa!!.dismiss()
}
when (v.id) {
R.id.dialog_btn_left -> {
}
R.id.dialog_btn_right -> {
CustomerServiceManager.joinQQ(activity!!)
}
}
}
})
cdaa!!.setTitle("提示")
cdaa!!.setContent("好赚钱想要打开QQ")
cdaa!!.setLeft("取消")
cdaa!!.setRight("打开")
cdaa!!.show()
}
}
\ No newline at end of file
......@@ -13,7 +13,6 @@ import android.widget.TextView;
import com.mints.goodmoney.R;
/**
* 仿苹果自定义dialog选择框
*/
......@@ -35,22 +34,20 @@ public class CustomDialogAsApple extends BaseDialog {
lp = getWindow().getAttributes();
lp.gravity = Gravity.CENTER;
lp.width = LayoutParams.MATCH_PARENT;
lp.height = LayoutParams.WRAP_CONTENT;
lp.windowAnimations = R.style.DialogAnimBottom;
// lp.dimAmount = 0; // 去背景遮盖
// lp.alpha = 1.0f;//透明效果
getWindow().setAttributes(lp);
// 查找View
dialog_tv_title = (TextView) findViewById(R.id.dialog_tv_title);
dialog_tv_content = (TextView) findViewById(R.id.dialog_tv_content);
dialog_tv_title = findViewById(R.id.dialog_tv_title);
dialog_tv_content = findViewById(R.id.dialog_tv_content);
dialog_tv_content.setMovementMethod(ScrollingMovementMethod.getInstance());
dialog_btn_left = (Button) findViewById(R.id.dialog_btn_left);
dialog_btn_right = (Button) findViewById(R.id.dialog_btn_right);
dialog_btn_left = findViewById(R.id.dialog_btn_left);
dialog_btn_right = findViewById(R.id.dialog_btn_right);
dialog_v_line = findViewById(R.id.dialog_v_line);
dialog_btn_left.setOnClickListener(listener);
dialog_btn_right.setOnClickListener(listener);
}
......
......@@ -3,7 +3,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:background="@drawable/shape_dialog_bg"
android:background="@drawable/shape_dialog_friends"
android:gravity="center">
<TextView
......@@ -15,8 +15,9 @@
android:ellipsize="marquee"
android:gravity="center"
android:singleLine="true"
android:textColor="@color/dialog_text_color"
android:textSize="16sp"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="gone" />
<TextView
......@@ -31,8 +32,8 @@
android:maxLines="10"
android:scrollbars="vertical"
android:singleLine="false"
android:textColor="@color/dialog_text_color"
android:textSize="14sp" />
android:textColor="@color/gray"
android:textSize="16sp" />
<View
style="@style/line_1"
......@@ -53,7 +54,7 @@
android:background="@null"
android:gravity="center"
android:padding="10dp"
android:textColor="@color/main"
android:textColor="@color/main_mints"
android:textSize="14sp" />
<View
......@@ -68,7 +69,7 @@
android:background="@null"
android:gravity="center"
android:padding="10dp"
android:textColor="@color/main"
android:textColor="@color/main_mints"
android:textSize="14sp" />
</LinearLayout>
......
......@@ -56,7 +56,7 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
<include
layout="@layout/item_fragment_main_my_bottom"
layout="@layout/item_fragment_main_my_customer_service"
android:visibility="gone" />
</LinearLayout>
......
......@@ -26,13 +26,22 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_right_icon2"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:scaleType="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/iv_right_icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_right_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:scaleType="center"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="20dp"
android:paddingBottom="20dp">
<TextView
android:id="@+id/item_bottom_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="QQ群客服:点击去加群" />
<TextView
android:id="@+id/item_bottom_qqGroupNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="12343324(已满)" />
<!-- <TextView-->
<!-- android:id="@+id/item_bottom_version"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="10dp"-->
<!-- android:text="v1.0.0" />-->
</LinearLayout>
\ No newline at end of file
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