浏览代码

群聊话题

zhaoxiaohai 3 年之前
父节点
当前提交
9c007ddb06

+ 0 - 1
app.json

@@ -48,7 +48,6 @@
         "pages/storeMessage/editor/editor",
         "pages/webView/index",
         "pages/teamManagement/applyFor",
-        "pages/instantMessaging/index",
         "pages/annunciate/index",
         "pages/annunciate/newAndChange",
         "pages/annunciate/details",

+ 1 - 1
components/My_TwoDimensionalCode/base64src.js

@@ -1,5 +1,5 @@
 const fsm = wx.getFileSystemManager();
-const FILE_BASE_NAME = 'file_base64src'; //自定义文件名
+const FILE_BASE_NAME = 'buwanjia'; //自定义文件名
 
 function base64src(base64data, cb) {
     const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || [];

+ 55 - 0
pages/chatRoom/GambitMsgBubble/index.js

@@ -0,0 +1,55 @@
+// pages/chatRoom/GambitMsgBubble/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        //数据
+        itemData: {
+            type: Object
+        },
+        //创建者id
+        role: {
+            type: Boolean
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {},
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        change() {
+            this.setData({
+                role: !this.data.role
+            })
+        },
+        //浏览图片
+        preViewImage(e) {
+            console.log(e)
+            const {
+                type,
+                url
+            } = e.target.dataset;
+            if (type == "emoji") return;
+            let urls = [];
+            urls.push(url)
+            wx.previewImage({
+                urls: urls,
+            })
+        },
+        //去查看统计
+        toStats(e) {
+            const {
+                type
+            } = e.target.dataset;
+            if (type != undefined) wx.navigateTo({
+                url: '/pages/chatRoom/stats?type=' + type + '&timsubjectid=' + this.data.itemData.timsubjectid + '&timdialogid=' + this.data.itemData.timdialogid,
+            })
+        },
+    }
+})

+ 4 - 0
pages/chatRoom/GambitMsgBubble/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 47 - 0
pages/chatRoom/GambitMsgBubble/index.wxml

@@ -0,0 +1,47 @@
+<view class="gambit-msg {{role?'r':'l'}}">
+    <!-- 头像 -->
+    <image class="user-img" wx:if="{{itemData.sendfrom.headpic!=''}}" src="{{itemData.sendfrom.headpic}}" />
+    <image class="user-img" wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png" />
+    <!-- 内容盒子 -->
+    <view class="contents-box">
+        <block wx:for="{{itemData.imsubjectcontent}}" wx:key="index">
+            <view class="msg-bubble">{{item.fcontent}}</view>
+            <view class="msg-file" wx:if="{{item.attinfos.length>=1}}" wx:for="{{item.attinfos}}" wx:for-index="i" wx:for-item="it" wx:key="i">
+                <image class="{{it.ftype=='emoji'?'emoji':'image'}}" data-type="{{it.ftype}}" data-url="{{it.fobsurl}}" catchtap="preViewImage" src="{{it.fobsurl}}" mode="widthFix" />
+            </view>
+        </block>
+        <block wx:if="{{role}}">
+            <view class="hr"></view>
+            <view class="bottom" bindtap="toStats">
+                <text data-type='回复'>查看回复详情</text>
+                <text data-type='已读' style="margin-left: 40rpx;">查看已读/未读详情</text>
+            </view>
+        </block>
+        <view class="time">
+            {{itemData.closedate}}
+        </view>
+    </view>
+    <!-- 透明度为0,结构和上方一直 用来撑盒子高度 -->
+    <view class="contents-box" style="position: relative; left: 0; opacity: 0; pointer-events: none;">
+        <block wx:for="{{itemData.imsubjectcontent}}" wx:key="index">
+            <view class="msg-bubble">{{item.fcontent}}</view>
+            <view class="msg-file" wx:if="{{item.attinfos.length>=1}}" wx:for="{{item.attinfos}}" wx:for-index="i" wx:for-item="it" wx:key="i">
+                <image class="{{it.ftype=='emoji'?'emoji':'image'}}" data-type="{{it.ftype}}" data-url="{{it.fobsurl}}" catchtap="preViewImage" src="{{it.fobsurl}}" mode="widthFix" />
+            </view>
+        </block>
+        <block wx:if="{{role}}">
+            <view class="hr"></view>
+            <view class="bottom" bindtap="toStats">
+                <text data-type='回复'>查看回复详情</text>
+                <text data-type='已读' style="margin-left: 40rpx;">查看已读/未读详情</text>
+            </view>
+        </block>
+        <view class="time">
+            {{itemData.closedate}}
+        </view>
+    </view>
+</view>
+<!-- 
+<button style="margin-top: 84rpx;" bindtap="change">
+    切换
+</button> -->

