소스 검색

文件传输

dgf 8 년 전
부모
커밋
e9b135e9de

+ 1 - 0
talkview/src/html/index.html

@@ -12,6 +12,7 @@
     <!--<script src="js/jquery.min.js"></script>-->
     <script src="../bower_components/lodash/dist/lodash.js"></script>
     <script src="../bower_components/jquery/dist/jquery.min.js"></script>
+    <script src="../bower_components/jquery-qrcode/jquery.qrcode.min.js"></script>
     <script src="../bower_components/angular/angular.js"></script>
     <script src="../bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
     <script src="../bower_components/angular-animate/angular-animate.min.js"></script>

+ 4 - 4
talkview/src/js/controller/transmitterController.js

@@ -47,9 +47,9 @@ angular.module('appMessage').controller('TransmitterController', ['$scope', '$in
     };
 
     $scope.getSpeed = function(item) {
-        if (item.completedLength / item.takeTime > 1024 * 1024)
+        if (item.completedLength / item.takeTime > 1024 && item.completedLength / item.takeTime < 1024 * 1024)
             return parseInt((item.completedLength / item.takeTime) / 1024).toString() + ' MB/S';
-        else if (item.completedLength / item.takeTime)
+        else if (item.completedLength / item.takeTime < 1024)
             return parseInt(item.completedLength / item.takeTime).toString() + ' KB/S';
         else
             return '';
@@ -59,9 +59,9 @@ angular.module('appMessage').controller('TransmitterController', ['$scope', '$in
         var reTime = (item.length - item.completedLength) / (item.completedLength / item.takeTime) / 1000;
         if (reTime > 60 * 60)
             return (parseInt(reTime / 60 * 60) / 100).toFixed(2).slice(-2) + ':' + (parseInt((reTime % (60 * 60)) / 60) / 100).toFixed(2).slice(-2) + ':' + (parseInt((reTime % (60 * 60)) % 60) / 100).toFixed(2).slice(-2);
-        else if (reTime > 60)
+        else if (reTime > 60 && reTime < 60 * 60)
             return '00:' + (parseInt(reTime / 60) / 100).toFixed(2).slice(-2) + ':' + (parseInt(reTime % 60) / 100).toFixed(2).slice(-2);
-        else if (reTime)
+        else if (reTime < 60)
             return '00:' + '00:' + (parseInt(reTime) / 100).toFixed(2).slice(-2);
         else
             return '';

+ 43 - 0
talkview/src/js/controller/userController.js

@@ -0,0 +1,43 @@
+'use strict';
+
+angular.module('appMessage').controller('UserController', ['$scope', '$state', function($scope, $state) {
+
+    lxtalkClient.Invoke('{FB60F992-A0FD-47B3-AAA7-E80DF209C5A4}', '_Register', '', $scope);
+
+    // $scope.user = {
+    //     name: '陆趣趣',
+    //     l: '0578+0-lslqq',
+    //     shotL: 'lslqq',
+    //     comp: '浙江万赛软件科技有限公司',
+    //     branch: '运维部',
+    //     sex: '0',
+    //     mob: '15215756180',
+    //     sMob: '666666',
+    //     tel: '2189026',
+    //     duty: '运维部经理',
+    //     officeID: '运维室001',
+    //     email: 'lqq@wswin.cn',
+    //     shortL: 'lszhangzhangzhang'
+    // };
+
+    $scope.getSex = function(sex) {
+        if ($scope.user === undefined)
+            return '保密';
+        if ($scope.user.sex == 0)
+            return '男';
+        else if ($scope.user.sex == 1)
+            return '女';
+        else
+            return '保密';
+    }
+
+    $scope.update = function(userJson) {
+        userJson = userJson.replace(/ /g, " ");
+        userJson = userJson.replace(/\t/g, "\\t");
+        var user = JSON.parse(userJson);
+        $scope.user = user;
+        var reg = /-([\W\w]*)/;
+        var group = reg.exec($scope.user.l);
+        $scope.user.shortL = group == null ? $scope.user.l : group[1];
+    }
+}]);

+ 47 - 0
talkview/src/js/directive/qrcode.js

@@ -0,0 +1,47 @@
+(function() {
+    'use strict';
+
+    angular
+        .module('appMessage')
+        .directive('qrcode', Directive);
+    Directive.$inject = ['Utilities'];
+
+    function Directive(Utilities) {
+        // Usage:
+        //
+        // Creates:
+        //
+        var directive = {
+            link: link,
+            restrict: 'A',
+            scope: {
+                user: '=ngUser'
+            }
+        };
+        return directive;
+
+        function link($scope, element, attrs) {
+            var codeText = "BEGIN:VCARD \r\n" +
+                "VERSION:3.0" + "\r\n" +
+                "FN:" + $scope.user.name + "\r\n" +
+                "TEL;HOME:" + $scope.user.sMob + "\r\n" +
+                "TEL;WORK:" + $scope.user.tel + "\r\n" +
+                "TEL;CELL:" + $scope.user.mob + "\r\n" +
+                "ORG:" + $scope.user.comp + "\r\n" +
+                "TITLE:" + $scope.user.duty + "\r\n" +
+                "EMAIL:" + $scope.user.email + "\r\n" +
+                "END:VCARD\r\n";
+            element.qrcode({
+                render: "canvas",
+                text: Utilities.toUtf8(codeText),
+                width: 160,
+                height: 160,
+                typeNumber: -1, //计算模式  
+                correctLevel: 0, //纠错等级 
+                background: "#ffffff",
+                foreground: "#2D7B94"
+            });
+            // jQuery('#code')
+        }
+    }
+})();

+ 5 - 0
talkview/src/js/router.js

@@ -15,6 +15,11 @@ angular.module('appMessage').run(['$rootScope', '$state', '$stateParams',
                 url: '/transmitter',
                 templateUrl: 'templates/transmitter.html',
                 controller: 'TransmitterController'
+            })
+            .state('details', {
+                url: '/details',
+                templateUrl: 'templates/details.html',
+                controller: 'UserController'
             });
     }
 ]);

+ 24 - 0
talkview/src/js/service/utilities.js

@@ -0,0 +1,24 @@
+angular.module('appMessage')
+    .factory('Utilities', function() {
+        return {
+            toUtf8: function(str) {
+                var out, i, len, c;
+                out = "";
+                len = str.length;
+                for (i = 0; i < len; i++) {
+                    c = str.charCodeAt(i);
+                    if ((c >= 0x0001) && (c <= 0x007F)) {
+                        out += str.charAt(i);
+                    } else if (c > 0x07FF) {
+                        out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
+                        out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
+                        out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+                    } else {
+                        out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
+                        out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+                    }
+                }
+                return out;
+            }
+        }
+    });

+ 106 - 0
talkview/src/less/app.main.less

@@ -262,4 +262,110 @@
     top: 40px;
     left: 50px;
     font-size: 11px;
+}
+
+#details{
+    width: 250px;
+    height: 450px;
+    margin: auto;
+    overflow: hidden;
+    text-align: center;
+    position: relative;//
+    #userHead{
+        height: 75px;
+        background: #96CEDF;/* Opera 11.1 - 12.0 */
+        overflow: hidden;
+        #icoImg {
+            float: left;
+            width: 55px;
+            height: 55px;
+            margin: 10px 0px 10px 2px;
+            border-radius: 100%;
+            border:2px solid #fff;
+            background: #96CEDF;
+            >img {
+                border-radius: 100%;
+                width: 100%;
+                height: 100%;
+                }
+        }
+        .displayname {
+            color: #fff;
+            font-size: 18px;
+            font-family: "微软雅黑","宋体";
+            >input {
+                text-align: left;
+                width: 100%;
+                margin-left: -8px; 
+                margin-bottom: 2px;
+                text-shadow:0px 0px 2px #999;
+                border: none;
+                outline: none;
+                background: #96CEDF;
+            }
+        }
+        #watch {
+            margin-top: 12px;
+            margin-left: 70px;
+            text-align: left;
+            font-family: "微软雅黑","宋体";
+            background: #96CEDF;
+            color: #fff;
+            font-size: 12px;
+            text-shadow:0px 0px 2px #aaa;
+            white-space: nowrap; /* 自适应宽度,不换行*/
+            >input {
+                margin-left:-8px;
+                border: none;
+                outline: none;
+                background: #96CEDF;
+                width: 100%;
+                white-space: nowrap;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                text-shadow:0px 0px 2px #999;
+            }
+        }
+    }
+    #userInfo {
+        height: 155px;
+        background: #fff;
+        #content {
+            position: relative;
+            >ul {
+                position: absolute;
+                list-style: none;
+                margin-left: -33px;
+                >li {
+                    width: 235px;
+                    font-family: "微软雅黑","宋体";
+                    padding-top:5px;
+                    padding-bottom: 1px;
+                    text-align: left;
+                    font-size: 12px;
+                    color: #444;
+                    white-space: nowrap; /* 自适应宽度,不换行*/
+                    overflow: hidden;
+                    >input.lr {
+                        border: none;
+                        outline: none;
+                        background: #fff;
+                        width: 84%;
+                        white-space: nowrap;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                    }
+                }
+            }
+        }
+    }
+    #userCode {
+        #code {
+            margin: 20px auto;
+            width: 180px;
+            height: 180px;
+            border: 8px solid #fff;
+            box-shadow:0px 0px 1px #ccc;
+        }
+    }
 }

