页面渲染 添加

This commit is contained in:
taoxu 2023-12-07 15:09:29 +08:00
parent 6e590cd865
commit 8b38b01d19
5 changed files with 583 additions and 50 deletions

View File

@ -42,7 +42,7 @@ const install = (Vue, vm) => {
// 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值 // 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
// const token = uni.getStorageSync('token'); // const token = uni.getStorageSync('token');
const token = " Bearer 8dc2aff0225547d7b9698f8e126a8b10" const token = " Bearer d61c0fee9e404290b8e4ad7bd0167656"
// console.log("我是token", token) // console.log("我是token", token)
config.header.Authorization = token; config.header.Authorization = token;

View File

@ -54,7 +54,7 @@ export default {
}, },
methods: { methods: {
getclassteacher(){ getclassteacher(){
this.$u.get(`https://api.admin-v2.langsi.online/admin-api/classroom/teacher/list?id=${this.classid}`).then(res => { this.$u.get(`https://api.admin-v2.langsi.online/admin-api/classroom/teacher/list?classId=${this.classid}`).then(res => {
if (res.code == 0) { if (res.code == 0) {

207
pages/Mystudent/addstu.vue Normal file
View File

@ -0,0 +1,207 @@
<template>
<view class="searchpage">
<u-navbar title="搜索" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
height='36'></u-navbar>
<view class="serchbox">
<view class="serchimg">
<image src="https://file.langsi.online/yasiimg/web/static/uVMACkynkipOxuTYDqm0">
</image>
</view>
<input type="text" placeholder="搜索相关内容..." class="input" placeholder-style="color:#C7CDD3 ">
</view>
<view class="check_card">
<view class="check_card_stu" v-for="(item,index ) in stulist" :key="index">
<view class="check_card_stu_info_left">
<view class="class_card_left">
<image src=" https://file.langsi.online/yasiimg/web/static/udWNTRG6GulmTtgPRQ49"></image>
</view>
<view class="class_card_right">
<view class="class_card_right_top">
李斯丹妮
</view>
<view class="class_card_right_bot">
ID3324
</view>
</view>
</view>
</view>
</view>
<view class="zhanwei" style="width: 100%; height: 50rpx;">
</view>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: "#transparent",
},
checkindex: 1,
stulist:[]
}
},
onLoad(option) {
// this.classid=option.id
this.classid=15
this.getallstu()
},
methods: {
getallstu(){
this.$u.get(`https://api.admin-v2.langsi.online/admin-api/v2/ybs-user/page`).then(res => {
if (res.code == 0) {
this.stulist=res.data.list
// this.classlist = res.data.list
// this.isloding = false
}
})
}
}
}
</script>
<style lang="scss">
page {
background: linear-gradient(183deg, #F0F6FF 0%, #FAFAFA 100%);
}
.searchpage {
width: 750rpx;
padding: 0 32rpx;
.serchbox {
padding: 0 32rpx;
display: flex;
flex-wrap: nowrap;
margin-top: 30rpx;
align-items: center;
width: 686rpx;
height: 88rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
.serchimg {
width: 30.51rpx;
height: 32rpx;
margin-right: 24rpx;
}
.input {
margin: 0 auto;
width: 568rpx;
height: 88rpx;
border-radius: 30rpx;
// background-color: #f5f8fc;
// display: flex;
// justify-content: center;
// align-items: center;
// text-align: center;
font-size: 28rpx;
font-family: Source Han Sans CN, Source Han Sans CN-Light;
font-weight: 300;
text-align: left;
color: #a7b9cd;
letter-spacing: 1.2rpx;
line-height: 36rpx;
// padding: 0 100rpx;
// padding-right: 135rpx;
box-sizing: border-box;
}
}
.check_card {
margin-top: 20rpx;
.check_card_stu {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
padding: 32rpx;
width: 686rpx;
height: 148rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
border: 2rpx solid #FFFFFF;
margin-bottom: 20rpx;
.check_card_stu_info_left {
display: flex;
flex-wrap: nowrap;
.class_card_left {
width: 76rpx;
height: 76rpx;
}
.class_card_right {
margin-left: 12rpx;
display: flex;
flex-wrap: wrap;
.class_card_right_top {
width: 100%;
font-size: 28rpx;
font-family: 'PingFang', 'PingFang';
font-weight: bold;
color: #072F5A;
}
.class_card_right_bot {
margin-top: 4rpx;
font-size: 20rpx;
font-family: 'PingFang', 'PingFang';
font-weight: 500;
color: rgba(7, 47, 90, 0.6);
}
}
}
.check_card_stu_info_right {
width: 50%;
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
.class_info {
width: 110rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
.class_info_top {
font-size: 20rpx;
font-family: 'PingFang', 'PingFang';
font-weight: 500;
color: rgba(7, 47, 90, 0.5);
}
.class_info_bot {
margin-top: 12rpx;
font-size: 28rpx;
font-family: 'PingFang', 'PingFang';
font-weight: 800;
color: #2D7CE6;
}
}
}
}
.act1 {
border: 2rpx solid #2D7CE6;
}
}
}
</style>

371
pages/Mystudent/formstu.vue Normal file
View File

@ -0,0 +1,371 @@
<template>
<view class="addpage">
<u-navbar :title="title"
:border-bottom="false"
:background="bgc"
title-color='#2E4975'
title-size='36'
height='36'></u-navbar>
<view class="topbox">
<view class="search_box">
<!-- <view class="check_search">
{{ checkindex == "0" ? "班级" : '学生' }}
<view class="iconfont icon-arow_down"></view>
</view> -->
<view class="serchbox">
<view class="serchimg">
<image src="https://file.langsi.online/yasiimg/web/static/uVMACkynkipOxuTYDqm0"
mode="scaleToFill">
</image>
</view>
<input type="text"
placeholder="搜索相关内容..."
class="input"
placeholder-style="color:#C7CDD3 ">
</view>
</view>
<view class="addclass" @click="addstu()">
+ 添加学生
</view>
</view>
<view class="check_card" v-show="checkindex==1">
<view class="check_card_stu">
<view class="check_card_stu_info_left">
<view class="class_card_left">
<image src=" https://file.langsi.online/yasiimg/web/static/udWNTRG6GulmTtgPRQ49"></image>
</view>
<view class="class_card_right">
<view class="class_card_right_top">
李斯丹妮
</view>
<view class="class_card_right_bot">
ID3324
</view>
</view>
</view>
<view class="check_card_stu_info_right">
<view class="class_info" >
<view class="class_info_top" >
平均成绩/
</view>
<view class="class_info_bot" >
6
</view>
</view>
<view class="class_info" >
<view class="class_info_top" >
作业完成度
</view>
<view class="class_info_bot" >
80%
</view>
</view>
</view>
</view>
<view class="check_card_stu ">
<view class="check_card_stu_info_left">
<view class="class_card_left">
<image src=" https://file.langsi.online/yasiimg/web/static/udWNTRG6GulmTtgPRQ49"></image>
</view>
<view class="class_card_right">
<view class="class_card_right_top">
李斯丹妮
</view>
<view class="class_card_right_bot">
ID3324
</view>
</view>
</view>
<view class="check_card_stu_info_right">
<view class="class_info" >
<view class="class_info_top" >
平均成绩/
</view>
<view class="class_info_bot" >
6
</view>
</view>
<view class="class_info" >
<view class="class_info_top" >
作业完成度
</view>
<view class="class_info_bot" >
80%
</view>
</view>
</view>
</view>
</view>
<!-- <view class="botbtn">
<view class="btn">
确定添加1
</view>
</view> -->
</view>
</template>
<script>
export default {
data() {
return {
title: '班级成员',
bgc: {
backgroundColor: "#F6F9FC",
},
checkindex: 1,
}
},
onLoad(option) {
// this.classid=option.id
this.classid=15
this.getclassteacher()
},
methods: {
getclassteacher(){
this.$u.get(`https://api.admin-v2.langsi.online/admin-api/classroom/members/list?classId=${this.classid}`).then(res => {
if (res.code == 0) {
this.teacherlist=res.data.list
// this.classlist = res.data.list
// this.isloding = false
}
})
},
addstu(){
uni.navigateTo({
url: "/pages/Mystudent/addstu?id=" + this.classid
}).then(res => {
}).catch(err => {
});
}
}
}
</script>
<style lang="scss">
page {
background: #F6F9FC;
}
.addpage {
width: 750rpx;
padding: 0 32rpx;
flex-wrap: wrap;
// display: flex;
// flex-wrap: wrap;
.topbox{
margin-top: 46rpx;
display: flex;
flex-wrap: nowrap;
justify-content:space-between;
align-items: center;
.search_box {
width: 480rpx;
height: 88rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
display: flex;
flex-wrap: nowrap;
.check_search {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
width: 148rpx;
height: 88rpx;
background: #FFF2E4;
border-radius: 20rpx 0rpx 0rpx 20rpx;
font-size: 28rpx;
font-family:'PingFang','PingFang';
font-weight: 500;
color: #F39852;
.icon-arow_down {
margin-left: 8rpx;
font-size: 20rpx;
}
}
.serchbox {
// padding: 0 32rpx;
display: flex;
flex-wrap: nowrap;
// margin-top: 30rpx;
align-items: center;
// justify-content: space-between;
width: 538rpx;
height: 88rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
.serchimg {
margin-left: 32rpx;
width: 32rpx;
height: 32rpx;
}
.input {
margin-left: 24rpx;
width: 394rpx;
height: 88rpx;
// border-radius: 30rpx;
// background-color: #f5f8fc;
// display: flex;
// justify-content: center;
// align-items: center;
// text-align: center;
font-size: 28rpx;
font-family: Source Han Sans CN, Source Han Sans CN-Light;
font-weight: 300;
text-align: left;
color: #a7b9cd;
letter-spacing: 1.2rpx;
line-height: 36rpx;
// padding: 0 100rpx;
// padding-right: 135rpx;
box-sizing: border-box;
}
}
}
.addclass{
display: flex;
align-items: center;
justify-content: center;
width: 194rpx;
height: 88rpx;
background: #FFF2E4;
border-radius: 20rpx 20rpx 20rpx 20rpx;
font-size: 28rpx;
font-family:'PingFang','PingFang';
font-weight: 500;
color: #F39852;
}
}
.check_card {
margin-top: 20rpx;
.check_card_stu {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
padding: 32rpx;
width: 686rpx;
height: 148rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
border: 2rpx solid #FFFFFF;
margin-bottom: 20rpx;
.check_card_stu_info_left {
display: flex;
flex-wrap: nowrap;
.class_card_left {
width: 76rpx;
height: 76rpx;
}
.class_card_right {
margin-left: 12rpx;
display: flex;
flex-wrap: wrap;
.class_card_right_top {
width: 100%;
font-size: 28rpx;
font-family:'PingFang','PingFang';
font-weight: bold;
color: #072F5A;
}
.class_card_right_bot {
margin-top: 4rpx;
font-size: 20rpx;
font-family:'PingFang','PingFang';
font-weight: 500;
color: rgba(7,47,90,0.6);
}
}
}
.check_card_stu_info_right {
width: 50%;
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
.class_info {
width: 110rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
.class_info_top {
font-size: 20rpx;
font-family:'PingFang','PingFang';
font-weight: 500;
color: rgba(7, 47, 90, 0.5);
}
.class_info_bot {
margin-top: 12rpx;
font-size: 28rpx;
font-family:'PingFang','PingFang';
font-weight: 800;
color: #2D7CE6;
}
}
}
}
.act1{
border: 2rpx solid #2D7CE6;
}
}
.botbtn{
padding: 32rpx 32rpx 0 32rpx;
margin-left: -32rpx;
position: fixed;
bottom: 0;
width: 750rpx;
height: 200rpx;
background: #FFFFFF;
box-shadow: 0rpx -10rpx 16rpx 0rpx rgba(202,202,202,0.25);
border-radius: 40rpx 40rpx 0rpx 0rpx;
.btn{
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-family:'PingFang','PingFang';
font-weight: 800;
color: #FFFFFF;
width: 686rpx;
height: 80rpx;
background: linear-gradient(180deg, #74AFFF 0%, #2D7CE6 100%);
border-radius: 104rpx 104rpx 104rpx 104rpx;
}
}
}</style>

View File

@ -92,52 +92,7 @@
return { return {
isShow: false, isShow: false,
clas:[
{
title:'班级成员',
image:[
{
url:'https://file.langsi.online/yasiimg/web/static/uXJ24nLEqmCb0FkFpmfy',
},
{
url:'https://file.langsi.online/yasiimg/web/static/ufg5N01CbfezyG5wt48Q'
},
{
url:'https://file.langsi.online/yasiimg/web/static/uXJ24nLEqmCb0FkFpmfy'
},
{
url:'https://file.langsi.online/yasiimg/web/static/uy3xEPgyYPnRqPbpamya'
},
{
url:'https://file.langsi.online/yasiimg/web/static/uY8idjLvCQSuYCzvus9A'
},{
url:'https://file.langsi.online/yasiimg/web/static/ucf2g8fGLqNtW7OpGNT6'
},
]
},
{
title:'带班老师',
image:[
{
url:'https://file.langsi.online/yasiimg/web/static/uXJ24nLEqmCb0FkFpmfy',
},
{
url:'https://file.langsi.online/yasiimg/web/static/ufg5N01CbfezyG5wt48Q'
},
{
url:'https://file.langsi.online/yasiimg/web/static/uXJ24nLEqmCb0FkFpmfy'
},
{
url:'https://file.langsi.online/yasiimg/web/static/uy3xEPgyYPnRqPbpamya'
},
{
url:'https://file.langsi.online/yasiimg/web/static/uY8idjLvCQSuYCzvus9A'
},{
url:'https://file.langsi.online/yasiimg/web/static/ucf2g8fGLqNtW7OpGNT6'
},
]
}
],
operation:[ operation:[
{ {
image:'https://file.langsi.online/yasiimg/web/static/ukPnTLkhCKU5zhbM7SMu', image:'https://file.langsi.online/yasiimg/web/static/ukPnTLkhCKU5zhbM7SMu',
@ -188,7 +143,7 @@
}, },
toteacher(){ toteacher(){
uni.redirectTo({ uni.navigateTo({
url: "/pages/Mystudent/Formteacher?id=" + this.classinfo.id url: "/pages/Mystudent/Formteacher?id=" + this.classinfo.id
}).then(res => { }).then(res => {
@ -199,7 +154,7 @@
}, },
tostu(){ tostu(){
uni.redirectTo({ uni.navigateTo({
url: "/pages/Mystudent/formstu?id=" + this.classinfo.id url: "/pages/Mystudent/formstu?id=" + this.classinfo.id
}).then(res => { }).then(res => {