activitymsg.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. const app = getApp();
  2. var utils = require("../../../utils/http")
  3. const util = require("../../../utils/util");
  4. let page = 1, sharepage = 1;
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. imgUrl: app.globalData.imgUrl,
  11. aid: '',
  12. activityobj: {},
  13. wshareshow: false,
  14. titype: 1,
  15. trackflag: false,
  16. tracktype: '1',
  17. customerlist: [],
  18. trackimgarr: [],
  19. nowimagearr: [],
  20. nowcid: '',
  21. recordtext: '',
  22. visitobj: {},
  23. housestate: '预约回访',
  24. seletime: '',
  25. visitcount: 0,
  26. visitlogarr: [],
  27. statype: '1',
  28. activitylist: [],
  29. activityname: '',
  30. invitecrm: [],
  31. showUpcrm: [],
  32. datashow: true,
  33. start: "",
  34. end: '',
  35. columns: [],
  36. showPicker: false,
  37. nowaid: '',
  38. personobj: app.globalData.personMsg,
  39. typeflag: false,
  40. ranktype: '预约',
  41. orgtype: '公司排行',
  42. shareranklist: [],
  43. gotranklist: [],
  44. sharemyrankobj: {},
  45. gotmyrankobj: {},
  46. topdataobj: {},
  47. type: 1,
  48. tacktype: 1,
  49. tackarr: [
  50. { id: 1, text: '自定义' },
  51. { id: 3, text: '已装修' },
  52. { id: 4, text: '无需求' },
  53. { id: 5, text: '有需求' },
  54. { id: 6, text: '超地域' },
  55. { id: 7, text: '未交房' },
  56. { id: 8, text: '在外地' },
  57. { id: 9, text: '无购买力' },
  58. { id: 10, text: '未接通电话' },
  59. ],
  60. nowtext1: '自定义',
  61. tacktext: '',
  62. amountdate: '',
  63. nowtext: false,
  64. timeshow: false,
  65. amountime: 1,
  66. amountime1: 1,
  67. visitdate: '',
  68. apointobj: {},
  69. customerobj: {},
  70. nowidx: 0,
  71. scoleval: 0,
  72. nowdate: '',
  73. cluestate: 1,
  74. activityType: ''
  75. },
  76. /**
  77. * 生命周期函数--监听页面加载
  78. */
  79. onLoad: function (options) {
  80. let date = new Date();
  81. let m = date.getMonth() * 1 + 1;
  82. let d = date.getDate();
  83. let str = date.getFullYear() + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? ('0' + d) : d);
  84. wx.showLoading({
  85. title: '加载中...',
  86. })
  87. this.setData({
  88. aid: options.aid,
  89. amountdate: str,
  90. start: str,
  91. nowdate: str,
  92. personobj: app.globalData.personMsg,
  93. imgUrl: app.globalData.imgUrl,
  94. })
  95. if (!!options.type) {
  96. this.setData({
  97. activityType: options.type
  98. })
  99. }
  100. this.activityfun();
  101. },
  102. dothis() { },
  103. /**
  104. * 生命周期函数--监听页面初次渲染完成
  105. */
  106. onReady: function () {
  107. },
  108. sharewaytap: function () {
  109. this.setData({
  110. wshareshow: true
  111. })
  112. },
  113. shareurltap: function () {
  114. wx.showLoading({
  115. title: '加载中...',
  116. })
  117. this.activitytap();
  118. util.schemefun('/share/pages/activitymsg/activitymsg', 'aid=' + this.data.aid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, this.data.aid, 'activity', '');
  119. },
  120. setpostertap: function () {
  121. wx.navigateTo({
  122. url: '/index/pages/setposter/setposter?type=activity&aid=' + this.data.aid + "&listshare=",
  123. })
  124. },
  125. activityfun: function () {
  126. var that = this;
  127. utils.$post({
  128. url: app.globalData.webUrl + 'api/activity/details',
  129. header: {
  130. 'Authorization': 'bearer ' + app.globalData.token
  131. },
  132. data: {
  133. id: that.data.aid,
  134. uid: app.globalData.personMsg.id
  135. },
  136. success: function (res) {
  137. if (res.data.code == '0') {
  138. that.setData({
  139. activityobj: res.data.data
  140. })
  141. wx.setNavigationBarTitle({
  142. title: res.data.data.title
  143. })
  144. }
  145. wx.hideLoading()
  146. }
  147. })
  148. },
  149. activitytap: function () {
  150. let that = this;
  151. utils.$post({
  152. url: app.globalData.webUrl + 'api/share/addlog',
  153. header: {
  154. 'Authorization': 'bearer ' + app.globalData.token
  155. },
  156. data: {
  157. id: that.data.aid,
  158. type: 'activity',
  159. },
  160. success: function (r) {
  161. }
  162. })
  163. },
  164. /**
  165. * 生命周期函数--监听页面显示
  166. */
  167. onShow: function () {
  168. },
  169. /**
  170. * 生命周期函数--监听页面隐藏
  171. */
  172. onHide: function () {
  173. },
  174. /**
  175. * 生命周期函数--监听页面卸载
  176. */
  177. onUnload: function () {
  178. },
  179. /**
  180. * 页面相关事件处理函数--监听用户下拉动作
  181. */
  182. onPullDownRefresh: function () {
  183. },
  184. /**
  185. * 页面上拉触底事件的处理函数
  186. */
  187. onReachBottom: function () {
  188. },
  189. /**
  190. * 用户点击右上角分享
  191. */
  192. onShareAppMessage: function () {
  193. var img = this.data.activityobj.poster;
  194. this.activitytap();
  195. return {
  196. title: this.data.activityobj.title,
  197. imageUrl: img,
  198. path: '/share/pages/activitymsg/activitymsg?aid=' + this.data.aid + '&uid=' + app.globalData.personMsg.id + "&ctp=" + app.globalData.clientype
  199. }
  200. }
  201. })