|
@@ -9,6 +9,13 @@
|
9
|
9
|
float: right;
|
10
|
10
|
}
|
11
|
11
|
}
|
|
12
|
+ .ivu-form .ivu-form-item-label{
|
|
13
|
+ width: 80px;
|
|
14
|
+ font-size: 16px;
|
|
15
|
+ }
|
|
16
|
+ .ivu-form-item-content{
|
|
17
|
+ margin-left: 80px;
|
|
18
|
+ }
|
12
|
19
|
</style>
|
13
|
20
|
|
14
|
21
|
<template>
|
|
@@ -16,14 +23,19 @@
|
16
|
23
|
<Row class="margin-top-10">
|
17
|
24
|
<Col>
|
18
|
25
|
<Card>
|
19
|
|
- <p slot="title">首页底部模块编辑</p>
|
|
26
|
+ <p slot="title">首页服务介绍和底部图片配置</p>
|
20
|
27
|
<div class="edittable-table-height-con">
|
|
28
|
+ <img :src="photo" style="width:100%;max-width:750px;" v-if="photo" class="upload-img">
|
21
|
29
|
<Form>
|
22
|
|
- <Upload :action='$domain + "/upload"'>
|
23
|
|
- <Button icon="ios-cloud-upload-outline">上传显示图片</Button>
|
|
30
|
+ <Upload :headers="uploadHeader" :on-success="handleSuccess" :action='$domain + "/upload"'>
|
|
31
|
+ <Button icon="ios-cloud-upload-outline">上传更新图片</Button>
|
24
|
32
|
</Upload>
|
25
|
|
- <FormItem label="图片点击显示详情">
|
26
|
|
- <editor :editor-content="introduce"></editor>
|
|
33
|
+ <br>
|
|
34
|
+ <FormItem label="图片详情">
|
|
35
|
+ <editor :editor-content="content"></editor>
|
|
36
|
+ </FormItem>
|
|
37
|
+ <FormItem label="服务介绍">
|
|
38
|
+ <Input v-model="introduce" type="textarea" :rows="6" placeholder="请输入服务介绍" />
|
27
|
39
|
</FormItem>
|
28
|
40
|
</Form>
|
29
|
41
|
<div class="submit">
|
|
@@ -40,24 +52,37 @@
|
40
|
52
|
import tinymce from 'tinymce';
|
41
|
53
|
import editor from '../main-components/editor'
|
42
|
54
|
export default {
|
43
|
|
- name: 'introduce',
|
|
55
|
+ name: 'images',
|
44
|
56
|
components: {
|
45
|
57
|
editor
|
46
|
58
|
},
|
47
|
59
|
data() {
|
48
|
60
|
return {
|
|
61
|
+ content: '',
|
|
62
|
+ photo: '',
|
49
|
63
|
introduce: '',
|
50
|
|
- publishLoading: false
|
|
64
|
+ publishLoading: false,
|
|
65
|
+ uploadHeader: {
|
|
66
|
+
|
|
67
|
+ }
|
51
|
68
|
};
|
52
|
69
|
},
|
53
|
70
|
methods: {
|
|
71
|
+ handleSuccess (res, file) {
|
|
72
|
+ if (res.status == 0) {
|
|
73
|
+ this.photo = res.location
|
|
74
|
+ }
|
|
75
|
+ },
|
54
|
76
|
handlePublish() {
|
55
|
|
- let introduce = tinymce.activeEditor.getContent();
|
56
|
|
- console.warn(introduce)
|
57
|
|
- if (introduce) {
|
|
77
|
+ const content = tinymce.activeEditor.getContent();
|
|
78
|
+ const photo = this.photo;
|
|
79
|
+ const introduce = this.introduce;
|
|
80
|
+ if (content && photo) {
|
58
|
81
|
this.publishLoading = true;
|
59
|
|
- this.axios.post("/product/store", {
|
60
|
|
-
|
|
82
|
+ this.axios.post("/bottom/store", {
|
|
83
|
+ content,
|
|
84
|
+ photo,
|
|
85
|
+ introduce
|
61
|
86
|
}).then((res) => {
|
62
|
87
|
if (res.data.status == 0) {
|
63
|
88
|
this.$Message.success('操作成功!');
|
|
@@ -68,20 +93,22 @@
|
68
|
93
|
}
|
69
|
94
|
});
|
70
|
95
|
} else {
|
71
|
|
- this.$Message.warning('内容不能为空!');
|
|
96
|
+ this.$Message.warning('请把内容填写完整!');
|
72
|
97
|
}
|
73
|
98
|
},
|
74
|
99
|
getData() {
|
75
|
|
- this.axios.post("/product/store", {})
|
76
|
|
- .then((res) => {
|
77
|
|
- if (res.data.status == 0) {
|
78
|
|
- this.introduce = res.data.data.introduce;
|
79
|
|
- }
|
80
|
|
- });
|
|
100
|
+ this.axios.get("/bottom", {})
|
|
101
|
+ .then((res) => {
|
|
102
|
+ if (res.data.status == 0) {
|
|
103
|
+ this.content = res.data.data.content;
|
|
104
|
+ this.photo = res.data.data.photo;
|
|
105
|
+ this.introduce = res.data.data.introduce;
|
|
106
|
+ }
|
|
107
|
+ });
|
81
|
108
|
}
|
82
|
109
|
},
|
83
|
110
|
mounted() {
|
84
|
|
- // this.getData();
|
|
111
|
+ this.getData();
|
85
|
112
|
}
|
86
|
113
|
};
|
87
|
114
|
</script>
|