二维码生成

This commit is contained in:
仲么了
2023-07-24 15:00:19 +08:00
parent 689436759f
commit 863d30ee61
40 changed files with 6103 additions and 35 deletions

View File

@@ -158,6 +158,8 @@ export default {
timer: null,
devId: '',
dictData: [],
isMaster: 0,
userInfo: {},
}
},
computed: {
@@ -200,7 +202,7 @@ export default {
} else if (e.item.text === '关于') {
uni.navigateTo({ url: '/pages/device/APF/about' })
} else if (e.item.text === '移交') {
uni.navigateTo({ url: '/pages/device/transfer' })
uni.navigateTo({ url: '/pages/device/transfer?id=' + this.devId })
} else if (e.item.text === '反馈') {
uni.navigateTo({ url: '/pages/device/feedback' })
} else if (e.item.text === '用户') {
@@ -219,9 +221,7 @@ export default {
uni.pageScrollTo({ scrollTop: 0, duration: 0 })
},
init() {
let userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
console.log(userInfo.authorities)
switch (userInfo.authorities) {
switch (this.userInfo.authorities) {
case 1:
this.content.splice(0, 1)
this.content.splice(
@@ -240,12 +240,6 @@ export default {
case 2:
this.content.splice(0, 1)
break
case 3:
this.content.splice(0, 0, {
iconPath: '/static/transfer.png',
text: '移交',
})
break
case 4:
this.content.splice(
1,
@@ -317,6 +311,7 @@ export default {
console.log(`订阅成功:/zl/devData/${this.devId}`)
this.client.publish(`/zl/askDevData/${this.devId}`)
this.timer = setInterval(() => {
console.log('askDevData')
this.client.publish(`/zl/askDevData/${this.devId}`)
}, 10000)
}
@@ -334,6 +329,9 @@ export default {
})
.on('message', (topic, message) => {
console.log('接收推送信息:', message.toString())
if (!message.toString()) {
return
}
this.loading = false
let dataList = []
this.deviceInfo.appsLineTopologyDiagramPO.forEach((element) => {
@@ -368,11 +366,30 @@ export default {
},
onLoad(options) {
this.dictData = uni.getStorageSync(this.$cacheKey.dictData)
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
this.devId = options.id
this.isMaster = options.isMaster
this.content.splice(0, 0, {
iconPath: '/static/transfer.png',
text: '移交',
})
if (this.isMaster == 1) {
this.content.splice(0, 0, {
iconPath: '/static/transfer.png',
text: '移交',
})
if (this.userInfo.authorities !== 'engineering_user') {
this.content.splice(0, 0, {
iconPath: '/static/share.png',
text: '分享',
})
}
}
this.init()
queryTopologyDiagram(options.id).then((res) => {
this.deviceInfo = res.data
console.log(this.dictData);
console.log(this.dictData)
this.dictData.forEach((item) => {
if (item.code == 'Line_Position') {
item.children.forEach((item2) => {

View File

@@ -1,11 +1,15 @@
<template>
<Cn-page :loading='loading'>
<view slot='body'>
<view class='transfer'>
<image class="transfer-img" src="/static/transfer.png" mode="scaleToFill" />
<Cn-page :loading="loading">
<view slot="body">
<view class="transfer">
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="devId" :options="{ margin: 10 }"></uqrcode>
<canvas id="qrcode" width="200" height="200"></canvas>
<view class="transfer-text">请让接收人员扫码接收</view>
<view class="transfer-btn">
<button class="transfer-btn-item" style="background-color:#fff;color:#111" @click="back">返回</button>
<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>
@@ -13,27 +17,34 @@
</Cn-page>
</template>
<script>
// import QRCode from 'qrcodejs2'
// import UQRCode from '@/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js';
export default {
data () {
data() {
return {
loading: false
loading: false,
devId: '',
}
},
methods: {
back () {
back() {
uni.navigateBack({
delta: 1
delta: 1,
})
},
home () {
home() {
uni.switchTab({
url: '/pages/index/index'
url: '/pages/index/index',
})
}
}
},
},
onLoad(options) {
this.devId = options.id
},
}
</script>
<style lang='scss'>
<style lang="scss">
.transfer {
padding: 200rpx 34rpx 0;
display: flex;
@@ -41,9 +52,6 @@ export default {
align-items: center;
.transfer-img {
width: 500rpx;
height: 500rpx;
background: $uni-theme-blue ;
}
.transfer-text {
@@ -72,4 +80,4 @@ export default {
}
}
}
</style>
</style>