|
@@ -121,73 +121,43 @@ Page({
|
|
|
this.getMeme()
|
|
|
},
|
|
|
/* 创建话题,回复话题 */
|
|
|
- createGambit(e) {
|
|
|
- const {
|
|
|
- type
|
|
|
- } = e.currentTarget.dataset;
|
|
|
- if (type == '发起会话') {
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "system.im.imdialog.imdialog",
|
|
|
- "method": "createSubject",
|
|
|
- "content": {
|
|
|
- "timdialogid": this.data.timdialogid,
|
|
|
- "timsubjectid": this.data.timsubjectid,
|
|
|
- "fcontent": ""
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- let gambitList = this.data.gambitList;
|
|
|
- gambitList.push(res.data[0]);
|
|
|
- this.setData({
|
|
|
- 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) {
|
|
|
- console.log("sddf", res)
|
|
|
- }
|
|
|
- })
|
|
|
+ createGambit() {
|
|
|
+ _Http.basic({
|
|
|
+ "accesstoken": wx.getStorageSync('userData').token,
|
|
|
+ "classname": "system.im.imdialog.imdialog",
|
|
|
+ "method": "createSubject",
|
|
|
+ "content": {
|
|
|
+ "timdialogid": this.data.timdialogid,
|
|
|
+ "timsubjectid": this.data.timsubjectid,
|
|
|
+ "fcontent": ""
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
})
|
|
|
- } else {
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "system.im.imdialog.imdialog",
|
|
|
- "method": "subjectAnswer",
|
|
|
- "content": {
|
|
|
- "timsubjectid": this.data.timsubjectid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log("回复话题", res)
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- _Http.basic({
|
|
|
- "accesstoken": wx.getStorageSync('userData').token,
|
|
|
- "classname": "system.im.imdialog.imdialog",
|
|
|
- "method": "quickcontact",
|
|
|
+ let gambitList = this.data.gambitList;
|
|
|
+ gambitList.push(res.data[0]);
|
|
|
+ this.setData({
|
|
|
+ timsubjectid: res.data[0].timsubjectid,
|
|
|
+ gambitList
|
|
|
+ })
|
|
|
+ app.globalData.SocketTask.send({
|
|
|
+ data: JSON.stringify({
|
|
|
+ "classname": "message.message",
|
|
|
+ "method": "sendDataMessage",
|
|
|
"content": {
|
|
|
- "tenterprise_userid": this.data.fimuserid
|
|
|
+ "timdialogid": this.data.timdialogid,
|
|
|
+ "ownertable": "timsubject",
|
|
|
+ "ownerid": this.data.timsubjectid,
|
|
|
+ "ftype": "话题",
|
|
|
}
|
|
|
- }).then(res => {
|
|
|
- console.log("回复创建一对一聊天", res)
|
|
|
- })
|
|
|
+ }),
|
|
|
+ success(res) {
|
|
|
+ console.log("sddf", res)
|
|
|
+ }
|
|
|
})
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
/* 结束话题 */
|
|
|
endGambit(isGetList) {
|
|
@@ -376,6 +346,7 @@ Page({
|
|
|
},
|
|
|
/* 根据话题ID查询详情 */
|
|
|
async querySubject(array) {
|
|
|
+ console.log("列表", array)
|
|
|
let list = [];
|
|
|
for (let index = 0; index < array.length; index++) {
|
|
|
await _Http.basic({
|
|
@@ -386,7 +357,7 @@ Page({
|
|
|
"timsubjectid": array[index].message.data.ownerid
|
|
|
}
|
|
|
}, false).then(res => {
|
|
|
- if (res.data[0].imsubjectcontent.length != 0) {
|
|
|
+ if (res.data.length != 0 && 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) {
|
|
@@ -401,7 +372,6 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- console.log("群聊话题详情", list);
|
|
|
return list;
|
|
|
},
|
|
|
/* 加载分页 */
|