小程序公告详情

This commit is contained in:
yanran200730
2021-12-16 15:07:56 +08:00
parent 0ed6cdb32e
commit f6ec0d0d96
3 changed files with 72 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
<script>
import List from './components/List'
import Add from './components/Add'
import Detail from './components/Detail'
export default {
name: 'AppNotice',
@@ -29,7 +30,8 @@
components: {
Add,
List
List,
Detail
},
mounted () {
@@ -42,6 +44,11 @@
this.params = data.params
}
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'list') {
this.component = 'List'
this.params = data.params

View File

@@ -17,7 +17,7 @@
<el-form-item label="正文" style="width: 100%;" prop="codeName" :rules="[{ required: true, message: '请输入正文', trigger: 'blur' }]">
<el-input size="small" placeholder="请输入正文" :rows="6" :maxlength="1000" type="textarea" v-model="form.codeName"></el-input>
</el-form-item>
<el-form-item label="图片" style="width: 100%;" prop="codeName" :rules="[{ required: true, message: '请上传图片', trigger: 'blur' }]">
<el-form-item label="图片" style="width: 100%;" prop="codeName">
<ai-uploader v-model="form.pictureUrl" :instance="instance" :limit="9"></ai-uploader>
</el-form-item>
</el-form>

View File

@@ -0,0 +1,63 @@
<template>
<ai-detail>
<template slot="title">
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
id: ''
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appeveryvillagecode/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = res.data
this.form.codeUrl = [{
url: res.data.codeUrl
}]
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>