You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bsdgy-front/src/pages/activity/ActivityCode.vue

148 lines
3.6 KiB
Vue

5 years ago
<template>
<div class="activity_code">
5 years ago
<Table :loading="loading"
border
:columns="columns"
:data="data"></Table>
<Page :total="totalSize"
:current="pageNum"
:page-size="pageSize"
show-elevator
show-total
placement="top"
@on-change="handlePage"
class-name="ks-page"></Page>
5 years ago
</div>
</template>
<script>
5 years ago
import { activityCodeList } from '../../services/ActivityManager/ActivityManager';
5 years ago
export default {
name: "ActivityCode",
5 years ago
data () {
let _this = this;
5 years ago
return {
loading: false,
totalSize: 0,
pageNum: 1,
pageSize: 10,
5 years ago
data: [],
instanceId: 0,
columns: [
{
type: "index",
width: 80,
align: "center",
title: "序号",
},
{
title: "所属零售公司",
key: "organizational.name",
render (h, params) {
return h("span", params.row["organizational"]["name"]);
},
},
{
title: "零售公司编号",
key: "organizational.code",
render (h, params) {
return h("span", params.row["organizational"]["code"]);
},
},
{
title: "店铺名称",
key: "store.name",
render (h, params) {
return h("span", params.row["store"]["name"]);
},
},
{
title: "店铺编号",
key: "store.code",
render (h, params) {
return h("span", params.row["store"]["code"]);
},
},
{
title: "推广码",
key: "qrCode",
render (h, params) {
return h("div", {
class: "qrcode" }, [
h(
"Button",
{
props: { type: "primary", size: "small" },
style: { marginRight: "8px" },
on: { "mouseover.native": () => _this.showQrcode(params.row) }
},
"二维码"
),
h(
"div",
{
class: "qrcodeBox",
style: { display: "none" }
}, [
h(
"img",
{ attrs: { src: params.row.qrCode } }
)]
)
]);
},
},
{
title: "操作",
key: "action",
width: 200,
render (h, p) {
return h("div", [
h(
"Button",
{
props: { type: "primary", size: "small" },
style: { marginRight: "8px" },
on: {
click: () => _this.guideCode(p.row),
},
},
"查看导购码"
)
]);
},
},
]
5 years ago
};
},
5 years ago
created () {
this.instanceId = this.$route.query.instanceId;
this.load();
},
5 years ago
methods: {
5 years ago
handlePage (value) {
5 years ago
this.pageNum = value;
this.load();
},
5 years ago
showQrcode (row) {
console.log(row)
},
load (params = {}) {
let _this = this;
this.loading = true;
params.pageSize = this.pageSize;
params.pageNum = this.pageNum;
params.instanceId = this.instanceId;
activityCodeList(params, res => {
_this.data = res.data.results.this.records
_this.totalSize = res.data.results.this.total
_this.loading = false;
})
}
5 years ago
}
};
</script>
5 years ago
<style>
</style>