配置登录页菜单

This commit is contained in:
guange 2016-08-02 17:27:40 +08:00
parent 2632f7aa59
commit 2a67ec5407
3 changed files with 13 additions and 3 deletions

View File

@ -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(){

View File

@ -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");
}));

View File

@ -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){
//是否已经绑定