页面接口推介
This commit is contained in:
@@ -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: '移交',
|
||||
|
||||
Reference in New Issue
Block a user