|
|
@@ -32,7 +32,7 @@ Page({ |
|
|
|
// 被浏览量 |
|
|
|
totalPageView: 0, |
|
|
|
// 是他人主业还是个人主业 |
|
|
|
isOther:false, |
|
|
|
isOther: false, |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
@@ -42,21 +42,30 @@ Page({ |
|
|
|
const eventChannel = this.getOpenerEventChannel() |
|
|
|
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |
|
|
|
eventChannel.on('customerid', data => { |
|
|
|
console.log(data,'customerid') |
|
|
|
console.log(data, 'customerid') |
|
|
|
this.setData({ |
|
|
|
customerId: data.customerid, |
|
|
|
pageLoading: true, |
|
|
|
isOther:data.customerid != app.globalData.customerId |
|
|
|
isOther: data.customerid != app.globalData.customerId |
|
|
|
}) |
|
|
|
// 记录浏览量 |
|
|
|
if (this.data.isOther) { |
|
|
|
this.saveHomeCollect(); |
|
|
|
} |
|
|
|
this.getListData(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveHomeCollect() { |
|
|
|
$request.post('/statisticsBusinessCommunicationDemand/saveHomeCollect.action', |
|
|
|
{ customerId: app.globalData.customerId } |
|
|
|
).then(res => { }).catch(err => { console.log(err) }) |
|
|
|
}, |
|
|
|
// 底部按钮点击 |
|
|
|
footBtnClick(){ |
|
|
|
footBtnClick() { |
|
|
|
console.log(`点击了底部按钮`) |
|
|
|
console.log(this.data.isOther) |
|
|
|
// 前往聊一聊 |
|
|
|
if(this.data.isOther){ |
|
|
|
if (this.data.isOther) { |
|
|
|
console.log(this.data.customer) |
|
|
|
let customer = this.data.customer; |
|
|
|
wx.navigateTo({ |
|
|
@@ -68,7 +77,7 @@ Page({ |
|
|
|
}) |
|
|
|
} |
|
|
|
// 前往发布需求 |
|
|
|
else{ |
|
|
|
else { |
|
|
|
wx.navigateTo({ |
|
|
|
url: '/pages/releaseModule/index', |
|
|
|
}) |
|
|
@@ -86,7 +95,7 @@ Page({ |
|
|
|
let tempListData = this.data.listData; |
|
|
|
if (res.status == 0) { |
|
|
|
let datas = res.data; |
|
|
|
console.log(datas,'datas') |
|
|
|
console.log(datas, 'datas') |
|
|
|
// 先push数据 |
|
|
|
tempListData.push(...datas.demandList); |
|
|
|
tempListData.forEach(el => { |
|
|
@@ -100,12 +109,12 @@ Page({ |
|
|
|
// 设置总数 |
|
|
|
this.setData({ |
|
|
|
listData: tempListData, |
|
|
|
total:datas.total, |
|
|
|
total: datas.total, |
|
|
|
customer: datas.businessCommunicationCustomer, |
|
|
|
beCollectDemand:datas.beCollectDemand, |
|
|
|
collectDemand:datas.collectDemand, |
|
|
|
postDemand:datas.postDemand, |
|
|
|
totalPageView:datas.totalPageView, |
|
|
|
beCollectDemand: datas.beCollectDemand, |
|
|
|
collectDemand: datas.collectDemand, |
|
|
|
postDemand: datas.postDemand, |
|
|
|
totalPageView: datas.totalPageView, |
|
|
|
}) |
|
|
|
// 如果数据大于了返回的总数 |
|
|
|
if (tempListData.length >= this.data.total) { |
|
|
@@ -148,18 +157,18 @@ Page({ |
|
|
|
* 用户点击右上角分享 |
|
|
|
*/ |
|
|
|
onShareAppMessage: function () { |
|
|
|
if(this.data.isOther){ |
|
|
|
if (this.data.isOther) { |
|
|
|
return { |
|
|
|
title: "发现了一个适合你的客户需求!推荐你一起来关注~", |
|
|
|
imageUrl: '/images/home/ShareApp-homePage2.png', |
|
|
|
path: 'pages/index/components/homepage/homepage' |
|
|
|
} |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return { |
|
|
|
title: "分享给你我的需求信息!推荐你一起来关注~", |
|
|
|
imageUrl: '/images/home/ShareApp-homePage1.png', |
|
|
|
path: 'pages/index/components/homepage/homepage' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |