Your Name 5 年之前
父節點
當前提交
cb0badc1f8
共有 5 個文件被更改,包括 487 次插入93 次删除
  1. 15 15
      app.js
  2. 2 0
      pages/chat/chat.js
  3. 392 37
      pages/information/chat/chat.js
  4. 59 40
      pages/information/chat/chat.wxml
  5. 19 1
      pages/information/chat/chat.wxss

+ 15 - 15
app.js

@@ -33,22 +33,22 @@ App({
33 33
     // console.log(wx.getStorageSync('access_token'))    //是否注册过
34 34
 
35 35
 
36
-    // if (wx.getStorageSync('access_token')) {   //是否注册过
36
+    if (wx.getStorageSync('access_token')) {   //是否注册过
37 37
       
38
-    //   wx.reLaunch({
39
-    //     url: '/pages/index/index'        //注册过 进入首页
40
-    //   })
41
-
42
-    // } else if (wx.getStorageSync('wx_id')) {  //是否授权
43
-    //   // console.log(2);
44
-    //   wx.reLaunch({
45
-    //     url: '/pages/Landpage/Land/Land'    //授权过 进入登陆页
46
-    //   })  
47
-    // }else {
48
-    //   wx.reLaunch({
49
-    //     url: '/pages/Jurisdiction/click_Jurisdiction/click_Jurisdiction'   //未授权  进入授权页
50
-    //   })
51
-    // }
38
+      wx.reLaunch({
39
+        url: '/pages/index/index'        //注册过 进入首页
40
+      })
41
+
42
+    } else if (wx.getStorageSync('wx_id')) {  //是否授权
43
+      // console.log(2);
44
+      wx.reLaunch({
45
+        url: '/pages/Landpage/Land/Land'    //授权过 进入登陆页
46
+      })  
47
+    }else {
48
+      wx.reLaunch({
49
+        url: '/pages/Jurisdiction/click_Jurisdiction/click_Jurisdiction'   //未授权  进入授权页
50
+      })
51
+    }
52 52
 
53 53
   
54 54
   },

+ 2 - 0
pages/chat/chat.js

@@ -248,6 +248,7 @@ Page({
248 248
             data.data[index].showTime = true;
249 249
             //自己 
250 250
             console.log(getApp().UserToken());
251
+
251 252
             if (data.data[index].form_id == getApp().UserToken()) {
252 253
               data.data[index].isMy = true;
253 254
               data.data[index].userId = data.data[index].form_id;
@@ -257,6 +258,7 @@ Page({
257 258
               data.data[index].isMy = false;
258 259
               data.data[index].headUrl = _that.data.headUrl
259 260
             }
261
+            
260 262
             _that.ArrMsg.push(data.data[index]);
261 263
           }
262 264
           // data.data.push(_that.data.chatItems)

+ 392 - 37
pages/information/chat/chat.js

@@ -1,30 +1,71 @@
1 1
 const app = getApp();
2
-
2
+const ImageType = 'images';
3
+const TextType = 'text';
3 4
 Page({
4 5
 
5 6
   /**
6 7
    * 页面的初始数据
7 8
    */
8 9
   data: {
9
-    focus: false,
10
-    // scrollTop: 100,
10
+    scrollTopVal: 1,    //滚动条
11 11
     menu: false, //菜单显示隐藏
12
-    uploadImages: ["/image/smyz2.png","/image/smyz1.png"], //相册放大图集
12
+    Expression: false,  // 表情显示隐藏
13
+    Sendoutshow: false, // 发送按钮显示隐藏
14
+    menushow: true, //菜单按钮显示隐藏
15
+    _width:500, //input高度
16
+    // uploadImages: ["/image/smyz2.png","/image/smyz1.png"], //相册放大图集
13 17
     news:'',//input消息
14
-    inputValue: null,  //input 的 value 
15
-
16
-    messages:'',//接收消息数据
18
+    KeyboardHeight: 366.66666666666674, //键盘高度
19
+    ExpressionImg:'', //表情
20
+    inputValue:'',  //input 的 value 
17 21
     photo:'', //相片
22
+
23
+    Receive_news:'', //历史消息
24
+    UserToken:'',  //区分自己
25
+    limit_page:1,
26
+
27
+    myheadurl:'', //我的头像
28
+    headUrl:'', //他人头像
29
+
30
+    to_id:'',    //他人
31
+    form_id:'',   //自己
32
+
33
+    // scrollTop:'' //下拉更多时的位置
34
+    connectemojiO: ['😊','😅','😲', '😭', '😂', '😄', '😩', '😞', '😵', '😒', '😍', '😤', '😜', '😝', '😋', '😘', '😚', '😷', '😳', '😃', '😆', '😁', '😢', '😨', '😠', '😣', '😌', '😖', '😔', '😰', '😱', '😪', '😏', '😓'],
35
+
18 36
   },
19 37
 
20 38
 
21 39
   onLoad: function (options) {
22 40
     var that = this;
23
-    console.log(options);
41
+
42
+    that.ArrMsg = [];
43
+    // console.log(that.data.UserToken);
44
+    // console.log(options.headUrl);
45
+    // console.log(options.myheadurl);
46
+    // console.log(getApp().UserId(),'token');
47
+
48
+    // console.log(options);
24 49
     const friend = options;
25
-    this.SocketSend({ to_id: friend.to_id, form_id: getApp().UserId(), type: 'get_history', page: this.data.limit_page });
26 50
 
51
+    that.setData({
52
+      to_id: friend.to_id,  // 他人
53
+      UserToken: getApp().UserToken(),   //自己
54
+      myheadurl: options.myheadurl, //我的头像
55
+      headUrl: options.headUrl, //他人头像
56
+    })
57
+
58
+
59
+    this.SocketSend({
60
+        //  to_id: friend.to_id,    // 他人
61
+        //  form_id: getApp().UserId(),   //自己
62
+         type: 'get_history', 
63
+         page: this.data.limit_page
64
+    });
27 65
     getApp().Imsocket().onSocketMessageCallback = this.onSocketMessageCallback;
66
+
67
+
68
+
28 69
   },
29 70
 
30 71
 
@@ -33,18 +74,35 @@ Page({
33 74
     var that = this;
34 75
     that.setData({ 
35 76
       menu: false, //关闭底部菜单
77
+      Expression: false, //关闭表情
36 78
     })
37 79
   },
38 80
 
81
+
39 82
 // 底部菜单显示隐藏切换
40 83
   chatInputExtraClickEvent:function(){
41 84
         var that = this;
42 85
     that.setData({
43
-      menu: !that.data.menu   
86
+      menu: !that.data.menu,
87
+      Expression: false, //关闭表情
44 88
     })
45 89
   },
46 90
 
47 91
 
92
+
93
+  // 关闭表情显示隐藏切换
94
+ExpressionClickEvent: function () {
95
+    var that = this;
96
+    that.setData({
97
+      Expression: !that.data.Expression,
98
+      menu: false, //关闭底部菜单
99
+    })
100
+  },
101
+
102
+  
103
+
104
+
105
+
48 106
 // 相册点击放大
49 107
   enlarge: function (e) {
50 108
     var that = this;
@@ -52,7 +110,7 @@ Page({
52 110
     // console.log(e.currentTarget.dataset.src,)
53 111
     wx.previewImage({
54 112
       current: e.currentTarget.dataset.src, // 当前显示图片的http链接
55
-      urls: that.data.uploadImages, // 需要预览的图片http链接列表
113
+      urls: [e.currentTarget.dataset.src], // 需要预览的图片http链接列表
56 114
     })
57 115
 
58 116
 
@@ -60,32 +118,20 @@ Page({
60 118
 
61 119
 
62 120
 
63
-// 发送消息事件
64
-  Sendout: function (e) {
65
-    var that = this;
66
-    console.log(that.data.news);
67
-
68
-    that.setData({
69
-      menu: false,  //隐藏底部菜单
70
-      inputValue: '',  //清空 input
71
-      messages: that.data.news,  //显示信息
72
-    })
73
-    console.log('发送');
74
-    
75
-  },
76
-
77
-  //输入框
121
+  //input输入框
78 122
   Telephone: function (e) {
79 123
     var that = this;
80
-    // console.log(e.detail.value);
81
-
124
+    console.log(e.detail.value);
82 125
     that.setData({
83 126
       news: e.detail.value,     //获取输入文字
84 127
     })
128
+ 
85 129
 
130
+    that.Sendoutswitch(e.detail.value); // 发送键切换
86 131
   },
87 132
 
88 133
 
134
+
89 135
   // 上传图片
90 136
   chooseImageTap: function () {
91 137
     var that = this;
@@ -95,18 +141,52 @@ Page({
95 141
       sourceType: ['album', 'camera'],
96 142
       success(res) {
97 143
 
144
+        wx.uploadFile({
145
+          url: getApp().globalData.url + 'imsocket/images/chatimg',
146
+          filePath: res.tempFilePaths[0],
147
+          name: 'photo',
148
+          formData: {
149
+            key: wx.getStorageSync('access_key'),
150
+            token: wx.getStorageSync('access_token')
151
+          },
152
+          success: function (res) {
153
+            var data = JSON.parse(res.data);
154
+
155
+            console.log(data, '图片上传成功');
156
+
157
+            if (data.code == 201) {
158
+              let con = data.data;
159
+              //显示图片
160
+              console.log(con, 1);
161
+        
162
+              // console.log(ImgRes.tempFilePaths[0], 1222222);
163
+              that.SocketSend({type: ImageType,  content: con});
164
+
165
+              // that.msgManager.sendMsg({ type: IMOperator.ImageType, content: con })
166
+
167
+            } else if (data.code == 301) {
168
+              wx.showModal({
169
+                title: '提示',
170
+                content: data.msg,
171
+                showCancel: false,
172
+              })
173
+            }
174
+          }, fail: function (d) {
175
+          }
176
+        })
98 177
         console.log(res.tempFilePaths[0]);
99 178
         // tempFilePath可以作为img标签的src属性显示图片
100 179
         that.setData({
101 180
           photo: res.tempFilePaths[0],
181
+          menu: false, //菜单显示隐藏
102 182
         });
103 183
 
104 184
       }
105 185
     })
106
-
107
-
108 186
   },
109 187
   
188
+
189
+
110 190
   // 重发消息
111 191
   retransmission:function(){
112 192
     wx.showModal({
@@ -119,30 +199,305 @@ Page({
119 199
         }
120 200
       }
121 201
     })
122
-
123 202
   },
124
-    SocketSend: function (msg) {
203
+
204
+
205
+
206
+// 发送消息
207
+  SocketSend: function (msg) {
208
+    var that =this;
209
+    msg.form_id = getApp().UserId();
210
+    msg.to_id = that.data.to_id;
211
+
212
+    // console.log(that.data.Receive_news);
213
+
125 214
     // { to_id: friend.to_id, form_id: getApp().UserId(), type: 'get_history' }
126 215
     // msg.type = 'get_history';
127 216
     getApp().Imsocket().sendSocketMessage({
128
-      msg: JSON.stringify(msg),
129
-      success: function (res) {
217
+       msg: JSON.stringify(msg),
218
+   
219
+        success: function (res) {   //发送成功
220
+
221
+        // 我跟他人说话
222
+        switch(msg.type){
223
+       
224
+          case "alone":     //  发送文本
225
+
226
+            console.log(' 发送文本');
227
+            var obj = {     //创建对象,用来合并历史消息对象
228
+              content: that.data.news,     //发送消息内容  
229
+              type: 1,                            //类型 1 : 文字类型     类型 2 : 图片
230
+              time: Date.now(),         //时间
231
+              isMy: true,   //自己
232
+              send: true,   //    发送成功  为true   失败false 
233
+              };
234
+            let _Receive_news =  that.data.Receive_news;
235
+            _Receive_news.push(obj);   //合并历史消息对象
236
+
237
+            console.log(_Receive_news,'aaa');
238
+            that.setData({
239
+              Receive_news: _Receive_news,     //前台数据赋值 
240
+            });
241
+
242
+            //调用页面滚动条处理
243
+            that.scrollbar(_Receive_news);
244
+  
245
+           break;
246
+
247
+           case "images":   //  发送图片
248
+    
249
+            console.log(' 发送图片');
250
+
251
+            var obj = {     //创建对象,用来合并历史消息对象
252
+              content: that.data.photo,     //发送消息内容  
253
+              type: 2,                            //类型 1 : 文字类型     类型 2 : 图片
254
+              time: Date.now(),         //时间
255
+              isMy: true,   //自己
256
+              send: true,   //    发送成功  为true   失败false 
257
+            };
258
+            let _Receive_img = that.data.Receive_news;
259
+            _Receive_img.push(obj);   //合并历史消息对象
260
+
261
+            console.log(_Receive_img, '发送图片');
262
+            that.setData({
263
+              Receive_news: _Receive_img,     //前台数据赋值 
264
+            });
265
+
266
+            //调用页面滚动条处理
267
+            that.scrollbar(_Receive_img);
268
+
269
+
270
+
271
+
272
+           break; 
273
+        } 
274
+
130 275
         console.log(res, '获取历史消息成功');
131
-      }, fail: function (res) {
276
+
277
+      }, fail: function (res) {    //发送失败
278
+
132 279
         console.log('获取历史消息失败')
280
+
133 281
       }
134 282
     })
283
+
135 284
   },
285
+
286
+
287
+// 接收消息
136 288
   onSocketMessageCallback: function (e) {
289
+    var that = this;
137 290
     let data = JSON.parse(e);
138
-   
139
-      console.log(data,'接受消息成功');
291
+
292
+    //  console.log(data,'接受消息成功');
293
+
294
+    var arrData = data.data;
295
+
296
+    switch(data.type){
297
+      // 接收历史消息
298
+      case "get_history":
299
+        // console.log(arrData,111112222);
300
+        for (var index in arrData) {     //二次赋值  
301
+          if (arrData[index].form_id == getApp().UserToken()) {   //判断  如果等于自己 true  ,等于他人  false。
302
+            arrData[index].isMy = true;    //自己
303
+            }else{
304
+            arrData[index].isMy = false;   //他人
305
+            }
306
+          that.ArrMsg.push(arrData[index]);
307
+        }
308
+
309
+        // 滚动条处理
310
+        var scrollTopValLength = "";
311
+        if (that.data.limit_page == 1) {
312
+          scrollTopValLength = arrData.length * 999
313
+        } else {
314
+          scrollTopValLength = arrData.length * 100
315
+        }
316
+
317
+        console.log(that.ArrMsg, 111112222);
318
+        that.setData({
319
+          Receive_news: that.sortarr(that.ArrMsg),        //前台数据赋值 
320
+          scrollTopVal: scrollTopValLength,    // 滚动条赋值
321
+        });
322
+
323
+    
324
+        // that.scrollbar(that.ArrMsg);      //调用页面滚动条处理  这里不对
325
+      break; 
326
+
327
+
328
+      case "alone":       // 接收他人文本
329
+        console.log(arrData,"aaasd");
330
+
331
+        var obj = {     //创建对象,用来合并历史消息对象
332
+          content: arrData.content,   //发送消息内容
333
+          type: 1,          //类型 1 : 文字类型     类型 2 : 图片
334
+          time: Date.now(),    //时间
335
+          isMy: false,   //他人
336
+        };
337
+
338
+        let _Receive_news = that.data.Receive_news;
339
+        _Receive_news.push(obj);      //合并历史消息对象
340
+     
341
+        that.setData({
342
+          Receive_news: _Receive_news,     //前台数据赋值 
343
+        });
344
+
345
+        //调用页面滚动条处理
346
+        that.scrollbar(_Receive_news);
347
+      break; 
348
+
349
+      case "images":   // 接收他人图片
350
+        console.log(arrData, "接收图片");
351
+
352
+        var obj = {     //创建对象,用来合并历史消息对象
353
+          content: arrData.content,   //发送消息内容
354
+          type: 2,          //类型 1 : 文字类型     类型 2 : 图片
355
+          time: Date.now(),    //时间
356
+          isMy: false,   //他人
357
+        };
358
+
359
+        let _Receive_img = that.data.Receive_news;
360
+        _Receive_img.push(obj);      //合并历史消息对象
361
+
362
+        that.setData({
363
+          Receive_news: _Receive_img,     //前台数据赋值 
364
+        });
365
+
366
+        //调用页面滚动条处理
367
+        that.scrollbar(_Receive_img);
368
+
369
+
370
+        break; 
371
+
372
+
373
+
374
+    }
375
+
376
+
140 377
 
141 378
   },
142 379
 
380
+// 处理滚动条
381
+  scrollbar: function (data) {
382
+    var that =this;
383
+    if(data){
384
+      let lengNum = data.length;
385
+      //页面滚动条处理
143 386
 
387
+      that.setData({
388
+        scrollTopVal: lengNum * 999
389
+      })
390
+      console.log(lengNum * 999);
391
+    }
144 392
 
393
+  },
145 394
 
395
+  // 发送消息事件  用来获取input数据
396
+  Sendout: function (e) {
397
+    var that = this;
398
+    // console.log(that.data.news);
399
+    
400
+    let msg = {
401
+      // to_id: that.data.to_id,
402
+      // form_id: getApp().UserId(),
403
+      type: 'alone',
404
+      content: that.data.news
405
+    };
406
+
407
+    // console.log(msg);
408
+    this.SocketSend(msg);
409
+
410
+      that.setData({
411
+        menu: false,  //隐藏底部菜单
412
+        Expression: false,//隐藏表情栏
413
+        inputValue: '',  //清空 input
414
+        news: '', //清空 input内容
415
+      })
416
+
417
+
418
+    that.Sendoutswitch(that.data.news)  // 发送键切换
419
+
420
+    // console.log(that.data.Receive_news)
421
+
422
+  },
423
+
424
+//冒泡排序
425
+  sortarr: function (arr) {
426
+    for (let i = 0; i < arr.length - 1; i++) {
427
+      for (let j = 0; j < arr.length - 1 - i; j++) {
428
+        if (arr[j].create_at > arr[j + 1].create_at) {
429
+          var temp = arr[j];
430
+          arr[j] = arr[j + 1];
431
+          arr[j + 1] = temp;
432
+        }
433
+      }
434
+    }
435
+    return arr;
436
+  },
437
+
438
+ 
439
+   upper: function (e) {
440
+    // console.log(e,'加载')
441
+ 
442
+     let that = this;
443
+     that.setData({
444
+       limit_page: that.data.limit_page * 1 + 1
445
+     })
446
+     console.log(that.data.limit_page * 1 + 1)
447
+     that.SocketSend({type: 'get_history', page: that.data.limit_page })
146 448
 
147 449
   
450
+  },
451
+
452
+
453
+// 点击表情
454
+  Expression:function(e){
455
+    var that = this;
456
+
457
+    var _news = that.data.news;
458
+    var _text = _news + e.currentTarget.dataset.id;
459
+
460
+
461
+    console.log(that.data.news) 
462
+    console.log(_text) 
463
+    that.setData({
464
+      news: _text,
465
+      inputValue: _text,
466
+    })
467
+
468
+    that.Sendoutswitch(that.data.news) // 发送键切换
469
+  },
470
+
471
+
472
+// 点击input
473
+  bindfocusclick: function(e) {
474
+    var that = this;
475
+   that.setData({
476
+     Expression: false,
477
+     menu: false,
478
+     KeyboardHeight: e.detail.height,
479
+   })
480
+    console.log(e.detail.height);
481
+  },
482
+
483
+  // 发送键切换
484
+  Sendoutswitch: function (data) {
485
+    var that = this;
486
+    if (data == '') {
487
+      that.setData({
488
+        menushow: true,   //菜单按钮显示隐藏
489
+        Sendoutshow: false,// 发送按钮显示隐藏
490
+        _width: 500,   // input宽度
491
+      })
492
+    } else {
493
+      that.setData({
494
+        menushow: false,   //菜单按钮显示隐藏
495
+        Sendoutshow: true,// 发送按钮显示隐藏
496
+        _width: 447,   // input宽度
497
+      })
498
+    }
499
+  },
500
+
501
+
502
+
148 503
 })

+ 59 - 40
pages/information/chat/chat.wxml

@@ -1,69 +1,72 @@
1 1
 
2
-<!-- <view class='HGJKHJKHJK'> -->
3
-<scroll-view class="history" scroll-y="true" scroll-with-animation  scroll-top="10000"   bindtap="resetInputStatus">
4
- 
2
+   <!-- scroll-top="{{scrollTopVal}}"
3
+    bindscrolltoupper="upper"
4
+    bindscrolltolower="lower"
5
+    bindscroll="scroll" -->
6
+    
7
+<scroll-view class="history"     scroll-top="{{scrollTopVal}}"    scroll-y="true" bindtap="resetInputStatus"  bindscrolltoupper="upper" >
8
+
5 9
           <!-- 自己 -->
6
-           <block  wx:if="{{messages || photo}}">  <!-- wx:for='{{home}}' wx:key="item" wx:for-index="id" -->
7
-                <view class='my_right c' >
8
-                          <text class='time'>下午 9:25</text>
10
+           <block  wx:for='{{Receive_news}}' wx:key="item">
11
+                <view class='my_right c' wx:if="{{item.isMy === true}}">
12
+                          <text class='time' wx:if="{{item.time}}">{{item.time}}</text>
9 13
                             <!-- 文字-->
10
-                          <view class='information' wx:if="{{messages}}">
14
+                          <view class='information' wx:if="{{item.type == 1}}">   
11 15
                                   <!--  加载 -->
12
-                                  <view class='m_state'>
16
+                                  <!-- <view class='m_state'>
13 17
                                          <image class='m_jz' src='/image/jz.png'></image>
14
-                                  </view>
18
+                                  </view> -->
15 19
                                    <!--  失败 -->
16
-                                  <view class='m_state' bindtap="retransmission">
20
+                                  <view class='m_state' bindtap="retransmission" wx:if="{{item.send == false}}">
17 21
                                            <image  class='m_jz' src='/image/send_fail.png' mode="aspectFill"></image>
18 22
                                   </view>
19 23
 
20
-                                  <text>{{messages}}</text>
24
+                                  <text>{{item.content}}</text>
21 25
 
22
-
23
-                                  <image  class='m_tx' src='/image/personal1.jpg' mode="aspectFill"></image>
26
+                                  <image  class='m_tx' src='{{myheadurl}}' mode="aspectFill"></image>
24 27
                                   
25
-                                
26 28
                           </view>
27 29
 
28 30
                           <!-- 图片 --> 
29
-                          <view class='m_img' wx:elif="{{photo}}">
31
+                          <view class='m_img' wx:if="{{item.type == 2}}">
30 32
                                   <!--  加载 -->
31
-                                  <view class='m_state'>
33
+                                  <!-- <view class='m_state'>
32 34
                                          <image class='m_jz' src='/image/jz.png'></image>
33
-                                  </view>
35
+                                  </view> -->
34 36
                                   <!--  失败 -->
35
-                                  <view class='m_state'> 
37
+                                  <view class='m_state' bindtap="retransmission"  wx:if="{{item.send == false}}"> 
36 38
                                            <image  class='m_jz' src='/image/send_fail.png' mode="aspectFill"></image>
37 39
                                   </view>
38 40
 
39
-                                    <image class='m_picture' src='{{photo}}' mode="aspectFill" data-src='/image/smyz2.png'  bindtap='enlarge'></image>
40
-                                    <image class='m_tx'  src='/image/personal1.jpg'></image>
41
+                                    <image class='m_picture' src='{{item.content}}' mode="aspectFill" data-src='{{item.content}}'  bindtap='enlarge'></image>
42
+                                    <image class='m_tx'  src='{{myheadurl}}'></image>
41 43
                           </view>
42 44
                 </view>
43
-          </block>
44 45
 
45
-         <!-- 他人 -->
46
-          <!-- <view class='my_left c'>
47
-                    <text class='l_time'>下午 9:25</text>
48
-                  
49
-                    <view class='l_information'>
50
-                            <image  class='l_tx' src='/image/personal1.jpg'></image>
51
-                            <text>阿萨德,啊实打实的,啊  ASD ASD</text>
52 46
 
53
-                    </view>
47
+              <!-- 他人 -->
48
+                <view class='my_left c' wx:if="{{item.isMy === false}}">
49
+                          <text class='l_time' wx:if="{{item.time}}">{{item.time}}</text>
50
+                        
51
+                          <view class='l_information' wx:if="{{item.type == 1}}">
52
+                                  <image  class='l_tx' src='{{headUrl}}'></image>
53
+                                  <text>{{item.content}}</text>
54 54
 
55
-                    
56
-                  <view class='l_img'>
57
-                              <image class='l_tx'  src='/image/personal1.jpg'></image>
58
-                              <image class='l_picture' src='/image/smyz2.png'  data-src='/image/smyz2.png'  mode="widthFix"  bindtap='enlarge'></image>
59
-                    </view> 
60
-          </view> -->
55
+                          </view>
56
+
57
+                          
58
+                        <view class='l_img' wx:if="{{item.type == 2}}">
59
+                                    <image class='l_tx'  src='{{headUrl}}'></image>
60
+                                    <image class='l_picture' src='{{item.content}}'  data-src='{{item.content}}'  mode="widthFix"  bindtap='enlarge'></image>
61
+                          </view> 
62
+                </view>
61 63
 
64
+        </block>
62 65
   
63 66
           <!-- <view style='height:148rpx'></view> -->
64 67
 
65 68
 </scroll-view>
66
-     <!-- </view> -->
69
+
67 70
 
68 71
 
69 72
 <!-- 功能栏 -->
@@ -71,25 +74,28 @@
71 74
           <view class='my_bottom c'>
72 75
                 
73 76
                  <!-- 表情 -->
74
-                 <image class='l_img' src='/image/bq1.png'></image>
77
+                 <image class='l_img' src='/image/bq1.png' catchtap="ExpressionClickEvent"></image>
75 78
                    
76 79
                    <!-- 输入框 -->
77
-                  <view class="textarea-wrp">
80
+                  <view class="textarea-wrp " style='width:{{_width}}rpx'>
78 81
                        <input  
79 82
                        type='text' 
80 83
                        value="{{inputValue}}" 
81 84
                        bindinput="Telephone" 
82 85
                        confirm-type="send" 
83
-                       cursor-spacing="20" 
86
+                       cursor-spacing="{{KeyboardHeight}}" 
84 87
                        adjust-position="true" 
85 88
                        bindconfirm="Sendout"
89
+                       bindfocus="bindfocusclick"
86 90
                        ></input>
87 91
                   </view>
88 92
 
89 93
                   <!-- 菜单 -->
90
-                  <view hover-class="press-style-opacity" catchtap="chatInputExtraClickEvent"  >
94
+                  <view hover-class="press-style-opacity" catchtap="chatInputExtraClickEvent"  wx:if="{{menushow}}">
91 95
                         <image class='r_img' src='/image/jh1.png'></image>
92 96
                  </view>
97
+                  <!-- 发送按钮 -->
98
+                 <view class='Send_out' wx:if="{{Sendoutshow}}"  bindtap="Sendout">发送</view>
93 99
           </view>
94 100
 
95 101
         <block wx:if="{{menu}}">
@@ -120,5 +126,18 @@
120 126
           </view> 
121 127
 
122 128
        </block>
129
+
130
+
131
+        <block wx:if="{{Expression}}">
132
+
133
+          <view  class="Expression_box  c">
134
+              <block wx:for='{{connectemojiO}}' wx:key="item">
135
+                  <view class='Expression_img' bindtap='Expression' data-id='{{item}}'>{{item}}</view>
136
+              </block>
137
+
138
+          </view> 
139
+
140
+       </block>
141
+
123 142
 </view>
124 143
 

+ 19 - 1
pages/information/chat/chat.wxss

@@ -47,7 +47,7 @@ page {background-color: #EDEDED; height: 100%;}
47 47
 
48 48
 
49 49
 
50
-.textarea-wrp{float:left;width:500rpx;background-color: #fff;margin-left:86rpx;height:80rpx;
50
+.textarea-wrp{float:left;background-color: #fff;margin-left:86rpx;height:80rpx;
51 51
     padding:0 20rpx;border-radius:6rpx;
52 52
     display: flex;
53 53
     align-items: center; 
@@ -55,6 +55,8 @@ page {background-color: #EDEDED; height: 100%;}
55 55
     flex-direction: column;
56 56
 }
57 57
 
58
+
59
+
58 60
 .textarea-wrp input{
59 61
     font-size:30rpx;
60 62
     width:100%; 
@@ -94,3 +96,19 @@ page {background-color: #EDEDED; height: 100%;}
94 96
     margin-top: 10rpx
95 97
 }
96 98
 
99
+.Expression_box{    
100
+    margin-top:25rpx;
101
+    background-color: rgba(246, 246, 246, 0.98);
102
+    border-top:1px solid #EEE;
103
+    padding:0 40rpx;
104
+    }
105
+.Expression_img{
106
+float:left;
107
+margin-top:40rpx;
108
+margin-right:26rpx;
109
+
110
+}
111
+
112
+.Expression_box  .Expression_img:nth-child(10n){margin-right:0;}
113
+
114
+.Send_out{background:#4fa2f3;float:right;font-size:31rpx;color:#FFF;height:80rpx;width:120rpx;text-align:center;line-height:80rpx;border-radius:10rpx;}