Commit 945c8cd3 authored by shangtx's avatar shangtx

feat: 轮播图跳转

parent 811e6beb
......@@ -18,9 +18,29 @@
:form="form"
/>
<a-form-item label="排序">
<a-input-number v-decorator="['showOrder']" />
<a-input-number v-decorator="['showOrder']" defaultValue="0" />
</a-form-item>
<a-form-item label="跳转类型">
<a-select
v-decorator="['type']"
defaultValue="0"
:options="[
{ label: '不跳转', value: 0 },
{ label: '公众号文章', value: 2 }
]"
@change="typeChange"
/>
</a-form-item>
<a-form-item v-if="type == 2" label="文章链接">
<a-input
v-decorator="[
'mpArticle',
{ rules: [{ required: true, message: '请输入文章链接' }] }
]"
/>
</a-form-item>
</a-form>
<div class="drawer-form-bottom-toolbar">
<a-button :style="{ marginRight: '8px' }" @click="close"> 取消 </a-button>
<a-button type="primary" @click="submit"> 保存 </a-button>
......@@ -39,7 +59,8 @@ export default {
return {
form: this.$form.createForm(this),
visible: false,
id: null
id: null,
type: 0
}
},
methods: {
......@@ -49,7 +70,10 @@ export default {
this.visible = true
if (this.id) {
getDetail(this.id).then(({ data }) => {
this.type = data.type
this.$nextTick(() => {
this.form.setFieldsValue(data)
})
this.$refs.image.setValue([data.url])
})
}
......@@ -58,14 +82,18 @@ export default {
this.id = null
this.$refs.image.reset()
this.form.resetFields()
this.type = 0
this.form.setFieldsValue({ type: 0 })
this.visible = false
},
typeChange(value) {
this.type = value
},
submit() {
this.form.validateFields((err, values) => {
if (err) {
return
}
console.info('values', values, this.$refs.image.getValue())
const reqData = {
...values,
url: this.$refs.image.getValue()[0],
......
......@@ -59,7 +59,7 @@ const columns = [
]
export default {
name: 'ErrorLogList',
name: 'BannerList',
mixins: [TableScript],
components: { TableTemplate, BannerEdit },
data() {
......
......@@ -58,6 +58,7 @@
</a-descriptions>
</div>
<div id="order-detail-drawer-box-timeline">
<h3>订单流程</h3>
<a-timeline>
<template v-for="(log, i) in order.process">
<a-timeline-item :key="i">
......@@ -214,7 +215,7 @@ export default {
mounted() {}
}
</script>
<style lang="less" scoped>
<style lang="less">
#order-detail-drawer-box {
height: 100%;
display: flex;
......@@ -225,7 +226,14 @@ export default {
width: 40%;
max-height: 100%;
overflow-y: auto;
padding-top: 10px;
h3 {
margin-bottom: 30px;
font-weight: bold;
}
}
.ant-descriptions-item-label {
margin-top: 5px;
font-weight: bold;
}
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment