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

@@ -12,8 +12,8 @@
"src" : "图片路径"
}
],
"versionName" : "1.0.13",
"versionCode" : 1013,
"versionName" : "1.0.14",
"versionCode" : 1014,
"app-plus" : {
"nvueCompiler" : "weex",
"compatible" : {

View File

@@ -604,6 +604,27 @@
{
"navigationBarTitleText" : "设置班级管理员"
}
},
{
"path" : "pages/miniClass/addHomeWork",
"style" :
{
"navigationBarTitleText" : "发布作业"
}
},
{
"path" : "pages/miniClass/classCaskList",
"style" :
{
"navigationBarTitleText" : "班级任务列表/心得列表"
}
},
{
"path" : "pages/miniClass/giveScore",
"style" :
{
"navigationBarTitleText" : "评分"
}
}
],
"globalStyle": {

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}`

BIN
static/icon/biaoxianfen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
static/icon/pigai1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/icon/pigai2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
static/icon/pigai3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,23 @@
## 1.2.52023-03-29
- 新增 pattern.icon 属性,可自定义图标
## 1.2.42022-09-07
小程序端由于 style 使用了对象导致报错,[详情](https://ask.dcloud.net.cn/question/152790?item_id=211778&rf=false)
## 1.2.32022-09-05
- 修复 nvue 环境下,具有 tabBar 时fab 组件下部位置无法正常获取 --window-bottom 的bug详见[https://ask.dcloud.net.cn/question/110638?notification_id=826310](https://ask.dcloud.net.cn/question/110638?notification_id=826310)
## 1.2.22021-12-29
- 更新 组件依赖
## 1.2.12021-11-19
- 修复 阴影颜色不正确的bug
## 1.2.02021-11-19
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-fab](https://uniapp.dcloud.io/component/uniui/uni-fab)
## 1.1.12021-11-09
- 新增 提供组件设计资源,组件样式调整
## 1.1.02021-07-30
- 组件兼容 vue3如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.0.72021-05-12
- 新增 组件示例地址
## 1.0.62021-02-05
- 调整为uni_modules目录规范
- 优化 按钮背景色调整
- 优化 兼容pc端

View File

@@ -0,0 +1,491 @@
<template>
<view class="uni-cursor-point">
<view v-if="popMenu && (leftBottom||rightBottom||leftTop||rightTop) && content.length > 0" :class="{
'uni-fab--leftBottom': leftBottom,
'uni-fab--rightBottom': rightBottom,
'uni-fab--leftTop': leftTop,
'uni-fab--rightTop': rightTop
}" class="uni-fab"
:style="nvueBottom"
>
<view :class="{
'uni-fab__content--left': horizontal === 'left',
'uni-fab__content--right': horizontal === 'right',
'uni-fab__content--flexDirection': direction === 'vertical',
'uni-fab__content--flexDirectionStart': flexDirectionStart,
'uni-fab__content--flexDirectionEnd': flexDirectionEnd,
'uni-fab__content--other-platform': !isAndroidNvue
}" :style="{ width: boxWidth, height: boxHeight, backgroundColor: styles.backgroundColor }"
class="uni-fab__content" elevation="5">
<view v-if="flexDirectionStart || horizontalLeft" class="uni-fab__item uni-fab__item--first" />
<view v-for="(item, index) in content" :key="index" :class="{ 'uni-fab__item--active': isShow }"
class="uni-fab__item" @click="_onItemClick(index, item)">
<image :src="item.active ? item.selectedIconPath : item.iconPath" class="uni-fab__item-image"
mode="aspectFit" />
<text class="uni-fab__item-text"
:style="{ color: item.active ? styles.selectedColor : styles.color }">{{ item.text }}</text>
</view>
<view v-if="flexDirectionEnd || horizontalRight" class="uni-fab__item uni-fab__item--first" />
</view>
</view>
<view :class="{
'uni-fab__circle--leftBottom': leftBottom,
'uni-fab__circle--rightBottom': rightBottom,
'uni-fab__circle--leftTop': leftTop,
'uni-fab__circle--rightTop': rightTop,
'uni-fab__content--other-platform': !isAndroidNvue
}" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor, 'bottom': nvueBottom }" @click="_onClick">
<uni-icons class="fab-circle-icon" :type="styles.icon" :color="styles.iconColor" size="32"
:class="{'uni-fab__plus--active': isShow && content.length > 0}"></uni-icons>
<!-- <view class="fab-circle-v" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view>
<view class="fab-circle-h" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view> -->
</view>
</view>
</template>
<script>
let platform = 'other'
// #ifdef APP-NVUE
platform = uni.getSystemInfoSync().platform
// #endif
/**
* Fab 悬浮按钮
* @description 点击可展开一个图形按钮菜单
* @tutorial https://ext.dcloud.net.cn/plugin?id=144
* @property {Object} pattern 可选样式配置项
* @property {Object} horizontal = [left | right] 水平对齐方式
* @value left 左对齐
* @value right 右对齐
* @property {Object} vertical = [bottom | top] 垂直对齐方式
* @value bottom 下对齐
* @value top 上对齐
* @property {Object} direction = [horizontal | vertical] 展开菜单显示方式
* @value horizontal 水平显示
* @value vertical 垂直显示
* @property {Array} content 展开菜单内容配置项
* @property {Boolean} popMenu 是否使用弹出菜单
* @event {Function} trigger 展开菜单点击事件,返回点击信息
* @event {Function} fabClick 悬浮按钮点击事件
*/
export default {
name: 'UniFab',
emits: ['fabClick', 'trigger'],
props: {
pattern: {
type: Object,
default () {
return {}
}
},
horizontal: {
type: String,
default: 'left'
},
vertical: {
type: String,
default: 'bottom'
},
direction: {
type: String,
default: 'horizontal'
},
content: {
type: Array,
default () {
return []
}
},
show: {
type: Boolean,
default: false
},
popMenu: {
type: Boolean,
default: true
}
},
data() {
return {
fabShow: false,
isShow: false,
isAndroidNvue: platform === 'android',
styles: {
color: '#3c3e49',
selectedColor: '#007AFF',
backgroundColor: '#fff',
buttonColor: '#007AFF',
iconColor: '#fff',
icon: 'plusempty'
}
}
},
computed: {
contentWidth(e) {
return (this.content.length + 1) * 55 + 15 + 'px'
},
contentWidthMin() {
return '55px'
},
// 动态计算宽度
boxWidth() {
return this.getPosition(3, 'horizontal')
},
// 动态计算高度
boxHeight() {
return this.getPosition(3, 'vertical')
},
// 计算左下位置
leftBottom() {
return this.getPosition(0, 'left', 'bottom')
},
// 计算右下位置
rightBottom() {
return this.getPosition(0, 'right', 'bottom')
},
// 计算左上位置
leftTop() {
return this.getPosition(0, 'left', 'top')
},
rightTop() {
return this.getPosition(0, 'right', 'top')
},
flexDirectionStart() {
return this.getPosition(1, 'vertical', 'top')
},
flexDirectionEnd() {
return this.getPosition(1, 'vertical', 'bottom')
},
horizontalLeft() {
return this.getPosition(2, 'horizontal', 'left')
},
horizontalRight() {
return this.getPosition(2, 'horizontal', 'right')
},
// 计算 nvue bottom
nvueBottom() {
const safeBottom = uni.getSystemInfoSync().windowBottom;
// #ifdef APP-NVUE
return 30 + safeBottom
// #endif
// #ifndef APP-NVUE
return 30
// #endif
}
},
watch: {
pattern: {
handler(val, oldVal) {
this.styles = Object.assign({}, this.styles, val)
},
deep: true
}
},
created() {
this.isShow = this.show
if (this.top === 0) {
this.fabShow = true
}
// 初始化样式
this.styles = Object.assign({}, this.styles, this.pattern)
},
methods: {
_onClick() {
this.$emit('fabClick')
if (!this.popMenu) {
return
}
this.isShow = !this.isShow
},
open() {
this.isShow = true
},
close() {
this.isShow = false
},
/**
* 按钮点击事件
*/
_onItemClick(index, item) {
if (!this.isShow) {
return
}
this.$emit('trigger', {
index,
item
})
},
/**
* 获取 位置信息
*/
getPosition(types, paramA, paramB) {
if (types === 0) {
return this.horizontal === paramA && this.vertical === paramB
} else if (types === 1) {
return this.direction === paramA && this.vertical === paramB
} else if (types === 2) {
return this.direction === paramA && this.horizontal === paramB
} else {
return this.isShow && this.direction === paramA ? this.contentWidth : this.contentWidthMin
}
}
}
}
</script>
<style lang="scss" >
$uni-shadow-base:0 1px 5px 2px rgba($color: #000000, $alpha: 0.3) !default;
.uni-fab {
position: fixed;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
z-index: 10;
border-radius: 45px;
box-shadow: $uni-shadow-base;
}
.uni-cursor-point {
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-fab--active {
opacity: 1;
}
.uni-fab--leftBottom {
left: 15px;
bottom: 30px;
/* #ifdef H5 */
left: calc(15px + var(--window-left));
bottom: calc(30px + var(--window-bottom));
/* #endif */
// padding: 10px;
}
.uni-fab--leftTop {
left: 15px;
top: 30px;
/* #ifdef H5 */
left: calc(15px + var(--window-left));
top: calc(30px + var(--window-top));
/* #endif */
// padding: 10px;
}
.uni-fab--rightBottom {
right: 15px;
bottom: 30px;
/* #ifdef H5 */
right: calc(15px + var(--window-right));
bottom: calc(30px + var(--window-bottom));
/* #endif */
// padding: 10px;
}
.uni-fab--rightTop {
right: 15px;
top: 30px;
/* #ifdef H5 */
right: calc(15px + var(--window-right));
top: calc(30px + var(--window-top));
/* #endif */
// padding: 10px;
}
.uni-fab__circle {
position: fixed;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
width: 55px;
height: 55px;
background-color: #3c3e49;
border-radius: 45px;
z-index: 11;
// box-shadow: $uni-shadow-base;
}
.uni-fab__circle--leftBottom {
left: 15px;
bottom: 30px;
/* #ifdef H5 */
left: calc(15px + var(--window-left));
bottom: calc(30px + var(--window-bottom));
/* #endif */
}
.uni-fab__circle--leftTop {
left: 15px;
top: 30px;
/* #ifdef H5 */
left: calc(15px + var(--window-left));
top: calc(30px + var(--window-top));
/* #endif */
}
.uni-fab__circle--rightBottom {
right: 15px;
bottom: 30px;
/* #ifdef H5 */
right: calc(15px + var(--window-right));
bottom: calc(30px + var(--window-bottom));
/* #endif */
}
.uni-fab__circle--rightTop {
right: 15px;
top: 30px;
/* #ifdef H5 */
right: calc(15px + var(--window-right));
top: calc(30px + var(--window-top));
/* #endif */
}
.uni-fab__circle--left {
left: 0;
}
.uni-fab__circle--right {
right: 0;
}
.uni-fab__circle--top {
top: 0;
}
.uni-fab__circle--bottom {
bottom: 0;
}
.uni-fab__plus {
font-weight: bold;
}
// .fab-circle-v {
// position: absolute;
// width: 2px;
// height: 24px;
// left: 0;
// top: 0;
// right: 0;
// bottom: 0;
// /* #ifndef APP-NVUE */
// margin: auto;
// /* #endif */
// background-color: white;
// transform: rotate(0deg);
// transition: transform 0.3s;
// }
// .fab-circle-h {
// position: absolute;
// width: 24px;
// height: 2px;
// left: 0;
// top: 0;
// right: 0;
// bottom: 0;
// /* #ifndef APP-NVUE */
// margin: auto;
// /* #endif */
// background-color: white;
// transform: rotate(0deg);
// transition: transform 0.3s;
// }
.fab-circle-icon {
transform: rotate(0deg);
transition: transform 0.3s;
font-weight: 200;
}
.uni-fab__plus--active {
transform: rotate(135deg);
}
.uni-fab__content {
/* #ifndef APP-NVUE */
box-sizing: border-box;
display: flex;
/* #endif */
flex-direction: row;
border-radius: 55px;
overflow: hidden;
transition-property: width, height;
transition-duration: 0.2s;
width: 55px;
border-color: #DDDDDD;
border-width: 1rpx;
border-style: solid;
}
.uni-fab__content--other-platform {
border-width: 0px;
box-shadow: $uni-shadow-base;
}
.uni-fab__content--left {
justify-content: flex-start;
}
.uni-fab__content--right {
justify-content: flex-end;
}
.uni-fab__content--flexDirection {
flex-direction: column;
justify-content: flex-end;
}
.uni-fab__content--flexDirectionStart {
flex-direction: column;
justify-content: flex-start;
}
.uni-fab__content--flexDirectionEnd {
flex-direction: column;
justify-content: flex-end;
}
.uni-fab__item {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
width: 55px;
height: 55px;
opacity: 0;
transition: opacity 0.2s;
}
.uni-fab__item--active {
opacity: 1;
}
.uni-fab__item-image {
width: 20px;
height: 20px;
margin-bottom: 4px;
}
.uni-fab__item-text {
color: #FFFFFF;
font-size: 12px;
line-height: 12px;
margin-top: 2px;
}
.uni-fab__item--first {
width: 55px;
}
</style>

View File

@@ -0,0 +1,84 @@
{
"id": "uni-fab",
"displayName": "uni-fab 悬浮按钮",
"version": "1.2.5",
"description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。",
"keywords": [
"uni-ui",
"uniui",
"按钮",
"悬浮按钮",
"fab"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-scss","uni-icons"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@@ -0,0 +1,9 @@
## Fab 悬浮按钮
> **组件名uni-fab**
> 代码块: `uFab`
点击可展开一个图形按钮菜单
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-fab)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839

View File

@@ -1,3 +1,5 @@
## 2.0.102024-06-07
- 优化 uni-app x 中size 属性的类型
## 2.0.92024-01-12
fix: 修复图标大小默认值错误的问题
## 2.0.82023-12-14

View File

@@ -1,91 +1,91 @@
<template>
<text class="uni-icons" :style="styleObj">
<slot>{{unicode}}</slot>
</text>
<text class="uni-icons" :style="styleObj">
<slot>{{unicode}}</slot>
</text>
</template>
<script>
import { fontData, IconsDataItem } from './uniicons_file'
import { fontData, IconsDataItem } from './uniicons_file'
/**
* Icons 图标
* @description 用于展示 icon 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: "uni-icons",
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: Object,
default: 16
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {};
},
computed: {
unicode() : string {
let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
if (codes !== null) {
return codes.unicode
}
return ''
},
iconSize() : string {
const size = this.size
if (typeof size == 'string') {
const reg = /^[0-9]*$/g
return reg.test(size as string) ? '' + size + 'px' : '' + size;
// return '' + this.size
}
return this.getFontSize(size as number)
},
styleObj() : UTSJSONObject {
if (this.fontFamily !== '') {
return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
}
return { color: this.color, fontSize: this.iconSize }
}
},
created() { },
methods: {
/**
* 字体大小
*/
getFontSize(size : number) : string {
return size + 'px';
},
},
}
/**
* Icons 图标
* @description 用于展示 icon 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number,String} size 图标大小
* @property {String} type 图标图案,参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: "uni-icons",
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
fontFamily: {
type: String,
default: ''
}
},
data() {
return {};
},
computed: {
unicode() : string {
let codes = fontData.find((item : IconsDataItem) : boolean => { return item.font_class == this.type })
if (codes !== null) {
return codes.unicode
}
return ''
},
iconSize() : string {
const size = this.size
if (typeof size == 'string') {
const reg = /^[0-9]*$/g
return reg.test(size as string) ? '' + size + 'px' : '' + size;
// return '' + this.size
}
return this.getFontSize(size as number)
},
styleObj() : UTSJSONObject {
if (this.fontFamily !== '') {
return { color: this.color, fontSize: this.iconSize, fontFamily: this.fontFamily }
}
return { color: this.color, fontSize: this.iconSize }
}
},
created() { },
methods: {
/**
* 字体大小
*/
getFontSize(size : number) : string {
return size + 'px';
},
},
}
</script>
<style scoped>
@font-face {
font-family: UniIconsFontFamily;
src: url('./uniicons.ttf');
}
@font-face {
font-family: UniIconsFontFamily;
src: url('./uniicons.ttf');
}
.uni-icons {
font-family: UniIconsFontFamily;
font-size: 18px;
font-style: normal;
color: #333;
}
.uni-icons {
font-family: UniIconsFontFamily;
font-size: 18px;
font-style: normal;
color: #333;
}
</style>

View File

@@ -1,7 +1,7 @@
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "2.0.9",
"version": "2.0.10",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
@@ -42,7 +42,8 @@
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {