dgf před 8 roky
rodič
revize
5182b8b395

+ 36 - 0
dist/bower - 副本.json

@@ -0,0 +1,36 @@
+{
+  "name": "talkview",
+  "description": "",
+  "main": "",
+  "authors": [
+    "lqq"
+  ],
+  "license": "MIT",
+  "homepage": "",
+  "private": true,
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "test",
+    "tests"
+  ],
+  "dependencies": {
+    "angular-ui-router": "^0.3.1",
+    "bootstrap": "^3.3.7",
+    "angular": "^1.5.8",
+    "angular-animate": "^1.5.8",
+    "animate.css": "^3.5.2",
+    "angular-bootstrap": "^2.2.0",
+    "angular-sanitize": "^1.5.8",
+    "jquery-qrcode": "*",
+    "zTree": "^3.5.26",
+    "lodash": "^4.17.4",
+    "peerjs": "^0.3.14",
+    "ngInfiniteScroll": "^1.3.4",
+    "jquery": "^3.2.1",
+    "ngDraggable": "^0.1.11",
+    "swiper": "^3.4.2",
+    "angular-cookies": "^1.6.6"
+  }
+}

+ 7 - 6
dist/bower.json

@@ -16,13 +16,13 @@
     "tests"
   ],
   "dependencies": {
-    "angular-ui-router": "^0.3.1",
+    "angular-ui-router": "^1.0.6",
     "bootstrap": "^3.3.7",
-    "angular": "^1.5.8",
-    "angular-animate": "^1.5.8",
+    "angular": "^1.6.6",
+    "angular-animate": "^1.6.6",
     "animate.css": "^3.5.2",
-    "angular-bootstrap": "^2.2.0",
-    "angular-sanitize": "^1.5.8",
+    "angular-bootstrap": "^2.5.0",
+    "angular-sanitize": "^1.6.6",
     "jquery-qrcode": "*",
     "zTree": "^3.5.26",
     "lodash": "^4.17.4",
@@ -30,6 +30,7 @@
     "ngInfiniteScroll": "^1.3.4",
     "jquery": "^3.2.1",
     "ngDraggable": "^0.1.11",
-    "swiper": "^3.4.2"
+    "swiper": "^3.4.2",
+    "angular-cookies": "^1.6.6"
   }
 }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 136 - 45
dist/web12345-new/app-7395cc9769.js


+ 2 - 1
dist/web12345-new/index.html

@@ -19,11 +19,12 @@
     <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
     <script src="../bower_components/swiper/dist/js/swiper.jquery.min.js"></script>
     <script src="../bower_components/angular/angular.min.js"></script>
+    <script src="../bower_components/angular-cookies/angular-cookies.min.js"></script>
     <script src="../bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
     <script src="../bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
     <script src="../bower_components/angular-animate/angular-animate.min.js"></script>
 
-    <script src="app-7395cc9769.js"></script>
+    <script src="app-cf557bfa80.js"></script>
 </head>
 
 <body ng-app="app">

+ 1 - 0
web12345-new/src/html/index.html

@@ -19,6 +19,7 @@
     <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
     <script src="../bower_components/swiper/dist/js/swiper.jquery.min.js"></script>
     <script src="../bower_components/angular/angular.min.js"></script>
+    <script src="../bower_components/angular-cookies/angular-cookies.min.js"></script>
     <script src="../bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
     <script src="../bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
     <script src="../bower_components/angular-animate/angular-animate.min.js"></script>

+ 2 - 1
web12345-new/src/js/app.js

@@ -4,5 +4,6 @@ var app = angular.module('app', [
     'ui.router',
     'templatescache',
     'ui.bootstrap',
-    'ngAnimate'
+    'ngAnimate',
+    'ngCookies'
 ]);

+ 60 - 38
web12345-new/src/js/controller/webController.js

@@ -1,12 +1,21 @@
 'use strict';
 
