新增商户关联商户网络

master
许宏杰 1 year ago
parent 43d42f2a06
commit 2b519c967a

@ -37,3 +37,13 @@
height: 200px;
width: 400px;
}
.codeImg {
width: 100%;
height: 350px;
}
.netName {
margin-top: 10px;
text-align: center;
font-size: 16px;
font-weight: bold;
}

@ -12,13 +12,16 @@ export default {
computed: {
...mapGetters(["roles"]),
},
created() {
let index = this.roles.findIndex((item) => item == "common");
if (index > -1) {
this.$router.push({ path: "/net" });
} else {
this.$router.push({ path: "/shanghu" });
}
mounted() {
this.$nextTick(() => {
let index = this.roles.findIndex((item) => item == "common");
console.log(index, "路径");
if (index > -1) {
this.$router.push({ path: "/net" });
} else {
this.$router.push({ path: "/shanghu" });
}
});
},
};
</script>

@ -369,15 +369,4 @@ export default {
},
};
</script>
<style scoped>
.codeImg {
width: 100%;
height: 350px;
}
.netName {
margin-top: 10px;
text-align: center;
font-size: 16px;
font-weight: bold;
}
</style>
<style scoped></style>

@ -104,6 +104,7 @@
<el-table-column label="网络名称" align="center" prop="netName" />
<el-table-column label="wifi名称" align="center" prop="wifiName" />
<el-table-column label="wifi密码" align="center" prop="wifiPass" />
<el-table-column label="连网时间" align="center" prop="createTime" />
<el-table-column
label="操作"
align="center"

@ -110,7 +110,12 @@
}}</el-link>
</template>
</el-table-column>
<el-table-column label="有效起始时间" align="center" prop="startTime">
<el-table-column label="广告播放时间" align="center" prop="createTime">
<!-- <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template> -->
</el-table-column>
<!-- <el-table-column label="有效起始时间" align="center" prop="startTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
</template>
@ -119,7 +124,7 @@
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
</el-table-column> -->
<!-- <el-table-column label="视频封面" align="center" prop="videoLogo" /> -->
<el-table-column
label="操作"

@ -0,0 +1,113 @@
<template>
<div>
<el-table v-loading="loading" :data="netList" height="200">
<el-table-column label="网络名称" align="center" prop="netName" />
<el-table-column label="wifi名称" align="center" prop="wifiName" />
<el-table-column label="wifi密码" align="center" prop="wifiPass" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-download"
@click="handleCode(scope.row)"
>下载二维码</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog
title="WI-FI码"
:visible.sync="wifiopen"
width="420px"
append-to-body
>
<div ref="downloadElement" style="padding: 20px 10px">
<img :src="code.imgs" alt="" class="codeImg" />
<div class="netName">店铺名称{{ code.posName }}</div>
<div class="netName">WI-FI名称{{ code.wifiName }}</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleUpload()"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listNet } from "@/api/netEwm/net";
import html2canvas from "html2canvas";
import { getCode } from "@/api/login.js";
export default {
data() {
return {
wifiopen: false,
code: {
imgs: "",
netName: "",
},
loading: true,
netList: [],
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
},
};
},
methods: {
getList(shanghuId) {
this.queryParams.shanghuId = shanghuId;
this.loading = true;
listNet(this.queryParams).then((response) => {
this.netList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleCode(row) {
let data = {
path: "pages/index/index",
posterId: row.id,
};
getCode(data).then((res) => {
this.code.imgs = "data:image/png;base64," + res.data;
this.code.wifiName = row.wifiName;
this.code.posName = row.posName;
this.wifiopen = true;
});
},
handleUpload() {
const downloadElement = this.$refs.downloadElement;
// 使html2canvasCanvas
html2canvas(downloadElement).then((canvas) => {
// CanvasBase64
const base64Image = canvas.toDataURL("image/png");
//
const downloadLink = document.createElement("a");
downloadLink.href = base64Image;
downloadLink.download = "downloaded_image.png";
//
downloadLink.click();
});
},
},
};
</script>
<style></style>

@ -190,7 +190,7 @@
<!-- 商户详情 -->
<el-dialog
:title="titleInfo"
title="查看商户详细信息"
:visible.sync="openInfo"
width="800px"
append-to-body
@ -222,6 +222,12 @@
></video>
</div>
</div>
<div class="my-info">
<div class="cell-info">商户网络列表</div>
<div class="info-container">
<my-net ref="MyNetTable"></my-net>
</div>
</div>
</el-dialog>
<my-table ref="MyTable"></my-table>
</div>
@ -238,9 +244,11 @@ import {
import { getPoster } from "@/api/netEwm/poster";
import MyTable from "./components/MyTable.vue";
import MyNet from "./components/net.vue";
export default {
components: {
MyTable,
MyNet,
},
name: "Shanghu",
data() {
@ -371,19 +379,17 @@ export default {
handleUpdate(row, type) {
this.reset();
const id = row.id || this.ids;
getShanghu(id).then((response) => {
getShanghu(id).then(async (response) => {
this.form = response.data;
if (type == "info") {
if (this.form.posterId) {
getPoster(this.form.posterId).then((info) => {
this.form.videoPath = this.baseUrl + info.data.videoPath;
this.openInfo = true;
this.titleInfo = "查看商户详细信息";
});
} else {
this.openInfo = true;
this.titleInfo = "查看商户详细信息";
let info = await getPoster(this.form.posterId);
this.form.videoPath = this.baseUrl + info.data.videoPath;
}
this.openInfo = true;
this.$nextTick(() => {
this.$refs.MyNetTable.getList(this.form.id);
});
} else {
this.open = true;
this.title = "修改商户";

Loading…
Cancel
Save