app-838d641c35.js 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. /**
  2. * Make sure the charset of the page using this script is
  3. * set to utf-8 or you will not get the correct results.
  4. */
  5. var utf8 = (function () {
  6. var highSurrogateMin = 0xd800,
  7. highSurrogateMax = 0xdbff,
  8. lowSurrogateMin = 0xdc00,
  9. lowSurrogateMax = 0xdfff,
  10. surrogateBase = 0x10000;
  11. function isHighSurrogate(charCode) {
  12. return highSurrogateMin <= charCode && charCode <= highSurrogateMax;
  13. }
  14. function isLowSurrogate(charCode) {
  15. return lowSurrogateMin <= charCode && charCode <= lowSurrogateMax;
  16. }
  17. function combineSurrogate(high, low) {
  18. return ((high - highSurrogateMin) << 10) + (low - lowSurrogateMin) + surrogateBase;
  19. }
  20. /**
  21. * Convert charCode to JavaScript String
  22. * handling UTF16 surrogate pair
  23. */
  24. function chr(charCode) {
  25. var high, low;
  26. if (charCode < surrogateBase) {
  27. return String.fromCharCode(charCode);
  28. }
  29. // convert to UTF16 surrogate pair
  30. high = ((charCode - surrogateBase) >> 10) + highSurrogateMin,
  31. low = (charCode & 0x3ff) + lowSurrogateMin;
  32. return String.fromCharCode(high, low);
  33. }
  34. /**
  35. * Convert JavaScript String to an Array of
  36. * UTF8 bytes
  37. * @export
  38. */
  39. function stringToBytes(str) {
  40. var bytes = [],
  41. strLength = str.length,
  42. strIndex = 0,
  43. charCode, charCode2;
  44. while (strIndex < strLength) {
  45. charCode = str.charCodeAt(strIndex++);
  46. // handle surrogate pair
  47. if (isHighSurrogate(charCode)) {
  48. if (strIndex === strLength) {
  49. throw new Error('Invalid format');
  50. }
  51. charCode2 = str.charCodeAt(strIndex++);
  52. if (!isLowSurrogate(charCode2)) {
  53. throw new Error('Invalid format');
  54. }
  55. charCode = combineSurrogate(charCode, charCode2);
  56. }
  57. // convert charCode to UTF8 bytes
  58. if (charCode < 0x80) {
  59. // one byte
  60. bytes.push(charCode);
  61. }
  62. else if (charCode < 0x800) {
  63. // two bytes
  64. bytes.push(0xc0 | (charCode >> 6));
  65. bytes.push(0x80 | (charCode & 0x3f));
  66. }
  67. else if (charCode < 0x10000) {
  68. // three bytes
  69. bytes.push(0xe0 | (charCode >> 12));
  70. bytes.push(0x80 | ((charCode >> 6) & 0x3f));
  71. bytes.push(0x80 | (charCode & 0x3f));
  72. }
  73. else {
  74. // four bytes
  75. bytes.push(0xf0 | (charCode >> 18));
  76. bytes.push(0x80 | ((charCode >> 12) & 0x3f));
  77. bytes.push(0x80 | ((charCode >> 6) & 0x3f));
  78. bytes.push(0x80 | (charCode & 0x3f));
  79. }
  80. }
  81. return bytes;
  82. }
  83. /**
  84. * Convert an Array of UTF8 bytes to
  85. * a JavaScript String
  86. * @export
  87. */
  88. function bytesToString(bytes) {
  89. var str = '',
  90. length = bytes.length,
  91. index = 0,
  92. byte,
  93. charCode;
  94. while (index < length) {
  95. // first byte
  96. byte = bytes[index++];
  97. if (byte < 0x80) {
  98. // one byte
  99. charCode = byte;
  100. }
  101. else if ((byte >> 5) === 0x06) {
  102. // two bytes
  103. charCode = ((byte & 0x1f) << 6) | (bytes[index++] & 0x3f);
  104. }
  105. else if ((byte >> 4) === 0x0e) {
  106. // three bytes
  107. charCode = ((byte & 0x0f) << 12) | ((bytes[index++] & 0x3f) << 6) | (bytes[index++] & 0x3f);
  108. }
  109. else {
  110. // four bytes
  111. charCode = ((byte & 0x07) << 18) | ((bytes[index++] & 0x3f) << 12) | ((bytes[index++] & 0x3f) << 6) | (bytes[index++] & 0x3f);
  112. }
  113. str += chr(charCode);
  114. }
  115. return str;
  116. }
  117. return {
  118. stringToBytes: stringToBytes,
  119. bytesToString: bytesToString
  120. };
  121. }());
  122. 'use strict';
  123. var app = angular.module('app', [
  124. 'ui.router',
  125. 'templatescache',
  126. 'ngAnimate',
  127. 'ngCookies'
  128. ]);
  129. angular.module('app').run(['$rootScope', '$state', '$stateParams', 'auth2Service',
  130. function($rootScope, $state, $stateParams, auth2Service) {
  131. $rootScope.$state = $state;
  132. $rootScope.$stateParams = $stateParams;
  133. var locationChangeStartOff = $rootScope.$on('$locationChangeStart', function(event) {
  134. auth2Service.checkAuthByServer();
  135. });
  136. }
  137. ]).config(['$stateProvider', '$urlRouterProvider',
  138. function($stateProvider, $urlRouterProvider) {
  139. $urlRouterProvider.otherwise('/home'); //
  140. $stateProvider.state('home', {
  141. url: '/home',
  142. templateUrl: 'templates/home.html',
  143. controller: 'HomeController'
  144. })
  145. .state('webChat', {
  146. url: '/webChat',
  147. templateUrl: 'templates/webChat.html',
  148. controller: 'WebController'
  149. })
  150. .state('webChat.conComplain', {
  151. url: '/conComplain',
  152. templateUrl: 'templates/webChat-1.html',
  153. controller: 'WebController'
  154. })
  155. .state('webChat.queryEv', {
  156. url: '/queryEv',
  157. templateUrl: 'templates/webChat-2.html',
  158. controller: 'WebController'
  159. })
  160. .state('webChat.dyInfo', {
  161. url: '/dyInfo',
  162. templateUrl: 'templates/webChat-3.html',
  163. controller: 'WebController'
  164. })
  165. .state('webChat.resultQue', {
  166. url: '/resultQue',
  167. templateUrl: 'templates/webChat-4.html',
  168. controller: 'ResultController'
  169. })
  170. .state('webChat.online', {
  171. url: '/online',
  172. templateUrl: 'templates/webChat-5.html',
  173. controller: 'WebController'
  174. })
  175. .state('webChat.pageView', {
  176. url: '/pageView',
  177. params: { data: {} }, //
  178. templateUrl: 'templates/webChat-6.html',
  179. controller: 'DetailController'
  180. });
  181. }
  182. ]);
  183. angular.module('templatescache', []).run(['$templateCache', function($templateCache) {$templateCache.put('templates/home.html','<div class="main box-content">\n <header>\n <!--<div class="header111">\n <img src="../img/webChatImg/banner.png" alt="">\n </div>-->\n <div class="swiper-container">\n <div class="swiper-wrapper">\n <div class="swiper-slide"><img src="../img/webChatImg/banner.png" alt=""></div>\n <div class="swiper-slide"><img src="../img/webChatImg/banner.png" alt=""></div>\n <div class="swiper-slide"><img src="../img/webChatImg/banner.png" alt=""></div>\n </div>\n <!-- \u5982\u679C\u9700\u8981\u5206\u9875\u5668 -->\n <div class="swiper-pagination"></div>\n <!-- \u5982\u679C\u9700\u8981\u5BFC\u822A\u6309\u94AE -->\n <!--<div class="swiper-button-prev"></div>\n <div class="swiper-button-next"></div>-->\n <!-- \u5982\u679C\u9700\u8981\u6EDA\u52A8\u6761 -->\n <!--<div class="swiper-scrollbar"></div>-->\n </div>\n </header>\n\n <content class="mid-content">\n <div></div>\n </content>\n\n <footer>\n <div class="bg">\n <img src="../img/webChatImg/bg2.jpg" alt="">\n </div>\n <div class="contain" ng-cloak>\n <div class="inquire" ng-cloak>\n <a href="http://www.lszszw.gov.cn/Search.aspx">\n <img class="breath size1" src="../img/webChatImg/\u81EA\u52A9\u54A8\u8BE2.png" alt=""><span class="explain">\u81EA\u52A9\u54A8\u8BE2</span>\n </a>\n </div>\n <div class="call" ng-cloak>\n <a href="tel:057812345">\n <img class="breath size2" src="../img/webChatImg/12345.png" alt=""><span class="explain">\u62E8\u625312345</span>\n </a>\n </div>\n <div class="online" ng-cloak>\n <a data-toggle="modal" href="">\n <img class="breath size3" ng-click="onOnlineClick($event)" src="../img/webChatImg/\u5728\u7EBF\u670D\u52A1.png" alt=""><span ng-click="onOnlineClick($event)" class="explain">\u5728\u7EBF\u670D\u52A1</span>\n </a>\n </div>\n <div class="email" ng-cloak>\n <a ui-sref="webChat.online" href="">\n <!--data-toggle="modal" data-target="#info"-->\n <img class="breath size4" src="../img/webChatImg/\u7F51\u4E0A\u4FE1\u7BB1.png" alt=""><span class="explain">\u7F51\u4E0A\u4FE1\u7BB1</span>\n </a>\n </div>\n <div class="result" ng-cloak>\n <a ui-sref="webChat.resultQue" href="">\n <img class="breath size5" src="../img/webChatImg/\u7ED3\u679C\u67E5\u8BE2.png" alt=""><span class="explain">\u7ED3\u679C\u67E5\u8BE2</span>\n </a>\n </div>\n\n <div class="logo">\n <img src="../img/webChatImg/logo.png" alt="">\n </div>\n </div>\n </footer>\n <div class="modal fade info" id="info" tabindex="-2" data-backdrop="static" role="dialog" aria-labelledby="infoModalLabel" aria-hidden="true">\n <div class="modal-info">\n <p>\u6B64\u529F\u80FD\u6B63\u5728\u5168\u529B\u5F00\u53D1\u4E2D\uFF0C\u656C\u8BF7\u671F\u5F85</p>\n <a href="" data-dismiss="modal" style="color:#888;">\u5173\u95ED</a>\n </div>\n </div>\n <div class="modal fade errorLogin" id="errorLoginModal" tabindex="-2" data-backdrop="static" role="dialog" aria-labelledby="errorLoginModalLabel" aria-hidden="true">\n <div class="modal-info">\n <p>{{addr.regeocode.addressComponent.district}}\u6682\u4E0D\u652F\u6301\u6B64\u529F\u80FD</p>\n <a href="" data-dismiss="modal" style="color:#888;">\u5173\u95ED</a>\n </div>\n </div>\n <div class="modal fade phoneLogin" id="phoneLoginModal" tabindex="-2" data-backdrop="static" role="dialog" aria-labelledby="phoneLoginModalLabel" aria-hidden="true">\n <div class="modal-info">\n <p>\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801</p>\n <input class="form-control input-sm" type="text" ng-model="currentUser.Mobile">\n <a ng-click="onlineService()">\u786E\u5B9A</a>\n <a href="" data-dismiss="modal" style="color:#888;">\u5173\u95ED</a>\n </div>\n </div>\n</div>');
  184. $templateCache.put('templates/webChat-1.html','<div class="ui-webView">\n <div class="header">\n <span onClick="javascript :history.back(-1);" class="glyphicon glyphicon-arrow-left"></span><span>\u54A8\u8BE2\u6295\u8BC9</span><span ui-sref="home" class="glyphicon glyphicon-home"></span>\n </div>\n <div class="webContent-1">\n <div class="webImg-1">\n </div>\n\n <div class="circular" id="1">\n <span> <p>\u54A8\u8BE2\u6295\u8BC9</p> </span>\n </div>\n\n <div class="web-button">\n <div style="height:50px"></div>\n <a href="tel:12345">\n <button type="button" class="btn btn-block">\n \n <span class="glyphicon glyphicon-comment" aria-hidden="true"></span>\n <p>\u4EBA\u5DE5\u5BA2\u670D</p> \n </button>\n </a>\n <a href="https://zjwskj.qiyukf.com/client?k=e52a7ac21a88369ef6c38c56b54c810e&wp=1" target="_blank">\n <button type="button" class="btn btn-block">\n <span class=" glyphicon glyphicon-phone-alt" aria-hidden="true"></span>\n <p>\u5728\u7EBF\u54A8\u8BE2</p>\n \n </button>\n </a>\n <button type="button" class="btn btn-block" ui-sref="webChat.online">\n <span class="glyphicon glyphicon-globe" aria-hidden="true"></span>\n <p>\u7F51\u4E0A\u6295\u8BC9</p> \n </button>\n </div>\n </div>\n</div>');
  185. $templateCache.put('templates/webChat-2.html','<div class="ui-webView">\n <div class="header">\n <span onClick="javascript :history.back(-1);" class="glyphicon glyphicon-arrow-left"></span><span>\u67E5\u8BE2\u8BC4\u4EF7</span><span ui-sref="home" class="glyphicon glyphicon-home"></span>\n </div>\n <div class="webContent-1">\n <div class="webImg-1">\n </div>\n\n <div class="circular" id="color2">\n <span> <p>\u67E5\u8BE2\u8BC4\u4EF7</p> </span>\n </div>\n\n <div class="web-button" id="btn2">\n <div style="height:50px"></div>\n <button type="button" class="btn btn-block">\n <span class="glyphicon glyphicon-phone" aria-hidden="true"></span>\n <p>\u624B\u673A\u53F7\u67E5\u8BE2</p> \n </button>\n <button type="button" class="btn btn-block">\n <span class="glyphicon glyphicon-barcode" aria-hidden="true"></span>\n <p>\u67E5\u8BE2\u7801\u67E5\u8BE2</p> \n </button>\n </div>\n </div>\n</div>');
  186. $templateCache.put('templates/webChat-3.html','<div class="ui-webView">\n <div class="header">\n <span onClick="javascript :history.back(-1);" class="glyphicon glyphicon-arrow-left"></span><span>\u52A8\u6001\u4FE1\u606F</span><span ui-sref="home" class="glyphicon glyphicon-home"></span>\n </div>\n <div class="webContent-1">\n <div class="webImg-1">\n </div>\n\n <div class="circular" id="color3">\n <span> <p>\u52A8\u6001\u4FE1\u606F</p> </span>\n </div>\n\n <div class="web-button" id="btn3">\n <div style="height:50px"></div>\n <button type="button" class="btn btn-block">\n <span class="glyphicon glyphicon-comment" aria-hidden="true"></span>\n <p>\u5E73\u53F0\u7B80\u4ECB</p> \n </button>\n <button type="button" class="btn btn-block">\n <span class=" glyphicon glyphicon-phone-alt btn3-2" aria-hidden="true"></span>\n <p>\u9886\u5BFC\u63A5\u542C\u9884\u544A</p> \n </button>\n <button type="button" class="btn btn-block">\n <span class="glyphicon glyphicon-globe" aria-hidden="true"></span>\n <p>\u5DE5\u4F5C\u52A8\u6001</p> \n </button>\n </div>\n </div>\n</div>');
  187. $templateCache.put('templates/webChat-4.html','<div class="results-Que">\r\n <div class="header">\r\n <span onClick="javascript :history.back(-1);" class="glyphicon glyphicon-arrow-left"></span><span>\u7ED3\u679C\u67E5\u8BE2</span><span ui-sref="home" class="glyphicon glyphicon-home"></span>\r\n </div>\r\n <div class="webContent-3">\r\n <div id="form">\r\n <div class="input-search">\r\n <span class="glyphicon glyphicon-search"></span>\r\n <input type="text" class="form-control input-sm" placeholder="\u8F93\u5165\u624B\u673A\u53F7\u7801\u6216\u67E5\u8BE2\u7801 . . ." ng-change="searchUser()" ng-model="searchName">\r\n <button type="submit" class="btn btn-default" ng-click="resultQue()">\u641C\u7D22</button>\r\n </div>\r\n <div id="content" ng-show="load">\r\n <div class="results" ng-repeat="result in results track by $index" ng-click="viewDetail(result)" ui-sref="webChat.pageView">\r\n <p class="r-title">{{result.title}}</p>\r\n <small class="r-info">\u6765\u81EA\uFF1A<a >\u5FAE\u4FE1\u624B\u673A\u7AEF</a></small>\r\n <small class="r-time">{{result.createDate}}</small>\r\n <div style="border-top: solid 1px #ddd; margin: 5px 0px;"></div>\r\n <p class="r-data">{{result.describe}}</p>\r\n </div>\r\n </div>\r\n <div class="loading" ng-show="!load">\r\n <p>&nbsp<img src="../img/Loading.gif" alt="">&nbsp&nbsp&nbsp</p>\r\n <p style="margin:-5px auto 0px;">&nbsp\u6B63\u5728\u52A0\u8F7D\u6570\u636E . . .</p>\r\n </div>\r\n </div>\r\n </div>\r\n</div>');
  188. $templateCache.put('templates/webChat-5.html','<div class="online-letter">\n <div class="header">\n <span onClick="javascript :history.back(-1);" class="glyphicon glyphicon-arrow-left"></span><span>\u7F51\u4E0A\u4FE1\u7BB1</span><span ui-sref="home" class="glyphicon glyphicon-home"></span>\n </div>\n <div class="webContent-2" ng-click="footShow($event)">\n <!--<div class="webimg-2">\n <img src="../img/\u4ED9\u5BAB\u6E56.jpg">\n </div>-->\n\n <div class="userInfo">\n <form>\n <div><span>\u59D3&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\u540D\uFF1A</span><input maxlength="50" class="form-control input-sm" type="text" ng-model="bundle.name" ng-focus="footHide()"></div>\n <div><span>\u624B\u673A\u53F7\u7801\uFF1A</span><input required maxlength="11" class="form-control input-sm" type="text" ng-model="bundle.mobile" ng-focus="footHide()"><span class="certificate">*</span></div>\n <div><span>\u6807&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\u9898\uFF1A</span><input required maxlength="100" class="form-control input-sm" type="text" ng-model="bundle.title" ng-focus="footHide()"><span class="certificate">*</span></div>\n <div><span>\u6295\u8BC9\u5185\u5BB9\uFF1A</span>\n <div class="text-message descr" required maxlength="2000" type="text" contenteditable="plaintext-only" ng-focus="footHide()"></div><span class="certificate">*</span>\n </div>\n <div class="image"><span>\u56FE&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\u7247\uFF1A</span>\n <div id="imgpreview">\n </div>\n <button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-open"></span></button>\n <input id="file" type="file" name="file" multiple="multiple" onchange=\'angular.element(this).scope().imgPreview(this)\' />\n </div>\n <div style="margin-bottom:-5px"><span>\u6240\u5C5E\u53BF\u5E02\uFF1A</span>\n <select class="form-control input-sm selects" ng-model="bundle.country_Id">\n <option ng-value="\'\u4E3D\u6C34\u5E02\u672C\u7EA7\'" selected = "selected">\u4E3D\u6C34\u5E02\u672C\u7EA7</option>\n <option ng-value="\'\u83B2\u90FD\u533A\'">\u83B2\u90FD\u533A</option>\n <!--<option>\u5F00\u53D1\u533A</option>\n <option>\u9F99\u6CC9\u5E02</option>\n <option>\u9752\u7530\u53BF</option>\n <option>\u4E91\u548C\u53BF</option>\n <option>\u5E86\u5143\u53BF</option>\n <option>\u9042\u660C\u53BF</option>\n <option>\u666F\u5B81\u53BF</option>\n <option>\u7F19\u4E91\u53BF</option>\n <option>\u677E\u9633\u53BF</option>-->\n </select>\n </div>\n <div style="margin-bottom:-5px"><span>\u7C7B&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\u522B\uFF1A</span>\n <select class="form-control input-sm selects" ng-model="bundle.type">\n <option ng-value="0">\u6211\u8981\u54A8\u8BE2</option>\n <option ng-value="1">\u6211\u8981\u6295\u8BC9</option>\n <option ng-value="2" selected = "selected">\u6211\u8981\u5EFA\u8BAE</option>\n <option ng-value="3">\u9886\u5BFC\u4FE1\u7BB1</option>\n <option ng-value="4">\u6211\u8981\u4E3E\u62A5</option>\n <option ng-value="5">\u7EA0\u9519</option>\n </select>\n </div>\n <div style="margin-bottom:-5px"><span>\u662F\u5426\u5EFA\u8BAE\uFF1A</span>\n <select class="form-control input-sm selects" ng-model="bundle.advice">\n <option ng-value="0">\u6295\u8BC9</option>\n <option ng-value="1" selected = "selected">\u5EFA\u8BAE</option>\n </select>\n </div>\n <div style="margin-bottom:-5px"><span>\u662F\u5426\u516C\u5F00\uFF1A</span>\n <select class="form-control input-sm selects" ng-model="bundle.isPublic">\n <option ng-value="0" selected = "selected">\u5426</option>\n <option ng-value="1">\u662F</option>\n </select>\n </div>\n <div><span>\u6240\u5728\u4F4D\u7F6E\uFF1A</span>\n <select id="result" class="form-control input-sm">\n <option></option>\n <option></option>\n <option></option>\n </select>\n <div class="glyphicon glyphicon-map-marker cover-white"></div>\n <div class="text-map">\n <gaode-map id="container"></gaode-map>\n </div>\n </div>\n <div class="button-bottom">\n <button type="submit" class="btn btn-default" ng-click="submit($event)" data-toggle="modal">\u63D0\u4EA4</button>\n </div>\n </form>\n <div class="modal fade information" id="information" tabindex="-2" data-backdrop="static" role="dialog" aria-labelledby="infoModalLabel" aria-hidden="true">\n <div class="modal-info submit" ng-show="submiting">\n <p>&nbsp<img src="../img/Loading.gif" alt="">&nbsp&nbsp&nbsp</p>\n <p style="margin:-5px auto 0px;">&nbsp\u6B63\u5728\u4E0A\u4F20\u6570\u636E . . .</p>\n </div>\n <div class="modal-info success" ng-show="successed">\n <p>\u4E0A\u4F20\u6570\u636E\u6210\u529F</p>\n <a data-dismiss="modal" ng-click="successed=false">\u786E\u5B9A</a>\n </div>\n <div class="modal-info success" ng-show="falied">\n <p>\u4E0A\u4F20\u6570\u636E\u5931\u8D25</p>\n <a data-dismiss="modal" ng-click="falied=false">\u786E\u5B9A</a>\n </div>\n </div>\n <div class="modal fade viewModal" id="viewModal" tabindex="-2" data-backdrop="static" role="dialog" aria-labelledby="viewModalLabel" aria-hidden="true">\n <button type="button" class="close" aria-hidden="true" ng-click="sure=true"><span class="glyphicon glyphicon-trash"></span></button>\n <a class="thumbnail image-view"></a>\n <div class="modal-info sure" ng-show="sure">\n <p>\u786E\u5B9A\u5220\u9664\uFF1F</p>\n <a data-dismiss="modal" ng-click="delSure()">\u786E\u5B9A</a>\n <a ng-click="sure=flase" style="color:#888;">\u53D6\u6D88</a>\n </div>\n </div>\n </div>\n </div>\n</div>');
  189. $templateCache.put('templates/webChat-6.html','<div class="results-Que">\r\n <div class="header">\r\n <span onClick="javascript :history.back(-1);" class="glyphicon glyphicon-arrow-left"></span><span>\u7ED3\u679C\u8BE6\u7EC6</span><span ui-sref="home" class="glyphicon glyphicon-home"></span>\r\n </div>\r\n <div class="pageView">\r\n <p class="web-title">12345\u653F\u52A1\u670D\u52A1\u70ED\u7EBF</p>\r\n <div style="border-top:solid 1px #ddd;margin-bottom:10px;"></div>\r\n <div class="assess">\r\n <div class="star" ng-show="true">\r\n <span style="color:#555;">\u6EE1\u610F\u8BC4\u4EF7\uFF1A</span>\r\n <span class="glyphicon glyphicon-star five"><span class="glyphicon glyphicon-star four"><span class="glyphicon glyphicon-star three"><span class="glyphicon glyphicon-star two"><span class="glyphicon glyphicon-star one"></span></span>\r\n </span>\r\n </span>\r\n </span>\r\n <span id="lable"></span>\r\n </div>\r\n <button type="submit" class="btn btn-default ass" ng-click="assess()" data-toggle="modal" data-target="#assess">\u8BC4\u4EF7</button>\r\n </div>\r\n <div class="web-content">\r\n <p style="margin-bottom:20px;">\u5B98\u65B9\u7B54\u590D\uFF1A<span class="text-message">\u6B63\u5728\u5904\u7406\u4E2D...</span></p>\r\n </div>\r\n <p ng-click="expands($event)" ng-show="!expand">&nbsp. . .<a class="glyphicon glyphicon-menu-down web-menu">\u5C55\u5F00</a></p>\r\n <p ng-click="expands($event)" ng-show="expand"><a class="glyphicon glyphicon-menu-up web-menu">\u6536\u8D77</a></p>\r\n <div class="web-content" ng-show="expand">\r\n <p>\u6807&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp\u9898\uFF1A<span class="text-message">{{boudle.title}}</span></p>\r\n <p>\u63D0\u4EA4\u65F6\u95F4\uFF1A<span class="text-message">{{boudle.createDate}}</span></p>\r\n <p>\u7528\u6237\u59D3\u540D\uFF1A<span class="text-message">{{boudle.name}}</span></p>\r\n <p>\u624B\u673A\u53F7\u7801\uFF1A<span class="text-message">{{boudle.mobile}}</span></p>\r\n <p>\u95EE\u9898\u63CF\u8FF0\uFF1A<span class="text-message">{{boudle.describe}}</span></p>\r\n <p style="margin-top:10px;" ng-show="imgShow">\u56FE\u7247\u63CF\u8FF0\uFF1A</p>\r\n <div class="imgpreview" ng-show="imgShow">\r\n <a data-toggle="modal" data-target="#viewModal" ng-class="imgSize" ng-repeat="img in boudle.assets track by $index"><img ng-click="imgView($event)" ng-src="{{img.data.src}}"></a>\r\n </div>\r\n <p style="margin-bottom: 0px;" ng-show="mapShow">\u6240\u5728\u4F4D\u7F6E\uFF1A</p>\r\n <select id="result" class="form-control input-sm" ng-show="mapShow">\r\n <option></option>\r\n <option></option>\r\n <option></option>\r\n </select>\r\n <div class="glyphicon glyphicon-map-marker cover-white" ng-click="restAddress()" ng-show="mapShow"></div>\r\n <div class="text-map" ng-show="mapShow">\r\n <div id="containerResult"></div>\r\n </div>\r\n </div>\r\n <div class="modal fade viewModal" id="viewModal" tabindex="-2" data-backdrop="static" role="dialog" aria-labelledby="viewModalLabel" aria-hidden="true">\r\n <a class="thumbnail image-view"></a>\r\n </div>\r\n <div class="modal fade" id="assess" tabindex="-2" role="dialog" aria-labelledby="assessModalLabel" aria-hidden="true">\r\n <div class="modal-dialog">\r\n <div class="modal-content">\r\n <div class="modal-header">\r\n <p class="web-title">\u6EE1\u610F\u5EA6\u8BC4\u4EF7</p>\r\n </div>\r\n <div class="modal-body">\r\n <div class="radio">\r\n <label>\r\n <input ng-click="starChange($event)" type="radio" name="optionsRadios" class="optionsStar" id="optionsRadios1" value="option1" checked>\r\n <p>\u975E\u5E38\u6EE1\u610F\uFF1A <span class="glyphicon glyphicon-star options1"></span><span class="glyphicon glyphicon-star options1"></span><span class="glyphicon glyphicon-star options1"></span><span class="glyphicon glyphicon-star options1"></span><span class="glyphicon glyphicon-star options1"></span></p>\r\n </label>\r\n </div>\r\n <div class="radio">\r\n <label>\r\n <input ng-click="starChange($event)" type="radio" name="optionsRadios" class="optionsStar" id="optionsRadios2" value="option2">\r\n <p>\u57FA\u672C\u6EE1\u610F\uFF1A <span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star options2"></span><span class="glyphicon glyphicon-star options2"></span><span class="glyphicon glyphicon-star options2"></span><span class="glyphicon glyphicon-star options2"></span></p>\r\n </label>\r\n </div>\r\n <div class="radio">\r\n <label>\r\n <input ng-click="starChange($event)" type="radio" name="optionsRadios" class="optionsStar" id="optionsRadios3" value="option3">\r\n <p>\u4E0D\u6EE1\u610F\uFF1A <span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star"></span><span class="glyphicon glyphicon-star options3"></span><span style="margin-left:16px;" class="glyphicon glyphicon-star options3"></span></p>\r\n </label>\r\n </div>\r\n </div>\r\n <div class="modal-footer">\r\n <button ng-click="assessSure()" type="button" class="btn btn-primary" data-dismiss="modal">\u786E\u5B9A</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>');
  190. $templateCache.put('templates/webChat.html','<header>\n</header>\n<content ui-view></content>\n\n<footer class="foot">\n</footer>');}]);
  191. 'use strict';
  192. angular.module('app').controller('DetailController', ['$scope', 'userService', 'messageService', '$stateParams', '$timeout', function($scope, userService, messageService, $stateParams, $timeout) {
  193. $scope.boudle = $stateParams.data;
  194. $scope.expand = false;
  195. $scope.$on('$viewContentLoaded', function() {
  196. //初始化
  197. var clientWidth = document.documentElement.clientWidth || window.innerWidth;
  198. var innerWidth = Math.max(Math.min(clientWidth, 600), 320);
  199. $scope.imgShow = true;
  200. $scope.mapShow = true;
  201. $scope.imgSize = "thumbnail images";
  202. messageService.getAsset($stateParams.data.id,
  203. function(response) {
  204. if (response.data.length > 0) {
  205. $scope.boudle.assets = response.data;
  206. for (var i = 0; i < $scope.boudle.assets.length; i++) {
  207. if ($scope.boudle.assets[i].data && $scope.boudle.assets[i].assetType == 1) {
  208. $scope.boudle.assets[i].data = JSON.parse($scope.boudle.assets[i].data);
  209. $scope.boudle.assets[i].data.src = '/ws12345' + $scope.boudle.assets[i].data.src;
  210. } else if ($scope.boudle.assets[i].assetType == 0) {
  211. $scope.positions = JSON.parse($scope.boudle.assets[i].data);
  212. $scope.boudle.assets.splice(i, 1);
  213. i = i - 1;
  214. }
  215. }
  216. console.log(response.data);
  217. console.log($scope.boudle);
  218. console.log($scope.positions);
  219. //图片
  220. $scope.imgNum = $scope.boudle.assets.length;
  221. if (innerWidth <= 480) {
  222. if ($scope.imgNum == 1) {
  223. $scope.imgSize = "thumbnail images one";
  224. } else if ($scope.imgNum == 2) {
  225. $scope.imgSize = "thumbnail images two";
  226. } else if ($scope.imgNum >= 3) {
  227. $scope.imgSize = "thumbnail images three";
  228. } else if ($scope.imgNum == 0) {
  229. $scope.imgShow = false;
  230. }
  231. }
  232. //定位
  233. if ($scope.positions) {
  234. var map = new AMap.Map('containerResult', {
  235. resizeEnable: true,
  236. center: [$scope.positions.position.lng, $scope.positions.position.lat],
  237. zoom: 17
  238. });
  239. var marker = new AMap.Marker({
  240. map: map,
  241. position: [$scope.positions.position.lng, $scope.positions.position.lat]
  242. });
  243. map.plugin(["AMap.Geocoder"], function() {
  244. var geocoder = new AMap.Geocoder({
  245. radius: 1000,
  246. extensions: "all"
  247. });
  248. geocoder.getAddress([$scope.positions.position.lng, $scope.positions.position.lat], function(status, result) {
  249. if (status == 'complete' && result.info === 'OK') {
  250. console.log(result);
  251. $("#result")[0][0].textContent = result.regeocode.formattedAddress.substring(6);
  252. $("#result")[0][1].textContent = result.regeocode.pois[0].name;
  253. $("#result")[0][2].textContent = result.regeocode.pois[1].name;
  254. } else {
  255. alert("错误:获取地址出错");
  256. }
  257. });
  258. });
  259. } else {
  260. $scope.mapShow = false;
  261. }
  262. } else {
  263. $scope.imgShow = false;
  264. $scope.mapShow = false;
  265. history.back(-1);
  266. }
  267. $timeout();
  268. },
  269. function(error) {
  270. history.back(-1);
  271. }
  272. );
  273. //加载屏幕适应
  274. if (innerWidth > 480) {
  275. angular.element(".viewModal").removeClass("phone");
  276. angular.element("#content .text-message").addClass("pc-text");
  277. angular.element(".imgpreview .thumbnail").addClass("img-pc");
  278. } else if (innerWidth <= 480) {
  279. angular.element("#content .text-message").removeClass("pc-text");
  280. angular.element(".imgpreview .thumbnail").removeClass("img-pc");
  281. angular.element(".viewModal").addClass("phone");
  282. };
  283. //加载拖拽功能模块
  284. var oBox = $(".modal-backdrop")[0],
  285. odrop = $(".viewModal")[0];
  286. odrop.onmousedown = function(e) {
  287. var oClientX = (e || event).clientX; //鼠标位置距离最左端长度
  288. var oClientY = (e || event).clientY; //鼠标位置距离最左端长度
  289. var oLeftX = odrop.offsetLeft; //line相对父元素的长度
  290. var oTopY = odrop.offsetTop;
  291. document.onmousemove = function(e) {
  292. var LeftX = oLeftX + ((e || event).clientX - oClientX);
  293. var TopY = oTopY + ((e || event).clientY - oClientY);
  294. odrop.style.margin = 0;
  295. // LineX < 150 && (LineX = 150);
  296. // LineX > 300 && (LineX = 300);
  297. odrop.style.left = LeftX + "px";
  298. odrop.style.top = TopY + "px";
  299. return false;
  300. };
  301. document.onmouseup = function() {
  302. document.onmousemove = null;
  303. document.onmouseup = null;
  304. odrop.releaseCapture && odrop.releaseCapture(); //将鼠标事件退回
  305. };
  306. odrop.setCapture && odrop.setCapture(); //将后续的mouse事件都发送给当前对象
  307. return false;
  308. };
  309. });
  310. $scope.assess = function() {
  311. var star = $(".optionsStar");
  312. console.log(star);
  313. if (star[0].checked) {
  314. angular.element(".options1").addClass("actived");
  315. } else if (star[1].checked) {
  316. angular.element(".options2").addClass("actived");
  317. } else if (star[2].checked) {
  318. angular.element(".options3").addClass("actived");
  319. }
  320. };
  321. $scope.starChange = function(event) {
  322. var star = $(event.target);
  323. console.log(star);
  324. if (star[0].id == "optionsRadios1") {
  325. angular.element(".radio .glyphicon-star").removeClass("actived");
  326. angular.element(".options1").addClass("actived");
  327. } else if (star[0].id == "optionsRadios2") {
  328. angular.element(".radio .glyphicon-star").removeClass("actived");
  329. angular.element(".options2").addClass("actived");
  330. } else if (star[0].id == "optionsRadios3") {
  331. angular.element(".radio .glyphicon-star").removeClass("actived");
  332. angular.element(".options3").addClass("actived");
  333. }
  334. };
  335. $scope.assessSure = function() {
  336. var star = $(".optionsStar");
  337. var ass = $(".ass");
  338. console.log(star, ass);
  339. if (star[0].checked) {
  340. angular.element(".star .glyphicon-star").addClass("actived");
  341. $("#lable")[0].textContent = "非常满意";
  342. $scope.boudle.assOption = "非常满意";
  343. } else if (star[1].checked) {
  344. angular.element(".star .glyphicon-star").removeClass("actived");
  345. angular.element(".two").addClass("actived");
  346. angular.element(".three").addClass("actived");
  347. angular.element(".four").addClass("actived");
  348. angular.element(".five").addClass("actived");
  349. $("#lable")[0].textContent = "基本满意";
  350. $scope.boudle.assOption = "基本满意";
  351. } else if (star[2].checked) {
  352. angular.element(".star .glyphicon-star").removeClass("actived");
  353. angular.element(".four").addClass("actived");
  354. angular.element(".five").addClass("actived");
  355. $("#lable")[0].textContent = "不满意";
  356. $scope.boudle.assOption = "不满意";
  357. }
  358. ass[0].disabled = true;
  359. ass[0].textContent = "已评";
  360. $scope.boudle.isAssessed = 1;
  361. console.log($scope.boudle);
  362. };
  363. $scope.expands = function(event) {
  364. var actived = $(event.target);
  365. console.log(actived);
  366. if (actived[0].textContent.indexOf("展开") !== -1) {
  367. $scope.expand = true;
  368. } else if (actived[0].textContent.indexOf("收起") !== -1) {
  369. $scope.expand = false;
  370. }
  371. };
  372. $scope.imgView = function(event) {
  373. $(".viewModal")[0].style.top = 0;
  374. $(".viewModal")[0].style.left = 0;
  375. angular.element(".onView").removeClass("onView");
  376. var img = $(event.target);
  377. img[0].className = "onView";
  378. if (img[0].naturalWidth > img[0].naturalHeight) {
  379. angular.element(".image-view").addClass("width-Img");
  380. } else {
  381. angular.element(".image-view").removeClass("width-Img");
  382. }
  383. $scope.imgUrl = img[0].src;
  384. $(".image-big").remove();
  385. $(".image-view").append('<img class="image-big" src="' + $scope.imgUrl + '" data-dismiss="modal">');
  386. };
  387. $scope.restAddress = function() {
  388. var map = new AMap.Map('containerResult', {
  389. resizeEnable: true,
  390. center: [$scope.positions.position.lng, $scope.positions.position.lat],
  391. zoom: 17
  392. });
  393. var marker = new AMap.Marker({
  394. map: map,
  395. position: [$scope.positions.position.lng, $scope.positions.position.lat]
  396. });
  397. };
  398. }]);
  399. 'use strict';
  400. angular.module('app').controller('HomeController', ['$scope', '$state', '$timeout', 'userService', function($scope, $state, $timeout, userService) {
  401. $scope.getAddSuccess = true;
  402. $scope.currentUser = userService.getMe();
  403. $scope.$on('$viewContentLoaded', function() {
  404. //加载轮播
  405. var swiper = new Swiper('.swiper-container', {
  406. pagination: '.swiper-pagination',
  407. paginationClickable: true,
  408. loop: true,
  409. autoplayDisableOnInteraction: false,
  410. autoplay: 5000,
  411. effect: 'coverflow',
  412. slidesPerView: 'auto',
  413. centeredSlides: true,
  414. spaceBetween: -55,
  415. coverflow: {
  416. rotate: 30,
  417. stretch: 0,
  418. depth: 60,
  419. modifier: 1,
  420. slideShadows: false
  421. }
  422. });
  423. //加载字体适应
  424. var clientWidth = document.documentElement.clientWidth || window.innerWidth;
  425. var innerWidth = Math.max(Math.min(clientWidth, 480), 320);
  426. console.log(innerWidth);
  427. if (innerWidth < 350) {
  428. angular.element(".explain").removeClass("font-15");
  429. angular.element(".explain").addClass("font-12");
  430. } else if (innerWidth > 400) {
  431. angular.element(".explain").removeClass("font-12");
  432. angular.element(".explain").addClass("font-15");
  433. }
  434. console.log(userService.getMe());
  435. //加载sdk
  436. ysf.on({
  437. 'onload': function() {
  438. $scope.sdk = true;
  439. }
  440. });
  441. //加载地图,调用浏览器定位服务
  442. var map, geolocation;
  443. map = new AMap.Map('', {
  444. resizeEnable: true,
  445. zoom: 17
  446. });
  447. map.plugin('AMap.Geolocation', function() {
  448. geolocation = new AMap.Geolocation({
  449. enableHighAccuracy: true, //是否使用高精度定位,默认:true
  450. timeout: 30000, //超过30秒后停止定位,默认:无穷大
  451. maximumAge: 0, //定位结果缓存0毫秒,默认:0
  452. convert: true, //自动偏移坐标,偏移后的坐标为高德坐标,默认:true
  453. showButton: true, //显示定位按钮,默认:true
  454. buttonPosition: 'RB', //定位按钮停靠位置,默认:'LB',左下角
  455. buttonOffset: new AMap.Pixel(10, 20), //定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
  456. showMarker: true, //定位成功后在定位到的位置显示点标记,默认:true
  457. showCircle: true, //定位成功后用圆圈表示定位精度范围,默认:true
  458. panToLocation: true, //定位成功后将定位到的位置作为地图中心点,默认:true
  459. zoomToAccuracy: true //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
  460. });
  461. map.addControl(geolocation);
  462. geolocation.getCurrentPosition();
  463. AMap.event.addListener(geolocation, 'complete', onComplete); //返回定位信息
  464. AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
  465. function onComplete(data) {
  466. $scope.getAddSuccess = true;
  467. var geocoder = new AMap.Geocoder({
  468. radius: 1000,
  469. extensions: "all"
  470. });
  471. console.log("获取地址");
  472. geocoder.getAddress(data.position, function(status, result) {
  473. if (status === 'complete' && result.info === 'OK') {
  474. $scope.addr = result;
  475. $timeout();
  476. }
  477. });
  478. };
  479. function onError(data) {
  480. $scope.getAddSuccess = false;
  481. };
  482. });
  483. });
  484. $scope.onOnlineClick = function(e) {
  485. console.log($scope.sdk);
  486. var activeClick = $(e.target);
  487. //activeClick[0].parentElement.dataset.target = "#phoneLoginModal";
  488. if (!$scope.getAddSuccess) {
  489. alert("获取地址失败,请开启手机GPS定位功能,并允许获取地理位置授权");
  490. window.location.reload();
  491. } else if (!$scope.addr && $scope.getAddSuccess) {
  492. alert("地理位置获取中,请稍后");
  493. } else if ($scope.addr.regeocode.addressComponent.district === '莲都区') {
  494. //activeClick[0].parentElement.parentElement.dataset.target = "#phoneLoginModal";
  495. activeClick[0].parentElement.dataset.target = "#phoneLoginModal";
  496. } else {
  497. //activeClick[0].parentElement.parentElement.dataset.target = "#errorLoginModal";
  498. activeClick[0].parentElement.dataset.target = "#errorLoginModal";
  499. }
  500. };
  501. $scope.onlineService = function() {
  502. var g = (/1[7358]\d{9}/).exec($scope.currentUser.Mobile);
  503. console.log(g);
  504. //console.log($scope.mobile, $scope.sdk);
  505. if ($scope.currentUser.Mobile.length == 11 && $scope.sdk) {
  506. userService.update($scope.currentUser);
  507. ysf.config({
  508. uid: $scope.currentUser.Id, // 用户Id
  509. name: $scope.currentUser.Nickname, // 用户名称
  510. email: $scope.addr.regeocode.formattedAddress, // 用户邮箱
  511. mobile: $scope.currentUser.Mobile, // 用户电话
  512. success: function() { // 成功回调
  513. ysf.open();
  514. console.log('success');
  515. },
  516. error: function() { // 错误回调
  517. // handle error
  518. //ysf.open();
  519. alert('error!!!');
  520. }
  521. });
  522. } else {
  523. alert("请正确输入手机号码");
  524. }
  525. };
  526. }]);
  527. 'use strict';
  528. angular.module('app').controller('ResultController', ['$scope', 'userService', 'messageService', '$state', function($scope, userService, messageService, $state) {
  529. //lxtalkClient.Invoke('{FB60F992-A0FD-47B3-AAA7-E80DF209C5A4}', '_Register', '', $scope);
  530. // $scope.results = [{
  531. // date: '2017-08-16 11:11:11',
  532. // title: "测试测试",
  533. // name: '浙江万赛软件科技有限公司',
  534. // mobile: '15906422850',
  535. // describe: '近日办公助手出现程序被360软件拦截,导致软件奔溃或者被360删除。已被删除的用户需要重新下载安装,然后在360中添加信任,未被删除的用户直接添加信任。添加信任办法如下:打开360安全窗口,单击“木马查杀”图标——在木马查杀窗口中,单击左下角“信任区”图标,然后单击下面的“添加信任目录”按钮——选择办公助手安装的路径,确定就可以了。以上操作有困难的用户可致电2091970咨询指导或申请远程协助解决。',
  536. // assets: []
  537. // },
  538. // ];
  539. $scope.load = false;
  540. messageService.getAll(
  541. function(reponse) {
  542. $scope.results = reponse.data;
  543. $scope.load = true;
  544. //console.log($scope.results);
  545. },
  546. function(error) { alert("error!"); }
  547. );
  548. $scope.viewDetail = function(result) {
  549. //$scope.bundleId = result.id;
  550. $state.go("webChat.pageView", { data: result }, { inherit: false });
  551. };
  552. }]);
  553. 'use strict';
  554. angular.module('app').controller('WebController', ['$scope', '$timeout', 'userService', 'messageService', function($scope, $timeout, userService, messageService) {
  555. //lxtalkClient.Invoke('{FB60F992-A0FD-47B3-AAA7-E80DF209C5A4}', '_Register', '', $scope);
  556. $scope.bundle = {
  557. userId: -1,
  558. //不超过2000个字符
  559. describe: '',
  560. //不超过50个字符
  561. name: '',
  562. //手机号码
  563. mobile: '',
  564. //所属县市
  565. country_Id: '丽水市本级',
  566. //不超过100个字符
  567. title: '',
  568. /// 类型
  569. /// 0我要咨询;1我要投诉;2我要建议;3领导信箱;4我要举报 5纠错
  570. type: 2, //2
  571. //是否建议 0-投诉 1-建议
  572. advice: 1,
  573. //是否公开互联网(0否 1是)
  574. isPublic: 0,
  575. assets: []
  576. };
  577. $scope.currentUser = userService.getMe();
  578. $scope.bundle.name = $scope.currentUser.Nickname;
  579. $scope.bundle.mobile = $scope.currentUser.Mobile;
  580. $scope.$on('$viewContentLoaded', function() {
  581. var clientWidth = document.documentElement.clientWidth || window.innerWidth;
  582. var innerWidth = Math.max(Math.min(clientWidth, 480), 320);
  583. //console.log(innerWidth);
  584. if (innerWidth > 350) {
  585. angular.element(".userInfo>form>div>span").addClass("font-14");
  586. angular.element(".certificate").addClass("font-14");
  587. angular.element(".userInfo .input-sm ").addClass("font-13");
  588. angular.element(".userInfo .text-message").addClass("font-13");
  589. angular.element(".userInfo .selects").addClass("font-13");
  590. } else {
  591. angular.element(".font-13").removeClass("font-13");
  592. angular.element(".font-14").removeClass("font-14");
  593. }
  594. });
  595. $scope.imgView = function(event) {
  596. angular.element(".onView").removeClass("onView");
  597. var img = $(event.target);
  598. img[0].className = "onView";
  599. if (img[0].naturalWidth > img[0].naturalHeight) {
  600. angular.element(".image-view").addClass("width-Img");
  601. } else {
  602. angular.element(".image-view").removeClass("width-Img");
  603. }
  604. $scope.imgUrl = img[0].src;
  605. $(".image-big").remove();
  606. $(".image-view").append('<img class="image-big" src="' + $scope.imgUrl + '" data-dismiss="modal">');
  607. };
  608. $scope.delSure = function() {
  609. $scope.sure = false;
  610. var imgs = $(".images");
  611. $(".image-big").remove();
  612. for (var i = 0, len = imgs.length; i < len; i++) {
  613. if (imgs[i].firstElementChild.className == "onView") {
  614. imgs[i].remove();
  615. var imgNum = $("#imgpreview").find('img').length;
  616. if (imgNum == 2) {
  617. angular.element(".images").removeClass("three");
  618. angular.element(".images").addClass("two");
  619. } else if (imgNum = 1) {
  620. angular.element(".images").removeClass("two");
  621. angular.element(".images").addClass("one");
  622. }
  623. return;
  624. }
  625. };
  626. };
  627. // $scope.actived = function($event) {
  628. // var activeClick = $($event.target);
  629. // if (activeClick[0].nodeName == "A") {
  630. // angular.element(".Aa").removeClass("activeColor");
  631. // angular.element(".glyphicon").removeClass("activeColor");
  632. // activeClick.addClass("activeColor");
  633. // } else if (activeClick[0].nodeName == "SPAN") {
  634. // angular.element(".Aa").removeClass("activeColor");
  635. // angular.element(".glyphicon").removeClass("activeColor");
  636. // activeClick.addClass("activeColor");
  637. // $(activeClick[0].parentElement).addClass("activeColor");
  638. // }
  639. // };
  640. // $scope.footHide = function() {
  641. // angular.element(".foot").addClass("hide");
  642. // };
  643. // $scope.footShow = function($event) {
  644. // var activeClick = $($event.target);
  645. // if (activeClick[0].className == "form-control input-sm" || activeClick[0].className == "text-message") {
  646. // angular.element(".foot").addClass("hide");
  647. // } else {
  648. // $timeout(function() {
  649. // angular.element(".foot").removeClass("hide");
  650. // }, 400);
  651. // }
  652. // };
  653. $scope.submit = function(e) {
  654. $scope.bundle.describe = _.trim($(".descr")[0].textContent).substr(0, 2000);
  655. $scope.bundle.describe = $scope.bundle.describe.replace(/ /g, "&nbsp");
  656. var mobReg = (/^1[34578]\d{9}$/).exec($scope.bundle.mobile);
  657. if (mobReg && $scope.bundle.describe) {
  658. $(e.target)[0].dataset.target = "#information";
  659. var imgs = $(".images");
  660. for (var i = 0, len = imgs.length; i < len; i++) {
  661. $scope.bundle.assets.push({ assetType: 1, data: imgs[i].firstElementChild.src });
  662. };
  663. if ($scope.mapPosition)
  664. $scope.bundle.assets.push({ assetType: 0, data: JSON.stringify({ info: $scope.mapPosition.info, district: $scope.mapPosition.addressComponent.district, address: $scope.mapPosition.formattedAddress, position: $scope.mapPosition.position }) });
  665. console.log($scope.bundle);
  666. $scope.submiting = true;
  667. messageService.submit($scope.bundle,
  668. function() {
  669. $scope.submiting = false;
  670. $scope.successed = true;
  671. $scope.bundle.title = "";
  672. $scope.bundle.describe = $(".descr")[0].textContent = "";
  673. imgs.remove();
  674. $scope.bundle.assets = [];
  675. },
  676. function() {
  677. $scope.submiting = false;
  678. $scope.falied = true;
  679. $scope.bundle.assets = [];
  680. });
  681. } else if (!mobReg) {
  682. $(e.target)[0].dataset.target = "";
  683. alert("手机号码有误");
  684. } else if (mobReg && $scope.bundle.describe == "") {
  685. $(e.target)[0].dataset.target = "";
  686. alert("标题或投诉内容不能为空");
  687. } else {
  688. $(e.target)[0].dataset.target = "";
  689. alert("手机号码有误或者投诉内容为空");
  690. }
  691. };
  692. $scope.imgPreview = function(fileDom) {
  693. //判断是否支持FileReader
  694. if (window.FileReader) {
  695. var reader = new FileReader();
  696. } else {
  697. alert("您的设备不支持图片预览功能,如需该功能请升级您的设备!");
  698. };
  699. //获取文件
  700. var file = fileDom.files[0];
  701. var imageType = /^image\//;
  702. //是否是图片
  703. if (!imageType.test(file.type)) {
  704. alert("请选择图片!");
  705. return;
  706. };
  707. $("#file")[0].value = "";
  708. //读取完成
  709. reader.onload = function(e) {
  710. // //获取图片dom
  711. // var img = document.getElementById("preview");
  712. // //图片路径设置为读取的图片
  713. // img.src = e.target.result;
  714. var img = new Image,
  715. width = 1080, //image resize
  716. quality = 0.9, //image quality
  717. canvas = document.createElement("canvas"),
  718. drawer = canvas.getContext("2d");
  719. img.src = this.result;
  720. $(img).on('load', function() {
  721. $(img).off('load');
  722. var imgNum = $("#imgpreview").find('img').length;
  723. canvas.width = width;
  724. canvas.height = width * (img.height / img.width);
  725. drawer.drawImage(img, 0, 0, canvas.width, canvas.height);
  726. img.src = canvas.toDataURL(file.type, quality);
  727. if (imgNum == 0) {
  728. $("#imgpreview").append('<a data-toggle="modal" data-target="#viewModal" class="thumbnail images"><img onClick="angular.element(this).scope().imgView(event)" src="' + img.src + '"></a>');
  729. angular.element(".images").addClass("one");
  730. } else if (imgNum == 1) {
  731. $("#imgpreview").append('<a data-toggle="modal" data-target="#viewModal" class="thumbnail images"><img onClick="angular.element(this).scope().imgView(event)" src="' + img.src + '"></a>');
  732. angular.element(".images").removeClass("one");
  733. angular.element(".images").addClass("two");
  734. } else if (imgNum >= 2) {
  735. $("#imgpreview").append('<a data-toggle="modal" data-target="#viewModal" class="thumbnail images"><img onClick="angular.element(this).scope().imgView(event)" src="' + img.src + '"></a>');
  736. angular.element(".images").removeClass("two");
  737. angular.element(".images").addClass("three");
  738. }
  739. });
  740. };
  741. reader.readAsDataURL(file);
  742. };
  743. }]);
  744. (function() {
  745. 'use strict';
  746. angular
  747. .module('app')
  748. .directive('gaodeMap', Directive);
  749. Directive.$inject = [];
  750. function Directive() {
  751. var directive = {
  752. link: link,
  753. restrict: 'E',
  754. template: '<div id="container"></div>',
  755. replace: true,
  756. scope: false
  757. // scope: {
  758. // options: '='
  759. // }
  760. };
  761. return directive;
  762. function link(scope, element, attrs) {
  763. var map, geolocation, marker, geocoder;
  764. //加载地图,调用浏览器定位服务
  765. map = new AMap.Map('container', {
  766. resizeEnable: true,
  767. zoom: 17
  768. });
  769. map.plugin('AMap.Geolocation', function() {
  770. geolocation = new AMap.Geolocation({
  771. enableHighAccuracy: true, //是否使用高精度定位,默认:true
  772. timeout: 30000, //超过30秒后停止定位,默认:无穷大
  773. maximumAge: 0, //定位结果缓存0毫秒,默认:0
  774. convert: true, //自动偏移坐标,偏移后的坐标为高德坐标,默认:true
  775. showButton: true, //显示定位按钮,默认:true
  776. buttonPosition: 'RB', //定位按钮停靠位置,默认:'LB',左下角
  777. buttonOffset: new AMap.Pixel(10, 20), //定位按钮与设置的停靠位置的偏移量,默认:Pixel(10, 20)
  778. showMarker: true, //定位成功后在定位到的位置显示点标记,默认:true
  779. showCircle: true, //定位成功后用圆圈表示定位精度范围,默认:true
  780. panToLocation: true, //定位成功后将定位到的位置作为地图中心点,默认:true
  781. zoomToAccuracy: true //定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
  782. });
  783. map.addControl(geolocation);
  784. geolocation.getCurrentPosition();
  785. AMap.event.addListener(geolocation, 'complete', onComplete); //返回定位信息
  786. AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
  787. function onComplete(data) {
  788. map.clearMap();
  789. map.setZoomAndCenter(17, [data.position.lng, data.position.lat]);
  790. scope.mapPosition = data;
  791. var geocoder = new AMap.Geocoder({
  792. radius: 1000,
  793. extensions: "all"
  794. });
  795. var marker = new AMap.Marker({
  796. map: map,
  797. position: [data.position.lng, data.position.lat],
  798. bubble: false,
  799. visible: true
  800. });
  801. geocoder.getAddress(data.position, function(status, result) {
  802. if (status == 'complete' && result.info === 'OK') {
  803. //console.log(result);
  804. $("#result")[0][0].textContent = result.regeocode.formattedAddress.substring(6);
  805. $("#result")[0][1].textContent = result.regeocode.pois[0].name;
  806. $("#result")[0][2].textContent = result.regeocode.pois[1].name;
  807. } else {
  808. alert("错误A:定位失败");
  809. }
  810. });
  811. map.on('click', function(e) {
  812. marker.setPosition(e.lnglat);
  813. geocoder.getAddress(e.lnglat, function(status, result) {
  814. if (status == 'complete' && result.info === 'OK') {
  815. scope.mapPosition.position = e.lnglat;
  816. //console.log($("#result"));
  817. //var sub = result.regeocode.formattedAddress.indexOf(result.regeocode.aois[0].name);
  818. $("#result")[0][0].textContent = result.regeocode.formattedAddress.substring(6);
  819. $("#result")[0][1].textContent = result.regeocode.pois[0].name;
  820. $("#result")[0][2].textContent = result.regeocode.pois[1].name;
  821. $("#result")[0].selectedIndex = 0;
  822. } else {
  823. alert("错误B:定位失败");
  824. }
  825. });
  826. });
  827. }
  828. function onError(data) {
  829. alert("错误C:定位失败");
  830. }
  831. });
  832. }
  833. }
  834. })();
  835. (function() {
  836. 'use strict';
  837. angular
  838. .module('app')
  839. .service('auth2Service', auth2Service);
  840. auth2Service.$inject = ['$cookies', '$http', '$location'];
  841. function auth2Service($cookies, $http, $location) {
  842. this.checkAuthByResponse = checkAuthByResponse;
  843. this.checkAuthByCookie = checkAuthByCookie;
  844. this.checkAuthByServer = checkAuthByServer;
  845. function checkAuthByResponse(response) {
  846. if (response.status == 501) {
  847. window.location = $cookies.get('BaseUrl');
  848. }
  849. }
  850. function checkAuthByServer() {
  851. $http.get($cookies.get('BaseUrl') + 'api/auth/check').then(
  852. function() {
  853. },
  854. checkAuthByResponse
  855. );
  856. }
  857. function checkAuthByCookie() {
  858. return $cookies.get('User') != "" || $cookies.get('User') != undefined;
  859. }
  860. }
  861. })();
  862. 'use strict';
  863. angular.module('app').service('messageService', ['$http', '$cookies', '$location', 'userService', function($http, $cookies, $location, userService) {
  864. var self = this;
  865. this.submit = function(bundle, successCallback, failsCallback) {
  866. bundle.userId = userService.getMe().Id;
  867. $http.post($cookies.get('BaseUrl') + 'api/bundle', bundle).then(successCallback, failsCallback);
  868. }
  869. this.getAll = function(successCallback, failsCallback) {
  870. $http.get($cookies.get('BaseUrl') + 'api/bundle/all').then(successCallback, failsCallback);
  871. }
  872. this.getDe = function(bundleId, successCallback, failsCallback) {
  873. $http.get($cookies.get('BaseUrl') + 'api/bundle/detail/' + bundleId).then(successCallback, failsCallback);
  874. }
  875. this.getAsset = function(bundleId, successCallback, failsCallback) {
  876. $http.get($cookies.get('BaseUrl') + 'api/asset/byBundleId/' + bundleId).then(successCallback, failsCallback);
  877. }
  878. }]);
  879. (function() {
  880. 'use strict';
  881. angular
  882. .module('app')
  883. .service('userService', userService);
  884. userService.$inject = ['$http', '$cookies', 'auth2Service'];
  885. function userService($http, $cookies, auth2Service) {
  886. this.getMe = getMe;
  887. this.update = update;
  888. function getMe() {
  889. if (this.me != undefined) {
  890. return this.me;
  891. }
  892. if ($cookies.get('User') != "" || $cookies.get('User') != undefined) {
  893. this.me = JSON.parse($cookies.get('User'));
  894. return this.me;
  895. }
  896. if (this.me === undefined)
  897. $http.get($cookies.get('BaseUrl') + 'api/user').then(
  898. function(response) {
  899. this.me = response.data;
  900. },
  901. function(response) {
  902. this.me = {};
  903. auth2Service.checkAuthByResponse(response);
  904. }
  905. );
  906. return this.me;
  907. }
  908. function update(u) {
  909. if (u.Id != undefined)
  910. $http.post($cookies.get('BaseUrl') + 'api/user', u).then(
  911. function(response) {
  912. console.log(response.data)
  913. },
  914. function(response) {
  915. console.log(response.data)
  916. }
  917. );
  918. }
  919. }
  920. })();