增加广告跳转,增加现金红包配置
This commit is contained in:
@@ -793,7 +793,11 @@
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="图片">
|
||||
<template slot-scope="scope">
|
||||
<img style="width: 50px; height: 50px" v-if="scope.row.url" :src="scope.row.url" />
|
||||
<img
|
||||
style="width: 50px; height: 50px"
|
||||
v-if="scope.row.url"
|
||||
:src="scope.row.url"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型">
|
||||
@@ -829,22 +833,73 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="现金红包抽奖金额配置" name="senven">
|
||||
<div class="">
|
||||
<div style="margin-bottom: 20px">
|
||||
<el-button type="primary" @click="openPop('refAddRedPack')"
|
||||
>添加</el-button
|
||||
>
|
||||
</div>
|
||||
<el-table :border="true" :data="redPackData">
|
||||
<el-table-column label="描述" prop="name"></el-table-column>
|
||||
<el-table-column
|
||||
label="最大金额"
|
||||
prop="maxAmount"
|
||||
></el-table-column>
|
||||
<el-table-column label="中奖概率">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.random }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="redPackChangeStatus($event, scope.row)"
|
||||
v-model="scope.row.status"
|
||||
:inactive-value="0"
|
||||
:active-value="1"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编辑">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="openPop('refAddRedPack', scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button type="text" size="mini" @click="depPopRedPack(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<pop-add-zhuanpan
|
||||
ref="refAddZhuanpan"
|
||||
@refresh="zhuanPanRefresh"
|
||||
></pop-add-zhuanpan>
|
||||
<pop-add-red-pack
|
||||
ref="refAddRedPack"
|
||||
@refresh="redpackRefresh"
|
||||
></pop-add-red-pack>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $disc from "@/api/disc-spinning.js";
|
||||
import popAddZhuanpan from "./components/pop-add-zhuanpan.vue";
|
||||
import popAddRedPack from "./components/pop-add-redPack.vue";
|
||||
import { $redPackApi } from "@/api/red-pack.js";
|
||||
export default {
|
||||
components: { popAddZhuanpan },
|
||||
components: { popAddZhuanpan, popAddRedPack },
|
||||
data() {
|
||||
return {
|
||||
redPackData: [],
|
||||
//抽奖转盘数据
|
||||
zhuanpanData: [],
|
||||
page: 1,
|
||||
@@ -971,6 +1026,40 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
depPopRedPack(item){
|
||||
this.$confirm("是否删除该红包抽奖配置?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
$redPackApi.del(item.id).then((res) => {
|
||||
const data = res.data;
|
||||
if (data.code == 0) {
|
||||
this.$message.success("删除成功");
|
||||
this.redPackInit();
|
||||
} else {
|
||||
this.$message.error(data.msg || "删除失败");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
async redPackChangeStatus(e,item){
|
||||
console.log(e)
|
||||
const res=await $redPackApi.update({...item,status:e})
|
||||
if(res.data.code==0){
|
||||
this.$message.success('修改成功')
|
||||
this.redPackInit()
|
||||
}else{
|
||||
this.$message.error(res.data.msg || '修改失败')
|
||||
}
|
||||
},
|
||||
redpackRefresh() {
|
||||
this.page = 1;
|
||||
this.limit = 10;
|
||||
this.redPackInit();
|
||||
},
|
||||
zhuanPanRefresh() {
|
||||
this.page = 1;
|
||||
this.limit = 10;
|
||||
@@ -984,6 +1073,9 @@ export default {
|
||||
};
|
||||
return $types[type] ? $types[type] : "";
|
||||
},
|
||||
openPop(key, item) {
|
||||
this.$refs[key].open(item);
|
||||
},
|
||||
// 转盘添加弹窗show
|
||||
refAddZhuanpanOpen(item) {
|
||||
this.$refs.refAddZhuanpan.open(item);
|
||||
@@ -1299,6 +1391,14 @@ export default {
|
||||
});
|
||||
this.zhuanpanData = data.data.records;
|
||||
},
|
||||
//现金红包抽奖配置数据初始化
|
||||
async redPackInit() {
|
||||
const { data } = await $redPackApi.getList({
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
});
|
||||
this.redPackData = data.data.records;
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
this.orderId = "";
|
||||
this.userName = "";
|
||||
@@ -1331,6 +1431,11 @@ export default {
|
||||
this.limit = 10;
|
||||
this.zhuanPanInit();
|
||||
}
|
||||
if (tab._props.label == "现金红包抽奖金额配置") {
|
||||
this.page = 1;
|
||||
this.limit = 10;
|
||||
this.redPackInit();
|
||||
}
|
||||
},
|
||||
// 查询
|
||||
phoneSelect() {
|
||||
|
||||
Reference in New Issue
Block a user