chat.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // compontents/chat/chat.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. productionData: {
  8. type: Object,
  9. value: {}
  10. },
  11. title: {
  12. type: String,
  13. value: ''
  14. },
  15. query: {
  16. type: String,
  17. value: ''
  18. },
  19. type: {
  20. type: String,
  21. value: ''
  22. },
  23. columnType: {
  24. type: String,
  25. value: ''
  26. },
  27. },
  28. /**
  29. * 组件的初始数据
  30. */
  31. data: {
  32. text: '',
  33. chatDatas: [],
  34. animationData: {},
  35. },
  36. /**
  37. * 组件的方法列表
  38. */
  39. methods: {
  40. uploadImage (e) {
  41. const type = this.properties.type;
  42. const columnType = this.properties.columnType;
  43. wx.navigateTo({
  44. url: '../input_content/input_content?type=' + type + '&columnType=' + columnType
  45. })
  46. },
  47. listenerButtonPreviewImage: function(e) {
  48. let imgUrl = [];
  49. imgUrl.push(e.target.dataset.img);
  50. wx.previewImage({
  51. current: '', // 当前显示图片的http链接
  52. urls: imgUrl, // 需要预览的图片http链接列表
  53. //这根本就不走
  54. success: function(res) {
  55. //console.log(res);
  56. },
  57. //也根本不走
  58. fail: function() {
  59. //console.log('fail')
  60. }
  61. })
  62. },
  63. shareImage: function(e){
  64. console.log(e);
  65. //分享查询单条的时候会用到这两个值
  66. const postId = e.currentTarget.dataset.postsid;
  67. this.share.showPopup(postId);
  68. },
  69. examine: function () {
  70. //console.log(1)
  71. var myEventDetail = {} // detail对象,提供给事件监听函数
  72. var myEventOption = {} // 触发事件的选项
  73. this.triggerEvent('myevent', myEventDetail, myEventOption)
  74. }
  75. },
  76. ready: function(){
  77. }
  78. })