소스 검색

提交代码~

release/210823_需求对对碰
王饶冀 3 년 전
부모
커밋
422345341a

+ 8
- 6
app.json 파일 보기

@@ -1,27 +1,29 @@
{
"pages":[
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/releaseModule/index",
"pages/myModule/index",
"pages/msgModule/index"
"pages/msgModule/index",
"pages/index/components/listDetails/Details"
],
"usingComponents": {
"tabBar": "/components/tabbar/tabbar",
"listItem":"/components/listItem/listItem",
"van-loading": "/miniprogram_npm/@vant/weapp/loading",
"van-icon": "/miniprogram_npm/@vant/weapp/icon",
"van-row": "/miniprogram_npm/@vant/weapp/row",
"van-col": "/miniprogram_npm/@vant/weapp/col"
},
"window":{
"backgroundTextStyle":"light",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "业务交流通",
"navigationBarTextStyle":"black"
"navigationBarTextStyle": "black"
},
"sitemapLocation": "sitemap.json",
"useExtendedLib": {
"kbone": true,
"weui": true
}
}
}

+ 49
- 0
app.wxss 파일 보기

@@ -30,4 +30,53 @@
}
.not-data .not-info{
color: #b3bfcb;
}


/* 通用page容器 */
.page-container{
background: #f5f9ff;
padding: 20rpx;
min-height: calc(100vh - 130rpx);
padding-bottom: 120rpx;
font-size: 26rpx;
}

/* 通用渐变感兴趣的 */
.view-interested{
background: #c9d6ff; /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #c9d6ff, #f4f9ff); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #c9d6ff, #f4f9ff); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
font-size: 24rpx;
height: 52rpx;
line-height: 52rpx;
color: #5e73e5;
box-sizing: border-box;
padding-left: 28rpx;
border-radius: 15rpx 0 0 0;
}

/* 通用list */
/* list块 */
.list-view {
background: #fff;
/* height: 315rpx; */
border-radius: 20rpx;
margin-bottom: 20rpx;
padding: 28rpx 18rpx;
position: relative;
}

.list-loading {
margin-top: 15vh;
}
.list-finished{
color: #8c97c0;
}
.list-finished .finished-img{
width: 25rpx;
height: 25rpx;
margin-right: 10rpx;
position: relative;
top: 1rpx;
}

+ 35
- 0
components/listItem/listItem.js 파일 보기

@@ -0,0 +1,35 @@
// components/listItem/listItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
},
// index => 首页 detatil => 详情 home => 个人主页
pageStatus: {
type: String,
default: 'index',
},
},

/**
* 组件的初始数据
*/
data: {
// 是否收藏
isCollect:false,
},

/**
* 组件的方法列表
*/
methods: {
// 进入详情
goDetails(e) {
let dataset = e.currentTarget.dataset;
this.triggerEvent('getItem', dataset.item);
},
}
})

+ 4
- 0
components/listItem/listItem.json 파일 보기

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

+ 52
- 0
components/listItem/listItem.wxml 파일 보기

@@ -0,0 +1,52 @@
<!-- components/listItem/listItem.wxml -->
<!-- 平台认证 -->
<view class="list-certification" wx:if="{{ item.isPartner }}">
<image class="certification-img" src="/images/home/certification-icon.png" />
平台认证
</view>
<!-- 头部 -->
<view class="list-avatar">
<view class="list-chatHeads fl">
<image class="chatHeads-img" src="{{ item.chatHeads }}" />
</view>
<view class="list-nick-name fl">{{ item.nickName }}</view>
<view class="list-home fl">
<image class="home-img" src="{{ item.isPartner ? '/images/home/company-icon.png' : '/images/home/personal-icon.png' }}" />
主页
</view>
</view>
<!-- 内容 -->
<view class="list-content">
<view bindtap="goDetails" data-item="{{ item }}">
<!-- 详情 -->
<view>
<text space class="list-details-text need">{{ item.info }}</text>
</view>
<!-- 标签 -->
<view class="list-tag-view">
<view class="list-tag" wx:for="{{ item.type }}" wx:for-item="tag" wx:key="*this">
{{ tag }}
</view>
</view>
</view>
<!-- 底部 -->
<view class="list-foot {{ pageStatus == 'detatil' ? 'is-details-page' : '' }}">
<view class="fl list-foot-text-lf">
<image class="time-img" src="/images/home/time-icon.png" />
{{ item.createdOn }}
</view>
<view class="fl list-foot-text-lf">
<image class="browse-img" src="/images/home/browse-icon.png" />
{{ item.pageView }}浏览量
</view>
<view class="fl list-collect-view" wx:if="{{ pageStatus == 'detatil' }}">
<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">
<image class="chat-img" src="/images/home/chat-icon.png" />
聊一聊
</view>
</view>
</view>

