Compare commits
2 Commits
140473bcb5
...
38091d2cf0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
38091d2cf0 | ||
![]() |
d13c81526d |
|
@ -51,3 +51,23 @@ export function handleAudit(data){
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 广告启用
|
||||||
|
export function enableAd(id) {
|
||||||
|
return request({
|
||||||
|
url: '/bst/ad/enable',
|
||||||
|
method: 'put',
|
||||||
|
data: id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 广告禁用
|
||||||
|
export function disableAd(id) {
|
||||||
|
return request({
|
||||||
|
url: '/bst/ad/disable',
|
||||||
|
method: 'put',
|
||||||
|
data: id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,7 @@ export const BonusStatus = {
|
||||||
// 加盟商申请状态
|
// 加盟商申请状态
|
||||||
export const MchApplyStatus = {
|
export const MchApplyStatus = {
|
||||||
APPROVING: "1", // 审核中
|
APPROVING: "1", // 审核中
|
||||||
PASSED: "2", // 审核通过
|
PASSED: "2", // 审核通过
|
||||||
REJECTED: "3", // 审核驳回
|
REJECTED: "3", // 审核驳回
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,6 +317,12 @@ export const FaultStatus = {
|
||||||
COMPLETED: "3", // 已完成
|
COMPLETED: "3", // 已完成
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 广告状态
|
||||||
|
export const AdStatus = {
|
||||||
|
DISABLED: "0", // 禁用
|
||||||
|
ENABLE: "1", // 启用
|
||||||
|
}
|
||||||
|
|
||||||
// 提现手续费类型
|
// 提现手续费类型
|
||||||
export const WithdrawServiceType = {
|
export const WithdrawServiceType = {
|
||||||
POINT: "1", // 按比例
|
POINT: "1", // 按比例
|
||||||
|
|
|
@ -71,6 +71,11 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="跳转链接" align="center" prop="url" />
|
<el-table-column label="跳转链接" align="center" prop="url" />
|
||||||
|
<el-table-column label="广告状态" align="center" prop="status">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.ad_status" :value="scope.row.status"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
@ -79,9 +84,31 @@
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-view"
|
icon="el-icon-view"
|
||||||
@click="handleView(scope.row)"
|
@click="handleView(scope.row)"
|
||||||
v-hasPermi="['bst:ad:edit']">
|
v-if="isSysAdmin() && scope.row.auditStatus === '1'"
|
||||||
{{ scope.row.auditStatus === '1' ? '审核' : '查看详情' }}
|
>审核</el-button>
|
||||||
</el-button>
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-view"
|
||||||
|
@click="handleView(scope.row)"
|
||||||
|
v-else
|
||||||
|
>查看详情</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-close"
|
||||||
|
@click="handleDisable(scope.row)"
|
||||||
|
v-has-permi="['bst:ad:disable']"
|
||||||
|
v-show="AdStatus.ENABLE.includes(scope.row.status)"
|
||||||
|
>禁用</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-check"
|
||||||
|
@click="handleEnable(scope.row)"
|
||||||
|
v-has-permi="['bst:ad:enable']"
|
||||||
|
v-show="AdStatus.DISABLED.includes(scope.row.status)"
|
||||||
|
>启用</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -124,17 +151,20 @@
|
||||||
<el-descriptions-item label="广告图片" :span="2">
|
<el-descriptions-item label="广告图片" :span="2">
|
||||||
<image-preview :src="detailForm.picture" :width="100" :height="100" />
|
<image-preview :src="detailForm.picture" :width="100" :height="100" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="跳转链接" :span="24">{{ detailForm.url }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="跳转类型" :span="2">
|
|
||||||
<dict-tag :options="dict.type.ad_url_type" :value="detailForm.urlType"/>
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="审核状态">
|
<el-descriptions-item label="审核状态">
|
||||||
<dict-tag :value="detailForm.auditStatus" :options="dict.type.ad_audit_status"/>
|
<dict-tag :value="detailForm.auditStatus" :options="dict.type.ad_audit_status"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="广告状态">
|
||||||
|
<dict-tag :value="detailForm.status" :options="dict.type.ad_status"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="跳转类型" :span="2">
|
||||||
|
<dict-tag :options="dict.type.ad_url_type" :value="detailForm.urlType"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="跳转链接" :span="24">{{ detailForm.url }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</div>
|
</div>
|
||||||
<!-- 审核区块 -->
|
<!-- 审核区块 -->
|
||||||
<template v-if="detailForm.auditStatus === '1'">
|
<template v-if="isSysAdmin()&&detailForm.auditStatus === '1'">
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<div class="verify-area">
|
<div class="verify-area">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -191,6 +221,12 @@
|
||||||
<image-upload v-model="form.picture" :limit="1"/>
|
<image-upload v-model="form.picture" :limit="1"/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="广告状态" prop="status">
|
||||||
|
<template>
|
||||||
|
<el-radio v-model="form.status" label="1">启用</el-radio>
|
||||||
|
<el-radio v-model="form.status" label="0">禁用</el-radio>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="跳转类型" prop="urlType">
|
<el-form-item label="跳转类型" prop="urlType">
|
||||||
<el-select v-model="form.urlType" placeholder="请选择跳转类型">
|
<el-select v-model="form.urlType" placeholder="请选择跳转类型">
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -223,6 +259,8 @@
|
||||||
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
import AreaRemoteSelect from "@/components/Business/Area/AreaRemoteSelect.vue";
|
||||||
import {isSysAdmin} from "@/utils/permission";
|
import {isSysAdmin} from "@/utils/permission";
|
||||||
import {handleAudit} from "@/api/bst/ad";
|
import {handleAudit} from "@/api/bst/ad";
|
||||||
|
import {AdStatus} from "@/utils/enums";
|
||||||
|
import {enableDevice} from "@/api/bst/device";
|
||||||
|
|
||||||
// 默认排序字段
|
// 默认排序字段
|
||||||
const defaultSort = {
|
const defaultSort = {
|
||||||
|
@ -232,7 +270,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Ad",
|
name: "Ad",
|
||||||
dicts:['ad_type','ad_url_type','ad_belong','ad_audit_status'],
|
dicts:['ad_type','ad_url_type','ad_belong','ad_audit_status','ad_status'],
|
||||||
props:{
|
props:{
|
||||||
id: {
|
id: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
|
@ -257,6 +295,9 @@
|
||||||
//{key: 'urlType', visible: true, label: '跳转类型,1外链跳转,2站内跳转', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
//{key: 'urlType', visible: true, label: '跳转类型,1外链跳转,2站内跳转', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
|
status: [
|
||||||
|
{ required: true, message: '广告状态不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
picture: [
|
picture: [
|
||||||
{ required: true, message: '广告图片不能为空', trigger: 'change' }
|
{ required: true, message: '广告图片不能为空', trigger: 'change' }
|
||||||
],
|
],
|
||||||
|
@ -301,6 +342,7 @@
|
||||||
picture: null,
|
picture: null,
|
||||||
url: null,
|
url: null,
|
||||||
deleted: null,
|
deleted: null,
|
||||||
|
status: null,
|
||||||
urlType: null,
|
urlType: null,
|
||||||
belong: null
|
belong: null
|
||||||
},
|
},
|
||||||
|
@ -310,6 +352,9 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
|
AdStatus() {
|
||||||
|
return AdStatus
|
||||||
|
},
|
||||||
initAreaOptions() {
|
initAreaOptions() {
|
||||||
return [{id: this.form.areaId, name: this.form.areaName}]
|
return [{id: this.form.areaId, name: this.form.areaName}]
|
||||||
},
|
},
|
||||||
|
@ -391,6 +436,7 @@
|
||||||
},
|
},
|
||||||
/** 查看详情 */
|
/** 查看详情 */
|
||||||
handleView(row) {
|
handleView(row) {
|
||||||
|
console.log('isSysAdmin 值:', this.isSysAdmin);
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getAd(row.adId).then(response => {
|
getAd(row.adId).then(response => {
|
||||||
this.detailForm = response.data;
|
this.detailForm = response.data;
|
||||||
|
@ -422,6 +468,48 @@
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加广告";
|
this.title = "添加广告";
|
||||||
},
|
},
|
||||||
|
// 启用广告
|
||||||
|
handleEnable(row) {
|
||||||
|
let msg = '是否确认一键启用?';
|
||||||
|
let ids = this.ids;
|
||||||
|
if (row != null) {
|
||||||
|
ids = [row.id];
|
||||||
|
msg = '是否确认启用广告';
|
||||||
|
}
|
||||||
|
this.$confirm(msg, {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
enableDevice(ids).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("操作成功,共启用" + res.data + "台设备");
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 禁用广告
|
||||||
|
handleDisable(row) {
|
||||||
|
let msg = '是否确认一键启用?';
|
||||||
|
let ids = this.ids;
|
||||||
|
if (row != null) {
|
||||||
|
ids = [row.id];
|
||||||
|
msg = '是否确认启用广告?';
|
||||||
|
}
|
||||||
|
this.$confirm(msg, {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
enableDevice(ids).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("操作成功,共启用" + res.data + "台设备");
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user