|
@@ -4,7 +4,11 @@
|
|
<view slot="body">
|
|
<view slot="body">
|
|
<view class="class-info-text">
|
|
<view class="class-info-text">
|
|
<u-icon name="clock"></u-icon>
|
|
<u-icon name="clock"></u-icon>
|
|
- {{classInfo.classStartDate}} {{classInfo.classStartHours}} {{classInfo.residue}}课时
|
|
|
|
|
|
+ {{classInfo.classStartDate}} {{classInfo.classStartHours}} ~ {{classInfo.classEndDate}} {{classInfo.classEndHours}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="class-info-text" v-for="(item, index) in classInfo.classExtrasList">
|
|
|
|
+ <u-icon name="calendar" style="visibility: hidden;"></u-icon>
|
|
|
|
+ <text>{{item.week}} {{item.startTime}}-{{item.endTime}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="class-info-text">
|
|
<view class="class-info-text">
|
|
<u-icon name="map"></u-icon>
|
|
<u-icon name="map"></u-icon>
|
|
@@ -23,11 +27,21 @@
|
|
</u-grid-item>
|
|
</u-grid-item>
|
|
</u-grid>
|
|
</u-grid>
|
|
</u-card>
|
|
</u-card>
|
|
- <u-card title="班级近况" :show-foot="false" title-size="32" margin="0px" :head-style="cardStyle">
|
|
|
|
|
|
+ <u-card title="班级近况" :sub-title="imgEdit ? '完成' : '管理'" :sub-title-color="imgEdit ? '#19be6b' : '#909399'" :show-foot="false"
|
|
|
|
+ title-size="32" margin="0px" :head-style="cardStyle" @sub-click="imgEdit = !imgEdit">
|
|
<view class="class-show-box" slot="body">
|
|
<view class="class-show-box" slot="body">
|
|
- <view v-for="(item, index) in classInfo.showList" :key="index" class="class-show-card">
|
|
|
|
|
|
+ <view v-for="(item, index) in classShowList" :key="index" class="class-show-card">
|
|
<u-image :src="item.url" mode="aspectFill" height="30vw" border-radius="10px"></u-image>
|
|
<u-image :src="item.url" mode="aspectFill" height="30vw" border-radius="10px"></u-image>
|
|
<view class="class-show-name">{{item.name}}</view>
|
|
<view class="class-show-name">{{item.name}}</view>
|
|
|
|
+ <u-icon name="close-circle-fill" color="#fa3534" size="48" v-if="imgEdit" class="delete-icon" @click="deleteClassShow(item)"></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="class-show-card" style="width: calc(100% - 16px)" v-if="imgEdit">
|
|
|
|
+ <u-upload :action="uploadUrl" :header="uploadHeader" :show-upload-list="false" :custom-btn="true" @on-success="uploadSuccess"
|
|
|
|
+ @on-error="uploadError">
|
|
|
|
+ <view slot="addBtn" style="width: calc(100vw - 32px);text-align: center;">
|
|
|
|
+ <u-icon name="plus-circle-fill" size="100" :color="mainColor"></u-icon>
|
|
|
|
+ </view>
|
|
|
|
+ </u-upload>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</u-card>
|
|
</u-card>
|
|
@@ -53,16 +67,25 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ uploadUrl: API.uploadFile,
|
|
|
|
+ uploadHeader: {
|
|
|
|
+ Authorization: uni.getStorageSync('token')
|
|
|
|
+ },
|
|
classId: '',
|
|
classId: '',
|
|
classInfo: {
|
|
classInfo: {
|
|
name: '',
|
|
name: '',
|
|
classStartDate: '',
|
|
classStartDate: '',
|
|
classStartHours: '',
|
|
classStartHours: '',
|
|
|
|
+ classEndDate: '',
|
|
|
|
+ classEndHours: '',
|
|
residue: '',
|
|
residue: '',
|
|
address: '',
|
|
address: '',
|
|
|
|
+ classExtrasList: [],
|
|
studentSignList: [],
|
|
studentSignList: [],
|
|
showList: [],
|
|
showList: [],
|
|
},
|
|
},
|
|
|
|
+ classShowList: [],
|
|
|
|
+ imgEdit: false,
|
|
cardStyle: {
|
|
cardStyle: {
|
|
fontWeight: 'bold'
|
|
fontWeight: 'bold'
|
|
},
|
|
},
|
|
@@ -74,10 +97,12 @@
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
this.classId = options.id
|
|
this.classId = options.id
|
|
this.initialize()
|
|
this.initialize()
|
|
|
|
+ this.getClassShow()
|
|
},
|
|
},
|
|
onReady() {},
|
|
onReady() {},
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
this.initialize()
|
|
this.initialize()
|
|
|
|
+ this.getClassShow()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 获取初始化数据
|
|
// 获取初始化数据
|
|
@@ -94,6 +119,68 @@
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 文件上传成功回调
|
|
|
|
+ getClassShow() {
|
|
|
|
+ NET.request(API.getClassDetailShowList, {
|
|
|
|
+ id: this.classId,
|
|
|
|
+ page: 0,
|
|
|
|
+ size: 1000
|
|
|
|
+ }, 'POST').then(res => {
|
|
|
|
+ this.classShowList = res.data.row
|
|
|
|
+ this.$refs.uTips.show({
|
|
|
|
+ title: '班级近况发布成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.$refs.uTips.show({
|
|
|
|
+ title: error.message,
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 文件上传成功回调
|
|
|
|
+ uploadSuccess(res, index, lists, name) {
|
|
|
|
+ NET.request(API.insertClassShow, {
|
|
|
|
+ fileId: [res.data.id],
|
|
|
|
+ id: this.classId,
|
|
|
|
+ }, 'POST').then(res => {
|
|
|
|
+ this.getClassShow()
|
|
|
|
+ this.$refs.uTips.show({
|
|
|
|
+ title: '班级近况发布成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.$refs.uTips.show({
|
|
|
|
+ title: error.message,
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ return true
|
|
|
|
+ },
|
|
|
|
+ // 文件上传失败回调
|
|
|
|
+ uploadError(res, index, lists, name) {
|
|
|
|
+ this.$refs.uTips.show({
|
|
|
|
+ title: error.message,
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 删除班级近况
|
|
|
|
+ deleteClassShow(site) {
|
|
|
|
+ NET.request(API.deleteClassShow, {
|
|
|
|
+ id: site.id,
|
|
|
|
+ }, 'POST').then(res => {
|
|
|
|
+ this.getClassShow()
|
|
|
|
+ this.$refs.uTips.show({
|
|
|
|
+ title: '删除成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ this.$refs.uTips.show({
|
|
|
|
+ title: error.message,
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 跳转学生详情
|
|
// 跳转学生详情
|
|
goToStudentInfo(item) {
|
|
goToStudentInfo(item) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -159,8 +246,6 @@
|
|
.class-student-box {
|
|
.class-student-box {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-around;
|
|
justify-content: space-around;
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
.class-show-box {
|
|
.class-show-box {
|
|
@@ -171,6 +256,7 @@
|
|
width: calc(50% - 16px);
|
|
width: calc(50% - 16px);
|
|
margin: 0 8px 16px 8px;
|
|
margin: 0 8px 16px 8px;
|
|
float: left;
|
|
float: left;
|
|
|
|
+ position: relative;
|
|
|
|
|
|
.class-show-name {
|
|
.class-show-name {
|
|
width: 100%;
|
|
width: 100%;
|
|
@@ -179,6 +265,12 @@
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
margin-top: 5px;
|
|
margin-top: 5px;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .delete-icon {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: -5px;
|
|
|
|
+ top: -5px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|