微信跳转
This commit is contained in:
parent
ea27e00151
commit
e7f207d4b5
|
@ -6,7 +6,7 @@ export function getWxSchemeUrl(path, query) {
|
|||
}
|
||||
|
||||
export function getWxIndexUrl(query) {
|
||||
let url = `https://znb.ccttiot.com/wxjump/index/action=device`;
|
||||
let url = `https://kaiguan.chuantewulian.cn/wxjump/index?action=device`;
|
||||
if (query != null ) {
|
||||
if (query instanceof Object) {
|
||||
query = tansParams(query).slice(0, -1);
|
||||
|
@ -15,5 +15,6 @@ export function getWxIndexUrl(query) {
|
|||
url += `&${query}`;
|
||||
}
|
||||
}
|
||||
console.log("wx_url", url);
|
||||
return url;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备名称" prop="deviceId">
|
||||
<el-form-item label="设备名称" prop="deviceId" v-if="deviceId == null">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="请输入设备"
|
||||
|
@ -124,7 +124,7 @@
|
|||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="设备" prop="deviceId">
|
||||
<device-input v-model="form.deviceId" />
|
||||
<device-input v-model="form.deviceId" :disabled="deviceId != null" />
|
||||
</el-form-item>
|
||||
<el-form-item label="套餐名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入套餐名称" />
|
||||
|
@ -150,10 +150,22 @@
|
|||
<script>
|
||||
import { listSuit, getSuit, delSuit, addSuit, updateSuit } from "@/api/ss/suit";
|
||||
import DeviceInput from '@/components/Business/Device/DeviceInput.vue'
|
||||
import device from '@/views/system/device/index.vue'
|
||||
|
||||
export default {
|
||||
name: "Suit",
|
||||
computed: {
|
||||
device() {
|
||||
return device
|
||||
}
|
||||
},
|
||||
components: { DeviceInput },
|
||||
props: {
|
||||
deviceId: {
|
||||
type: String,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
@ -205,7 +217,8 @@ export default {
|
|||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
mounted() {
|
||||
this.queryParams.deviceId = this.deviceId;
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
@ -227,7 +240,7 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
suitId: null,
|
||||
deviceId: null,
|
||||
deviceId: this.deviceId,
|
||||
name: null,
|
||||
feeType: null,
|
||||
value: null,
|
||||
|
|
71
src/views/system/device/components/suitList.vue
Normal file
71
src/views/system/device/components/suitList.vue
Normal file
|
@ -0,0 +1,71 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="recordList">
|
||||
<el-table-column align="center" type="index" label="#"></el-table-column>
|
||||
<el-table-column align="center" label="时间" prop="createTime"></el-table-column>
|
||||
<el-table-column align="center" label="用户名称" prop="userName"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:auto-scroll="false"
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getRecordList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listBindRecord} from "@/api/system/bindRecord";
|
||||
|
||||
export default {
|
||||
name: 'suitList',
|
||||
props: {
|
||||
// 设备id
|
||||
deviceId: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
recordList: [], // 记录列表
|
||||
loading: false,
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deviceId: null,
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
deviceId(nv, ov) {
|
||||
this.getRecordList(nv);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getRecordList(this.deviceId);
|
||||
},
|
||||
methods: {
|
||||
// 获取记录列表
|
||||
getRecordList(deviceId) {
|
||||
if(deviceId == null) {
|
||||
this.recordList = [];
|
||||
this.total = 0;
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
this.queryParams.deviceId = deviceId | this.deviceId;
|
||||
listBindRecord(this.queryParams).then(response => {
|
||||
this.recordList = response.rows;
|
||||
this.total = response.total;
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -9,7 +9,7 @@
|
|||
width="180"
|
||||
trigger="click">
|
||||
<div class="qr-code-box">
|
||||
<qr-code :text="qrCodeText(deviceData.mac)" :width="150" :height="150" />
|
||||
<qr-code :text="qrCodeText(deviceData)" :width="150" :height="150" />
|
||||
<p>扫描二维码进行设备绑定</p>
|
||||
</div>
|
||||
<el-button slot="reference" type="primary" icon="el-icon-picture">设备二维码</el-button>
|
||||
|
@ -19,9 +19,10 @@
|
|||
<dict-tag :options="dict.type.sm_device_status" :value="deviceData.status" size="mini"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="SN">{{deviceData.deviceNo | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="型号">
|
||||
<el-link type="primary" href="#">{{deviceData.model | defaultValue}}</el-link>
|
||||
<el-descriptions-item label="在线状态">
|
||||
<dict-tag :options="dict.type.sm_device_online_status" :value="deviceData.onlineStatus" size="mini"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="型号">{{deviceData.model | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="型号标签">
|
||||
<dict-tag :options="dict.type.sm_model_tag" :value="deviceData.modelTags" size="mini"/>
|
||||
</el-descriptions-item>
|
||||
|
@ -44,6 +45,9 @@
|
|||
|
||||
<el-card class="box-card">
|
||||
<el-tabs>
|
||||
<el-tab-pane label="套餐列表" :lazy="true">
|
||||
<suit v-if="deviceData.deviceId != null" :device-id="deviceData.deviceId"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="充值记录" :lazy="true">
|
||||
<recharge-record :device-id="deviceData.deviceId"/>
|
||||
</el-tab-pane>
|
||||
|
@ -74,11 +78,16 @@ import {getWxIndexUrl} from "@/utils/wx";
|
|||
import BindRecord from "@/views/system/device/components/bindRecord.vue";
|
||||
import ResetRecord from "@/views/system/device/components/resetRecord.vue";
|
||||
import TenantList from "@/views/system/device/components/tenantList.vue";
|
||||
import SuitList from '@/views/system/device/components/suitList.vue'
|
||||
import Suit from '@/views/ss/suit/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'deviceDetail',
|
||||
components: {TenantList, ResetRecord, BindRecord, ReadingRecord, MeterRecordReport, QrCode, RechargeRecord, LineChart},
|
||||
dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way', 'sm_model_tag'],
|
||||
components: {
|
||||
Suit,
|
||||
SuitList,
|
||||
TenantList, ResetRecord, BindRecord, ReadingRecord, MeterRecordReport, QrCode, RechargeRecord, LineChart},
|
||||
dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way', 'sm_model_tag', 'sm_device_online_status'],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
|
@ -89,8 +98,8 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
qrCodeText() {
|
||||
return (mac) => {
|
||||
return getWxIndexUrl({ mac: mac});
|
||||
return (device) => {
|
||||
return getWxIndexUrl({ deviceNo: device.deviceNo});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -136,7 +136,7 @@
|
|||
width="180"
|
||||
trigger="hover">
|
||||
<div class="qr-code-box">
|
||||
<qr-code :text="qrCodeText(d.row.mac)" :width="150" :height="150" />
|
||||
<qr-code :text="qrCodeText(d.row)" :width="150" :height="150" />
|
||||
<p>扫描二维码进行设备绑定</p>
|
||||
</div>
|
||||
<el-button slot="reference" type="text" icon="el-icon-picture">查看</el-button>
|
||||
|
@ -337,8 +337,8 @@ export default {
|
|||
},
|
||||
// 二维码文本
|
||||
qrCodeText() {
|
||||
return (mac) => {
|
||||
return getWxIndexUrl({ mac: mac});
|
||||
return (device) => {
|
||||
return getWxIndexUrl({ deviceNo: device.deviceNo});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user