소스 검색

处理查看主页相关逻辑

release/210823_需求对对碰
王饶冀 4 년 전
부모
커밋
fed5f32994

+ 15
- 10
components/listItem/listItem.js 파일 보기

// index => 首页 detatil => 详情 homepage => 个人主页 // index => 首页 detatil => 详情 homepage => 个人主页
pageStatus: { pageStatus: {
type: String, type: String,
default: 'index',
value: 'index',
}, },
// 是否收藏 // 是否收藏
isCollect: { isCollect: {
type: Boolean, type: Boolean,
default: false
value:false,
},
// 是否其他查看主页---用于是否显示聊一聊
isOther:{
type: Boolean,
value:true,
}, },
// 类名 // 类名
listClass: { listClass: {
type: String, type: String,
default: "",
value: "",
}, },
}, },


return return
} }
console.log(`点击了聊一聊`) console.log(`点击了聊一聊`)
wx.navigateTo({
url:"/pages/msgModule/wechat2/wechat2",
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('customerid', { customerid })
}
})
// wx.navigateTo({
// url:"/pages/msgModule/wechat2/wechat2",
// success: function (res) {
// // 通过eventChannel向被打开页面传送数据
// res.eventChannel.emit('customerid', { customerid })
// }
// })
}, },
} }
}) })

+ 2
- 2
components/listItem/listItem.wxml 파일 보기

</view> </view>
<view class="fl list-foot-text-lf"> <view class="fl list-foot-text-lf">
<image class="browse-img" src="/images/home/browse-icon.png" /> <image class="browse-img" src="/images/home/browse-icon.png" />
{{ item.pageView }}浏览量
{{ item.pageView || 0}}浏览量
</view> </view>
<view class="fl list-collect-view" wx:if="{{ pageStatus == 'detatil' }}" bindtap="productCollect"> <view class="fl list-collect-view" wx:if="{{ pageStatus == 'detatil' }}" bindtap="productCollect">
<image class="collect-img" src="/images/home/is-collect.png" wx:if="{{ isCollect }}" /> <image class="collect-img" src="/images/home/is-collect.png" wx:if="{{ isCollect }}" />
<image class="collect-img" src="/images/home/not-collect.png" wx:else /> <image class="collect-img" src="/images/home/not-collect.png" wx:else />
收藏 收藏
</view> </view>
<view class="fr list-foot-text-chat" wx:if="{{ pageStatus != 'myRelease' }}" bindtap="goToChat">
<view class="fr list-foot-text-chat" wx:if="{{ pageStatus != 'myRelease' && isOther }}" bindtap="goToChat">
<image class="chat-img" src="/images/home/chat-icon.png" /> <image class="chat-img" src="/images/home/chat-icon.png" />
聊一聊 聊一聊
</view> </view>

+ 1
- 0
pages/index/components/homepage/homepage.js 파일 보기

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

+ 2
- 2
pages/index/components/homepage/homepage.wxml 파일 보기

</view> </view>
<view wx:else> <view wx:else>
<view class="list-view" wx:for="{{ listData }}" wx:key="*this"> <view class="list-view" wx:for="{{ listData }}" wx:key="*this">
<listItem item="{{ item }}" bind:getItem="goDetails" pageStatus="homepage"/>
<listItem item="{{ item }}" bind:getItem="goDetails" pageStatus="homepage" isOther="{{ isOther }}"/>
</view> </view>
<view class="text-center" wx:if="{{ itemLoading }}"> <view class="text-center" wx:if="{{ itemLoading }}">
<van-loading size="24px">加载中...</van-loading> <van-loading size="24px">加载中...</van-loading>
round round
bind:click="footBtnClick" bind:click="footBtnClick"
> >
立即沟通
{{ isOther ? '立即沟通' : '发布需求'}}
</van-button> </van-button>
</view> </view>
</view> </view>

+ 3
- 1
pages/releaseModule/index.js 파일 보기

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


/** /**
if (res1.confirm) { if (res1.confirm) {
that.clearData(); that.clearData();
console.log('用户点击确定') console.log('用户点击确定')
} else if (res1.cancel) {
} else if (res1.cancel) {
let listDetail = res.data; let listDetail = res.data;
if (typeof listDetail.type == 'string') { if (typeof listDetail.type == 'string') {
listDetail.type = listDetail.type.split(','); listDetail.type = listDetail.type.split(',');
listDetail.createdOn = $util.formatTime(new Date(el.createdOn), true);
} }
that.clearData(); that.clearData();
wx.navigateTo({ wx.navigateTo({

Loading…
취소
저장