123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- /**
- * 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','<div class="lszw-home">\r\n <!--<div class="bgImg">\r\n </div>-->\r\n <div class="county">\r\n <p ng-click="menuLeft($event)" class="lf menu-icon"><span class="glyphicon glyphicon-map-marker"></span><span id="city">\u4E3D\u6C34\u5E02</span></p>\r\n </div>\r\n <div class="guides">\r\n <div class="lab maxOne" ui-sref="">\r\n <p><span class="glyphicon glyphicon-send"></span><span>\u6700\u591A\u8DD1\u4E00\u6B21</span></p>\r\n </div>\r\n <div class="lab service" ui-sref="">\r\n <p><span class="glyphicon glyphicon-th-list"></span><span>\u670D\u52A1\u4E8B\u9879</span></p>\r\n </div>\r\n <div class="lab guide" ui-sref="">\r\n <p><span class="glyphicon glyphicon-list-alt"></span><span>\u7A97\u53E3\u5F15\u5BFC</span></p>\r\n </div>\r\n <div class="lab seacch " ui-sref="">\r\n <p><span class="glyphicon glyphicon-phone-alt"></span><span>12345</span></p>\r\n </div>\r\n </div>\r\n <div class="hot-point">\r\n <div class="input-search">\r\n <input type="text" class="form-control input-sm" placeholder="\u641C\u7D22\u4E8B\u9879 . . ." ng-change="searchUser()" ng-model="searchName">\r\n <span class="glyphicon glyphicon-search"></span>\r\n <span id="search">\u641C\u7D22</span>\r\n </div>\r\n <div class="hot">\r\n <p class="hot-title"><span>\u70ED\u70B9\u4E8B\u9879</span><span class="addHot">+ \u6DFB\u52A0</span></p>\r\n <div class="line">\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-tint" style="background-color: #71D5A6;"></span><span>\u793E\u4FDD</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-grain" style="background-color: #FFC547;"></span><span>\u516C\u79EF\u91D1</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-book" style="background-color: #FA7471;"></span><span>\u6237\u53E3</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-user" style="background-color: #40A1E6;"></span><span>\u8EAB\u4EFD\u8BC1</span>\r\n </div>\r\n </div>\r\n <div class="line">\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-envelope" style="background-color: #FA7471;"></span><span>\u6863\u6848</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-film" style="background-color: #40A1E6;"></span><span>\u9A7E\u9A76\u8BC1</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-yen" style="background-color: #FFC547;"></span><span>\u5DE5\u5546</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-home" style="background-color: #71D5A6;"></span><span>\u4F01\u4E1A\u8BBE\u7ACB</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="menu" ng-click="menuLeft($event)">\r\n <div class="app-menu">\r\n <ul class="sidenav">\r\n <div class="title"> \u7AD9\u70B9\u5217\u8868</div>\r\n <li ng-value="0"><a ng-value="0" class="city actived" href="#">\u4E3D\u6C34\u5E02\u672C\u7EA7 <span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="1"><a ng-value="1" class="city" href="#">\u83B2\u90FD\u533A <span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="2"><a ng-value="2" class="city" href="#">\u9F99\u6CC9\u5E02<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="3"><a ng-value="3" class="city" href="#">\u9752\u7530\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="4"><a ng-value="4" class="city" href="#">\u4E91\u548C\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="5"><a ng-value="5" class="city" href="#">\u5E86\u5143\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="6"><a ng-value="6" class="city" href="#">\u7F19\u4E91\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="7"><a ng-value="7" class="city" href="#">\u9042\u660C\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="8"><a ng-value="8" class="city" href="#">\u677E\u9633\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="9"><a ng-value="9" class="city" href="#">\u666F\u5B81\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="10"><a ng-value="10" class="city" href="#">\u7ECF\u6D4E\u5F00\u53D1\u533A<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</div>');
- $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','<header>\n</header>\n<content ui-view></content>\n\n<footer class="foot">\n</footer>');}]);
- '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);
- };
- }]);
|