index文件夹修改
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="">
|
<view class="">
|
||||||
<u-sticky :enable="enable">
|
<u-sticky :enable="enableIos">
|
||||||
<view class="search-box">
|
<view class="search-box-ios">
|
||||||
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" v-model="keyword"
|
<u-search bg-color="#f2f2f2" style="width: 100%;" placeholder="搜索更多资源" v-model="keyword"
|
||||||
:show-action="false" :animation="true" @search="getCourseList()"></u-search>
|
:show-action="false" :animation="true" @search="getCourseList()"></u-search>
|
||||||
</view>
|
</view>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<view class="swiper-box">
|
<view class="swiper-box">
|
||||||
<swiper :indicator-dots="true" class="swiper " :autoplay="true" interval="5000" duration="500"
|
<swiper :indicator-dots="true" class="swiper " :autoplay="true" interval="5000" duration="500"
|
||||||
:circular="true" style="width: 100%;height: 350rpx;">
|
:circular="true" style="width: 100%;height: 350rpx;">
|
||||||
<swiper-item v-for="(item,index) in swiperList" :key='index' @tap="goPage(item.url)">
|
<swiper-item v-for="(item,index) in swiperListIos" :key='index' @tap="goPage(item.url)">
|
||||||
<image :src="item.imageUrl" mode="scaleToFill"
|
<image :src="item.imageUrl" mode="scaleToFill"
|
||||||
style="width: 100%;height: 100%;border-radius: 24rpx;"></image>
|
style="width: 100%;height: 100%;border-radius: 24rpx;"></image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
@@ -18,24 +18,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="padding-lr">
|
<view class="padding-lr">
|
||||||
<view class="" v-if="courseList.length">
|
<view class="" v-if="courseListIos.length">
|
||||||
<!-- <view class="vidoList flex align-center justify-between flex-wrap">
|
<videoList @success="posterSuccess" :list="courseListIos" />
|
||||||
<view class="vidoList-item" @click="goCourse(item.courseId,item.courseDetailsId)"
|
|
||||||
v-for="(item, index) in courseList" :key="index">
|
|
||||||
<view class="vidoList-item-img">
|
|
||||||
<image :src="item.titleImg" mode="aspectFill"></image>
|
|
||||||
</view>
|
|
||||||
<view class="vidoList-item-title">
|
|
||||||
{{item.title}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="vidoList-item" style="height: 0;"></view>
|
|
||||||
<view class="vidoList-item" style="height: 0;"></view>
|
|
||||||
</view> -->
|
|
||||||
<videoList @success="posterSuccess" :list="courseList" />
|
|
||||||
</view>
|
</view>
|
||||||
<empty title="暂无视频" :isShow='false' v-else></empty>
|
<empty title="暂无视频" :isShow='false' v-else></empty>
|
||||||
<u-loadmore v-if="courseList.length > 0" :status="status" />
|
<u-loadmore v-if="courseListIos.length > 0" :status="statusIos" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -51,38 +38,25 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
enable: true,
|
enableIos: true,
|
||||||
status: 'loadmore',
|
statusIos: 'loadmore',
|
||||||
swiperList: [], //轮播图列表
|
swiperListIos: [], //轮播图列表
|
||||||
courseList: [], //资源列表
|
courseListIos: [], //资源列表
|
||||||
page: 1,
|
pageIos: 1,
|
||||||
limit: 10,
|
limitIos: 10,
|
||||||
id: '',
|
|
||||||
|
sortIos: '',
|
||||||
datalist: [{
|
|
||||||
id: 1,
|
|
||||||
name: '综合'
|
|
||||||
}, {
|
|
||||||
id: 2,
|
|
||||||
name: '人气'
|
|
||||||
}, {
|
|
||||||
id: 3,
|
|
||||||
name: '价格',
|
|
||||||
label: '0'
|
|
||||||
}],
|
|
||||||
dataIndex: 0,
|
|
||||||
sort: '',
|
|
||||||
count: 0,
|
count: 0,
|
||||||
keyword: '',
|
keyword: '',
|
||||||
isPrice: '', //是否免费 2:免费
|
isPrice: '', //是否免费 2:免费
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.enable = true
|
this.enableIos = true
|
||||||
this.getCourseList()
|
this.getCourseList()
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.enable = false
|
this.enableIos = false
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
@@ -90,7 +64,7 @@
|
|||||||
})
|
})
|
||||||
this.getBannerList()
|
this.getBannerList()
|
||||||
if (option.sort) {
|
if (option.sort) {
|
||||||
this.sort = option.sort
|
this.sortIos = option.sort
|
||||||
}
|
}
|
||||||
if (option.isPrice) {
|
if (option.isPrice) {
|
||||||
this.isPrice = option.isPrice
|
this.isPrice = option.isPrice
|
||||||
@@ -112,9 +86,9 @@
|
|||||||
//最新热播
|
//最新热播
|
||||||
getCourseList() {
|
getCourseList() {
|
||||||
let data = {
|
let data = {
|
||||||
limit: this.limit,
|
limit: this.limitIos,
|
||||||
page: this.page,
|
page: this.pageIos,
|
||||||
sort: this.sort ? this.sort : '',
|
sort: this.sortIos ? this.sortIos : '',
|
||||||
title: this.keyword,
|
title: this.keyword,
|
||||||
}
|
}
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
@@ -129,18 +103,18 @@
|
|||||||
this.$u.api.courseList(data).then(res => {
|
this.$u.api.courseList(data).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.pages = res.data.totalPage
|
this.pages = res.data.totalPage
|
||||||
if (this.page < this.pages) {
|
if (this.pageIos < this.pages) {
|
||||||
this.status = 'loadmore'
|
this.statusIos = 'loadmore'
|
||||||
} else {
|
} else {
|
||||||
this.status = 'nomore'
|
this.statusIos = 'nomore'
|
||||||
}
|
}
|
||||||
// res.data.list.forEach(ret => {
|
// res.data.list.forEach(ret => {
|
||||||
// ret.courseLabel = ret.courseLabel ? ret.courseLabel.split(',') : []
|
// ret.courseLabel = ret.courseLabel ? ret.courseLabel.split(',') : []
|
||||||
// })
|
// })
|
||||||
if (this.page == 1) {
|
if (this.pageIos == 1) {
|
||||||
this.courseList = res.data.list
|
this.courseListIos = res.data.list
|
||||||
} else {
|
} else {
|
||||||
this.courseList = [...this.courseList, ...res.data.list]
|
this.courseListIos = [...this.courseListIos, ...res.data.list]
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -161,7 +135,7 @@
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
res.data.forEach(d => {
|
res.data.forEach(d => {
|
||||||
if (d.state == 1) {
|
if (d.state == 1) {
|
||||||
this.swiperList.push(d)
|
this.swiperListIos.push(d)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -177,25 +151,25 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom: function() {
|
onReachBottom: function() {
|
||||||
if (this.page < this.pages) {
|
if (this.pageIos < this.pages) {
|
||||||
this.page += 1
|
this.pageIos += 1
|
||||||
this.status = 'loading'
|
this.statusIos = 'loading'
|
||||||
this.getCourseList()
|
this.getCourseList()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.status = 'nomore'
|
this.statusIos = 'nomore'
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onPullDownRefresh: function() {
|
onPullDownRefresh: function() {
|
||||||
this.page = 1;
|
this.pageIos = 1;
|
||||||
this.getCourseList()
|
this.getCourseList()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.search-box {
|
.search-box-ios {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 15upx 2.5%;
|
padding: 15upx 2.5%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -203,42 +177,7 @@
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vidoList {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.vidoList-item {
|
|
||||||
width: calc((100% - 40rpx) / 3);
|
|
||||||
height: 356rpx;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vidoList-item-img {
|
|
||||||
width: 100%;
|
|
||||||
height: 280rpx;
|
|
||||||
border-radius: 24rpx 24rpx 0 0;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 24rpx 24rpx 0 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.vidoList-item-title {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
border-radius: 0 0 24rpx 24rpx;
|
|
||||||
padding: 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis; //溢出用省略号显示
|
|
||||||
white-space: nowrap; // 默认不换行;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper {
|
.swiper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
270
pages/index/course/viepsii.vue
Normal file
270
pages/index/course/viepsii.vue
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
<template>
|
||||||
|
<view class="">
|
||||||
|
<view class="shop-info-wrap">
|
||||||
|
<view class="info-wrap flex-between">
|
||||||
|
<view></view>
|
||||||
|
<text class="shopName">{{ shopInfo.storeInfo.shopName }}</text>
|
||||||
|
<view class="close" @click="showShopInfo = false">
|
||||||
|
<u-icon name="close" color="#999999" size="28"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-wrap-title">商家信息</view>
|
||||||
|
<view class="row" style="margin-bottom: 20rpx;">
|
||||||
|
<view class="col">
|
||||||
|
<text class="l">营业时间:</text>
|
||||||
|
<text
|
||||||
|
class="t">{{ (shopInfo.storeInfo.businessStartDay || '——') +'至'+ (shopInfo.storeInfo.businessEndDay || '——') +' '+ (shopInfo.storeInfo.businessTime || '')}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="col">
|
||||||
|
<text class="l">商家地址:</text>
|
||||||
|
<text class="t">{{ shopInfo.storeInfo.address }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="col" @click="makePhoneCall(shopInfo.storeInfo.phone)">
|
||||||
|
<text class="l">商家电话:</text>
|
||||||
|
<text class="t">{{ shopInfo.storeInfo.phone }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="info-wrap-title">商家公告</view>
|
||||||
|
<view class="row">
|
||||||
|
<view class="col">
|
||||||
|
<text class="l">公告:</text>
|
||||||
|
<text class="t">{{ shopInfo.storeInfo.detail }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="shop_bottom ">
|
||||||
|
<view class="flex-between">
|
||||||
|
<view class="price">
|
||||||
|
<text class="i">¥</text>
|
||||||
|
<text class="num">{{salePrice}}</text>
|
||||||
|
<text class="i">/{{specifications.unitSnap}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="operation-wrap">
|
||||||
|
|
||||||
|
<view class="btn">
|
||||||
|
<u-icon name="minus-circle-fill" color="#E9AB7A" size="50"></u-icon>
|
||||||
|
<view class="btnClick" @click="shopAdd(specifications,specifications.indexa,specifications.indexb,'-',specifications.tagSnap == null ? '单规格':'')"></view>
|
||||||
|
</view>
|
||||||
|
<text class="num">{{amountcartNumber}}</text>
|
||||||
|
<view class="btn" >
|
||||||
|
<u-icon name="plus-circle-fill" color="#E9AB7A" size="50"></u-icon>
|
||||||
|
<view class="btnClick" @click="shopAdd(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="shop_skuselect flex-start" v-if="specifications.tagSnap">
|
||||||
|
<view class="shop_skuselectname">{{skuidname.toString()}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="addShopping" :class="(amountcartNumber>0&&isSpec)?'active':''"
|
||||||
|
@click="addShopping(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')">
|
||||||
|
{{skuBtnText}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import videoList from '../../../components/videoList/videoList.vue'
|
||||||
|
import empty from '@/components/empty.vue'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
empty,
|
||||||
|
videoList
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.enable = true
|
||||||
|
this.getCourseList()
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
this.enable = false
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: option.title
|
||||||
|
})
|
||||||
|
this.getBannerList()
|
||||||
|
if (option.sort) {
|
||||||
|
this.sort = option.sort
|
||||||
|
}
|
||||||
|
if (option.isPrice) {
|
||||||
|
this.isPrice = option.isPrice
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goPage(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//点击回调
|
||||||
|
posterSuccess(item) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//最新热播
|
||||||
|
getCourseList() {
|
||||||
|
let data = {
|
||||||
|
limit: this.limit,
|
||||||
|
page: this.page,
|
||||||
|
sort: this.sort ? this.sort : '',
|
||||||
|
title: this.keyword,
|
||||||
|
}
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
data.wxShow = 1
|
||||||
|
// #endif
|
||||||
|
// #ifdef MP-TOUTIAO
|
||||||
|
data.dyShow = 1
|
||||||
|
// #endif
|
||||||
|
if (this.isPrice) {
|
||||||
|
data.isPrice = this.isPrice
|
||||||
|
}
|
||||||
|
this.$u.api.courseList(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.pages = res.data.totalPage
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.status = 'loadmore'
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
// res.data.list.forEach(ret => {
|
||||||
|
// ret.courseLabel = ret.courseLabel ? ret.courseLabel.split(',') : []
|
||||||
|
// })
|
||||||
|
if (this.page == 1) {
|
||||||
|
this.courseList = res.data.list
|
||||||
|
} else {
|
||||||
|
this.courseList = [...this.courseList, ...res.data.list]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取轮播图列表
|
||||||
|
getBannerList() {
|
||||||
|
this.$u.api.bannerList({
|
||||||
|
classify: '1'
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
res.data.forEach(d => {
|
||||||
|
if (d.state == 1) {
|
||||||
|
this.swiperList.push(d)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
duration: 1000,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
onReachBottom: function() {
|
||||||
|
if (this.page < this.pages) {
|
||||||
|
this.page += 1
|
||||||
|
this.status = 'loading'
|
||||||
|
this.getCourseList()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.status = 'nomore'
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
onPullDownRefresh: function() {
|
||||||
|
this.page = 1;
|
||||||
|
this.getCourseList()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.search-box {
|
||||||
|
width: 100%;
|
||||||
|
padding: 15upx 2.5%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vidoList {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
|
||||||
|
.vidoList-item {
|
||||||
|
width: calc((100% - 40rpx) / 3);
|
||||||
|
height: 356rpx;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 24rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vidoList-item-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 280rpx;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.vidoList-item-title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border-radius: 0 0 24rpx 24rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis; //溢出用省略号显示
|
||||||
|
white-space: nowrap; // 默认不换行;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.swiper {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
margin-top: 10rpx;
|
||||||
|
|
||||||
|
.swiper-box {
|
||||||
|
width: 686rpx;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: #5074FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: 150upx;
|
||||||
|
height: 60upx;
|
||||||
|
background: #5074FF;
|
||||||
|
border-radius: 30upx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 60rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -125,10 +125,10 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: res.msg,
|
// title: res.msg,
|
||||||
icon: 'none'
|
// icon: 'none'
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user