<template> <view class="teaching_case" @click="gotoTeDetail"> <view class="img"> <!-- <slot name="img"></slot> --> <image src="../../static/yym/Rectangle23.png" mode="aspectFill"></image> </view> <view class="right"> <view class="title"> <view class="tag">类型</view> <text v-if="!item.btn">这是教研标题这是教研标题这是教研标题</text> <text v-else>这是活动活动活动活动活动活动活动活动活动</text> </view> <view class="introduce"> 查看详情查看详情查看详情查看详情查看详情查看详情查看详情查看详情查看详情查看详情 </view> <view class="operate" v-if="!item.btn"> <view class="left"> <view class="opr" style="padding-right: 25rpx;"> <uni-icons type="star" size="22"></uni-icons> 收藏 </view> <view class="opr"> <uni-icons type="cloud-download" size="22"></uni-icons> <!-- <image src="../../static/yym/Vector (Stroke).png" style="width: 30rpx;height: 30rpx;" mode="aspectFill"></image> --> 订阅 </view> </view> <button class="btn" disableEventPropagation="true" @click.stop="join">立即参与</button> </view> <view class="operate" v-else> <view class="left"> <view class="price">¥188</view> <view class="pernum">已报名123人</view> </view> <button class="btn" @click.stop="actApply">立即报名</button> </view> </view> </view> </template> <script> export default { name:"teaching-case", props:{ item:{ type:Object, default (){ return{ btn:0 //0教研列表 1活动列表 } } } }, data() { return { }; }, methods:{ gotoTeDetail(){ if(this.item.btn){ uni.navigateTo({ url:"/pages/activityDetail/activityDetail" }) }else{ uni.navigateTo({ url:"/pages/teachingDetail/teachingDetail" }) } }, join(){ uni.navigateTo({ url:'/pages/jys/jys' }) }, actApply(){ uni.navigateTo({ url:'/pages/hd/hd' }) } } } </script> <style lang="scss"> .teaching_case{ display: flex; justify-content: space-between; margin-bottom: 10px; background-color: #ffffff; padding: 20rpx 30rpx; // padding-bottom: 20rpx; .img{ width: 180rpx; height: 180rpx; image{ width: 100%; height:100%; } } .right{ padding-left: 15px; flex: 1; // height: 300px; width: 100rpx; display: flex; flex-direction: column; align-content: flex-end ; // align-content: space-between; .title{ display: flex; margin-bottom: 5px; .tag{ border: 1px #00b2b6 solid; font-size: 12px; display: flex; white-space: nowrap; justify-content: center; align-items: center; padding: 2px 4px; border-radius: 3px; margin-right: 10rpx; color: #00b2b6; } text{ font-weight: bold; overflow: hidden; text-overflow:ellipsis; white-space: nowrap; } } .introduce{ font-size: 16px; color: #a7a7a7; // padding: 20rpx 0; overflow: hidden; text-overflow:ellipsis; white-space: nowrap; } .operate{ display: flex; justify-content: space-between; align-items: flex-end; flex-grow: 1; .left{ display: flex; justify-content: space-between; align-items: center; // width: 200rpx; .opr{ display: flex; align-items: center; } .pernum{ color: #666666; font-size: 14px; } .price{ font-size: 18px; font-weight: bold; color: #f8a551; padding-right: 10rpx; } } .btn{ z-index: 5; font-size: 12px; background-color: #3081e8; color: #fff; border-radius: 30px; margin: 0; float: right; // margin-top: 10px; // padding: 0 15rpx; letter-spacing:1px; } } } } </style>