+ 27 - 0
talkview/src/templates/details.html

@@ -0,0 +1,27 @@
+<div id="details">
+    <div id="userHead">
+        <div id="icoImg">
+            <img src="../img/DefaultHeadImage_96.png">
+        </div>
+        <div id="watch">
+            <span class="displayname"> <input type="text" readonly="readonly" value="{{user.name}}&nbsp({{user.shortL}})"></span>
+            </br><input type="text" readonly="readonly" value="{{user.watchword !== null && user.watchword !== undefined && user.watchword !== ''?user.watchword:'他什么也没有留下'}}">
+        </div>
+    </div>
+    <div id="userInfo">
+        <div id="content">
+            <ul>
+                <li><span class="lf">单位:</span> <input class="lr" type="text" readonly="readonly" value="{{user.comp}}"></li>
+                <li><span class="lf">处室:</span> <input class="lr" type="text" readonly="readonly" value="{{user.branch}}"></li>
+                <li><span class="lf">职务:</span> <input class="lr" type="text" readonly="readonly" value="{{user.duty}}"></li>
+                <li><span class="lf">电话:</span> <input class="lr" type="text" readonly="readonly" value="{{user.tel}}"></li>
+                <li><span class="lf">手机:</span> <input class="lr" type="text" readonly="readonly" value="{{user.mob}}"></li>
+                <li><span class="lf">邮箱:</span> <input class="lr" type="text" readonly="readonly" value="{{user.email}}"></li>
+            </ul>
+        </div>
+    </div>
+    <div style="border-top:solid 1px #ddd;margin:0px 6px"></div>
+    <div id="userCode">
+        <div id="code" qrcode ng-user="user"> </div>
+    </div>
+</div>

