5 changed files with 91 additions and 1 deletions
@ -1,3 +1,6 @@
|
||||
# open-JSD-8179 |
||||
|
||||
JSD-8179 |
||||
JSD-8179 微信集成H5报表时隐藏右上角的菜单\ |
||||
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ |
||||
仅作为开发者学习参考使用!禁止用于任何商业用途!\ |
||||
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。 |
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<plugin> |
||||
<id>com.fr.plugin.qywxyccd</id> |
||||
<name><![CDATA[企业微信隐藏菜单]]></name> |
||||
<active>yes</active> |
||||
<version>1.0.6</version> |
||||
<env-version>10.0</env-version> |
||||
<jartime>2020-07-31</jartime> |
||||
<vendor>author</vendor> |
||||
<description><![CDATA[企业微信隐藏菜单]]></description> |
||||
<change-notes><![CDATA[ |
||||
]]></change-notes> |
||||
<lifecycle-monitor class="com.fr.plugin.YCCDMonitor"/> |
||||
<dependence> |
||||
<item type="plugin" key="com.fr.plugin.mobile.web"/> |
||||
</dependence> |
||||
<function-recorder class="com.fr.plugin.YCCDMonitor"/> |
||||
</plugin > |
@ -0,0 +1,48 @@
|
||||
package com.fr.plugin; |
||||
|
||||
import com.fr.base.ServerConfig; |
||||
import com.fr.base.TemplateUtils; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.plugin.context.PluginContext; |
||||
import com.fr.plugin.context.PluginContexts; |
||||
import com.fr.plugin.mobile.web.server.config.Html5Config; |
||||
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor; |
||||
import com.fr.plugin.transform.ExecuteFunctionRecord; |
||||
import com.fr.plugin.transform.FunctionRecorder; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.stable.fun.Authorize; |
||||
|
||||
@FunctionRecorder |
||||
@Authorize(callSignKey = "com.fr.plugin.qywxyccd") |
||||
public class YCCDMonitor extends AbstractPluginLifecycleMonitor { |
||||
@Override |
||||
@ExecuteFunctionRecord |
||||
public void afterRun(PluginContext pluginContext) { |
||||
|
||||
Html5Config html5Config = Html5Config.getInstance(); |
||||
String jsLink = html5Config.getJsLink(); |
||||
if (PluginContexts.currentContext().isAvailable()) { |
||||
// 做认证通过的事情
|
||||
if (!StringUtils.contains(jsLink, "hidemenu.js")) { |
||||
String url = null; |
||||
ServerConfig serverConfig = ServerConfig.getInstance(); |
||||
String reportServletName = serverConfig.getServletName(); |
||||
try { |
||||
url = "/"+reportServletName+"/file?path=com/fr/plugin/hidemenu.js&type=plain&parser=plain" ; |
||||
html5Config.setjsLink(jsLink +";\n"+ url); |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
} else { |
||||
// 做认证未通过的事情
|
||||
FineLoggerFactory.getLogger().error("企业微信隐藏菜单 插件未注册"); |
||||
} |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void beforeStop(PluginContext pluginContext) { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,21 @@
|
||||
; |
||||
var initss = setInterval(function () { |
||||
try { |
||||
if (window.Dec.H5) { |
||||
clearInterval(initss); |
||||
window.Dec.H5.Ready(function (data) { |
||||
alert(data) |
||||
wx.hideOptionMenu(); |
||||
wx.hideAllNonBaseMenuItem(); |
||||
wx.hideMenuItems({ |
||||
menuList: [ |
||||
"menuItem:setFont", |
||||
"menuItem:refresh", |
||||
] // 要隐藏的菜单项
|
||||
}); |
||||
}) |
||||
} |
||||
} catch (e) { |
||||
// alert(e)
|
||||
} |
||||
}, 2000) |
Loading…
Reference in new issue