+ 172
- 0
components/listItem/listItem.wxss 파일 보기

@@ -0,0 +1,172 @@
/* components/listItem/listItem.wxss */

.fl {
float: left;
}
.fr {
float: right;
}


/* list块-头部 */
.list-avatar {
height: 60rpx;
line-height: 60rpx;
}
.list-chatHeads{
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: #999;
}
.list-chatHeads .chatHeads-img{
width: 100%;
height: 100%;
border-radius: 50%;
}
/* 平台认证 */
.list-certification {
position: absolute;
right: 0;
top: 22rpx;
width: 130rpx;
height: 40rpx;
line-height: 40rpx;
background-color: #fff0be;
border-radius: 18rpx 0 0 18rpx;
text-align: center;
color: #ef6f10;
font-size: 20rpx;
}
.list-certification .certification-img{
width: 26rpx;
height: 27rpx;
position: relative;
top: 6rpx;
}
/* 名称 */
.list-nick-name {
margin-left: 15rpx;
max-width: 300rpx;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
font-weight: bold;
}
/* 主页 */
.list-home {
color: #827de5;
border-radius: 16px;
border: solid 1px #827de5;
width: 96rpx;
height: 32rpx;
line-height: 32rpx;
font-size: 20rpx;
text-align: center;
margin-top: 15rpx;
margin-left: 15rpx;
}
.list-home .home-img{
width: 22rpx;
height: 23rpx;
position: relative;
top: 2rpx;
}

