123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <template>
- <view class="course-card">
- <view class="course-tips">
- <view class="">!</view>
- <view class="">全平台每种类型的运动课程只可免费试听一次</view>
- </view>
- <view class="select-btn">
- <view :class="sel_btn===index?'distance':'score'" v-for="(item,index) in selectList" :key="index"
- @click="select_btn(item,index)">{{item.name}}</view>
- </view>
- <view class="venue-card" v-for="item in listData" :key="item.id" @click="toCourseDetail(item)">
- <image :src="item.cover" mode=""></image>
- <view class="venue-info">
- <view class="info-title">
- <view class="title textHidden">{{item.name}}</view>
- <view class="sales">年售{{item.salesYear}}</view>
- </view>
- <view class="type">
- 上课地点:{{item.address}} | {{item.km||'--'}}km
- </view>
- <view class="type">
- {{item.count||'0'}}课时 {{item.startTime}}-{{item.endTime}}
- </view>
- <view class="price">
- <view class="">¥{{item.sellingPrice}}</view>
- <view class="">¥{{item.originalPrice}}</view>
- </view>
- <view class="price-info">
- <view class="sale">
- 已售{{item.sales}} {{item.goodRate}}%好评
- </view>
- <view class="price-btn">免费试听</view>
- </view>
- </view>
- </view>
- <view class="not-data" v-if="listData.length<1">暂无数据</view>
- <view class="more">查看更多</view>
- </view>
- </template>
- <script lang="ts" setup>
- import { ref } from 'vue';
- interface Props {
- listData ?: any;
- selectList?:any;
- }
- const props = withDefaults(defineProps<Props>(), {
- listData: [],
- selectList:[],
- });
- const emit = defineEmits(['change']);
- const sel_btn=ref(0);
- const select_btn=(e,i)=>{
- sel_btn.value=i
- emit('change', e, i);
- }
-
- const toCourseDetail=(e)=>{
- uni.navigateTo({
- url:`/pages/index/courseDetail/index?id=${e.id}&type=1`
- })
- }
- </script>
- <style lang="less" scoped>
- .course-card {
- padding: 20rpx;
- background: #FFFFFF;
- border-radius: 32rpx;
- margin-top: 20rpx;
- .course-tips {
- display: flex;
- align-items: center;
- gap: 10rpx;
- font-size: 24rpx;
- color: #999999;
-
- &>view:first-child {
- width: 32rpx;
- height: 32rpx;
- background:#FFA347;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #FFFFFF;
- }
- }
- .select-btn {
- display: flex;
- align-items: center;
- gap: 20rpx;
- margin-top: 20rpx;
-
- .distance {
- width: 92rpx;
- height: 36rpx;
- background:#C8FF0C;
- border-radius: 8rpx;
- font-size: 24rpx;
- color: #222222;
- line-height:34rpx;
- text-align: center;
- }
-
- .score {
- width: 92rpx;
- height: 36rpx;
- background:#F5F5F5;
- border-radius: 8rpx;
- font-size: 24rpx;
- color:#AAAAAA;
- line-height:34rpx;
- text-align: center;
- }
- }
- .venue-card{
- display: flex;
- align-items: center;
- gap: 20rpx;
- margin-top: 20rpx;
- &>image{
- width: 200rpx;
- height: 200rpx;
- border-radius: 32rpx;
- }
- .venue-info{
- width: 430rpx;
- height: 260rpx;
- border-bottom: 1rpx solid #F0F0F0;
- .info-title{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .title{
- width: 340rpx;
- font-weight: 800;
- font-size: 32rpx;
- color: #222222;
- }
- .sales{
- font-size: 22rpx;
- color: #AAAAAA;
- }
- }
- .type{
- margin-top: 16rpx;
- font-size: 24rpx;
- color: #AAAAAA;
- }
- .price{
- display: flex;
- align-items: center;
- gap: 20rpx;
- margin-top: 16rpx;
- &>view:nth-child(1){
- font-weight: bold;
- font-size: 28rpx;
- color: #FB5B5B;
- }
- &>view:nth-child(2){
- font-size: 22rpx;
- color: #AAAAAA;
- text-decoration: line-through;
- }
- }
- .price-info{
- display: flex;
- align-items: center;
- justify-content: space-between;
- .sale{
- font-size: 24rpx;
- color: #AAAAAA;
- }
- .price-btn{
- width: 152rpx;
- height: 48rpx;
- background: #C8FF0C;
- border-radius: 8rpx;
- font-weight: bold;
- font-size: 28rpx;
- color: #222222;
- text-align: center;
- line-height: 48rpx;
- }
- }
- }
- }
- .more{
- margin: auto;
- width:100rpx;
- margin-top: 20rpx;
- text-align: center;
- font-size: 24rpx;
- color: #CCCCCC;
- position: relative;
- }
- .more::after{
- position: absolute;
- bottom: -10rpx;
- left:25rpx;
- content: '';
- width: 38rpx;
- height: 4rpx;
- border-radius: 2rpx;
- background-color: #CCCCCC;
- }
- }
- </style>
|