-angular.module('app').controller('WebController', ['$scope', '$timeout', function($scope, $timeout) {
+angular.module('app').controller('WebController', ['$scope', '$timeout', 'userService', 'messageService', function($scope, $timeout, userService, messageService) {
     //lxtalkClient.Invoke('{FB60F992-A0FD-47B3-AAA7-E80DF209C5A4}', '_Register', '', $scope);
+    $scope.bundle = {
+        //userId: userService.getMe().Id,
+        userId: 0,
+        uesrName: "",
+        uesrMobile: "",
+        descr: "",
+        position: {},
+        imgSources: [],
+    };
 
     $scope.$on('$viewContentLoaded', function() {
         var clientWidth = document.documentElement.clientWidth || window.innerWidth;
         var innerWidth = Math.max(Math.min(clientWidth, 480), 320);
-        console.log(innerWidth);
+        //console.log(innerWidth);
         if (innerWidth > 350) {
             angular.element(".userInfo>div>span").addClass("font-14");
             angular.element(".certificate").addClass("font-14");
@@ -39,14 +48,11 @@ angular.module('app').controller('WebController', ['$scope', '$timeout', functio
 
     $scope.delSure = function() {
         $scope.sure = false;
-        // var activeClick = $($event.target);
-        // console.log(activeClick);
-        // var imgUrl = activeClick[0].parentElement.previousElementSibling.firstElementChild.src;
         var imgs = $(".images");
         $(".image-big").remove();
         for (var i = 0, len = imgs.length; i < len; i++) {
-            if ($(".images")[i].firstElementChild.className == "onView") {
-                $(".images")[i].remove();
+            if (imgs[i].firstElementChild.className == "onView") {
+                imgs[i].remove();
                 var imgNum = $("#imgpreview").find('img').length;
                 if (imgNum == 2) {
                     angular.element(".images").removeClass("three");
@@ -60,32 +66,48 @@ angular.module('app').controller('WebController', ['$scope', '$timeout', functio
         };
     };
 
-    $scope.actived = function($event) {
-        var activeClick = $($event.target);
-        if (activeClick[0].nodeName == "A") {
-            angular.element(".Aa").removeClass("activeColor");
-            angular.element(".glyphicon").removeClass("activeColor");
-            activeClick.addClass("activeColor");
-        } else if (activeClick[0].nodeName == "SPAN") {
-            angular.element(".Aa").removeClass("activeColor");
-            angular.element(".glyphicon").removeClass("activeColor");
-            activeClick.addClass("activeColor");
-            $(activeClick[0].parentElement).addClass("activeColor");
-        }
-    };
+    // $scope.actived = function($event) {
+    //     var activeClick = $($event.target);
+    //     if (activeClick[0].nodeName == "A") {
+    //         angular.element(".Aa").removeClass("activeColor");
+    //         angular.element(".glyphicon").removeClass("activeColor");
+    //         activeClick.addClass("activeColor");
+    //     } else if (activeClick[0].nodeName == "SPAN") {
+    //         angular.element(".Aa").removeClass("activeColor");
+    //         angular.element(".glyphicon").removeClass("activeColor");
+    //         activeClick.addClass("activeColor");
+    //         $(activeClick[0].parentElement).addClass("activeColor");
+    //     }
+    // };
 
-    $scope.footHide = function() {
-        angular.element(".foot").addClass("hide");
-    };
-    $scope.footShow = function($event) {
-        var activeClick = $($event.target);
-        if (activeClick[0].className == "form-control input-sm" || activeClick[0].className == "text-message") {
-            angular.element(".foot").addClass("hide");
-        } else {
-            $timeout(function() {
-                angular.element(".foot").removeClass("hide");
-            }, 400);
-        }
+    // $scope.footHide = function() {
+    //     angular.element(".foot").addClass("hide");
+    // };
+    // $scope.footShow = function($event) {
+    //     var activeClick = $($event.target);
+    //     if (activeClick[0].className == "form-control input-sm" || activeClick[0].className == "text-message") {
+    //         angular.element(".foot").addClass("hide");
+    //     } else {
+    //         $timeout(function() {
+    //             angular.element(".foot").removeClass("hide");
+    //         }, 400);
+    //     }
+    // };
+
+    $scope.submit = function() {
+        var imgs = $(".images");
+        for (var i = 0, len = imgs.length; i < len; i++) {
+            $scope.bundle.imgSources.push({ type: 1, source: imgs[i].firstElementChild.src });
+        };
+        $scope.bundle.descr = $(".descr")[0].textContent;
+        $scope.bundle.position = $scope.position;
+        console.log($scope.bundle);
+        //messageService.submit($scope.bundle, "successCallback", "failsCallback");
+        $scope.bundle.uesrName = "";
+        $scope.bundle.uesrMobile = "";
+        $scope.bundle.descr = $(".descr")[0].textContent = "";
+        $scope.bundle.position = {};
+        $scope.bundle.imgSources = [];
     };
 
     $scope.imgPreview = function(fileDom) {
@@ -110,21 +132,21 @@ angular.module('app').controller('WebController', ['$scope', '$timeout', functio
             // var img = document.getElementById("preview");
             // //图片路径设置为读取的图片
             // img.src = e.target.result;
-            console.log(file);
-            console.log(e);
             var img = new Image,
                 width = 1080, //image resize
                 quality = 0.9, //image quality
                 canvas = document.createElement("canvas"),
                 drawer = canvas.getContext("2d");
             img.src = this.result;
-            if (img.src) {
+
+            $(img).on('load', function() {
+                $(img).off('load');
                 var imgNum = $("#imgpreview").find('img').length;
                 canvas.width = width;
                 canvas.height = width * (img.height / img.width);
                 drawer.drawImage(img, 0, 0, canvas.width, canvas.height);
-                img.src = canvas.toDataURL("image/jpeg", quality);
-                console.log(img);
+                img.src = canvas.toDataURL(file.type, quality);
+
                 if (imgNum == 0) {
                     $("#imgpreview").append('<a data-toggle="modal" data-target="#viewModal" class="thumbnail images"><img onClick="angular.element(this).scope().imgView(event)" src="' + img.src + '"></a>');
                     angular.element(".images").addClass("one");
@@ -137,7 +159,7 @@ angular.module('app').controller('WebController', ['$scope', '$timeout', functio
                     angular.element(".images").removeClass("two");
                     angular.element(".images").addClass("three");
                 }
-            };
+            });
         };
         reader.readAsDataURL(file);
     };

+ 5 - 4
web12345-new/src/js/directive/webChat.js

@@ -12,13 +12,13 @@
             restrict: 'E',
             template: '<div id="container"></div>',
             replace: true,
-            scope: {
-                options: '='
-            }
+            // scope: {
+            //     options: '='
+            // }
         };
         return directive;
 
-        function link($scope, element, attrs) {
+        function link(scope, element, attrs) {
             var map, geolocation, marker, geocoder;
             //加载地图,调用浏览器定位服务
             map = new AMap.Map('container', {
@@ -46,6 +46,7 @@
                 AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
 
                 function onComplete(data) {
+                    scope.position = data;
                     var geocoder = new AMap.Geocoder({
                         radius: 1000,
                         extensions: "all"

+ 24 - 0
web12345-new/src/js/service/auth2Service.js

@@ -0,0 +1,24 @@
+(function() {
+    'use strict';
+
+    angular
+        .module('app')
+        .service('auth2Service', auth2Service);
+
+    auth2Service.$inject = ['$cookies', '$http'];
+
+    function auth2Service($cookies, $http) {
+        this.checkAuthByResponse = checkAuthByResponse;
+        this.checkAuthByCookie = checkAuthByCookie;
+
+        function checkAuthByResponse(response) {
+            if (response.status == 501) {
+                window.location = "/home";
+            }
+        }
+
+        function checkAuthByCookie() {
+            return $cookies.user != "" || $cookies.user != undefined;
+        }
+    }
+})();

+ 10 - 0
web12345-new/src/js/service/messageService.js

@@ -0,0 +1,10 @@
+'use strict';
+
+angular.module('app').service('messageService', ['$http', '$cookies', '$location', 'userService', function($http, $cookies, $location, userService) {
+    var self = this;
+
+    this.submit = function(bundle, successCallback, failsCallback) {
+        bundle.userId = userService.getMe().Id;
+        $http.post($location.protocol() + '://' + $location.host() + ':' + $location.port() + '/api/bundle', bundle).then(successCallback, failsCallback);
+    }
+}]);

+ 33 - 0
web12345-new/src/js/service/userService.js

@@ -0,0 +1,33 @@
+(function() {
+    'use strict';
+
+    angular
+        .module('app')
+        .service('userService', userService);
+
+    userService.$inject = ['$http', '$cookies', 'auth2Service'];
+
+    function userService($http, $cookies, auth2Service) {
+        this.getMe = getMe;
+
+        function getMe() {
+            if (this.me != undefined)
+                return this.me;
+            if ($cookies.get('User') != "" || $cookies.get('User') != undefined) {
+                this.me = JSON.parse($cookies.get('User'));
+                return this.me;
+            }
+
+            if (this.me === undefined)
+                $http.get('/api/user').then(
+                    function(response) {
+                        this.me = response.data;
+                    },
+                    function(response) {
+                        this.me = {};
+                        auth2Service.checkAuthByResponse(response);
+                    }
+                );
+        }
+    }
+})();

+ 1 - 1
web12345-new/src/templates/home.html

@@ -29,7 +29,7 @@
         </div>
         <div class="contain" ng-cloak>
             <div class="inquire" ng-cloak>
-                <a href="">
+                <a href="http://www.lszszw.gov.cn/Search.aspx">
                     <img class="breath size1" src="../img/webChatImg/自助咨询.png" alt=""><span class="explain">自助咨询</span>
                 </a>
             </div>

+ 4 - 4
web12345-new/src/templates/webChat-5.html

@@ -7,10 +7,10 @@
     </div>-->
 
     <div class="userInfo">
-        <div><span>姓&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp名:</span><input class="form-control input-sm" type="text" placeholder="单行输入" ng-focus="footHide()"><span class="certificate">*</span></div>
-        <div><span>手机号码:</span><input class="form-control input-sm" type="text" placeholder="单行输入" ng-focus="footHide()"><span class="certificate">*</span></div>
+        <div><span>姓&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp名:</span><input class="form-control input-sm" type="text" placeholder="单行输入" ng-model="bundle.uesrName" ng-focus="footHide()"><span class="certificate">*</span></div>
+        <div><span>手机号码:</span><input class="form-control input-sm" type="text" placeholder="单行输入" ng-model="bundle.uesrMobile" ng-focus="footHide()"><span class="certificate">*</span></div>
         <div><span>投诉内容:</span>
-            <div class="text-message" contenteditable="plaintext-only" ng-focus="footHide()"></div><span class="certificate">*</span>
+            <div class="text-message descr" contenteditable="plaintext-only" ng-focus="footHide()"></div><span class="certificate">*</span>
         </div>
         <div class="image"><span>图&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp片:</span>
             <div id="imgpreview">
@@ -30,7 +30,7 @@
             </div>
         </div>
         <div class="button-bottom">
-            <button type="button" class="btn btn-default" ng-click="pageChange()">提交</button>
+            <button type="button" class="btn btn-default" ng-click="submit()">提交</button>
         </div>
         <div class="modal fade viewModal" id="viewModal" tabindex="-2" data-backdrop="static" role="dialog" aria-labelledby="viewModalLabel" aria-hidden="true">
             <button type="button" class="close" aria-hidden="true" ng-click="sure=true"><span class="glyphicon glyphicon-trash"></span></button>