|
@@ -1,178 +0,0 @@
|
|
|
-'use strict';
|
|
|
-
|
|
|
-angular.module('appMessage').controller('MessageController', ['$scope', '$location', '$anchorScroll', function($scope, $location, $anchorScroll) {
|
|
|
-
|
|
|
- lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', '_Register', '', $scope);
|
|
|
- $scope.glued = true;
|
|
|
- $scope.items = [{
|
|
|
- "uid": "2636765",
|
|
|
- "senderDisplayName": "丽水市市委办公室",
|
|
|
- "sender": "0578+002682BECE10-lqq",
|
|
|
- "msgType": 0,
|
|
|
- "networkType": 1,
|
|
|
- "isDes": false,
|
|
|
- "length": 0,
|
|
|
- "isReaded": false,
|
|
|
- "contentType": 1,
|
|
|
- "receiver": "0578+002682BECE10-lsws",
|
|
|
- "fromClient": 0,
|
|
|
- "ts": "来自pc端",
|
|
|
- "id": 0,
|
|
|
- "content": "111111",
|
|
|
- "style": ""
|
|
|
- }, {
|
|
|
- content: "消息内容",
|
|
|
- style: '字体',
|
|
|
- fromClient: 2, //消息来源([0:PC],[1:iOS],[2:Android]
|
|
|
- id: "616ebe69e1c04c2ea9740a14457aaca6",
|
|
|
- isDes: 0, //是否加密消息
|
|
|
- contentType: 1, // 消息类型([1,文本消息],[2,图片消息],[3,文件消息],[4,语音消息], [5,位置消息])
|
|
|
- networkType: 1, //网络类型([1:wifi],[2:2G],[3:3G],[4:4G])
|
|
|
- sender: "0578+0-ls_xxj1",
|
|
|
- senderDisplayName: "陆趣趣",
|
|
|
- length: 12312,
|
|
|
- ts: 12312312412 //时间搓
|
|
|
- }, {
|
|
|
- content: "http://202.107.249.133:8125/e/8/2/4/f/e824fa94cbacff419a0ad611926710f9.dat?下载文件.docx",
|
|
|
- fromClient: 2,
|
|
|
- id: "253db476c6d140f0a1b4d4af5fcf2016",
|
|
|
- isDes: 0,
|
|
|
- contentType: 3,
|
|
|
- networkType: 1,
|
|
|
- sender: "0578+0-ls_xxj1",
|
|
|
- senderDisplayName: "陆趣趣",
|
|
|
- "ts": "来自pc端",
|
|
|
- length: 17359
|
|
|
- },
|
|
|
- {
|
|
|
- content: "../img/DefaultHeadImage_96.png",
|
|
|
- fromClient: 2,
|
|
|
- id: "253db476c6d140f0a1b4d4af5fcf2016",
|
|
|
- isDes: 0,
|
|
|
- contentType: 2,
|
|
|
- networkType: 1,
|
|
|
- sender: "0578+0-ls_xxj1",
|
|
|
- senderDisplayName: "陆趣趣",
|
|
|
- "ts": "来自pc端",
|
|
|
- length: 17359
|
|
|
- },
|
|
|
- {
|
|
|
- content: "../img/DefaultHeadImage_96.png",
|
|
|
- fromClient: 2,
|
|
|
- id: "253db476c6d140f0a1b4d4af5fcf2016",
|
|
|
- isDes: 0,
|
|
|
- contentType: 2,
|
|
|
- networkType: 1,
|
|
|
- sender: "0578+0-ls_xxj1",
|
|
|
- senderDisplayName: "陆趣趣",
|
|
|
- "ts": "来自pc端",
|
|
|
- length: 17359
|
|
|
- },
|
|
|
- {
|
|
|
- content: "../img/DefaultHeadImage_96.png",
|
|
|
- fromClient: 2,
|
|
|
- id: "253db476c6d140f0a1b4d4af5fcf2016",
|
|
|
- isDes: 0,
|
|
|
- contentType: 2,
|
|
|
- networkType: 1,
|
|
|
- sender: "0578+0-ls_xxj1",
|
|
|
- senderDisplayName: "陆趣趣",
|
|
|
- "ts": "来自pc端",
|
|
|
- length: 17359
|
|
|
- },
|
|
|
- {
|
|
|
- content: "http://202.107.249.133:8125/e/8/2/4/f/e824fa94cbacff419a0ad611926710f9.dat?下载文件.docx",
|
|
|
- fromClient: 2,
|
|
|
- id: "253db476c6d140f0a1b4d4af5fcf2016",
|
|
|
- isDes: 0,
|
|
|
- contentType: 3,
|
|
|
- networkType: 1,
|
|
|
- sender: "0578+0-ls_xxj1",
|
|
|
- senderDisplayName: "陆趣趣",
|
|
|
- "ts": "来自pc端",
|
|
|
- length: 17359
|
|
|
- },
|
|
|
- {
|
|
|
- content: "消息内容",
|
|
|
- style: { "family": "宋体", "size": 9, "color": 16711680 },
|
|
|
- fromClient: 2, //消息来源([0:PC],[1:iOS],[2:Android]
|
|
|
- id: "616ebe69e1c04c2ea9740a14457aaca6",
|
|
|
- isDes: 0, //是否加密消息
|
|
|
- contentType: 1, // 消息类型([1,文本消息],[2,图片消息],[3,文件消息],[4,语音消息], [5,位置消息])
|
|
|
- networkType: 1, //网络类型([1:wifi],[2:2G],[3:3G],[4:4G])
|
|
|
- sender: "0578+0-ls_xxj1",
|
|
|
- senderDisplayName: "陆趣趣",
|
|
|
- length: 12312,
|
|
|
- ts: 12312312412 //时间搓
|
|
|
- }
|
|
|
- ];
|
|
|
- $scope.appContent = {};
|
|
|
- // $scope.guid = lxtalkClient.Invoke('register', 'talkview', $scope)
|
|
|
-
|
|
|
- $scope.sendmessages = [];
|
|
|
- $scope.historyitems = [];
|
|
|
- $scope.historymessages = [];
|
|
|
- $scope.pageSize = 1;
|
|
|
- $scope.pageNumber = 2;
|
|
|
- $scope.historyitems.push($scope.items.slice($scope.pageNumber * ($scope.pageSize - 1), $scope.pageNumber * $scope.pageSize));
|
|
|
- for (var i = 0; i < $scope.pageNumber; i++) {
|
|
|
- if ($scope.historyitems[0][i] !== undefined) {
|
|
|
- $scope.historymessages.push($scope.historyitems[0][i]);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $scope.initAppContent = function(appContentJson) {
|
|
|
- $scope.appContent = JSON.parse(appContentJson);
|
|
|
- }
|
|
|
-
|
|
|
- $scope.addMessage = function() {
|
|
|
- scroll(document.body);
|
|
|
- }
|
|
|
-
|
|
|
- $scope.showMessage = function(jsonStr) {
|
|
|
- console.log(jsonStr);
|
|
|
- jsonStr = jsonStr.replace(/ /g, " ");
|
|
|
- jsonStr = jsonStr.replace(/\r\n/g, "<br>");
|
|
|
- jsonStr = jsonStr.replace(/\r/g, "\\r");
|
|
|
- jsonStr = jsonStr.replace(/\n/g, "\\n");
|
|
|
- jsonStr = jsonStr.replace(/\t/g, "\\t");
|
|
|
- jsonStr = jsonStr.replace(/\f/g, "\\f");
|
|
|
- var msg = JSON.parse(jsonStr);
|
|
|
- $scope.sendmessages.push(msg);
|
|
|
- $scope.scrollHide();
|
|
|
- }
|
|
|
-
|
|
|
- $scope.showHistoryMessage = function(jsonStr) {
|
|
|
- var msg = JSON.parse(jsonStr);
|
|
|
- // $scope.items.unshift(msg);
|
|
|
- // console.log(msg);
|
|
|
- }
|
|
|
-
|
|
|
- $scope.getMore = function() {
|
|
|
- $scope.historyitems = [];
|
|
|
- $scope.pageSize = $scope.pageSize + 1;
|
|
|
- $scope.historyitems.push($scope.items.slice($scope.pageNumber * ($scope.pageSize - 1), $scope.pageNumber * $scope.pageSize));
|
|
|
- for (var i = 0; i < $scope.pageNumber; i++) {
|
|
|
- if ($scope.historyitems[0][i] !== undefined) {
|
|
|
- $scope.historymessages.push($scope.historyitems[0][i]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $scope.scrollHide = function() {
|
|
|
- angular.element("#body").addClass("scrollGlue");
|
|
|
- }
|
|
|
- $scope.scrollShow = function() {
|
|
|
- angular.element("#body").removeClass("scrollGlue");
|
|
|
- }
|
|
|
-
|
|
|
- }])
|
|
|
- .animation(".animate", function() {
|
|
|
- return {
|
|
|
- enter: function(element, done) {
|
|
|
- var height = element.height();
|
|
|
- element.css({ position: 'relative', bottom: 0, opacity: 0 });
|
|
|
- element.animate({ bottom: 0, opacity: 1 }, 500, done);
|
|
|
- }
|
|
|
- };
|
|
|
- });
|