Bladeren bron

本地保存customerId 以及 查看主页判断是个人查看还是他人查看

release/210823_需求对对碰
王饶冀 4 jaren geleden
bovenliggende
commit
ad90b950f6

+ 1
- 0
app.js Bestand weergeven

} }
if(businessCommunicationCustomer){ if(businessCommunicationCustomer){
this.globalData.businessCommunicationCustomer = businessCommunicationCustomer; this.globalData.businessCommunicationCustomer = businessCommunicationCustomer;
this.globalData.customerId = businessCommunicationCustomer.customerId;
} }
} }
} }

+ 5
- 2
pages/index/components/homepage/homepage.js Bestand weergeven

postDemand: 0, postDemand: 0,
// 被浏览量 // 被浏览量
totalPageView: 0, totalPageView: 0,
// 是他人主业还是个人主业
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)
console.log(data,'customerid')
this.setData({ this.setData({
customerId: data.customerid, customerId: data.customerid,
pageLoading: true
pageLoading: true,
isOther:data.customerid != app.globalData.customerId
}) })
this.getListData(); this.getListData();
}) })

+ 1
- 1
pages/index/components/homepage/homepage.wxml Bestand weergeven

</view> </view>
<view class="customer-info fl"> <view class="customer-info fl">
<view class="customer-nick-name yichu">{{ customer.nickName }}</view> <view class="customer-nick-name yichu">{{ customer.nickName }}</view>
<view class="customer-address">{{ customer.address }}</view>
<view class="customer-address">{{ customer.province + (customer.city ? '·' + customer.city : '') }}</view>
</view> </view>
</view> </view>
<view class="service-project" wx:if="{{ !!customer.serviceProject }}"> <view class="service-project" wx:if="{{ !!customer.serviceProject }}">

+ 2
- 1
pages/myModule/components/myRelease/myRelease.js Bestand weergeven

// pages/myModule/components/myRelease/myRelease.js // pages/myModule/components/myRelease/myRelease.js
const $request = require('../../../../utils/request.js'); const $request = require('../../../../utils/request.js');
const $util = require('../../../../utils/util.js'); const $util = require('../../../../utils/util.js');
const app = getApp()
Page({ Page({


/** /**
let { businessCommunicationDemandId, isOnTop } = item; let { businessCommunicationDemandId, isOnTop } = item;
this.showLoading(); this.showLoading();
$request.post(`/businessCommunicationDemand/setOnTopOrDown.action`, $request.post(`/businessCommunicationDemand/setOnTopOrDown.action`,
{ businessCommunicationDemandId, isOnTop: isOnTop ? 0 : 1, customerId: "666967" }
{ businessCommunicationDemandId, isOnTop: isOnTop ? 0 : 1, customerId: this.data.customerId }
).then(res => { ).then(res => {
wx.hideLoading() wx.hideLoading()
if (res.status == 0) { if (res.status == 0) {

Laden…
Annuleren
Opslaan