| // components/listItem/listItem.js | // components/listItem/listItem.js | ||||
| const app = getApp(); | const app = getApp(); | ||||
| const $request = require('../../utils/request.js'); | |||||
| Component({ | Component({ | ||||
| /** | /** | ||||
| * 组件的属性列表 | * 组件的属性列表 | ||||
| } | } | ||||
| console.log(`点击了聊一聊`) | console.log(`点击了聊一聊`) | ||||
| let item = e.currentTarget.dataset.item; | let item = e.currentTarget.dataset.item; | ||||
| let businessCommunicationDemandId = item.businessCommunicationDemandId; | |||||
| $request.post('/statisticsBusinessCommunicationDemand/saveDemandCollect.action', | |||||
| { businessCommunicationDemandId } | |||||
| ).then(res => { }).catch(err => { console.log(err) }) | |||||
| $request.post('/statisticsBusinessCommunicationDemand/demandPageView.action', | |||||
| { businessCommunicationDemandId, customerId: app.globalData.customerId } | |||||
| ).then(res => { }).catch(err => { console.log(err) }) | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: "/pages/msgModule/wechat2/wechat2", | url: "/pages/msgModule/wechat2/wechat2", | ||||
| success: function (res) { | success: function (res) { | ||||
| // 通过eventChannel向被打开页面传送数据 | // 通过eventChannel向被打开页面传送数据 | ||||
| res.eventChannel.emit('customerid', { | res.eventChannel.emit('customerid', { | ||||
| customerid: item.customerId, | customerid: item.customerId, | ||||
| businessCommunicationDemandId: item.businessCommunicationDemandId, | |||||
| businessCommunicationDemandId, | |||||
| chatHeads: item.chatHeads, | chatHeads: item.chatHeads, | ||||
| info: item.info | info: item.info | ||||
| }) | }) |
| }, | }, | ||||
| saveHomeCollect() { | saveHomeCollect() { | ||||
| $request.post('/statisticsBusinessCommunicationDemand/saveHomeCollect.action', | $request.post('/statisticsBusinessCommunicationDemand/saveHomeCollect.action', | ||||
| { customerId: app.globalData.customerId } | |||||
| { customerId: this.data.customerId } | |||||
| ).then(res => { }).catch(err => { console.log(err) }) | ).then(res => { }).catch(err => { console.log(err) }) | ||||
| }, | }, | ||||
| // 底部按钮点击 | // 底部按钮点击 |
| userCustomerId: businessCommunicationCustomer.customerId | userCustomerId: businessCommunicationCustomer.customerId | ||||
| }) | }) | ||||
| } | } | ||||
| // const listDetail = wx.getStorageSync('listDetail') || null; | |||||
| // this.setData({ | |||||
| // currentData: listDetail, | |||||
| // type: listDetail.type.join(), | |||||
| // pageLoading: true, | |||||
| // }) | |||||
| // 获取当前数据 | // 获取当前数据 | ||||
| this.getCurrentData(); | this.getCurrentData(); | ||||
| if (app.globalData.customerId) { | if (app.globalData.customerId) { | ||||
| } else { | } else { | ||||
| this.getListData(); | this.getListData(); | ||||
| } | } | ||||
| // 设置当前访问量 | |||||
| this.setDemandCollect(); | |||||
| }, | |||||
| setDemandCollect(){ | |||||
| let businessCommunicationDemandId = this.data.businessCommunicationDemandId; | |||||
| $request.post('/statisticsBusinessCommunicationDemand/saveDemandCollect.action', | |||||
| { businessCommunicationDemandId } | |||||
| ).then(res => { }).catch(err => { console.log(err) }) | |||||
| $request.post('/statisticsBusinessCommunicationDemand/demandPageView.action', | |||||
| { businessCommunicationDemandId,customerId: app.globalData.customerId } | |||||
| ).then(res => { }).catch(err => { console.log(err) }) | |||||
| }, | }, | ||||
| // 热门详情点击 | // 热门详情点击 | ||||
| goDetails(e) { | goDetails(e) { |