页面接口推介
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='about'>
|
||||
<view class='about-title'>盛弘APF</view>
|
||||
<view class='about-title'>灿能APF</view>
|
||||
<view class='about-text'>杋器码:0000000</view>
|
||||
<view class='about-text'>软件版本:1.0.0</view>
|
||||
<view class='about-text'>使用期限:永久使用</view>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<view class="detail-header">
|
||||
<Cn-htmlToImg domId="header" @renderFinish="renderFinish">
|
||||
<view class="header" ref="header" @click="previewImg">
|
||||
<image :src="deviceInfo.filePath" style="width: 375px" mode="widthFix" />
|
||||
<img :src="deviceInfo.filePath" style="width: 375px" mode="widthFix" />
|
||||
<view
|
||||
class="point"
|
||||
:style="{ left: item.lat + 'px', top: item.lng + 'px' }"
|
||||
@@ -94,6 +94,10 @@
|
||||
:content="content"
|
||||
@trigger="trigger"
|
||||
/>
|
||||
<uni-popup ref="share" type="share" :safe-area="false">
|
||||
<uni-popup-share title="分享到" ></uni-popup-share>
|
||||
<view style="height: 40rpx;background: #fff;"></view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
@@ -104,10 +108,10 @@ import xieBo from './comp/xieBo.vue'
|
||||
import power from './comp/power.vue'
|
||||
import oscillogram from './comp/oscillogram.vue'
|
||||
import IO from './comp/IO.vue'
|
||||
import { queryTopologyDiagram } from '@/common/api/device'
|
||||
import { queryTopologyDiagram, deleteDevice } from '@/common/api/device'
|
||||
import { MQTT_IP, MQTT_OPTIONS } from '@/common/js/mqtt.js'
|
||||
import mqtt from 'mqtt/dist/mqtt.js'
|
||||
|
||||
import { base64ToPath } from 'image-tools'
|
||||
export default {
|
||||
components: {
|
||||
basic,
|
||||
@@ -158,7 +162,7 @@ export default {
|
||||
timer: null,
|
||||
devId: '',
|
||||
dictData: [],
|
||||
isMaster: 0,
|
||||
isPrimaryUser: 0,
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
@@ -185,9 +189,18 @@ export default {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定删除该设备吗?',
|
||||
success: function (res) {
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
deleteDevice(this.devId).then((res) => {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none',
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
@@ -248,10 +261,7 @@ export default {
|
||||
iconPath: '/static/delate.png',
|
||||
text: '报表',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/table.png',
|
||||
text: '删除',
|
||||
},
|
||||
|
||||
{
|
||||
iconPath: '/static/feedback.png',
|
||||
text: '反馈',
|
||||
@@ -290,8 +300,11 @@ export default {
|
||||
}, 500)
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.previewImage({
|
||||
urls: [this.img],
|
||||
base64ToPath(this.img).then((res) => {
|
||||
console.log(res)
|
||||
uni.previewImage({
|
||||
urls: [res],
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -328,7 +341,7 @@ export default {
|
||||
console.log('连接断开')
|
||||
})
|
||||
.on('message', (topic, message) => {
|
||||
console.log('接收推送信息:', message.toString())
|
||||
console.log('接收推送信息:', message.toString().length)
|
||||
if (!message.toString()) {
|
||||
return
|
||||
}
|
||||
@@ -369,12 +382,12 @@ export default {
|
||||
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: '移交',
|
||||
this.isPrimaryUser = options.isPrimaryUser
|
||||
if (this.isPrimaryUser == 1) {
|
||||
this.content.splice(0, 0, {
|
||||
iconPath: '/static/delate.png',
|
||||
text: '删除',
|
||||
})
|
||||
if (this.isMaster == 1) {
|
||||
this.content.splice(0, 0, {
|
||||
iconPath: '/static/transfer.png',
|
||||
text: '移交',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<uni-forms>
|
||||
<uni-forms-item label="设备识别码">
|
||||
<view style="display: flex">
|
||||
<uni-easyinput type="number" v-model="formData.nDid" placeholder="请输入设备识别码" />
|
||||
<uni-easyinput type="text" v-model="formData.nDid" placeholder="请输入设备识别码" />
|
||||
<uni-icons
|
||||
type="camera"
|
||||
color="#007aff"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view slot="body">
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="devId" :options="{ margin: 10 }"></uqrcode>
|
||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode>
|
||||
<canvas id="qrcode" width="200" height="200"></canvas>
|
||||
<view class="transfer-text">请让接收人员扫码接收</view>
|
||||
<view class="transfer-btn">
|
||||
@@ -24,23 +24,22 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
devId: '',
|
||||
content: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
this.$util.refreshPrePage(2)
|
||||
},
|
||||
home() {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
this.$util.refreshPrePage(2)
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.devId = options.id
|
||||
this.content = JSON.stringify({
|
||||
type: 'transferDevice',
|
||||
id: options.id,
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user