const app = getApp(); var utils = require("../../../utils/http") const util = require("../../../utils/util"); let page = 1, sharepage = 1; Page({ /** * 页面的初始数据 */ data: { imgUrl: app.globalData.imgUrl, aid: '', activityobj: {}, wshareshow: false, titype: 1, trackflag: false, tracktype: '1', customerlist: [], trackimgarr: [], nowimagearr: [], nowcid: '', recordtext: '', visitobj: {}, housestate: '预约回访', seletime: '', visitcount: 0, visitlogarr: [], statype: '1', activitylist: [], activityname: '', invitecrm: [], showUpcrm: [], datashow: true, start: "", end: '', columns: [], showPicker: false, nowaid: '', personobj: app.globalData.personMsg, typeflag: false, ranktype: '预约', orgtype: '公司排行', shareranklist: [], gotranklist: [], sharemyrankobj: {}, gotmyrankobj: {}, topdataobj: {}, type: 1, tacktype: 1, tackarr: [ { id: 1, text: '自定义' }, { id: 3, text: '已装修' }, { id: 4, text: '无需求' }, { id: 5, text: '有需求' }, { id: 6, text: '超地域' }, { id: 7, text: '未交房' }, { id: 8, text: '在外地' }, { id: 9, text: '无购买力' }, { id: 10, text: '未接通电话' }, ], nowtext1: '自定义', tacktext: '', amountdate: '', nowtext: false, timeshow: false, amountime: 1, amountime1: 1, visitdate: '', apointobj: {}, customerobj: {}, nowidx: 0, scoleval: 0, nowdate: '', cluestate: 1, activityType: '' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { let date = new Date(); let m = date.getMonth() * 1 + 1; let d = date.getDate(); let str = date.getFullYear() + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? ('0' + d) : d); wx.showLoading({ title: '加载中...', }) this.setData({ aid: options.aid, amountdate: str, start: str, nowdate: str, personobj: app.globalData.personMsg, imgUrl: app.globalData.imgUrl, }) if (!!options.type) { this.setData({ activityType: options.type }) } this.activityfun(); }, dothis() { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, sharewaytap: function () { this.setData({ wshareshow: true }) }, shareurltap: function () { wx.showLoading({ title: '加载中...', }) this.activitytap(); util.schemefun('/share/pages/activitymsg/activitymsg', 'aid=' + this.data.aid + '&uid=' + app.globalData.personMsg.id + '&ctp=' + app.globalData.clientype, this.data.aid, 'activity', ''); }, setpostertap: function () { wx.navigateTo({ url: '/index/pages/setposter/setposter?type=activity&aid=' + this.data.aid + "&listshare=", }) }, activityfun: function () { var that = this; utils.$post({ url: app.globalData.webUrl + 'api/activity/details', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: that.data.aid, uid: app.globalData.personMsg.id }, success: function (res) { if (res.data.code == '0') { that.setData({ activityobj: res.data.data }) wx.setNavigationBarTitle({ title: res.data.data.title }) } wx.hideLoading() } }) }, activitytap: function () { let that = this; utils.$post({ url: app.globalData.webUrl + 'api/share/addlog', header: { 'Authorization': 'bearer ' + app.globalData.token }, data: { id: that.data.aid, type: 'activity', }, success: function (r) { } }) }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { var img = this.data.activityobj.poster; this.activitytap(); return { title: this.data.activityobj.title, imageUrl: img, path: '/share/pages/activitymsg/activitymsg?aid=' + this.data.aid + '&uid=' + app.globalData.personMsg.id + "&ctp=" + app.globalData.clientype } } })