@@ -12,15 +12,27 @@ Page({ | |||
entersList:[ | |||
{ | |||
title:'关注抖音', | |||
iconPath:'../../../assets/img/attentionIcon.png' | |||
iconPath:'../../../assets/img/attentionIcon.png', | |||
path: '/package_first/pages/AttentionMethod/index', | |||
isJoin: false, | |||
isShow: true | |||
// type: 'tiktok' | |||
}, | |||
{ | |||
title:'学习视频', | |||
iconPath:'../../../assets/img/video.png' | |||
iconPath:'../../../assets/img/video.png', | |||
path: '2', | |||
isJoin: false, | |||
isShow: true | |||
// type: 'video' | |||
}, | |||
{ | |||
title:'志愿者活动', | |||
iconPath:'../../../assets/img/volunteer.png' | |||
iconPath:'../../../assets/img/volunteer.png', | |||
path: '3', | |||
isJoin: false, | |||
isShow: true | |||
// type: 'activity' | |||
} | |||
] | |||
}, | |||
@@ -81,21 +93,25 @@ Page({ | |||
}, | |||
getIsApply(){ | |||
console.log('1111'); | |||
const tenantObj = wx.getStorageSync('tenant') | |||
const entersList = this.data.entersList | |||
const {tenantId} = wx.getStorageSync('tenant') | |||
const openid = wx.getStorageSync('openid') | |||
const data = { | |||
tenantId:tenantObj.tenantId, | |||
openid, | |||
if(tenantId === null){ | |||
entersList[0].isShow = false | |||
this.setData({ entersList }) | |||
}else{ | |||
const data = { openid } | |||
api_getIsApply(data).then(res=>{ | |||
entersList[0].isJoin = !!res.data | |||
this.setData({ entersList }) | |||
}) | |||
} | |||
api_getIsApply(data).then(res=>{ | |||
console.log(res); | |||
}) | |||
}, | |||
goPage(e){ | |||
console.log(1111); | |||
const { path } = e.currentTarget.dataset | |||
wx.navigateTo({ | |||
url: `/package_first/pages/AttentionMethod/index`, | |||
url: path | |||
}) | |||
}, | |||
homepage(e){ |
@@ -7,27 +7,29 @@ | |||
<view class="top"> | |||
<image class="activity_bg" src="../../../assets/img/activitybg.png" mode=""/> | |||
</view> | |||
<view class="main"> | |||
<view class="part" wx:key="index" wx:for="{{entersList}}"> | |||
<view> | |||
<view class="part"> | |||
<view class="part__item" wx:key="index" wx:for="{{entersList}}" wx:if="{{ item.isShow }}"> | |||
<view class="part__left"> | |||
<image class="icon" src="{{item.iconPath}}" mode=""/> | |||
</view> | |||
<view class="middle_text"> | |||
<view class="text"> | |||
{{item.title}} | |||
</view> | |||
<!-- <view class="marks"> | |||
<view> | |||
<image class="marks_icon" src="../../../assets/img/gold.png" mode=""/> | |||
<view class="part__right"> | |||
<view class="middle_text"> | |||
<view class="text"> | |||
{{item.title}} | |||
</view> | |||
<view class="marks_text">10积分</view> | |||
</view> --> | |||
</view> | |||
<view class="takepart" wx:if=""> | |||
已参加 | |||
</view> | |||
<view> | |||
<image class="takepart_icon" bindtap="goPage" src="../../../assets/img/takepart.png" mode=""/> | |||
<view class="marks"> | |||
<view> | |||
<image class="marks_icon" src="../../../assets/img/gold.png" mode=""/> | |||
</view> | |||
<!-- <view class="marks_text">10积分</view> --> | |||
</view> | |||
</view> | |||
<view class="item__button is--join" wx:if="{{item.isJoin}}"> | |||
已参加 | |||
</view> | |||
<view class="item__button no--join" wx:else data-path="{{item.path}}" bindtap="goPage"> | |||
参与活动 | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -16,24 +16,32 @@ | |||
width: 100%; | |||
height: 454rpx; | |||
} | |||
.main{ | |||
.part{ | |||
width: calc(100% - 80rpx); | |||
height: 1221rpx; | |||
background-color: #ffffff; | |||
border-radius: 30rpx 30rpx 0rpx 0rpx; | |||
margin:0rpx 50rpx 0rpx 30rpx; | |||
padding: 30rpx; | |||
position: absolute; | |||
top: 268rpx; | |||
} | |||
.part{ | |||
.part__item{ | |||
display: flex; | |||
flex-direction: row; | |||
align-items: center; | |||
justify-content: space-between; | |||
padding: 61rpx 0rpx 0rpx 30rpx ; | |||
} | |||
.middle_text{ | |||
padding-left: 39rpx; | |||
.part__left{ | |||
margin-right: 39rpx; | |||
} | |||
.part__right{ | |||
flex: 1; | |||
padding: 46rpx 0 20rpx 0; | |||
display: flex; | |||
align-items: center; | |||
justify-content: space-between; | |||
border-bottom: 1px solid rgba(225, 225, 225, 0.5); | |||
} | |||
.marks{ | |||
display: flex; | |||
@@ -45,7 +53,6 @@ | |||
} | |||
.text{ | |||
width: 180rpx; | |||
height: 32rpx; | |||
font-size: 34rpx; | |||
font-family: Source Han Sans CN; | |||
font-weight: 500; | |||
@@ -59,17 +66,15 @@ | |||
} | |||
.marks_text{ | |||
width: 80rpx; | |||
height: 22rpx; | |||
font-size: 24rpx; | |||
font-family: Source Han Sans CN; | |||
font-weight: 400; | |||
color: #A2A2A2; | |||
line-height: 60rpx; | |||
} | |||
.takepart{ | |||
.item__button{ | |||
width: 126rpx; | |||
height: 56rpx; | |||
background: #FE8100; | |||
box-shadow: 0rpx 5rpx 9rpx 0rpx rgba(254,129,0,0.28); | |||
border-radius: 28rpx; | |||
font-size: 22rpx; | |||
@@ -80,6 +85,12 @@ | |||
text-align: center; | |||
margin-left: 65rpx; | |||
} | |||
.is--join{ | |||
background: rgba(254, 129, 0, 1); | |||
} | |||
.no--join{ | |||
background: rgba(0, 109, 247, 1); | |||
} | |||
.takepart_icon{ | |||
width: 143rpx; | |||
height: 74rpx; |