暂存
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<view class="888">
|
||||
<view class="newBox" v-if="preClassList.length > 0">
|
||||
<view class="item flexbox" v-for="(item, index) in preClassList" :key="index"
|
||||
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||
@click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" v-if="item.icon != ''">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
@@ -35,7 +35,7 @@
|
||||
<text v-show="item.classModel.type == 0">【普通班】</text>
|
||||
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||
<text v-show="item.classModel.type == 2">【精英班】</text>
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
@@ -58,7 +58,7 @@
|
||||
<view class="learnBox box">
|
||||
<view class="newBox" v-if="learningClassList.length > 0">
|
||||
<view class="item flexbox" v-for="(item, index) in learningClassList" :key="index"
|
||||
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||
@click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" v-if="item.icon != ''">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
@@ -71,7 +71,7 @@
|
||||
<text v-show="item.classModel.type == 0">【普通班】</text>
|
||||
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||
<text v-show="item.classModel.type == 2">【精英班】</text>
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
@@ -98,7 +98,7 @@
|
||||
<view class="learnBox box">
|
||||
<view class="newBox" v-if="classList.length > 0">
|
||||
<view class="item flexbox" v-for="(item, index) in classList" :key="index"
|
||||
@click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||
@click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||
<view class="imgcontainer" v-if="item.icon != ''">
|
||||
<image :src="item.icon" mode="aspectFit"></image>
|
||||
@@ -111,7 +111,7 @@
|
||||
<text v-show="item.classModel.type == 0">【普通班】</text>
|
||||
<text v-show="item.classModel.type == 1">【联合班】</text>
|
||||
<text v-show="item.classModel.type == 2">【精英班】</text>
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item.id)">
|
||||
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
|
||||
{{item.title}}
|
||||
</text>
|
||||
</view>
|
||||
@@ -256,8 +256,8 @@
|
||||
console.log('下拉刷新')
|
||||
// this.status = 3
|
||||
// this.page = 1
|
||||
this.classList = []
|
||||
this.getData()
|
||||
// this.classList = []
|
||||
// this.getData()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
onReachBottom() {
|
||||
@@ -271,10 +271,13 @@
|
||||
...mapState(['userInfo'])
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
async onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
// uni.hideTabBar();
|
||||
this.getLearingClassList()
|
||||
this.classList = await this.getData('1','2')
|
||||
this.learningClassList = await this.getData('1','1')
|
||||
this.preClassList = await this.getData('1','0')
|
||||
// this.getLearingClassList()
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
@@ -303,6 +306,7 @@
|
||||
url: "common/class/MyClassList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"role": "1",
|
||||
"state": '0', //小班状态0待开班1已开班2完成
|
||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
@@ -341,6 +345,7 @@
|
||||
url: "common/class/MyClassList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"role": "1",
|
||||
"state": '1', //小班状态0待开班1已开班2完成
|
||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
@@ -399,22 +404,23 @@
|
||||
// this.page = 1
|
||||
// this.getData(this.subTabId);
|
||||
},
|
||||
getData(id) {
|
||||
if (!this.flag) {
|
||||
console.log('正在执行,未完成')
|
||||
return
|
||||
}
|
||||
|
||||
async getData(role,state) {
|
||||
// if (!this.flag) {
|
||||
// console.log('正在执行,未完成')
|
||||
// return
|
||||
// }
|
||||
var _list = []
|
||||
this.status = 1
|
||||
this.flag = false
|
||||
// this.flag = false
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
$http.request({
|
||||
await $http.request({
|
||||
url: "common/class/MyClassList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"state": '2', //小班状态0待开班1已开班2完成
|
||||
"role": role,
|
||||
"state": state, //小班状态0待开班1已开班2完成
|
||||
"type": '' // 班类型 0小班 1联合班 2精英班
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
@@ -424,17 +430,19 @@
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.result.length > 0) {
|
||||
this.classList = res.result
|
||||
|
||||
// this.classList = res.result
|
||||
_list = res.result
|
||||
} else {
|
||||
this.classList = []
|
||||
// this.classList = []
|
||||
_list = []
|
||||
}
|
||||
this.flag = true
|
||||
// this.flag = true
|
||||
}
|
||||
uni.hideLoading()
|
||||
}).catch(e => {
|
||||
_list = []
|
||||
uni.hideLoading()
|
||||
this.flag = true
|
||||
// this.flag = true
|
||||
console.log(e, '数据报错')
|
||||
// this.status = 3
|
||||
uni.showToast({
|
||||
@@ -442,15 +450,49 @@
|
||||
icon: 'error'
|
||||
})
|
||||
});
|
||||
return _list
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url, id, have) {
|
||||
// console.log('进来了',url,id);
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&have=${have}`
|
||||
});
|
||||
async onPageJump(url, id, have) {
|
||||
var isStudent = await this.getRealRole(id)
|
||||
console.log('isStudent',isStudent);
|
||||
if(isStudent){
|
||||
uni.navigateTo({
|
||||
url:`/pages/miniClass/classInfo?id=${id}`
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&have=${have}`
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取真实的身份信息
|
||||
async getRealRole(id) {
|
||||
// console.log('this.thisClass.id', this.thisClass.id);
|
||||
var _isStudent = undefined
|
||||
await $http.request({
|
||||
url: "common/class/getUserRole",
|
||||
method: "POST",
|
||||
data: {
|
||||
"classId": id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
uni.hideLoading()
|
||||
// 如果单纯是学员的身份
|
||||
if(res.result.length == 1 && res.result[0].role == 0){
|
||||
console.log('只是学员身份');
|
||||
_isStudent = true
|
||||
|
||||
}else{
|
||||
_isStudent = false
|
||||
}
|
||||
})
|
||||
return _isStudent
|
||||
},
|
||||
|
||||
shuomingPage(url, id, pid) {
|
||||
uni.navigateTo({
|
||||
url: `${url}?id=${id}&pid=${pid}`
|
||||
|
||||
Reference in New Issue
Block a user