页面接口推介

This commit is contained in:
仲么了
2023-07-31 09:00:30 +08:00
parent 863d30ee61
commit 77b4ff6f88
30 changed files with 928 additions and 652 deletions

View File

@@ -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>

View File

@@ -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: '移交',