fanfan 5 months ago
parent 88218f6dce
commit feab27b94e
  1. 2
      pages.json
  2. 59
      pages/merchantTutorial/tutorial.vue

@ -1186,7 +1186,7 @@
"path": "tutorial", "path": "tutorial",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarTitleText": "商家教程" "navigationBarTitleText": "商家教程"
} }
} }

@ -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;

Loading…
Cancel
Save