[新增]企业主页,企业活动

This commit is contained in:
zdx
2020-12-28 10:38:29 +08:00
parent d3fa1d743c
commit 3a559141d1
106 changed files with 4587 additions and 164 deletions

View File

@@ -0,0 +1,92 @@
// components/videoList/videoList.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
lists:[],//列表
categoryList:[],
category_id:'0',
company_id:wx.getStorageSync('company_id'),
page:1,
has_more:true,
},
/**
* 组件的方法列表
*/
methods: {
/**
* 跳转到详情
*/
toUrl(e){
wx.navigateTo({
url: '/pages/home/projectDetail/projectDetail?id='+e.currentTarget.dataset.id,
})
},
/**
* 点击按钮触发事件
*/
menuSelect: function (e) {
var category_id=e.currentTarget.dataset.id;
if(this.data.category_id!=category_id){
console.log(category_id);
this.setData({
category_id:category_id,
lists:[],
page:1,
has_more:true
})
this.crowdfunds();
}
},
/**
* 请求项目筹集分类接口
*/
crowdfundcategory(company_id){
wx.$api.companyModule.crowdfundcategory(company_id).then(res=>{
console.log(res)
this.setData({
categoryList:res,
category_id:res[0].id
})
this.crowdfunds();
})
},
/**
* 请求根据分类获取列表
*/
crowdfunds(){
if(this.data.has_more){
wx.$api.companyModule.crowdfunds(this.data.company_id,this.data.category_id,this.data.page).then(res=>{
console.log(res)
if(res.page.has_more){
this.setData({
has_more:true,
page:this.data.page+1,
})
}else{
this.setData({
has_more:false
})
}
var lists=this.data.lists.concat(res.data);
this.setData({
lists:lists
})
})
}
},
}
})

View File

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

View File

@@ -0,0 +1,41 @@
<!-- 分类 -->
<view class="scroll_menu">
<scroll-view class="scroll-view_H" scroll-x="true" bindscroll="scroll" style="width: 100%">
<view id="menu1" wx:for='{{categoryList}}' catchtap="menuSelect" data-id='{{item.id}}'
class="scroll-view-item_H {{category_id==item.id?'scroll_view_select':''}}">{{item.title}}</view>
</scroll-view>
</view>
<view class="project_content" wx:for='{{lists}}' catchtap="toUrl" data-id='{{item.crowdfund_id}}'>
<view class="project_cover">
<view class="project_type_icon" wx:if='{{item.status==2}}'>{{item.status_text}}</view>
<image class="project_cover_bg" src="{{item.cover}}" mode="aspectFill"></image>
</view>
<view class="project_title">{{item.title}}</view>
<view class="project_bottom ">
<span class="color333">{{item.city}}/{{item.category}}</span>
<span class="color333">{{item.ratio}}%</span>
</view>
<view class="project_line">
<progress percent="{{item.ratio*100}}" color="#378fff" active stroke-width="6" />
</view>
<view class="project_bottom" wx:if='{{item.status==1}}'>
<span>筹集金额 ¥{{item.amount}}</span>
<span>剩余天数 {{item.diffDays}}天</span>
</view>
<view class="project_bottom" wx:elif='{{item.status==3}}'>
<span></span>
<span>已成功</span>
</view>
<view class="project_bottom" wx:elif='{{item.status==2}}'>
<span>倒计时{{item.openDiffDays}}</span>
<span>{{item.likes}}人关注</span>
</view>
<view class="project_bottom" wx:elif='{{item.status==4}}'>
<span></span>
<span>已结束</span>
</view>
</view>
<view class="has_more">{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}</view>

View File

@@ -0,0 +1,136 @@
.project_content {
background-color: #fff;
margin: 20rpx;
box-sizing: border-box;
}
.project_cover {
width: 100%;
height: 340rpx;
position: relative;
overflow: hidden;
padding-bottom: 0;
}
.project_cover_bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
}
.project_type_icon {
position: absolute;
top: 10rpx;
left: 10rpx;
background-color: #ffcc00;
border-radius: 4rpx;
color: #4a1900;
padding: 6rpx 16rpx;
font-size: 24rpx;
z-index: 1;
}
.project_title {
margin-top: 20rpx;
padding: 0 20rpx;
color: #333;
font-weight: 600;
font-size: 28rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
}
.project_des {
margin-top: 14rpx;
padding: 0 10rpx;
color: #666;
font-size: 24rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.project_time {
margin-top: 14rpx;
padding: 0 10rpx;
color: #666;
font-size: 26rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.project_line {
margin: 0 20rpx;
border-bottom: solid 1rpx #f7f7f7;
}
.project_bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
font-size: 36rpx;
font-weight: 600;
color: #333;
padding: 20rpx;
}
.project_bottom span {
color: #999;
font-size: 24rpx;
font-weight: normal;
}
.project_bottom .color333 {
color: #666;
}
/* 滚动菜单 */
.scroll_menu{
/* background-color: #fff; */
/* box-shadow: 0 0rpx 10px rgba(0, 0, 0, 0.1); */
font-size: 26rpx;
}
.scroll-view_H{
white-space: nowrap;
color: #666;
}
.scroll-view-item{
height: 90rpx;
line-height: 90rpx;
}
.scroll-view-item_H{
display: inline-block;
/* width: 25%; */
padding: 0 30rpx;
height: 90rpx;
line-height: 90rpx;
text-align: center;
/* border-top: solid 10rpx #fff;
border-bottom: solid 10rpx #fff; */
}
.scroll_view_select{
/* border-bottom: solid 4rpx #378fff; */
color: #378fff;
font-weight: 600;
}
.has_more{
color: #999;
font-size: 26rpx;
text-align: center;
padding: 30rpx ;
}