|
@@ -1,33 +1,58 @@
|
|
|
import OUpload from '@/components/o-upload'
|
|
|
+import request from '@/helpers/request'
|
|
|
import { Button, Field } from 'vant'
|
|
|
-import { defineComponent } from 'vue'
|
|
|
+import { defineComponent, reactive } from 'vue'
|
|
|
import styles from './add-information.module.less'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'add-information',
|
|
|
emits: ['close'],
|
|
|
setup(props, { slots, attrs, emit }) {
|
|
|
+ const forms = reactive({
|
|
|
+ type: 'HOT_CONSULTATION',
|
|
|
+ clientType: 'SCHOOL',
|
|
|
+ coverImage: null,
|
|
|
+ title: null,
|
|
|
+ linkUrl: null,
|
|
|
+ memo: null
|
|
|
+ })
|
|
|
+ const onSubmit = async () => {
|
|
|
+ try {
|
|
|
+ await request.post('/api-school/sysNewsInformation/save', {
|
|
|
+ data: {}
|
|
|
+ })
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return () => (
|
|
|
<div class={styles.addInformation}>
|
|
|
<div class={styles.title}>
|
|
|
<i class={[styles.icon, styles.icon1]}></i>请上传封面图片
|
|
|
</div>
|
|
|
- <OUpload style={{ margin: 0, background: '#fff' }} />
|
|
|
+ <OUpload class={styles.upload} v-model:modelValue={forms.coverImage} />
|
|
|
|
|
|
<div class={styles.title}>
|
|
|
<i class={[styles.icon, styles.icon2]}></i>资讯标题
|
|
|
</div>
|
|
|
- <Field placeholder="请输入资讯标题" />
|
|
|
+ <Field placeholder="请输入资讯标题" class={styles.field} v-model={forms.title} />
|
|
|
|
|
|
<div class={styles.title}>
|
|
|
<i class={[styles.icon, styles.icon3]}></i>内容简介
|
|
|
</div>
|
|
|
- <Field placeholder="请输入资讯内容简要概述" type="textarea" rows={2} />
|
|
|
+ <Field
|
|
|
+ placeholder="请输入资讯内容简要概述"
|
|
|
+ type="textarea"
|
|
|
+ rows={2}
|
|
|
+ class={styles.field}
|
|
|
+ v-model={forms.memo}
|
|
|
+ />
|
|
|
|
|
|
<div class={styles.title}>
|
|
|
<i class={[styles.icon, styles.icon4]}></i>添加链接
|
|
|
</div>
|
|
|
- <Field placeholder="请输入链接" />
|
|
|
+ <Field placeholder="请输入链接" class={styles.field} v-model={forms.linkUrl} />
|
|
|
|
|
|
<div class={'btnGroup'}>
|
|
|
<Button type="primary" size="large" block round>
|