Merge branch 'xie'

This commit is contained in:
@fawn-nine
2024-06-21 13:35:55 +08:00
6 changed files with 209 additions and 98 deletions

View File

@@ -14,7 +14,7 @@
<view class="content">
<!-- <text class="text">{{item.title}}</text> -->
<view class="sub1List">
<view class="item leve2" @click.stop="clickCourseInfo(item)">
<view class="item leve2" @click.stop="clickCourseInfo(item)" v-if="item.isLast == 1">
<text class="textss"> 本目录下全部课程</text>
</view>
<view :class="['item', 'leve2']"

View File

@@ -436,8 +436,7 @@
"path" : "pages/course/myCourse",
"style" :
{
"navigationBarTitleText" : "我的课程",
"enablePullDownRefresh": true
"navigationBarTitleText" : "我的课程"
}
},{
"path": "pages/goods/index/index",

View File

@@ -366,7 +366,7 @@
},
onReachBottom() {
console.log('触底');
if (this.status != 2) {
if (this.status != 2 && !this.loadFlag) {
this.pPage++
this.getSayList()
}
@@ -592,10 +592,10 @@
// 查询课程的评论
getSayList() {
this.status = 1
if (this.loadFlag) {
console.log('有未完成的进程');
return
}
// if (this.loadFlag) {
// console.log('有未完成的进程');
// return
// }
this.loadFlag = true
$http.request({
url: "common/courseGuestbook/getCourseGuestbookList",
@@ -640,7 +640,7 @@
this.loadFlag = false
}).catch(e => {
console.log('获取留言失败');
this.loadFlag = false
// this.loadFlag = false
})
},
previewImage(url) {

View File

@@ -139,7 +139,7 @@
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.status != 2) {
if (this.status != 2 && this.flag) {
this.page++
this.getData(this.subTabId)
}
@@ -245,10 +245,10 @@
this.getData(this.subTabId);
},
getData(id) {
if (!this.flag) {
console.log('正在执行,未完成')
return
}
// if (!this.flag) {
// console.log('正在执行,未完成')
// return
// }
this.status = 1
this.flag = false
$http.request({

View File

@@ -9,16 +9,21 @@
itemStyle="padding-left: 15px; padding-right: 15px; height: 50px;"></u-tabs>
</view>
<view class="containerBg1">
<view class="MyCourseBox" v-show="this.curTagId == 0">
<view class="search" style="margin-top: 20rpx;">
<u-search placeholder="请输入课程名" @clear="clear" v-model="searchValue"
@search="search" @custom="search"></u-search>
</view>
<uni-section class="mb-10" title="课程列表" type="line">
<uni-section class="mb-10" title="课程列表" type="line">
<template v-slot:right>
<u-icon name="grid" color="#2979ff" size="28" @click="showDrawer"></u-icon>
</template>
</uni-section>
<view class="selectCateText" v-if="selectCat != ''">
<text>已选中分类{{selectCat}}</text>
<text class="del" @click="delselectCat">清除</text>
</view>
<!-- <view class="containerBg"> -->
<view class="newBox">
<view class="item flexbox" v-for="(item, index) in MyCourseList.list" :key="index"
@@ -52,6 +57,89 @@
<u-divider v-show="MyCourseList.status == 2" text="已加载全部"></u-divider>
<u-divider v-show="MyCourseList.status == 3" text="暂无数据"></u-divider>
<u-divider v-show="MyCourseList.status == 1" text="加载中..."></u-divider>
</view>
<view class="LearningCourseBox" v-show="this.curTagId == 1">
<uni-section class="mb-10" title="在学习课程列表" type="line">
<!-- <template v-slot:right>
<u-icon name="grid" color="#2979ff" size="28" @click="showDrawer"></u-icon>
</template> -->
</uni-section>
<!-- <view class="containerBg"> -->
<view class="newBox">
<view class="item flexbox" v-for="(item, index) in LearningCourseList.list" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555">
{{item.title}}
</view>
<view class="jianjie" v-html="item.content">
</view>
<view class="tag-view">
<uni-tag v-if="item.level != 0" style="margin-right: 10rpx;"
:text="item.level == 1 ? '初级':'高级'" type="primary" size="small" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;"
text="必修" size="small" type="warning" />
<uni-tag v-if="item.selective != 0 && item.selective == 2" style="margin-right: 10rpx;"
text="选修" size="small" type="success" />
</view>
<view class="btn_box">
<text>了解课程</text>
</view>
</view>
</view>
</view>
<u-divider v-show="LearningCourseList.status == 2" text="已加载全部"></u-divider>
<u-divider v-show="LearningCourseList.status == 3" text="暂无数据"></u-divider>
<u-divider v-show="LearningCourseList.status == 1" text="加载中..."></u-divider>
</view>
<view class="ExpiredCourseBox" v-show="this.curTagId == 2">
<uni-section class="mb-10" title="过期课程列表" type="line">
<!-- <template v-slot:right>
<u-icon name="grid" color="#2979ff" size="28" @click="showDrawer"></u-icon>
</template> -->
</uni-section>
<!-- <view class="containerBg"> -->
<view class="newBox">
<view class="item flexbox" v-for="(item, index) in ExpiredCourseList.list" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555">
{{item.title}}
</view>
<view class="jianjie" v-html="item.content">
</view>
<view class="tag-view">
<uni-tag v-if="item.level != 0" style="margin-right: 10rpx;"
:text="item.level == 1 ? '初级':'高级'" type="primary" size="small" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;"
text="必修" size="small" type="warning" />
<uni-tag v-if="item.selective != 0 && item.selective == 2" style="margin-right: 10rpx;"
text="选修" size="small" type="success" />
</view>
<view class="btn_box">
<text>了解课程</text>
</view>
</view>
</view>
</view>
<u-divider v-show="ExpiredCourseList.status == 2" text="已加载全部"></u-divider>
<u-divider v-show="ExpiredCourseList.status == 3" text="暂无数据"></u-divider>
<u-divider v-show="ExpiredCourseList.status == 1" text="加载中..."></u-divider>
</view>
</view>
<view>
@@ -85,7 +173,8 @@
return {
curTagId: 0,
playData: {},
searchValue:'',
searchValue:'',
selectCat:'', // 选中的分类名称
// fixed: false,
bgiStyle: {
background: '#fff'
@@ -113,7 +202,7 @@
name: '我的课程'
}, {
id: 2,
name: '我收藏的'
name: '正在学习'
}, {
id: 3,
name: '已过期'
@@ -152,8 +241,8 @@
this.getUserInfo()
// this.fatherClick()
this.getMyCourseList()
// this.getLearningCourseList()
// this.getExpiredCourseList()
this.getLearningCourseList()
this.getExpiredCourseList()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
@@ -163,6 +252,15 @@
this.fixed = false
}
},
onPullDownRefresh() {
this.selectCat = ''
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
this.getLearningCourseList()
this.getExpiredCourseList()
uni.stopPullDownRefresh()
},
computed: {
...mapState(['userInfo'])
},
@@ -176,13 +274,12 @@
console.log('触底');
if (this.curTagId == 0) {
if(this.MyCourseList.status != 2){
if(!this.MyCourseList.flag){
this.MyCourseList.page++
this.getMyCourseList()
}
}
}else if(this.curTagId == 1){
}else if(this.curTagId == 2){
}
}
},
components: {
// musicPlay
@@ -193,8 +290,24 @@
},
//方法
methods: {
delselectCat(){
this.selectCat = ''
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
},
search(res){
console.log('点了搜索')
// if (this.curTagId == 0) {
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
// this.curTagId = 0
// }else if(this.curTagId == 1){
// this.getLearningCourseList()
// }else if(this.curTagId == 2){
// this.getExpiredCourseList()
// }
},
cancel(res){},
clear(){
@@ -204,10 +317,15 @@
console.log(val,'选择的分类数据');
if(val && val.id){
this.medicalId = val.id
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.selectCat = val.title
this.getMyCourseList()
}
},
fatherClick(e) {
console.log(e,'tabitem')
this.curTagId = e.index
},
showDrawer(){
this.treeListVisible = true
@@ -218,11 +336,11 @@
},
getMyCourseList() {
this.MyCourseList.status = 1
if (this.MyCourseList.flag) {
console.log('正在执行,未完成')
return
}
this.MyCourseList.flag = false
// if (this.MyCourseList.flag) {
// console.log('正在执行,未完成')
// return
// }
this.MyCourseList.flag = true
$http.request({
url: "medical/course/getUserCourseBuy",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
@@ -247,91 +365,82 @@
this.MyCourseList.status = 2
}
} else {
this.MyCourseList.status = 3 // 暂无数据
}
console.log('status', this.MyCourseList.status)
}
this.MyCourseList.flag = true
this.MyCourseList.flag = false
}).catch(e => {
console.log(e, '数据报错')
});
},
getLearningCourseList() {
if (!this.pObj.pFlag) {
return
}
this.pObj.pFlag = false
this.pObj.status = 1
this.LearningCourseList.status = 1
// this.LearningCourseList.flag = true
$http.request({
url: "common/taihuWelfare/getTaihuWelfareProductList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"page": this.pObj.page,
"limit": 14
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
if (res.page.records.length > 0) {
var _list = res.page.records
this.productList = this.productList.concat(_list)
if (res.page.pages > this.pObj.page) {
this.pObj.status = 88
url: "medical/course/getUserCourseStudying",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"userId": this.userInfo.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.courseList.length > 0) {
this.LearningCourseList.list = res.courseList
// if (res.courseList.pages > this.LearningCourseList.page) {
// this.LearningCourseList.status = 0
// } else {
this.LearningCourseList.status = 2
// }
} else {
// 加载完毕
this.pObj.status = 2
this.LearningCourseList.status = 3 // 暂无数据
}
} else {
this.pObj.status = 3
console.log('status', this.LearningCourseList.status)
}
}
this.pObj.pFlag = true
}).catch(e => {
console.log(e, '商品列表')
this.pObj.status = 88
this.pObj.pFlag = true
});
// this.LearningCourseList.flag = false
}).catch(e => {
console.log(e, '数据报错')
});
},
getExpiredCourseList() {
if (!this.pObj.pFlag) {
return
}
this.pObj.pFlag = false
this.pObj.status = 1
this.ExpiredCourseList.status = 1
// if (this.ExpiredCourseList.flag) {
// console.log('正在执行,未完成')
// return
// }
// this.ExpiredCourseList.flag = true
$http.request({
url: "common/taihuWelfare/getTaihuWelfareProductList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"page": this.pObj.page,
"limit": 14
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
}).then(res => {
if (res.code == 0) {
if (res.page.records.length > 0) {
var _list = res.page.records
this.productList = this.productList.concat(_list)
if (res.page.pages > this.pObj.page) {
this.pObj.status = 88
url: "medical/course/getCourseExpire",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"userId": this.userInfo.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.courseList.length > 0) {
this.ExpiredCourseList.list = res.courseList
// if (res.courseList.pages > this.ExpiredCourseList.page) {
// this.ExpiredCourseList.status = 0
// } else {
this.ExpiredCourseList.status = 2
// }
} else {
// 加载完毕
this.pObj.status = 2
this.ExpiredCourseList.status = 3 // 暂无数据
}
} else {
this.pObj.status = 3
console.log('status', this.ExpiredCourseList.status)
}
}
this.pObj.pFlag = true
}).catch(e => {
console.log(e, '商品列表')
this.pObj.status = 88
this.pObj.pFlag = true
});
// this.ExpiredCourseList.flag = false
}).catch(e => {
console.log(e, '数据报错')
});
},
getUserInfo() {
// 用户详情
@@ -356,6 +465,9 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.selectCateText{ margin-bottom: 20rpx;
.del{color: #ff7446; padding-left: 20rpx;}
}
.search{background-color: $containerColor; padding: 10rpx; }
.containerBg1{padding:0 10px;}
.containerBg {

View File

@@ -123,7 +123,7 @@
onReachBottom() {
console.log('触底加载')
if (this.tabId == 1) { // 商品
if (this.pObj.status != 2) {
if (this.pObj.status != 2 && this.pObj.pFlag) {
this.pObj.page++
this.getProData()
} else {
@@ -131,7 +131,7 @@
}
}
if (this.tabId == 2) { // 资讯
if (this.nObj.status != 2) {
if (this.nObj.status != 2 && this.nObj.nFlag) {
this.nObj.page++
this.getnewsData()
} else {