Commit 37a6f93e by 姜鹏凯

短链推广bug fixed

1 parent 8ca46a1b
<template> <template>
<div> <div>
<el-dialog :title="title" :visible.sync="Pvisible" width="800px" append-to-body :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="Pvisible" width="800px" append-to-body :close-on-click-modal="false">
<template v-if="list.length"> <template v-if="list.length || !isInit">
<el-row type="flex" justify="space-between" style="max-height: 500px;"> <el-row type="flex" justify="space-between" style="max-height: 500px;">
<el-col style="margin-top: 0px;"> <el-col style="margin-top: 0px;">
<div> <div>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<el-button type="primary" @click="getList(1)">查询</el-button> <el-button type="primary" @click="search()">查询</el-button>
<el-button @click="resetForm()">重置</el-button> <el-button @click="resetForm()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<el-button type="primary" @click="submit">确 定</el-button> <el-button type="primary" @click="submit">确 定</el-button>
</div> </div>
</template> </template>
<template v-else> <template v-if="!list.length && isInit">
<div class="empty"> <div class="empty">
<div> <div>
暂无短链,点击下方按钮立即创建 暂无短链,点击下方按钮立即创建
...@@ -103,11 +103,14 @@ ...@@ -103,11 +103,14 @@
}, },
data() { data() {
return { return {
isInit: true,
touchTypeDict, touchTypeDict,
loading: true, // 遮罩层 loading: true, // 遮罩层
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
type: null,
shortLinkName: ''
}, },
list: [], // 列表 list: [], // 列表
total: 0, // 总条数 total: 0, // 总条数
...@@ -140,9 +143,11 @@ ...@@ -140,9 +143,11 @@
methods: { methods: {
resetForm() { resetForm() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.isInit = true
this.getList(1) this.getList(1)
}, },
search() { search() {
this.isInit = false
this.query.pageNum = 1 this.query.pageNum = 1
this.getList() this.getList()
}, },
...@@ -152,7 +157,8 @@ ...@@ -152,7 +157,8 @@
this.loading = true this.loading = true
getList(this.query) getList(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows this.radio = ''
this.list = rows ? rows : []
this.total = +total this.total = +total
this.loading = false this.loading = false
}) })
...@@ -161,6 +167,10 @@ ...@@ -161,6 +167,10 @@
}) })
}, },
submit() { submit() {
if (!this.radio) {
this.msgError('请选择一项!')
return
}
this.Pvisible = false this.Pvisible = false
this.$emit('success', this.radio) this.$emit('success', this.radio)
}, },
......
...@@ -64,8 +64,7 @@ export function deletePomotion(id) { ...@@ -64,8 +64,7 @@ export function deletePomotion(id) {
// 列表批量删除 // 列表批量删除
export function deleteMultPo(ids) { export function deleteMultPo(ids) {
return request({ return request({
url: wecom + '/promotion/batch/delete', url: wecom + '/promotion/batch/delete/' + ids,
data: ids,
method: 'delete' method: 'delete'
}) })
} }
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
// 是否显示模板库 // 是否显示模板库
showModle: { showModle: {
type: Boolean, type: Boolean,
default: true default: false
}, },
// 1.员工活码;2:企微营销;3:企业动态;4:门店活码 // 1.员工活码;2:企微营销;3:企业动态;4:门店活码
otherType: { otherType: {
......
<template> <template>
<div> <div>
<el-dialog :title="title" :visible.sync="Pvisible" width="800px" append-to-body :close-on-click-modal="false"> <el-dialog :title="title" :visible.sync="Pvisible" width="800px" append-to-body :close-on-click-modal="false">
<template v-if="list.length"> <template v-if="list.length || !isInit">
<el-row type="flex" justify="space-between" style="max-height: 500px;"> <el-row type="flex" justify="space-between" style="max-height: 500px;">
<el-col style="margin-top: 0px;"> <el-col style="margin-top: 0px;">
<div> <div>
<el-form ref="queryForm" :model="query" :inline="true" label-width=""> <el-form ref="queryForm" :model="query" :inline="true" label-width="">
<el-form-item label="海报标题" prop="shortLinkName"> <el-form-item label="海报标题" prop="title">
<el-input clearable v-model="query.title" placeholder="请输入"></el-input> <el-input clearable v-model="query.title" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<el-button type="primary" @click="getList(1)">查询</el-button> <el-button type="primary" @click="search()">查询</el-button>
<el-button @click="resetForm()">重置</el-button> <el-button @click="resetForm()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
<el-button type="primary" @click="submit">确 定</el-button> <el-button type="primary" @click="submit">确 定</el-button>
</div> </div>
</template> </template>
<template v-else> <template v-if="!list.length && isInit">
<div class="empty"> <div class="empty">
<div> <div>
暂无短链,点击下方按钮立即创建 暂无海报,点击下方按钮立即创建
<div style="margin-top: 30px;"> <div style="margin-top: 30px;">
<el-button size="mini" type="primary" @click="$router.push('/content/martial/trackMaterial/list')"> <el-button size="mini" type="primary" @click="$router.push('/content/martial/trackMaterial/list')">
去新建 去新建
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
}, },
data() { data() {
return { return {
isInit: true,
loading: true, // 遮罩层 loading: true, // 遮罩层
query: { query: {
pageNum: 1, pageNum: 1,
...@@ -117,9 +118,11 @@ ...@@ -117,9 +118,11 @@
methods: { methods: {
resetForm() { resetForm() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.isInit = true
this.getList(1) this.getList(1)
}, },
search() { search() {
this.isInit = false
this.query.pageNum = 1 this.query.pageNum = 1
this.getList() this.getList()
}, },
...@@ -130,6 +133,7 @@ ...@@ -130,6 +133,7 @@
getPosterList(this.query) getPosterList(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows this.list = rows
this.radio = ''
this.list.forEach((dd) => { this.list.forEach((dd) => {
dd.coverUrl = dd.materialUrl dd.coverUrl = dd.materialUrl
}) })
...@@ -141,6 +145,10 @@ ...@@ -141,6 +145,10 @@
}) })
}, },
submit() { submit() {
if (!this.radio) {
this.msgError('请选择一项!')
return
}
this.Pvisible = false this.Pvisible = false
this.$emit('success', this.radio) this.$emit('success', this.radio)
}, },
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
return deleteMultPo(ids) return deleteMultPo(ids)
}) })
.then(() => { .then(() => {
this.search() this.handleSearch()
this.msgSuccess('删除成功') this.msgSuccess('删除成功')
}) })
.catch(function () {}) .catch(function () {})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!