chenxiaofeng 5 years ago
parent
commit
16f387d353
2 changed files with 19 additions and 17 deletions
  1. 5 4
      pages/chat-list/chat-list.js
  2. 14 13
      pages/index_details/index_details.js

+ 5 - 4
pages/chat-list/chat-list.js

@@ -143,17 +143,18 @@ Page({
143
         for (var index in dataArr){
143
         for (var index in dataArr){
144
           // idData.push(String(dataArr[index].to_id));
144
           // idData.push(String(dataArr[index].to_id));
145
           idData.push(String(dataArr[index].to_str)); //统一转换成string
145
           idData.push(String(dataArr[index].to_str)); //统一转换成string
146
-          dataArr[index].timeStr = timefunc.TimeFormatting(data.data.create_at); 
146
+         
147
           if (dataArr[index].to_str == data.data.to_str)
147
           if (dataArr[index].to_str == data.data.to_str)
148
             {
148
             {
149
+              dataArr[index].timeStr = timefunc.TimeFormatting(data.data.create_at); 
149
               dataArr[index].count = data.data.count;
150
               dataArr[index].count = data.data.count;
150
               dataArr[index].content = data.data.content;
151
               dataArr[index].content = data.data.content;
151
               dataArr[index].create_at = data.data.create_at;
152
               dataArr[index].create_at = data.data.create_at;
152
             }
153
             }
153
 
154
 
154
-            if(dataArr[index].type == 2){
155
-              dataArr[index].content = '[图片]'
156
-            }
155
+            // if(dataArr[index].type == 2){
156
+            //   dataArr[index].content = '[图片]'
157
+            // }
157
          } 
158
          } 
158
      
159
      
159
         //新增一列
160
         //新增一列

+ 14 - 13
pages/index_details/index_details.js

@@ -3,25 +3,18 @@ Page({
3
 
3
 
4
   data: {
4
   data: {
5
     information: '',   //个人信息
5
     information: '',   //个人信息
6
-
7
     optioninfo: '',    //择偶信息
6
     optioninfo: '',    //择偶信息
8
-
9
     adopticon: '',  //认证信息
7
     adopticon: '',  //认证信息
10
-
11
     geifabulous:'',  //获取点赞
8
     geifabulous:'',  //获取点赞
12
-
13
     Fabulous:'',  // 点赞
9
     Fabulous:'',  // 点赞
14
-
15
     optionsuid: '', //用户uid
10
     optionsuid: '', //用户uid
16
-
17
     collection: '',  //收藏
11
     collection: '',  //收藏
18
-
19
     options_img: '',  //头像
12
     options_img: '',  //头像
20
-
21
     uploadImages:[], //相册放大图集
13
     uploadImages:[], //相册放大图集
22
     albumimg:'', // 相册
14
     albumimg:'', // 相册
23
     albumimgurl: '',// 相册url
15
     albumimgurl: '',// 相册url
24
     watermark: '',
16
     watermark: '',
17
+    to_id:'',
25
   },
18
   },
26
 
19
 
27
 
20
 
@@ -44,7 +37,8 @@ Page({
44
 
37
 
45
     that.to_id = options.uid;
38
     that.to_id = options.uid;
46
     that.setData({
39
     that.setData({
47
-      options_img: options.img  //头像
40
+      options_img: options.img,  //头像
41
+      to_id: options.uid
48
     })
42
     })
49
 
43
 
50
     // 同步传参
44
     // 同步传参
@@ -256,13 +250,20 @@ console.log(that.data.uploadImages)
256
   toChat(e) { //跳转进入聊天页面
250
   toChat(e) { //跳转进入聊天页面
257
   let that = this;
251
   let that = this;
258
 
252
 
259
-    app.postRequest('circle/dialogue/validate', {}, function (res) {
260
-        console.log(res);
253
+    app.postRequest('circle/dialogue/validate', {to_id:that.data.to_id}, function (res) {
254
+        // console.log(res);
255
+
256
+        // return ;
261
       if (res.code == 201) {
257
       if (res.code == 201) {
258
+
262
         wx.navigateTo({
259
         wx.navigateTo({
263
-          url: '../chat/chat?to_id=' + that.to_id + '&myheadurl=' + that.myheadurl + '&headUrl=' + that.data.options_img
260
+          url: '../information/chat/chat?to_id=' + that.data.to_id + '&headUrl=' + that.data.options_img + '&myheadurl=' + res.data.myHeadImg
264
         });
261
         });
265
-        return ;
262
+
263
+        // wx.navigateTo({
264
+        //   url: '../chat/chat?to_id=' +  + '&myheadurl=' + that.myheadurl + '&headUrl=' + that.data.options_img
265
+        // });
266
+       
266
       } 
267
       } 
267
 
268
 
268
       if (res.data.location == 'shiming') {
269
       if (res.data.location == 'shiming') {