/* 内容容器 */
.list-content {
padding-left: 75rpx;
padding-right: 15rpx;
}
/* 详情 */
.list-details-text{
margin: 15rpx 0;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
}
.list-details-text.need {
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
/* 标签 */
.list-tag-view {
margin-bottom: 20rpx;
}
.list-tag-view .list-tag{
display: inline-block;
width: 120rpx;
height: 36rpx;
border-radius: 18rpx;
text-align: center;
line-height: 36rpx;
font-size: 20rpx;
margin-right: 15rpx;
}
.list-tag-view .list-tag:nth-child(1){
background-color: #e4f1f7;
color: #3d97e6;
}
.list-tag-view .list-tag:nth-child(2){
background-color: #f7eee4;
color: #f29f61;
}
.list-tag-view .list-tag:nth-child(3){
background-color: #eafee3;
color: #80c269;
}

/* 底部 */
.list-foot {
height: 62rpx;
line-height: 62rpx;
}
.list-foot-text-lf{
color: #999;
font-size: 22rpx;
margin-right: 40rpx;
}
.list-foot-text-lf .browse-img{
width: 24rpx;
height: 18rpx;
}
.list-foot-text-lf .time-img{
width: 24rpx;
height: 24rpx;
position: relative;
top: 1rpx;
}
.list-foot-text-chat {
height: 62rpx;
width: 180rpx;
background-color: #5e73e5;
box-shadow: -1px 3px 12px 4px
rgba(62, 95, 179, 0.14);
border-radius: 31rpx;
text-align: center;
color: #fff;
font-size: 24rpx;
}
.list-foot-text-chat .chat-img{
width: 28rpx;
height: 28rpx;
position: relative;
top: 4rpx;
left: -10rpx;
}

.list-collect-view .collect-img {
width: 22rpx;
height: 19rpx;
}
.list-collect-view {
color: #e16531;
font-size: 22rpx;
position: relative;
top: 1rpx;
}

.is-details-page .list-foot-text-lf{
margin-right: 20rpx;
}

BIN
images/home/is-collect.png 파일 보기


BIN
images/home/not-collect.png 파일 보기


+ 123
- 0
pages/index/components/listDetails/Details.js 파일 보기

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

/**
* 页面的初始数据
*/
data: {
// 页面Loading
pageLoading: false,
// 路由接受的参数
currentData: {},
// 感兴趣的需求----
// item行加载
itemLoading: false,
// 数据是否加载完成
isFinished: false,
listData: [],
page: 1,
size: 10,
total: 0,
// 是否加载数据,true加载,false不加载
onRefresh: true,
currentIndex: 0,
},

/**
* 生命周期函数--监听页面加载
*/
onLoad(option) {
const eventChannel = this.getOpenerEventChannel()
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
eventChannel.on('acceptDataFromOpenerPage', data => {
this.setData({
currentData: data.listDetail,
type: data.listDetail.type.join(),
pageLoading: true,
})
this.getListData();
})
},
// 热门详情点击
goDetails(e){
this.setData({
currentData: e.detail,
type: e.detail.type.join(),
pageLoading: true,
listData:[],
page:1,
onRefresh:true,
})
this.getListData();
},
// 获取list数据
getListData() {
let { page, size, type } = this.data;
$request.get('/businessCommunicationDemand/getDemandByKeywordOrType.action',
{ page, size, type, isInterest: 1 }
).then(res => {
this.setData({
pageLoading: false,
})
let tempListData = this.data.listData;
if (res.status == 0) {
let datas = res.data;
// 先push数据
tempListData.push(...datas.demandList);
tempListData.forEach(el => {
el.createdOn = $util.formatTime(new Date(el.createdOn), true);
if (typeof el.type == 'string') {
el.type = el.type.split(',');
}
})
// 设置总数
this.setData({
listData: tempListData,
total: res.data.total,
})
// 如果数据大于了返回的总数
if (tempListData.length >= this.data.total) {
// 停止累加数据
this.setData({
onRefresh: false,
itemLoading: false,
isFinished: true,
})
} else {
this.setData({
onRefresh: true,
itemLoading: false,
isFinished: false,
page: page + 1
})
}
console.log('-------------详情页 beg-------------------')
console.log(this.data.listData);
console.log('-------------详情页 end-------------------')
}
}).catch(error => {
console.log(error, 'error appletLogin')
})
},
/*
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
if (this.data.onRefresh) {
this.setData({
itemLoading: true
})
this.getListData();
}
},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 3
- 0
pages/index/components/listDetails/Details.json 파일 보기

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

+ 24
- 0
pages/index/components/listDetails/Details.wxml 파일 보기

@@ -0,0 +1,24 @@
<!-- pages/index/components/listDetails/Details.wxml -->
<view class="details-page page-container">
<view class="list-loading text-center" wx:if="{{ pageLoading }}">
<van-loading size="24px">加载中...</van-loading>
</view>
<view wx:else>
<view class="list-view">
<listItem item="{{ currentData }}" pageStatus="detatil"/>
</view>
<view class="view-interested">你可能感兴趣的需求</view>
<view class="list-view" wx:for="{{ listData }}" wx:key="*this">
<listItem item="{{ item }}" bind:getItem="goDetails"/>
</view>
<view class="text-center" wx:if="{{ itemLoading }}">
<van-loading size="24px">加载中...</van-loading>
</view>
<view class="list-finished text-center" wx:if="{{ isFinished }}">
<image class="finished-img" src="/images/home/finished-icon.png" />
没有更多啦~
</view>
</view>
<tabBar currentIndex="{{currentIndex}}"></tabBar>
</view>

+ 1
- 0
pages/index/components/listDetails/Details.wxss 파일 보기

@@ -0,0 +1 @@
/* pages/index/components/listDetails/Details.wxss */

+ 23
- 10
pages/index/index.js 파일 보기

@@ -2,6 +2,7 @@
// 获取应用实例
const app = getApp()
const $request = require('../../utils/request.js');
const $util = require('../../utils/util.js');
Page({
data: {
currentIndex: 0,
@@ -109,10 +110,19 @@ Page({
})
this.toSearch();
},
// 进入详情
goDetails(e) {
wx.navigateTo({
url: '/pages/index/components/listDetails/Details',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('acceptDataFromOpenerPage', { listDetail: e.detail })
}
})
},
// 获取tab数据
getAllType() {
$request.get('/businessCommunicationType/getAllType.action').then(res => {
console.log(res);
if (res.status == 0) {
let { tabData, moreTabOption } = this.data;
let datas = res.data;
@@ -151,7 +161,7 @@ Page({
type = "";
}
$request.get('/businessCommunicationDemand/getDemandByKeywordOrType.action',
{ page, size, keyword, type }
{ page, size, keyword, type,isInterest:0 }
).then(res => {
// console.log(res);
this.setData({
@@ -163,6 +173,7 @@ Page({
// 先push数据
tempListData.push(...datas.demandList);
tempListData.forEach(el => {
el.createdOn = $util.formatTime(new Date(el.createdOn),true);
if (typeof el.type == 'string') {
el.type = el.type.split(',');
}
@@ -188,7 +199,9 @@ Page({
page: page + 1
})
}
console.log('-------------首页 beg-------------------')
console.log(this.data.listData);
console.log('-------------首页 end-------------------')
}
}).catch(error => {
console.log(error, 'error appletLogin')
@@ -211,15 +224,15 @@ Page({
*/
getPhoneNumber(e) {
if (!!e.detail.iv && !!e.detail.encryptedData) {
const iv = e.detail.iv
const encryptedData = e.detail.encryptedData
this.appletLogin(iv, encryptedData)
const iv = e.detail.iv
const encryptedData = e.detail.encryptedData
this.appletLogin(iv, encryptedData)
} else {
wx.showToast({
title: '请允许授权,获得更好的服务哦',
icon: "none",
duration: 3000
})
wx.showToast({
title: '请允许授权,获得更好的服务哦',
icon: "none",
duration: 3000
})
}
},
/**

+ 3
- 46
pages/index/index.wxml 파일 보기

@@ -1,5 +1,5 @@
<!-- index.wxml -->
<view class="home-page">
<view class="home-page page-container">
<!-- 搜索块 -->
<view class="search-view">
<view class="serach-input-view">
@@ -45,7 +45,7 @@
<view wx:else>
<view class="not-data" wx:if="{{ listData.length < 1 }}">
<image class="not-data-img" src="/images/home/not-data.png" />
<view class="not-info" wx:if="{{ currentTab == 'all' }}">
<view class="not-info" wx:if="{{ currentTab == 'all ' }}">
抱歉,暂无任何需求
</view>
<view class="not-info" wx:else>
@@ -54,50 +54,7 @@
</view>
<view wx:else>
<view class="list-view" wx:for="{{ listData }}" wx:key="*this">
<!-- 平台认证 -->
<view class="list-certification" wx:if="{{ item.isPartner }}">
<image class="certification-img" src="/images/home/certification-icon.png" />
平台认证
</view>
<!-- 头部 -->
<view class="list-avatar">
<view class="list-chatHeads fl">
<image class="chatHeads-img" src="{{ item.chatHeads }}" />
</view>
<view class="list-nick-name fl">{{ item.nickName }}</view>
<view class="list-home fl">
<image class="home-img" src="{{ item.isPartner ? '/images/home/company-icon.png' : '/images/home/personal-icon.png' }}" />
主页
</view>
</view>
<!-- 内容 -->
<view class="list-content">
<!-- 详情 -->
<view>
<text space class="list-details-text">{{ item.info }}</text>
</view>
<!-- 标签 -->
<view class="list-tag-view">
<view class="list-tag" wx:for="{{ item.type }}" wx:for-item="tag" wx:key="*this">
{{ tag }}
</view>
</view>
<!-- 底部 -->
<view class="list-foot">
<view class="fl list-foot-text-lf">
<image class="time-img" src="/images/home/time-icon.png" />
2021-07-23
</view>
<view class="fl list-foot-text-lf">
<image class="browse-img" src="/images/home/browse-icon.png" />
897浏览量
</view>
<view class="fr list-foot-text-chat">
<image class="chat-img" src="/images/home/chat-icon.png" />
聊一聊
</view>
</view>
</view>
<listItem item="{{ item }}" bind:getItem="goDetails"/>
</view>
<view class="text-center" wx:if="{{ itemLoading }}">
<van-loading size="24px">加载中...</van-loading>

+ 0
- 173
pages/index/index.wxss 파일 보기

@@ -1,11 +1,4 @@
/**index.wxss**/
.home-page {
background: #f5f9ff;
padding: 20rpx;
min-height: 100%;
padding-bottom: 120rpx;
font-size: 26rpx;
}

/* 搜索块 */
.search-view {
@@ -153,170 +146,4 @@
.tab-view .tab-menu .van-ellipsis{
display: none;
}
/* list块 */
.list-view {
background: #fff;
/* height: 315rpx; */
border-radius: 20rpx;
margin-bottom: 20rpx;
padding: 28rpx 18rpx;
position: relative;
}
.list-loading {
margin-top: 15vh;
}
.list-finished{
color: #8c97c0;
}
.list-finished .finished-img{
width: 25rpx;
height: 25rpx;
margin-right: 10rpx;
position: relative;
top: 1rpx;
}

/* list块-头部 */
.list-avatar {
height: 60rpx;
line-height: 60rpx;
}
.list-chatHeads{
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: #999;
}
.list-chatHeads .chatHeads-img{
width: 100%;
height: 100%;
border-radius: 50%;
}
/* 平台认证 */
.list-certification {
position: absolute;
right: 0;
top: 22rpx;
width: 130rpx;
height: 40rpx;
line-height: 40rpx;
background-color: #fff0be;
border-radius: 18rpx 0 0 18rpx;
text-align: center;
color: #ef6f10;
font-size: 20rpx;
}
.list-certification .certification-img{
width: 26rpx;
height: 27rpx;
position: relative;
top: 6rpx;
}
/* 名称 */
.list-nick-name {
margin-left: 15rpx;
max-width: 300rpx;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
font-weight: bold;
}
/* 主页 */
.list-home {
color: #827de5;
border-radius: 16px;
border: solid 1px #827de5;
width: 96rpx;
height: 32rpx;
line-height: 32rpx;
font-size: 20rpx;
text-align: center;
margin-top: 15rpx;
margin-left: 15rpx;
}
.list-home .home-img{
width: 22rpx;
height: 23rpx;
position: relative;
top: 2rpx;
}

/* 内容容器 */
.list-content {
padding-left: 75rpx;
padding-right: 15rpx;
}
/* 详情 */
.list-details-text{
margin: 15rpx 0;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
/* 标签 */
.list-tag-view {
margin-bottom: 20rpx;
}
.list-tag-view .list-tag{
display: inline-block;
width: 120rpx;
height: 36rpx;
border-radius: 18rpx;
text-align: center;
line-height: 36rpx;
font-size: 20rpx;
margin-right: 15rpx;
}
.list-tag-view .list-tag:nth-child(1){
background-color: #e4f1f7;
color: #3d97e6;
}
.list-tag-view .list-tag:nth-child(2){
background-color: #f7eee4;
color: #f29f61;
}
.list-tag-view .list-tag:nth-child(3){
background-color: #eafee3;
color: #80c269;
}
/* 底部 */
.list-foot {
height: 62rpx;
line-height: 62rpx;
}
.list-foot-text-lf{
color: #999;
font-size: 24rpx;
margin-right: 40rpx;
}
.list-foot-text-lf .browse-img{
width: 24rpx;
height: 18rpx;
}
.list-foot-text-lf .time-img{
width: 24rpx;
height: 24rpx;
position: relative;
top: 1rpx;
}
.list-foot-text-chat {
height: 62rpx;
width: 180rpx;
background-color: #5e73e5;
box-shadow: -1px 3px 12px 4px
rgba(62, 95, 179, 0.14);
border-radius: 31rpx;
text-align: center;
color: #fff;
font-size: 24rpx;
}
.list-foot-text-chat .chat-img{
width: 28rpx;
height: 28rpx;
position: relative;
top: 4rpx;
left: -10rpx;
}

+ 27
- 6
pages/releaseModule/index.js 파일 보기

@@ -1,9 +1,30 @@
// pages/release/release.js
// 获取应用实例
// pages/index/components/listDetails/Details.js
const app = getApp()
const $request = require('../../utils/request.js');
Page({
data: {
currentIndex: 1
},

/**
* 页面的初始数据
*/
data: {
currentIndex: 1,
pageLoading:false,
tags:[],
},

/**
* 生命周期函数--监听页面加载
*/
onLoad() {
this.getTags();
},
getTags(){
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 2
- 2
project.config.json 파일 보기

@@ -35,10 +35,10 @@
"userConfirmedBundleSwitch": false,
"packNpmManually": true,
"packNpmRelationList": [
{
{
"packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./miniprogram_npm/"
}
}
],
"minifyWXSS": true,
"showES6CompileOption": false

+ 6
- 3
utils/util.js 파일 보기

@@ -1,12 +1,15 @@
const formatTime = date => {
const formatTime = (date,notHour) => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()

return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
if(notHour){
return `${[year, month, day].map(formatNumber).join('/')}`
}else{
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
}
}

const formatNumber = n => {

Loading…
취소
저장