chenxiaofeng 6 年之前
父节点
当前提交
3a0b1b824c
共有 4 个文件被更改,包括 20 次插入6 次删除
  1. 2 2
      pages/chat-list/chat-list.js
  2. 2 1
      pages/chat/chat.js
  3. 1 0
      pages/index/index.js
  4. 15 3
      pages/index_details/index_details.js

+ 2 - 2
pages/chat-list/chat-list.js

@@ -48,11 +48,11 @@ Page({
48 48
      */
49 49
     onShow() {
50 50
       var _this = this;
51
-
51
+    console.log(11);
52 52
       webSocket.sendSocketMessage({
53 53
         msg: JSON.stringify({ form_id: getApp().UserId(), type: 'Chat_list' }),
54 54
         success: function (res) {
55
-          console.log(res, 'dakai');
55
+          console.log(res, 'dakai111');
56 56
         }, fail: function (res) {
57 57
           console.log('发送消息失败')
58 58
         }

+ 2 - 1
pages/chat/chat.js

@@ -31,6 +31,7 @@ Page({
31 31
       // headUrl
32 32
       // wx.startPullDownRefresh
33 33
     //请空未读消息条数
34
+    console.log(options);
34 35
       console.log(options,'chat');
35 36
       const friend = options;
36 37
       this.SocketSend({ to_id: friend.to_id, form_id: getApp().UserId(), type: 'get_history', page: this.data.limit_page});
@@ -62,7 +63,7 @@ Page({
62 63
     },
63 64
   onShow: function (e) {
64 65
     //获取历史消息getget
65
-    this.onLoad();
66
+    // this.onLoad();
66 67
 
67 68
   },
68 69
     initData() {

+ 1 - 0
pages/index/index.js

@@ -62,6 +62,7 @@ Page({
62 62
   },
63 63
 
64 64
   onLoad: function (options) {
65
+   
65 66
     webSocket.connectSocket();
66 67
   },
67 68
 

+ 15 - 3
pages/index_details/index_details.js

@@ -25,9 +25,20 @@ Page({
25 25
 
26 26
   onLoad: function (options) {
27 27
     var that = this;
28
-    
29
-    getApp().showLoading();   //提示加载中
30 28
 
29
+    app.postRequest('my/images/headurl', {}, function (res) {
30
+      if (res.code == 201) {
31
+        that.myheadurl = res.data.img
32
+        // console.log(res);
33
+        // that.setData({
34
+        //   myheadurl: res.data.img,
35
+        //   // optioninfocode: res,
36
+        // })
37
+      }
38
+    })
39
+
40
+    getApp().showLoading();   //提示加载中
41
+    that.to_id = options.uid;
31 42
     that.setData({
32 43
       options_img: options.img  //头像
33 44
     })
@@ -237,8 +248,9 @@ console.log(that.data.uploadImages)
237 248
 
238 249
   },
239 250
   toChat(e) { //跳转进入聊天页面
251
+  let that = this;
240 252
     wx.navigateTo({
241
-      url: '../chat/chat?to_id=' + e.currentTarget.dataset.item
253
+      url: '../chat/chat?to_id=' + that.to_id + '&myheadurl=' + that.myheadurl + '&headUrl=' + that.data.options_img
242 254
     });
243 255
   }
244 256