chat.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // compontents/chat/chat.js
  2. <<<<<<< HEAD
  3. Component({
  4. relations: {
  5. '../discuss/discuss': {
  6. type: 'child', // 关联的目标节点应为子节点
  7. linked: function(target) {
  8. // 每次有custom-li被插入时执行,target是该节点实例对象,触发在该节点attached生命周期之后
  9. console.log(target)
  10. },
  11. linkChanged: function(target) {
  12. // 每次有custom-li被移动后执行,target是该节点实例对象,触发在该节点moved生命周期之后
  13. console.log(target)
  14. },
  15. unlinked: function(target) {
  16. // 每次有custom-li被移除时执行,target是该节点实例对象,触发在该节点detached生命周期之后
  17. console.log(target)
  18. =======
  19. const APIClient = require('../../utils/APIClient.js');
  20. Component({
  21. relations: {
  22. '../discuss/custom-li': {
  23. type: 'child', // 关联的目标节点应为子节点
  24. linked: function(target) {
  25. // 每次有custom-li被插入时执行,target是该节点实例对象,触发在该节点attached生命周期之后
  26. },
  27. linkChanged: function(target) {
  28. // 每次有custom-li被移动后执行,target是该节点实例对象,触发在该节点moved生命周期之后
  29. },
  30. unlinked: function(target) {
  31. // 每次有custom-li被移除时执行,target是该节点实例对象,触发在该节点detached生命周期之后
  32. >>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
  33. }
  34. }
  35. },
  36. /**
  37. * 组件的属性列表
  38. */
  39. properties: {
  40. productionData: {
  41. type: Object,
  42. value: {}
  43. },
  44. <<<<<<< HEAD
  45. title: {
  46. type: String,
  47. value: ''
  48. },
  49. query: {
  50. type: String,
  51. value: ''
  52. },
  53. type: {
  54. type: String,
  55. value: ''
  56. },
  57. =======
  58. >>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
  59. },
  60. /**
  61. * 组件的初始数据
  62. */
  63. data: {
  64. <<<<<<< HEAD
  65. text: '',
  66. chatDatas: [],
  67. animationData: {},
  68. =======
  69. flag: false,
  70. text: '',
  71. chatDatas: [],
  72. animationData: {}
  73. >>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
  74. },
  75. /**
  76. * 组件的方法列表
  77. */
  78. methods: {
  79. uploadImage (e) {
  80. <<<<<<< HEAD
  81. const type = this.properties.type;
  82. wx.navigateTo({
  83. url: '../input_content/input_content?type=' + type
  84. =======
  85. wx.navigateTo({
  86. url: '../input_content/input_content'
  87. >>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
  88. })
  89. },
  90. listenerButtonPreviewImage: function(e) {
  91. let imgUrl = [];
  92. imgUrl.push(e.target.dataset.img);
  93. wx.previewImage({
  94. current: '', // 当前显示图片的http链接
  95. urls: imgUrl, // 需要预览的图片http链接列表
  96. //这根本就不走
  97. success: function(res) {
  98. //console.log(res);
  99. },
  100. //也根本不走
  101. fail: function() {
  102. //console.log('fail')
  103. }
  104. })
  105. <<<<<<< HEAD
  106. },
  107. shareImage: function(e){
  108. console.log(e);
  109. //分享查询单条的时候会用到这两个值
  110. const postId = e.currentTarget.dataset.postsid;
  111. this.share.showPopup(postId);
  112. },
  113. _getAllLi: function(){
  114. // 使用getRelationNodes可以获得nodes数组,包含所有已关联的custom-li,且是有序的
  115. var nodes = this.getRelationNodes('../discuss/discuss');
  116. console.log(nodes);
  117. }
  118. },
  119. ready: function(){
  120. this._getAllLi()
  121. this.share = this.selectComponent("#share");
  122. =======
  123. }
  124. },
  125. ready () {
  126. console.log(this.getRelationNodes('discuss/discuss/custom-li'))
  127. // this.discuss = this.selectComponent("#discuss");
  128. // console.log(this.discuss);
  129. >>>>>>> d311ba85855d9833139d43ef0f7038e08d5d9599
  130. }
  131. })