chenxiaofeng пре 5 година
родитељ
комит
16f387d353
2 измењених фајлова са 19 додато и 17 уклоњено
  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 143
         for (var index in dataArr){
144 144
           // idData.push(String(dataArr[index].to_id));
145 145
           idData.push(String(dataArr[index].to_str)); //统一转换成string
146
-          dataArr[index].timeStr = timefunc.TimeFormatting(data.data.create_at); 
146
+         
147 147
           if (dataArr[index].to_str == data.data.to_str)
148 148
             {
149
+              dataArr[index].timeStr = timefunc.TimeFormatting(data.data.create_at); 
149 150
               dataArr[index].count = data.data.count;
150 151
               dataArr[index].content = data.data.content;
151 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 4
   data: {
5 5
     information: '',   //个人信息
6
-
7 6
     optioninfo: '',    //择偶信息
8
-
9 7
     adopticon: '',  //认证信息
10
-
11 8
     geifabulous:'',  //获取点赞
12
-
13 9
     Fabulous:'',  // 点赞
14
-
15 10
     optionsuid: '', //用户uid
16
-
17 11
     collection: '',  //收藏
18
-
19 12
     options_img: '',  //头像
20
-
21 13
     uploadImages:[], //相册放大图集
22 14
     albumimg:'', // 相册
23 15
     albumimgurl: '',// 相册url
24 16
     watermark: '',
17
+    to_id:'',
25 18
   },
26 19
 
27 20
 
@@ -44,7 +37,8 @@ Page({
44 37
 
45 38
     that.to_id = options.uid;
46 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 250
   toChat(e) { //跳转进入聊天页面
257 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 257
       if (res.code == 201) {
258
+
262 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 269
       if (res.data.location == 'shiming') {