设备扫码注册以及我的二维码修改
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 = '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_PASSWORD = 'njcnpqs'//密码
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" noPadding beforeRender>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body">
|
||||
<view class="detail" :style="{ opacity: domLoading ? '0' : '1' }" style="overflow: hidden">
|
||||
<view class="detail-header">
|
||||
@@ -321,7 +321,7 @@ export default {
|
||||
this.client = mqtt.connect('wx://' + MQTT_IP, MQTT_OPTIONS)
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.client = mqtt.connect('ws://' + MQTT_IP, MQTT_OPTIONS)
|
||||
this.client = mqtt.connect('wss://' + MQTT_IP, MQTT_OPTIONS)
|
||||
// #endif
|
||||
this.client
|
||||
.on('connect', () => {
|
||||
|
||||
@@ -271,7 +271,7 @@ export default {
|
||||
queryTopologyDiagramPage({
|
||||
projectId: this.formData.projectId,
|
||||
}).then((res) => {
|
||||
this.imageList = res.data.records.map(item=>{
|
||||
this.imageList = res.data.records.map(item => {
|
||||
return {
|
||||
...item,
|
||||
filePath: this.$config.static + item.filePath
|
||||
@@ -297,12 +297,13 @@ export default {
|
||||
},
|
||||
scanCode() {
|
||||
uni.scanCode({
|
||||
success(res) {
|
||||
success: (res) => {
|
||||
console.log('条码类型:' + res.scanType)
|
||||
console.log('条码内容:' + res.result)
|
||||
let content = JSON.parse(res.result)
|
||||
console.log(content)
|
||||
if (content.type === 'NDID') {
|
||||
this.formData.nDid = content.nDid
|
||||
this.formData.nDid = content.data
|
||||
this.register()
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
<template>
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<Cn-htmlToImg domId="content" @renderFinish="renderFinish" style="display: flex">
|
||||
<view class="content" id="content">
|
||||
<view class="user-info">
|
||||
<image class="avatar" :src="userInfo.avatar" v-if="userInfo.avatar"></image>
|
||||
<image class="avatar" src="/static/head.png" v-else></image>
|
||||
<view class="right">
|
||||
<view class="user-info-name">{{ userInfo.nickname }}</view>
|
||||
<view class="user-info-role">{{ roleName }}</view>
|
||||
<Cn-page :loading="loading" before-render>
|
||||
<view class="transfer" slot="body">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<Cn-htmlToImg domId="content" @renderFinish="renderFinish" style="display: flex">
|
||||
<view class="content" id="content">
|
||||
<view class="user-info">
|
||||
<image class="avatar" :src="userInfo.avatar" v-if="userInfo.avatar"></image>
|
||||
<image class="avatar" src="/static/head.png" v-else></image>
|
||||
<view class="right">
|
||||
<view class="user-info-name">{{ userInfo.nickname }}</view>
|
||||
<view class="user-info-role">{{ roleName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<uqrcode size="260" ref="uqrcode" canvas-id="qrcode" :value="content" @complete="loading = false"
|
||||
:loading="false"></uqrcode>
|
||||
</view>
|
||||
<uqrcode size="260" ref="uqrcode" canvas-id="qrcode" :value="content"
|
||||
:loading="false"></uqrcode>
|
||||
</Cn-htmlToImg>
|
||||
<view class="transfer-text">
|
||||
<!-- <view>换个样式</view>-->
|
||||
<view @click="save">保存图片</view>
|
||||
</view>
|
||||
</Cn-htmlToImg>
|
||||
<view class="transfer-text">
|
||||
<!-- <view>换个样式</view>-->
|
||||
<view @click="save">保存图片</view>
|
||||
<!-- <view class="transfer-btn">
|
||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||
返回
|
||||
</button>
|
||||
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- <view class="transfer-btn">
|
||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||
返回
|
||||
</button>
|
||||
<button class="transfer-btn-item ml20" @click="home">转移成功</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
// import QRCode from 'qrcodejs2'
|
||||
@@ -71,10 +73,12 @@ export default {
|
||||
this.img = e
|
||||
},
|
||||
save() {
|
||||
if(!this.img){
|
||||
setTimeout(()=>{
|
||||
console.log(this.img)
|
||||
if (!this.img) {
|
||||
setTimeout(() => {
|
||||
this.save()
|
||||
},500)
|
||||
}, 500)
|
||||
return
|
||||
}
|
||||
base64ToPath(this.img).then((res) => {
|
||||
console.log(res)
|
||||
|
||||
Reference in New Issue
Block a user