Selaa lähdekoodia

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

release/210823_需求对对碰
王饶冀 3 vuotta sitten
vanhempi
commit
ad90b950f6

+ 1
- 0
app.js Näytä tiedosto

@@ -67,6 +67,7 @@ App({
}
if(businessCommunicationCustomer){
this.globalData.businessCommunicationCustomer = businessCommunicationCustomer;
this.globalData.customerId = businessCommunicationCustomer.customerId;
}
}
}

+ 5
- 2
pages/index/components/homepage/homepage.js Näytä tiedosto

@@ -30,6 +30,8 @@ Page({
postDemand: 0,
// 被浏览量
totalPageView: 0,
// 是他人主业还是个人主业
isOther:false,
},

/**
@@ -39,10 +41,11 @@ Page({
const eventChannel = this.getOpenerEventChannel()
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
eventChannel.on('customerid', data => {
console.log(data)
console.log(data,'customerid')
this.setData({
customerId: data.customerid,
pageLoading: true
pageLoading: true,
isOther:data.customerid != app.globalData.customerId
})
this.getListData();
})

+ 1
- 1
pages/index/components/homepage/homepage.wxml Näytä tiedosto

@@ -11,7 +11,7 @@
</view>
<view class="customer-info fl">
<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 class="service-project" wx:if="{{ !!customer.serviceProject }}">

+ 2
- 1
pages/myModule/components/myRelease/myRelease.js Näytä tiedosto

@@ -1,6 +1,7 @@
// pages/myModule/components/myRelease/myRelease.js
const $request = require('../../../../utils/request.js');
const $util = require('../../../../utils/util.js');
const app = getApp()
Page({

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

Loading…
Peruuta
Tallenna