This commit is contained in:
@fawn-nine
2024-08-26 17:35:18 +08:00
parent 57d5beaa72
commit 4792202081
21 changed files with 726 additions and 693 deletions

View File

@@ -131,8 +131,8 @@ import $http from '@/config/requestConfig.js';
//第一次加载
onLoad(e) {
console.log('收到的值', e);
if(e.sort){
this.form.sort = e.sort+''
if(e.sort != 'undefined'){
this.form.sort = e.sort
}
this.pageType = e.type
this.form.classId = e.classId
@@ -265,7 +265,7 @@ import $http from '@/config/requestConfig.js';
this.fileList1.splice(event.index, 1)
},
onSubmit() {
this.$refs.form.validate().then(res => {
this.$refs.form.validate().then(res => {
if (this.fileList1.length > 0) {
let _list = this.fileList1
_list = _list.map(item => item.url)
@@ -274,20 +274,19 @@ import $http from '@/config/requestConfig.js';
}else{
this.form.img = ''
}
var newSort = undefined
console.log('this.sort',this.form.sort);
if(this.form.sort != undefined) {
console.log('this.sort',this.form.sort);
var oldsort = this.form.sort.split('')
if(oldsort[oldsort.length-1] == '9'){
oldsort.push('0')
}else{
console.log('符合');
oldsort[oldsort.length-1] = ( parseInt(oldsort[oldsort.length-1]) + 1) + ''
}
newSort = oldsort.join('')
}
// console.log('this.sort',newSort);
// var newSort = undefined
// if(this.form.sort) {
// console.log('this.sort',this.form.sort);
// // var oldsort = this.form.sort.split('')
// if(oldsort[oldsort.length-1] == '9'){
// oldsort.push('0')
// }else{
// console.log('符合');
// oldsort[oldsort.length-1] = ( parseInt(oldsort[oldsort.length-1]) + 1) + ''
// }
// newSort = oldsort.join('')
// }
console.log('this.form',this.form);
var _url = ""
this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask"
$http.request({
@@ -301,7 +300,7 @@ import $http from '@/config/requestConfig.js';
"title": this.form.title,
"content": this.form.content,
"img": this.form.img,
"sort": newSort
"sort": this.form.sort ? parseInt(this.form.sort)+1 : undefined
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -373,7 +372,7 @@ import $http from '@/config/requestConfig.js';
// overflow: hidden;
// height: 100rpx;
padding-top: 10rpx;
margin-bottom: 20rpx;
// border-bottom: 1rpx solid #eeeeee;
align-items: center;