/** * Make sure the charset of the page using this script is * set to utf-8 or you will not get the correct results. */ var utf8 = (function () { var highSurrogateMin = 0xd800, highSurrogateMax = 0xdbff, lowSurrogateMin = 0xdc00, lowSurrogateMax = 0xdfff, surrogateBase = 0x10000; function isHighSurrogate(charCode) { return highSurrogateMin <= charCode && charCode <= highSurrogateMax; } function isLowSurrogate(charCode) { return lowSurrogateMin <= charCode && charCode <= lowSurrogateMax; } function combineSurrogate(high, low) { return ((high - highSurrogateMin) << 10) + (low - lowSurrogateMin) + surrogateBase; } /** * Convert charCode to JavaScript String * handling UTF16 surrogate pair */ function chr(charCode) { var high, low; if (charCode < surrogateBase) { return String.fromCharCode(charCode); } // convert to UTF16 surrogate pair high = ((charCode - surrogateBase) >> 10) + highSurrogateMin, low = (charCode & 0x3ff) + lowSurrogateMin; return String.fromCharCode(high, low); } /** * Convert JavaScript String to an Array of * UTF8 bytes * @export */ function stringToBytes(str) { var bytes = [], strLength = str.length, strIndex = 0, charCode, charCode2; while (strIndex < strLength) { charCode = str.charCodeAt(strIndex++); // handle surrogate pair if (isHighSurrogate(charCode)) { if (strIndex === strLength) { throw new Error('Invalid format'); } charCode2 = str.charCodeAt(strIndex++); if (!isLowSurrogate(charCode2)) { throw new Error('Invalid format'); } charCode = combineSurrogate(charCode, charCode2); } // convert charCode to UTF8 bytes if (charCode < 0x80) { // one byte bytes.push(charCode); } else if (charCode < 0x800) { // two bytes bytes.push(0xc0 | (charCode >> 6)); bytes.push(0x80 | (charCode & 0x3f)); } else if (charCode < 0x10000) { // three bytes bytes.push(0xe0 | (charCode >> 12)); bytes.push(0x80 | ((charCode >> 6) & 0x3f)); bytes.push(0x80 | (charCode & 0x3f)); } else { // four bytes bytes.push(0xf0 | (charCode >> 18)); bytes.push(0x80 | ((charCode >> 12) & 0x3f)); bytes.push(0x80 | ((charCode >> 6) & 0x3f)); bytes.push(0x80 | (charCode & 0x3f)); } } return bytes; } /** * Convert an Array of UTF8 bytes to * a JavaScript String * @export */ function bytesToString(bytes) { var str = '', length = bytes.length, index = 0, byte, charCode; while (index < length) { // first byte byte = bytes[index++]; if (byte < 0x80) { // one byte charCode = byte; } else if ((byte >> 5) === 0x06) { // two bytes charCode = ((byte & 0x1f) << 6) | (bytes[index++] & 0x3f); } else if ((byte >> 4) === 0x0e) { // three bytes charCode = ((byte & 0x0f) << 12) | ((bytes[index++] & 0x3f) << 6) | (bytes[index++] & 0x3f); } else { // four bytes charCode = ((byte & 0x07) << 18) | ((bytes[index++] & 0x3f) << 12) | ((bytes[index++] & 0x3f) << 6) | (bytes[index++] & 0x3f); } str += chr(charCode); } return str; } return { stringToBytes: stringToBytes, bytesToString: bytesToString }; }()); 'use strict'; var app = angular.module('app', [ 'ui.router', 'templatescache', 'ngAnimate', 'ngCookies' ]); angular.module('app').run(['$rootScope', '$state', '$stateParams', function($rootScope, $state, $stateParams) { $rootScope.$state = $state; $rootScope.$stateParams = $stateParams; } ]).config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/home'); // $stateProvider.state('home', { url: '/home', templateUrl: 'templates/home.html', controller: 'HomeController' }) .state('webChat', { url: '/webChat', templateUrl: 'templates/webChat.html', controller: 'WebController' }) .state('webChat.service', { url: '/service', templateUrl: 'templates/service.html', controller: 'WebController' }) .state('webChat.maxOne', { url: '/maxOne', templateUrl: 'templates/maxOne.html', controller: 'WebController' }) .state('webChat.guide', { url: '/guide', templateUrl: 'templates/guide.html', controller: 'WebController' }) .state('webChat.search', { url: '/search', templateUrl: 'templates/search.html', controller: 'WebController' }) .state('webChat.listView', { url: '/listView', templateUrl: 'templates/listView.html', controller: 'WebController' }) .state('webChat.detail', { url: '/detail', params: { data: {} }, // templateUrl: 'templates/detail.html', controller: 'WebController' }); } ]); angular.module('templatescache', []).run(['$templateCache', function($templateCache) {$templateCache.put('templates/detail.html',''); $templateCache.put('templates/guide.html',''); $templateCache.put('templates/home.html','
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n

\u6700\u591A\u8DD1\u4E00\u6B21

\r\n
\r\n
\r\n

\u670D\u52A1\u4E8B\u9879

\r\n
\r\n
\r\n

\u7A97\u53E3\u5F15\u5BFC

\r\n
\r\n
\r\n

12345

\r\n
\r\n
\r\n
\r\n \r\n
\r\n

\u70ED\u70B9\u4E8B\u9879+ \u6DFB\u52A0

\r\n
\r\n
\r\n \u793E\u4FDD\r\n
\r\n
\r\n \u516C\u79EF\u91D1\r\n
\r\n
\r\n \u6237\u53E3\r\n
\r\n
\r\n \u8EAB\u4EFD\u8BC1\r\n
\r\n
\r\n
\r\n
\r\n \u6863\u6848\r\n
\r\n
\r\n \u9A7E\u9A76\u8BC1\r\n
\r\n
\r\n \u5DE5\u5546\r\n
\r\n
\r\n \u4F01\u4E1A\u8BBE\u7ACB\r\n
\r\n
\r\n
\r\n
\r\n \r\n
'); $templateCache.put('templates/listView.html',''); $templateCache.put('templates/maxOne.html',''); $templateCache.put('templates/search.html',''); $templateCache.put('templates/service.html',''); $templateCache.put('templates/webChat.html','
\n
\n\n\n');}]); 'use strict'; angular.module('app').controller('HomeController', ['$scope', 'messageService', function($scope, messageService) { $scope.$on('$viewContentLoaded', function() { }); $scope.menuLeft = function(event) { var actived = $(event.target); var myMenu = $(".menu")[0]; console.log(actived); if (myMenu.className.indexOf("menu--visible") == -1) { angular.element(".menu").addClass("menu--visible"); } else if (actived[0].className.indexOf("menu--visible") !== -1) { angular.element(".menu").removeClass("menu--visible"); } else if (actived[0].className.indexOf("menu--visible") == -1 && actived[0].innerText.indexOf("站点列表") == -1) { if (actived[0].innerText == "丽水市本级") { $("#city")[0].textContent = "丽水市"; angular.element(".menu").removeClass("menu--visible"); angular.element(".actived").removeClass("actived"); actived.addClass("actived"); $(actived[0].children).addClass("actived"); messageService.setCounty(actived[0].value); messageService.getCounty(function(response) { console.log("Success", response); }, function(error) { console.log("error!"); }); } else if (actived[0].innerText !== "") { $("#city")[0].textContent = actived[0].innerText; angular.element(".menu").removeClass("menu--visible"); angular.element(".actived").removeClass("actived"); actived.addClass("actived"); $(actived[0].children).addClass("actived"); } } }; }]); 'use strict'; angular.module('app').controller('WebController', ['$scope', function($scope) { //lxtalkClient.Invoke('{FB60F992-A0FD-47B3-AAA7-E80DF209C5A4}', '_Register', '', $scope); }]); 'use strict'; angular.module('app').service('messageService', ['$http', function($http) { var self = this; this.countyId = 0; this.setCounty = function(countyId) { this.countyId = countyId; }; this.getCounty = function(successCallback, failsCallback) { $http.get('http://192.168.0.75/api/branch/all/' + this.countyId).then(successCallback, failsCallback); }; this.getByBranch = function(guId, successCallback, failsCallback) { $http.get('http://192.168.0.75/api/powermatter/getByBranch/' + this.countyId + '/' + guId).then(successCallback, failsCallback); }; this.getDetail = function(qlCode, successCallback, failsCallback) { $http.get('http://192.168.0.75/api/powermatter/detail/' + this.countyId + '/' + qlCode).then(successCallback, failsCallback); }; }]);