设备扫码注册以及我的二维码修改
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// export const MQTT_IP = '192.168.1.18:8083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
|
// export const MQTT_IP = '192.168.1.18:8083/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
|
||||||
export const MQTT_IP = 'pqmcn.com:8085/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
|
export const MQTT_IP = 'pqmcn.com:8884/mqtt'//mqtt地址端口, 使用emqx时一定要加mqtt
|
||||||
|
|
||||||
const MQTT_USERNAME = 't_user'//mqtt用户名
|
const MQTT_USERNAME = 't_user'//mqtt用户名
|
||||||
const MQTT_PASSWORD = 'njcnpqs'//密码
|
const MQTT_PASSWORD = 'njcnpqs'//密码
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Cn-page :loading="loading" noPadding beforeRender>
|
<Cn-page :loading="loading" noPadding>
|
||||||
<view slot="body">
|
<view slot="body">
|
||||||
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }" style="overflow: hidden">
|
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }" style="overflow: hidden">
|
||||||
<view class="detail-header">
|
<view class="detail-header">
|
||||||
@@ -321,7 +321,7 @@ export default {
|
|||||||
this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS)
|
this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS)
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
this.client = mqtt.connect('ws://' + MQTT_IP, MQTT_OPTIONS)
|
this.client = mqtt.connect('wss://' + MQTT_IP, MQTT_OPTIONS)
|
||||||
// #endif
|
// #endif
|
||||||
this.client
|
this.client
|
||||||
.on('connect', () => {
|
.on('connect', () => {
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ export default {
|
|||||||
queryTopologyDiagramPage({
|
queryTopologyDiagramPage({
|
||||||
projectId: this.formData.projectId,
|
projectId: this.formData.projectId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.imageList = res.data.records.map(item=>{
|
this.imageList = res.data.records.map(item => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
filePath: this.$config.static + item.filePath
|
filePath: this.$config.static + item.filePath
|
||||||
@@ -297,12 +297,13 @@ export default {
|
|||||||
},
|
},
|
||||||
scanCode() {
|
scanCode() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success(res) {
|
success: (res) => {
|
||||||
console.log('条码类型:' + res.scanType)
|
console.log('条码类型:' + res.scanType)
|
||||||
console.log('条码内容:' + res.result)
|
console.log('条码内容:' + res.result)
|
||||||
let content = JSON.parse(res.result)
|
let content = JSON.parse(res.result)
|
||||||
|
console.log(content)
|
||||||
if (content.type === 'NDID') {
|
if (content.type === 'NDID') {
|
||||||
this.formData.nDid = content.nDid
|
this.formData.nDid = content.data
|
||||||
this.register()
|
this.register()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="transfer">
|
<Cn-page :loading="loading" before-render>
|
||||||
|
<view class="transfer" slot="body">
|
||||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||||
<Cn-htmlToImg domId="content" @renderFinish="renderFinish" style="display: flex">
|
<Cn-htmlToImg domId="content" @renderFinish="renderFinish" style="display: flex">
|
||||||
<view class="content" id="content">
|
<view class="content" id="content">
|
||||||
@@ -11,7 +12,7 @@
|
|||||||
<view class="user-info-role">{{ roleName }}</view>
|
<view class="user-info-role">{{ roleName }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uqrcode size="260" ref="uqrcode" canvas-id="qrcode" :value="content"
|
<uqrcode size="260" ref="uqrcode" canvas-id="qrcode" :value="content" @complete="loading = false"
|
||||||
:loading="false"></uqrcode>
|
:loading="false"></uqrcode>
|
||||||
</view>
|
</view>
|
||||||
</Cn-htmlToImg>
|
</Cn-htmlToImg>
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// import QRCode from 'qrcodejs2'
|
// import QRCode from 'qrcodejs2'
|
||||||
@@ -71,10 +73,12 @@ export default {
|
|||||||
this.img = e
|
this.img = e
|
||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
if(!this.img){
|
console.log(this.img)
|
||||||
setTimeout(()=>{
|
if (!this.img) {
|
||||||
|
setTimeout(() => {
|
||||||
this.save()
|
this.save()
|
||||||
},500)
|
}, 500)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
base64ToPath(this.img).then((res) => {
|
base64ToPath(this.img).then((res) => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
|||||||
Reference in New Issue
Block a user