Преглед изворни кода

完成 详情、聊一聊、主页 等访问记录保存

release/210823_需求对对碰
王饶冀 пре 3 година
родитељ
комит
252e5a8793

+ 9
- 1
components/listItem/listItem.js Прегледај датотеку

@@ -1,5 +1,6 @@
// components/listItem/listItem.js
const app = getApp();
const $request = require('../../utils/request.js');
Component({
/**
* 组件的属性列表
@@ -84,13 +85,20 @@ Component({
}
console.log(`点击了聊一聊`)
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({
url: "/pages/msgModule/wechat2/wechat2",
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('customerid', {
customerid: item.customerId,
businessCommunicationDemandId: item.businessCommunicationDemandId,
businessCommunicationDemandId,
chatHeads: item.chatHeads,
info: item.info
})

+ 1
- 1
pages/index/components/homepage/homepage.js Прегледај датотеку

@@ -57,7 +57,7 @@ Page({
},
saveHomeCollect() {
$request.post('/statisticsBusinessCommunicationDemand/saveHomeCollect.action',
{ customerId: app.globalData.customerId }
{ customerId: this.data.customerId }
).then(res => { }).catch(err => { console.log(err) })
},
// 底部按钮点击

+ 11
- 6
pages/index/components/listDetails/Details.js Прегледај датотеку

@@ -49,12 +49,6 @@ Page({
userCustomerId: businessCommunicationCustomer.customerId
})
}
// const listDetail = wx.getStorageSync('listDetail') || null;
// this.setData({
// currentData: listDetail,
// type: listDetail.type.join(),
// pageLoading: true,
// })
// 获取当前数据
this.getCurrentData();
if (app.globalData.customerId) {
@@ -65,6 +59,17 @@ Page({
} else {
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) {

Loading…
Откажи
Сачувај