+ 124 - 0
pages/chatRoom/GambitMsgBubble/index.wxss

@@ -0,0 +1,124 @@
+.gambit-msg {
+    position: relative;
+    width: 100vw;
+    margin-top: 34rpx;
+    margin-bottom: 74rpx;
+}
+
+/* l为左对齐 r为右对齐 */
+/* 用户头像 */
+.user-img {
+    position: absolute;
+    width: 70rpx;
+    height: 70rpx;
+    top: 6rpx;
+    border-radius: 50%;
+}
+
+.l .user-img {
+    left: 30rpx;
+}
+
+.r .user-img {
+    right: 30rpx;
+}
+
+/* 话题内容盒子 */
+.contents-box {
+    display: flex;
+    flex-direction: column;
+    position: absolute;
+    width: 570rpx;
+    background: #F6F7F8;
+    border-radius: 10rpx;
+    padding: 20rpx;
+    padding-bottom: 0;
+    box-sizing: border-box;
+    top: 0;
+}
+
+.l .contents-box {
+    align-items: flex-start;
+    left: 120rpx;
+}
+
+.r .contents-box {
+    align-items: flex-end;
+    right: 120rpx;
+}
+
+/* 信息气泡样式 */
+.msg-bubble {
+    border-radius: 10rpx;
+    font-size: 28rpx;
+    background-color: #FFFFFF;
+    padding: 20rpx;
+    box-sizing: border-box;
+    margin-bottom: 20rpx;
+}
+
+.l .msg-bubble {
+    background-color: #FFFFFF;
+    color: #000000;
+}
+
+.r .msg-bubble {
+    background-color: #4BBECF;
+    color: #FFFFFF;
+}
+
+/* 附件信息 */
+.msg-file {
+    padding: 6rpx;
+    border-radius: 10rpx;
+    margin-bottom: 20rpx;
+    padding-bottom: 0;
+}
+
+.r .msg-file {
+    align-items: flex-end;
+}
+
+
+.msg-file .image {
+    width: 168px;
+    border-radius: 10rpx;
+}
+
+.msg-file .emoji {
+    width: 50rpx;
+}
+
+/* 分割线 */
+.hr {
+    height: 2rpx;
+    width: 100%;
+    background: rgba(147, 147, 147, .1);
+    padding-left: -10rpx;
+}
+
+.bottom {
+    width: 100vw;
+    height: 34rpx;
+    line-height: 34rpx;
+    font-size: 24rpx;
+    color: rgba(0, 0, 0, .3);
+    margin-top: 18rpx;
+    margin-bottom: 20rpx;
+    text-decoration: underline;
+}
+
+.r .bottom {
+    text-align: right;
+}
+
+.contents-box .time {
+    position: absolute;
+    height: 34rpx;
+    line-height: 34rpx;
+    font-size: 24rpx;
+    color: #000000;
+    right: 20rpx;
+    bottom: -40rpx;
+    opacity: .39;
+}

+ 278 - 111
pages/chatRoom/dialogbox.js

