420版本
This commit is contained in:
@@ -73,7 +73,8 @@ public class MyUserIconUtil {
|
||||
intentwf.putExtra("search", "medicine");
|
||||
context.startActivity(intentwf);
|
||||
}else if ("肝胆课件".equals(name)){
|
||||
context.startActivity(new Intent(context, CoursewareActivity.class));
|
||||
// context.startActivity(new Intent(context, CoursewareActivity.class));
|
||||
showUniMp(context, "/pages_app/ppt/ppt", null);
|
||||
}else if ("精品课程".equals(name)){
|
||||
context.startActivity(new Intent(context, QualityCourseActivity.class));
|
||||
}else if ("肝病学院".equals(name)){
|
||||
@@ -111,7 +112,7 @@ public class MyUserIconUtil {
|
||||
{
|
||||
// context.startActivity(new Intent(context, VideoActivity.class));
|
||||
// 调用公共方法打开uniapp mp
|
||||
showUniMp(context, "/pages_app/video/video");
|
||||
showUniMp(context, "/pages_app/video/video", null);
|
||||
}
|
||||
else if("公益咨询".equals(name))
|
||||
{
|
||||
@@ -121,7 +122,7 @@ public class MyUserIconUtil {
|
||||
{
|
||||
// context.startActivity(new Intent(context, MyLibraryActivity.class));
|
||||
// 调用公共方法打开uniapp mp
|
||||
showUniMp(context, "/pages_app/zhinan/zhinan");
|
||||
showUniMp(context, "/pages_app/zhinan/zhinan", null);
|
||||
}
|
||||
else if ("专题e站".equals(name)){
|
||||
Intent intent1 = new Intent(context, NewsDetailActivity.class);
|
||||
@@ -249,14 +250,14 @@ public class MyUserIconUtil {
|
||||
* @param context 上下文
|
||||
* @param targetPath
|
||||
*/
|
||||
public static void showUniMp(Context context, String targetPath) {
|
||||
public static void showUniMp(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) {
|
||||
try {
|
||||
String uuid = SharePrefUtil.getString(context, Constant.uuid, "");
|
||||
if(StringUtil.isEmpty(uuid)){
|
||||
return;
|
||||
}
|
||||
String access_token = SharePrefUtil.getString(context, "access_token", "");
|
||||
|
||||
String QueryString = StringUtil.toQueryString(pageParams);
|
||||
JSONObject userInfo = new JSONObject();
|
||||
userInfo.put("uuid", SharePrefUtil.getString(context, Constant.uuid, ""));
|
||||
userInfo.put("realName", SharePrefUtil.getString(context, Constant.realName, ""));
|
||||
@@ -272,11 +273,11 @@ public class MyUserIconUtil {
|
||||
|
||||
IUniMP uniapp_MP_cash = BaseApplication.getUniMPCaches().get(uniapp_mp_appid);
|
||||
if(uniapp_MP_cash != null && uniapp_MP_cash.isRunning()){
|
||||
uniapp_MP_cash.sendUniMPEvent("goPage", targetPath);
|
||||
uniapp_MP_cash.sendUniMPEvent("goPage", targetPath+QueryString);
|
||||
uniapp_MP_cash.showUniMP();
|
||||
}else{
|
||||
if(StringUtil.notEmpty(targetPath)){
|
||||
uniMPOpenConfiguration.extraData.put("targetPath", targetPath);
|
||||
uniMPOpenConfiguration.extraData.put("targetPath", targetPath+QueryString);
|
||||
}
|
||||
IUniMP uniapp_MP = DCUniMPSDK.getInstance().openUniMP(mContext, uniapp_mp_appid, uniMPOpenConfiguration);
|
||||
BaseApplication.getUniMPCaches().put(uniapp_MP.getAppid(), uniapp_MP);
|
||||
@@ -285,4 +286,13 @@ public class MyUserIconUtil {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeUniMP(){
|
||||
IUniMP uniapp_MP = BaseApplication.getUniMPCaches().get(uniapp_mp_appid);
|
||||
if(uniapp_MP != null && uniapp_MP.isRunning()){
|
||||
uniapp_MP.closeUniMP();
|
||||
BaseApplication.getUniMPCaches().remove(uniapp_mp_appid);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user