6155部分功能提交
This commit is contained in:
93
pages/6155/ImgCrop.vue
Normal file
93
pages/6155/ImgCrop.vue
Normal file
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<canvas canvas-id="splashCanvas"
|
||||
style="width: 160px; height: 80px; z-index: 9999;position: fixed; visibility: visible;top: 0px;left:0px;"
|
||||
|
||||
</canvas>
|
||||
|
||||
<qf-image-cropper :src="src" :showAngle="false" :width="1600" :height="800" fileType="jpg"
|
||||
@crop="handleCrop" :gpu="true">
|
||||
</qf-image-cropper>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue';
|
||||
export default {
|
||||
components: {
|
||||
QfImageCropper
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
src:"",
|
||||
Statu: false
|
||||
|
||||
}
|
||||
},
|
||||
onLoad:function(option){
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
var these=this;
|
||||
eventChannel.on('checkImg', function(data) {
|
||||
console.log("我收到你的消息了,消息内容是:"+JSON.stringify(data));
|
||||
these.src=data.data;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleCrop(e) {
|
||||
var these=this;
|
||||
this.Statu = true;
|
||||
console.log("裁剪完成");
|
||||
console.log(e.tempFilePath);
|
||||
|
||||
|
||||
const ctx = uni.createCanvasContext('splashCanvas', these);
|
||||
console.log("1111111");
|
||||
// 绘制图片到canvas
|
||||
ctx.drawImage(e.tempFilePath, 0, 0, 160, 80);
|
||||
console.log("22222");
|
||||
ctx.draw(false, () => {
|
||||
// 获取canvas像素数据
|
||||
console.log("444444");
|
||||
setTimeout(() => {
|
||||
uni.canvasGetImageData({
|
||||
canvasId: 'splashCanvas',
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 160,
|
||||
height: 80,
|
||||
success: (res) => {
|
||||
// 处理像素数据并发送
|
||||
console.log("res.data.length="+res.data.length);
|
||||
// this.processAndSendImageData(res.data).then(
|
||||
// resolve).catch(reject);
|
||||
const eventChannel = these.getOpenerEventChannel();
|
||||
eventChannel.emit('ImgCutOver',res.data);
|
||||
uni.navigateBack();
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(`获取canvas数据失败: ${err.errMsg}`);
|
||||
}
|
||||
});
|
||||
}, 500); // 等待canvas绘制完成
|
||||
});
|
||||
|
||||
console.log("333333");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.canvas {
|
||||
width: 1600px;
|
||||
height: 800px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
@ -1,257 +0,0 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<custom-navbar :showBack="true"></custom-navbar>
|
||||
<view class="pageContent" :style="{ paddingTop: navBarHeight + 'px' }">
|
||||
<view class="scanner">
|
||||
<view class="pulse"></view>
|
||||
<view class="device-name">
|
||||
<!-- <image src="/static/images/svgg.png" class="bluth"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="device">我的设备</view>
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
||||
<!-- 设备卡片内容保持不变 -->
|
||||
<view @click.stop="handleFile(item)" class="device-card">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<!-- <image src="/static/images/bip.png" mode="" class="IMG"></image> -->
|
||||
</view>
|
||||
<view class="device-name1">
|
||||
<view>设备:001-00</view>
|
||||
<view class="ID">
|
||||
<view>ID:0222222</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<view class="device">其他设备</view>
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<block v-for="(item, index) in 3" :key="index" :ref="'swipeItem_' + index">
|
||||
<!-- 设备卡片内容保持不变 -->
|
||||
<view @click.stop="handleFile(item)" class="device-card">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<!-- <image src="/static/images/bip.png" mode="" class="IMG"></image> -->
|
||||
</view>
|
||||
<view class="device-name1">
|
||||
<view>设备:001-00</view>
|
||||
<view class="ID">
|
||||
<view>ID:0222222</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 这里可以添加数据绑定
|
||||
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
||||
deviceList:[{}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 扫描
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pageContent {
|
||||
min-height: 100vh;
|
||||
background-color: rgb(18, 18, 18);
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.scanner {
|
||||
position: relative;
|
||||
width: 600rpx;
|
||||
height: 600rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 设备名称 */
|
||||
.device-name {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
background: rgba(187, 230, 0, 1);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.bluth {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
/* 脉冲波纹效果 */
|
||||
.pulse {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(206, 242, 49, 0.05);
|
||||
background: rgba(206, 242, 49, 0.05);
|
||||
animation: pulse 4s infinite cubic-bezier(0.2, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
/* 通过伪元素创建4层波纹 */
|
||||
.pulse::before,
|
||||
.pulse::after,
|
||||
.pulse .ripple-1,
|
||||
.pulse .ripple-2 {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border-radius: 50%;
|
||||
background: rgba(187, 230, 0, 0.4);
|
||||
border: 1px solid rgba(206, 242, 49, 0.04);
|
||||
animation: inherit;
|
||||
}
|
||||
|
||||
.pulse::before {
|
||||
animation-delay: 1s;
|
||||
}
|
||||
|
||||
.pulse::after {
|
||||
animation-delay: 2s;
|
||||
}
|
||||
|
||||
.pulse .ripple-1 {
|
||||
animation-delay: 0.5s;
|
||||
}
|
||||
|
||||
.pulse .ripple-2 {
|
||||
animation-delay: 1.5s;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
transform: scale(0.1);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
70% {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.device {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 设备卡片 */
|
||||
.device-card {
|
||||
background-color: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.device-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15rpx;
|
||||
padding: 30rpx 0 10rpx 30rpx;
|
||||
}
|
||||
|
||||
.device-name1 {
|
||||
font-size: 32rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
margin-left:40rpx;
|
||||
line-height: 50rpx;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.ID {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
|
||||
.device-status {
|
||||
width: 122rpx;
|
||||
height: 52rpx;
|
||||
font-size: 26rpx;
|
||||
border-radius: 0px 8px 0px 8px;
|
||||
background-color: rgb(42, 42, 42);
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
text-align: center;
|
||||
line-height: 52rpx;
|
||||
}
|
||||
|
||||
.circle {
|
||||
width:8rpx;
|
||||
height: 40rpx;
|
||||
position: absolute;
|
||||
right:25rpx;
|
||||
top:85rpx;
|
||||
}
|
||||
|
||||
.online {
|
||||
color: rgb(187, 230, 0);
|
||||
}
|
||||
|
||||
.device-id {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.device-info {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
position: relative;
|
||||
padding: 0rpx 0rpx 30rpx 30rpx;
|
||||
}
|
||||
|
||||
.deviceIMG {
|
||||
/* width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
background-color: rgba(42, 42, 42, 0.6);
|
||||
display: flex;
|
||||
align-items: center; */
|
||||
}
|
||||
|
||||
.IMG {
|
||||
width:38rpx;
|
||||
height: 80rpx;
|
||||
margin-left: 17%;
|
||||
}
|
||||
</style>
|
1334
pages/6155/deviceDetail.vue
Normal file
1334
pages/6155/deviceDetail.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,9 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>6155</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
</script>
|
Reference in New Issue
Block a user