Commit 4848be46 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent 5a87a336
...@@ -33,7 +33,7 @@ public class VipBean implements Serializable { ...@@ -33,7 +33,7 @@ public class VipBean implements Serializable {
private String title; private String title;
private String topTitle; private String topTitle;
private String buttonText; private String buttonText;
private int payToModel;//0 app内部,1.只签约转支付宝浏览器支付 2.带uid转支付宝小程序(暂定只有一个小程序) private int payToModel;//0 app内部,1.只签约转支付宝浏览器支付 2.带uid转支付宝小程序(暂定只有一个小程序) 3.微信小程序
//带uid转支付宝小程序 第一个小程序 //带uid转支付宝小程序 第一个小程序
private String payToModel2FirstAlipayAppid; private String payToModel2FirstAlipayAppid;
......
...@@ -234,7 +234,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -234,7 +234,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
if (vipList != null && vipList!!.size > 0) { if (vipList != null && vipList!!.size > 0) {
val vipBean = vipList!![vipAdapter.getPosition()] val vipBean = vipList!![vipAdapter.getPosition()]
val payToModel = vipBean.payToModel val payToModel = vipBean.payToModel
//0 app内部,1.只签约转支付宝浏览器支付 2.带uid转支付宝小程序(暂定只有一个小程序) //0 app内部,1.只签约转支付宝浏览器支付 2.带uid转支付宝小程序(暂定只有一个小程序)3.微信小程序
when (payToModel) { when (payToModel) {
0 -> { 0 -> {
alipay(paramsBean) alipay(paramsBean)
...@@ -249,6 +249,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -249,6 +249,9 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
openAlipayApp(vipBean.payToModel2SecondAlipayAppid) openAlipayApp(vipBean.payToModel2SecondAlipayAppid)
} }
} }
3 -> {
openWxApp()
}
} }
} }
} }
...@@ -810,14 +813,14 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener, ...@@ -810,14 +813,14 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
} }
private fun openWxApp() { private fun openWxApp() {
// AppConfig.enterAlipay = true AppConfig.enterAlipay = true
try { try {
val appId = "wx263e5304a9a67d7c" // 填移动应用(App)的 AppId,非小程序的 AppID val appId = "wx263e5304a9a67d7c" // 填移动应用(App)的 AppId,非小程序的 AppID
val api: IWXAPI = WXAPIFactory.createWXAPI(context, appId) val api: IWXAPI = WXAPIFactory.createWXAPI(context, appId)
val req = WXLaunchMiniProgram.Req() val req = WXLaunchMiniProgram.Req()
req.userName = "gh_439c32026e1b" // 填小程序原始id req.userName = "gh_439c32026e1b" // 填小程序原始id
req.path = req.path =
"/pages/loading?testApp1=mcg1&testApp2=mcg2" ////拉起小程序页面的可带参路径,不填默认拉起小程序首页,对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar"。 "/pages/loading?" + "app_uid=" + UserManager.getInstance().userID + "&package_app=" + Constant.MINTS_PKG_NAME
req.miniprogramType = req.miniprogramType =
WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE // 可选打开 开发版,体验版和正式版 WXLaunchMiniProgram.Req.MINIPTOGRAM_TYPE_RELEASE // 可选打开 开发版,体验版和正式版
api.sendReq(req) api.sendReq(req)
......
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