Browse Source

优化更新活动页

master
xuhuajiao 3 weeks ago
parent
commit
6670f205d8
  1. 4
      src/components/wangEditor/index.vue
  2. 20
      src/views/weChatMiniProgram/activity.vue

4
src/components/wangEditor/index.vue

@ -109,8 +109,10 @@ export default {
},
methods: {
handleCreated(editor) {
// editor undefined
if (!editor) return
this.editor = editor
editor.config.height = this.height
// editor.config.height = this.height
},
handleChange(editor) {
this.$emit('change', editor.getHtml())

20
src/views/weChatMiniProgram/activity.vue

@ -95,11 +95,11 @@
</el-form-item>
</el-row>
</div>
<!-- :editor-content="editorContent" -->
<WangEditor
v-model="editorContent"
style="width: 740px;"
:editor-content="editorContent"
:editor-ref="editorRef"
@editor-ref="onEditorRef"
@contentData="contentData"
/>
</div>
@ -276,7 +276,7 @@ export default {
{ key: -1, display_name: '已取消' }
],
imageUrl: require('@/assets/images/system/default-img.jpg'),
editorRef: 'test',
editorRef: null,
editorContent: '',
cancelDialogVisible: false,
cancelForm: {
@ -361,6 +361,9 @@ export default {
}
},
methods: {
onEditorRef(ref) {
this.editorRef = ref
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.params.libcode = this.user.fonds.fondsNo
if (this.blurryTime) {
@ -381,12 +384,16 @@ export default {
},
//
[CRUD.HOOK.beforeToAdd]() {
this.editorContent = ''
// this.editorContent = ''
},
//
[CRUD.HOOK.beforeToEdit](crud, form) {
form.numberLimit = form.activityPeople === 0 ? 1 : 2
this.editorContent = form.activityContent
this.$nextTick(() => {
if (this.editorRef && form.activityContent) {
this.editorContent = form.activityContent
}
})
},
//
[CRUD.HOOK.afterValidateCU](crud) {
@ -425,6 +432,7 @@ export default {
if (!isImage) {
this.$message({ message: '只可上传图片', type: 'error', offset: 8 })
}
const isLt2M = file.size / 1024 / 1024 < 2
if (!isLt2M) {
this.$message({ message: '图片大小不能超过2MB', type: 'error', offset: 8 })
@ -432,7 +440,7 @@ export default {
return isImage && isLt2M
},
contentData(val) {
console.log('contentData', val)
// console.log('contentData', val)
this.editorContent = val
},
getStatusText(status) {

Loading…
Cancel
Save