Commit 0e4c5187 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 5c1d9fa1
...@@ -13,16 +13,12 @@ import com.duben.happyplaylet.MintsApplication ...@@ -13,16 +13,12 @@ import com.duben.happyplaylet.MintsApplication
import com.duben.happyplaylet.R import com.duben.happyplaylet.R
import com.duben.happyplaylet.common.Constant import com.duben.happyplaylet.common.Constant
import com.duben.happyplaylet.manager.TrackManager import com.duben.happyplaylet.manager.TrackManager
import com.duben.happyplaylet.manager.UserManager
import com.duben.happyplaylet.ui.activitys.base.BaseActivity import com.duben.happyplaylet.ui.activitys.base.BaseActivity
import com.duben.happyplaylet.utils.MateUtils import com.duben.happyplaylet.utils.MateUtils
import com.duben.happyplaylet.utils.ToastUtil import com.duben.happyplaylet.utils.ToastUtil
import com.duben.library.utils.ConstantUtil import com.duben.library.utils.ConstantUtil
import com.duben.library.utils.json.JsonUtil import com.duben.library.utils.json.JsonUtil
import com.duben.library.utils.nodoubleclick.AntiShake import com.duben.library.utils.nodoubleclick.AntiShake
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
import com.tencent.mm.opensdk.openapi.IWXAPI
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import kotlinx.android.synthetic.main.activity_aboutus.* import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
...@@ -46,13 +42,12 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -46,13 +42,12 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
ivAboutasIcon.setOnLongClickListener { ivAboutasIcon.setOnLongClickListener {
// ToastUtil.showLong( ToastUtil.showLong(
// this, "自有渠道:" + MateUtils.getAppMetaData( this, "自有渠道:" + MateUtils.getAppMetaData(
// MintsApplication.getContext(), "CHANNEL_NAME" MintsApplication.getContext(), "CHANNEL_NAME"
// ) + ) +
// "\n 头条渠道:" + HumeSDK.getChannel(context) "\n 头条渠道:" + HumeSDK.getChannel(context)
// ) )
openWxApp()
true true
} }
...@@ -104,22 +99,4 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -104,22 +99,4 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
} }
} }
private fun openWxApp() {
// AppConfig.enterAlipay = true
try {
val appId = "wxdafe24fe177a5661" // 填移动应用(App)的 AppId,非小程序的 AppID
val api: IWXAPI = WXAPIFactory.createWXAPI(context, appId)
val req = WXLaunchMiniProgram.Req()
req.userName = "gh_439c32026e1b" // 填小程序原始id
req.path =
"/pages/loading?" + "app_uid=" + UserManager.getInstance().userID + "&package_app=" + Constant.MINTS_PKG_NAME+ "&source_type=android"
req.miniprogramType =
WXLaunchMiniProgram.Req.MINIPROGRAM_TYPE_PREVIEW // 可选打开 开发版,体验版和正式版
// WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE // 可选打开 开发版,体验版和正式版
api.sendReq(req)
} catch (e: Exception) {
e.printStackTrace()
}
}
} }
...@@ -539,6 +539,25 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -539,6 +539,25 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
* 返回支付弹窗-签约 * 返回支付弹窗-签约
*/ */
private fun backPayYesDialog(vipBean: VipBean.ListBean) { private fun backPayYesDialog(vipBean: VipBean.ListBean) {
if (vipBean.isAlipay && vipBean.isWeixin) {
ll_vip_alipay.visibility = View.VISIBLE
ll_vip_wx.visibility = View.VISIBLE
payType = WEIXIN_PAY
iv_vip_wx.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_none)
} else if (vipBean.isAlipay && !vipBean.isWeixin) {
ll_vip_alipay.visibility = View.VISIBLE
ll_vip_wx.visibility = View.GONE
payType = ALIPAY
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_wx.setImageResource(R.mipmap.ic_vip_none)
} else if (!vipBean.isAlipay && vipBean.isWeixin) {
ll_vip_alipay.visibility = View.GONE
ll_vip_wx.visibility = View.VISIBLE
payType = WEIXIN_PAY
iv_vip_wx.setImageResource(R.mipmap.ic_vip_enable_blue)
iv_vip_alipay.setImageResource(R.mipmap.ic_vip_none)
}
payYesDialog = PayYesDialog(context, vipBean, object : DialogListener() { payYesDialog = PayYesDialog(context, vipBean, object : DialogListener() {
override fun onClick(v: View) { override fun onClick(v: View) {
if (!isFinishing() && payYesDialog != null && payYesDialog!!.isShowing()) { if (!isFinishing() && payYesDialog != null && payYesDialog!!.isShowing()) {
...@@ -796,8 +815,8 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -796,8 +815,8 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
req.path = req.path =
"/pages/loading?" + "app_uid=" + UserManager.getInstance().userID + "&package_app=" + Constant.MINTS_PKG_NAME + "&source_type=android" "/pages/loading?" + "app_uid=" + UserManager.getInstance().userID + "&package_app=" + Constant.MINTS_PKG_NAME + "&source_type=android"
req.miniprogramType = req.miniprogramType =
// WXLaunchMiniProgram.Req.MINIPROGRAM_TYPE_PREVIEW // 可选打开 开发版,体验版和正式版 WXLaunchMiniProgram.Req.MINIPROGRAM_TYPE_PREVIEW // 可选打开 开发版,体验版和正式版
WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE // 可选打开 开发版,体验版和正式版 // WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE // 可选打开 开发版,体验版和正式版
// val wx_api = WXAPIFactory.createWXAPI(context, "wxdafe24fe177a5661", true) // val wx_api = WXAPIFactory.createWXAPI(context, "wxdafe24fe177a5661", true)
// api.registerApp("wxdafe24fe177a5661") // api.registerApp("wxdafe24fe177a5661")
......
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