Просмотр исходного кода

提交代码~

release/210823_需求对对碰
王饶冀 4 лет назад
Родитель
Сommit
d8e13c6d11
2 измененных файлов: 25 добавлений и 16 удалений
  1. 1
    1
      app.js
  2. 24
    15
      pages/index/components/homepage/homepage.js

+ 1
- 1
app.js Просмотреть файл

}) })
}, },
// mangerUrl: 'http://test2.hhrchina.com', // mangerUrl: 'http://test2.hhrchina.com',
mangerUrl: "http://192.168.18.138",
mangerUrl: "http://192.168.18.216",
// mangerUrl: "https://www.hhrchina.com", // mangerUrl: "https://www.hhrchina.com",
// mangerUrlPath: "https://www.hhrchina.com", // mangerUrlPath: "https://www.hhrchina.com",
}) })

+ 24
- 15
pages/index/components/homepage/homepage.js Просмотреть файл

// 被浏览量 // 被浏览量
totalPageView: 0, totalPageView: 0,
// 是他人主业还是个人主业 // 是他人主业还是个人主业
isOther:false,
isOther: false,
}, },


/** /**
const eventChannel = this.getOpenerEventChannel() const eventChannel = this.getOpenerEventChannel()
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
eventChannel.on('customerid', data => { eventChannel.on('customerid', data => {
console.log(data,'customerid')
console.log(data, 'customerid')
this.setData({ this.setData({
customerId: data.customerid, customerId: data.customerid,
pageLoading: true, pageLoading: true,
isOther:data.customerid != app.globalData.customerId
isOther: data.customerid != app.globalData.customerId
}) })
// 记录浏览量
if (this.data.isOther) {
this.saveHomeCollect();
}
this.getListData(); 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(`点击了底部按钮`)
console.log(this.data.isOther) console.log(this.data.isOther)
// 前往聊一聊 // 前往聊一聊
if(this.data.isOther){
if (this.data.isOther) {
console.log(this.data.customer) console.log(this.data.customer)
let customer = this.data.customer; let customer = this.data.customer;
wx.navigateTo({ wx.navigateTo({
}) })
} }
// 前往发布需求 // 前往发布需求
else{
else {
wx.navigateTo({ wx.navigateTo({
url: '/pages/releaseModule/index', url: '/pages/releaseModule/index',
}) })
let tempListData = this.data.listData; let tempListData = this.data.listData;
if (res.status == 0) { if (res.status == 0) {
let datas = res.data; let datas = res.data;
console.log(datas,'datas')
console.log(datas, 'datas')
// 先push数据 // 先push数据
tempListData.push(...datas.demandList); tempListData.push(...datas.demandList);
tempListData.forEach(el => { tempListData.forEach(el => {
// 设置总数 // 设置总数
this.setData({ this.setData({
listData: tempListData, listData: tempListData,
total:datas.total,
total: datas.total,
customer: datas.businessCommunicationCustomer, 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) { if (tempListData.length >= this.data.total) {
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
if(this.data.isOther){
if (this.data.isOther) {
return { return {
title: "发现了一个适合你的客户需求!推荐你一起来关注~", title: "发现了一个适合你的客户需求!推荐你一起来关注~",
imageUrl: '/images/home/ShareApp-homePage2.png', imageUrl: '/images/home/ShareApp-homePage2.png',
path: 'pages/index/components/homepage/homepage' path: 'pages/index/components/homepage/homepage'
} }
}else{
} else {
return { return {
title: "分享给你我的需求信息!推荐你一起来关注~", title: "分享给你我的需求信息!推荐你一起来关注~",
imageUrl: '/images/home/ShareApp-homePage1.png', imageUrl: '/images/home/ShareApp-homePage1.png',
path: 'pages/index/components/homepage/homepage' path: 'pages/index/components/homepage/homepage'
}
}
} }
} }
}) })

Загрузка…
Отмена
Сохранить