Commit 945c8cd3 authored by shangtx's avatar shangtx

feat: 轮播图跳转

parent 811e6beb
...@@ -18,9 +18,29 @@ ...@@ -18,9 +18,29 @@
:form="form" :form="form"
/> />
<a-form-item label="排序"> <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-item>
</a-form> </a-form>
<div class="drawer-form-bottom-toolbar"> <div class="drawer-form-bottom-toolbar">
<a-button :style="{ marginRight: '8px' }" @click="close"> 取消 </a-button> <a-button :style="{ marginRight: '8px' }" @click="close"> 取消 </a-button>
<a-button type="primary" @click="submit"> 保存 </a-button> <a-button type="primary" @click="submit"> 保存 </a-button>
...@@ -39,7 +59,8 @@ export default { ...@@ -39,7 +59,8 @@ export default {
return { return {
form: this.$form.createForm(this), form: this.$form.createForm(this),
visible: false, visible: false,
id: null id: null,
type: 0
} }
}, },
methods: { methods: {
...@@ -49,7 +70,10 @@ export default { ...@@ -49,7 +70,10 @@ export default {
this.visible = true this.visible = true
if (this.id) { if (this.id) {
getDetail(this.id).then(({ data }) => { getDetail(this.id).then(({ data }) => {
this.form.setFieldsValue(data) this.type = data.type
this.$nextTick(() => {
this.form.setFieldsValue(data)
})
this.$refs.image.setValue([data.url]) this.$refs.image.setValue([data.url])
}) })
} }
...@@ -58,14 +82,18 @@ export default { ...@@ -58,14 +82,18 @@ export default {
this.id = null this.id = null
this.$refs.image.reset() this.$refs.image.reset()
this.form.resetFields() this.form.resetFields()
this.type = 0
this.form.setFieldsValue({ type: 0 })
this.visible = false this.visible = false
}, },
typeChange(value) {
this.type = value
},
submit() { submit() {
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (err) { if (err) {
return return
} }
console.info('values', values, this.$refs.image.getValue())
const reqData = { const reqData = {
...values, ...values,
url: this.$refs.image.getValue()[0], url: this.$refs.image.getValue()[0],
......
...@@ -59,7 +59,7 @@ const columns = [ ...@@ -59,7 +59,7 @@ const columns = [
] ]
export default { export default {
name: 'ErrorLogList', name: 'BannerList',
mixins: [TableScript], mixins: [TableScript],
components: { TableTemplate, BannerEdit }, components: { TableTemplate, BannerEdit },
data() { data() {
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
</a-descriptions> </a-descriptions>
</div> </div>
<div id="order-detail-drawer-box-timeline"> <div id="order-detail-drawer-box-timeline">
<h3>订单流程</h3>
<a-timeline> <a-timeline>
<template v-for="(log, i) in order.process"> <template v-for="(log, i) in order.process">
<a-timeline-item :key="i"> <a-timeline-item :key="i">
...@@ -214,7 +215,7 @@ export default { ...@@ -214,7 +215,7 @@ export default {
mounted() {} mounted() {}
} }
</script> </script>
<style lang="less" scoped> <style lang="less">
#order-detail-drawer-box { #order-detail-drawer-box {
height: 100%; height: 100%;
display: flex; display: flex;
...@@ -225,7 +226,14 @@ export default { ...@@ -225,7 +226,14 @@ export default {
width: 40%; width: 40%;
max-height: 100%; max-height: 100%;
overflow-y: auto; overflow-y: auto;
padding-top: 10px; h3 {
margin-bottom: 30px;
font-weight: bold;
}
}
.ant-descriptions-item-label {
margin-top: 5px;
font-weight: bold;
} }
} }
</style> </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