引导页设置

This commit is contained in:
liuye
2023-03-17 16:08:20 +08:00
parent b16d4a8af9
commit 20408bb71f

View File

@@ -5,7 +5,7 @@
<template slot="content"> <template slot="content">
<ai-search-bar bottomBorder> <ai-search-bar bottomBorder>
<template #left> <template #left>
<el-button type="primary" @click="isShow = true">添加</el-button> <el-button type="primary" @click="isShow = true" icon="iconfont iconAdd">添加</el-button>
</template> </template>
<template #right> <template #right>
<span class="text">是否开启引导页</span> <el-switch v-model="isStart" @change="changeStatus"></el-switch> <span class="text">是否开启引导页</span> <el-switch v-model="isStart" @change="changeStatus"></el-switch>
@@ -99,6 +99,7 @@
tableData: [], tableData: [],
total: 0, total: 0,
isStart: true, isStart: true,
isFlag: false,
isShow: false, isShow: false,
form: { form: {
urlList: [], urlList: [],
@@ -110,6 +111,7 @@
created () { created () {
this.getList() this.getList()
this.getStatus()
}, },
methods: { methods: {
@@ -160,17 +162,29 @@
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('提交成功!') this.$message.success('提交成功!')
this.isShow = false this.onClose()
this.getList() this.getList()
} }
}) })
} }
}) })
}, },
changeStatus(status) { getStatus() {
this.instance.post(`/app/appwechatguidepage/enableStatus`).then(res => {
if (res.code == 0) {
this.isStart = res.data
this.isFlag = false
}
})
},
changeStatus() {
if(this.isFlag = true) return
this.isFlag = true
this.instance.post(`/app/appwechatguidepage/enable`).then(res => { this.instance.post(`/app/appwechatguidepage/enable`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('操作成功!') this.$message.success(this.isStart == 1 ? '引导页已开启' : '引导页已关闭')
this.getStatus()
} }
}) })
} }