dialogbox.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. const app = getApp();
  2. import {
  3. ApiModel
  4. } from "../../utils/api";
  5. const _Http = new ApiModel();
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. iosX: false,
  12. sendText: "", //输入框内容
  13. headerTitle: "对话框",
  14. socketMsgQueue: [],
  15. lineCount: 1, //输入框行数
  16. toView: 'item0',
  17. keyboardHeight: 0, //键盘高度
  18. functionToChoose: "", //功能选项
  19. memePopup: false, //表情弹出
  20. pageNumber: 1,
  21. pageTotal: 1,
  22. triggered: false, //下拉状态
  23. unreadCount: 0, //对方发送未读信息
  24. joinHands: false, //是否显示合作按钮
  25. ownerid: 0, //供需id
  26. fimdialogtype: '', //对话框类型
  27. fimuserid: 0, //创建者id
  28. timsubjectid: 0, //话题id
  29. timdialogid: 0, //对话框id
  30. gambitList: [], //话题列表
  31. sendfrom: [],
  32. isEndGambit: true, //是否结束话题,用于点击编辑不结束话题
  33. fdatastatus: 0, // 0 1 2对接中
  34. },
  35. /**
  36. * 生命周期函数--监听页面加载
  37. */
  38. onLoad: function (options) {
  39. //app.initSocket(); 链接websocket 用于测试
  40. const that = this;
  41. this.setData({
  42. timdialogid: options.id,
  43. userid: wx.getStorageSync('userData').userid
  44. });
  45. if (options.fdatastatus) {
  46. this.setData({
  47. fdatastatus: options.fdatastatus
  48. })
  49. }
  50. //判断是否存在安全距离
  51. let iosX = (getApp().globalData.safeAreaBottom == 0) ? false : true;
  52. this.setData({
  53. iosX
  54. })
  55. //获取表情包
  56. this.getMeme()
  57. },
  58. toCreate() {
  59. this.setData({
  60. isEndGambit: false
  61. })
  62. wx.navigateTo({
  63. url: '/pages/chatRoom/create?timdialogid=' + this.data.timdialogid,
  64. })
  65. },
  66. /* 创建话题,回复话题 */
  67. createGambit() {
  68. _Http.basic({
  69. "accesstoken": wx.getStorageSync('userData').token,
  70. "classname": "system.im.imdialog.imdialog",
  71. "method": "createSubject",
  72. "content": {
  73. "timdialogid": this.data.timdialogid,
  74. "timsubjectid": this.data.timsubjectid,
  75. "fcontent": ""
  76. }
  77. }).then(res => {
  78. if (res.msg != '成功') return wx.showToast({
  79. title: res.data,
  80. icon: "none"
  81. })
  82. let gambitList = this.data.gambitList;
  83. gambitList.push(res.data[0]);
  84. this.setData({
  85. timsubjectid: res.data[0].timsubjectid,
  86. gambitList
  87. })
  88. app.globalData.SocketTask.send({
  89. data: JSON.stringify({
  90. "classname": "message.message",
  91. "method": "sendDataMessage",
  92. "content": {
  93. "timdialogid": this.data.timdialogid,
  94. "ownertable": "timsubject",
  95. "ownerid": this.data.timsubjectid,
  96. "ftype": "话题",
  97. }
  98. }),
  99. success(res) {
  100. console.log("sddf", res)
  101. }
  102. })
  103. })
  104. },
  105. /* 结束话题 */
  106. endGambit(isGetList) {
  107. _Http.basic({
  108. "accesstoken": wx.getStorageSync('userData').token,
  109. "classname": "system.im.imdialog.imdialog",
  110. "method": "closeSubject",
  111. "content": {
  112. "timsubjectid": this.data.timsubjectid,
  113. "timdialogid": this.data.timdialogid
  114. }
  115. }).then(res => {
  116. if (res.msg != '成功') return wx.showToast({
  117. title: res.data,
  118. icon: "none"
  119. });
  120. this.setData({
  121. timsubjectid: 0
  122. })
  123. if (isGetList) this.query_imdialogMessage();
  124. })
  125. },
  126. /* 发送信息 */
  127. sendMsg(type, data) {
  128. const content = this.data.sendText.trim(),
  129. that = this;
  130. if (this.data.fimdialogtype == '话题') {
  131. if (type === 'file') {
  132. console.log("附件类型", data)
  133. let list = this.data.gambitList[this.data.gambitList.length - 1].imsubjectcontent;
  134. _Http.basic({
  135. "accesstoken": wx.getStorageSync('userData').token,
  136. "classname": "system.system.docManage",
  137. "method": "changeFilesData",
  138. "content": {
  139. "files": [{
  140. "tattachmentid": data[0].tattachmentid,
  141. "fdocument": data[0].fdocument,
  142. "ownertable": "timsubjectcontent",
  143. "ownerid": list[list.length - 1].timsubjectcontenid,
  144. "ftype": data[0].ftype
  145. }]
  146. }
  147. }).then(async s => {
  148. console.log("附件位置修改", s)
  149. let id = [{
  150. message: {
  151. data: {
  152. ownerid: this.data.timsubjectid
  153. }
  154. }
  155. }],
  156. item = await this.querySubject(id)
  157. list = this.data.gambitList;
  158. item[0].closedate = item[0].createdate;
  159. item[0].sendfrom = this.data.sendfrom;
  160. list[list.length - 1] = item[0];
  161. this.setData({
  162. gambitList: list
  163. })
  164. setTimeout(() => {
  165. this.setData({
  166. toView: 'bottom'
  167. })
  168. }, 300)
  169. })
  170. } else {
  171. if (content == '') return;
  172. _Http.basic({
  173. "accesstoken": wx.getStorageSync('userData').token,
  174. "classname": "system.im.imdialog.imdialog",
  175. "method": "createSubject",
  176. "content": {
  177. "timdialogid": this.data.timdialogid,
  178. "timsubjectid": this.data.timsubjectid,
  179. "fcontent": content
  180. }
  181. }, false).then(res => {
  182. let list = this.data.gambitList,
  183. time = res.data[0].createdate.split(".");
  184. res.data[0].closedate = time[0];
  185. res.data[0].sendfrom = this.data.sendfrom;
  186. list[list.length - 1] = res.data[0];
  187. this.setData({
  188. gambitList: list,
  189. sendText: ''
  190. })
  191. setTimeout(() => {
  192. this.setData({
  193. toView: 'bottom'
  194. })
  195. }, 300)
  196. })
  197. }
  198. } else {
  199. if (type === 'file') {
  200. app.globalData.SocketTask.send({
  201. data: JSON.stringify({
  202. "classname": "message.message",
  203. "method": "sendFileMessage",
  204. "content": {
  205. "timdialogid": this.data.timdialogid,
  206. "tattachmentid": data[0].tattachmentid
  207. }
  208. }),
  209. success(res) {}
  210. })
  211. } else {
  212. if (content == '') return;
  213. app.globalData.SocketTask.send({
  214. data: JSON.stringify({
  215. "classname": "message.message",
  216. "method": "sendTextMessage",
  217. "content": {
  218. "timdialogid": that.data.timdialogid,
  219. "fmessage": content
  220. }
  221. }),
  222. success(res) {
  223. that.setData({
  224. sendText: ''
  225. })
  226. }
  227. })
  228. }
  229. }
  230. },
  231. //历史信息查询
  232. query_imdialogMessage() {
  233. _Http.basic({
  234. "accesstoken": wx.getStorageSync('userData').token,
  235. "classname": "system.im.imdialog.imdialog",
  236. "method": "query_imdialogMessage",
  237. "content": {
  238. "pageNumber": this.data.pageNumber,
  239. "pageSize": 20,
  240. "timdialogid": this.data.timdialogid
  241. }
  242. }, false).then(async res => {
  243. console.log("聊天记录", res)
  244. if (res.msg != '成功') return wx.showToast({
  245. title: res.data,
  246. icon: "none"
  247. });
  248. let list = res.data;
  249. list = list.reverse();
  250. if (res.pageNumber != 1) {
  251. if (this.data.fimdialogtype != '话题') {
  252. list = list.concat(this.data.socketMsgQueue);
  253. this.setData({
  254. socketMsgQueue: list,
  255. toView: `item${res.data.length - 1}`,
  256. triggered: false
  257. })
  258. } else {
  259. let gambitList = await this.querySubject(list);
  260. list = gambitList.concat(this.data.gambitList);
  261. this.setData({
  262. gambitList: list,
  263. toView: `item${res.data.length - 1}`,
  264. triggered: false
  265. })
  266. }
  267. } else {
  268. if (this.data.fimdialogtype != '话题') {
  269. this.setData({
  270. socketMsgQueue: list,
  271. toView: `item${res.data.length - 1}`,
  272. pageTotal: res.pageTotal
  273. })
  274. } else {
  275. let gambitList = await this.querySubject(list);
  276. this.setData({
  277. gambitList,
  278. toView: `item${res.data.length - 1}`,
  279. pageTotal: res.pageTotal
  280. })
  281. }
  282. setTimeout(() => {
  283. this.setData({
  284. toView: 'bottom'
  285. })
  286. }, 500)
  287. }
  288. })
  289. },
  290. /* 根据话题ID查询详情 */
  291. async querySubject(array) {
  292. let list = [];
  293. for (let index = 0; index < array.length; index++) {
  294. await _Http.basic({
  295. "accesstoken": wx.getStorageSync('userData').token,
  296. "classname": "system.im.imdialog.imdialog",
  297. "method": "querySubject",
  298. "content": {
  299. "timsubjectid": array[index].message.data.ownerid
  300. }
  301. }, false).then(res => {
  302. if (res.data.length != 0 && res.data[0].imsubjectcontent.length != 0) {
  303. res.data[0].sendfrom = array[index].message.sendfrom;
  304. res.data[0].timdialogid = array[index].message.timdialogid;
  305. if (res.data[0].closedate != null) {
  306. let time = res.data[0].closedate.split('.');
  307. res.data[0].closedate = time[0];
  308. res.data[0].finish = true;
  309. list.push(res.data[0]);
  310. } else {
  311. let time = res.data[0].createdate.split('.');
  312. res.data[0].createdate = time[0];
  313. res.data[0].finish = false;
  314. list.push(res.data[0]);
  315. }
  316. }
  317. })
  318. }
  319. return list;
  320. },
  321. /* 加载分页 */
  322. scrolltoupper() {
  323. if (this.data.pageNumber < this.data.pageTotal) {
  324. this.setData({
  325. pageNumber: this.data.pageNumber + 1,
  326. triggered: true
  327. })
  328. this.query_imdialogMessage();
  329. } else {
  330. this.setData({
  331. triggered: true
  332. })
  333. }
  334. },
  335. //键盘弹出高度
  336. keyboardheightchange(e) {
  337. let {
  338. height
  339. } = e.detail;
  340. if (this.data.iosX && height > 150) height = height - 17;
  341. this.setData({
  342. keyboardHeight: height
  343. })
  344. },
  345. /* 确认合作 */
  346. confirmTheCooperation() {
  347. let that = this;
  348. wx.showModal({
  349. title: '提示',
  350. content: '是否确定达成合作',
  351. success: function (res) {
  352. if (res.confirm) {
  353. _Http.basic({
  354. "accesstoken": wx.getStorageSync('userData').token,
  355. "classname": "customer.supplyanddemand.supplyanddemand",
  356. "method": "updatesupplyanddemandstatus",
  357. "content": {
  358. "tsupplyanddemandid": that.data.ownerid,
  359. "fstatus": "已解决",
  360. "tenterprise_userid": that.data.fimuserid,
  361. "timdialogid": that.data.timdialogid
  362. }
  363. }).then(res => {
  364. let text = ' 恭喜达成合作';
  365. if (res.msg != '成功') text = res.data;
  366. wx.showToast({
  367. title: text,
  368. icon: "none"
  369. })
  370. if (res.msg == '成功') that.setData({
  371. fdatastatus: 1
  372. })
  373. })
  374. }
  375. }
  376. })
  377. },
  378. /* 拒绝合作 */
  379. refuseToCooperate() {
  380. let that = this;
  381. wx.showModal({
  382. title: '提示',
  383. content: '是否确定拒绝',
  384. success: function (res) {
  385. if (res.confirm) {
  386. _Http.basic({
  387. "accesstoken": wx.getStorageSync('userData').token,
  388. "classname": "customer.supplyanddemand.supplyanddemand",
  389. "method": "updatesupplyanddemandstatus",
  390. "content": {
  391. "tsupplyanddemandid": that.data.ownerid,
  392. "fstatus": "待对接",
  393. "timdialogid": that.data.timdialogid
  394. }
  395. }).then(res => {
  396. let text = ' 拒绝成功';
  397. if (res.msg != '成功') text = res.data;
  398. wx.showToast({
  399. title: text,
  400. icon: "none"
  401. })
  402. if (res.msg == '成功') that.setData({
  403. fdatastatus: 0
  404. })
  405. })
  406. }
  407. }
  408. })
  409. },
  410. /* 输入框数据绑定 */
  411. sendInput(e) {
  412. this.setData({
  413. sendText: e.detail.value
  414. })
  415. },
  416. /* 发送表情 */
  417. sendMeme(e) {
  418. if (this.data.fimdialogtype == '话题') return wx.showToast({
  419. title: '当前状态不可发送',
  420. icon: "none"
  421. })
  422. const {
  423. item
  424. } = e.currentTarget.dataset;
  425. let data = [];
  426. data.push(item);
  427. this.sendMsg('file', data)
  428. },
  429. //功能选择
  430. selectionFunction(e) {
  431. const {
  432. name
  433. } = e.target.dataset,
  434. that = this;
  435. if (name == undefined || name == "") return;
  436. if (name == '表情') {
  437. let keyboardHeight = (this.data.iosX == true) ? 220 : 200;
  438. this.setData({
  439. keyboardHeight,
  440. memePopup: true
  441. })
  442. that.toBotton()
  443. let time1 = setInterval(() => {
  444. this.setData({
  445. keyboardHeight
  446. })
  447. if (this.data.keyboardHeight == keyboardHeight && this.data.memePopup) clearInterval(time1);
  448. }, 100);
  449. } else if (name == '图片') {
  450. this.endMemePopup()
  451. wx.chooseMedia({
  452. count: 1,
  453. mediaType: ['image'],
  454. sourceType: ['album', 'camera'],
  455. maxDuration: 30,
  456. camera: 'back',
  457. success(res) {
  458. let data = {
  459. file: res.tempFiles[0].tempFilePath
  460. };
  461. that.afterRead(data)
  462. }
  463. })
  464. } else if (name == '历史') {
  465. wx.navigateTo({
  466. url: './history?id=' + that.data.timdialogid + '&type=' + that.data.fimdialogtype,
  467. })
  468. }
  469. },
  470. textareaFocus() {
  471. this.setData({
  472. memePopup: false, //表情弹出
  473. })
  474. this.toBotton()
  475. },
  476. //关闭表情
  477. endMemePopup(e) {
  478. this.setData({
  479. keyboardHeight: 0, //键盘高度
  480. memePopup: false, //表情弹出
  481. })
  482. },
  483. /* 文本域行数变化 */
  484. /* linechange(e) {
  485. console.log(e)
  486. const {
  487. lineCount
  488. } = e.detail;
  489. if (lineCount == this.data.lineCount) return;
  490. this.setData({
  491. lineCount
  492. })
  493. }, */
  494. //获取表情包
  495. getMeme() {
  496. _Http.basic({
  497. "accesstoken": wx.getStorageSync('userData').token,
  498. "classname": "system.system.docManage",
  499. "method": "queryDoc",
  500. "content": {
  501. "getdatafromdbanyway": true,
  502. "ownertable": "system",
  503. "ownerid": 0
  504. }
  505. }, false).then(res => {
  506. if (res.msg != '成功') return setTimeout(() => {
  507. this.getMeme();
  508. }, 3000);
  509. this.setData({
  510. memeList: res.data
  511. })
  512. })
  513. },
  514. afterRead({
  515. file
  516. }) {
  517. if (this.data.fimdialogtype == '话题') {
  518. if (this.data.timsubjectid == 0 || this.data.userid != this.data.fimuserid) {
  519. return wx.showToast({
  520. title: '当前状态不可发送',
  521. icon: "none"
  522. })
  523. } else {
  524. if (this.data.gambitList[this.data.gambitList.length - 1].imsubjectcontent.length < 1) return wx.showToast({
  525. title: '当前状态不可发送',
  526. icon: "none"
  527. })
  528. }
  529. }
  530. var that = this
  531. var index = file.lastIndexOf(".");
  532. var ext = file.substr(index + 1);
  533. var timestamp = Date.parse(new Date());
  534. wx.getFileSystemManager().readFile({
  535. filePath: file,
  536. // encoding:'utf-8',
  537. success: result => {
  538. //返回临时文件路径
  539. const fileData = result.data
  540. wx.request({
  541. url: 'https://www.buwanjia.com/bwj/rest/webclientrest/', //仅为示例,并非真实的接口地址
  542. data: {
  543. "accesstoken": wx.getStorageSync('userData').token,
  544. "classname": "system.system.docManage",
  545. "method": "getFileName",
  546. "content": {
  547. "filename": 'wx' + timestamp,
  548. "filetype": ext,
  549. "ownertable": "timdialog",
  550. "ownerid": that.data.timdialogid,
  551. "ftype": "default",
  552. "HttpMethod": 'put'
  553. }
  554. },
  555. method: 'post',
  556. header: {
  557. 'content-type': 'application/json' // 默认值
  558. },
  559. success(res) {
  560. console.log(res)
  561. that.uploadFile(res, fileData)
  562. }
  563. })
  564. },
  565. fail: console.error
  566. })
  567. },
  568. uploadFile(res, data) {
  569. var that = this
  570. wx.request({
  571. url: res.data.data.obsuploadurl,
  572. method: "PUT",
  573. data: data,
  574. header: {
  575. 'content-type': 'application/octet-stream' // 默认值
  576. },
  577. success() {
  578. wx.request({
  579. url: 'https://www.buwanjia.com/bwj/rest/webclientrest/', //仅为示例,并非真实的接口地址
  580. data: {
  581. "accesstoken": wx.getStorageSync('userData').token,
  582. "classname": "system.system.docManage",
  583. "method": "uploadSuccess",
  584. "content": {
  585. "obsfilename": res.data.data.obsfilename
  586. }
  587. },
  588. method: 'post',
  589. header: {
  590. 'content-type': 'application/json' // 默认值
  591. },
  592. success(res) {
  593. let file = res.data.data;
  594. that.sendMsg('file', file)
  595. }
  596. })
  597. }
  598. })
  599. },
  600. toBotton() {
  601. this.setData({
  602. toView: 'bottom'
  603. })
  604. },
  605. /**
  606. * 生命周期函数--监听页面初次渲染完成
  607. */
  608. onReady: function () {
  609. },
  610. /**
  611. * 生命周期函数--监听页面显示
  612. */
  613. onShow: function () {
  614. var that = this;
  615. //详情
  616. _Http.basic({
  617. "accesstoken": wx.getStorageSync('userData').token,
  618. "classname": "system.im.imdialog.imdialog",
  619. "method": "query_imdialogMain",
  620. "content": {
  621. "getdatafromdbanyway": true,
  622. "timdialogid": this.data.timdialogid
  623. }
  624. }).then(res => {
  625. console.log("详情", res)
  626. if (res.msg != '成功') return wx.showToast({
  627. title: res.data,
  628. icon: "none"
  629. });
  630. let title = res.data[0].fimdialogname.split('-'),
  631. headerTitle = (title[0] == res.data[0].fname) ? title[1] : title[0],
  632. joinHands = false;
  633. //供需类型对话框,判断对话框ID是否为当前账号,当前账号更改供需状态,非当前账号显示合作按钮
  634. if (res.data[0].fimdialogtype == '供需') {
  635. if (res.data[0].fimuserid == this.data.userid) {
  636. _Http.basic({
  637. "accesstoken": wx.getStorageSync('userData').token,
  638. "classname": "customer.supplyanddemand.supplyanddemand",
  639. "method": "updatesupplyanddemandstatus",
  640. "content": {
  641. "tsupplyanddemandid": res.data[0].ownerid,
  642. "fstatus": "对接中",
  643. "timdialogid": res.data[0].timdialogid
  644. }
  645. }, false).then(res => {
  646. console.log("对接中", res)
  647. })
  648. } else {
  649. joinHands = true
  650. }
  651. }
  652. //返回数据
  653. this.setData({
  654. headerTitle,
  655. ownerid: res.data[0].ownerid,
  656. joinHands,
  657. fimuserid: res.data[0].fimuserid,
  658. fimdialogtype: res.data[0].fimdialogtype
  659. })
  660. //判断是否为话题类型对话框
  661. if (res.data[0].fimdialogtype == '话题') {
  662. _Http.basic({
  663. "accesstoken": wx.getStorageSync('userData').token,
  664. "classname": "system.im.imdialog.imdialog",
  665. "method": "queryDialogUncloseSubject",
  666. "content": {
  667. "timdialogid": res.data[0].timdialogid
  668. }
  669. }, false).then(s => {
  670. if (s.msg != '成功') return wx.showToast({
  671. title: res.data,
  672. icon: "none"
  673. });
  674. if (s.data != '成功') {
  675. this.setData({
  676. timsubjectid: s.data[0].timsubjectid
  677. })
  678. if (this.data.isEndGambit) this.endGambit(true) //存在未关闭话题,调用关闭话题,并在关闭后重新获取历史话题
  679. } else {
  680. this.query_imdialogMessage(); //不存在未关闭话题,直接获取历史话题
  681. }
  682. })
  683. } else {
  684. this.query_imdialogMessage(); //非话题类型对话框,直接获取历史记录
  685. }
  686. });
  687. app.globalData.callback = function (res) {
  688. //res 接收websocket onMessage事件返回的数据
  689. let objs = JSON.parse(res.data),
  690. unreadCount = that.data.unreadCount; /* triggered */
  691. console.log('接收', objs)
  692. if (objs.message) {
  693. if (objs.message.timdialogid != that.data.timdialogid) return;
  694. }
  695. that.data.socketMsgQueue.push(objs);
  696. /* 接受信息 */
  697. that.setData({
  698. socketMsgQueue: that.data.socketMsgQueue
  699. })
  700. if (objs.message.sendfrom) that.setData({
  701. sendfrom: objs.message.sendfrom
  702. })
  703. that.toBotton()
  704. /* if (wx.getStorageSync('userData').userid == objs.message.sendfrom.userid) {
  705. } else {
  706. that.setData({
  707. socketMsgQueue: that.data.socketMsgQueue
  708. })
  709. } */
  710. /* ,
  711. toView: `item${that.data.socketMsgQueue.length - 1}` */
  712. };
  713. },
  714. /**
  715. * 生命周期函数--监听页面隐藏
  716. */
  717. onHide: function () {
  718. },
  719. /**
  720. * 生命周期函数--监听页面卸载
  721. */
  722. onUnload: function () {
  723. //重置未读信息
  724. _Http.basic({
  725. "accesstoken": wx.getStorageSync('userData').token,
  726. "classname": "system.im.imdialog.imdialog",
  727. "method": "restUnReadMsgCount",
  728. "content": {
  729. "timdialogid": this.data.timdialogid
  730. }
  731. }).then(res => {
  732. console.log(res)
  733. })
  734. },
  735. /**
  736. * 页面相关事件处理函数--监听用户下拉动作
  737. */
  738. onPullDownRefresh: function () {
  739. },
  740. /**
  741. * 页面上拉触底事件的处理函数
  742. */
  743. onReachBottom: function () {
  744. },
  745. /**
  746. * 用户点击右上角分享
  747. */
  748. onShareAppMessage: function () {
  749. }
  750. })