This commit is contained in:
@fawn-nine
2024-08-05 17:30:54 +08:00
parent 1c670dfc27
commit 4426b044bd
20 changed files with 2303 additions and 443 deletions

View File

@@ -275,6 +275,13 @@
// console.log('this.fileList1',_list);
this.form.icon = _list.join(',')
}
if(this.form.number <= 0){
uni.showToast({
title: '目标人数必须大于0个人',
icon: 'error'
})
return
}
var _url = ''
this.form.id ? _url = 'common/class/editClass' : _url = "common/class/addClass"
$http.request({

View File

@@ -0,0 +1,349 @@
<template>
<view class="page">
<z-nav-bar :title="pageName+pageType"></z-nav-bar>
<!-- 公共组件-每个页面必须引入 -->
<public-module ></public-module>
<!-- <view class="title">{{pageName+pageType}}</view> -->
<uni-forms :modelValue="form" :rules="rules" ref="form">
<view class="input_box">
<uni-forms-item label="" name="title" label-width="0">
<text class="input_tit"><i>*</i>标题:</text>
<view class="in">
<input placeholder-style="font-size:26rpx" type="text" v-model="form.title"
placeholder="请输入标题" />
</view>
</uni-forms-item>
</view>
<view class="input_box">
<text class="input_tit">上传图片:</text>
<view class="in" style="border: none;" @click="checkPermision">
<u-upload :fileList="fileList1" @afterRead="addPic" @delete="deletePic" multiple :maxCount="4"
width="40" height="40" :previewFullImage="true">
</u-upload>
<!-- <text style="font-size: 24rpx; color: #999;">可上传4张问题截图</text> -->
</view>
<!-- <input type="password" maxlength="8" v-model="confirmPassword" placeholder="请确认密码" /> -->
</view>
<view class="input_box">
<uni-forms-item label="" name="content" label-width="0">
<text class="input_tit"><i>*</i>说明:<span style="font-weight: normal; color: #999; font-size: 26rpx;">(600字以内)</span></text>
<view class="in">
<view class="uni-textarea">
<textarea placeholder-style="font-size:26rpx" v-model="form.content" maxlength="600"
placeholder="请输入内容" />
</view>
</view>
</uni-forms-item>
</view>
<view class="input_box" v-if="form.type == 2">
<radio-group @change="radioChange" class="flex_box">
<view class="" style="margin-right:20rpx ;">
<radio value="0" />他人不可见</label>
</view>
<view class="">
<radio value="1" checked="true" />他人可见</label>
</view>
</radio-group>
<span style="color: #999; font-size: 28rpx;">不勾选时班级管理员以外的人看不见提交的数据</span>
</view>
</uni-forms>
<view class="btn_box"><button @click="onSubmit"> </button></view>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
import permission from "@/js_sdk/wa-permission/permission.js"
import {
mapState,
mapMutations
} from 'vuex';
export default {
data() {
return {
fileList1: [],
playData: {},
//手机号账号
form: {
id: '', // 作业或者医案id
classId: undefined,
display:'1',
content: '', // 描述
img: '', //图片
type: undefined, // 反馈类型
},
telError: false,
relationError: false,
relationErrorPattern:false,
rules: {
title: {
rules: [{
required: true,
errorMessage: '请输入标题',
}
]
},
content: {
rules: [{
required: true,
errorMessage: '请输入问题描述',
}
]
},
},
pageType: '',
pageName:''
};
},
//第一次加载
onLoad(e) {
console.log('收到的值', e);
this.pageType = e.type
this.form.classId = e.id
this.form.type = e.type
if(e.renwuId){
this.form.renwuId = e.renwuId
this.pageName = '编辑'
}else{
this.pageName = '添加'
}
if(e.type == 0){
// this.form.renwuId = e.renwuId
this.pageType = '作业'
}else if(e.type == 1){
this.pageType = '医案'
}
},
//页面显示
onShow() {
},
computed: {
...mapState(['userInfo']),
reversedMessage: function() {
// `this` 指向 vm 实例
this.form.account = this.userInfo.tel
}
},
//方法
methods: {
radioChange(e){
// console.log('点了', e);
this.form.display = e.detail.value
console.log('点了',this.form.show, e);
},
relationInput(e) {
this.relationError = false
this.relationErrorPattern = false
},
telInput(e) {
// console.log('键盘输入',e);
this.telError = false
},
async checkPermision(){
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
if (result != 1) {
return false
}
},
async addPic(e) {
console.log("添加图片");
let that = this;
for (var i = 0; i < e.file.length; i++) {
//console.log(i,e.file[i].url)
uni.uploadFile({
url: this.$baseUrl + "oss/fileoss",
filePath: e.file[i].url,
//files:e.file,
name: "file",
formData: {},
success: (res) => {
that.fileList1.push({
url: JSON.parse(res.data).url,
});
console.log(that.fileList1, "that.uploadPicLIst");
},
fail: (error) => {
console.log("上传失败", error);
},
});
}
},
deletePic(event) {
this.fileList1.splice(event.index, 1)
},
onSubmit() {
this.$refs.form.validate().then(res => {
var _show = '1'
if(this.form.type == 2){
this.form.display == true ? _show = '1' : _show = '0'
}
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
// console.log('this.fileList1',_list);
this.form.img = _list.join(',')
}
// this.$http.post("common/class/addClassTask",{
// "classId": this.form.classId,
// "type": this.form.type, //类型 0班内任务1医案2心得
// "show": _show, //0不展示1展示
// "title": this.form.title,
// "content": this.form.content,
// "img": this.form.img
// })
$http.request({
url: "common/class/addClassTask",
method: "POST",
data: {
"classId": this.form.classId,
"type": this.form.type, //类型 0班内任务1医案2心得
"display": _show, //0不展示1展示
"title": this.form.title,
"content": this.form.content,
"img": this.form.img
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
uni.showToast({
title:'操作成功!',
icon:'success'
})
setTimeout(()=>{
uni.navigateBack({
delta: 1
});
},1000)
}).catch(e => {
// console.log('表单错误信息:', err);
uni.showToast({
title: '操作失败',
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
})
})
}
},
//页面隐藏
onHide() {},
//页面卸载
onUnload() {},
//页面下来刷新
onPullDownRefresh() {},
//页面上拉触底
onReachBottom() {},
//用户点击分享
onShareAppMessage(e) {
return this.wxShare();
}
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
::v-deep .uni-forms-item{
margin-bottom: 26rpx !important;
}
.input_tit{
font-weight: bold;
}
.page {
background-color: #ffffff;
padding: 0 65rpx;
min-height: 100vh;
.title {
padding: 30rpx 0 40rpx 0;
font-size: 40rpx;
color: #333333;
}
.input_box {
display: block;
// justify-content: space-between;
// overflow: hidden;
// height: 100rpx;
padding-top: 10rpx;
// border-bottom: 1rpx solid #eeeeee;
align-items: center;
i {
font-size: 24rpx;
color: red;
padding-right: 10rpx;
}
.in {
border: 1rpx solid #eeeeee;
border-radius: 8rpx;
padding: 8rpx;
margin-top: 10rpx;
}
text {
font-size: 30rpx;
width: 180rpx;
}
input {
flex: 1;
height: 50rpx;
// line-height: 70rpx;
font-size: 30rpx;
}
button {
height: 78rpx;
line-height: 78rpx;
font-size: 30rpx;
color: $themeColor;
&:active {
background-color: transparent;
}
}
}
.btn_box {
margin-top: 70rpx;
padding-bottom: 20rpx;
button {
font-size: 32rpx;
@include theme('btn_bg') color: #fff;
height: 80rpx;
line-height: 80rpx;
border-radius: 50rpx;
}
}
.protocol {
font-size: 24rpx;
color: #999999;
text-align: center;
margin-top: 20rpx;
text {
color: $themeColor;
}
}
}
</style>

View File

@@ -0,0 +1,547 @@
<template>
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="pageName"></z-nav-bar>
<!-- <view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
itemStyle="padding-left: 15px; padding-right: 15px; height: 50px;"></u-tabs>
</view> -->
<view class="containerBg1">
<!-- 我的课程 -->
<view class="MyCourseBox" >
<!-- <view class="containerBg"> -->
<view class="newBox">
<view :class="['item','flexbox', userMsg.vip != '0'&& item.isBuy != 1 ? 'blueBorder':'']" v-for="(item, index) in MyTaskList.list" :key="index"
>
<view class="vipTag" v-if="userMsg.vip != '0' && item.isBuy != 1">
VIP畅学
</view>
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" @click="onPageJump('/pages/course/courseDetail',item.id)">
<image v-if="item.image && item.image != ''" :src="item.image" mode="aspectFit"></image>
<!-- <image :src="item.image" mode="" @click="goDetail(item.productId)"></image> -->
<!-- <image v-else src="/static/nobg.jpg" mode="widthFix"></image> -->
</view>
<view class="buyItems">
<view class="txt555">
<view class="" @click="onPageJump('/pages/course/courseDetail',item.id)">
{{item.title}}
</view>
</view>
<view class="jianjie" v-html="item.content">
</view>
<view class="collection">
<!-- 收藏状态{{item.isStudying}} -->
<text class="add citem" v-if="item.isStudying == 0" @click="addCollection(item,index)">加入在学习</text>
<text class="del citem" v-else @click="delCollection(item,index)">取消在学习</text>
<text class="citem btn_box" @click="onPageJump('/pages/course/courseDetail',item.id)">去学习</text>
</view>
</view>
</view>
</view>
<u-divider v-show="MyTaskList.status == 2" text="已加载全部"></u-divider>
<u-divider v-show="MyTaskList.status == 3" text="暂无数据"></u-divider>
<u-divider v-show="MyTaskList.status == 1" text="加载中..."></u-divider>
</view>
</view>
<view>
<u-back-top :scroll-top="scrollTop" bottom="150" :customStyle='bgiStyle'
:iconStyle="iconStyle"></u-back-top>
</view>
<!-- </view> -->
<!-- 评论弹出 -->
<public-module></public-module>
<z-navigation></z-navigation>
<!-- <music-play :playData="playData"></music-play> -->
</view>
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
var clear;
import {
mapState
} from 'vuex';
export default {
data() {
return {
proPriceList: [],
pricespop:false,
curTagId: 0,
playData: {},
searchValue:'',
selectCat:'', // 选中的分类名称
// fixed: false,
bgiStyle: {
background: '#fff'
},
iconStyle: {
fontSize: '40rpx',
fontWeight: 'bold',
color: '#258feb',
},
userMsg: {}, // 用户信息
scrollTop: 0,
activeStyle: {
color: '#333',
fontWeight: 'bold',
transform: 'scale(1.2)',
// backgroundColor: '#258feb'
},
scrollable: false,
pageTitle: null,
fixed: false,
medicalId:'',
tabList: [{
id: '0',
name: '班内任务'
}, {
id: '1',
name: '医案'
}, {
id: '2',
name: '心得'
}], // 目录列表
curId: null,
curIndex: 0,
treeListVisible:false,
MyTaskList: {
list: [],
status: 88,
page: 1,
flag: false
},
classId:undefined,
pageType:undefined,
pageName:'',
};
},
//第一次加载
onLoad(e) {
this.classId = e.id,
this.pageType = e.type
if(e.type == '0'){
this.pageName = '班内任务'
}else if(this.pageName = '医案'){
}else{
this.pageName = '心得'
}
// 隐藏原生的tabbar
uni.hideTabBar();
// this.windowWidth = uni.getSystemInfoSync().windowWidth;
// this.pageTitle = e.title
console.log(e, '传入分类id')
// this.getUserInfo()
// this.fatherClick()
this.getMyTaskList()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
if (this.scrollTop > 500) {
this.fixed = true
} else {
this.fixed = false
}
},
onPullDownRefresh() {
this.selectCat = ''
this.MyTaskList.page = 1
this.MyTaskList.list = []
this.getMyTaskList()
// this.getLearningCourseList()
// this.getExpiredCourseList()
uni.stopPullDownRefresh()
},
computed: {
...mapState(['userInfo'])
},
//页面显示
onShow() {
// 隐藏原生的tabbar
uni.hideTabBar();
// #ifdef APP-PLUS
plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary");
// #endif
},
onReachBottom() {
console.log('触底');
if (this.curTagId == 0) {
if(this.MyTaskList.status != 2){
if(!this.MyTaskList.flag){
this.MyTaskList.page++
this.getMyTaskList()
}
}
}
},
components: {
// musicPlay
// emotion,
// treeList,
// buyPup
// commentsList
},
//方法
methods: {
oprate(data){
console.log(data,'得到的内容')
if(data.name == 'buy'){
this.buy(data.item)
}else if(data.name == 'gouwuche'){
this.addCart(data.item)
}
},
// 购物车
addCart(val){
console.log(val)
if (val.productStock == 0) {
uni.showToast({
title: '商品库存不足',
icon: "none"
});
} else {
console.log(this.userInfo, '222')
this.$http
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
.then(res => {
// console.log(
this.cartList = res.cartList
this.isAddLink(val)
}).catch( e => {
console.log(e,'e')
uni.showToast({
title:`获取数据失败`,
icon:'error'
})
})
}
},
closePup(e){
this.pricespop = false
},
delselectCat(){
this.selectCat = ''
this.medicalId = ''
this.MyTaskList.page = 1
this.MyTaskList.list = []
this.getMyTaskList()
},
// search(res){
// // console.log('点了搜索')
// if(!this.MyTaskList.flag){
// this.MyTaskList.page = 1
// this.MyTaskList.list = []
// this.getMyTaskList()
// console.log(this.searchValue,'searchValue')
// }else{
// console.log('存在未执行完的程序')
// }
// },
focus(res){
this.oldValue = res
// console.log(res,this.oldValue,'聚焦');
},
blur(res){
// console.log(res,this.searchValue,'res');
if(this.oldValue != res){ // 重新请求
this.MyTaskList.page = 1
this.MyTaskList.list = []
this.getMyTaskList()
this.oldValue = ''
}
},
clear(){
// console.log('++++++++++++++++++++++')
this.searchValue = ''
this.MyTaskList.page = 1
this.MyTaskList.list = []
this.getMyTaskList()
},
clickCourseInfo(val){
console.log(val,'选择的分类数据');
if(val && val.id){
this.medicalId = val.id
this.MyTaskList.page = 1
this.MyTaskList.list = []
this.selectCat = val.title
this.getMyTaskList()
}
},
fatherClick(e) {
if(this.pageType == e.id){ return}
console.log(e,'tabitem')
this.pageType = e.id
this.getMyTaskList()
this.curTagId = e.index
},
showDrawer(){
this.treeListVisible = true
this.$nextTick( ()=> {
this.$refs['treeList'].getData()
})
},
getMyTaskList() {
this.MyTaskList.status = 1
// if (this.MyTaskList.flag) {
// console.log('正在执行,未完成')
// return
// }
this.MyTaskList.flag = true
$http.request({
url: "common/class/getClassTaskList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"limit": 20,
"page": this.MyTaskList.page,
"type": this.pageType+'', //类型 0班内任务1医案2心得
"title": ""
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.page.records.length > 0) {
var list = res.page.records
this.MyTaskList.list = this.MyTaskList.list.concat(list)
if (res.page.pages > this.MyTaskList.page) {
this.MyTaskList.status = 0
} else {
this.MyTaskList.status = 2
}
} else {
this.MyTaskList.status = 3 // 暂无数据
}
// console.log('status--------------------', this.MyTaskList.list)
}
this.MyTaskList.flag = false
}).catch(e => {
this.MyTaskList.flag = false
this.MyTaskList.status = 3
console.log(e, '数据报错')
uni.showToast({
title:`获取数据失败`,
icon:'error'
})
});
},
getUserInfo() {
// 用户详情
// if (this.userInfo.id != undefined) {
this.$http
.post('book/user/info/' + this.userInfo.id)
.then(res => {
this.userMsg = res.user
// this.userInfo = res.user
});
// }
},
// 跳转
onPageJump(url, id) {
uni.navigateTo({
url: `${url}?id=${id}`
});
},
},
};
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.LearningCourseBox,.ExpiredCourseBox{margin-top: 20rpx;}
.collection{ margin-top: 20rpx; overflow: hidden; text-align: right;
.btn_box{border: 1px solid $themeColor !important; color:$themeColor !important; margin-left: 20rpx;}
.citem{ display: inline-block;
border-radius: 10rpx;
// background-color: #ff7446;
border: 1px solid #ff7446;
padding: 10rpx; font-size:24rpx;
color: #ff7446;
}
.del{
background-color: #ffe6db; color: #ff7446;
}
}
.sectionTitle{ margin: 20rpx 0;
justify-content: space-between; margin-bottom: 20rpx; margin-top: 20rpx;
.rightIcon{color:#2979ff ; align-items: center; font-size: 26rpx;}
}
.selectCateText{ min-width:20rpx ; font-size: 26rpx;
.del{color: #ff7446; padding-left: 20rpx;}
}
.search{background-color: $containerColor; padding: 10rpx; }
.containerBg1{padding:0 10px;}
.containerBg {
background-color: $containerColor;
padding: 0 20rpx;
}
.curseSet{margin-right: 20rpx; font-size: 28rpx; display: flex; align-items: center;}
.fixed {
position: fixed;
z-index: 2; width: 100%; background-color: #fff;
}
.newBox {
.blueBorder{border: 1px solid #2979ff !important;}
.item { overflow: hidden;
border: #fff 1px solid ;
.vipTag{position: absolute; padding:10rpx 100rpx; font-size: 26rpx;
left: -100rpx; top: 20rpx;
transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
z-index: 1;
@include theme("btn_bg") ;
color: #fff;}
position: relative;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 20rpx;
@include ptop_bottm(10px);
@include pleft_right(10px);
@include mshadow(10px, 1) .imgcontainer {
display: block;
width: 110rpx;
margin-right: 20rpx;
// background-size: cover;
// background-position: center;
height: 200rpx;
flex-grow: 1;
// @include ptop_bottm(10px);
overflow: hidden;
// @include pleft_right(10px);
image {
width: 100%;
height: 200rpx;
}
}
.btn_box{ text-align: right;
text{
border-radius: 20rpx;
padding: 3px 5px; @include theme("btn_bg");
font-size: 28rpx; color: #fff;
}
}
.buyItems {
width: 60%;
}
.jianjie {
line-height: 30rpx; height: 60rpx; overflow: hidden;
margin-top: 10rpx;
font-size: 24rpx;
@include bov();
color: #9c9c9c;
}
.txt555 {
font-size: 30rpx;
color: #000;
@include bov()
}
}
}
.subCate {
padding-top:10px;
padding-bottom: 10px;
.item {
font-size: 26rpx;
background-color: #fff;
border-radius: 10px;
color: #333;
margin-right: 16rpx;
padding: 14rpx 30rpx;
}
.item:last-child() {
margin-right: 0;
}
.item.active {
background-color: $themeColor;
color: #fff;
}
}
.tabList {
text-align: center;
}
.flexbox {
display: flex;
}
.imgcontainer {
background-color: $imgBg;
}
.box {
// background-color: #fff;
min-height: calc(100vh - 270rpx);
}
.learnBox {
// background-color: #fff;
margin-top: 10px;
.learn {
flex-wrap: wrap;
justify-content: space-between;
margin-top: 20rpx;
.item {
width: 48%;
margin-bottom: 16px;
overflow: hidden;
image {
width: 100%;
height: 200rpx;
}
.txt555 {
display: block;
text-align: center;
height: 40rpx;
width: 100%;
line-height: 40rpx;
@include bov(1);
margin-top: 10rpx;
font-size: 24rpx;
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,125 @@
<template>
<view>
<z-nav-bar :title="pageName"></z-nav-bar>
<view class="">
<!-- <uni-section title="左侧滑出" type="line"> -->
<view class="example-body">
<view class="haveNoSelected">
<view class="flex_box" style="text-align: center; align-items: center; justify-content: center; width: 100%; background-color: #eee; padding: 40rpx 0;">
<button type="primary" @click="showDrawer('showLeft')" size="mini"><text class="word-btn-white">选择任务</text>
</button>
</view>
<text style="display: inline-block; margin-top: 40rpx;">
操作步骤<br/>
1点击上面的选择按钮在弹出的面板中选择要评分的内容<br/>
2点击要评分的内容会列出学员提交的内容评分员可点击对应的提交内容进行评分
</text>
</view>
<uni-drawer ref="showLeft" mode="left" :width="300" @change="change($event,'showLeft')">
<view class="scroll-view">
<scroll-view class="scroll-view-box" scroll-y="true">
<view class="info">
<text class="info-text">右侧遮罩只能通过按钮关闭不能通过点击遮罩关闭</text>
</view>
<view class="close">
<button @click="closeDrawer('showRight')"><text class="word-btn-white">关闭Drawer</text></button>
</view>
<view class="info-content" v-for="item in 100" :key="item">
<text>可滚动内容 {{item}}</text>
</view>
<!-- <view class="close">
<button @click="closeDrawer('showRight')"><text class="word-btn-white">关闭Drawer</text></button>
</view> -->
</scroll-view>
</view>
</uni-drawer>
</view>
<!-- </uni-section> -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
classId:undefined,
pageType:undefined,
showRight: false,
showLeft: false,
pageName:''
}
},
onLoad(e) {
this.classId = e.classId
this.pageType = e.type
if(e.type == '0'){
this.pageName = '任务评分'
}else if(this.pageName = '医案评分'){
}else{
this.pageName = '心得评分'
}
},
onBackPress() {
if (this.showRight || this.showLeft) {
this.$refs.showLeft.close()
this.$refs.showRight.close()
return true
}
},
methods: {
// 打开窗口
showDrawer(e) {
this.$refs[e].open()
},
// 关闭窗口
closeDrawer(e) {
this.$refs[e].close()
},
// 抽屉状态发生变化触发
change(e, type) {
console.log((type === 'showLeft' ? '左窗口' : '右窗口') + (e ? '打开' : '关闭'));
this[type] = e
}
}
}
</script>
<style lang="scss" scoped>
.example-body {
padding: 10px;
}
.scroll-view {
/* #ifndef APP-NVUE */
width: 100%;
height: 100%;
/* #endif */
flex:1
}
// 处理抽屉内容滚动
.scroll-view-box {
flex: 1;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.info {
padding: 15px;
color: #666;
}
.info-text {
font-size: 14px;
color: #666;
}
.info-content {
padding: 5px 15px;
}
.close {
padding: 10px;
}
</style>

View File

@@ -72,7 +72,7 @@
<!-- {{setDefaultAddItem}} -->
<view class="item" v-if="memeberRefsh">
<view class="box" v-for="(item, index) in form.scorer" @click="showMemberAdd('scorer',index)">
<span v-show="!item"><uni-icons class="addIcon" color="#999" type="plusempty"
<span v-show="!item || item == null || item == 'null'"><uni-icons class="addIcon" color="#999" type="plusempty"
size="20"></uni-icons></span>
<text style="width: 100%; display: inline-block;"
v-if="item">
@@ -157,8 +157,8 @@
"monitor": undefined, //班长
"dmonitor": undefined, //2班长
"learner": undefined, //学习委员
"scorer": [], //评分员
"counter": [] //记分员
"scorer": [undefined,undefined], //评分员
"counter": [undefined,undefined] //记分员
},
telError: false,
// relationError: false,
@@ -255,6 +255,8 @@
this.refresh = false
if (res.code == 0) {
if (res.result.admins.length > 0) {
var scorerIndex = 0
var counterIndex = 0
res.result.admins.forEach(item => {
if (item.role == '1') {
this.form.monitor = item.user
@@ -265,33 +267,18 @@
if (item.role == '3') {
this.form.learner = item.user
}
if (item.role == '4') {
// console.log('this.admins.counter',this.admins.counter);
this.form.scorer.push(item.user)
if (item.role == '4') {
this.form.scorer[scorerIndex] = item.user
scorerIndex += 1
}
if (item.role == '5') {
// console.log('this.admins.counter',this.admins.counter);
this.form.counter.push(item.user)
if (item.role == '5') {
this.form.counter[counterIndex] = item.user
counterIndex += 1
}
})
}
if(this.form.scorer.length == 1){
this.form.scorer[1] = undefined
}else if(this.form.scorer.length == 0){
this.form.scorer[0] = undefined
this.form.scorer[1] = undefined
}
if(this.form.counter.length == 1){
this.form.counter[1] = undefined
}else if(this.form.counter.length == 0){
this.form.counter[0] = undefined
this.form.counter[1] = undefined
}
// this.form = res.result.class
// this.form.modelId = res.result.classModel.id
console.log('this.form.scorer',this.form.scorer.length);
}
console.log('this.form', this.form);
uni.hideLoading()

View File

@@ -12,9 +12,9 @@
<view class="" style="width: 60%; text-align: center;">
<button type="primary" @click="pupShow = true">新开一个班级</button>
</view>
</view>
</view>
</view>
<view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"
:activeStyle="activeStyle" :scrollable="scrollable" :list="tabList"
@@ -182,6 +182,7 @@
},
//页面显示
onShow() {
this.addType = undefined
// 隐藏原生的tabbar
// uni.hideTabBar();
},
@@ -221,8 +222,7 @@
goCreateClass(){
console.log('this.addType',this.addType);
if(this.addType != undefined){
this.pupShow = false
this.addType = undefined
this.pupShow = false
setTimeout(()=> {
uni.navigateTo({
url:`/pages/miniClass/addClass?type=${this.addType}`