You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

231 lines
4.9 KiB

3 years ago
<template>
<!-- sdsd 345 -->
3 years ago
<view class="activityCenter-page">
3 years ago
<image src="https://download.cyjyyjy.com/center-img.png" class="top-bg"></image>
3 years ago
<view class="pageTitle-box" :class="isFixed ? 'showPageTitle' : ''"
:style="{'padding-top':navTopHeight + 'px',height:navHeight*2+ 'px'}">
<view class="page-title acea-row row-center row-middle"
:style="'top:' + menuTop + 'px;height:' + menuHeight + 'px;line-height: ' + menuHeight + 'px;'"><image src="../../../static/images/arror-right.png" mode="" class="page-back" @tap="toBackHome"></image>活动中心
</view>
</view>
3 years ago
<view class="activity-box">
3 years ago
<view class="activity-list acea-row" v-for="(item,index) in activity" :key="index" @tap="toActiveDetail"
:data-id="item.id">
<image :src="item.images" mode="aspectFill" class="act-img"></image>
3 years ago
<view class="act-con acea-row row-column-between">
3 years ago
<view class="title line2">{{item.name}}</view>
3 years ago
<view class="act-time acea-row row-middle">
<image src="../../../static/images/act-time.png" mode="" class="time-img"></image>
3 years ago
<view>{{item.activityStartTime.split(' ')[0]}}{{item.activityEndTime.split(' ')[0]}}</view>
3 years ago
</view>
<view class="act-adress acea-row">
<image src="../../../static/images/act-address.png" mode="" class="address-img"></image>
3 years ago
<view class="title-line line2">{{item.address}}</view>
3 years ago
</view>
<view class="acea-row row-between-wrapper act-price">
3 years ago
<text class="act-p">{{item.price}}</text>
3 years ago
<text class="act-i">进行中</text>
<view class="enter-btn">立即报名</view>
</view>
</view>
</view>
3 years ago
</view>
3 years ago
</view>
</template>
<script>
3 years ago
import {
getIndexData
} from "@/api/home";
3 years ago
const app = getApp();
export default {
data() {
3 years ago
return {
3 years ago
menuHeight: app.globalData.menuHeight,
3 years ago
navHeight: app.globalData.navHeight,
3 years ago
menuTop: app.globalData.menuTop,
3 years ago
navTopHeight: app.globalData.navTopHeight,
3 years ago
activity: [], //活动列表
3 years ago
isFixed: false,
};
},
onPageScroll(e) {
if (e.scrollTop > 60) {
this.isFixed = true;
} else {
this.isFixed = false;
3 years ago
};
3 years ago
},
3 years ago
mounted: function() {
this.getIndexData()
},
methods: {
getIndexData() {
getIndexData().then(res => {
this.activity = res.data.recommendActivity.content
})
},
toActiveDetail(e) {
let id = e.currentTarget.dataset.id;
uni.navigateTo({
url: '/pages/activity/detail/index?id=' + id
});
},
3 years ago
toBackHome(e){
console.log("1")
uni.navigateBack();
}
3 years ago
}
3 years ago
}
</script>
<style lang="less">
3 years ago
.activityCenter-page {
3 years ago
width: 100%;
height: auto;
background: #fff;
position: relative;
}
3 years ago
.top-bg {
width: 100%;
height: 1210rpx;
3 years ago
position: absolute;
3 years ago
}
3 years ago
3 years ago
.pageTitle-box {
width: 100%;
position: fixed;
top: 0;
z-index: 99;
transition: all .5s;
}
.showPageTitle {
background: #fff;
color: #000000 !important;
opacity: 1;
.page-title {
color: #000;
}
.page-back {
width: 18rpx;
height: 30rpx;
background: url(../../../static/images/arror-right.png) no-repeat center center;
background-size: 100% 100%;
transform: rotateY(180deg);
}
}
3 years ago
.page-title {
3 years ago
position: absolute;
3 years ago
width: 100%;
color: #fff;
3 years ago
font-weight: 600;
font-size: 32rpx;
3 years ago
text-align: center;
3 years ago
transition: all .5s cubic-bezier(.25, .5, .5, .9);
}
.page-back {
width: 18rpx;
height: 30rpx;
position: absolute;
left: 40rpx;
transform: rotateY(180deg);
3 years ago
}
3 years ago
.activity-box {
3 years ago
width: 100%;
height: auto;
background: #FFF;
position: absolute;
top: 538rpx;
border-radius: 30rpx 30rpx 0 0;
padding: 32rpx 40rpx 0 40rpx;
margin-bottom: 218rpx;
}
3 years ago
.activity-list {
3 years ago
border-bottom: 1px solid #EEEEEE;
padding: 20rpx 0;
3 years ago
.act-img {
3 years ago
width: 178rpx;
height: 236rpx;
margin-right: 20rpx;
3 years ago
border-radius: 8rpx;
3 years ago
}
3 years ago
.act-con {
3 years ago
width: 450rpx;
height: 236rpx;
padding: 5rpx 0;
3 years ago
.title {
3 years ago
font-size: 28rpx;
font-weight: 600;
color: #1D1D1D;
}
3 years ago
.act-time {
3 years ago
font-size: 24rpx;
color: #191919;
3 years ago
.time-img {
3 years ago
width: 18rpx;
height: 22rpx;
line-height: 34rpx;
margin: 0rpx 16rpx 0 0;
}
}
3 years ago
.act-adress {
3 years ago
height: 67rpx;
3 years ago
.address-img {
3 years ago
width: 19rpx;
height: 23rpx;
margin: 7rpx 14rpx 40rpx 0;
}
3 years ago
.title-line {
3 years ago
height: 68rpx;
font-size: 24rpx;
font-weight: 500;
3 years ago
color: #191919;
word-wrap: break-word;
overflow: hidden;
3 years ago
}
}
3 years ago
.act-price {
3 years ago
width: 100%;
3 years ago
3 years ago
.act-i {
font-size: 24rpx;
color: #FF5A0E;
font-weight: 600;
}
3 years ago
.act-p {
3 years ago
font-size: 32rpx;
color: #2A2B2B;
font-weight: 600;
}
3 years ago
.enter-btn {
3 years ago
width: 138rpx;
height: 40rpx;
line-height: 40rpx;
text-align: center;
background: linear-gradient(39deg, #FF5A0D 0%, #FFAC85 100%);
border-radius: 26rpx;
color: #fff;
font-size: 24rpx;
}
}
}
}
</style>