@@ -23,11 +23,12 @@ Page({
         unreadCount: 0, //对方发送未读信息
         joinHands: false, //是否显示合作按钮
         ownerid: 0, //供需id
-        fimdialogtype: '话题', //对话框类型
+        fimdialogtype: '', //对话框类型
         fimuserid: 0, //创建者id
         timsubjectid: 0, //话题id
+        timdialogid: 0, //对话框id
+        gambitList: [], //话题列表
     },
-
     /**
      * 生命周期函数--监听页面加载
      */
@@ -55,6 +56,7 @@ Page({
             let title = res.data[0].fimdialogname.split('-'),
                 headerTitle = (title[0] == res.data[0].fname) ? title[1] : title[0],
                 joinHands = false;
+            //供需类型对话框,判断对话框ID是否为当前账号,当前账号更改供需状态,非当前账号显示合作按钮
             if (res.data[0].fimdialogtype == '供需') {
                 if (res.data[0].fimuserid == this.data.userid) {
                     _Http.basic({
@@ -73,17 +75,43 @@ Page({
                     joinHands = true
                 }
             }
+            //返回数据
             this.setData({
                 headerTitle,
                 ownerid: res.data[0].ownerid,
                 initiator: res.data[0].fimuserid,
                 joinHands,
-                fimdialogtype: res.data[0].fimdialogtype,
-                fimuserid: res.data[0].fimuserid
+                fimuserid: res.data[0].fimuserid,
+                fimdialogtype: res.data[0].fimdialogtype
             })
+            //判断是否为话题类型对话框
+            if (res.data[0].fimdialogtype == '话题') {
+                _Http.basic({
+                    "accesstoken": wx.getStorageSync('userData').token,
+                    "classname": "system.im.imdialog.imdialog",
+                    "method": "queryDialogUncloseSubject",
+                    "content": {
+                        "timdialogid": res.data[0].timdialogid
+                    }
+                }, false).then(s => {
+                    if (s.msg != '成功') return wx.showToast({
+                        title: res.data,
+                        icon: "none"
+                    });
+                    if (s.data != '成功') {
+                        this.setData({
+                            timsubjectid: s.data[0].timsubjectid
+                        })
+                        this.endGambit(true) //存在未关闭话题,调用关闭话题,并在关闭后重新获取历史话题
+                    } else {
+                        this.query_imdialogMessage(); //不存在未关闭话题,直接获取历史话题
+                    }
+                })
+            } else {
+                this.query_imdialogMessage(); //非话题类型对话框,直接获取历史记录
+            }
         })
-        //群历史信息
-        this.query_imdialogMessage();
+        //判断是否存在安全距离
         let iosX = (getApp().globalData.safeAreaBottom == 0) ? false : true;
         this.setData({
             iosX
@@ -91,12 +119,11 @@ Page({
         //获取表情包
         this.getMeme()
     },
-    /* 创建话题 */
+    /* 创建话题,回复话题 */
     createGambit(e) {
         const {
             type
         } = e.currentTarget.dataset;
-        console.log(type)
         if (type == '发起会话') {
             _Http.basic({
                 "accesstoken": wx.getStorageSync('userData').token,
@@ -113,8 +140,24 @@ Page({
                     title: res.data,
                     icon: "none"
                 })
+                let gambitList = this.data.gambitList;
+                gambitList.push(res.data[0]);
                 this.setData({
-                    timsubjectid: res.data[0].timsubjectid
+                    timsubjectid: res.data[0].timsubjectid,
+                    gambitList
+                })
+                app.globalData.SocketTask.send({
+                    data: JSON.stringify({
+                        "classname": "message.message",
+                        "method": "sendDataMessage",
+                        "content": {
+                            "timdialogid": this.data.timdialogid,
+                            "ownertable": "timsubject",
+                            "ownerid": this.data.timsubjectid,
+                            "ftype": "话题",
+                        }
+                    }),
+                    success(res) {}
                 })
             })
         } else {
@@ -144,36 +187,121 @@ Page({
             })
         }
     },
-    /* 确认合作 */
-    confirmTheCooperation() {
+    /* 结束话题 */
+    endGambit(isGetList) {
         _Http.basic({
             "accesstoken": wx.getStorageSync('userData').token,
-            "classname": "customer.supplyanddemand.supplyanddemand",
-            "method": "updatesupplyanddemandstatus",
+            "classname": "system.im.imdialog.imdialog",
+            "method": "closeSubject",
             "content": {
-                "tsupplyanddemandid": this.data.ownerid,
-                "fstatus": "已解决",
-                "tenterprise_userid": this.data.initiator,
+                "timsubjectid": this.data.timsubjectid,
                 "timdialogid": this.data.timdialogid
             }
         }).then(res => {
-            console.log("确认合作", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            this.setData({
+                timsubjectid: 0
+            })
+            if (isGetList) this.query_imdialogMessage();
         })
     },
-    /* 拒绝合作 */
-    refuseToCooperate() {
-        _Http.basic({
-            "accesstoken": wx.getStorageSync('userData').token,
-            "classname": "customer.supplyanddemand.supplyanddemand",
-            "method": "updatesupplyanddemandstatus",
-            "content": {
-                "tsupplyanddemandid": this.data.ownerid,
-                "fstatus": "待对接",
-                "timdialogid": this.data.timdialogid
+    /* 发送信息 */
+    sendMsg(type, data) {
+        const content = this.data.sendText.trim(),
+            that = this;
+        if (this.data.fimdialogtype == '话题') {
+            if (type === 'file') {
+                console.log("附件类型", data)
+                let list = this.data.gambitList[this.data.gambitList.length - 1].imsubjectcontent;
+                _Http.basic({
+                    "accesstoken": wx.getStorageSync('userData').token,
+                    "classname": "system.system.docManage",
+                    "method": "changeFilesData",
+                    "content": {
+                        "files": [{
+                            "tattachmentid": data[0].tattachmentid,
+                            "fdocument": data[0].fdocument,
+                            "ownertable": "timsubjectcontent",
+                            "ownerid": list[list.length - 1].timsubjectcontenid,
+                            "ftype": data[0].ftype
+                        }]
+                    }
+                }).then(async s => {
+                    console.log("附件位置修改", s)
+
+                    let id = [{
+                            message: {
+                                data: {
+                                    ownerid: this.data.timsubjectid
+                                }
+                            }
+                        }],
+                        item = await this.querySubject(id)
+                    list = this.data.gambitList;
+                    list[list.length - 1] = {};
+                    this.setData({
+                        gambitList: list
+                    })
+                    list[list.length - 1] = item[0];
+                    console.log(item[0])
+                    this.setData({
+                        gambitList: list
+                    })
+                })
+            } else {
+                _Http.basic({
+                    "accesstoken": wx.getStorageSync('userData').token,
+                    "classname": "system.im.imdialog.imdialog",
+                    "method": "createSubject",
+                    "content": {
+                        "timdialogid": this.data.timdialogid,
+                        "timsubjectid": this.data.timsubjectid,
+                        "fcontent": content
+                    }
+                }).then(res => {
+                    let list = this.data.gambitList;
+                    list[list.length - 1] = res.data[0];
+                    console.log(res.data[0])
+                    this.setData({
+                        gambitList: list
+                    })
+                })
             }
-        }).then(res => {
-            console.log("拒绝合作", res)
-        })
+        } else {
+            if (type === 'file') {
+                app.globalData.SocketTask.send({
+                    data: JSON.stringify({
+                        "classname": "message.message",
+                        "method": "sendFileMessage",
+                        "content": {
+                            "timdialogid": this.data.timdialogid,
+                            "tattachmentid": data[0].tattachmentid
+                        }
+                    }),
+                    success(res) {}
+                })
+            } else {
+                if (content == '') return;
+                app.globalData.SocketTask.send({
+                    data: JSON.stringify({
+                        "classname": "message.message",
+                        "method": "sendTextMessage",
+                        "content": {
+                            "timdialogid": that.data.timdialogid,
+                            "fmessage": content
+                        }
+                    }),
+                    success(res) {
+                        that.setData({
+                            sendText: ''
+                        })
+                    }
+                })
+            }
+        }
     },
     //历史信息查询
     query_imdialogMessage() {
@@ -186,37 +314,85 @@ Page({
                 "pageSize": 20,
                 "timdialogid": this.data.timdialogid
             }
-        }, false).then(res => {
+        }, false).then(async res => {
+            console.log("聊天记录", res)
             if (res.msg != '成功') return wx.showToast({
                 title: res.data,
                 icon: "none"
-            })
+            });
+            let list = res.data;
+            list = list.reverse();
             if (res.pageNumber != 1) {
-                let list = res.data;
-                list = list.reverse();
-                list = list.concat(this.data.socketMsgQueue);
-                this.setData({
-                    socketMsgQueue: list,
-                    toView: `item${res.data.length - 1}`,
-                    triggered: false
-                })
+                if (this.data.fimdialogtype != '话题') {
+                    list = list.concat(this.data.socketMsgQueue);
+                    this.setData({
+                        socketMsgQueue: list,
+                        toView: `item${res.data.length - 1}`,
+                        triggered: false
+                    })
+                } else {
+                    let gambitList = await this.querySubject(list);
+                    list = gambitList.concat(this.data.gambitList);
+                    this.setData({
+                        gambitList: list,
+                        toView: `item${res.data.length - 1}`,
+                        triggered: false
+                    })
+                }
             } else {
-                let list = res.data;
-                list = list.reverse();
-                this.setData({
-                    socketMsgQueue: list,
-                    toView: `item${res.data.length - 1}`,
-                    pageTotal: res.pageTotal
-                })
+                if (this.data.fimdialogtype != '话题') {
+                    this.setData({
+                        socketMsgQueue: list,
+                        toView: `item${res.data.length - 1}`,
+                        pageTotal: res.pageTotal
+                    })
+                } else {
+                    let gambitList = await this.querySubject(list);
+                    this.setData({
+                        gambitList,
+                        toView: `item${res.data.length - 1}`,
+                        pageTotal: res.pageTotal
+                    })
+                }
                 setTimeout(() => {
                     this.setData({
                         toView: 'bottom'
                     })
                 }, 500)
             }
-
         })
     },
+    /* 根据话题ID查询详情 */
+    async querySubject(array) {
+        let list = [];
+        for (let index = 0; index < array.length; index++) {
+            await _Http.basic({
+                "accesstoken": wx.getStorageSync('userData').token,
+                "classname": "system.im.imdialog.imdialog",
+                "method": "querySubject",
+                "content": {
+                    "timsubjectid": array[index].message.data.ownerid
+                }
+            }, false).then(res => {
+                if (res.data[0].imsubjectcontent.length != 0) {
+                    res.data[0].sendfrom = array[index].message.sendfrom;
+                    res.data[0].timdialogid = array[index].message.timdialogid;
+                    if (res.data[0].closedate != null) {
+                        let time = res.data[0].closedate.split('.');
+                        res.data[0].closedate = time[0];
+                        list.push(res.data[0]);
+                    } else {
+                        let time = res.data[0].createdate.split('.');
+                        res.data[0].createdate = time[0];
+                        list.push(res.data[0]);
+                    }
+                }
+            })
+        }
+        console.log("群聊话题详情", list);
+        return list;
+    },
+    /* 加载分页 */
     scrolltoupper() {
         if (this.data.pageNumber < this.data.pageTotal) {
             this.setData({
@@ -240,80 +416,58 @@ Page({
             keyboardHeight: height
         })
     },
+    /* 确认合作 */
+    confirmTheCooperation() {
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "updatesupplyanddemandstatus",
+            "content": {
+                "tsupplyanddemandid": this.data.ownerid,
+                "fstatus": "已解决",
+                "tenterprise_userid": this.data.initiator,
+                "timdialogid": this.data.timdialogid
+            }
+        }).then(res => {
+            console.log("确认合作", res)
+        })
+    },
+    /* 拒绝合作 */
+    refuseToCooperate() {
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.supplyanddemand.supplyanddemand",
+            "method": "updatesupplyanddemandstatus",
+            "content": {
+                "tsupplyanddemandid": this.data.ownerid,
+                "fstatus": "待对接",
+                "timdialogid": this.data.timdialogid
+            }
+        }).then(res => {
+            console.log("拒绝合作", res)
+        })
+    },
     /* 输入框数据绑定 */
     sendInput(e) {
         this.setData({
             sendText: e.detail.value
         })
     },
-    /* 发送信息 */
-    sendMsg(type, data) {
-        const content = this.data.sendText.trim(),
-            that = this;
-        if (type === 'file') {
-            if (this.data.fimdialogtype != '话题') {
-                app.globalData.SocketTask.send({
-                    data: JSON.stringify({
-                        "classname": "message.message",
-                        "method": "sendFileMessage",
-                        "content": {
-                            "timdialogid": this.data.timdialogid,
-                            "tattachmentid": data[0].tattachmentid
-                        }
-                    }),
-                    success(res) {}
-                })
-            } else {
-                app.globalData.SocketTask.send({
-                    data: JSON.stringify({
-                        "classname": "message.message",
-                        "method": "sendDataMessage",
-                        "content": {
-                            "timdialogid": this.data.timdialogid,
-                            "ownertable": "timsubject",
-                            "ownerid": this.data.timsubjectid,
-                            "ftype": "话题"
-                        }
-                    }),
-                    success(res) {}
-                })
-            }
-        } else {
-            if (content == '') return;
-            if (this.data.fimdialogtype != '话题') {
-                app.globalData.SocketTask.send({
-                    data: JSON.stringify({
-                        "classname": "message.message",
-                        "method": "sendTextMessage",
-                        "content": {
-                            "timdialogid": that.data.timdialogid,
-                            "fmessage": content
-                        }
-                    }),
-                    success(res) {
-                        that.setData({
-                            sendText: ''
-                        })
-                    }
+    /* 发送表情 */
+    sendMeme(e) {
+        if (this.data.fimdialogtype == '话题') {
+            if (this.data.timsubjectid == 0 || this.data.userid != this.data.fimuserid) {
+                return wx.showToast({
+                    title: '当前状态不可发送',
+                    icon: "none"
                 })
             } else {
-                app.globalData.SocketTask.send({
-                    data: JSON.stringify({
-                        "classname": "message.message",
-                        "method": "sendDataMessage",
-                        "content": {
-                            "timdialogid": this.data.timdialogid,
-                            "ownertable": "timsubject",
-                            "ownerid": this.data.timsubjectid,
-                            "ftype": "话题"
-                        }
-                    }),
-                    success(res) {}
+                if (this.data.gambitList[this.data.gambitList.length - 1].imsubjectcontent.length < 1) return wx.showToast({
+                    title: '当前状态不可发送',
+                    icon: "none"
                 })
             }
         }
-    },
-    sendMeme(e) {
         const {
             item
         } = e.currentTarget.dataset;
@@ -409,6 +563,19 @@ Page({
     afterRead({
         file
     }) {
+        if (this.data.fimdialogtype == '话题') {
+            if (this.data.timsubjectid == 0 || this.data.userid != this.data.fimuserid) {
+                return wx.showToast({
+                    title: '当前状态不可发送',
+                    icon: "none"
+                })
+            } else {
+                if (this.data.gambitList[this.data.gambitList.length - 1].imsubjectcontent.length < 1) return wx.showToast({
+                    title: '当前状态不可发送',
+                    icon: "none"
+                })
+            }
+        }
         var that = this
         var index = file.lastIndexOf(".");
         var ext = file.substr(index + 1);

+ 2 - 1
pages/chatRoom/dialogbox.json

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
-    "MsgBubble": "./MsgBubble/index"
+    "MsgBubble": "./MsgBubble/index",
+    "GambitMsgBubble": "./GambitMsgBubble/index"
   }
 }

+ 15 - 7
pages/chatRoom/dialogbox.wxml

@@ -6,7 +6,7 @@
         <van-button custom-class='head-bot-class head-bot-r' catchtap="confirmTheCooperation">确认合作</van-button>
     </view>
     <view class="header_botton" wx:if="{{fimdialogtype=='话题'}}">
-        <van-button custom-class='compile' catchtap="refuseToCooperate">
+        <van-button custom-class='compile' catchtap="a54564">
             <image src="/static/icon-19.png" style="width: 16rpx;height: 20rpx;"></image>
             编辑
         </van-button>
@@ -16,17 +16,25 @@
 <scroll-view class="chatFrame" refresher-default-style='none' refresher-enabled bindrefresherrefresh='scrolltoupper' refresher-triggered='{{triggered}}' scroll-y scroll-into-view="{{toView}}">
     <view style="height: 110rpx;"></view>
     <!-- 个人聊天 -->
-    <MsgBubble wx:for="{{socketMsgQueue}}" wx:key="index" id="item{{index}}" type='{{item.message.ftype}}' fobsurl='{{item.message.data[0].fobsurl}}' role="{{userid==item.message.sendfrom.userid?'my':'you'}}" userImg='{{item.message.sendfrom.headpic}}' content='{{item.message.data.fcontent}}' time='{{item.message.fdatetime}}' />
+    <MsgBubble wx:if="{{fimdialogtype!='话题'}}" wx:for="{{socketMsgQueue}}" wx:key="index" id="item{{index}}" type='{{item.message.ftype}}' fobsurl='{{item.message.data[0].fobsurl}}' role="{{userid==item.message.sendfrom.userid?'my':'you'}}" userImg='{{item.message.sendfrom.headpic}}' content='{{item.message.data.fcontent}}' time='{{item.message.fdatetime}}' />
+    <!-- 群聊聊天 -->
+    <GambitMsgBubble wx:if="{{fimdialogtype=='话题'}}" wx:for="{{gambitList}}" wx:if="{{item.imsubjectcontent.length!=0}}" itemData='{{item}}' wx:key="index" id="item{{index}}" fimuserid='{{fimuserid}}' role="{{userid==fimuserid?true:false}}" />
     <view style="height: {{keyboardHeight}}px;"></view>
     <view id="bottom" style="height: {{iosX?'102':'85'}}px;"></view>
 </scroll-view>
 <!-- 底部输入 -->
 <view class="input-box" style="bottom:{{keyboardHeight}}px;">
-    <!-- {{lineCount>1?'multi-row':''}} -->
-    <textarea class="input-text" bindfocus="textareaFocus" adjust-position='{{false}}' bindconfirm='sendMsg' show-confirm-bar='{{false}}' confirm-type='send' confirm-hold='true' cursor-spacing='45' bindinput='sendInput' value='{{sendText}}' maxlength='-1' fixed='true' type="text" bindlinechange='linechange' bindkeyboardheightchange='keyboardheightchange'>
-    <view class="gambit" wx:if="{{fimdialogtype=='话题'&&timsubjectid==0}}" catchtap="createGambit" data-type="{{fimuserid==userid?'发起会话':'回复'}}">
-        {{fimuserid==userid?'发起会话':'回复'}}
-    </view>
+    <!-- 普通输入框 -->
+    <textarea class="input-text" bindfocus="textareaFocus" bindblur="sendMsg" adjust-position='{{false}}' bindconfirm='sendMsg' show-confirm-bar='{{false}}' confirm-type='send' confirm-hold='true' cursor-spacing='45' bindinput='sendInput' value='{{sendText}}' maxlength='-1' fixed='true' type="text" bindlinechange='linechange' bindkeyboardheightchange='keyboardheightchange'>
+    <!-- 话题 -->
+    <block wx:if="{{fimdialogtype=='话题'}}">
+        <view class="gambit" wx:if="{{timsubjectid==0&&fimuserid==userid}}" catchtap="createGambit" data-type="{{fimuserid==userid?'发起会话':'回复'}}">
+            {{fimuserid==userid?'发起会话':'回复'}}
+        </view>
+        <navigator url='#' class="gambit-end" catchtap="endGambit" wx:else>
+            <image src="/static/icon-20.png" mode="aspectFill"></image>
+        </navigator>
+    </block>
     </textarea>
     <view class="functionalZone" catchtap="selectionFunction">
         <image data-name='表情' mode="heightFix" src="/static/chatRoom/icon-01.png" />

+ 20 - 0
pages/chatRoom/dialogbox.wxss

@@ -160,4 +160,24 @@ page {
     z-index: 9999999999999;
     font-size: 24rpx;
     color: rgba(0, 0, 0, 0.5);
+}
+
+.gambit-end {
+    position: absolute;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 126rpx;
+    height: 52rpx;
+    background: #4BBECF;
+    box-shadow: 0px 2rpx 4rpx 0px rgba(0, 0, 0, 0.15);
+    border-radius: 32rpx;
+    top: 6rpx;
+    right: 6rpx;
+}
+
+.gambit-end image {
+    width: 34rpx;
+    height: 36rpx;
+    z-index: 999999999;
 }

+ 59 - 5
pages/chatRoom/stats.js

@@ -1,4 +1,7 @@
-// pages/chatRoom/stats.js
+import {
+    ApiModel
+} from "../../utils/api";
+const _Http = new ApiModel();
 Page({
 
     /**
@@ -6,21 +9,72 @@ Page({
      */
     data: {
         tabsList: ['已读', '未读', '回复'],
-        tabsSelect: "已读"
+        tabsSelect: "已读",
+        list: {},
+        showList: [], //显示列表
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "system.im.imdialog.imdialog",
+            "method": "querySubjectAnalysis",
+            "content": {
+                "timsubjectid": options.timsubjectid,
+                "timdialogid": options.timdialogid
+            }
+        }).then(res => {
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            })
+            this.setData({
+                list: res.data
+            })
+            this.tabsChange(options.type);
+        })
     },
     tabsCallBack({
         detail
     }) {
-        this.setData({tabsSelect:detail})
+        if (this.data.tabsSelect == detail) return;
+        this.tabsChange(detail);
+        this.setData({
+            tabsSelect: detail
+        })
+    },
+    tabsChange(value) {
+        let showList = [],
+            list = this.data.list;
+        switch (value) {
+            case "已读":
+                showList = list.readlist
+                break;
+            case "未读":
+                showList = list.unreadlist
+                break;
+            case "回复":
+                showList = list.answerlist
+                break;
+            default:
+                showList = list.unanswerlist
+                break;
+        };
+        for (let i = 0; i < showList.length; i++) {
+            if (typeof (showList[i].ffirstreadtime) != undefined && showList[i].ffirstreadtime != null) {
+                let time = showList[i].ffirstreadtime.split('.');
+                showList[i].ffirstreadtime = time[0];
+            } else {
+                showList[i].ffirstreadtime = ''
+            }
+        }
+        this.setData({
+            showList
+        })
     },
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 5 - 4
pages/chatRoom/stats.wxml

@@ -7,10 +7,11 @@
             合计{{tabsSelect}}:
         </view>
         <view class="list">
-            <view class="item" wx:for="{{30}}">
-                <image src="/static/changeImg.png"></image>
-                <text class="u-line-1">花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1花旗1</text>
-                20:35:45
+            <view class="item" wx:for="{{showList}}">
+                <image wx:if="{{item.headportraiturl}}" src="{{item.headportraiturl}}"></image>
+                <image wx:else src="https://bwj.obs.cn-east-2.myhuaweicloud.com/resources/WeChat/userCenter/userImg.png"></image>
+                <text class="u-line-1">{{item.fname}}</text>
+                {{item.ffirstreadtime}}
             </view>
         </view>
     </view>

+ 1 - 0
pages/chatRoom/stats.wxss

@@ -55,6 +55,7 @@ page {
     height: 70rpx;
     border-radius: 50%;
     margin-right: 20rpx;
+    flex-shrink: 0;
 }
 
 .list .item text {

+ 0 - 66
pages/instantMessaging/index.js

@@ -1,66 +0,0 @@
-// pages/instantMessaging/index.js
-Page({
-
-    /**
-     * 页面的初始数据
-     */
-    data: {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
-
-    },
-
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
-
-    },
-
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
-
-    },
-
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
-
-    },
-
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
-
-    }
-})

+ 0 - 3
pages/instantMessaging/index.json

@@ -1,3 +0,0 @@
-{
-  "usingComponents": {}
-}

+ 0 - 13
pages/instantMessaging/index.wxml

@@ -1,13 +0,0 @@
-<navigator class="msg-item-box" wx:for="{{5}}">
-    <view class="userImage">
-        <image src="/static/tacitly-approve/MRuserImg.png" mode="aspectFill"></image>
-    </view>
-    <view class="userText">
-        <view class="userText-name u-line-1">王梅</view>
-        <view class="userText-msg u-line-1">你好你好你好你好你好你好你好你好你好你好你好你好</view>
-    </view>
-    <view class="statistics">
-        <view class="msg-time">上午9:34</view>
-        <view class="msg-count">19</view>
-    </view>
-</navigator>

+ 0 - 83
pages/instantMessaging/index.wxss

@@ -1,83 +0,0 @@
-page {
-    background-color: #ffffff;
-}
-
-/* 信息框 */
-.msg-item-box {
-    display: flex;
-    align-items: center;
-    width: 100%;
-    height: 160rpx;
-    padding: 0 24rpx 0 30rpx;
-    box-sizing: border-box;
-}
-
-/* 用户头像 */
-.userImage {
-    width: 100rpx;
-    height: 100rpx;
-    overflow: hidden;
-    flex-shrink: 0;
-}
-
-.userImage>image {
-    width: 100%;
-    height: 100%;
-}
-
-/* 用户文字 */
-.userText {
-    flex: 1;
-    height: 100rpx;
-    margin-left: 30rpx;
-}
-
-
-.userText-name {
-    width: 430rpx;
-    height: 44rpx;
-    font-size: 32rpx;
-    color: #000000;
-    line-height: 44rpx;
-}
-
-.userText-msg {
-    width: 430rpx;
-    height: 40rpx;
-    font-size: 28rpx;
-    color: rgba(0, 0, 0, .4);
-    line-height: 40rpx;
-    margin-top: 8rpx;
-}
-
-/* 信息数据统计 */
-.statistics {
-    display: flex;
-    flex-direction: column;
-    align-items: flex-end;
-    height: 100rpx;
-    width: 120rpx;
-    flex-shrink: 0px;
-}
-
-.msg-time {
-    height: 34rpx;
-    font-size: 24rpx;
-    color: rgba(0, 0, 0, .4);
-    line-height: 34rpx;
-    margin-top: 8rpx;
-}
-
-.msg-count {
-    height: 30rpx;
-    text-align: center;
-    line-height: 30rpx;
-    background-color: #4DC2D4;
-    border-radius:15rpx;
-
-    font-size: 20rpx;
-    font-family: PingFangSC-Medium, PingFang SC;
-    color: #FFFFFF;
-    margin-top: 18rpx;
-    padding: 0 10rpx;
-}

+ 3 - 0
pages/storeMessage/select.js

@@ -34,6 +34,7 @@ Page({
         } else {
             wx.scanCode({
                 success(res) {
+                    console.log("扫码", res)
                     if (res.errMsg != 'scanCode:ok') return wx.showToast({
                         title: '扫码失败',
                     });
@@ -42,8 +43,10 @@ Page({
                     });
                 },
                 fail(err) {
+                    console.log("扫码失败", err)
                     wx.showToast({
                         title: '扫码失败',
+                        icon: "error"
                     });
                 }
             })

+ 9 - 9
project.private.config.json

@@ -138,13 +138,6 @@
                     "query": "",
                     "scene": null
                 },
-                {
-                    "name": "信息列表",
-                    "pathName": "pages/instantMessaging/index",
-                    "query": "",
-                    "launchMode": "default",
-                    "scene": null
-                },
                 {
                     "name": "",
                     "pathName": "pages/webView/index",
@@ -254,8 +247,15 @@
                     "name": "群聊数据统计",
                     "pathName": "pages/chatRoom/stats",
                     "query": "",
-                    "scene": null,
-                    "launchMode": "default"
+                    "launchMode": "default",
+                    "scene": null
+                },
+                {
+                    "name": "",
+                    "pathName": "pages/teamManagement/applyFor",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
                 }
             ]
         }

二进制
static/icon-20.png