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.

273 lines
6.9 KiB

1 year ago
<template>
<view class="container">
1 year ago
<image class="cbg" :src="base.imgHost('common_bg.png')"></image>
1 year ago
<view class="wrap">
1 year ago
<topBanner v-if="banner_list.length>0" :banner_list="banner_list"></topBanner>
1 year ago
<view class="list">
<view>
<view v-if="list.length>0">
1 year ago
<view class="list-item" v-for="item in list">
<view class="list-item-status">
<view :class="{'list-item-status-text':item.course_status===10,'list-item-status-textEnd':item.course_status!=10}">{{item.date_status}}</view>
<view :class="{
'list-item-status-status':item.course_signs[0]['status']===0||item.course_signs[0]['status']===3,
'list-item-status-statusSuccess':item.course_signs[0]['status']===1,
'list-item-status-statusFail':item.course_signs[0]['status']===2
1 year ago
}">{{item.course_signs[0]['status_text']==='备选'?'待审核':item.course_signs[0]['status_text']}}</view>
1 year ago
</view>
<view class="list-item-name">
<view>
<image :src="base.imgHost('me-icon1.png')"></image>
1 year ago
<text>
<block v-if="item.type">{{item.type_detail?item.type_detail.name+' | ':''}}</block>
{{item.name}}
</text>
1 year ago
</view>
<view>
<image :src="base.imgHost('mybook-icon3.png')"></image>
<text>开课日期{{item.start_date?item.start_date:'待定'}}</text>
</view>
1 year ago
</view>
<view class="list-item-buttom">
<view>
1 year ago
<u-button v-if="item.course_status===10" size="mini" :custom-style="{'color':'#b79373',
1 year ago
'border-color':'transparent','font-size': '26rpx',
'padding': 0}" :hair-line="false" @click="clickShareId(item)" shape="circle" open-type="share">
<image :src="base.imgHost('mycourse-share.png')"></image>
<text>分享</text>
</u-button>
</view>
1 year ago
<view class="list-item-btn">
<text @click="toUrl(item.id,3)" v-if="item.course_signs[0]['status']===1 && item.is_fee===0"></text>
<text @click="toUrl(item.id,1)" v-if="item.course_signs[0]['status']===1 && item.is_fee===1"></text>
<text @click="toUrl(item.id,2)" v-if="item.course_signs[0]['status']===0||item.course_signs[0]['status']===3"></text>
<text @click="toUrl(item.id,2)" v-if="item.course_signs[0]['status']===2"></text>
1 year ago
</view>
</view>
</view>
</view>
1 year ago
1 year ago
</view>
</view>
1 year ago
</view>
</view>
</template>
1 year ago
<script>
import topBanner from '@/components/topBanner.vue'
1 year ago
export default {
1 year ago
components: {
1 year ago
topBanner
1 year ago
},
data() {
1 year ago
return {
banner_list: [],
list: [],
historyList: [],
shareObj: {}
1 year ago
}
},
1 year ago
onShareAppMessage(res) {
console.log("res", res)
console.log("this.shareObj", this.shareObj)
if (res.from === 'button') {
return {
path: "/packages/course/detail?id=" + this.shareObj.id, //这是为了传参 onload(data){let id=data.id;}
title: this.shareObj.name,
imageUrl: '/static/share.jpg'
}
}
return this.base.shareInfo
},
//发送到朋友圈
onShareTimeline(res) {
if (res.from === 'button') {
return {
path: "/packages/course/detail?id=" + this.shareObj.id, //这是为了传参 onload(data){let id=data.id;}
title: this.shareObj.name,
imageUrl: '/static/share.jpg'
}
}
return this.base.shareInfo
},
onLoad() {
console.log("selectOptions", this.selectOptions)
this.getMyCourse()
1 year ago
this.getBannerList()
1 year ago
},
methods: {
async getMyCourse() {
1 year ago
const res = await this.$u.api.courseMy()
this.list = res.list.data
1 year ago
},
clickShareId(item) {
this.shareObj = item
},
1 year ago
toUrl(id,type) {
// 付费审核通过
if(type===1){
uni.navigateTo({
url: '/packages/mycourse/detail?id=' + id
})
}else if(type===2){
// 审核不通过 或待审核 备选
uni.navigateTo({
url: '/packages/mycourse/courseStatus?id=' + id
})
}else if(type===3){
// 不付费的 审核通过
uni.navigateTo({
url: '/packages/course/freeDetail?id=' + id
})
}
1 year ago
},
async getBannerList() {
const res = await this.$u.api.otherBanner({
1 year ago
position: 2
1 year ago
})
1 year ago
if(res.length>0){
this.banner_list = res.sort((a,b)=>{a.sort-b.sort})
}
1 year ago
},
1 year ago
}
}
</script>
1 year ago
<style scoped lang="scss">
.container {
padding: 30rpx;
width: 100%;
height: 100vh;
.cbg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
}
.wrap {
position: relative;
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
1 year ago
1 year ago
.list {
margin-top: 50rpx;
&-title {
margin-bottom: 30rpx;
color: #333;
font-size: 42rpx;
}
&-item {
background-color: #fff;
padding: 30rpx;
margin-bottom: 30rpx;
border-radius: 20rpx;
1 year ago
// border-bottom: 2px solid #b79373
box-shadow: 0 -1rpx 20rpx #bed2ec;
&-status{
display: flex;
justify-content: space-between;
align-items: center;
font-size:28rpx;
padding-bottom:20rpx;
border-bottom: 1px solid #f5f5f5;
&>view:last-child{
padding:5rpx 20rpx;
border-radius: 28rpx 0 28rpx 28rpx;
color:#fff;
}
&-text{
color:#b08c6c;
font-size:28rpx;
}
&-textEnd{
color:#999;
font-size:28rpx;
}
&-status{
background-color: #bf976e;
font-size:24rpx;
}
&-statusSuccess{
background-color: #00b318;
font-size:24rpx;
}
&-statuFail{
background-color: #999999;
font-size:24rpx;
}
}
&-name {
padding:20rpx 0;
border-bottom: 1px solid #f5f5f5;
&>view{
display: flex;
justify-content: space-between;
align-items: baseline;
font-size:28rpx;
image{
width:24rpx;
height:24rpx;
margin-right:20rpx;
}
text{
display: inline-block;
width:calc(100% - 44rpx);
font-size: 28rpx;
line-height: 1.5;
}
}
&>view:first-child{
margin-bottom:20rpx;
}
1 year ago
}
&-hisname {
color: #888888
}
&-buttom {
display: flex;
justify-content: space-between;
align-items: center;
color: #b79373;
margin-top: 20rpx;
&>view:first-child {
display: flex;
align-items: center;
image {
width: 26rpx;
height: 26rpx;
margin: 0 10rpx;
}
}
}
1 year ago
&-btn {
color:#b08c6c;
// background: linear-gradient(to right, #5e5fbc, #0d0398);
// border-radius: 30rpx;
// color: #fff;
// text-align: center;
// padding: 10rpx 20rpx;
// width: 140rpx;
1 year ago
}
}
}
}
}
1 year ago
</style>