chenxiaofeng 6 years ago
parent
commit
cc1863ac80
2 changed files with 16 additions and 5 deletions
  1. 7 4
      pages/information/chat/chat.js
  2. 9 1
      project.config.json

+ 7 - 4
pages/information/chat/chat.js

@@ -165,7 +165,7 @@ Page({
165
               console.log(con, 1);
165
               console.log(con, 1);
166
 
166
 
167
               // console.log(ImgRes.tempFilePaths[0], 1222222);
167
               // console.log(ImgRes.tempFilePaths[0], 1222222);
168
-              that.SocketSend({ type: ImageType, content: con });
168
+              that.SocketSend({ type: ImageType, content: con.img_name });
169
 
169
 
170
               // that.msgManager.sendMsg({ type: IMOperator.ImageType, content: con })
170
               // that.msgManager.sendMsg({ type: IMOperator.ImageType, content: con })
171
 
171
 
@@ -292,11 +292,11 @@ Page({
292
   // 接收消息
292
   // 接收消息
293
   onSocketMessageCallback: function (e) {
293
   onSocketMessageCallback: function (e) {
294
     var that = this;
294
     var that = this;
295
-    let data = JSON.parse(e);
295
+    let data  = JSON.parse(e);
296
   
296
   
297
     //  console.log(data,'接受消息成功');
297
     //  console.log(data,'接受消息成功');
298
 
298
 
299
-    var arrData = data.data;
299
+    var arrData = data.data.data;
300
 
300
 
301
     switch (data.type) {
301
     switch (data.type) {
302
       // 接收历史消息
302
       // 接收历史消息
@@ -311,7 +311,10 @@ Page({
311
           } else {
311
           } else {
312
             arrData[index].isMy = false;   //他人
312
             arrData[index].isMy = false;   //他人
313
           }
313
           }
314
-      
314
+
315
+          if (arrData[index].type == 2){
316
+    arrData[index].content = data.data.url + arrData[index].content + data.data.stylename;
317
+          }
315
         
318
         
316
           that.ArrMsg.push(arrData[index]);
319
           that.ArrMsg.push(arrData[index]);
317
         }
320
         }

+ 9 - 1
project.config.json

@@ -9,8 +9,16 @@
9
 		"postcss": true,
9
 		"postcss": true,
10
 		"minified": true,
10
 		"minified": true,
11
 		"newFeature": true,
11
 		"newFeature": true,
12
+		"coverView": true,
12
 		"autoAudits": false,
13
 		"autoAudits": false,
13
-		"checkInvalidKey": true
14
+		"checkInvalidKey": true,
15
+		"checkSiteMap": true,
16
+		"uploadWithSourceMap": true,
17
+		"babelSetting": {
18
+			"ignore": [],
19
+			"disablePlugins": [],
20
+			"outputPath": ""
21
+		}
14
 	},
22
 	},
15
 	"compileType": "miniprogram",
23
 	"compileType": "miniprogram",
16
 	"libVersion": "2.4.0",
24
 	"libVersion": "2.4.0",