diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index e06d84bfb..e7b89f224 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -23,6 +23,8 @@ window.g_projectid = <%= @project_id %>; <% end %> + //参考文档 + //https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115&token=&lang=zh_CN wx.config({ debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: '<%= @appid %>', // 必填,公众号的唯一标识 @@ -30,7 +32,8 @@ nonceStr: '<%= @sign_params[:noncestr] %>', // 必填,生成签名的随机串 signature: '<%= @sign_params[:signature] %>',// 必填,签名,见附录1 jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', - 'hideMenuItems','closeWindow', 'scanQRCode'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 + 'hideOptionMenu','showOptionMenu','showMenuItems', 'hideMenuItems', + 'hideAllNonBaseMenuItem','showAllNonBaseMenuItem','closeWindow', 'scanQRCode'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ diff --git a/public/javascripts/wechat/controllers/login.js b/public/javascripts/wechat/controllers/login.js index f31dd629f..b70398955 100644 --- a/public/javascripts/wechat/controllers/login.js +++ b/public/javascripts/wechat/controllers/login.js @@ -1,5 +1,8 @@ -app.controller('LoginController', ['$scope', '$http', '$location', '$routeParams', 'alertService', 'config','auth','session', - function ($scope, $http, $location, $routeParams, alertService, config, auth,session) { +app.controller('LoginController', ['$scope', '$http', '$location', '$routeParams', 'alertService', 'config','auth','session','wx', + function ($scope, $http, $location, $routeParams, alertService, config, auth,session, wx) { + // 登录页不用显示菜音 + wx.hideOptionMenu(); + if(auth.get_bind().then(function(){ $location.path("/activities"); })); diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js index 89e2b700f..6e110a6ea 100644 --- a/public/javascripts/wechat/others/factory.js +++ b/public/javascripts/wechat/others/factory.js @@ -30,6 +30,10 @@ app.factory('alertService', function(){ } }); +app.factory('wx', ['$window', function($window){ + var wechat = $window.wx; + return wechat; +}]); app.factory('auth', ['$http','$routeParams', '$q', 'session', 'config',function($http,$routeParams, $q, session,config){ //是否已经绑定