修改 app
This commit is contained in:
@@ -1,80 +1,92 @@
|
||||
<template>
|
||||
<view class='basic'>
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">温度</view>
|
||||
<view class="grid-card-content-4">
|
||||
<template v-for="item in renderData">
|
||||
<view class="item item-title">{{ item[0].clDid }}
|
||||
<template v-if="item[0].clDid "> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title">{{ item[1].clDid }}
|
||||
<template v-if="item[1].clDid "> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title">{{ item[2].clDid }}
|
||||
<template v-if="item[2].clDid "> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title">{{ item[3].clDid }}
|
||||
<template v-if="item[3].clDid "> (°C)</template>
|
||||
</view>
|
||||
<view class="item">{{ item[0].clDid ? item[0].value || '-' : '' }}</view>
|
||||
<view class="item">{{ item[1].clDid ? item[1].value || '-' : '' }}</view>
|
||||
<view class="item">{{ item[2].clDid ? item[2].value || '-' : '' }}</view>
|
||||
<view class="item">{{ item[3].clDid ? item[3].value || '-' : '' }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="grid-card">-->
|
||||
<!-- <view class="grid-card-title">干接点</view>-->
|
||||
<!-- <view class="grid-card-content-4">-->
|
||||
<!-- <view class="item item-title">干接点1</view>-->
|
||||
<!-- <view class="item item-title">干接点2</view>-->
|
||||
<!-- <view class="item item-title"></view>-->
|
||||
<!-- <view class="item item-title"></view>-->
|
||||
<!-- <view class="item">正常</view>-->
|
||||
<!-- <view class="item">正常</view>-->
|
||||
<!-- <view class="item"></view>-->
|
||||
<!-- <view class="item"></view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
<view class="basic">
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">温度</view>
|
||||
<view class="grid-card-content-4">
|
||||
<template v-for="item in renderData">
|
||||
<view class="item item-title"
|
||||
>{{ item[0].clDid }}
|
||||
<template v-if="item[0].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[1].clDid }}
|
||||
<template v-if="item[1].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[2].clDid }}
|
||||
<template v-if="item[2].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item item-title"
|
||||
>{{ item[3].clDid }}
|
||||
<template v-if="item[3].clDid"> (°C)</template>
|
||||
</view>
|
||||
<view class="item">{{ item[0].clDid ? Math.round(item[0].value) || '-' : '' }}</view>
|
||||
<view class="item">{{ item[1].clDid ? Math.round(item[1].value) || '-' : '' }}</view>
|
||||
<view class="item">{{ item[2].clDid ? Math.round(item[2].value) || '-' : '' }}</view>
|
||||
<view class="item">{{ item[3].clDid ? Math.round(item[3].value) || '-' : '' }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="grid-card">-->
|
||||
<!-- <view class="grid-card-title">干接点</view>-->
|
||||
<!-- <view class="grid-card-content-4">-->
|
||||
<!-- <view class="item item-title">干接点1</view>-->
|
||||
<!-- <view class="item item-title">干接点2</view>-->
|
||||
<!-- <view class="item item-title"></view>-->
|
||||
<!-- <view class="item item-title"></view>-->
|
||||
<!-- <view class="item">正常</view>-->
|
||||
<!-- <view class="item">正常</view>-->
|
||||
<!-- <view class="item"></view>-->
|
||||
<!-- <view class="item"></view>-->
|
||||
<!-- </view>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
props: {
|
||||
IOData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
renderData() {
|
||||
let arr = []
|
||||
// 把IOData转换成每4个一组的二维数组
|
||||
for (let i = 0; i < this.IOData.length; i += 4) {
|
||||
arr.push(this.IOData.slice(i, i + 4))
|
||||
}
|
||||
// 把每组的长度补齐到4
|
||||
arr.forEach((item) => {
|
||||
if (item.length < 4) {
|
||||
let length = 4 - item.length
|
||||
for (let i = 0; i < length; i++) {
|
||||
item.push({})
|
||||
}
|
||||
}
|
||||
})
|
||||
console.warn(arr)
|
||||
return arr
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
props: {
|
||||
IOData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
renderData() {
|
||||
let arr = []
|
||||
// 把IOData转换成每4个一组的二维数组
|
||||
for (let i = 0; i < this.IOData.length; i += 4) {
|
||||
this.IOData.slice(i, i + 4).forEach((item) => {
|
||||
|
||||
if (Number.isInteger(item.value) || item.value =='') {
|
||||
|
||||
}else {
|
||||
item.value = (item.value-0).toFixed(4)
|
||||
}
|
||||
})
|
||||
arr.push(this.IOData.slice(i, i + 4))
|
||||
}
|
||||
// 把每组的长度补齐到4
|
||||
arr.forEach((item) => {
|
||||
if (item.length < 4) {
|
||||
let length = 4 - item.length
|
||||
for (let i = 0; i < length; i++) {
|
||||
item.push({})
|
||||
}
|
||||
}
|
||||
})
|
||||
console.warn(arr)
|
||||
return arr
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
<style lang="scss">
|
||||
.basic {
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<view class="item item-title">畸变率(%)</view>
|
||||
<template v-for="(item, index) in renderData.电网电流">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ item['Apf_RmsI_Sys(A)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_ThdA_Sys(%)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_RmsI_Sys(A)'] }}</view>
|
||||
<view class="item">{{ item['Apf_ThdA_Sys(%)'] }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -22,9 +22,9 @@
|
||||
<view class="item item-title">畸变率(%)</view>
|
||||
<template v-for="(item, index) in renderData.电网电压">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ item['Apf_PhV_Sys(V)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_Freq(Hz)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_ThdU_Sys(%)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_PhV_Sys(V)'] }}</view>
|
||||
<view class="item">{{ item['Apf_Freq(Hz)'] }}</view>
|
||||
<view class="item">{{ item['Apf_ThdU_Sys(%)'] }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -36,8 +36,8 @@
|
||||
<view class="item item-title">畸变率(%)</view>
|
||||
<template v-for="(item, index) in renderData.负载电流">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ item['Apf_RmsI_Load(A)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_ThdA_Load(%)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_RmsI_Load(A)'] }}</view>
|
||||
<view class="item">{{ item['Apf_ThdA_Load(%)'] }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -49,8 +49,8 @@
|
||||
<view class="item item-title">负载率(%)</view>
|
||||
<template v-for="(item, index) in renderData.补偿电流">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ item['Apf_RmsI_TolOut(A)'] || '-' }}</view>
|
||||
<view class="item">{{ item['load_Rate'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_RmsI_TolOut(A)'] }}</view>
|
||||
<view class="item">{{ item['load_Rate'] }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -129,11 +129,11 @@ export default {
|
||||
return item2.phase === item.phase
|
||||
})
|
||||
if (index > -1) {
|
||||
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
|
||||
this.renderData[key][index][item.statisticalName] = item.statisticalData //
|
||||
} else {
|
||||
this.renderData[key].push({
|
||||
phase: item.phase,
|
||||
[item.statisticalName]: item.statisticalData || '-',
|
||||
[item.statisticalName]: item.statisticalData //,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,119 +1,117 @@
|
||||
<template>
|
||||
<view class="basic">
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">电网侧</view>
|
||||
<view class="grid-card-content-5">
|
||||
<view class="item item-title">名称</view>
|
||||
<view class="item item-title">有功功率(kw)</view>
|
||||
<view class="item item-title">无功功率(kVar)</view>
|
||||
<view class="item item-title">视在功率(kVA)</view>
|
||||
<view class="item item-title">功率因数</view>
|
||||
<template v-for="(item, index) in renderData.电网侧">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ item['Apf_P_Sys(W)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_Q_Sys(Var)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_S_Sys(VA)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">负载侧</view>
|
||||
<view class="grid-card-content-5">
|
||||
<view class="item item-title">名称</view>
|
||||
<view class="item item-title">有功功率(kw)</view>
|
||||
<view class="item item-title">无功功率(kVar)</view>
|
||||
<view class="item item-title">视在功率(kVA)</view>
|
||||
<view class="item item-title">功率因数</view>
|
||||
<template v-for="(item, index) in renderData.负载侧">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ item['Apf_P_Load(W)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_Q_Load(Var)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_S_Load(VA)'] || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="basic">
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">电网侧</view>
|
||||
<view class="grid-card-content-5">
|
||||
<view class="item item-title">名称</view>
|
||||
<view class="item item-title">有功功率(kw)</view>
|
||||
<view class="item item-title">无功功率(kVar)</view>
|
||||
<view class="item item-title">视在功率(kVA)</view>
|
||||
<view class="item item-title">功率因数</view>
|
||||
<template v-for="(item, index) in renderData.电网侧">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ (item['Apf_P_Sys(W)'] / 1000).toFixed(4) || '-' }}</view>
|
||||
<view class="item">{{ (item['Apf_Q_Sys(Var)'] / 1000).toFixed(4) || '-' }}</view>
|
||||
<view class="item">{{ (item['Apf_S_Sys(VA)'] / 1000).toFixed(4) || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_PF_Sys(null)'] || '-' }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-card">
|
||||
<view class="grid-card-title">负载侧</view>
|
||||
<view class="grid-card-content-5">
|
||||
<view class="item item-title">名称</view>
|
||||
<view class="item item-title">有功功率(kw)</view>
|
||||
<view class="item item-title">无功功率(kVar)</view>
|
||||
<view class="item item-title">视在功率(kVA)</view>
|
||||
<view class="item item-title">功率因数</view>
|
||||
<template v-for="(item, index) in renderData.负载侧">
|
||||
<view class="item">{{ item.phase }}</view>
|
||||
<view class="item">{{ (item['Apf_P_Load(W)'] / 1000).toFixed(4) || '-' }}</view>
|
||||
<view class="item">{{ (item['Apf_Q_Load(Var)'] / 1000).toFixed(4) || '-' }}</view>
|
||||
<view class="item">{{ (item['Apf_S_Load(VA)'] / 1000).toFixed(4) || '-' }}</view>
|
||||
<view class="item">{{ item['Apf_PF_Load(null)'] || '-' }}</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
renderData: {
|
||||
电网侧: [],
|
||||
负载侧: [],
|
||||
未知: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
basicData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
basicData: {
|
||||
handler: function (newVal, oldVal) {
|
||||
data() {
|
||||
return {
|
||||
renderData: {
|
||||
电网侧: [],
|
||||
负载侧: [],
|
||||
未知: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
basicData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
basicData: {
|
||||
handler: function (newVal, oldVal) {
|
||||
newVal.forEach((item) => {
|
||||
if (item.phase === 'avg') {
|
||||
return
|
||||
}
|
||||
let key = ''
|
||||
switch (item.statisticalName) {
|
||||
case 'Apf_P_Sys(W)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_Q_Sys(Var)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_S_Sys(VA)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_PF_Sys(null)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_P_Load(W)':
|
||||
key = '负载侧'
|
||||
break
|
||||
case 'Apf_Q_Load(Var)':
|
||||
key = '负载侧'
|
||||
break
|
||||
case 'Apf_S_Load(VA)':
|
||||
key = '负载侧'
|
||||
break
|
||||
case 'Apf_PF_Load(null)':
|
||||
key = '负载侧'
|
||||
break
|
||||
default:
|
||||
key = '未知'
|
||||
break
|
||||
}
|
||||
|
||||
newVal.forEach(item => {
|
||||
if (item.phase === 'avg') {
|
||||
return
|
||||
}
|
||||
let key = ''
|
||||
switch (item.statisticalName) {
|
||||
case 'Apf_P_Sys(W)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_Q_Sys(Var)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_S_Sys(VA)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_PF_Sys(null)':
|
||||
key = '电网侧'
|
||||
break
|
||||
case 'Apf_P_Load(W)':
|
||||
key = '负载侧'
|
||||
break
|
||||
case 'Apf_Q_Load(Var)':
|
||||
key = '负载侧'
|
||||
break
|
||||
case 'Apf_S_Load(VA)':
|
||||
key = '负载侧'
|
||||
break
|
||||
case 'Apf_PF_Load(null)':
|
||||
key = '负载侧'
|
||||
break
|
||||
default:
|
||||
key = '未知'
|
||||
break
|
||||
}
|
||||
|
||||
let index = this.renderData[key].findIndex((item2) => {
|
||||
return item2.phase === item.phase
|
||||
})
|
||||
if (index > -1) {
|
||||
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
|
||||
} else {
|
||||
this.renderData[key].push({
|
||||
phase: item.phase,
|
||||
[item.statisticalName]: item.statisticalData || '-',
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(this.renderData)
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
|
||||
},
|
||||
methods: {},
|
||||
let index = this.renderData[key].findIndex((item2) => {
|
||||
return item2.phase === item.phase
|
||||
})
|
||||
if (index > -1) {
|
||||
this.renderData[key][index][item.statisticalName] = item.statisticalData || '-'
|
||||
} else {
|
||||
this.renderData[key].push({
|
||||
phase: item.phase,
|
||||
[item.statisticalName]: item.statisticalData || '-',
|
||||
})
|
||||
}
|
||||
})
|
||||
console.log(this.renderData)
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
></uni-data-select>
|
||||
</div>
|
||||
<view class="charts-box">
|
||||
<view class="data-time">{{ time }}</view>
|
||||
<!-- <view class="data-time">{{ time }}</view> -->
|
||||
<qiun-data-charts type="bar" :ontouch="true" :opts="opts" :chartData="chartData" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
default: () => [],
|
||||
},
|
||||
dataTime: {
|
||||
type: String,
|
||||
type: [String,Number],
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
@@ -103,8 +103,8 @@ export default {
|
||||
meterFillColor: '#FFFFFF',
|
||||
activeBgColor: '#000000',
|
||||
activeBgOpacity: 0.08,
|
||||
seriesGap: 2,
|
||||
categoryGap: 6,
|
||||
seriesGap: 1,
|
||||
categoryGap: 4,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -163,11 +163,11 @@ export default {
|
||||
let dataOptions = []
|
||||
let type = [
|
||||
{
|
||||
name: '电网谐波电流幅值序列',
|
||||
name: '谐波电流幅值序列',
|
||||
key: 'Apf_HarmI',
|
||||
},
|
||||
{
|
||||
name: '负载谐波电压含有率序列',
|
||||
name: '谐波电压含有率序列',
|
||||
key: 'Apf_HarmUR',
|
||||
},
|
||||
]
|
||||
@@ -183,7 +183,6 @@ export default {
|
||||
this.dataOptions = dataOptions
|
||||
console.log(dataOptions)
|
||||
this.initEcharts()
|
||||
console.log(this.dataTime)
|
||||
this.time = this.$util.parseTime(this.dataTime - 8 * 60 * 60)
|
||||
},
|
||||
deep: true,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,7 @@ import ShuChu from "./comp/shuChu.vue";
|
||||
import GanJieDian from "./comp/ganJieDian.vue";
|
||||
import ZhuangTaiLiang from "./comp/zhuangTaiLiang.vue";
|
||||
import QiTa from "./comp/qiTa.vue";
|
||||
import { manualAccess } from '@/common/api/accessBoot'
|
||||
export default {
|
||||
components: {
|
||||
DianWang,
|
||||
@@ -53,6 +54,7 @@ export default {
|
||||
loading: false,
|
||||
navMenuActive: 0,
|
||||
navHeight: 0,
|
||||
pageOptions:{},
|
||||
navMenuList: [{
|
||||
text: '电网数据'
|
||||
}, {
|
||||
@@ -76,6 +78,10 @@ export default {
|
||||
iconPath: '/static/about.png',
|
||||
text: '关于',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/access.png',
|
||||
text: '接入',
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -110,6 +116,10 @@ export default {
|
||||
uni.navigateTo({ url: '/pages/device/feedback' })
|
||||
} else if (e.item.text === '用户') {
|
||||
uni.navigateTo({ url: '/pages/device/user' })
|
||||
}else if (e.item.text === '接入') {
|
||||
manualAccess({nDid:this.pageOptions.ndid}).then((res) => {
|
||||
this.$util.toast(res.message)
|
||||
})
|
||||
}
|
||||
this.$refs.fab.close()
|
||||
},
|
||||
@@ -164,6 +174,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad (options) {
|
||||
this.pageOptions = options
|
||||
this.init()
|
||||
},
|
||||
|
||||
|
||||
@@ -368,11 +368,12 @@ export default {
|
||||
this.navMenuActive = index
|
||||
},
|
||||
jump(item) {
|
||||
console.log(12321,item);
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser,
|
||||
url: '/pages/device/APF/detail?id=' + item.equipmentId + '&isPrimaryUser=' + item.isPrimaryUser + '&ndid=' + item.ndid,
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
<style lang="scss"></style>
|
||||
1050
pages/device/new.vue
1050
pages/device/new.vue
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,47 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" beforeRender>
|
||||
<view slot="body">
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" size="200"
|
||||
@complete="complete"
|
||||
:loading="false"></uqrcode>
|
||||
<view style="height: 200rpx"></view>
|
||||
<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 ml20" @click="scan">扫一扫</button>
|
||||
<view>
|
||||
<Cn-page :loading="loading" beforeRender>
|
||||
<view slot="body">
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
||||
<uqrcode
|
||||
ref="uqrcode"
|
||||
canvas-id="qrcode"
|
||||
:value="content"
|
||||
size="200"
|
||||
@complete="complete"
|
||||
:loading="false"
|
||||
></uqrcode>
|
||||
<view style="height: 200rpx"></view>
|
||||
<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 ml20" @click="scan">扫一扫</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</Cn-page>
|
||||
<uni-popup ref="alertDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
type="info"
|
||||
cancelText="禁止"
|
||||
confirmText="允许"
|
||||
title="权限说明"
|
||||
content='是否允许"灿能物联"使用相机?'
|
||||
@confirm="handleScon"
|
||||
@close="dialogClose"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import QRCode from 'qrcodejs2'
|
||||
// import UQRCode from '@/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js';
|
||||
|
||||
import {transferDevice} from "@/common/api/device";
|
||||
import { transferDevice } from '@/common/api/device'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -38,10 +56,10 @@ export default {
|
||||
this.loading = false
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack({delta: 1})
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
home() {
|
||||
uni.navigateBack({delta: 1})
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
transferDevice(userId) {
|
||||
transferDevice(this.options.id, userId).then((res) => {
|
||||
@@ -53,6 +71,18 @@ export default {
|
||||
})
|
||||
},
|
||||
scan() {
|
||||
if (
|
||||
plus.os.name == 'Android' &&
|
||||
plus.navigator.checkPermission('android.permission.CAMERA') === 'undetermined'
|
||||
) {
|
||||
//未授权
|
||||
|
||||
this.$refs.alertDialog.open()
|
||||
} else {
|
||||
this.handleScon()
|
||||
}
|
||||
},
|
||||
handleScon() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
@@ -68,6 +98,7 @@ export default {
|
||||
},
|
||||
})
|
||||
},
|
||||
dialogClose() {},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.options = options
|
||||
|
||||
Reference in New Issue
Block a user