index.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import {
  2. ApiModel
  3. } from "../../../utils/api";
  4. const _Http = new ApiModel();
  5. Component({
  6. /**
  7. * 组件的属性列表
  8. */
  9. properties: {
  10. //数据
  11. itemData: {
  12. type: Object
  13. },
  14. //创建者id
  15. role: {
  16. type: Boolean
  17. },
  18. //是否显示底部
  19. isShowBottom: {
  20. type: Boolean,
  21. value: true
  22. }
  23. },
  24. /**
  25. * 组件的初始数据
  26. */
  27. data: {},
  28. /**
  29. * 组件的方法列表
  30. */
  31. methods: {
  32. change() {
  33. this.setData({
  34. role: !this.data.role
  35. })
  36. },
  37. //浏览图片
  38. preViewImage(e) {
  39. const {
  40. type,
  41. url
  42. } = e.target.dataset;
  43. if (type == "emoji") return;
  44. let urls = [];
  45. urls.push(url)
  46. wx.previewImage({
  47. urls: urls,
  48. })
  49. },
  50. //去查看统计
  51. toStats(e) {
  52. const {
  53. type
  54. } = e.target.dataset;
  55. if (type != undefined) wx.navigateTo({
  56. url: '/pages/chatRoom/stats?type=' + type + '&timsubjectid=' + this.data.itemData.timsubjectid + '&timdialogid=' + this.data.itemData.timdialogid,
  57. })
  58. },
  59. //回复话题
  60. writBack() {
  61. // return console.log(this.data.itemData)
  62. _Http.basic({
  63. "accesstoken": wx.getStorageSync('userData').token,
  64. "classname": "system.im.imdialog.imdialog",
  65. "method": "subjectAnswer",
  66. "content": {
  67. "timsubjectid": this.data.itemData.timsubjectid
  68. }
  69. }).then(res => {
  70. console.log("回复话题", res)
  71. if (res.msg != '成功') return wx.showToast({
  72. title: res.data,
  73. icon: "none"
  74. });
  75. _Http.basic({
  76. "accesstoken": wx.getStorageSync('userData').token,
  77. "classname": "system.im.imdialog.imdialog",
  78. "method": "quickcontact",
  79. "content": {
  80. "tenterprise_userid": this.data.itemData.sendfrom.userid,
  81. "message": this.data.itemData
  82. }
  83. }).then(res => {
  84. console.log("回复创建一对一聊天", res)
  85. if (res.msg != '成功') return wx.showToast({
  86. title: res.data,
  87. icon: "none"
  88. });
  89. wx.navigateTo({
  90. url: '/pages/chatRoom/dialogbox?id=' + res.data[0].timdialogid,
  91. })
  92. })
  93. })
  94. }
  95. }
  96. })