index文件夹修改

This commit is contained in:
GaoHao
2024-12-23 16:38:42 +08:00
parent 5a55632bc0
commit 54250730ce
3 changed files with 74 additions and 74 deletions

View File

@@ -2,15 +2,15 @@
<view class="">
<u-sticky :enable="enableIos">
<view class="search-box-ios">
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" v-model="keyword"
:show-action="false" :animation="true" @search="getCourseList()"></u-search>
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" v-model="keywordIos"
:show-action="false" :animation="true" @search="getCourseListIos()"></u-search>
</view>
</u-sticky>
<view class="swiper flex align-center justify-center">
<view class="swiper-box">
<swiper :indicator-dots="true" class="swiper " :autoplay="true" interval="5000" duration="500"
:circular="true" style="width: 100%;height: 350rpx;">
<swiper-item v-for="(item,index) in swiperListIos" :key='index' @tap="goPage(item.url)">
<swiper-item v-for="(item,index) in swiperListIos" :key='index' @tap="goPageIos(item.url)">
<image :src="item.imageUrl" mode="scaleToFill"
style="width: 100%;height: 100%;border-radius: 24rpx;"></image>
</swiper-item>
@@ -19,7 +19,7 @@
</view>
<view class="padding-lr">
<view class="" v-if="courseListIos.length">
<videoList @success="posterSuccess" :list="courseListIos" />
<videoList @success="posterSuccessIos" :list="courseListIos" />
</view>
<empty title="暂无视频" :isShow='false' v-else></empty>
<u-loadmore v-if="courseListIos.length > 0" :status="statusIos" />
@@ -44,16 +44,16 @@
courseListIos: [], //资源列表
pageIos: 1,
limitIos: 10,
pagesIos: 0,
sortIos: '',
count: 0,
keyword: '',
isPrice: '', //是否免费 2:免费
keywordIos: '',
isPriceIos: '', //是否免费 2:免费
}
},
onShow() {
this.enableIos = true
this.getCourseList()
this.getCourseListIos()
},
onHide() {
this.enableIos = false
@@ -62,34 +62,34 @@
uni.setNavigationBarTitle({
title: option.title
})
this.getBannerList()
this.getBannerListIos()
if (option.sort) {
this.sortIos = option.sort
}
if (option.isPrice) {
this.isPrice = option.isPrice
this.isPriceIos = option.isPrice
}
},
methods: {
goPage(url) {
goPageIos(url) {
uni.navigateTo({
url: url
})
},
//点击回调
posterSuccess(item) {
posterSuccessIos(item) {
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId
})
},
//最新热播
getCourseList() {
getCourseListIos() {
let data = {
limit: this.limitIos,
page: this.pageIos,
sort: this.sortIos ? this.sortIos : '',
title: this.keyword,
title: this.keywordIos,
}
// #ifdef MP-WEIXIN
data.wxShow = 1
@@ -97,13 +97,13 @@
// #ifdef MP-TOUTIAO
data.dyShow = 1
// #endif
if (this.isPrice) {
data.isPrice = this.isPrice
if (this.isPriceIos) {
data.isPrice = this.isPriceIos
}
this.$u.api.courseList(data).then(res => {
if (res.code == 0) {
this.pages = res.data.totalPage
if (this.pageIos < this.pages) {
this.pagesIos = res.data.totalPage
if (this.pageIos < this.pagesIos) {
this.statusIos = 'loadmore'
} else {
this.statusIos = 'nomore'
@@ -128,7 +128,7 @@
})
},
// 获取轮播图列表
getBannerList() {
getBannerListIos() {
this.$u.api.bannerList({
classify: '1'
}).then(res => {
@@ -151,10 +151,10 @@
},
onReachBottom: function() {
if (this.pageIos < this.pages) {
if (this.pageIos < this.pagesIos) {
this.pageIos += 1
this.statusIos = 'loading'
this.getCourseList()
this.getCourseListIos()
} else {
this.statusIos = 'nomore'
@@ -163,7 +163,7 @@
},
onPullDownRefresh: function() {
this.pageIos = 1;
this.getCourseList()
this.getCourseListIos()
},
}
</script>