|
|
@@ -28,6 +28,7 @@ Page({
|
|
|
timsubjectid: 0, //话题id
|
|
|
timdialogid: 0, //对话框id
|
|
|
gambitList: [], //话题列表
|
|
|
+ sendfrom: [],
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
@@ -135,7 +136,6 @@ Page({
|
|
|
"fcontent": ""
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
if (res.msg != '成功') return wx.showToast({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
@@ -157,7 +157,9 @@ Page({
|
|
|
"ftype": "话题",
|
|
|
}
|
|
|
}),
|
|
|
- success(res) {}
|
|
|
+ success(res) {
|
|
|
+ console.log("sddf", res)
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
} else {
|
|
|
@@ -231,7 +233,6 @@ Page({
|
|
|
}
|
|
|
}).then(async s => {
|
|
|
console.log("附件位置修改", s)
|
|
|
-
|
|
|
let id = [{
|
|
|
message: {
|
|
|
data: {
|
|
|
@@ -241,17 +242,20 @@ Page({
|
|
|
}],
|
|
|
item = await this.querySubject(id)
|
|
|
list = this.data.gambitList;
|
|
|
- list[list.length - 1] = {};
|
|
|
- this.setData({
|
|
|
- gambitList: list
|
|
|
- })
|
|
|
+ item[0].closedate = item[0].createdate;
|
|
|
+ item[0].sendfrom = this.data.sendfrom;
|
|
|
list[list.length - 1] = item[0];
|
|
|
- console.log(item[0])
|
|
|
this.setData({
|
|
|
gambitList: list
|
|
|
})
|
|
|
+ setTimeout(() => {
|
|
|
+ this.setData({
|
|
|
+ toView: 'bottom'
|
|
|
+ })
|
|
|
+ }, 300)
|
|
|
})
|
|
|
} else {
|
|
|
+ if (content == '') return;
|
|
|
_Http.basic({
|
|
|
"accesstoken": wx.getStorageSync('userData').token,
|
|
|
"classname": "system.im.imdialog.imdialog",
|
|
|
@@ -261,13 +265,21 @@ Page({
|
|
|
"timsubjectid": this.data.timsubjectid,
|
|
|
"fcontent": content
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- let list = this.data.gambitList;
|
|
|
+ }, false).then(res => {
|
|
|
+ let list = this.data.gambitList,
|
|
|
+ time = res.data[0].createdate.split(".");
|
|
|
+ res.data[0].closedate = time[0];
|
|
|
+ res.data[0].sendfrom = this.data.sendfrom;
|
|
|
list[list.length - 1] = res.data[0];
|
|
|
- console.log(res.data[0])
|
|
|
this.setData({
|
|
|
- gambitList: list
|
|
|
+ gambitList: list,
|
|
|
+ sendText: ''
|
|
|
})
|
|
|
+ setTimeout(() => {
|
|
|
+ this.setData({
|
|
|
+ toView: 'bottom'
|
|
|
+ })
|
|
|
+ }, 300)
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
@@ -455,19 +467,10 @@ Page({
|
|
|
},
|
|
|
/* 发送表情 */
|
|
|
sendMeme(e) {
|
|
|
- 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"
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ if (this.data.fimdialogtype == '话题') return wx.showToast({
|
|
|
+ title: '当前状态不可发送',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
const {
|
|
|
item
|
|
|
} = e.currentTarget.dataset;
|
|
|
@@ -662,16 +665,18 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
- var that = this
|
|
|
+ var that = this;
|
|
|
app.globalData.callback = function (res) {
|
|
|
//res 接收websocket onMessage事件返回的数据
|
|
|
let objs = JSON.parse(res.data),
|
|
|
unreadCount = that.data.unreadCount; /* triggered */
|
|
|
that.data.socketMsgQueue.push(objs)
|
|
|
- console.log("发送消息", objs)
|
|
|
that.setData({
|
|
|
socketMsgQueue: that.data.socketMsgQueue
|
|
|
})
|
|
|
+ if (objs.message.sendfrom) that.setData({
|
|
|
+ sendfrom: objs.message.sendfrom
|
|
|
+ })
|
|
|
that.toBotton()
|
|
|
/* if (wx.getStorageSync('userData').userid == objs.message.sendfrom.userid) {
|
|
|
} else {
|