浏览代码

处理查看主页相关逻辑

release/210823_需求对对碰
王饶冀 3 年前
父节点
当前提交
fed5f32994

+ 15
- 10
components/listItem/listItem.js 查看文件

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

@@ -66,13 +71,13 @@ Component({
return
}
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 查看文件

@@ -44,14 +44,14 @@
</view>
<view class="fl list-foot-text-lf">
<image class="browse-img" src="/images/home/browse-icon.png" />
{{ item.pageView }}浏览量
{{ item.pageView || 0}}浏览量
</view>
<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/not-collect.png" wx:else />
收藏
</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" />
聊一聊
</view>

+ 1
- 0
pages/index/components/homepage/homepage.js 查看文件

@@ -1,4 +1,5 @@
// pages/index/components/homepage/homepage.js
const app = getApp()
const $request = require('../../../../utils/request.js');
const $util = require('../../../../utils/util.js');
Page({

+ 2
- 2
pages/index/components/homepage/homepage.wxml 查看文件

@@ -54,7 +54,7 @@
</view>
<view wx:else>
<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 class="text-center" wx:if="{{ itemLoading }}">
<van-loading size="24px">加载中...</van-loading>
@@ -72,7 +72,7 @@
round
bind:click="footBtnClick"
>
立即沟通
{{ isOther ? '立即沟通' : '发布需求'}}
</van-button>
</view>
</view>

+ 3
- 1
pages/releaseModule/index.js 查看文件

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

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

正在加载...
取消
保存