暂存
This commit is contained in:
@@ -47,9 +47,9 @@
|
||||
<view class="in">
|
||||
<view class="uni-textarea">
|
||||
<textarea v-show="false" placeholder-style="font-size:26rpx" v-model="form.content"
|
||||
maxlength="600" auto-height placeholder="请输入内容" />
|
||||
auto-height placeholder="请输入内容" />
|
||||
<view class="editor-wrapper">
|
||||
<editor id="editor" class="ql-container" placeholder="请输入内容..." show-img-size
|
||||
<editor @input="editorIput" id="editor" class="ql-container" placeholder="请输入内容..." show-img-size
|
||||
show-img-toolbar show-img-resize @statuschange="onStatusChange"
|
||||
:read-only="readOnly" @ready="onEditorReady">
|
||||
</editor>
|
||||
@@ -80,6 +80,7 @@
|
||||
} from 'qs';
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import permission from "@/js_sdk/wa-permission/permission.js"
|
||||
import debounce from "@/common/debounce.js";
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
@@ -146,6 +147,9 @@
|
||||
pageName: ''
|
||||
};
|
||||
},
|
||||
onPullDownRefresh(){
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
console.log('收到的值', e);
|
||||
@@ -177,7 +181,7 @@
|
||||
} else if (e.type == 1) {
|
||||
this.pageType = '医案'
|
||||
} else if (e.type == 2) {
|
||||
this.pageType = '心得222'
|
||||
this.pageType = '心得'
|
||||
} else {
|
||||
this.pageType = '作业'
|
||||
}
|
||||
@@ -196,6 +200,9 @@
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
editorIput(e){
|
||||
|
||||
},
|
||||
readOnlyChange() {
|
||||
this.readOnly = !this.readOnly
|
||||
},
|
||||
@@ -325,18 +332,13 @@
|
||||
});
|
||||
},
|
||||
async onSubmit() {
|
||||
// debounce(async () => {
|
||||
let that = this
|
||||
if (this.flag) {
|
||||
console.log('拦截了吗');
|
||||
if (this.flag) {
|
||||
return
|
||||
} else {
|
||||
this.flag = true
|
||||
console.log('没拦截?', this.flag);
|
||||
}
|
||||
|
||||
// this.flag = true
|
||||
let data = await this.getHtml();
|
||||
var _data = data.html.replace(/<.*?>/g, "")
|
||||
}
|
||||
let data = await this.getHtml();
|
||||
var _data = data.html.replace(/<.*?>/g, "")
|
||||
if (!_data || _data == '') {
|
||||
uni.showToast({
|
||||
title: '请输入主要内容',
|
||||
@@ -367,12 +369,13 @@
|
||||
this.form.img = ''
|
||||
}
|
||||
console.log('this.form', this.form);
|
||||
this.flag = true
|
||||
uni.showLoading({
|
||||
title:'请稍后'
|
||||
})
|
||||
var _url = ""
|
||||
this.form.id ? _url = "common/class/editClassTask" : _url = "common/class/addClassTask"
|
||||
$http.request({
|
||||
url: _url,
|
||||
method: "POST",
|
||||
data: {
|
||||
var data = {
|
||||
"id": this.form.id,
|
||||
"classId": this.form.id ? undefined : this.form.classId,
|
||||
"type": this.form.type, //类型 0班内任务1医案2心得
|
||||
@@ -382,13 +385,19 @@
|
||||
"img": this.form.img,
|
||||
"sort": this.form.sort && !this.form.id ? parseInt(this.form.sort) +
|
||||
1 : undefined
|
||||
},
|
||||
}
|
||||
console.log('提交的数据',data);
|
||||
$http.request({
|
||||
url: _url,
|
||||
method: "POST",
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
// this.flag = false
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '操作成功!',
|
||||
icon: 'success'
|
||||
@@ -401,6 +410,7 @@
|
||||
})
|
||||
}, 1000)
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
this.flag = false
|
||||
// console.log('表单错误信息:', err);
|
||||
uni.showToast({
|
||||
@@ -416,7 +426,9 @@
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
}
|
||||
// },300)
|
||||
},
|
||||
|
||||
},
|
||||
//页面隐藏
|
||||
onHide() {},
|
||||
@@ -434,7 +446,7 @@
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.ql-container{height: auto;}
|
||||
::v-deep .uni-forms-item {
|
||||
margin-bottom: 26rpx !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user