+ 0 - 1
talkview/src/templates/messages.html

@@ -155,5 +155,4 @@
         <p></p>
         <span id="bottom"><span>
     </div>
-
 </div>

+ 28 - 1
talkview/src/templates/transmitter.html

@@ -8,4 +8,31 @@
     <span id="speed">{{getSpeed(item)}}&nbsp;&nbsp;{{getreTime(item)}}</span>
     <span class="textion"><a ng-show="!item.status&&item.direction==1" ng-click="acception(item)">接收</a><a ng-show="!item.status&&item.direction==1" ng-click="saveAs(item)">另存为</a><a ng-show="!item.status&&item.direction==1" ng-click="decline(item)">拒绝</a><a ng-show="item.status&&item.direction==1" ng-click="cancel(item)">取消</a></span>
     <span class="textion"><a ng-show="!item.status&&item.direction==0" ng-click="turnToOffline(item)">转为离线</a><a ng-show="item.direction==0" ng-click="cancel(item)">取消</a></span>
-</div>
+</div>
+<!--<div id="details">
+    <div id="userHead">
+        <div id="icoImg">
+            <img src="../img/DefaultHeadImage_96.png">
+        </div>
+        <div id="watch">
+            <span class="displayname"> <input type="text" readonly="readonly" value="{{user.name}}陆趣趣&nbsp({{user.shortL}}lslqq)"></span>
+            </br><input type="text" readonly="readonly" value="{{user.watchword !== null && user.watchword !== undefined && user.watchword !== ''?user.watchword:'脸上有肉才旺夫·~~做个快乐包子脸女孩,哈哈哈·``~~~'}}">
+        </div>
+    </div>
+    <div id="userInfo">
+        <div id="content">
+            <ul>
+                <li><span class="lf">单位:</span> <input class="lr" type="text" readonly="readonly" value="{{user.comp}}浙江万赛软件科技有限公司"></li>
+                <li><span class="lf">处室:</span> <input class="lr" type="text" readonly="readonly" value="{{user.branch}}运维部"></li>
+                <li><span class="lf">职务:</span> <input class="lr" type="text" readonly="readonly" value="{{user.duty}}副经理"></li>
+                <li><span class="lf">电话:</span> <input class="lr" type="text" readonly="readonly" value="{{user.tel}}0578-2189026"></li>
+                <li><span class="lf">手机:</span> <input class="lr" type="text" readonly="readonly" value="{{user.mob}}15157806180"></li>
+                <li><span class="lf">邮箱:</span> <input class="lr" type="text" readonly="readonly" value="{{user.email}}lqq@wswin.cn"></li>
+            </ul>
+        </div>
+    </div>
+    <div style="border-top:solid 1px #ddd;margin:0px 6px"></div>
+    <div id="userCode">
+        <div id="code" qrcode ng-user="user"> </div>
+    </div>
+</div>-->