|
|
@ -19,9 +19,8 @@ |
|
|
|
active-color="rgba(243, 74, 64, 1)" inactive-color="rgba(102, 102, 102, 1)" font-size="32" |
|
|
|
active-color="rgba(243, 74, 64, 1)" inactive-color="rgba(102, 102, 102, 1)" font-size="32" |
|
|
|
bar-width="55" bar-height="6" :current="current" @change="change"> |
|
|
|
bar-width="55" bar-height="6" :current="current" @change="change"> |
|
|
|
</u-tabs> |
|
|
|
</u-tabs> |
|
|
|
<view class="center-box"> |
|
|
|
<view class="center-box" v-if="courseList.length>0"> |
|
|
|
<view class="list" v-if="courseList.length>0" v-for="(a,i) in courseList" :key="i" |
|
|
|
<view class="list" v-for="(a,i) in courseList" :key="i" @click="onLookCord(a.video_url.external_url)"> |
|
|
|
@click="onLookCord(a.video_url.external_url)"> |
|
|
|
|
|
|
|
<image :src="a.image_url?a.image_url.external_url:''" mode="heightFix" class="img"></image> |
|
|
|
<image :src="a.image_url?a.image_url.external_url:''" mode="heightFix" class="img"></image> |
|
|
|
<view class="infor"> |
|
|
|
<view class="infor"> |
|
|
|
<view class="title"> |
|
|
|
<view class="title"> |
|
|
@ -35,8 +34,9 @@ |
|
|
|
观看 |
|
|
|
观看 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-empty text="暂无数据显示哦~" v-else mode="list"></u-empty> |
|
|
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<u-empty text="暂无数据显示哦~" v-else mode="list"></u-empty> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-mask :show="show" @click="pauseVideo"> |
|
|
|
<u-mask :show="show" @click="pauseVideo"> |
|
|
|
<view class="warp"> |
|
|
|
<view class="warp"> |
|
|
@ -57,7 +57,17 @@ |
|
|
|
current: 0, |
|
|
|
current: 0, |
|
|
|
courseList: [], |
|
|
|
courseList: [], |
|
|
|
show: false, |
|
|
|
show: false, |
|
|
|
video_url: '' |
|
|
|
video_url: '', |
|
|
|
|
|
|
|
page: 1, |
|
|
|
|
|
|
|
pageSize: 6, |
|
|
|
|
|
|
|
iconType: 'flower', |
|
|
|
|
|
|
|
status: 'loadmore', |
|
|
|
|
|
|
|
total: 0, |
|
|
|
|
|
|
|
loadText: { |
|
|
|
|
|
|
|
loadmore: '上拉加载更多', |
|
|
|
|
|
|
|
loading: '正在加载', |
|
|
|
|
|
|
|
nomore: '没有更多了 ' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
onLoad() { |
|
|
@ -65,6 +75,19 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 下拉刷新 |
|
|
|
|
|
|
|
onPullDownRefresh() { |
|
|
|
|
|
|
|
this.courseList = []; |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
|
|
|
|
this.getCourseList(); |
|
|
|
|
|
|
|
uni.stopPullDownRefresh(); //停止刷新 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReachBottom() { |
|
|
|
|
|
|
|
if (this.page * this.pageSize >= this.total) return |
|
|
|
|
|
|
|
this.page++; |
|
|
|
|
|
|
|
this.status = 'loading' |
|
|
|
|
|
|
|
this.getCourseList(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
pauseVideo() { |
|
|
|
pauseVideo() { |
|
|
@ -74,6 +97,8 @@ |
|
|
|
this.show = false |
|
|
|
this.show = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
change(index) { |
|
|
|
change(index) { |
|
|
|
|
|
|
|
this.courseList = []; |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
this.current = index; |
|
|
|
this.current = index; |
|
|
|
this.getCourseList() |
|
|
|
this.getCourseList() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -105,9 +130,10 @@ |
|
|
|
// 列表 |
|
|
|
// 列表 |
|
|
|
async getCourseList() { |
|
|
|
async getCourseList() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
that.courseList = [] |
|
|
|
|
|
|
|
let pames = { |
|
|
|
let pames = { |
|
|
|
courseCategoryId: that.courseTypeList[that.current].course_category_id |
|
|
|
courseCategoryId: that.courseTypeList[that.current].course_category_id, |
|
|
|
|
|
|
|
page: that.page, |
|
|
|
|
|
|
|
pageSize: that.pageSize |
|
|
|
} |
|
|
|
} |
|
|
|
let { |
|
|
|
let { |
|
|
|
status, |
|
|
|
status, |
|
|
@ -115,9 +141,16 @@ |
|
|
|
data |
|
|
|
data |
|
|
|
} = await api.courseList(pames); |
|
|
|
} = await api.courseList(pames); |
|
|
|
if (status == 200) { |
|
|
|
if (status == 200) { |
|
|
|
that.courseList = data.list |
|
|
|
const newData = data.list.data || []; |
|
|
|
|
|
|
|
that.courseList = [...that.courseList, ...newData]; // 将新数据添加到已有数据的尾部 |
|
|
|
|
|
|
|
that.total = data.list.total; |
|
|
|
|
|
|
|
if (that.courseList.length >= that.total) { |
|
|
|
|
|
|
|
that.status = 'nomore' |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
that.status = 'loadmore' |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
that.list = [] |
|
|
|
that.total = 0 |
|
|
|
that.$toast(message) |
|
|
|
that.$toast(message) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -133,7 +166,7 @@ |
|
|
|
::v-deep .u-empty { |
|
|
|
::v-deep .u-empty { |
|
|
|
padding: 100rpx 0; |
|
|
|
padding: 100rpx 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.warp { |
|
|
|
.warp { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
@ -152,7 +185,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
.park-top { |
|
|
|
.park-top { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 420rpx; |
|
|
|
height: 450rpx; |
|
|
|
background: url(https://www.royaum.com.cn/static/user/courseBg.png); |
|
|
|
background: url(https://www.royaum.com.cn/static/user/courseBg.png); |
|
|
|
background-size: 100%; |
|
|
|
background-size: 100%; |
|
|
|
|
|
|
|
|
|
|
@ -163,8 +196,7 @@ |
|
|
|
color: rgba(51, 51, 51, 1); |
|
|
|
color: rgba(51, 51, 51, 1); |
|
|
|
text-align: left; |
|
|
|
text-align: left; |
|
|
|
vertical-align: top; |
|
|
|
vertical-align: top; |
|
|
|
padding-top: 30rpx; |
|
|
|
padding: 30rpx 0rpx 20rpx 48rpx; |
|
|
|
padding-left: 48rpx; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.top-marker { |
|
|
|
.top-marker { |
|
|
@ -184,6 +216,7 @@ |
|
|
|
background: #fff; |
|
|
|
background: #fff; |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
overflow: hidden; |
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
padding-bottom: 50rpx; |
|
|
|
|
|
|
|
|
|
|
|
.center-box { |
|
|
|
.center-box { |
|
|
|
overflow: hidden; |
|
|
|
overflow: hidden; |
|
|
|