chenxiaofeng 5 years ago
parent
commit
1b5277a1fd

+ 3 - 10
pages/chat-list/chat-list.js

@@ -1,6 +1,7 @@
1 1
 // pages/chat-list/chat-list.js
2 2
 // import Times from "../../utils/time";
3 3
 const webSocket = require('../../utils/websocket.js');
4
+const timefunc = require('../../utils/time.js');
4 5
 const app = getApp();
5 6
 /**
6 7
  * 会话列表页面
@@ -24,8 +25,6 @@ Page({
24 25
       timestamp = timestamp / 1000;
25 26
       console.log("当前时间戳为:" + timestamp);  
26 27
   
27
-
28
-
29 28
       //获取自己的头像
30 29
       app.postRequest('my/images/headurl', {}, function (res) {
31 30
         if (res.code == 201) {
@@ -37,11 +36,6 @@ Page({
37 36
         }
38 37
       })
39 38
 
40
-    // emojiChar: "☺-😋-😌-😍-😏-😜-😝-😞-😔-😪-😭-😁-😂-😃-😅-😆-👿-😒-😓-😔-😏-😖-😘-😚-😒-😡-😢-😣-😤-😢-😨-😳-😵-😷-😸-😻-😼-😽-😾-😿-🙊-🙋-🙏-✈-🚇-🚃-🚌-🍄-🍅-🍆-🍇-🍈-🍉-🍑-🍒-🍓-🐔-🐶-🐷-👦-👧-👱-👩-👰-👨-👲-👳-💃-💄-💅-💆-💇-🌹-💑-💓-💘-🚲",
41
-
42
-
43
-   
44
-
45 39
     },
46 40
   toChat(e) { //跳转进入聊天页面
47 41
     // console.log(e);
@@ -129,6 +123,7 @@ Page({
129 123
             // console.log(112233);
130 124
             dataAtt[index].count = 0;
131 125
           }
126
+          dataAtt[index].timeStr = timefunc.TimeFormatting(dataAtt[index].create_at)
132 127
           if (dataAtt[index].type == 2) {
133 128
             dataAtt[index].content = '[图片]'
134 129
           }
@@ -148,11 +143,11 @@ Page({
148 143
         for (var index in dataArr){
149 144
           // idData.push(String(dataArr[index].to_id));
150 145
           idData.push(String(dataArr[index].to_str)); //统一转换成string
146
+          dataArr[index].timeStr = timefunc.TimeFormatting(data.data.create_at); 
151 147
           if (dataArr[index].to_str == data.data.to_str)
152 148
             {
153 149
               dataArr[index].count = data.data.count;
154 150
               dataArr[index].content = data.data.content;
155
-              dataArr[index].timeStr = data.data.timeStr;
156 151
               dataArr[index].create_at = data.data.create_at;
157 152
             }
158 153
 
@@ -168,9 +163,7 @@ Page({
168 163
          _this.setData({
169 164
            conversations: _this.sortarr(dataArr)
170 165
          })
171
-    
172 166
       break;  
173
-        break;
174 167
     }
175 168
   },
176 169
     sortarr:function(arr){//冒泡排序

+ 11 - 0
pages/information/chat/chat.js

@@ -594,6 +594,17 @@ Page({
594 594
         _width: 447,   // input宽度
595 595
       })
596 596
     }
597
+  }, 
598
+  onUnload: function (e) {
599
+    let url = 'imsocket/imchatmessage/clearunreadmsg';
600
+    let datas = {
601
+      to_id: this.data.to_id, form_id: getApp().UserId()
602
+    };
603
+    //清除未读信息
604
+    getApp().postRequest(url, datas, function (res) {
605
+      console.log(res, 11111);
606
+    })
607
+    console.log('销毁页面');
597 608
   },
598 609
   // ceshi: function (e) {
599 610
   //   var that = this;

+ 0 - 11
pages/personal_core/Album/Album.js

@@ -2,10 +2,7 @@
2 2
 var uploadPicture = require('../Album/common.js')
3 3
 const app = getApp()
4 4
 Page({
5
-
6
-
7 5
   //获取应用实例
8
-
9 6
   data: {
10 7
     // 上传的案例图片集合
11 8
     uploadImages: [],
@@ -34,23 +31,15 @@ Page({
34 31
     let initial_data = {
35 32
     };
36 33
     app.postRequest(initial_url, initial_data, function (res) {
37
-
38
-
39 34
       that.setData({
40 35
         initialcode: res.code,    //获取未上传状态
41 36
       });
42
-      
43
-
44 37
       // console.log(res.data[0].img)
45 38
       if (res.code == 201) {
46 39
         console.log(res.data)
47 40
         that.setData({
48 41
           initial: res.data,   // 初始数
49 42
           imglength: res.data.length,
50
-
51
-        
52
-  
53
-
54 43
         })
55 44
        
56 45
 

+ 1 - 2
pages/personal_core/home/home.js

@@ -87,7 +87,6 @@ Page({
87 87
     var that = this;
88 88
     var code = '';
89 89
     // getApp().showLoading();   //提示加载中
90
-
91 90
     //  头部信息
92 91
     let datum_url = 'my/other/share';
93 92
     let datum_data = {
@@ -111,7 +110,7 @@ Page({
111 110
       console.log("来自右上角转发菜单")
112 111
     }
113 112
     return {
114
-      title: '妹子图片',
113
+      title: 'jia',
115 114
       // path: '/pages/share/share?code=' + _that.data.code + '',
116 115
       success: (res) => {
117 116
         console.log("转发成功", res);