.run(['$rootScope', '$route', '$window', '$location', 'Position', '$cookies', 'Request', '$cookieStore',
function($rootScope, $route, $window, $location, position, $cookies, request, $cookieStore) {
//非微信的登陆
$rootScope.isWeiXinLogin = function() {
//判断是否微信登陆
var ua = window.navigator.userAgent.toLowerCase();
//console.log(ua); //mozilla/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit/601.1.46 (khtml, like gecko) version/9.0 mobile/13b143 safari/601.1
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
console.log(" 是来自微信内置浏览器");
return true;
} else {
console.log("不是来自微信内置浏览器");
return false;
}
};
]);
angular.module('autumnswind').controller('OrderCtrl', ['$rootScope', '$scope', 'Request', '$cookies', '$window', '$routeParams', '$location', 'Tool',
function($rootScope, $scope, request, $cookies, $window, $routeParams, $location, tool) {
if ($rootScope.isWeiXinLogin()) {
...
}
}
]);
$rootScope.goLogin = function(replace) {
if ($rootScope.isWeiXinLogin()) {
if (!replace) {
$cookieStore.remove('loginBack');
delete $cookies.loginBack;
$location.path('login');
} else {
$cookies.loginBack = $location.path();
$location.path('login').replace();
}
} else {
$cookieStore.remove('loginBack');
delete $cookies.loginBack;
$location.path('loginWebapp');
}
};
var getParam = function(name) {
var search = document.location.search;
var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
var matcher = pattern.exec(search);
var items = null;
if (null != matcher) {
try {
items = decodeURIComponent(decodeURIComponent(matcher[1]));
} catch (e) {
try {
items = decodeURIComponent(matcher[1]);
} catch (e) {
items = matcher[1];
}
}
}
return items;
};
//这个是根据路由name来决定进入那个parts
window.cats = getParam('AutumnsWind');
$rootScope.$on('$routeChangeSuccess',
function() {
var route = window.location.href;
if (route.indexOf('/hello/') != -1 && route.indexOf('/autumnswind/') != -1) {
window.AutumnsWindShareUrl = window.location.href;
} else if (route.indexOf('#/index') != -1) {
window.AutumnsWindShareUrl = window.location.href;
} else if (route.indexOf('#/asw'scat/') != -1) {
window.AutumnsWindShareUrl = window.location.href;
} else {
//跳转下载页面
window.AutumnsWindShareUrl = '~autumns~.cn';
}
);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有