This commit is contained in:
@fawn-nine
2024-06-18 16:39:28 +08:00
parent dc2f278594
commit 93dd4dfd41
5 changed files with 547 additions and 290 deletions

View File

@@ -6,29 +6,31 @@
<view class="container">
<view class="" v-if="courseList.length > 0">
<uni-collapse accordion>
<uni-collapse-item v-for="(item,index) in courseList" :key="index" :title="item.medical.title"
:thumb="item.medical.icon">
<view class="content">
<uni-collapse-item v-for="(item,index) in courseList" :key="index" :title="item.courseMedicine.title"
:thumb="item.courseMedicine.icon">
<view class="content" v-if="item.courseList.length > 1">
<!-- <pre>{{item}}</pre> -->
<view class="courseItemleve1" v-for="(item1, index1) in item.courseList" :key="index1">
<view class="text courseItem flexbox"><u-icon name="pushpin" color="#2979ff"
size="24"></u-icon><text>{{item1.title}}--</text></view>
<view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2">
<view class="priceItem flexbox">
<text class="text mname" v-if="item1.courseCatalogueEntityList.length > 1"
style="font-weight: bold; margin-right: 20rpx;">{{item2.title}}</text>
<!-- <view class="pbox flexbox"> -->
<text class="text">半年{{item2.halfFee}} </text><text class="text"
style="margin-left: 20rpx;">整年{{item2.fee}} </text>
<!-- </view> -->
</view>
</view>
<view class="buyBox">
<view class="saveBtn buybtn flexbox" @click="goBuy('halfFee')">
<u-icon name="bag" color="#fff" size="24"></u-icon>
<text>立即购买</text>
</view>
</view>
</view>
<view class="text courseItem flexbox"><u-icon name="pushpin" color="#2979ff"
size="24"></u-icon><text>{{item1.title}}</text></view>
<view class="" v-for="(item2, index2) in item1.courseCatalogueEntityList" :key="index2">
<view :class="['priceItem', item2.isBuy == 1 ? 'isBuy' : '']">
<text class="text mname" v-if="item1.courseCatalogueEntityList.length > 1"
style="font-weight: bold; margin-right: 10rpx;">{{item2.title}}</text>
<view class="pbox flexbox">
<text class="text">半年{{item2.halfFee}} </text><text class="text"
style="margin-left: 20rpx;">整年{{item2.fee}} </text>
</view>
<i class="haveBuy" v-if="item2.isBuy == 1">已购买</i>
</view>
</view>
<view class="buyBox" v-if="!item1.allBuy">
<view class="saveBtn buybtn flexbox" @click="goBuy('halfFee')">
<u-icon name="bag" color="#fff" size="24"></u-icon>
<text>立即购买</text>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
@@ -36,6 +38,8 @@
<u-divider v-if="status == 1" text="暂无数据"></u-divider>
<u-divider v-if="status == 0" text="加载中..."></u-divider>
</view>
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
:iconStyle="iconStyle"></u-back-top>
<z-navigation></z-navigation>
<!-- <music-play :playData="playData"></music-play> -->
</view>
@@ -54,6 +58,15 @@
playData: {},
courseList: [],
status:0,
scrollTop: 0,
bgiStyle: {
background: '#fff'
},
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
};
},
//第一次加载
@@ -71,6 +84,10 @@
uni.hideTabBar();
this.getCoursePriceList()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
@@ -83,8 +100,29 @@
this.$http
.post('medical/home/getMedicalCoursePrice')
.then(res => {
if (res.code == 0 && res.list.length > 0) {
this.courseList = res.list
if (res.code == 0 && res.res.length > 0) {
let _list = res.res
let _allBuy = false
_list.map(item => {
item.courseList.forEach(item2 => {
let _number = 0
item2.courseCatalogueEntityList.forEach(item3 => {
if(item3.isBuy == 1){
_number++
}
})
if(_number == item2.courseCatalogueEntityList.length){
_allBuy = true
}else{
_allBuy = false
}
item2.allBuy = _allBuy
})
})
this.courseList = res.res
this.status = 2
} else {
this.courseList = []
@@ -131,34 +169,43 @@
.courseItemleve1 {
padding: 20rpx;
border-radius: 20rpx;
border: 1px solid #eee;
// border: 1px solid #eee;
overflow: hidden;
margin-bottom: 20rpx;
margin-bottom: 30rpx;
@include mshadow(10px,8);
background: $containerColor;
}
.priceItem {justify-content: center;
.priceItem {
// justify-content: center;
margin-bottom: 20rpx;
font-size: 28rpx;
background-color: #82aee2;
// background-color: #82aee2;
border-radius: 20rpx; padding:10rpx;
// border: 1px solid #ff5500;
.pbox{ justify-content: center; width: 100%; text-align: center;}
border: 2px solid #82aee2;
.pbox{
justify-content: center;
width: 100%; text-align: center;}
text{
color: #fff;
// color: #fff;
}
.mname{padding: 2rpx 10rpx; background: #00e1ec ; border-radius: 20rpx;}
.mname{display: block; text-align: center; margin-bottom: 10rpx; color: #694bc6;}
}
.priceItem.isBuy{position: relative; border-color:#b3b3b3; overflow: hidden; background-color: #f3f3f3;}
.isBuy{
.haveBuy{position: absolute; padding:2rpx 6rpx; border-radius:0 0 0 20rpx ; right: 0; top: 0; z-index: 1; background-color: #e1e1e1; font-style: normal; font-size: 24rpx;}
.mname{color: inherit;}
}
.courseItem {
background: $containerColor; font-weight: bold; border-bottom: 1px dotted #e1e1e1;
border-radius: 20rpx;
// background: #b9d4f2;
font-weight: bold; border-bottom: 1px solid #e1e1e1;
// border-radius: 20rpx;
align-items: center;
margin-bottom: 20rpx;
display: block;
padding: 10rpx 0;
padding: 10rpx 10rpx;
width: 100%;
color: $themeColor;
.u-icon {
display: inline-block;
}
@@ -170,6 +217,7 @@
}
.container {
background-color: $containerColor;
.content {
padding: 0 20rpx;
}