1111
|
|
@ -4,7 +4,7 @@
|
|||
<view class="drawer-content" @touchstart.passive="onTouchStart" @touchmove.passive="onTouchMove"
|
||||
@touchend="onTouchEnd" @touchcancel="onTouchEnd">
|
||||
<!-- 抽屉中间的半圆 -->
|
||||
<view class="drawer-content-circle" :style="isVisible?{}:{background:`linear-gradient(to bottom,#62E8FF,#0097FF)`}" @click="whiteDrawer">
|
||||
<view class="drawer-content-circle" :class="circletarget?`pulse`:``" :style="isVisible?{}:{background:`linear-gradient(to bottom,#62E8FF,#0097FF)`}" @click="whiteDrawer">
|
||||
<image class="drawer-img" :src="isVisible?'/static/index/watch/whitearrow.png':'/static/index/watch/arrow.png' " />
|
||||
</view>
|
||||
<slot />
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ref,
|
||||
defineProps,
|
||||
|
|
@ -23,12 +23,20 @@
|
|||
|
||||
// 控制抽屉显示隐藏
|
||||
const isVisible = ref(false)
|
||||
// 定义 emit 事件
|
||||
const emit = defineEmits<{
|
||||
(e: 'open'): void
|
||||
}>()
|
||||
|
||||
// 接收父组件传入的宽度百分比
|
||||
const props = defineProps({
|
||||
widNumber: {
|
||||
type: Number,
|
||||
default: 25
|
||||
},
|
||||
circletarget:{
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -66,6 +74,9 @@
|
|||
// 打开/关闭
|
||||
function openDrawer() {
|
||||
isVisible.value = true
|
||||
// const optionSub = uni.getSubNVueById('optionSub')
|
||||
// optionSub.show('fade-in')
|
||||
emit('open')
|
||||
}
|
||||
|
||||
function closeDrawer() {
|
||||
|
|
@ -74,7 +85,12 @@
|
|||
|
||||
function whiteDrawer() {
|
||||
// 点击半圆:切换 & 旋转
|
||||
isVisible.value = !isVisible.value
|
||||
if(isVisible.value){
|
||||
closeDrawer()
|
||||
}else{
|
||||
openDrawer()
|
||||
}
|
||||
// isVisible.value = !isVisible.value
|
||||
rotate180()
|
||||
}
|
||||
|
||||
|
|
@ -169,4 +185,40 @@
|
|||
margin-left: 25rpx;
|
||||
// transform: rotate(180deg);
|
||||
}
|
||||
.target {
|
||||
--color: #99C9FD;
|
||||
--thick: 2px;
|
||||
--radius: 150rpx;
|
||||
--outline-offset: 5rpx;
|
||||
/* 外扩多少 */
|
||||
|
||||
/* 内层虚线(你现在用的) */
|
||||
border-radius: var(--radius);
|
||||
background-color: #ddf0ff;
|
||||
/* 内部背景 */
|
||||
animation: scalePulse 360ms cubic-bezier(.2, .8, .2, 1);
|
||||
/* 外层虚线:放在 outline(不会影响元素尺寸) */
|
||||
outline: var(--thick) dashed var(--color);
|
||||
outline-offset: var(--outline-offset);
|
||||
|
||||
/* 保证文本 / 子元素在最上层 */
|
||||
// position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.pulse{
|
||||
/* 可调参数 */
|
||||
--scale: 1.2;
|
||||
--dur: 0.8s;
|
||||
|
||||
animation: pulse var(--dur) ease-in-out infinite;
|
||||
transform-origin: center center;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* 放大到一定值再回到原始(平滑) */
|
||||
@keyframes pulse{
|
||||
0% { transform: scale(1); }
|
||||
50% { transform: scale(var(--scale)); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
"name" : "护理单元",
|
||||
"appid" : "__UNI__FB2D473",
|
||||
"description" : "护理单元",
|
||||
"versionName" : "1.5.4",
|
||||
"versionCode" : 154,
|
||||
"versionName" : "1.5.6",
|
||||
"versionCode" : 156,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
},
|
||||
{
|
||||
"type": "component",
|
||||
"name": "myText",
|
||||
"class": "com.cn.plugin_module.TestText"
|
||||
"name": "MonitorControlView",
|
||||
"class": "com.cn.plugin_module.PTZMotorJoyStickView"
|
||||
},
|
||||
{
|
||||
"type": "component",
|
||||
|
|
|
|||
57
pages.json
|
|
@ -8,7 +8,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 测试
|
||||
{
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
"style": {
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 测试
|
||||
{
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
"style": {
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
|
|
@ -41,13 +41,38 @@
|
|||
}
|
||||
|
||||
},
|
||||
// 监控
|
||||
{
|
||||
"path": "pages/watch/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
"navigationStyle": "custom",
|
||||
"app-plus": {
|
||||
"subNVues": [{
|
||||
"id": "monitorSub",
|
||||
"path": "pages/camera",
|
||||
"style": {
|
||||
"position": "absolute",
|
||||
"left": "250px",
|
||||
"top": "120px",
|
||||
"width": "600px",
|
||||
"height": "450px",
|
||||
"background": "transparent"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "optionSub",
|
||||
"path": "pages/option",
|
||||
"style": {
|
||||
"position": "absolute",
|
||||
"right": "110px",
|
||||
"bottom": "0px",
|
||||
"width": "170px",
|
||||
"height": "170px",
|
||||
"background": "transparent"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
// 设置
|
||||
{
|
||||
|
|
@ -55,7 +80,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 手动录入
|
||||
{
|
||||
|
|
@ -63,7 +88,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 扫码添加
|
||||
{
|
||||
|
|
@ -71,7 +96,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 雷达
|
||||
{
|
||||
|
|
@ -79,14 +104,14 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
{
|
||||
"path": "pages/NursingNew/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 仓储
|
||||
{
|
||||
|
|
@ -94,7 +119,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
//初始化
|
||||
{
|
||||
|
|
@ -102,7 +127,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 服务考核
|
||||
{
|
||||
|
|
@ -110,9 +135,9 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
// 护理表格预览
|
||||
{
|
||||
"path": "pages/timeMatrix/index",
|
||||
|
|
@ -126,7 +151,7 @@
|
|||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// {
|
||||
// "path": "pages/somethingmove/index",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,432 @@
|
|||
<template>
|
||||
<div class="center-column">
|
||||
<!-- 视频播放组件 -->
|
||||
<MonitorView
|
||||
ref="monitor"
|
||||
init="5"
|
||||
style="width: 600px;height: 450px;"
|
||||
@onTel="handleTelEvent"
|
||||
@onSnapShot="handleSnapShotEvent"
|
||||
@onRecord="handleRecordEvent"
|
||||
@onTalkStatus="handleTalkEvent"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false,
|
||||
isRecording: false, // 录屏状态
|
||||
isTalking: false, // 对讲状态
|
||||
// 内部 pending 请求队列,用于在 native 事件到达时把结果返回给特定 reqId
|
||||
// 结构: { snapshot: [reqId,...], record: [reqId,...], talk: [reqId,...] }
|
||||
// 注意:这仅用于在 native 事件没有直接 callback 时仍能把结果回传给请求方。
|
||||
_pendingRequests: {
|
||||
snapshot: [],
|
||||
record: [],
|
||||
talk: []
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// 保留你的 globalEvent 监听
|
||||
const globalEvent = uni.requireNativePlugin && uni.requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
console.log("myEvent", e);
|
||||
});
|
||||
}
|
||||
|
||||
// 在页面生命周期注册 uni.$on 事件,暴露给其他页面调用
|
||||
uni.$on('monitor:doSnapshot', this.doSnapshot);
|
||||
uni.$on('monitor:startRecord', this.doStartRecord);
|
||||
uni.$on('monitor:stopRecord', this.doStopRecord);
|
||||
uni.$on('monitor:openTalk', this.doOpenTalk);
|
||||
uni.$on('monitor:stopTalk', this.doStopTalk);
|
||||
|
||||
uni.$on('monitor:switchDisplay', (payload) => this.switchDisplay(payload));
|
||||
uni.$on('monitor:startAlarm', this.startAlarm);
|
||||
uni.$on('monitor:stopAlarm', this.stopAlarm);
|
||||
uni.$on('monitor:flipImage', (payload) => this.flipImage(payload));
|
||||
uni.$on('monitor:resumeOrPause', this.resumeOrPause);
|
||||
uni.$on('monitor:changeQuality', this.changeQuality);
|
||||
uni.$on('monitor:test', this.test);
|
||||
},
|
||||
onUnload() {
|
||||
// 页面卸载时一定要解绑
|
||||
uni.$off('monitor:doSnapshot', this.doSnapshot);
|
||||
uni.$off('monitor:startRecord', this.doStartRecord);
|
||||
uni.$off('monitor:stopRecord', this.doStopRecord);
|
||||
uni.$off('monitor:openTalk', this.doOpenTalk);
|
||||
uni.$off('monitor:stopTalk', this.doStopTalk);
|
||||
|
||||
uni.$off('monitor:switchDisplay', (payload) => this.switchDisplay(payload));
|
||||
uni.$off('monitor:startAlarm', this.startAlarm);
|
||||
uni.$off('monitor:stopAlarm', this.stopAlarm);
|
||||
uni.$off('monitor:flipImage', (payload) => this.flipImage(payload));
|
||||
uni.$off('monitor:resumeOrPause', this.resumeOrPause);
|
||||
uni.$off('monitor:changeQuality', this.changeQuality);
|
||||
uni.$off('monitor:test', this.test);
|
||||
},
|
||||
methods: {
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
console.log("Tel event detail:", event.detail);
|
||||
// 如果需要解析电话事件,在这里处理
|
||||
},
|
||||
|
||||
switchDisplay(mode) {
|
||||
console.log("zzzzz",mode)
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
console.log("startAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
stopAlarm() {
|
||||
this.isAlarming = false;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
console.log("stopAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
console.log("flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
|
||||
test() {
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法(支持 payload.reqId) ------------------ */
|
||||
|
||||
// 1. 截图(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doSnapshot(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({ title: "组件不支持 snapShot()", icon: "none" });
|
||||
// 直接给请求方回错
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'snapShot_not_supported' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果 caller 传了 reqId,就把 reqId 放入 pending(以备 native 事件回调时匹配)
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.snapshot.push(payload.reqId);
|
||||
}
|
||||
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
// 这个 callback 优先使用,直接回传结果给请求方(如果有)
|
||||
console.log("snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res, payload.reqId);
|
||||
});
|
||||
uni.showToast({ title: "正在截屏...", icon: "none", duration: 800 });
|
||||
} catch (err) {
|
||||
console.error("snapShot 调用失败", err);
|
||||
uni.showToast({ title: "snapShot 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'snapShot_call_failed', detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 2. 开始录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStartRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({ title: "组件不支持 startRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'startRecord_not_supported' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
console.log("startRecord callback:", res);
|
||||
// 有些实现会在 start 的 callback 里返回启动结果;如果 caller 传了 reqId 则回传
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({ title: "录屏已开始", icon: "none" });
|
||||
} catch (err) {
|
||||
console.error("startRecord 调用失败", err);
|
||||
uni.showToast({ title: "startRecord 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'startRecord_call_failed', detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 3. 停止录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({ title: "组件不支持 stopRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'stopRecord_not_supported' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 记录 pending(以便 native 的 onRecord 事件回传可匹配)
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.record.push(payload.reqId);
|
||||
}
|
||||
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
console.log("stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res, payload.reqId);
|
||||
});
|
||||
// 状态会在回调或事件里最终设置
|
||||
} catch (err) {
|
||||
console.error("stopRecord 调用失败", err);
|
||||
uni.showToast({ title: "stopRecord 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'stopRecord_call_failed', detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 4. 开始对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doOpenTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({ title: "组件不支持 openTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'openTalk_not_supported' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
// pending 用于当 native 发来 talk 状态事件时回传
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.talk.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
console.log("openTalk callback:", res);
|
||||
// 如果 callback 里有最终状态可以直接回传
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = true;
|
||||
uni.showToast({ title: "尝试建立对讲连接...", icon: "none" });
|
||||
} catch (err) {
|
||||
console.error("openTalk 调用失败", err);
|
||||
uni.showToast({ title: "openTalk 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'openTalk_call_failed', detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 5. 停止对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({ title: "组件不支持 stopTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'stopTalk_not_supported' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
console.log("stopTalk callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = false;
|
||||
} catch (err) {
|
||||
console.error("stopTalk 调用失败", err);
|
||||
uni.showToast({ title: "stopTalk 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: 'stopTalk_call_failed', detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
console.log("onSnapShot event:", payload);
|
||||
// 统一处理并尝试把结果回给 pending 请求者
|
||||
this._handleSnapshotResultFromNative(payload);
|
||||
},
|
||||
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
console.log("onRecord event:", payload);
|
||||
this._handleRecordResultFromNative(payload);
|
||||
},
|
||||
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
console.log("onTalkStatus event:", payload);
|
||||
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
|
||||
// 通知调用方(通用事件)
|
||||
uni.$emit('monitor:talk:status', payload);
|
||||
|
||||
// 如果有 pending talk 请求,回传结果
|
||||
if (this._pendingRequests.talk && this._pendingRequests.talk.length) {
|
||||
while (this._pendingRequests.talk.length) {
|
||||
const reqId = this._pendingRequests.talk.shift();
|
||||
uni.$emit(`monitor:response:${reqId}`, { ok: true, payload });
|
||||
}
|
||||
}
|
||||
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({ title: tips || "对讲连接中...", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({ title: tips || "对讲已连接", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({ title: tips || "对讲已停止", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({ title: tips || "对讲失败", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
uni.showToast({ title: tips || ("对讲状态: " + (status || "unknown")), icon: "none" });
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
|
||||
_handleSnapshotResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "截图没有返回数据", icon: "none" });
|
||||
// 回传失败
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: 'no_data' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail) payload = res.detail;
|
||||
|
||||
console.log("snapshot payload normalized:", payload);
|
||||
|
||||
// 优先判断 callback 里直接传进来的 reqId
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
|
||||
// 如果没有 callback reqId,但有 pending 列表,则把结果分发给所有 pending reqId(典型场景:调用方只发了 reqId,但 native 最终通过 onSnapShot 事件推回)
|
||||
if ((!reqIdFromCallback) && this._pendingRequests.snapshot && this._pendingRequests.snapshot.length) {
|
||||
while (this._pendingRequests.snapshot.length) {
|
||||
const rid = this._pendingRequests.snapshot.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
}
|
||||
|
||||
// 无论如何,都发一个通用完成事件,方便只监听通用事件的页面
|
||||
uni.$emit('monitor:snapshot:done', payload);
|
||||
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({ title: "截图成功", icon: "success", duration: 1200 });
|
||||
if (url) {
|
||||
uni.previewImage({ urls: [url] });
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({ title: "截图失败: " + err, icon: "none", duration: 2000 });
|
||||
console.warn("snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
|
||||
_handleRecordResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "录屏没有返回数据", icon: "none" });
|
||||
this.isRecording = false;
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: 'no_data' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail) payload = res.detail;
|
||||
|
||||
console.log("record payload normalized:", payload);
|
||||
|
||||
// 优先用 callback 的 reqId 回传
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
|
||||
// 如果没有 callback reqId,但有 pending,则回传给 pending 列表
|
||||
if ((!reqIdFromCallback) && this._pendingRequests.record && this._pendingRequests.record.length) {
|
||||
while (this._pendingRequests.record.length) {
|
||||
const rid = this._pendingRequests.record.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
}
|
||||
|
||||
// 通用事件
|
||||
uni.$emit('monitor:record:done', payload);
|
||||
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({ title: "录屏完成", icon: "success", duration: 1400 });
|
||||
this.isRecording = false;
|
||||
console.log("录屏地址:", payload.recordUrl);
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({ title: "录屏失败: " + payload.recordFailedReason, icon: "none", duration: 2000 });
|
||||
this.isRecording = false;
|
||||
console.warn("record failed reason:", payload.recordFailedReason);
|
||||
} else {
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({ title: "录屏操作已完成(返回未知)", icon: "none" });
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.center-column {
|
||||
width: 600px;
|
||||
height: 450px;
|
||||
border-radius: 30px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,34 +1,57 @@
|
|||
<template>
|
||||
<div class="center-column">
|
||||
<!-- 视频播放组件 -->
|
||||
<MonitorView ref="monitor" init="5" style="width:300rpx;height:200rpx;margin-top: 20rpx;"
|
||||
@onTel="handleTelEvent" />
|
||||
<!-- 视频播放组件,监听原生事件 -->
|
||||
<MonitorView ref="monitor" init="5" style="width:300px;height:200px;margin-top: 20px;" @onTel="handleTelEvent"
|
||||
@onSnapShot="handleSnapShotEvent" @onRecord="handleRecordEvent" @onTalkStatus="handleTalkEvent" />
|
||||
|
||||
<!-- 云台控制组件 -->
|
||||
<!-- <MonitorControlView ref="control" init="5" style="width:300rpx;height:300rpx;margin-top: 20rpx;" /> -->
|
||||
<view style="display: flex;flex-direction: row; align-items: flex-start;">
|
||||
<!-- 云台控制组件 -->
|
||||
<MonitorControlView ref="control" init="5" style="width:300px;height:300px;margin-top: 20px;" />
|
||||
|
||||
<!-- 功能按钮 -->
|
||||
<div class="button-group">
|
||||
<button @click="switchDisplay(0)">原图</button>
|
||||
<button @click="switchDisplay(1)">四分屏</button>
|
||||
<button @click="switchDisplay(2)">180°全景</button>
|
||||
<button @click="switchDisplay(3)">360°全景</button>
|
||||
<button @click="switchDisplay(4)">环状全景</button>
|
||||
<!-- 功能按钮 -->
|
||||
<div class="button-group">
|
||||
<button class="button" @click="switchDisplay(0)">原图</button>
|
||||
<button class="button" @click="switchDisplay(1)">四分屏</button>
|
||||
<button class="button" @click="switchDisplay(2)">180°全景</button>
|
||||
<button class="button" @click="switchDisplay(3)">360°全景</button>
|
||||
<button class="button" @click="switchDisplay(4)">环状全景</button>
|
||||
|
||||
<button @click="startAlarm">开启手动报警</button>
|
||||
<button @click="stopAlarm">停止手动报警</button>
|
||||
<button class="button" @click="startAlarm">开启手动报警</button>
|
||||
<button class="button" @click="stopAlarm">停止手动报警</button>
|
||||
|
||||
<button @click="flipImage(0)">左右翻转</button>
|
||||
<button @click="flipImage(1)">上下翻转</button>
|
||||
<button @click="flipImage(2)">中心翻转</button>
|
||||
<button @click="flipImage(3)">顺时针90°</button>
|
||||
<button @click="flipImage(4)">逆时针90°</button>
|
||||
<button @click="flipImage(5)">逆时针180°</button>
|
||||
<button @click="flipImage(6)">不翻转</button>
|
||||
<button class="button" @click="flipImage(0)">左右翻转</button>
|
||||
<button class="button" @click="flipImage(1)">上下翻转</button>
|
||||
<button class="button" @click="flipImage(2)">中心翻转</button>
|
||||
<button class="button" @click="flipImage(3)">顺时针90°</button>
|
||||
<button class="button" @click="flipImage(4)">逆时针90°</button>
|
||||
<button class="button" @click="flipImage(5)">逆时针180°</button>
|
||||
<button class="button" @click="flipImage(6)">不翻转</button>
|
||||
|
||||
<button class="button" @click="resumeOrPause">暂停/继续</button>
|
||||
<button class="button" @click="changeQuality">切换清晰度</button>
|
||||
|
||||
<!-- === 新增的功能按钮:截图 / 录屏 / 对讲 === -->
|
||||
<button class="button" @click="doSnapshot">截图</button>
|
||||
|
||||
<button class="button" :disabled="isRecording" @click="doStartRecord">
|
||||
开始录屏
|
||||
</button>
|
||||
<button class="button" :disabled="!isRecording" @click="doStopRecord">
|
||||
结束录屏
|
||||
</button>
|
||||
|
||||
<button class="button" :disabled="isTalking" @click="doOpenTalk">
|
||||
开始对讲
|
||||
</button>
|
||||
<button class="button" :disabled="!isTalking" @click="doStopTalk">
|
||||
结束对讲
|
||||
</button>
|
||||
|
||||
<!-- 测试按钮 -->
|
||||
<button class="button" @click="test">test</button>
|
||||
</div>
|
||||
</view>
|
||||
|
||||
<button @click="resumeOrPause">暂停/继续</button>
|
||||
<button @click="changeQuality">切换清晰度</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -38,32 +61,30 @@
|
|||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false,
|
||||
isRecording: false, // 录屏状态
|
||||
isTalking: false, // 对讲状态
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// 全局事件监听
|
||||
const globalEvent = uni.requireNativePlugin("globalEvent");
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
console.log("myEvent", e);
|
||||
uni.showToast({
|
||||
title: "myEvent: " + JSON.stringify(e),
|
||||
duration: 2000,
|
||||
// 全局事件监听:保留原有用法(有时原生插件会走 globalEvent 发广播)
|
||||
const globalEvent = uni.requireNativePlugin && uni.requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
console.log("myEvent", e);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
console.log("Tel event detail:", event.detail);
|
||||
|
||||
// 如果需要解析电话事件,在这里处理
|
||||
},
|
||||
|
||||
// 切换播放模式
|
||||
switchDisplay(mode) {
|
||||
// console.log("Tel event detail:", event.detail);
|
||||
this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
|
||||
// 手动报警
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
|
|
@ -77,26 +98,312 @@
|
|||
});
|
||||
},
|
||||
|
||||
// 翻转图像
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
console.log("flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
|
||||
// 暂停或继续
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause();
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
|
||||
// 切换清晰度
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality();
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
|
||||
// 测试按钮
|
||||
test() {
|
||||
this.$refs.monitor.test();
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法 ------------------ */
|
||||
|
||||
// 1. 截图(调用)
|
||||
doSnapshot() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 snapShot()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 有些原生实现既会通过 callback 返回结果,也可能通过事件推送。这里同时处理 callback
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
// callback 返回路径或结果,优先显示
|
||||
console.log("snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res);
|
||||
});
|
||||
uni.showToast({
|
||||
title: "正在截屏...",
|
||||
icon: "none",
|
||||
duration: 800
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("snapShot 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "snapShot 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 2. 开始录屏(调用)
|
||||
doStartRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 startRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
// 有些实现会在 start 的 callback 里返回启动结果
|
||||
console.log("startRecord callback:", res);
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({
|
||||
title: "录屏已开始",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("startRecord 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "startRecord 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 3. 停止录屏(调用)
|
||||
doStopRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 stopRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
// stopRecord 通常会回传录屏结果(recordUrl / recordFailedReason)
|
||||
console.log("stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res);
|
||||
});
|
||||
// 注意:实际是否结束以及是否成功,会通过回调或事件告诉你,这里先等待回调/事件设置状态
|
||||
} catch (err) {
|
||||
console.error("stopRecord 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "stopRecord 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 4. 开始对讲(调用)
|
||||
doOpenTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 openTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
console.log("openTalk callback:", res);
|
||||
// 有的实现会在 callback 中返回立即结果
|
||||
});
|
||||
// 将状态标为正在建立连接(最终以事件推送为准)
|
||||
this.isTalking = true;
|
||||
uni.showToast({
|
||||
title: "尝试建立对讲连接...",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("openTalk 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "openTalk 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 5. 停止对讲(调用)
|
||||
doStopTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 stopTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
console.log("stopTalk callback:", res);
|
||||
// 回调/事件会通知最终状态
|
||||
});
|
||||
this.isTalking = false;
|
||||
// 依赖事件或回调再把 isTalking 更新为 false(有些实现会立即回调成功)
|
||||
} catch (err) {
|
||||
console.error("stopTalk 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "stopTalk 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
// event.detail 里可能是你给出的结构:{snapShotUrl, snapShotResult:true/false, snapShotErrorCode:""}
|
||||
console.log("onSnapShot event:", event && event.detail ? event.detail : event);
|
||||
this._handleSnapshotResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
// 期待结构:{recordUrl:"", snapShotResult:true, recordFailedReason:""}
|
||||
console.log("onRecord event:", event && event.detail ? event.detail : event);
|
||||
this._handleRecordResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
// 期待结构:{talkStatus:"loading"|"playing"|"stopped"|"failed", tips:""}
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
console.log("onTalkStatus event:", payload);
|
||||
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({
|
||||
title: tips || "对讲连接中...",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({
|
||||
title: tips || "对讲已连接",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({
|
||||
title: tips || "对讲已停止",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({
|
||||
title: tips || "对讲失败",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
// 兼容未知状态
|
||||
uni.showToast({
|
||||
title: tips || ("对讲状态: " + (status || "unknown")),
|
||||
icon: "none"
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
|
||||
_handleSnapshotResultFromNative(res) {
|
||||
// res 可能是对象,也可能是字符串,做兼容
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "截图没有返回数据",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
// 当 res 是带 detail 的 event 时(在上层已经做过处理,但再次保险处理)
|
||||
if (res.detail) payload = res.detail;
|
||||
|
||||
// 常见结构: { snapShotUrl: "...", snapShotResult: true/false, snapShotErrorCode: "" }
|
||||
console.log("snapshot payload normalized:", payload);
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({
|
||||
title: "截图成功",
|
||||
icon: "success",
|
||||
duration: 1200
|
||||
});
|
||||
console.log("截图地址:", url);
|
||||
// 你可以在这里把 url 存入 state / 调用后端上传 / 打开预览等
|
||||
// 例如打开图片预览:
|
||||
if (url) {
|
||||
uni.previewImage({
|
||||
urls: [url]
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({
|
||||
title: "截图失败: " + err,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
console.warn("snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
|
||||
_handleRecordResultFromNative(res) {
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "录屏没有返回数据",
|
||||
icon: "none"
|
||||
});
|
||||
this.isRecording = false;
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail) payload = res.detail;
|
||||
|
||||
// 期待: { recordUrl: "...", snapShotResult: true, recordFailedReason: "" }
|
||||
console.log("record payload normalized:", payload);
|
||||
|
||||
// 如果有成功 URL
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({
|
||||
title: "录屏完成",
|
||||
icon: "success",
|
||||
duration: 1400
|
||||
});
|
||||
console.log("录屏地址:", payload.recordUrl);
|
||||
this.isRecording = false;
|
||||
// TODO: 根据需要下载/上传/播放录屏文件
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({
|
||||
title: "录屏失败: " + payload.recordFailedReason,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
console.warn("record failed reason:", payload.recordFailedReason);
|
||||
this.isRecording = false;
|
||||
} else {
|
||||
// 有些实现可能只返回一个标志位
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({
|
||||
title: "录屏操作已完成(返回未知)",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -107,7 +414,6 @@
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/* height: 100vh; */
|
||||
}
|
||||
|
||||
.button-group {
|
||||
|
|
@ -115,11 +421,21 @@
|
|||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
margin-top: 20rpx;
|
||||
margin-top: 40px;
|
||||
width: 620px;
|
||||
}
|
||||
|
||||
.button-group button {
|
||||
margin: 5rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
.button {
|
||||
margin: 6px;
|
||||
padding: 8px 12px;
|
||||
min-width: 120px;
|
||||
height: 44px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #ddd;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.button[disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -29,8 +29,7 @@
|
|||
testAsyncFunc() {
|
||||
// 获取 module
|
||||
var testModule = uni.requireNativePlugin("MonitorModule")
|
||||
// String deviceId =options.getString("deviceId");
|
||||
// String deviceName =options.getString("deviceName");
|
||||
|
||||
var json = {
|
||||
deviceId: '4',
|
||||
deviceName: 'sdfsfsdf'
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
<view class="input-father">
|
||||
<view class="add">+86</view>
|
||||
<view class="shu"></view>
|
||||
<input style="font-size: 27rpx;height: 350rpx;" type="number" v-model="form.username" maxlength="11" placeholder="请输入手机号"
|
||||
@blur="getImg" />
|
||||
<input style="font-size: 27rpx;height: 350rpx;" type="number" v-model="form.username" maxlength="11"
|
||||
placeholder="请输入手机号" @blur="getImg" />
|
||||
</view>
|
||||
<view class="input-father">
|
||||
<input class="password" password type="text" v-model="form.password" maxlength="15" placeholder="请输入密码" />
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
<!-- 自动更新组件 -->
|
||||
<zy-update ref="zyupgrade" :noticeflag="true" theme="blue" :h5preview="false" oldversion="1.0.0"
|
||||
:appstoreflag="true" :autocheckupdate="true"></zy-update>
|
||||
<view class="bg-mask" v-if="huakuaiOpen" @click="huakuaiOpen=false">
|
||||
<view class="bg-mask" v-if="huakuaiOpen" @click="huakuaiOpen=false">
|
||||
<huakuai @click.stop @success="huakuaisuccess" />
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -164,8 +164,8 @@
|
|||
openbottom.value = false;
|
||||
isTarget.value = true;
|
||||
login()
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
|
|
@ -193,7 +193,7 @@
|
|||
if (res.result !== null && res.result.serverUrl) {
|
||||
uni.setStorageSync('serverUrl', res.result.serverUrl);
|
||||
time.value = Date.now();
|
||||
|
||||
|
||||
getLoginCode(time.value).then((res : any) => {
|
||||
form.captcha = res.message
|
||||
canclick.value = true
|
||||
|
|
@ -226,11 +226,12 @@
|
|||
const login = () => {
|
||||
if (isTarget.value) {
|
||||
huakuaiOpen.value = true;
|
||||
|
||||
|
||||
} else {
|
||||
openbottom.value = true;
|
||||
}
|
||||
}
|
||||
const loading = ref(false)
|
||||
const huakuaisuccess = () => {
|
||||
form.checkKey = time.value
|
||||
huakuaiOpen.value = false
|
||||
|
|
@ -244,9 +245,14 @@
|
|||
uni.setStorageSync('token', res.result.token);
|
||||
uni.setStorageSync('username', form.username);
|
||||
uni.setStorageSync('realname', res.result.userInfo.realname);
|
||||
setTimeout(() => {
|
||||
jumpTo(`/pages/watch/index`)
|
||||
}, 500)
|
||||
if (!loading.value) {
|
||||
loading.value = true
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
jumpTo(`/pages/watch/index`)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
|
@ -261,14 +267,46 @@
|
|||
if (uni.getStorageSync('appWgtVersion') != uni.getSystemInfoSync().appWgtVersion) {
|
||||
showPopup.value = true;
|
||||
}
|
||||
init()
|
||||
});
|
||||
// 生命周期钩子
|
||||
onShow(() => {
|
||||
zyupgrade.value?.check_update();
|
||||
if(uni.getStorageSync('token') && uni.getStorageSync('token')!==1){
|
||||
jumpTo(`/pages/watch/index`)
|
||||
if (uni.getStorageSync('token') && uni.getStorageSync('token') !== 1) {
|
||||
if (!loading.value) {
|
||||
loading.value = true
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
jumpTo(`/pages/watch/index`)
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function init() {
|
||||
var monitorModule = uni.requireNativePlugin("MonitorModule")
|
||||
monitorModule.initSMBCloudSDK()
|
||||
logincamera()
|
||||
}
|
||||
function logincamera() {
|
||||
var monitorModule = uni.requireNativePlugin("MonitorModule")
|
||||
var loginfo = {
|
||||
userName: "admin",
|
||||
password: "Bl20230518",
|
||||
serverAddress: "121.36.88.64",
|
||||
port: 8888,
|
||||
}
|
||||
monitorModule.cloudLoginIn(loginfo, (r) => {
|
||||
console.log("?????",r)
|
||||
if (!loading.value) {
|
||||
loading.value = true
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
jumpTo(`/pages/watch/index`)
|
||||
}, 500)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
|
@ -601,17 +639,18 @@
|
|||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
.bg-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(5rpx);
|
||||
z-index: 998;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bg-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(5rpx);
|
||||
z-index: 998;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<template>
|
||||
<div class="center-column" @click="jumptonve">
|
||||
<!-- 视频播放组件 -->
|
||||
<MonitorControlView ref="monitor" init="5" style="width: 170px;height: 170px;" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.center-column {
|
||||
width: 170px;
|
||||
height: 170px;
|
||||
/* background-color: red; */
|
||||
border-radius: 80px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
```vue
|
||||
<!-- 轮盘(一级圆盘 + 二级左半弧滚动盘)-->
|
||||
<template>
|
||||
<view class="draw-all">
|
||||
|
|
@ -12,7 +11,7 @@
|
|||
<image class="all-size" src="/static/index/watch/panzi.png" />
|
||||
</view>
|
||||
|
||||
<!-- 一级转盘:完整圆盘,可旋转、自动校正、选中最左侧 -->
|
||||
<!-- 一级转盘 -->
|
||||
<view ref="compass" class="compass-container" @touchstart.stop.prevent="onTouchStart"
|
||||
@touchmove.prevent.stop="onTouchMove" @touchend.stop.prevent="onTouchEnd"
|
||||
@touchcancel.stop.prevent="onTouchEnd" :style="wrapperStyle">
|
||||
|
|
@ -21,7 +20,8 @@
|
|||
<view
|
||||
style="z-index: 2;display: flex;flex-direction: column;justify-content: center;align-items: center;">
|
||||
<image style="width: 50rpx;height: 50rpx;margin-bottom: 0rpx;"
|
||||
:src="`/static/index/watch/Wheel/${i}${i===target?1:0}.png`" />
|
||||
:class="i===target&&!opensecondmenu?`pulse`: ``"
|
||||
:src="`/static/index/watch/Wheel/${i+1}${i===target?1:0}.png`" />
|
||||
<view :style="i===target?{color:'#fff'}:{}">
|
||||
{{ item.label }}
|
||||
</view>
|
||||
|
|
@ -32,32 +32,29 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 二级转盘:只占左半球(90°~270°),竖向滚动、有边界、吸附、最多 5 个 -->
|
||||
<!-- 二级转盘 -->
|
||||
<view v-if="items2.length" ref="compass2" class="compass-container second"
|
||||
@touchstart.stop.prevent="onTouchStart2" @touchmove.prevent.stop="onTouchMove2"
|
||||
@touchend.stop.prevent="onTouchEnd2" @touchcancel.stop.prevent="onTouchEnd2" :style="wrapperStyle2"
|
||||
v-show="target">
|
||||
v-show="target !== -1">
|
||||
<view v-for="(item, i) in items2" :key="i" class="compass-item" :style="itemStyle2(item.baseAngle)">
|
||||
<text :class="i===target2?`item-label-second-target`: `item-label-second`" :style="labelStyle2">
|
||||
<text class="item-label-second" :class="i===target2&&opensecondmenu?`targetbutton`: ``"
|
||||
:style="labelStyle2">
|
||||
<view
|
||||
style="z-index: 2;display: flex;flex-direction: column;justify-content: center;align-items: center;">
|
||||
<image style="width: 70rpx;height: 70rpx;margin-bottom: 0rpx;"
|
||||
:src="`/static/index/watch/Wheel/${target}${i}${i===target2?1:0}.png`" />
|
||||
<view v-show="target!==-1" :style="i===target2?{color:'#0E86EA'}:{}">
|
||||
:src="`/static/index/watch/Wheel/${target === -1 ? 0 : target+1}${i}${i===secondMapTarget[target]?1:0}.png`" />
|
||||
<view v-show="target!==-1" :style="i===secondMapTarget[target]?{color:'#0E86EA'}:{}">
|
||||
{{ item.label }}
|
||||
</view>
|
||||
</view>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="" v-show="target===5">
|
||||
<joystick @movecard="" :movebottom="44" :moveleft="-5" :pao="false" :notext="true" />
|
||||
</view> -->
|
||||
|
||||
<!-- 一级手势蒙层 -->
|
||||
<!-- 手势蒙层 -->
|
||||
<view v-if="dragging==='first'" class="gesture-mask" @touchmove.stop.prevent="onTouchMove"
|
||||
@touchend.stop.prevent="onTouchEnd" @touchcancel.stop.prevent="onTouchEnd" />
|
||||
<!-- 二级手势蒙层 -->
|
||||
<view v-if="dragging==='second'" class="gesture-mask" @touchmove.stop.prevent="onTouchMove2"
|
||||
@touchend.stop.prevent="onTouchEnd2" @touchcancel.stop.prevent="onTouchEnd2" />
|
||||
</view>
|
||||
|
|
@ -65,71 +62,102 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed, nextTick, watch, onBeforeUnmount } from 'vue'
|
||||
// import joystick from '@/component/public/newgame/joysticknew.vue';
|
||||
|
||||
const emit = defineEmits([])
|
||||
const props = defineProps({})
|
||||
|
||||
/* ===================== 一级:完整圆盘 ===================== */
|
||||
// 10 个预设方向文字
|
||||
const labels = ['开机', '静音', '对讲', '截屏', '录制', '方位', '清晰度', '分屏', '翻转', '告警']
|
||||
const props = defineProps({
|
||||
opensecondmenu: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
})
|
||||
const emit = defineEmits(["firstIndex", "secondIndex"])
|
||||
/* ========== 基础数据 ========== */
|
||||
const labels = ['静音', '对讲', '截屏', '录制', '方位', '清晰度', '分屏', '翻转', '告警']
|
||||
const secondMapTarget = ref([1, 1, 1, 1, 1, 0, 0, 3, 1])
|
||||
const count = labels.length
|
||||
|
||||
// 一级:每个文字对应的初始角度(360 等分)
|
||||
const items = reactive(
|
||||
labels.map((label, idx) => ({
|
||||
label,
|
||||
baseAngle: (360 / count) * idx
|
||||
}))
|
||||
)
|
||||
// 恢复定时器(最简单的实现)
|
||||
const items = reactive(labels.map((label, idx) => ({
|
||||
label,
|
||||
baseAngle: (360 / count) * idx
|
||||
})))
|
||||
|
||||
/* ========== 定时器 & 常量 ========== */
|
||||
let restoreTimer : number | null = null
|
||||
let restoreTimer2 : number | null = null
|
||||
const RESTORE_MS = 300 // 0.3s
|
||||
// 当前累积旋转角度(一级)
|
||||
const ANIM_MS = 300
|
||||
const RESTORE_MS = 300
|
||||
|
||||
/* ========== 角度状态 ========== */
|
||||
// 逻辑角(连续累积,可超过多圈)—— 由手势增量累加得到
|
||||
const currentAngle = ref(0)
|
||||
let startAngle = 0
|
||||
// 用于渲染到 DOM 的“显示角”,我们会对它做最短角度动画
|
||||
const displayAngle = ref(0)
|
||||
|
||||
const startchange = () => {
|
||||
secondMapTarget.value[target.value] = target2.value;
|
||||
// console.log("????",target.value ,target2.value)
|
||||
if (target.value === 4 && target2.value === 0) {
|
||||
const optionSub = uni.getSubNVueById('optionSub')
|
||||
optionSub.show('fade-in')
|
||||
}else if(target.value === 4 && target2.value === 1){
|
||||
const optionSub = uni.getSubNVueById('optionSub')
|
||||
optionSub.hide('fade-out')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 拖拽状态
|
||||
const dragging = ref<null | 'first' | 'second'>(null)
|
||||
let prevTouchAngle : number | null = null
|
||||
let lastMoveDelta = 0
|
||||
|
||||
let idleTimer : number | null = null
|
||||
function armIdleFinish(handler : () => void, ms = 160) {
|
||||
if (idleTimer) clearTimeout(idleTimer)
|
||||
idleTimer = setTimeout(() => {
|
||||
if (dragging.value) handler()
|
||||
}, ms) as unknown as number
|
||||
idleTimer = setTimeout(() => { if (dragging.value) handler() }, ms) as unknown as number
|
||||
}
|
||||
function clearIdle() {
|
||||
if (idleTimer) {
|
||||
clearTimeout(idleTimer)
|
||||
idleTimer = null
|
||||
}
|
||||
if (idleTimer) { clearTimeout(idleTimer); idleTimer = null }
|
||||
}
|
||||
// 圆心坐标(用于一级 atan2)
|
||||
const center = reactive({ x: 0, y: 0 })
|
||||
|
||||
// 获取圆心(以一级容器为基准)
|
||||
/* ========== 圆心坐标 (用于 atan2) ========== */
|
||||
const center = reactive({ x: 0, y: 0 })
|
||||
onMounted(async () => {
|
||||
await nextTick()
|
||||
uni
|
||||
.createSelectorQuery()
|
||||
.select('.compass-container')
|
||||
.boundingClientRect(rect => {
|
||||
if (rect) {
|
||||
center.x = rect.left + rect.width / 2
|
||||
center.y = rect.top + rect.height / 2
|
||||
}
|
||||
})
|
||||
.exec()
|
||||
})
|
||||
uni.createSelectorQuery().select('.compass-container').boundingClientRect(rect => {
|
||||
if (rect) {
|
||||
center.x = rect.left + rect.width / 2
|
||||
center.y = rect.top + rect.height / 2
|
||||
}
|
||||
}).exec()
|
||||
|
||||
// 容器样式(一级)
|
||||
// 初始对齐:用 currentAngle (0) 找到左侧项并对齐 displayAngle
|
||||
await nextTick()
|
||||
const init = getLeftmostIndexFromAngle(currentAngle.value)
|
||||
target.value = init
|
||||
// 直接把 display 对齐到 current(无动画)
|
||||
displayAngle.value = currentAngle.value
|
||||
focusIndex(init, false)
|
||||
})
|
||||
// 开启窗体
|
||||
// function chuangti() {
|
||||
// const optionSub = uni.getSubNVueById('optionSub')
|
||||
// if (target.value === 4) {
|
||||
// // 显示子窗体
|
||||
// optionSub.show('fade-in') // 第二个参数是动画时长(毫秒)
|
||||
// } else {
|
||||
// // 隐藏子窗体
|
||||
// optionSub.hide('fade-out')
|
||||
// }
|
||||
// }
|
||||
|
||||
/* ========== 显示样式依赖 displayAngle ========== */
|
||||
const transitioning = ref(false)
|
||||
const wrapperStyle = computed(() => ({
|
||||
transform: `rotate(${currentAngle.value}deg)`,
|
||||
transition: transitioning.value ? 'transform 0.3s ease-out' : 'none'
|
||||
transform: `rotate(${displayAngle.value}deg)`,
|
||||
transition: transitioning.value ? `transform ${ANIM_MS}ms ease-out` : 'none'
|
||||
}))
|
||||
const labelStyle = computed(() => ({ transform: `rotate(${-displayAngle.value}deg)` }))
|
||||
|
||||
// 单项样式(一级)
|
||||
function itemStyle(baseAngle : number) {
|
||||
const radius = 190
|
||||
const rad = (baseAngle * Math.PI) / 180
|
||||
|
|
@ -138,132 +166,230 @@
|
|||
return { transform: `translate(${x}px, ${y}px)` }
|
||||
}
|
||||
|
||||
// 标签正立(一级)
|
||||
const labelStyle = computed(() => ({
|
||||
transform: `rotate(${-currentAngle.value}deg)`
|
||||
}))
|
||||
/* ========== 角度工具函数 ========== */
|
||||
function normalize360(a : number) {
|
||||
let v = a % 360
|
||||
if (v < 0) v += 360
|
||||
return v
|
||||
}
|
||||
// 返回 toAngle 相对于 fromAngle 的最短有向角差(-180,180]
|
||||
function signedShortestAngleDiff(toAngle : number, fromAngle : number) {
|
||||
// 直接利用归一化到 [0,360) 再差值并修正
|
||||
const a = normalize360(toAngle)
|
||||
const b = normalize360(fromAngle)
|
||||
let diff = a - b
|
||||
if (diff > 180) diff -= 360
|
||||
if (diff <= -180) diff += 360
|
||||
return diff
|
||||
}
|
||||
// 给出 targetAngle(0..360),返回与 reference 最接近的等价角(可能是 target±360k)
|
||||
function chooseClosestEquivalent(targetAngle : number, reference : number) {
|
||||
const base = normalize360(targetAngle)
|
||||
let best = base
|
||||
let bestDiff = Math.abs(best - reference)
|
||||
for (let k = -3; k <= 3; k++) {
|
||||
const cand = base + k * 360
|
||||
const d = Math.abs(cand - reference)
|
||||
if (d < bestDiff) {
|
||||
bestDiff = d
|
||||
best = cand
|
||||
}
|
||||
}
|
||||
return best
|
||||
}
|
||||
|
||||
// atan2 角度(一级)
|
||||
/* ====== touch 角度 (标准 atan2 返回 -180..180) ====== */
|
||||
function getTouchAngle(e : TouchEvent) {
|
||||
const t = e.touches[0]
|
||||
const dx = t.clientX - center.x
|
||||
const dy = t.clientY - center.y
|
||||
return ((Math.atan2(dy, dx) * 180) / Math.PI) * 2 // 灵敏度×2
|
||||
return (Math.atan2(dy, dx) * 180) / Math.PI * 2
|
||||
}
|
||||
function clearRestoreTimer() {
|
||||
if (restoreTimer !== null) {
|
||||
clearTimeout(restoreTimer)
|
||||
restoreTimer = null
|
||||
}
|
||||
}
|
||||
// 选中最左侧索引(一级)
|
||||
|
||||
/* ========== 选中 & 恢复计时 ========== */
|
||||
const target = ref(5)
|
||||
const saveindex = ref(-1)
|
||||
function clearRestoreTimer() {
|
||||
if (restoreTimer !== null) { clearTimeout(restoreTimer); restoreTimer = null }
|
||||
}
|
||||
function startRestoreTimer() {
|
||||
clearTimeout(restoreTimer)
|
||||
restoreTimer = setTimeout(() => {
|
||||
if (target.value === -1) {
|
||||
target.value = saveindex.value
|
||||
}
|
||||
}, 300)
|
||||
clearRestoreTimer()
|
||||
restoreTimer = setTimeout(() => {
|
||||
if (target.value === -1) target.value = saveindex.value
|
||||
}, RESTORE_MS) as unknown as number
|
||||
}
|
||||
function startRestoreTimer2() {
|
||||
clearTimeout(restoreTimer2)
|
||||
restoreTimer2 = setTimeout(() => {
|
||||
if (target2.value === -1) {
|
||||
target2.value = saveindex2.value
|
||||
}
|
||||
}, 300)
|
||||
clearTimeout(restoreTimer2)
|
||||
restoreTimer2 = setTimeout(() => {
|
||||
if (target2.value === -1) target2.value = saveindex2.value
|
||||
}, RESTORE_MS) as unknown as number
|
||||
}
|
||||
|
||||
/* ========== touch handlers:一级(使用 currentAngle 做逻辑,displayAngle 做渲染) ========== */
|
||||
function onTouchStart(e : TouchEvent) {
|
||||
saveindex.value = target.value
|
||||
target.value = -1
|
||||
transitioning.value = false
|
||||
startAngle = getTouchAngle(e) - currentAngle.value
|
||||
prevTouchAngle = getTouchAngle(e)
|
||||
lastMoveDelta = 0
|
||||
dragging.value = 'first'
|
||||
startRestoreTimer()
|
||||
}
|
||||
function onTouchMove(e : TouchEvent) {
|
||||
if (prevTouchAngle === null) {
|
||||
prevTouchAngle = getTouchAngle(e); return
|
||||
}
|
||||
const angle = getTouchAngle(e)
|
||||
currentAngle.value = angle - startAngle
|
||||
// 计算相对增量(短差),累加到 currentAngle(逻辑角)
|
||||
const delta = signedShortestAngleDiff(angle, prevTouchAngle as number)
|
||||
lastMoveDelta = delta
|
||||
currentAngle.value = currentAngle.value + delta
|
||||
// 直接把显示角同步到当前逻辑角(无动画)
|
||||
transitioning.value = false
|
||||
displayAngle.value = currentAngle.value
|
||||
prevTouchAngle = angle
|
||||
armIdleFinish(onTouchEnd)
|
||||
// 重启恢复定时器:0.3s 内没有新的 move 就恢复 saveindex
|
||||
startRestoreTimer()
|
||||
}
|
||||
function getLeftmostIndex() {
|
||||
function onTouchEnd() {
|
||||
prevTouchAngle = null
|
||||
clearRestoreTimer()
|
||||
|
||||
// 吸附到网格(snap)
|
||||
const step = 360 / count
|
||||
const snapUnit = (count % 2 === 0) ? step : step / 2
|
||||
|
||||
const raw = currentAngle.value
|
||||
const snappedBase = Math.round(raw / snapUnit) * snapUnit
|
||||
const targetNorm = normalize360(snappedBase) // 0..360 的目标表示
|
||||
|
||||
// 逻辑角:选择一个跟 raw 相近的等价角(保持数值连续性)
|
||||
const finalAngle = chooseClosestEquivalent(targetNorm, raw)
|
||||
// 立即把逻辑角更新为 finalAngle(这样后续逻辑以 finalAngle 为准)
|
||||
currentAngle.value = finalAngle
|
||||
|
||||
// 计算显示端要动画到哪个“等价角”——选择对 displayAngle 最接近的等价角
|
||||
const displayTarget = chooseClosestEquivalent(targetNorm, displayAngle.value)
|
||||
|
||||
// 计算最短差并让 displayAngle 增量变化(CSS 会走最短路径)
|
||||
let diff = displayTarget - displayAngle.value
|
||||
if (diff > 180) diff -= 360
|
||||
if (diff <= -180) diff += 360
|
||||
|
||||
// 启动过渡动画
|
||||
transitioning.value = true
|
||||
displayAngle.value = displayAngle.value + diff
|
||||
|
||||
// 先立刻更新 target(逻辑上的选中项)
|
||||
const leftIndex = getLeftmostIndexFromAngle(finalAngle)
|
||||
if (target.value !== leftIndex) {
|
||||
emit("firstIndex", leftIndex)
|
||||
target.value = leftIndex
|
||||
}
|
||||
|
||||
|
||||
// chuangti()
|
||||
// 动画结束后:关闭过渡、并用无动画方式把 displayAngle 数值对齐到逻辑角 currentAngle
|
||||
setTimeout(() => {
|
||||
transitioning.value = false
|
||||
// 把 displayAngle 对齐到 currentAngle 的数值(可能相差整圈),但无动画
|
||||
displayAngle.value = currentAngle.value
|
||||
}, ANIM_MS)
|
||||
|
||||
dragging.value = null
|
||||
lastMoveDelta = 0
|
||||
}
|
||||
|
||||
/* ========== focusIndex(外部调用或按钮触发的精确对齐) ========== */
|
||||
function angleForIndex(index : number) {
|
||||
if (!items[index]) return 0
|
||||
return normalize360(180 - items[index].baseAngle)
|
||||
}
|
||||
function focusIndex(index : number, animate = true) {
|
||||
if (index == null || index < 0 || index >= items.length) return
|
||||
const angle = angleForIndex(index) // 0..360 target
|
||||
// 逻辑上选择最接近 currentAngle 的等价角
|
||||
const finalAngle = chooseClosestEquivalent(angle, currentAngle.value)
|
||||
currentAngle.value = finalAngle
|
||||
|
||||
// 显示端选择对 displayAngle 最接近的等价角去动画
|
||||
const displayTarget = chooseClosestEquivalent(angle, displayAngle.value)
|
||||
if (!animate) {
|
||||
transitioning.value = false
|
||||
displayAngle.value = finalAngle
|
||||
// target.value = index
|
||||
if (target.value !== index) {
|
||||
emit("firstIndex", index)
|
||||
target.value = index
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
let diff = displayTarget - displayAngle.value
|
||||
if (diff > 180) diff -= 360
|
||||
if (diff <= -180) diff += 360
|
||||
|
||||
transitioning.value = true
|
||||
displayAngle.value = displayAngle.value + diff
|
||||
if (target.value !== index) {
|
||||
emit("firstIndex", index)
|
||||
target.value = index
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
transitioning.value = false
|
||||
displayAngle.value = currentAngle.value
|
||||
}, ANIM_MS)
|
||||
|
||||
dragging.value = null
|
||||
}
|
||||
|
||||
/* ========== 更稳健的 getLeftmost(基于任意角度) ========== */
|
||||
function angleDiff(a : number, b : number) {
|
||||
const diff = Math.abs(normalize360(a) - normalize360(b))
|
||||
return Math.min(diff, 360 - diff)
|
||||
}
|
||||
function getLeftmostIndexFromAngle(angle : number) {
|
||||
if (!items.length) return -1
|
||||
const cur = normalize360(angle)
|
||||
let minDiff = Infinity
|
||||
let idx = 0
|
||||
items.forEach((item, i) => {
|
||||
let real = (item.baseAngle + currentAngle.value) % 360
|
||||
if (real < 0) real += 360
|
||||
const diff = Math.abs(real - 180)
|
||||
if (diff < minDiff) {
|
||||
const targetAngleForItem = normalize360(180 - item.baseAngle)
|
||||
const diff = angleDiff(cur, targetAngleForItem)
|
||||
if (diff < minDiff - 1e-9) {
|
||||
minDiff = diff
|
||||
idx = i
|
||||
}
|
||||
})
|
||||
|
||||
return idx
|
||||
}
|
||||
function onTouchEnd() {
|
||||
// 结束时先清定时器,避免同时恢复和吸附冲突
|
||||
clearRestoreTimer()
|
||||
|
||||
const step = 360 / count
|
||||
const raw = currentAngle.value
|
||||
const nearest = Math.round(raw / step) * step
|
||||
transitioning.value = true
|
||||
currentAngle.value = nearest
|
||||
const leftIndex = getLeftmostIndex()
|
||||
target.value = leftIndex
|
||||
// console.log("???", target.value)
|
||||
setTimeout(() => (transitioning.value = false), 300)
|
||||
dragging.value = null
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
if (restoreTimer !== null) clearTimeout(restoreTimer)
|
||||
if (restoreTimer2 !== null) clearTimeout(restoreTimer2)
|
||||
clearIdle()
|
||||
})
|
||||
/* ===================== 二级:左半弧竖向滚动盘 ===================== */
|
||||
// 二级映射(每组最多 5 个)
|
||||
const secondMap : Record<number, string[]> = {
|
||||
0: [],
|
||||
1: [],
|
||||
2: [],
|
||||
3: [],
|
||||
4: [],
|
||||
5: [],
|
||||
6: ['超清', '流畅', '自动'],
|
||||
7: ['180°全景', '四分屏', '360°全景', '全景拉伸', '原图'],
|
||||
8: ['上下翻转', '关闭', '左右翻转'],
|
||||
9: []
|
||||
function getLeftmostIndex() {
|
||||
return getLeftmostIndexFromAngle(currentAngle.value)
|
||||
}
|
||||
|
||||
/* ================= 二级(竖向左半弧) ================ */
|
||||
const secondMapByLabel : Record<string, string[]> = {
|
||||
'静音': ['开启静音', '关闭静音',], '对讲': ['开启对讲', '关闭对讲',], '截屏': ["截屏"], '录制': ['开启录制', '关闭录制',], '方位': ['开启方位', '关闭方位',],
|
||||
'清晰度': ['高清', '流畅'],
|
||||
'分屏': ['原图', '四分屏', '180°全景', '360°全景', '环状全景'],
|
||||
'翻转': [ '左右翻转','上下翻转', '中心翻转','关闭'],
|
||||
'告警': ['开启告警', '关闭告警',]
|
||||
}
|
||||
|
||||
// 二级数据与状态
|
||||
const items2 = reactive<{ label : string; baseAngle : number }[]>([])
|
||||
const target2 = ref(0)
|
||||
|
||||
// 二级:半弧滚动偏移角(只允许在 [-Δ, +Δ])
|
||||
const currentOffset2 = ref(0)
|
||||
const step2 = ref(0) // Δ = 180 / (n + 1)
|
||||
const step2 = ref(0)
|
||||
const transitioning2 = ref(false)
|
||||
|
||||
// 竖向滚动灵敏度(度/像素),可按设备调节
|
||||
const DEG_PER_PX = 0.5
|
||||
|
||||
// 容器样式(二级:整体绕圆心微旋转 currentOffset2)
|
||||
const wrapperStyle2 = computed(() => ({
|
||||
transform: `rotate(${currentOffset2.value}deg)`,
|
||||
transition: transitioning2.value ? 'transform 0.25s ease-out' : 'none'
|
||||
transition: transitioning2.value ? `transform 0.25s ease-out` : 'none'
|
||||
}))
|
||||
|
||||
// 标签正立(二级)
|
||||
const labelStyle2 = computed(() => ({
|
||||
transform: `rotate(${-currentOffset2.value}deg)`
|
||||
}))
|
||||
|
||||
// 单项样式(二级:布局在左半弧 90°~270°)
|
||||
const labelStyle2 = computed(() => ({ transform: `rotate(${-currentOffset2.value}deg)` }))
|
||||
function itemStyle2(baseAngle : number) {
|
||||
const radius = 240
|
||||
const rad = (baseAngle * Math.PI) / 180
|
||||
|
|
@ -272,22 +398,19 @@
|
|||
return { transform: `translate(${x}px, ${y}px)` }
|
||||
}
|
||||
|
||||
// 固定角度位置(左半球从上到下)
|
||||
const presetAngles = [135, 157.5, 180, 202.5, 225]
|
||||
|
||||
// 优先顺序:中间 → 上 → 下 → 上上 → 下下
|
||||
function getBalancedAngles(n : number) : number[] {
|
||||
const order = [2, 1, 3, 0, 4]
|
||||
return order.slice(0, n).map(i => presetAngles[i])
|
||||
}
|
||||
const minOffset2 = ref(0);
|
||||
const maxOffset2 = ref(0);
|
||||
// 替换原来的 rebuildSecondByFirstIndex:
|
||||
const minOffset2 = ref(0)
|
||||
const maxOffset2 = ref(0)
|
||||
function rebuildSecondByFirstIndex(firstIdx : number) {
|
||||
const list = (secondMap[firstIdx] || []).slice(0, 5)
|
||||
const firstLabel = items[firstIdx]?.label
|
||||
const list = (firstLabel && secondMapByLabel[firstLabel]) ? secondMapByLabel[firstLabel].slice(0, 5) : []
|
||||
const angles = getBalancedAngles(list.length)
|
||||
minOffset2.value = 180 - Math.max(...angles)
|
||||
maxOffset2.value = 180 - Math.min(...angles)
|
||||
minOffset2.value = 180 - Math.max(...(angles.length ? angles : [180]))
|
||||
maxOffset2.value = 180 - Math.min(...(angles.length ? angles : [180]))
|
||||
items2.splice(0, items2.length)
|
||||
if (!list.length) {
|
||||
currentOffset2.value = 0
|
||||
|
|
@ -295,54 +418,39 @@
|
|||
target2.value = -1
|
||||
return
|
||||
}
|
||||
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
items2.push({
|
||||
label: list[i],
|
||||
baseAngle: angles[i]
|
||||
})
|
||||
items2.push({ label: list[i], baseAngle: angles[i] })
|
||||
}
|
||||
|
||||
currentOffset2.value = 0
|
||||
step2.value = 22.5 // 每个角度偏移
|
||||
nextTick(() => {
|
||||
target2.value = getLeftmostIndex2()
|
||||
})
|
||||
step2.value = 22.5
|
||||
nextTick(() => { target2.value = getLeftmostIndex2() })
|
||||
}
|
||||
// 获取二级“最左侧”(最靠近 180°)的索引
|
||||
function getLeftmostIndex2() {
|
||||
if (!items2.length) return -1
|
||||
let minDiff = Infinity
|
||||
let idx = 0
|
||||
let minDiff = Infinity; let idx = 0
|
||||
items2.forEach((item, i) => {
|
||||
let real = (item.baseAngle + currentOffset2.value) % 360
|
||||
if (real < 0) real += 360
|
||||
const diff = Math.abs(real - 180)
|
||||
if (diff < minDiff) {
|
||||
minDiff = diff
|
||||
idx = i
|
||||
}
|
||||
if (diff < minDiff) { minDiff = diff; idx = i }
|
||||
})
|
||||
return idx
|
||||
}
|
||||
|
||||
// 监听一级 target,联动二级
|
||||
watch(
|
||||
() => target.value,
|
||||
(idx) => {
|
||||
if (idx >= 0) rebuildSecondByFirstIndex(idx)
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
watch(() => target.value, (idx) => {
|
||||
if (idx >= 0) {
|
||||
rebuildSecondByFirstIndex(idx)
|
||||
focusIndex(idx, true)
|
||||
} else {
|
||||
rebuildSecondByFirstIndex(idx)
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
/* ---- 二级手势:竖向滚动到极限距离([-Δ, +Δ]),松手吸附到 Δ 的整数倍 ---- */
|
||||
/* 二级手势 */
|
||||
let startY2 = 0
|
||||
let startOffset2 = 0
|
||||
|
||||
function clamp2(val : number) {
|
||||
return Math.max(minOffset2.value, Math.min(maxOffset2.value, val))
|
||||
}
|
||||
const saveindex2 =ref(-1)
|
||||
function clamp2(val : number) { return Math.max(minOffset2.value, Math.min(maxOffset2.value, val)) }
|
||||
const saveindex2 = ref(-1)
|
||||
function onTouchStart2(e : TouchEvent) {
|
||||
saveindex2.value = target2.value
|
||||
const t = e.touches[0]
|
||||
|
|
@ -353,32 +461,97 @@
|
|||
dragging.value = 'second'
|
||||
startRestoreTimer2()
|
||||
}
|
||||
|
||||
function onTouchMove2(e : TouchEvent) {
|
||||
if (!items2.length) return
|
||||
const t = e.touches[0]
|
||||
const dy = t.clientY - startY2
|
||||
const Δ = step2.value || 1
|
||||
// 上滑为正角度:使用 -dy
|
||||
const raw = startOffset2 + (-dy) * DEG_PER_PX
|
||||
currentOffset2.value = clamp2(raw, -Δ, +Δ)
|
||||
currentOffset2.value = clamp2(raw)
|
||||
armIdleFinish(onTouchEnd2)
|
||||
startRestoreTimer2()
|
||||
}
|
||||
|
||||
function onTouchEnd2() {
|
||||
if (!items2.length) return
|
||||
const Δ = step2.value || 1
|
||||
// 吸附到 Δ 的整数倍,并限制在 [-Δ, +Δ]
|
||||
const snapped = Math.round(currentOffset2.value / Δ) * Δ
|
||||
transitioning2.value = true
|
||||
currentOffset2.value = clamp2(snapped, -Δ, +Δ)
|
||||
currentOffset2.value = clamp2(snapped)
|
||||
|
||||
// 选中靠近 180° 的项
|
||||
target2.value = getLeftmostIndex2()
|
||||
setTimeout(() => (transitioning2.value = false), 250)
|
||||
dragging.value = null
|
||||
if (target.value !== getLeftmostIndex2()) {
|
||||
emit("secondIndex", target2.value)
|
||||
target2.value = getLeftmostIndex2()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ========== 外部控制与清理 ========== */
|
||||
function moveFirstUp() {
|
||||
if (dragging.value === 'first') return
|
||||
const cur = getLeftmostIndex(); if (cur < 0) return
|
||||
const next = (cur - 1 + items.length) % items.length
|
||||
focusIndex(next, true);
|
||||
if (target.value !== next) {
|
||||
emit("firstIndex", next)
|
||||
target.value = next
|
||||
}
|
||||
|
||||
// chuangti()
|
||||
}
|
||||
function moveFirstDown() {
|
||||
if (dragging.value === 'first') return
|
||||
const cur = getLeftmostIndex(); if (cur < 0) return
|
||||
const next = (cur + 1) % items.length
|
||||
focusIndex(next, true);
|
||||
if (target.value !== next) {
|
||||
emit("firstIndex", next)
|
||||
target.value = next
|
||||
}
|
||||
// chuangti()
|
||||
}
|
||||
/* ======= 为二级盘新增外部控制(按偏移量,而不是按索引) ======= */
|
||||
function moveSecondUp() {
|
||||
if (dragging.value === 'second') return
|
||||
if (!items2.length) return
|
||||
const Δ = step2.value || 1
|
||||
// 手指向上 -> currentOffset2 增大 (onTouchMove 中也是这样:向上使 currentOffset2 增加)
|
||||
let target = currentOffset2.value + Δ
|
||||
// 把目标对齐到 step 网格并限制到 min/max
|
||||
target = Math.round(target / Δ) * Δ
|
||||
target = clamp2(target)
|
||||
transitioning2.value = true
|
||||
currentOffset2.value = target
|
||||
// 更新选中项(根据新的 offset 计算最靠近 180° 的项)
|
||||
target2.value = getLeftmostIndex2()
|
||||
emit("secondIndex", target2.value)
|
||||
|
||||
setTimeout(() => (transitioning2.value = false), 250)
|
||||
}
|
||||
|
||||
function moveSecondDown() {
|
||||
if (dragging.value === 'second') return
|
||||
if (!items2.length) return
|
||||
const Δ = step2.value || 1
|
||||
// 手指向下 -> currentOffset2 减小
|
||||
let target = currentOffset2.value - Δ
|
||||
target = Math.round(target / Δ) * Δ
|
||||
target = clamp2(target)
|
||||
transitioning2.value = true
|
||||
currentOffset2.value = target
|
||||
target2.value = getLeftmostIndex2()
|
||||
emit("secondIndex", target2.value)
|
||||
setTimeout(() => (transitioning2.value = false), 250)
|
||||
}
|
||||
|
||||
defineExpose({ moveFirstUp, moveFirstDown, moveSecondUp, moveSecondDown, startchange })
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (restoreTimer !== null) clearTimeout(restoreTimer)
|
||||
if (restoreTimer2 !== null) clearTimeout(restoreTimer2)
|
||||
clearIdle()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
@ -388,23 +561,23 @@
|
|||
background-color: #eff0f4;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.carmera {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 250rpx;
|
||||
height: 600rpx;
|
||||
width: 200rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
.carmera {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 250rpx;
|
||||
height: 600rpx;
|
||||
width: 200rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.roll {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0rpx;
|
||||
height: 1300rpx;
|
||||
width: 650rpx;
|
||||
}
|
||||
.roll {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0rpx;
|
||||
height: 1300rpx;
|
||||
width: 650rpx;
|
||||
}
|
||||
|
||||
.compass-container {
|
||||
|
|
@ -468,17 +641,6 @@
|
|||
position: relative;
|
||||
}
|
||||
|
||||
.item-label-second-target {
|
||||
font-size: 25rpx;
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.all-size {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
|
@ -494,7 +656,6 @@
|
|||
transition: opacity 0.8s ease;
|
||||
}
|
||||
|
||||
/* 二级容器放在一级之下,尺寸更大一圈(视觉在后面) */
|
||||
.compass-container.second {
|
||||
width: 480px;
|
||||
height: 480px;
|
||||
|
|
@ -505,7 +666,7 @@
|
|||
bottom: 172rpx;
|
||||
margin: auto;
|
||||
touch-action: none;
|
||||
z-index: 1; // 在一级之下
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.gesture-mask {
|
||||
|
|
@ -516,7 +677,51 @@
|
|||
bottom: 0;
|
||||
z-index: 9999;
|
||||
background: transparent;
|
||||
/* 或 rgba(0,0,0,0.001) */
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
.pulse {
|
||||
/* 可调参数 */
|
||||
--scale: 1.8;
|
||||
--dur: 0.8s;
|
||||
|
||||
animation: pulse var(--dur) ease-in-out infinite;
|
||||
transform-origin: center center;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
/* 放大到一定值再回到原始(平滑) */
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(var(--scale));
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.targetbutton {
|
||||
--color: #99C9FD;
|
||||
--thick: 2px;
|
||||
--radius: 60rpx;
|
||||
--outline-offset: -10rpx;
|
||||
/* 外扩多少 */
|
||||
|
||||
/* 内层虚线(你现在用的) */
|
||||
border-radius: var(--radius);
|
||||
// background-color: #ddf0ff;
|
||||
/* 内部背景 */
|
||||
animation: scalePulse 360ms cubic-bezier(.2, .8, .2, 1);
|
||||
/* 外层虚线:放在 outline(不会影响元素尺寸) */
|
||||
outline: var(--thick) dashed var(--color);
|
||||
outline-offset: var(--outline-offset);
|
||||
|
||||
/* 保证文本 / 子元素在最上层 */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,22 +3,27 @@
|
|||
<view class="view-left">
|
||||
<view class="title-father">
|
||||
<image class="title-img" src="/static/index/watch/uni.png" />
|
||||
<view class="title-font">
|
||||
<view class="title-font" @click="ceshi">
|
||||
护理单元
|
||||
</view>
|
||||
</view>
|
||||
<view class="zhezhao-top"></view>
|
||||
<view class="zhezhao-bottom"></view>
|
||||
<scroll-view class="menus-father" scroll-y :scroll-top="topnum">
|
||||
<view v-for="(item,index) in filteredMenu" :key="index" class="menu" :class="item.warning? 'warning':''"
|
||||
:style="index === menuIndex?{backgroundColor:`#fff`}:{} " @click="menuIndex=index">
|
||||
<view v-for="(item,index) in filteredMenu" :key="index" class="menu"
|
||||
:class="{warning: item.warning,target: index === leftTargetIndex}" :style="[
|
||||
index === menuIndex ? { backgroundColor: '#fff' } : {},
|
||||
leftTargetIndex === index ? { backgroundColor: '#ddf0ff' } : {}
|
||||
]" @click="menuIndex=index;leftTargetIndex =index">
|
||||
<view class="menu-img">
|
||||
<donghua :width="`65rpx`" :height="`65rpx`" :links="item.url" :playing="menuIndex===index" />
|
||||
</view>
|
||||
|
||||
<!-- <image class="menu-img" :src="item.url" /> -->
|
||||
<view style="margin-left: 10rpx;">
|
||||
<view style="font-size: 31rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 200rpx;" :style="index === menuIndex?{color:`#017DE9 `}:{} ">
|
||||
<view
|
||||
style="font-size: 31rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 200rpx;"
|
||||
:style="index === menuIndex?{color:`#017DE9 `}:{} ">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<!-- <view style="font-size: 20rpx;color: #A1A1A1;">
|
||||
|
|
@ -48,9 +53,11 @@
|
|||
<view class="zhezhao-left"></view>
|
||||
<view class="zhezhao-right"></view>
|
||||
<scroll-view scroll-x="true" style="width: 66%;height: 100%;">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<view style="display: flex;align-items: center;margin-top: 5rpx;">
|
||||
|
||||
<view v-for="(item,index) in typeArray" :key="index" class="menu" @click="typeNow=index;">
|
||||
<view v-for="(item,index) in typeArray" :key="index" class="menu"
|
||||
:style="topTargetIndex === index ? { backgroundColor: '#ddf0ff' } : {}"
|
||||
:class="{target: index === topTargetIndex}" @click="typeNow=index;">
|
||||
<!-- <image class="menu-img" :src="item.url" v-if="item.url" /> -->
|
||||
<donghua :links="item.url" :playing="typeNow===index" v-if="item.url" />
|
||||
<text class="menu-font" :class="{ zoom: typeNow===index }"
|
||||
|
|
@ -76,11 +83,14 @@
|
|||
<!-- <view class="">
|
||||
返回
|
||||
</view> -->
|
||||
<image style="width: 65rpx;height: 65rpx;" src="/static/index/newindex/curve/shezhi.png"
|
||||
@click="goback" />
|
||||
<view style="font-size: 32rpx;margin-left: 10rpx;" @click="goback">
|
||||
设置
|
||||
<view :class="{ targetbutton: shezhi }" style="display: flex;align-items: center;">
|
||||
<image style="width: 65rpx;height: 65rpx;" src="/static/index/newindex/curve/shezhi.png"
|
||||
@click="goback" />
|
||||
<view style="font-size: 32rpx;margin-left: 10rpx;" @click="goback">
|
||||
设置
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -104,7 +114,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- <image style="width: 100%;height: 100%;" src="/static/index/watch/bgc.png" /> -->
|
||||
<image style="width: 100rpx;height: 100rpx;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/index/watch/play.png" @click="jumpToCeshi" />
|
||||
<!-- <image style="width: 100rpx;height: 100rpx;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/index/watch/play.png" @click="jumpToCeshi" /> -->
|
||||
</view>
|
||||
<view style="display: flex;margin-top: 20rpx;">
|
||||
<view class="card-father">
|
||||
|
|
@ -267,43 +277,72 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<specialDrawerVue ref="gobackdrawer">
|
||||
<bigroll />
|
||||
<specialDrawerVue ref="gobackdrawer" :circletarget="openright" @open="cleanandopen">
|
||||
<bigroll ref="wheelRef" :opensecondmenu="opensecondmenu" @firstIndex="firstIndex"
|
||||
@secondIndex="secondIndex" />
|
||||
</specialDrawerVue>
|
||||
<arrowkeys @movecard="movecard" :getblue="getblue" :moveleft="5" />
|
||||
<!-- 自动更新组件 -->
|
||||
<zy-update ref="zyupgrade" :noticeflag="true" theme="blue" :h5preview="false" oldversion="1.0.0"
|
||||
:appstoreflag="true" :autocheckupdate="true"></zy-update>
|
||||
<!-- <zy-update ref="zyupgrade" :noticeflag="true" theme="blue" :h5preview="false" oldversion="1.0.0"
|
||||
:appstoreflag="true" :autocheckupdate="true"></zy-update> -->
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, onBeforeUnmount, vShow, computed } from 'vue';
|
||||
import { ref, onMounted, onBeforeUnmount, computed } from 'vue';
|
||||
import ZyUpdate from '@/component/zy-upgrade/zy-upgrade.vue'
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app"
|
||||
import specialDrawerVue from '../../component/public/specialDrawer.vue';
|
||||
import bigroll from './drawer/index.vue';
|
||||
|
||||
onLoad(() => {
|
||||
const globalEvent = uni.requireNativePlugin("globalEvent");
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
console.log("myEvent", e);
|
||||
uni.showToast({
|
||||
title: "myEvent: " + JSON.stringify(e),
|
||||
duration: 2000,
|
||||
});
|
||||
});
|
||||
const optionSub = uni.getSubNVueById('optionSub')
|
||||
optionSub.hide('fade-out') // 第二个参数是动画时长(毫秒)
|
||||
})
|
||||
const ceshi = () => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/ceshianzhuo"
|
||||
})
|
||||
}
|
||||
const zyupgrade = ref(null);
|
||||
const menuIndex = ref(-1);
|
||||
const typeNow = ref(-1);
|
||||
const photoplay = ref(false);
|
||||
const getblue = ref(false);
|
||||
const gobackdrawer = ref(null);
|
||||
const wheelRef = ref(null);
|
||||
const topnum = ref(0); // scroll-top (px)
|
||||
const itemHeight = 100; // 每项高度 (px)
|
||||
const containerHeight = 400; // scroll-view 高度 (px)
|
||||
|
||||
|
||||
|
||||
const jumpToCeshi = () => {
|
||||
uni.navigateTo({
|
||||
url:'/pages/denglu'
|
||||
url: '/pages/denglu'
|
||||
})
|
||||
}
|
||||
|
||||
const first = ref(5);
|
||||
const second = ref(0);
|
||||
const firstIndex = (index : number) => {
|
||||
first.value = index
|
||||
}
|
||||
const secondIndex = (index : number) => {
|
||||
second.value = index
|
||||
}
|
||||
// const change
|
||||
const opendrawer = () => {
|
||||
gobackdrawer.value.openDrawer();
|
||||
const optionSub = uni.getSubNVueById('optionSub')
|
||||
optionSub.show('fade-in')
|
||||
}
|
||||
function clamp(v, a, b) { return Math.max(a, Math.min(b, v)); }
|
||||
|
||||
|
|
@ -559,52 +598,310 @@
|
|||
getblue.value = true;
|
||||
|
||||
})
|
||||
const leftTargetIndex = ref(0);
|
||||
const topTargetIndex = ref(-1);
|
||||
const shezhi = ref(false)
|
||||
const openright = ref(false);
|
||||
const openfirstmenu = ref(false);
|
||||
const opensecondmenu = ref(false);
|
||||
// const circletarget = ref(false)
|
||||
|
||||
const cleanandopen = () => {
|
||||
leftTargetIndex.value = -1;
|
||||
topTargetIndex.value = -1;
|
||||
shezhi.value = false;
|
||||
openright.value = false;
|
||||
openright.value = false;
|
||||
openfirstmenu.value = true;
|
||||
opensecondmenu.value = false
|
||||
}
|
||||
|
||||
const movecard = (type : number) => {
|
||||
switch (type) {
|
||||
case 0:
|
||||
if (menuIndex.value > 0) {
|
||||
menuIndex.value--
|
||||
typeNow.value = 0
|
||||
if (leftTargetIndex.value !== -1) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
if (menuIndex.value > 0) {
|
||||
menuIndex.value--
|
||||
typeNow.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
}
|
||||
|
||||
break
|
||||
case 1:
|
||||
// if (typeNow.value < typeArray.value.length - 1) {
|
||||
// typeNow.value = 0
|
||||
// ensureVisible(menuIndex.value)
|
||||
// }
|
||||
// typeNow.value = 0;
|
||||
topTargetIndex.value = typeNow.value
|
||||
leftTargetIndex.value = -1
|
||||
|
||||
break
|
||||
case 2:
|
||||
if (menuIndex.value < filteredMenu.value.length - 1) {
|
||||
menuIndex.value++
|
||||
typeNow.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
}
|
||||
|
||||
break
|
||||
case 3:
|
||||
// if (typeNow.value > 0) {
|
||||
// typeNow.value--
|
||||
// ensureVisible(menuIndex.value)
|
||||
// }
|
||||
|
||||
break
|
||||
case 4:
|
||||
if (!typeNow.value) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/NursingNew/index'
|
||||
})
|
||||
} else if (typeNow.value === 1) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/Warehousing/index'
|
||||
})
|
||||
}
|
||||
break
|
||||
}
|
||||
} else if (topTargetIndex.value !== -1) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
|
||||
break
|
||||
case 1:
|
||||
if (typeNow.value < typeArray.value.length - 2) {
|
||||
console.log("???", typeArray.value.length)
|
||||
typeNow.value++
|
||||
topTargetIndex.value = typeNow.value
|
||||
|
||||
} else {
|
||||
shezhi.value = true
|
||||
topTargetIndex.value = -1
|
||||
}
|
||||
|
||||
break
|
||||
case 2:
|
||||
topTargetIndex.value = -1
|
||||
menuIndex.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
}
|
||||
break
|
||||
case 3:
|
||||
if (typeNow.value) {
|
||||
typeNow.value--
|
||||
topTargetIndex.value = typeNow.value
|
||||
|
||||
break
|
||||
case 1:
|
||||
if (typeNow.value < typeArray.value.length - 1) {
|
||||
typeNow.value++
|
||||
} else {
|
||||
topTargetIndex.value = -1
|
||||
menuIndex.value = 0
|
||||
typeNow.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
}
|
||||
|
||||
break
|
||||
case 5:
|
||||
topTargetIndex.value = -1
|
||||
menuIndex.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
}
|
||||
break
|
||||
}
|
||||
} else if (shezhi.value) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
|
||||
break
|
||||
case 1:
|
||||
|
||||
|
||||
break
|
||||
case 2:
|
||||
if (menuIndex.value < filteredMenu.value.length - 1) {
|
||||
menuIndex.value++
|
||||
typeNow.value = 0
|
||||
break
|
||||
case 2:
|
||||
shezhi.value = false;
|
||||
openright.value = true
|
||||
break
|
||||
case 3:
|
||||
typeNow.value = 3
|
||||
topTargetIndex.value = typeNow.value
|
||||
shezhi.value = false;
|
||||
break
|
||||
case 4:
|
||||
goback()
|
||||
break
|
||||
case 5:
|
||||
topTargetIndex.value = -1
|
||||
menuIndex.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
}
|
||||
shezhi.value = false;
|
||||
break
|
||||
}
|
||||
} else if (openright.value) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
shezhi.value = true;
|
||||
openright.value = false
|
||||
break
|
||||
case 1:
|
||||
opendrawer()
|
||||
openfirstmenu.value = true;
|
||||
openright.value = false
|
||||
break
|
||||
case 2:
|
||||
|
||||
break
|
||||
case 3:
|
||||
if (typeNow.value > 0) {
|
||||
typeNow.value--
|
||||
break
|
||||
case 3:
|
||||
topTargetIndex.value = -1
|
||||
menuIndex.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
}
|
||||
openright.value = false;
|
||||
break
|
||||
case 4:
|
||||
opendrawer()
|
||||
openfirstmenu.value = true;
|
||||
openright.value = false
|
||||
break
|
||||
case 5:
|
||||
topTargetIndex.value = -1
|
||||
menuIndex.value = 0
|
||||
leftTargetIndex.value = menuIndex.value
|
||||
ensureVisible(menuIndex.value)
|
||||
break
|
||||
}
|
||||
} else if (openfirstmenu.value) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
// wheelRef.value.moveFirstDown()
|
||||
moveDownDebounced() // 使用防抖
|
||||
break
|
||||
case 1:
|
||||
|
||||
break
|
||||
case 4:
|
||||
if (!typeNow.value) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/NursingNew/index'
|
||||
})
|
||||
} else if (typeNow.value === 1) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/Warehousing/index'
|
||||
})
|
||||
}
|
||||
break
|
||||
case 2:
|
||||
// wheelRef.value.moveFirstUp()
|
||||
moveUpDebounced() // 使用防抖
|
||||
break
|
||||
case 3:
|
||||
openfirstmenu.value = false;
|
||||
opensecondmenu.value = true;
|
||||
break
|
||||
case 4:
|
||||
openfirstmenu.value = false;
|
||||
opensecondmenu.value = true;
|
||||
break
|
||||
case 5:
|
||||
gobackdrawer.value.closeDrawer();
|
||||
openfirstmenu.value = false;
|
||||
openright.value = true
|
||||
break
|
||||
}
|
||||
} else if (opensecondmenu.value) {
|
||||
switch (type) {
|
||||
case 0:
|
||||
// wheelRef.value.moveFirstDown()
|
||||
// moveDownDebounced() // 使用防抖
|
||||
moveDownsecond()
|
||||
break
|
||||
case 1:
|
||||
opensecondmenu.value = false;
|
||||
openfirstmenu.value = true;
|
||||
break
|
||||
case 2:
|
||||
moveUpsecond()
|
||||
// wheelRef.value.moveFirstUp()
|
||||
// moveUpDebounced() // 使用防抖
|
||||
break
|
||||
case 3:
|
||||
|
||||
break
|
||||
case 4:
|
||||
clickDownsecond()
|
||||
break
|
||||
case 5:
|
||||
// gobackdrawer.value.closeDrawer();
|
||||
opensecondmenu.value = false;
|
||||
openfirstmenu.value = true;
|
||||
// openright.value = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
// 对 moveFirstUp / moveFirstDown 包装防抖
|
||||
const moveUpDebounced = useThrottle(() => wheelRef.value?.moveFirstUp(), 400)
|
||||
const moveDownDebounced = useThrottle(() => wheelRef.value?.moveFirstDown(), 400)
|
||||
const moveUpsecond = useThrottle(() => wheelRef.value?.moveSecondUp(), 400)
|
||||
const moveDownsecond = useThrottle(() => wheelRef.value?.moveSecondDown(), 400)
|
||||
const clickDownsecond = useThrottle(() => doSomething(), 700)
|
||||
|
||||
const gaoqing = ref(0);
|
||||
|
||||
function doSomething(){
|
||||
wheelRef.value?.startchange()
|
||||
console.log("index",first.value,second.value)
|
||||
if(first.value===1){
|
||||
if(second.value){
|
||||
uni.$emit('monitor:stopTalk');
|
||||
}else{
|
||||
uni.$emit('monitor:openTalk');
|
||||
}
|
||||
}
|
||||
if(first.value===2){
|
||||
uni.$emit('monitor:doSnapshot');
|
||||
}
|
||||
if(first.value===3){
|
||||
if(second.value){
|
||||
uni.$emit('monitor:stopRecord');
|
||||
}else{
|
||||
uni.$emit('monitor:startRecord');
|
||||
}
|
||||
}
|
||||
if(first.value===5){
|
||||
if(gaoqing.value !== second.value){
|
||||
gaoqing.value = second.value
|
||||
uni.$emit('monitor:changeQuality'); // 发起截图请求,不关心回调
|
||||
}
|
||||
}
|
||||
if(first.value===6){
|
||||
uni.$emit('monitor:switchDisplay',second.value)
|
||||
}
|
||||
if(first.value===7){
|
||||
if(second.value===3){
|
||||
uni.$emit('monitor:flipImage',6)
|
||||
}else{
|
||||
uni.$emit('monitor:flipImage',second.value)
|
||||
}
|
||||
// if(second.value){
|
||||
// uni.$emit('monitor:stopAlarm')
|
||||
// }else{
|
||||
// uni.$emit('monitor:startAlarm')
|
||||
// }
|
||||
|
||||
}
|
||||
if(first.value===8){
|
||||
if(second.value){
|
||||
uni.$emit('monitor:stopAlarm')
|
||||
}else{
|
||||
uni.$emit('monitor:startAlarm')
|
||||
}
|
||||
|
||||
}
|
||||
// if()
|
||||
}
|
||||
|
||||
function useThrottle(fn : () => void, delay = 1000) {
|
||||
let throttling = false
|
||||
return () => {
|
||||
if (throttling) return
|
||||
fn()
|
||||
throttling = true
|
||||
setTimeout(() => {
|
||||
throttling = false
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
const filteredMenu = computed(() => {
|
||||
|
|
@ -625,7 +922,7 @@
|
|||
}
|
||||
// 生命周期钩子
|
||||
onShow(() => {
|
||||
zyupgrade.value?.check_update();
|
||||
// zyupgrade.value?.check_update();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1123,4 +1420,46 @@
|
|||
transform: translateY(-50%);
|
||||
right: 130rpx;
|
||||
}
|
||||
|
||||
.target {
|
||||
--color: #99C9FD;
|
||||
--thick: 2px;
|
||||
--radius: 60rpx;
|
||||
--outline-offset: 0rpx;
|
||||
/* 外扩多少 */
|
||||
|
||||
/* 内层虚线(你现在用的) */
|
||||
border-radius: var(--radius);
|
||||
background-color: #ddf0ff;
|
||||
/* 内部背景 */
|
||||
animation: scalePulse 360ms cubic-bezier(.2, .8, .2, 1);
|
||||
/* 外层虚线:放在 outline(不会影响元素尺寸) */
|
||||
outline: var(--thick) dashed var(--color);
|
||||
outline-offset: var(--outline-offset);
|
||||
|
||||
/* 保证文本 / 子元素在最上层 */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.targetbutton {
|
||||
--color: #99C9FD;
|
||||
--thick: 2px;
|
||||
--radius: 60rpx;
|
||||
--outline-offset: 10rpx;
|
||||
/* 外扩多少 */
|
||||
|
||||
/* 内层虚线(你现在用的) */
|
||||
border-radius: var(--radius);
|
||||
// background-color: #ddf0ff;
|
||||
/* 内部背景 */
|
||||
animation: scalePulse 360ms cubic-bezier(.2, .8, .2, 1);
|
||||
/* 外层虚线:放在 outline(不会影响元素尺寸) */
|
||||
outline: var(--thick) dashed var(--color);
|
||||
outline-offset: var(--outline-offset);
|
||||
|
||||
/* 保证文本 / 子元素在最上层 */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1 +1 @@
|
|||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__FB2D473","name":"护理单元","version":{"name":"1.5.4","code":154},"description":"护理单元","developer":{"name":"","email":"","url":""},"permissions":{"Share":{},"Camera":{},"VideoPlayer":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"},"prerendered":"false"}},"google":{"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"uni.UNIFB2D473","aliasname":"__uni__fb2d473","password":"Z4Urhm9jqwqMGoeQNpGzJA==","storepwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keypwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"dSYMs":false,"plistcmds":["Add :UIFileSharingEnabled bool true"],"devices":"universal"},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"share":{"weixin":{"UniversalLinks":"","appid":"wxda748470da82886e"}}},"debug":true,"syncDebug":true,"orientation":"portrait-primary"},"nativePlugins":{"MonitorModule":{}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"control":"uni-v3","vueVersion":"3","compilerVersion":"4.76","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal","webView":{"minUserAgentVersion":"49.0"}},"adid":"122926210510"},"app-harmony":{"useragent":{"value":"uni-app","concatenate":true},"uniStatistics":{"enable":false}},"screenOrientation":["landscape-primary","landscape-secondary"],"launch_path":"__uniappview.html"}
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__FB2D473","name":"护理单元","version":{"name":"1.5.6","code":156},"description":"护理单元","developer":{"name":"","email":"","url":""},"permissions":{"Share":{},"Camera":{},"VideoPlayer":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"},"prerendered":"false"}},"google":{"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"uni.UNIFB2D473","aliasname":"__uni__fb2d473","password":"Z4Urhm9jqwqMGoeQNpGzJA==","storepwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keypwd":"Z4Urhm9jqwqMGoeQNpGzJA==","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"dSYMs":false,"plistcmds":["Add :UIFileSharingEnabled bool true"],"devices":"universal"},"plugins":{"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"share":{"weixin":{"UniversalLinks":"","appid":"wxda748470da82886e"}}},"debug":true,"syncDebug":true,"orientation":"portrait-primary"},"nativePlugins":{"MonitorModule":{}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"control":"uni-v3","vueVersion":"3","compilerVersion":"4.76","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal","webView":{"minUserAgentVersion":"49.0"}},"adid":"122926210510"},"app-harmony":{"useragent":{"value":"uni-app","concatenate":true},"uniStatistics":{"enable":false}},"screenOrientation":["landscape-primary","landscape-secondary"],"launch_path":"__uniappview.html"}
|
||||
|
|
@ -13,8 +13,8 @@
|
|||
},
|
||||
{
|
||||
"type": "component",
|
||||
"name": "myText",
|
||||
"class": "com.cn.plugin_module.TestText"
|
||||
"name": "MonitorControlView",
|
||||
"class": "com.cn.plugin_module.PTZMotorJoyStickView"
|
||||
},
|
||||
{
|
||||
"type": "component",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
"use weex:vue";
|
||||
|
||||
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
||||
Promise.prototype.finally = function(callback) {
|
||||
const promise = this.constructor
|
||||
return this.then(
|
||||
value => promise.resolve(callback()).then(() => value),
|
||||
reason => promise.resolve(callback()).then(() => {
|
||||
throw reason
|
||||
})
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
||||
const global = uni.requireGlobal()
|
||||
ArrayBuffer = global.ArrayBuffer
|
||||
Int8Array = global.Int8Array
|
||||
Uint8Array = global.Uint8Array
|
||||
Uint8ClampedArray = global.Uint8ClampedArray
|
||||
Int16Array = global.Int16Array
|
||||
Uint16Array = global.Uint16Array
|
||||
Int32Array = global.Int32Array
|
||||
Uint32Array = global.Uint32Array
|
||||
Float32Array = global.Float32Array
|
||||
Float64Array = global.Float64Array
|
||||
BigInt64Array = global.BigInt64Array
|
||||
BigUint64Array = global.BigUint64Array
|
||||
};
|
||||
|
||||
|
||||
(()=>{var h=Object.create;var p=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var T=(e,t,o,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of y(t))!x.call(e,r)&&r!==o&&p(e,r,{get:()=>t[r],enumerable:!(l=w(t,r))||l.enumerable});return e};var u=(e,t,o)=>(o=e!=null?h(b(e)):{},T(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e));var c=E((q,_)=>{_.exports=Vue});var C=u(c());function m(e){return weex.requireModule(e)}function d(e,t,...o){uni.__log__?uni.__log__(e,t,...o):console[e].apply(console,[...o,t])}var v=(e,t)=>{let o=e.__vccOpts||e;for(let[l,r]of t)o[l]=r;return o};var n=u(c()),V={"center-column":{"":{width:600,height:450,borderRadius:30,overflow:"hidden"}}},k={data(){return{}},onLoad(){m("globalEvent").addEventListener("myEvent",t=>{})},methods:{handleTelEvent(e){d("log","at pages/camera.nvue:30","Tel event detail:",e.detail)},jumptonve(){uni.navigateTo({url:"/pages/ceshianzhuo"})}}};function A(e,t,o,l,r,s){let g=(0,n.resolveComponent)("MonitorView");return(0,n.openBlock)(),(0,n.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,n.createElementVNode)("div",{class:"center-column",onClick:t[0]||(t[0]=(...f)=>s.jumptonve&&s.jumptonve(...f))},[(0,n.createVNode)(g,{ref:"monitor",init:"5",style:{width:"600px",height:"450px"},onOnTel:s.handleTelEvent},null,8,["onOnTel"])])])}var a=v(k,[["render",A],["styles",[V]]]);var i=plus.webview.currentWebview();if(i){let e=parseInt(i.id),t="pages/camera",o={};try{o=JSON.parse(i.__query__)}catch(r){}a.mpType="page";let l=Vue.createPageApp(a,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:o});l.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...a.styles||[]])),l.mount("#root")}})();
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
const _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
export {
|
||||
_export_sfc as _
|
||||
};
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
Promise.resolve("./pages/ceshianzhuo.js").then((res) => {
|
||||
res();
|
||||
});
|
||||
Promise.resolve("./pages/camera.js").then((res) => {
|
||||
res();
|
||||
});
|
||||
Promise.resolve("./pages/option.js").then((res) => {
|
||||
res();
|
||||
});
|
||||
Promise.resolve("./app.css.js").then(() => {
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,378 @@
|
|||
import { r as requireNativePlugin, f as formatAppLog } from "../uni-app.es.js";
|
||||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode } from "vue";
|
||||
import { _ as _export_sfc } from "../_plugin-vue_export-helper.js";
|
||||
const _style_0 = { "center-column": { "": { "width": 600, "height": 450, "borderRadius": 30, "overflow": "hidden" } } };
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false,
|
||||
isRecording: false,
|
||||
// 录屏状态
|
||||
isTalking: false,
|
||||
// 对讲状态
|
||||
// 内部 pending 请求队列,用于在 native 事件到达时把结果返回给特定 reqId
|
||||
// 结构: { snapshot: [reqId,...], record: [reqId,...], talk: [reqId,...] }
|
||||
// 注意:这仅用于在 native 事件没有直接 callback 时仍能把结果回传给请求方。
|
||||
_pendingRequests: {
|
||||
snapshot: [],
|
||||
record: [],
|
||||
talk: []
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const globalEvent = requireNativePlugin && requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:39", "myEvent", e);
|
||||
});
|
||||
}
|
||||
uni.$on("monitor:doSnapshot", this.doSnapshot);
|
||||
uni.$on("monitor:startRecord", this.doStartRecord);
|
||||
uni.$on("monitor:stopRecord", this.doStopRecord);
|
||||
uni.$on("monitor:openTalk", this.doOpenTalk);
|
||||
uni.$on("monitor:stopTalk", this.doStopTalk);
|
||||
uni.$on("monitor:switchDisplay", (payload) => this.switchDisplay(payload));
|
||||
uni.$on("monitor:startAlarm", this.startAlarm);
|
||||
uni.$on("monitor:stopAlarm", this.stopAlarm);
|
||||
uni.$on("monitor:flipImage", (payload) => this.flipImage(payload));
|
||||
uni.$on("monitor:resumeOrPause", this.resumeOrPause);
|
||||
uni.$on("monitor:changeQuality", this.changeQuality);
|
||||
uni.$on("monitor:test", this.test);
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off("monitor:doSnapshot", this.doSnapshot);
|
||||
uni.$off("monitor:startRecord", this.doStartRecord);
|
||||
uni.$off("monitor:stopRecord", this.doStopRecord);
|
||||
uni.$off("monitor:openTalk", this.doOpenTalk);
|
||||
uni.$off("monitor:stopTalk", this.doStopTalk);
|
||||
uni.$off("monitor:switchDisplay", (payload) => this.switchDisplay(payload));
|
||||
uni.$off("monitor:startAlarm", this.startAlarm);
|
||||
uni.$off("monitor:stopAlarm", this.stopAlarm);
|
||||
uni.$off("monitor:flipImage", (payload) => this.flipImage(payload));
|
||||
uni.$off("monitor:resumeOrPause", this.resumeOrPause);
|
||||
uni.$off("monitor:changeQuality", this.changeQuality);
|
||||
uni.$off("monitor:test", this.test);
|
||||
},
|
||||
methods: {
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
formatAppLog("log", "at pages/camera.nvue:77", "Tel event detail:", event.detail);
|
||||
},
|
||||
switchDisplay(mode) {
|
||||
formatAppLog("log", "at pages/camera.nvue:82", "zzzzz", mode);
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:89", "startAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
stopAlarm() {
|
||||
this.isAlarming = false;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:95", "stopAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:101", "flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
test() {
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法(支持 payload.reqId) ------------------ */
|
||||
// 1. 截图(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doSnapshot(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({ title: "组件不支持 snapShot()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "snapShot_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.snapshot.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:139", "snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res, payload.reqId);
|
||||
});
|
||||
uni.showToast({ title: "正在截屏...", icon: "none", duration: 800 });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:144", "snapShot 调用失败", err);
|
||||
uni.showToast({ title: "snapShot 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "snapShot_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 2. 开始录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStartRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({ title: "组件不支持 startRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "startRecord_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:164", "startRecord callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({ title: "录屏已开始", icon: "none" });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:173", "startRecord 调用失败", err);
|
||||
uni.showToast({ title: "startRecord 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "startRecord_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 3. 停止录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({ title: "组件不支持 stopRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopRecord_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.record.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:199", "stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res, payload.reqId);
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:204", "stopRecord 调用失败", err);
|
||||
uni.showToast({ title: "stopRecord 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopRecord_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 4. 开始对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doOpenTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({ title: "组件不支持 openTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "openTalk_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.talk.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:228", "openTalk callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = true;
|
||||
uni.showToast({ title: "尝试建立对讲连接...", icon: "none" });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:237", "openTalk 调用失败", err);
|
||||
uni.showToast({ title: "openTalk 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "openTalk_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 5. 停止对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({ title: "组件不支持 stopTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopTalk_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:257", "stopTalk callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = false;
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:264", "stopTalk 调用失败", err);
|
||||
uni.showToast({ title: "stopTalk 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopTalk_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:277", "onSnapShot event:", payload);
|
||||
this._handleSnapshotResultFromNative(payload);
|
||||
},
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:285", "onRecord event:", payload);
|
||||
this._handleRecordResultFromNative(payload);
|
||||
},
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:292", "onTalkStatus event:", payload);
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
uni.$emit("monitor:talk:status", payload);
|
||||
if (this._pendingRequests.talk && this._pendingRequests.talk.length) {
|
||||
while (this._pendingRequests.talk.length) {
|
||||
const reqId = this._pendingRequests.talk.shift();
|
||||
uni.$emit(`monitor:response:${reqId}`, { ok: true, payload });
|
||||
}
|
||||
}
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({ title: tips || "对讲连接中...", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({ title: tips || "对讲已连接", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({ title: tips || "对讲已停止", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({ title: tips || "对讲失败", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
uni.showToast({ title: tips || "对讲状态: " + (status || "unknown"), icon: "none" });
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
_handleSnapshotResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "截图没有返回数据", icon: "none" });
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: "no_data" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/camera.nvue:345", "snapshot payload normalized:", payload);
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
if (!reqIdFromCallback && this._pendingRequests.snapshot && this._pendingRequests.snapshot.length) {
|
||||
while (this._pendingRequests.snapshot.length) {
|
||||
const rid = this._pendingRequests.snapshot.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
}
|
||||
uni.$emit("monitor:snapshot:done", payload);
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({ title: "截图成功", icon: "success", duration: 1200 });
|
||||
if (url) {
|
||||
uni.previewImage({ urls: [url] });
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({ title: "截图失败: " + err, icon: "none", duration: 2e3 });
|
||||
formatAppLog("warn", "at pages/camera.nvue:372", "snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
_handleRecordResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "录屏没有返回数据", icon: "none" });
|
||||
this.isRecording = false;
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: "no_data" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/camera.nvue:388", "record payload normalized:", payload);
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
if (!reqIdFromCallback && this._pendingRequests.record && this._pendingRequests.record.length) {
|
||||
while (this._pendingRequests.record.length) {
|
||||
const rid = this._pendingRequests.record.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
}
|
||||
uni.$emit("monitor:record:done", payload);
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({ title: "录屏完成", icon: "success", duration: 1400 });
|
||||
this.isRecording = false;
|
||||
formatAppLog("log", "at pages/camera.nvue:409", "录屏地址:", payload.recordUrl);
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({ title: "录屏失败: " + payload.recordFailedReason, icon: "none", duration: 2e3 });
|
||||
this.isRecording = false;
|
||||
formatAppLog("warn", "at pages/camera.nvue:413", "record failed reason:", payload.recordFailedReason);
|
||||
} else {
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({ title: "录屏操作已完成(返回未知)", icon: "none" });
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorView = resolveComponent("MonitorView");
|
||||
return openBlock(), createElementBlock("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
createElementVNode("div", { class: "center-column" }, [
|
||||
createVNode(_component_MonitorView, {
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "600px", "height": "450px" },
|
||||
onOnTel: $options.handleTelEvent,
|
||||
onOnSnapShot: $options.handleSnapShotEvent,
|
||||
onOnRecord: $options.handleRecordEvent,
|
||||
onOnTalkStatus: $options.handleTalkEvent
|
||||
}, null, 8, ["onOnTel", "onOnSnapShot", "onOnRecord", "onOnTalkStatus"])
|
||||
])
|
||||
]);
|
||||
}
|
||||
const camera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]]]);
|
||||
export {
|
||||
camera as default
|
||||
};
|
||||
|
|
@ -1,83 +1,318 @@
|
|||
import { r as requireNativePlugin, f as formatAppLog } from "../uni-app.es.js";
|
||||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, createTextVNode } from "vue";
|
||||
function requireNativePlugin(name) {
|
||||
return weex.requireModule(name);
|
||||
}
|
||||
function formatAppLog(type, filename, ...args) {
|
||||
if (uni.__log__) {
|
||||
uni.__log__(type, filename, ...args);
|
||||
} else {
|
||||
console[type].apply(console, [...args, filename]);
|
||||
}
|
||||
}
|
||||
const _style_0 = { "center-column": { "": { "display": "flex", "flexDirection": "column", "alignItems": "center" } }, "button-group": { "": { "display": "flex", "flexDirection": "row", "flexWrap": "wrap", "justifyContent": "center", "marginTop": "20rpx" } } };
|
||||
const _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
import { _ as _export_sfc } from "../_plugin-vue_export-helper.js";
|
||||
const _style_0 = { "center-column": { "": { "display": "flex", "flexDirection": "column", "alignItems": "center" } }, "button-group": { "": { "display": "flex", "flexDirection": "row", "flexWrap": "wrap", "justifyContent": "center", "marginTop": 40, "width": 620 } }, "button": { "": { "marginTop": 6, "marginRight": 6, "marginBottom": 6, "marginLeft": 6, "paddingTop": 8, "paddingRight": 12, "paddingBottom": 8, "paddingLeft": 12, "minWidth": "120px", "height": 44, "borderRadius": 6, "borderWidth": 1, "borderStyle": "solid", "borderColor": "#dddddd", "backgroundColor": "#ffffff" } } };
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false
|
||||
isAlarming: false,
|
||||
isRecording: false,
|
||||
// 录屏状态
|
||||
isTalking: false
|
||||
// 对讲状态
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const globalEvent = requireNativePlugin("globalEvent");
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:47", "myEvent", e);
|
||||
uni.showToast({
|
||||
title: "myEvent: " + JSON.stringify(e),
|
||||
duration: 2e3
|
||||
const globalEvent = requireNativePlugin && requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:73", "myEvent", e);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTelEvent(event2) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:56", "Tel event detail:", event2.detail);
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:80", "Tel event detail:", event.detail);
|
||||
},
|
||||
// 切换播放模式
|
||||
switchDisplay(mode) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:62", "Tel event detail:", event.detail);
|
||||
this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
// 手动报警
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:70", "startAlarm callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:91", "startAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
stopAlarm() {
|
||||
this.isAlarming = false;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:76", "stopAlarm callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:97", "stopAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
// 翻转图像
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:83", "flipImage callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:103", "flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
// 暂停或继续
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause();
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
// 切换清晰度
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality();
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
// 测试按钮
|
||||
test() {
|
||||
this.$refs.monitor.test();
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法 ------------------ */
|
||||
// 1. 截图(调用)
|
||||
doSnapshot() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 snapShot()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:134", "snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res);
|
||||
});
|
||||
uni.showToast({
|
||||
title: "正在截屏...",
|
||||
icon: "none",
|
||||
duration: 800
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:143", "snapShot 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "snapShot 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 2. 开始录屏(调用)
|
||||
doStartRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 startRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:163", "startRecord callback:", res);
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({
|
||||
title: "录屏已开始",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:171", "startRecord 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "startRecord 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 3. 停止录屏(调用)
|
||||
doStopRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 stopRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:191", "stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res);
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:196", "stopRecord 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "stopRecord 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 4. 开始对讲(调用)
|
||||
doOpenTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 openTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:215", "openTalk callback:", res);
|
||||
});
|
||||
this.isTalking = true;
|
||||
uni.showToast({
|
||||
title: "尝试建立对讲连接...",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:225", "openTalk 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "openTalk 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 5. 停止对讲(调用)
|
||||
doStopTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 stopTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:244", "stopTalk callback:", res);
|
||||
});
|
||||
this.isTalking = false;
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:250", "stopTalk 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "stopTalk 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:263", "onSnapShot event:", event && event.detail ? event.detail : event);
|
||||
this._handleSnapshotResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:270", "onRecord event:", event && event.detail ? event.detail : event);
|
||||
this._handleRecordResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:278", "onTalkStatus event:", payload);
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({
|
||||
title: tips || "对讲连接中...",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({
|
||||
title: tips || "对讲已连接",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({
|
||||
title: tips || "对讲已停止",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({
|
||||
title: tips || "对讲失败",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
uni.showToast({
|
||||
title: tips || "对讲状态: " + (status || "unknown"),
|
||||
icon: "none"
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
_handleSnapshotResultFromNative(res) {
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "截图没有返回数据",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:337", "snapshot payload normalized:", payload);
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({
|
||||
title: "截图成功",
|
||||
icon: "success",
|
||||
duration: 1200
|
||||
});
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:345", "截图地址:", url);
|
||||
if (url) {
|
||||
uni.previewImage({
|
||||
urls: [url]
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({
|
||||
title: "截图失败: " + err,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
formatAppLog("warn", "at pages/ceshianzhuo.nvue:360", "snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
_handleRecordResultFromNative(res) {
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "录屏没有返回数据",
|
||||
icon: "none"
|
||||
});
|
||||
this.isRecording = false;
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:377", "record payload normalized:", payload);
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({
|
||||
title: "录屏完成",
|
||||
icon: "success",
|
||||
duration: 1400
|
||||
});
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:386", "录屏地址:", payload.recordUrl);
|
||||
this.isRecording = false;
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({
|
||||
title: "录屏失败: " + payload.recordFailedReason,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
formatAppLog("warn", "at pages/ceshianzhuo.nvue:395", "record failed reason:", payload.recordFailedReason);
|
||||
this.isRecording = false;
|
||||
} else {
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({
|
||||
title: "录屏操作已完成(返回未知)",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorView = resolveComponent("MonitorView");
|
||||
const _component_MonitorControlView = resolveComponent("MonitorControlView");
|
||||
const _component_button = resolveComponent("button");
|
||||
return openBlock(), createElementBlock("scroll-view", {
|
||||
scrollY: true,
|
||||
|
|
@ -90,130 +325,222 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
createVNode(_component_MonitorView, {
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "300rpx", "height": "200rpx", "margin-top": "20rpx" },
|
||||
onOnTel: $options.handleTelEvent
|
||||
}, null, 8, ["onOnTel"]),
|
||||
createElementVNode("div", { class: "button-group" }, [
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => $options.switchDisplay(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("原图")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => $options.switchDisplay(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("四分屏")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => $options.switchDisplay(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("180°全景")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => $options.switchDisplay(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("360°全景")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => $options.switchDisplay(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("环状全景")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, { onClick: $options.startAlarm }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("开启手动报警")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, { onClick: $options.stopAlarm }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("停止手动报警")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => $options.flipImage(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("左右翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => $options.flipImage(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("上下翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[7] || (_cache[7] = ($event) => $options.flipImage(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("中心翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[8] || (_cache[8] = ($event) => $options.flipImage(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("顺时针90°")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[9] || (_cache[9] = ($event) => $options.flipImage(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针90°")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[10] || (_cache[10] = ($event) => $options.flipImage(5))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针180°")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[11] || (_cache[11] = ($event) => $options.flipImage(6))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("不翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, { onClick: $options.resumeOrPause }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("暂停/继续")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, { onClick: $options.changeQuality }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("切换清晰度")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"])
|
||||
style: { "width": "300px", "height": "200px", "margin-top": "20px" },
|
||||
onOnTel: $options.handleTelEvent,
|
||||
onOnSnapShot: $options.handleSnapShotEvent,
|
||||
onOnRecord: $options.handleRecordEvent,
|
||||
onOnTalkStatus: $options.handleTalkEvent
|
||||
}, null, 8, ["onOnTel", "onOnSnapShot", "onOnRecord", "onOnTalkStatus"]),
|
||||
createElementVNode("view", { style: { "display": "flex", "flex-direction": "row", "align-items": "flex-start" } }, [
|
||||
createVNode(_component_MonitorControlView, {
|
||||
ref: "control",
|
||||
init: "5",
|
||||
style: { "width": "300px", "height": "300px", "margin-top": "20px" }
|
||||
}, null, 512),
|
||||
createElementVNode("div", { class: "button-group" }, [
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => $options.switchDisplay(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("原图")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => $options.switchDisplay(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("四分屏")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => $options.switchDisplay(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("180°全景")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => $options.switchDisplay(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("360°全景")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => $options.switchDisplay(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("环状全景")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.startAlarm
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("开启手动报警")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.stopAlarm
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("停止手动报警")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => $options.flipImage(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("左右翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => $options.flipImage(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("上下翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[7] || (_cache[7] = ($event) => $options.flipImage(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("中心翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[8] || (_cache[8] = ($event) => $options.flipImage(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("顺时针90°")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[9] || (_cache[9] = ($event) => $options.flipImage(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针90°")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[10] || (_cache[10] = ($event) => $options.flipImage(5))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针180°")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[11] || (_cache[11] = ($event) => $options.flipImage(6))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("不翻转")
|
||||
]),
|
||||
_: 1
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.resumeOrPause
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("暂停/继续")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.changeQuality
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("切换清晰度")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.doSnapshot
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("截图")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: $data.isRecording,
|
||||
onClick: $options.doStartRecord
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 开始录屏 ")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: !$data.isRecording,
|
||||
onClick: $options.doStopRecord
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 结束录屏 ")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: $data.isTalking,
|
||||
onClick: $options.doOpenTalk
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 开始对讲 ")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: !$data.isTalking,
|
||||
onClick: $options.doStopTalk
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 结束对讲 ")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.test
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("test")
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"])
|
||||
])
|
||||
])
|
||||
])
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode } from "vue";
|
||||
import { _ as _export_sfc } from "../_plugin-vue_export-helper.js";
|
||||
const _style_0 = { "center-column": { "": { "width": 170, "height": 170, "borderRadius": 80 } } };
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorControlView = resolveComponent("MonitorControlView");
|
||||
return openBlock(), createElementBlock("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
createElementVNode("div", {
|
||||
class: "center-column",
|
||||
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.jumptonve && _ctx.jumptonve(...args))
|
||||
}, [
|
||||
createVNode(_component_MonitorControlView, {
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "170px", "height": "170px" }
|
||||
}, null, 512)
|
||||
])
|
||||
]);
|
||||
}
|
||||
const option = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]]]);
|
||||
export {
|
||||
option as default
|
||||
};
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import "vue";
|
||||
function requireNativePlugin(name) {
|
||||
return weex.requireModule(name);
|
||||
}
|
||||
function formatAppLog(type, filename, ...args) {
|
||||
if (uni.__log__) {
|
||||
uni.__log__(type, filename, ...args);
|
||||
} else {
|
||||
console[type].apply(console, [...args, filename]);
|
||||
}
|
||||
}
|
||||
export {
|
||||
formatAppLog as f,
|
||||
requireNativePlugin as r
|
||||
};
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
"id": "__UNI__FB2D473",
|
||||
"name": "护理单元",
|
||||
"version": {
|
||||
"name": "1.5.4",
|
||||
"code": 154
|
||||
"name": "1.5.6",
|
||||
"code": 156
|
||||
},
|
||||
"description": "护理单元",
|
||||
"developer": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
"use weex:vue";
|
||||
|
||||
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
||||
Promise.prototype.finally = function(callback) {
|
||||
const promise = this.constructor
|
||||
return this.then(
|
||||
value => promise.resolve(callback()).then(() => value),
|
||||
reason => promise.resolve(callback()).then(() => {
|
||||
throw reason
|
||||
})
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
||||
const global = uni.requireGlobal()
|
||||
ArrayBuffer = global.ArrayBuffer
|
||||
Int8Array = global.Int8Array
|
||||
Uint8Array = global.Uint8Array
|
||||
Uint8ClampedArray = global.Uint8ClampedArray
|
||||
Int16Array = global.Int16Array
|
||||
Uint16Array = global.Uint16Array
|
||||
Int32Array = global.Int32Array
|
||||
Uint32Array = global.Uint32Array
|
||||
Float32Array = global.Float32Array
|
||||
Float64Array = global.Float64Array
|
||||
BigInt64Array = global.BigInt64Array
|
||||
BigUint64Array = global.BigUint64Array
|
||||
};
|
||||
|
||||
|
||||
(()=>{var d=Object.create;var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var b=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of y(t))!w.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(s=f(t,n))||s.enumerable});return e};var h=(e,t,o)=>(o=e!=null?d(g(e)):{},b(t||!e||!e.__esModule?c(o,"default",{value:e,enumerable:!0}):o,e));var i=v((S,a)=>{a.exports=Vue});var r=h(i());var u=(e,t)=>{let o=e.__vccOpts||e;for(let[s,n]of t)o[s]=n;return o};var x={"center-column":{"":{width:170,height:170,borderRadius:80}}},V={data(){return{}},onLoad(){},methods:{}};function C(e,t,o,s,n,$){let _=(0,r.resolveComponent)("MonitorControlView");return(0,r.openBlock)(),(0,r.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,r.createElementVNode)("div",{class:"center-column",onClick:t[0]||(t[0]=(...m)=>e.jumptonve&&e.jumptonve(...m))},[(0,r.createVNode)(_,{ref:"monitor",init:"5",style:{width:"170px",height:"170px"}},null,512)])])}var p=u(V,[["render",C],["styles",[x]]]);var l=plus.webview.currentWebview();if(l){let e=parseInt(l.id),t="pages/option",o={};try{o=JSON.parse(l.__query__)}catch(n){}p.mpType="page";let s=Vue.createPageApp(p,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:o});s.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...p.styles||[]])),s.mount("#root")}})();
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
const _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
export {
|
||||
_export_sfc as _
|
||||
};
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
Promise.resolve("./pages/ceshianzhuo.js").then((res) => {
|
||||
res();
|
||||
});
|
||||
Promise.resolve("./pages/camera.js").then((res) => {
|
||||
res();
|
||||
});
|
||||
Promise.resolve("./pages/option.js").then((res) => {
|
||||
res();
|
||||
});
|
||||
Promise.resolve("./app.css.js").then(() => {
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,379 @@
|
|||
import { r as requireNativePlugin, f as formatAppLog } from "../uni-app.es.js";
|
||||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, createVNode } from "vue";
|
||||
import { _ as _export_sfc } from "../_plugin-vue_export-helper.js";
|
||||
const _style_0 = { "center-column": { "": { "width": 600, "height": 450, "borderRadius": 30, "overflow": "hidden" } } };
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false,
|
||||
isRecording: false,
|
||||
// 录屏状态
|
||||
isTalking: false,
|
||||
// 对讲状态
|
||||
// 内部 pending 请求队列,用于在 native 事件到达时把结果返回给特定 reqId
|
||||
// 结构: { snapshot: [reqId,...], record: [reqId,...], talk: [reqId,...] }
|
||||
// 注意:这仅用于在 native 事件没有直接 callback 时仍能把结果回传给请求方。
|
||||
_pendingRequests: {
|
||||
snapshot: [],
|
||||
record: [],
|
||||
talk: []
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const globalEvent = requireNativePlugin && requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:39", "myEvent", e);
|
||||
});
|
||||
}
|
||||
uni.$on("monitor:doSnapshot", this.doSnapshot);
|
||||
uni.$on("monitor:startRecord", this.doStartRecord);
|
||||
uni.$on("monitor:stopRecord", this.doStopRecord);
|
||||
uni.$on("monitor:openTalk", this.doOpenTalk);
|
||||
uni.$on("monitor:stopTalk", this.doStopTalk);
|
||||
uni.$on("monitor:switchDisplay", (payload) => this.switchDisplay(payload));
|
||||
uni.$on("monitor:startAlarm", this.startAlarm);
|
||||
uni.$on("monitor:stopAlarm", this.stopAlarm);
|
||||
uni.$on("monitor:flipImage", (payload) => this.flipImage(payload));
|
||||
uni.$on("monitor:resumeOrPause", this.resumeOrPause);
|
||||
uni.$on("monitor:changeQuality", this.changeQuality);
|
||||
uni.$on("monitor:test", this.test);
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off("monitor:doSnapshot", this.doSnapshot);
|
||||
uni.$off("monitor:startRecord", this.doStartRecord);
|
||||
uni.$off("monitor:stopRecord", this.doStopRecord);
|
||||
uni.$off("monitor:openTalk", this.doOpenTalk);
|
||||
uni.$off("monitor:stopTalk", this.doStopTalk);
|
||||
uni.$off("monitor:switchDisplay", (payload) => this.switchDisplay(payload));
|
||||
uni.$off("monitor:startAlarm", this.startAlarm);
|
||||
uni.$off("monitor:stopAlarm", this.stopAlarm);
|
||||
uni.$off("monitor:flipImage", (payload) => this.flipImage(payload));
|
||||
uni.$off("monitor:resumeOrPause", this.resumeOrPause);
|
||||
uni.$off("monitor:changeQuality", this.changeQuality);
|
||||
uni.$off("monitor:test", this.test);
|
||||
},
|
||||
methods: {
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
formatAppLog("log", "at pages/camera.nvue:77", "Tel event detail:", event.detail);
|
||||
},
|
||||
switchDisplay(mode) {
|
||||
formatAppLog("log", "at pages/camera.nvue:82", "zzzzz", mode);
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:89", "startAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
stopAlarm() {
|
||||
this.isAlarming = false;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:95", "stopAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:101", "flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
test() {
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法(支持 payload.reqId) ------------------ */
|
||||
// 1. 截图(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doSnapshot(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({ title: "组件不支持 snapShot()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "snapShot_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.snapshot.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:139", "snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res, payload.reqId);
|
||||
});
|
||||
uni.showToast({ title: "正在截屏...", icon: "none", duration: 800 });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:144", "snapShot 调用失败", err);
|
||||
uni.showToast({ title: "snapShot 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "snapShot_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 2. 开始录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStartRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({ title: "组件不支持 startRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "startRecord_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:164", "startRecord callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({ title: "录屏已开始", icon: "none" });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:173", "startRecord 调用失败", err);
|
||||
uni.showToast({ title: "startRecord 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "startRecord_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 3. 停止录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({ title: "组件不支持 stopRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopRecord_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.record.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:199", "stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res, payload.reqId);
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:204", "stopRecord 调用失败", err);
|
||||
uni.showToast({ title: "stopRecord 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopRecord_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 4. 开始对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doOpenTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({ title: "组件不支持 openTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "openTalk_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.talk.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:228", "openTalk callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = true;
|
||||
uni.showToast({ title: "尝试建立对讲连接...", icon: "none" });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:237", "openTalk 调用失败", err);
|
||||
uni.showToast({ title: "openTalk 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "openTalk_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 5. 停止对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({ title: "组件不支持 stopTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopTalk_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:257", "stopTalk callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = false;
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:264", "stopTalk 调用失败", err);
|
||||
uni.showToast({ title: "stopTalk 调用失败", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopTalk_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:277", "onSnapShot event:", payload);
|
||||
this._handleSnapshotResultFromNative(payload);
|
||||
},
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:285", "onRecord event:", payload);
|
||||
this._handleRecordResultFromNative(payload);
|
||||
},
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:292", "onTalkStatus event:", payload);
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
uni.$emit("monitor:talk:status", payload);
|
||||
if (this._pendingRequests.talk && this._pendingRequests.talk.length) {
|
||||
while (this._pendingRequests.talk.length) {
|
||||
const reqId = this._pendingRequests.talk.shift();
|
||||
uni.$emit(`monitor:response:${reqId}`, { ok: true, payload });
|
||||
}
|
||||
}
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({ title: tips || "对讲连接中...", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({ title: tips || "对讲已连接", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({ title: tips || "对讲已停止", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({ title: tips || "对讲失败", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
uni.showToast({ title: tips || "对讲状态: " + (status || "unknown"), icon: "none" });
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
_handleSnapshotResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "截图没有返回数据", icon: "none" });
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: "no_data" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/camera.nvue:345", "snapshot payload normalized:", payload);
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
if (!reqIdFromCallback && this._pendingRequests.snapshot && this._pendingRequests.snapshot.length) {
|
||||
while (this._pendingRequests.snapshot.length) {
|
||||
const rid = this._pendingRequests.snapshot.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
}
|
||||
uni.$emit("monitor:snapshot:done", payload);
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({ title: "截图成功", icon: "success", duration: 1200 });
|
||||
if (url) {
|
||||
uni.previewImage({ urls: [url] });
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({ title: "截图失败: " + err, icon: "none", duration: 2e3 });
|
||||
formatAppLog("warn", "at pages/camera.nvue:372", "snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
_handleRecordResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "录屏没有返回数据", icon: "none" });
|
||||
this.isRecording = false;
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: "no_data" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/camera.nvue:388", "record payload normalized:", payload);
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
if (!reqIdFromCallback && this._pendingRequests.record && this._pendingRequests.record.length) {
|
||||
while (this._pendingRequests.record.length) {
|
||||
const rid = this._pendingRequests.record.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
}
|
||||
uni.$emit("monitor:record:done", payload);
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({ title: "录屏完成", icon: "success", duration: 1400 });
|
||||
this.isRecording = false;
|
||||
formatAppLog("log", "at pages/camera.nvue:409", "录屏地址:", payload.recordUrl);
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({ title: "录屏失败: " + payload.recordFailedReason, icon: "none", duration: 2e3 });
|
||||
this.isRecording = false;
|
||||
formatAppLog("warn", "at pages/camera.nvue:413", "record failed reason:", payload.recordFailedReason);
|
||||
} else {
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({ title: "录屏操作已完成(返回未知)", icon: "none" });
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorView = resolveComponent("MonitorView");
|
||||
return openBlock(), createElementBlock("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
createElementVNode("div", { class: "center-column" }, [
|
||||
createCommentVNode(" 视频播放组件 "),
|
||||
createVNode(_component_MonitorView, {
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "600px", "height": "450px" },
|
||||
onOnTel: $options.handleTelEvent,
|
||||
onOnSnapShot: $options.handleSnapShotEvent,
|
||||
onOnRecord: $options.handleRecordEvent,
|
||||
onOnTalkStatus: $options.handleTalkEvent
|
||||
}, null, 8, ["onOnTel", "onOnSnapShot", "onOnRecord", "onOnTalkStatus"])
|
||||
])
|
||||
]);
|
||||
}
|
||||
const camera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app/pages/camera.nvue"]]);
|
||||
export {
|
||||
camera as default
|
||||
};
|
||||
|
|
@ -1,82 +1,318 @@
|
|||
import { r as requireNativePlugin, f as formatAppLog } from "../uni-app.es.js";
|
||||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, createVNode, withCtx, createTextVNode } from "vue";
|
||||
function requireNativePlugin(name) {
|
||||
return weex.requireModule(name);
|
||||
}
|
||||
function formatAppLog(type, filename, ...args) {
|
||||
if (uni.__log__) {
|
||||
uni.__log__(type, filename, ...args);
|
||||
} else {
|
||||
console[type].apply(console, [...args, filename]);
|
||||
}
|
||||
}
|
||||
const _style_0 = { "center-column": { "": { "display": "flex", "flexDirection": "column", "alignItems": "center" } }, "button-group": { "": { "display": "flex", "flexDirection": "row", "flexWrap": "wrap", "justifyContent": "center", "marginTop": "20rpx" } } };
|
||||
const _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
import { _ as _export_sfc } from "../_plugin-vue_export-helper.js";
|
||||
const _style_0 = { "center-column": { "": { "display": "flex", "flexDirection": "column", "alignItems": "center" } }, "button-group": { "": { "display": "flex", "flexDirection": "row", "flexWrap": "wrap", "justifyContent": "center", "marginTop": 40, "width": 620 } }, "button": { "": { "marginTop": 6, "marginRight": 6, "marginBottom": 6, "marginLeft": 6, "paddingTop": 8, "paddingRight": 12, "paddingBottom": 8, "paddingLeft": 12, "minWidth": "120px", "height": 44, "borderRadius": 6, "borderWidth": 1, "borderStyle": "solid", "borderColor": "#dddddd", "backgroundColor": "#ffffff" } } };
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false
|
||||
isAlarming: false,
|
||||
isRecording: false,
|
||||
// 录屏状态
|
||||
isTalking: false
|
||||
// 对讲状态
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const globalEvent = requireNativePlugin("globalEvent");
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:47", "myEvent", e);
|
||||
uni.showToast({
|
||||
title: "myEvent: " + JSON.stringify(e),
|
||||
duration: 2e3
|
||||
const globalEvent = requireNativePlugin && requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:73", "myEvent", e);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:56", "Tel event detail:", event.detail);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:80", "Tel event detail:", event.detail);
|
||||
},
|
||||
// 切换播放模式
|
||||
switchDisplay(mode) {
|
||||
this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
// 手动报警
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:70", "startAlarm callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:91", "startAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
stopAlarm() {
|
||||
this.isAlarming = false;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:76", "stopAlarm callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:97", "stopAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
// 翻转图像
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:83", "flipImage callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:103", "flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
// 暂停或继续
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause();
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
// 切换清晰度
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality();
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
// 测试按钮
|
||||
test() {
|
||||
this.$refs.monitor.test();
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法 ------------------ */
|
||||
// 1. 截图(调用)
|
||||
doSnapshot() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 snapShot()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:134", "snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res);
|
||||
});
|
||||
uni.showToast({
|
||||
title: "正在截屏...",
|
||||
icon: "none",
|
||||
duration: 800
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:143", "snapShot 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "snapShot 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 2. 开始录屏(调用)
|
||||
doStartRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 startRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:163", "startRecord callback:", res);
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({
|
||||
title: "录屏已开始",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:171", "startRecord 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "startRecord 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 3. 停止录屏(调用)
|
||||
doStopRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 stopRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:191", "stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res);
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:196", "stopRecord 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "stopRecord 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 4. 开始对讲(调用)
|
||||
doOpenTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 openTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:215", "openTalk callback:", res);
|
||||
});
|
||||
this.isTalking = true;
|
||||
uni.showToast({
|
||||
title: "尝试建立对讲连接...",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:225", "openTalk 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "openTalk 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 5. 停止对讲(调用)
|
||||
doStopTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({
|
||||
title: "组件不支持 stopTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:244", "stopTalk callback:", res);
|
||||
});
|
||||
this.isTalking = false;
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:250", "stopTalk 调用失败", err);
|
||||
uni.showToast({
|
||||
title: "stopTalk 调用失败",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:263", "onSnapShot event:", event && event.detail ? event.detail : event);
|
||||
this._handleSnapshotResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:270", "onRecord event:", event && event.detail ? event.detail : event);
|
||||
this._handleRecordResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:278", "onTalkStatus event:", payload);
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({
|
||||
title: tips || "对讲连接中...",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({
|
||||
title: tips || "对讲已连接",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({
|
||||
title: tips || "对讲已停止",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({
|
||||
title: tips || "对讲失败",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
uni.showToast({
|
||||
title: tips || "对讲状态: " + (status || "unknown"),
|
||||
icon: "none"
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
_handleSnapshotResultFromNative(res) {
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "截图没有返回数据",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:337", "snapshot payload normalized:", payload);
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({
|
||||
title: "截图成功",
|
||||
icon: "success",
|
||||
duration: 1200
|
||||
});
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:345", "截图地址:", url);
|
||||
if (url) {
|
||||
uni.previewImage({
|
||||
urls: [url]
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({
|
||||
title: "截图失败: " + err,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
formatAppLog("warn", "at pages/ceshianzhuo.nvue:360", "snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
_handleRecordResultFromNative(res) {
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "录屏没有返回数据",
|
||||
icon: "none"
|
||||
});
|
||||
this.isRecording = false;
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:377", "record payload normalized:", payload);
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({
|
||||
title: "录屏完成",
|
||||
icon: "success",
|
||||
duration: 1400
|
||||
});
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:386", "录屏地址:", payload.recordUrl);
|
||||
this.isRecording = false;
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({
|
||||
title: "录屏失败: " + payload.recordFailedReason,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
formatAppLog("warn", "at pages/ceshianzhuo.nvue:395", "record failed reason:", payload.recordFailedReason);
|
||||
this.isRecording = false;
|
||||
} else {
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({
|
||||
title: "录屏操作已完成(返回未知)",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorView = resolveComponent("MonitorView");
|
||||
const _component_MonitorControlView = resolveComponent("MonitorControlView");
|
||||
const _component_button = resolveComponent("button");
|
||||
return openBlock(), createElementBlock("scroll-view", {
|
||||
scrollY: true,
|
||||
|
|
@ -86,153 +322,258 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
createElementVNode("div", { class: "center-column" }, [
|
||||
createCommentVNode(" 视频播放组件 "),
|
||||
createCommentVNode(" 视频播放组件,监听原生事件 "),
|
||||
createVNode(_component_MonitorView, {
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "300rpx", "height": "200rpx", "margin-top": "20rpx" },
|
||||
onOnTel: $options.handleTelEvent
|
||||
}, null, 8, ["onOnTel"]),
|
||||
createCommentVNode(" 云台控制组件 "),
|
||||
createCommentVNode(' <MonitorControlView ref="control" init="5" style="width:300rpx;height:300rpx;margin-top: 20rpx;" /> '),
|
||||
createCommentVNode(" 功能按钮 "),
|
||||
createElementVNode("div", { class: "button-group" }, [
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => $options.switchDisplay(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("原图")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => $options.switchDisplay(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("四分屏")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => $options.switchDisplay(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("180°全景")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => $options.switchDisplay(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("360°全景")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => $options.switchDisplay(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("环状全景")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, { onClick: $options.startAlarm }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("开启手动报警")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, { onClick: $options.stopAlarm }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("停止手动报警")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => $options.flipImage(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("左右翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => $options.flipImage(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("上下翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[7] || (_cache[7] = ($event) => $options.flipImage(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("中心翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[8] || (_cache[8] = ($event) => $options.flipImage(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("顺时针90°")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[9] || (_cache[9] = ($event) => $options.flipImage(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针90°")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[10] || (_cache[10] = ($event) => $options.flipImage(5))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针180°")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
onClick: _cache[11] || (_cache[11] = ($event) => $options.flipImage(6))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("不翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, { onClick: $options.resumeOrPause }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("暂停/继续")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, { onClick: $options.changeQuality }, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("切换清晰度")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"])
|
||||
style: { "width": "300px", "height": "200px", "margin-top": "20px" },
|
||||
onOnTel: $options.handleTelEvent,
|
||||
onOnSnapShot: $options.handleSnapShotEvent,
|
||||
onOnRecord: $options.handleRecordEvent,
|
||||
onOnTalkStatus: $options.handleTalkEvent
|
||||
}, null, 8, ["onOnTel", "onOnSnapShot", "onOnRecord", "onOnTalkStatus"]),
|
||||
createElementVNode("view", { style: { "display": "flex", "flex-direction": "row", "align-items": "flex-start" } }, [
|
||||
createCommentVNode(" 云台控制组件 "),
|
||||
createVNode(
|
||||
_component_MonitorControlView,
|
||||
{
|
||||
ref: "control",
|
||||
init: "5",
|
||||
style: { "width": "300px", "height": "300px", "margin-top": "20px" }
|
||||
},
|
||||
null,
|
||||
512
|
||||
/* NEED_PATCH */
|
||||
),
|
||||
createCommentVNode(" 功能按钮 "),
|
||||
createElementVNode("div", { class: "button-group" }, [
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => $options.switchDisplay(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("原图")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => $options.switchDisplay(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("四分屏")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => $options.switchDisplay(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("180°全景")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => $options.switchDisplay(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("360°全景")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => $options.switchDisplay(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("环状全景")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.startAlarm
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("开启手动报警")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.stopAlarm
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("停止手动报警")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => $options.flipImage(0))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("左右翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => $options.flipImage(1))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("上下翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[7] || (_cache[7] = ($event) => $options.flipImage(2))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("中心翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[8] || (_cache[8] = ($event) => $options.flipImage(3))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("顺时针90°")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[9] || (_cache[9] = ($event) => $options.flipImage(4))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针90°")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[10] || (_cache[10] = ($event) => $options.flipImage(5))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("逆时针180°")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[11] || (_cache[11] = ($event) => $options.flipImage(6))
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("不翻转")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.resumeOrPause
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("暂停/继续")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.changeQuality
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("切换清晰度")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createCommentVNode(" === 新增的功能按钮:截图 / 录屏 / 对讲 === "),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.doSnapshot
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("截图")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: $data.isRecording,
|
||||
onClick: $options.doStartRecord
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 开始录屏 ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: !$data.isRecording,
|
||||
onClick: $options.doStopRecord
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 结束录屏 ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: $data.isTalking,
|
||||
onClick: $options.doOpenTalk
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 开始对讲 ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
disabled: !$data.isTalking,
|
||||
onClick: $options.doStopTalk
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(" 结束对讲 ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
createCommentVNode(" 测试按钮 "),
|
||||
createVNode(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.test
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode("test")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"])
|
||||
])
|
||||
])
|
||||
])
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
import { resolveComponent, openBlock, createElementBlock, createElementVNode, createCommentVNode, createVNode } from "vue";
|
||||
import { _ as _export_sfc } from "../_plugin-vue_export-helper.js";
|
||||
const _style_0 = { "center-column": { "": { "width": 170, "height": 170, "borderRadius": 80 } } };
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorControlView = resolveComponent("MonitorControlView");
|
||||
return openBlock(), createElementBlock("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
createElementVNode("div", {
|
||||
class: "center-column",
|
||||
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.jumptonve && _ctx.jumptonve(...args))
|
||||
}, [
|
||||
createCommentVNode(" 视频播放组件 "),
|
||||
createVNode(
|
||||
_component_MonitorControlView,
|
||||
{
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "170px", "height": "170px" }
|
||||
},
|
||||
null,
|
||||
512
|
||||
/* NEED_PATCH */
|
||||
)
|
||||
])
|
||||
]);
|
||||
}
|
||||
const option = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app/pages/option.nvue"]]);
|
||||
export {
|
||||
option as default
|
||||
};
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import "vue";
|
||||
function requireNativePlugin(name) {
|
||||
return weex.requireModule(name);
|
||||
}
|
||||
function formatAppLog(type, filename, ...args) {
|
||||
if (uni.__log__) {
|
||||
uni.__log__(type, filename, ...args);
|
||||
} else {
|
||||
console[type].apply(console, [...args, filename]);
|
||||
}
|
||||
}
|
||||
export {
|
||||
formatAppLog as f,
|
||||
requireNativePlugin as r
|
||||
};
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
"id": "__UNI__FB2D473",
|
||||
"name": "护理单元",
|
||||
"version": {
|
||||
"name": "1.5.4",
|
||||
"code": 154
|
||||
"name": "1.5.6",
|
||||
"code": 156
|
||||
},
|
||||
"description": "护理单元",
|
||||
"developer": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,481 @@
|
|||
"use weex:vue";
|
||||
|
||||
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
||||
Promise.prototype.finally = function(callback) {
|
||||
const promise = this.constructor
|
||||
return this.then(
|
||||
value => promise.resolve(callback()).then(() => value),
|
||||
reason => promise.resolve(callback()).then(() => {
|
||||
throw reason
|
||||
})
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
||||
const global = uni.requireGlobal()
|
||||
ArrayBuffer = global.ArrayBuffer
|
||||
Int8Array = global.Int8Array
|
||||
Uint8Array = global.Uint8Array
|
||||
Uint8ClampedArray = global.Uint8ClampedArray
|
||||
Int16Array = global.Int16Array
|
||||
Uint16Array = global.Uint16Array
|
||||
Int32Array = global.Int32Array
|
||||
Uint32Array = global.Uint32Array
|
||||
Float32Array = global.Float32Array
|
||||
Float64Array = global.Float64Array
|
||||
BigInt64Array = global.BigInt64Array
|
||||
BigUint64Array = global.BigUint64Array
|
||||
};
|
||||
|
||||
|
||||
(() => {
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// vue-ns:vue
|
||||
var require_vue = __commonJS({
|
||||
"vue-ns:vue"(exports, module) {
|
||||
module.exports = Vue;
|
||||
}
|
||||
});
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/uni-app.es.js
|
||||
var import_vue = __toESM(require_vue());
|
||||
function requireNativePlugin(name) {
|
||||
return weex.requireModule(name);
|
||||
}
|
||||
function formatAppLog(type, filename, ...args) {
|
||||
if (uni.__log__) {
|
||||
uni.__log__(type, filename, ...args);
|
||||
} else {
|
||||
console[type].apply(console, [...args, filename]);
|
||||
}
|
||||
}
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/pages/camera.js
|
||||
var import_vue2 = __toESM(require_vue());
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/_plugin-vue_export-helper.js
|
||||
var _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/pages/camera.js
|
||||
var _style_0 = { "center-column": { "": { "width": 600, "height": 450, "borderRadius": 30, "overflow": "hidden" } } };
|
||||
var _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false,
|
||||
isRecording: false,
|
||||
// 录屏状态
|
||||
isTalking: false,
|
||||
// 对讲状态
|
||||
// 内部 pending 请求队列,用于在 native 事件到达时把结果返回给特定 reqId
|
||||
// 结构: { snapshot: [reqId,...], record: [reqId,...], talk: [reqId,...] }
|
||||
// 注意:这仅用于在 native 事件没有直接 callback 时仍能把结果回传给请求方。
|
||||
_pendingRequests: {
|
||||
snapshot: [],
|
||||
record: [],
|
||||
talk: []
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const globalEvent = requireNativePlugin && requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:39", "myEvent", e);
|
||||
});
|
||||
}
|
||||
uni.$on("monitor:doSnapshot", this.doSnapshot);
|
||||
uni.$on("monitor:startRecord", this.doStartRecord);
|
||||
uni.$on("monitor:stopRecord", this.doStopRecord);
|
||||
uni.$on("monitor:openTalk", this.doOpenTalk);
|
||||
uni.$on("monitor:stopTalk", this.doStopTalk);
|
||||
uni.$on("monitor:switchDisplay", (payload) => this.switchDisplay(payload));
|
||||
uni.$on("monitor:startAlarm", this.startAlarm);
|
||||
uni.$on("monitor:stopAlarm", this.stopAlarm);
|
||||
uni.$on("monitor:flipImage", (payload) => this.flipImage(payload));
|
||||
uni.$on("monitor:resumeOrPause", this.resumeOrPause);
|
||||
uni.$on("monitor:changeQuality", this.changeQuality);
|
||||
uni.$on("monitor:test", this.test);
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off("monitor:doSnapshot", this.doSnapshot);
|
||||
uni.$off("monitor:startRecord", this.doStartRecord);
|
||||
uni.$off("monitor:stopRecord", this.doStopRecord);
|
||||
uni.$off("monitor:openTalk", this.doOpenTalk);
|
||||
uni.$off("monitor:stopTalk", this.doStopTalk);
|
||||
uni.$off("monitor:switchDisplay", (payload) => this.switchDisplay(payload));
|
||||
uni.$off("monitor:startAlarm", this.startAlarm);
|
||||
uni.$off("monitor:stopAlarm", this.stopAlarm);
|
||||
uni.$off("monitor:flipImage", (payload) => this.flipImage(payload));
|
||||
uni.$off("monitor:resumeOrPause", this.resumeOrPause);
|
||||
uni.$off("monitor:changeQuality", this.changeQuality);
|
||||
uni.$off("monitor:test", this.test);
|
||||
},
|
||||
methods: {
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
formatAppLog("log", "at pages/camera.nvue:77", "Tel event detail:", event.detail);
|
||||
},
|
||||
switchDisplay(mode) {
|
||||
formatAppLog("log", "at pages/camera.nvue:82", "zzzzz", mode);
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:89", "startAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
stopAlarm() {
|
||||
this.isAlarming = false;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:95", "stopAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:101", "flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
test() {
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法(支持 payload.reqId) ------------------ */
|
||||
// 1. 截图(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doSnapshot(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({ title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 snapShot()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "snapShot_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.snapshot.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:139", "snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res, payload.reqId);
|
||||
});
|
||||
uni.showToast({ title: "\u6B63\u5728\u622A\u5C4F...", icon: "none", duration: 800 });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:144", "snapShot \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({ title: "snapShot \u8C03\u7528\u5931\u8D25", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "snapShot_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 2. 开始录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStartRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({ title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 startRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "startRecord_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:164", "startRecord callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({ title: "\u5F55\u5C4F\u5DF2\u5F00\u59CB", icon: "none" });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:173", "startRecord \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({ title: "startRecord \u8C03\u7528\u5931\u8D25", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "startRecord_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 3. 停止录屏(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopRecord(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({ title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 stopRecord()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopRecord_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.record.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:199", "stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res, payload.reqId);
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:204", "stopRecord \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({ title: "stopRecord \u8C03\u7528\u5931\u8D25", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopRecord_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 4. 开始对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doOpenTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({ title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 openTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "openTalk_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (payload.reqId) {
|
||||
this._pendingRequests.talk.push(payload.reqId);
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:228", "openTalk callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = true;
|
||||
uni.showToast({ title: "\u5C1D\u8BD5\u5EFA\u7ACB\u5BF9\u8BB2\u8FDE\u63A5...", icon: "none" });
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:237", "openTalk \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({ title: "openTalk \u8C03\u7528\u5931\u8D25", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "openTalk_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
// 5. 停止对讲(调用)
|
||||
// payload 可选:{ reqId: number }
|
||||
doStopTalk(payload = {}) {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({ title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 stopTalk()", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopTalk_not_supported" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
formatAppLog("log", "at pages/camera.nvue:257", "stopTalk callback:", res);
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: true, res });
|
||||
}
|
||||
});
|
||||
this.isTalking = false;
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/camera.nvue:264", "stopTalk \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({ title: "stopTalk \u8C03\u7528\u5931\u8D25", icon: "none" });
|
||||
if (payload.reqId) {
|
||||
uni.$emit(`monitor:response:${payload.reqId}`, { ok: false, error: "stopTalk_call_failed", detail: String(err) });
|
||||
}
|
||||
}
|
||||
},
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:277", "onSnapShot event:", payload);
|
||||
this._handleSnapshotResultFromNative(payload);
|
||||
},
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:285", "onRecord event:", payload);
|
||||
this._handleRecordResultFromNative(payload);
|
||||
},
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/camera.nvue:292", "onTalkStatus event:", payload);
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
uni.$emit("monitor:talk:status", payload);
|
||||
if (this._pendingRequests.talk && this._pendingRequests.talk.length) {
|
||||
while (this._pendingRequests.talk.length) {
|
||||
const reqId = this._pendingRequests.talk.shift();
|
||||
uni.$emit(`monitor:response:${reqId}`, { ok: true, payload });
|
||||
}
|
||||
}
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({ title: tips || "\u5BF9\u8BB2\u8FDE\u63A5\u4E2D...", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({ title: tips || "\u5BF9\u8BB2\u5DF2\u8FDE\u63A5", icon: "none" });
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({ title: tips || "\u5BF9\u8BB2\u5DF2\u505C\u6B62", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({ title: tips || "\u5BF9\u8BB2\u5931\u8D25", icon: "none" });
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
uni.showToast({ title: tips || "\u5BF9\u8BB2\u72B6\u6001: " + (status || "unknown"), icon: "none" });
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
_handleSnapshotResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "\u622A\u56FE\u6CA1\u6709\u8FD4\u56DE\u6570\u636E", icon: "none" });
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: "no_data" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/camera.nvue:345", "snapshot payload normalized:", payload);
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
if (!reqIdFromCallback && this._pendingRequests.snapshot && this._pendingRequests.snapshot.length) {
|
||||
while (this._pendingRequests.snapshot.length) {
|
||||
const rid = this._pendingRequests.snapshot.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!payload.snapShotResult, payload });
|
||||
}
|
||||
}
|
||||
uni.$emit("monitor:snapshot:done", payload);
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({ title: "\u622A\u56FE\u6210\u529F", icon: "success", duration: 1200 });
|
||||
if (url) {
|
||||
uni.previewImage({ urls: [url] });
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({ title: "\u622A\u56FE\u5931\u8D25: " + err, icon: "none", duration: 2e3 });
|
||||
formatAppLog("warn", "at pages/camera.nvue:372", "snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
_handleRecordResultFromNative(res, reqIdFromCallback = null) {
|
||||
if (!res) {
|
||||
uni.showToast({ title: "\u5F55\u5C4F\u6CA1\u6709\u8FD4\u56DE\u6570\u636E", icon: "none" });
|
||||
this.isRecording = false;
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: false, error: "no_data" });
|
||||
}
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/camera.nvue:388", "record payload normalized:", payload);
|
||||
if (reqIdFromCallback) {
|
||||
uni.$emit(`monitor:response:${reqIdFromCallback}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
if (!reqIdFromCallback && this._pendingRequests.record && this._pendingRequests.record.length) {
|
||||
while (this._pendingRequests.record.length) {
|
||||
const rid = this._pendingRequests.record.shift();
|
||||
uni.$emit(`monitor:response:${rid}`, { ok: !!(payload.recordUrl || payload.snapShotResult), payload });
|
||||
}
|
||||
}
|
||||
uni.$emit("monitor:record:done", payload);
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({ title: "\u5F55\u5C4F\u5B8C\u6210", icon: "success", duration: 1400 });
|
||||
this.isRecording = false;
|
||||
formatAppLog("log", "at pages/camera.nvue:409", "\u5F55\u5C4F\u5730\u5740\uFF1A", payload.recordUrl);
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({ title: "\u5F55\u5C4F\u5931\u8D25: " + payload.recordFailedReason, icon: "none", duration: 2e3 });
|
||||
this.isRecording = false;
|
||||
formatAppLog("warn", "at pages/camera.nvue:413", "record failed reason:", payload.recordFailedReason);
|
||||
} else {
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({ title: "\u5F55\u5C4F\u64CD\u4F5C\u5DF2\u5B8C\u6210\uFF08\u8FD4\u56DE\u672A\u77E5\uFF09", icon: "none" });
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorView = (0, import_vue2.resolveComponent)("MonitorView");
|
||||
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
(0, import_vue2.createElementVNode)("div", { class: "center-column" }, [
|
||||
(0, import_vue2.createCommentVNode)(" \u89C6\u9891\u64AD\u653E\u7EC4\u4EF6 "),
|
||||
(0, import_vue2.createVNode)(_component_MonitorView, {
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "600px", "height": "450px" },
|
||||
onOnTel: $options.handleTelEvent,
|
||||
onOnSnapShot: $options.handleSnapShotEvent,
|
||||
onOnRecord: $options.handleRecordEvent,
|
||||
onOnTalkStatus: $options.handleTalkEvent
|
||||
}, null, 8, ["onOnTel", "onOnSnapShot", "onOnRecord", "onOnTalkStatus"])
|
||||
])
|
||||
]);
|
||||
}
|
||||
var camera = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app/pages/camera.nvue"]]);
|
||||
|
||||
// <stdin>
|
||||
var webview = plus.webview.currentWebview();
|
||||
if (webview) {
|
||||
const __pageId = parseInt(webview.id);
|
||||
const __pagePath = "pages/camera";
|
||||
let __pageQuery = {};
|
||||
try {
|
||||
__pageQuery = JSON.parse(webview.__query__);
|
||||
} catch (e) {
|
||||
}
|
||||
camera.mpType = "page";
|
||||
const app = Vue.createPageApp(camera, { $store: getApp({ allowDefault: true }).$store, __pageId, __pagePath, __pageQuery });
|
||||
app.provide("__globalStyles", Vue.useCssStyles([...__uniConfig.styles, ...camera.styles || []]));
|
||||
app.mount("#root");
|
||||
}
|
||||
})();
|
||||
|
|
@ -63,7 +63,7 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
|||
}
|
||||
});
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/pages/ceshianzhuo.js
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/uni-app.es.js
|
||||
var import_vue = __toESM(require_vue());
|
||||
function requireNativePlugin(name) {
|
||||
return weex.requireModule(name);
|
||||
|
|
@ -75,7 +75,11 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
|||
console[type].apply(console, [...args, filename]);
|
||||
}
|
||||
}
|
||||
var _style_0 = { "center-column": { "": { "display": "flex", "flexDirection": "column", "alignItems": "center" } }, "button-group": { "": { "display": "flex", "flexDirection": "row", "flexWrap": "wrap", "justifyContent": "center", "marginTop": "20rpx" } } };
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/pages/ceshianzhuo.js
|
||||
var import_vue2 = __toESM(require_vue());
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/_plugin-vue_export-helper.js
|
||||
var _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
|
|
@ -83,222 +87,581 @@ if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
|||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/pages/ceshianzhuo.js
|
||||
var _style_0 = { "center-column": { "": { "display": "flex", "flexDirection": "column", "alignItems": "center" } }, "button-group": { "": { "display": "flex", "flexDirection": "row", "flexWrap": "wrap", "justifyContent": "center", "marginTop": 40, "width": 620 } }, "button": { "": { "marginTop": 6, "marginRight": 6, "marginBottom": 6, "marginLeft": 6, "paddingTop": 8, "paddingRight": 12, "paddingBottom": 8, "paddingLeft": 12, "minWidth": "120px", "height": 44, "borderRadius": 6, "borderWidth": 1, "borderStyle": "solid", "borderColor": "#dddddd", "backgroundColor": "#ffffff" } } };
|
||||
var _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
phoneNumber: "1234567890",
|
||||
isAlarming: false
|
||||
isAlarming: false,
|
||||
isRecording: false,
|
||||
// 录屏状态
|
||||
isTalking: false
|
||||
// 对讲状态
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
const globalEvent = requireNativePlugin("globalEvent");
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:47", "myEvent", e);
|
||||
uni.showToast({
|
||||
title: "myEvent: " + JSON.stringify(e),
|
||||
duration: 2e3
|
||||
const globalEvent = requireNativePlugin && requireNativePlugin("globalEvent");
|
||||
if (globalEvent && globalEvent.addEventListener) {
|
||||
globalEvent.addEventListener("myEvent", (e) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:73", "myEvent", e);
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* ------------------ 原有功能 ------------------ */
|
||||
handleTelEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:56", "Tel event detail:", event.detail);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:80", "Tel event detail:", event.detail);
|
||||
},
|
||||
// 切换播放模式
|
||||
switchDisplay(mode) {
|
||||
this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
this.$refs.monitor && this.$refs.monitor.switchDisplayModeFragment(mode);
|
||||
},
|
||||
// 手动报警
|
||||
startAlarm() {
|
||||
this.isAlarming = true;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:70", "startAlarm callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:91", "startAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
stopAlarm() {
|
||||
this.isAlarming = false;
|
||||
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:76", "stopAlarm callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:97", "stopAlarm callback:", res);
|
||||
});
|
||||
},
|
||||
// 翻转图像
|
||||
flipImage(type) {
|
||||
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:83", "flipImage callback:", res);
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:103", "flipImage callback:", res);
|
||||
});
|
||||
},
|
||||
// 暂停或继续
|
||||
resumeOrPause() {
|
||||
this.$refs.monitor.resumeOrPause();
|
||||
this.$refs.monitor.resumeOrPause && this.$refs.monitor.resumeOrPause();
|
||||
},
|
||||
// 切换清晰度
|
||||
changeQuality() {
|
||||
this.$refs.monitor.changeQuality();
|
||||
this.$refs.monitor.changeQuality && this.$refs.monitor.changeQuality();
|
||||
},
|
||||
// 测试按钮
|
||||
test() {
|
||||
this.$refs.monitor.test();
|
||||
this.$refs.monitor && this.$refs.monitor.test && this.$refs.monitor.test();
|
||||
},
|
||||
/* ------------------ 新增:截图/录屏/对讲 调用方法 ------------------ */
|
||||
// 1. 截图(调用)
|
||||
doSnapshot() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.snapShot) {
|
||||
uni.showToast({
|
||||
title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 snapShot()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.snapShot((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:134", "snapShot callback:", res);
|
||||
this._handleSnapshotResultFromNative(res);
|
||||
});
|
||||
uni.showToast({
|
||||
title: "\u6B63\u5728\u622A\u5C4F...",
|
||||
icon: "none",
|
||||
duration: 800
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:143", "snapShot \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({
|
||||
title: "snapShot \u8C03\u7528\u5931\u8D25",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 2. 开始录屏(调用)
|
||||
doStartRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.startRecord) {
|
||||
uni.showToast({
|
||||
title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 startRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.startRecord((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:163", "startRecord callback:", res);
|
||||
});
|
||||
this.isRecording = true;
|
||||
uni.showToast({
|
||||
title: "\u5F55\u5C4F\u5DF2\u5F00\u59CB",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:171", "startRecord \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({
|
||||
title: "startRecord \u8C03\u7528\u5931\u8D25",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 3. 停止录屏(调用)
|
||||
doStopRecord() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopRecord) {
|
||||
uni.showToast({
|
||||
title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 stopRecord()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopRecord((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:191", "stopRecord callback:", res);
|
||||
this._handleRecordResultFromNative(res);
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:196", "stopRecord \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({
|
||||
title: "stopRecord \u8C03\u7528\u5931\u8D25",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 4. 开始对讲(调用)
|
||||
doOpenTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.openTalk) {
|
||||
uni.showToast({
|
||||
title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 openTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.openTalk((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:215", "openTalk callback:", res);
|
||||
});
|
||||
this.isTalking = true;
|
||||
uni.showToast({
|
||||
title: "\u5C1D\u8BD5\u5EFA\u7ACB\u5BF9\u8BB2\u8FDE\u63A5...",
|
||||
icon: "none"
|
||||
});
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:225", "openTalk \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({
|
||||
title: "openTalk \u8C03\u7528\u5931\u8D25",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
// 5. 停止对讲(调用)
|
||||
doStopTalk() {
|
||||
if (!this.$refs.monitor || !this.$refs.monitor.stopTalk) {
|
||||
uni.showToast({
|
||||
title: "\u7EC4\u4EF6\u4E0D\u652F\u6301 stopTalk()",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.$refs.monitor.stopTalk((res) => {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:244", "stopTalk callback:", res);
|
||||
});
|
||||
this.isTalking = false;
|
||||
} catch (err) {
|
||||
formatAppLog("error", "at pages/ceshianzhuo.nvue:250", "stopTalk \u8C03\u7528\u5931\u8D25", err);
|
||||
uni.showToast({
|
||||
title: "stopTalk \u8C03\u7528\u5931\u8D25",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
},
|
||||
/* ------------------ 事件回调处理(来自原生推送的事件) ------------------ */
|
||||
// 处理来自模板 @onSnapShot 的事件(event.detail)
|
||||
handleSnapShotEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:263", "onSnapShot event:", event && event.detail ? event.detail : event);
|
||||
this._handleSnapshotResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
// 处理来自模板 @onRecord 的事件(event.detail)
|
||||
handleRecordEvent(event) {
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:270", "onRecord event:", event && event.detail ? event.detail : event);
|
||||
this._handleRecordResultFromNative(event && event.detail ? event.detail : event);
|
||||
},
|
||||
// 处理来自模板 @onTalkStatus 的事件
|
||||
handleTalkEvent(event) {
|
||||
const payload = event && event.detail ? event.detail : event;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:278", "onTalkStatus event:", payload);
|
||||
const status = payload && payload.talkStatus;
|
||||
const tips = payload && payload.tips;
|
||||
switch ((status || "").toLowerCase()) {
|
||||
case "loading":
|
||||
uni.showToast({
|
||||
title: tips || "\u5BF9\u8BB2\u8FDE\u63A5\u4E2D...",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "playing":
|
||||
uni.showToast({
|
||||
title: tips || "\u5BF9\u8BB2\u5DF2\u8FDE\u63A5",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = true;
|
||||
break;
|
||||
case "stopped":
|
||||
uni.showToast({
|
||||
title: tips || "\u5BF9\u8BB2\u5DF2\u505C\u6B62",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
case "failed":
|
||||
uni.showToast({
|
||||
title: tips || "\u5BF9\u8BB2\u5931\u8D25",
|
||||
icon: "none"
|
||||
});
|
||||
this.isTalking = false;
|
||||
break;
|
||||
default:
|
||||
uni.showToast({
|
||||
title: tips || "\u5BF9\u8BB2\u72B6\u6001: " + (status || "unknown"),
|
||||
icon: "none"
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ------------------ 原生结果的内部处理函数(统一处理 callback / event) ------------------ */
|
||||
_handleSnapshotResultFromNative(res) {
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "\u622A\u56FE\u6CA1\u6709\u8FD4\u56DE\u6570\u636E",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:337", "snapshot payload normalized:", payload);
|
||||
if (payload.snapShotResult === true || payload.snapShotResult === "true") {
|
||||
const url = payload.snapShotUrl || payload.snapShotPath || payload.url;
|
||||
uni.showToast({
|
||||
title: "\u622A\u56FE\u6210\u529F",
|
||||
icon: "success",
|
||||
duration: 1200
|
||||
});
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:345", "\u622A\u56FE\u5730\u5740\uFF1A", url);
|
||||
if (url) {
|
||||
uni.previewImage({
|
||||
urls: [url]
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const err = payload.snapShotErrorCode || payload.error || "unknown";
|
||||
uni.showToast({
|
||||
title: "\u622A\u56FE\u5931\u8D25: " + err,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
formatAppLog("warn", "at pages/ceshianzhuo.nvue:360", "snapshot failed reason:", err, payload);
|
||||
}
|
||||
},
|
||||
_handleRecordResultFromNative(res) {
|
||||
if (!res) {
|
||||
uni.showToast({
|
||||
title: "\u5F55\u5C4F\u6CA1\u6709\u8FD4\u56DE\u6570\u636E",
|
||||
icon: "none"
|
||||
});
|
||||
this.isRecording = false;
|
||||
return;
|
||||
}
|
||||
let payload = res;
|
||||
if (res.detail)
|
||||
payload = res.detail;
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:377", "record payload normalized:", payload);
|
||||
if (payload.recordUrl) {
|
||||
uni.showToast({
|
||||
title: "\u5F55\u5C4F\u5B8C\u6210",
|
||||
icon: "success",
|
||||
duration: 1400
|
||||
});
|
||||
formatAppLog("log", "at pages/ceshianzhuo.nvue:386", "\u5F55\u5C4F\u5730\u5740\uFF1A", payload.recordUrl);
|
||||
this.isRecording = false;
|
||||
} else if (payload.recordFailedReason) {
|
||||
uni.showToast({
|
||||
title: "\u5F55\u5C4F\u5931\u8D25: " + payload.recordFailedReason,
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
formatAppLog("warn", "at pages/ceshianzhuo.nvue:395", "record failed reason:", payload.recordFailedReason);
|
||||
this.isRecording = false;
|
||||
} else {
|
||||
if (payload.snapShotResult === true) {
|
||||
uni.showToast({
|
||||
title: "\u5F55\u5C4F\u64CD\u4F5C\u5DF2\u5B8C\u6210\uFF08\u8FD4\u56DE\u672A\u77E5\uFF09",
|
||||
icon: "none"
|
||||
});
|
||||
}
|
||||
this.isRecording = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorView = (0, import_vue.resolveComponent)("MonitorView");
|
||||
const _component_button = (0, import_vue.resolveComponent)("button");
|
||||
return (0, import_vue.openBlock)(), (0, import_vue.createElementBlock)("scroll-view", {
|
||||
const _component_MonitorView = (0, import_vue2.resolveComponent)("MonitorView");
|
||||
const _component_MonitorControlView = (0, import_vue2.resolveComponent)("MonitorControlView");
|
||||
const _component_button = (0, import_vue2.resolveComponent)("button");
|
||||
return (0, import_vue2.openBlock)(), (0, import_vue2.createElementBlock)("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
(0, import_vue.createElementVNode)("div", { class: "center-column" }, [
|
||||
(0, import_vue.createCommentVNode)(" \u89C6\u9891\u64AD\u653E\u7EC4\u4EF6 "),
|
||||
(0, import_vue.createVNode)(_component_MonitorView, {
|
||||
(0, import_vue2.createElementVNode)("div", { class: "center-column" }, [
|
||||
(0, import_vue2.createCommentVNode)(" \u89C6\u9891\u64AD\u653E\u7EC4\u4EF6\uFF0C\u76D1\u542C\u539F\u751F\u4E8B\u4EF6 "),
|
||||
(0, import_vue2.createVNode)(_component_MonitorView, {
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "300rpx", "height": "200rpx", "margin-top": "20rpx" },
|
||||
onOnTel: $options.handleTelEvent
|
||||
}, null, 8, ["onOnTel"]),
|
||||
(0, import_vue.createCommentVNode)(" \u4E91\u53F0\u63A7\u5236\u7EC4\u4EF6 "),
|
||||
(0, import_vue.createCommentVNode)(' <MonitorControlView ref="control" init="5" style="width:300rpx;height:300rpx;margin-top: 20rpx;" /> '),
|
||||
(0, import_vue.createCommentVNode)(" \u529F\u80FD\u6309\u94AE "),
|
||||
(0, import_vue.createElementVNode)("div", { class: "button-group" }, [
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => $options.switchDisplay(0))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u539F\u56FE")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => $options.switchDisplay(1))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u56DB\u5206\u5C4F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => $options.switchDisplay(2))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("180\xB0\u5168\u666F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => $options.switchDisplay(3))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("360\xB0\u5168\u666F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => $options.switchDisplay(4))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u73AF\u72B6\u5168\u666F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, { onClick: $options.startAlarm }, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u5F00\u542F\u624B\u52A8\u62A5\u8B66")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue.createVNode)(_component_button, { onClick: $options.stopAlarm }, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u505C\u6B62\u624B\u52A8\u62A5\u8B66")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => $options.flipImage(0))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u5DE6\u53F3\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => $options.flipImage(1))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u4E0A\u4E0B\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[7] || (_cache[7] = ($event) => $options.flipImage(2))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u4E2D\u5FC3\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[8] || (_cache[8] = ($event) => $options.flipImage(3))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u987A\u65F6\u948890\xB0")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[9] || (_cache[9] = ($event) => $options.flipImage(4))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u9006\u65F6\u948890\xB0")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[10] || (_cache[10] = ($event) => $options.flipImage(5))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u9006\u65F6\u9488180\xB0")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, {
|
||||
onClick: _cache[11] || (_cache[11] = ($event) => $options.flipImage(6))
|
||||
}, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u4E0D\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue.createVNode)(_component_button, { onClick: $options.resumeOrPause }, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u6682\u505C/\u7EE7\u7EED")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue.createVNode)(_component_button, { onClick: $options.changeQuality }, {
|
||||
default: (0, import_vue.withCtx)(() => [
|
||||
(0, import_vue.createTextVNode)("\u5207\u6362\u6E05\u6670\u5EA6")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"])
|
||||
style: { "width": "300px", "height": "200px", "margin-top": "20px" },
|
||||
onOnTel: $options.handleTelEvent,
|
||||
onOnSnapShot: $options.handleSnapShotEvent,
|
||||
onOnRecord: $options.handleRecordEvent,
|
||||
onOnTalkStatus: $options.handleTalkEvent
|
||||
}, null, 8, ["onOnTel", "onOnSnapShot", "onOnRecord", "onOnTalkStatus"]),
|
||||
(0, import_vue2.createElementVNode)("view", { style: { "display": "flex", "flex-direction": "row", "align-items": "flex-start" } }, [
|
||||
(0, import_vue2.createCommentVNode)(" \u4E91\u53F0\u63A7\u5236\u7EC4\u4EF6 "),
|
||||
(0, import_vue2.createVNode)(
|
||||
_component_MonitorControlView,
|
||||
{
|
||||
ref: "control",
|
||||
init: "5",
|
||||
style: { "width": "300px", "height": "300px", "margin-top": "20px" }
|
||||
},
|
||||
null,
|
||||
512
|
||||
/* NEED_PATCH */
|
||||
),
|
||||
(0, import_vue2.createCommentVNode)(" \u529F\u80FD\u6309\u94AE "),
|
||||
(0, import_vue2.createElementVNode)("div", { class: "button-group" }, [
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[0] || (_cache[0] = ($event) => $options.switchDisplay(0))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u539F\u56FE")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[1] || (_cache[1] = ($event) => $options.switchDisplay(1))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u56DB\u5206\u5C4F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[2] || (_cache[2] = ($event) => $options.switchDisplay(2))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("180\xB0\u5168\u666F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[3] || (_cache[3] = ($event) => $options.switchDisplay(3))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("360\xB0\u5168\u666F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[4] || (_cache[4] = ($event) => $options.switchDisplay(4))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u73AF\u72B6\u5168\u666F")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.startAlarm
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u5F00\u542F\u624B\u52A8\u62A5\u8B66")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.stopAlarm
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u505C\u6B62\u624B\u52A8\u62A5\u8B66")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[5] || (_cache[5] = ($event) => $options.flipImage(0))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u5DE6\u53F3\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[6] || (_cache[6] = ($event) => $options.flipImage(1))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u4E0A\u4E0B\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[7] || (_cache[7] = ($event) => $options.flipImage(2))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u4E2D\u5FC3\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[8] || (_cache[8] = ($event) => $options.flipImage(3))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u987A\u65F6\u948890\xB0")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[9] || (_cache[9] = ($event) => $options.flipImage(4))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u9006\u65F6\u948890\xB0")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[10] || (_cache[10] = ($event) => $options.flipImage(5))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u9006\u65F6\u9488180\xB0")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: _cache[11] || (_cache[11] = ($event) => $options.flipImage(6))
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u4E0D\u7FFB\u8F6C")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.resumeOrPause
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u6682\u505C/\u7EE7\u7EED")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.changeQuality
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u5207\u6362\u6E05\u6670\u5EA6")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue2.createCommentVNode)(" === \u65B0\u589E\u7684\u529F\u80FD\u6309\u94AE\uFF1A\u622A\u56FE / \u5F55\u5C4F / \u5BF9\u8BB2 === "),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.doSnapshot
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("\u622A\u56FE")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"]),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
disabled: $data.isRecording,
|
||||
onClick: $options.doStartRecord
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)(" \u5F00\u59CB\u5F55\u5C4F ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
disabled: !$data.isRecording,
|
||||
onClick: $options.doStopRecord
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)(" \u7ED3\u675F\u5F55\u5C4F ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
disabled: $data.isTalking,
|
||||
onClick: $options.doOpenTalk
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)(" \u5F00\u59CB\u5BF9\u8BB2 ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
disabled: !$data.isTalking,
|
||||
onClick: $options.doStopTalk
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)(" \u7ED3\u675F\u5BF9\u8BB2 ")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["disabled", "onClick"]),
|
||||
(0, import_vue2.createCommentVNode)(" \u6D4B\u8BD5\u6309\u94AE "),
|
||||
(0, import_vue2.createVNode)(_component_button, {
|
||||
class: "button",
|
||||
onClick: $options.test
|
||||
}, {
|
||||
default: (0, import_vue2.withCtx)(() => [
|
||||
(0, import_vue2.createTextVNode)("test")
|
||||
]),
|
||||
_: 1
|
||||
/* STABLE */
|
||||
}, 8, ["onClick"])
|
||||
])
|
||||
])
|
||||
])
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,133 @@
|
|||
"use weex:vue";
|
||||
|
||||
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
||||
Promise.prototype.finally = function(callback) {
|
||||
const promise = this.constructor
|
||||
return this.then(
|
||||
value => promise.resolve(callback()).then(() => value),
|
||||
reason => promise.resolve(callback()).then(() => {
|
||||
throw reason
|
||||
})
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
||||
const global = uni.requireGlobal()
|
||||
ArrayBuffer = global.ArrayBuffer
|
||||
Int8Array = global.Int8Array
|
||||
Uint8Array = global.Uint8Array
|
||||
Uint8ClampedArray = global.Uint8ClampedArray
|
||||
Int16Array = global.Int16Array
|
||||
Uint16Array = global.Uint16Array
|
||||
Int32Array = global.Int32Array
|
||||
Uint32Array = global.Uint32Array
|
||||
Float32Array = global.Float32Array
|
||||
Float64Array = global.Float64Array
|
||||
BigInt64Array = global.BigInt64Array
|
||||
BigUint64Array = global.BigUint64Array
|
||||
};
|
||||
|
||||
|
||||
(() => {
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// vue-ns:vue
|
||||
var require_vue = __commonJS({
|
||||
"vue-ns:vue"(exports, module) {
|
||||
module.exports = Vue;
|
||||
}
|
||||
});
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/pages/option.js
|
||||
var import_vue = __toESM(require_vue());
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/_plugin-vue_export-helper.js
|
||||
var _export_sfc = (sfc, props) => {
|
||||
const target = sfc.__vccOpts || sfc;
|
||||
for (const [key, val] of props) {
|
||||
target[key] = val;
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
// ../../../../hldy_app/unpackage/dist/dev/.nvue/pages/option.js
|
||||
var _style_0 = { "center-column": { "": { "width": 170, "height": 170, "borderRadius": 80 } } };
|
||||
var _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
const _component_MonitorControlView = (0, import_vue.resolveComponent)("MonitorControlView");
|
||||
return (0, import_vue.openBlock)(), (0, import_vue.createElementBlock)("scroll-view", {
|
||||
scrollY: true,
|
||||
showScrollbar: true,
|
||||
enableBackToTop: true,
|
||||
bubble: "true",
|
||||
style: { flexDirection: "column" }
|
||||
}, [
|
||||
(0, import_vue.createElementVNode)("div", {
|
||||
class: "center-column",
|
||||
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.jumptonve && _ctx.jumptonve(...args))
|
||||
}, [
|
||||
(0, import_vue.createCommentVNode)(" \u89C6\u9891\u64AD\u653E\u7EC4\u4EF6 "),
|
||||
(0, import_vue.createVNode)(
|
||||
_component_MonitorControlView,
|
||||
{
|
||||
ref: "monitor",
|
||||
init: "5",
|
||||
style: { "width": "170px", "height": "170px" }
|
||||
},
|
||||
null,
|
||||
512
|
||||
/* NEED_PATCH */
|
||||
)
|
||||
])
|
||||
]);
|
||||
}
|
||||
var option = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app/pages/option.nvue"]]);
|
||||
|
||||
// <stdin>
|
||||
var webview = plus.webview.currentWebview();
|
||||
if (webview) {
|
||||
const __pageId = parseInt(webview.id);
|
||||
const __pagePath = "pages/option";
|
||||
let __pageQuery = {};
|
||||
try {
|
||||
__pageQuery = JSON.parse(webview.__query__);
|
||||
} catch (e) {
|
||||
}
|
||||
option.mpType = "page";
|
||||
const app = Vue.createPageApp(option, { $store: getApp({ allowDefault: true }).$store, __pageId, __pagePath, __pageQuery });
|
||||
app.provide("__globalStyles", Vue.useCssStyles([...__uniConfig.styles, ...option.styles || []]));
|
||||
app.mount("#root");
|
||||
}
|
||||
})();
|
||||
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>View</title>
|
||||
<link rel="icon" href="data:,">
|
||||
<link rel="stylesheet" href="app.css" />
|
||||
<script>var __uniConfig = {"globalStyle":{},"darkmode":false}</script>
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="uni-app-view.umd.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
(function(){})();
|
||||
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
|
@ -0,0 +1 @@
|
|||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__FB2D473","name":"护理单元","version":{"name":"1.5.6","code":156},"description":"护理单元","developer":{"name":"","email":"","url":""},"permissions":{"Share":{},"Camera":{},"VideoPlayer":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"nativePlugins":{"MonitorModule":{"__plugin_info__":{"name":"MonitorModule","description":"bugly升级","platforms":"Android","url":"","android_package_name":"","ios_bundle_id":"","isCloud":false,"bought":-1,"pid":"","parameters":{}}}},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"control":"uni-v3","vueVersion":"3","compilerVersion":"4.76","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal","webView":{"minUserAgentVersion":"49.0"}}},"app-harmony":{"useragent":{"value":"uni-app","concatenate":true},"uniStatistics":{"enable":false}},"screenOrientation":["landscape-primary","landscape-secondary"],"launch_path":"__uniappview.html"}
|
||||
|
|
@ -0,0 +1 @@
|
|||
.calendar[data-v-0bf11501]{padding:16px}.header[data-v-0bf11501]{display:flex;flex-direction:column}.header-title[data-v-0bf11501]{display:flex;justify-content:space-between;align-items:center}.year-month[data-v-0bf11501]{font-size:18px;font-weight:700;margin-bottom:8px}.botton-father[data-v-0bf11501]{display:flex;margin-top:-.625rem}.click-button[data-v-0bf11501]{padding:.3125rem;width:3.75rem;font-size:.78125rem;height:1.25rem;margin-right:.3125rem;display:flex;justify-content:center;align-items:center;color:#fff;background-color:#888;border-radius:.3125rem}.weekdays[data-v-0bf11501]{display:flex;background-color:#e9e7fc;border-radius:.9375rem;padding:.3125rem}.weekday[data-v-0bf11501]{flex:1;text-align:center}.days[data-v-0bf11501]{display:flex;flex-wrap:wrap;padding:.3125rem}.day-cell[data-v-0bf11501]{width:2.29688rem;height:2.51563rem;text-align:center;padding-top:.25rem;padding-bottom:.25rem;box-sizing:border-box}.day-cell.prev-month .gregorian[data-v-0bf11501],.day-cell.next-month .gregorian[data-v-0bf11501]{color:#ccc}.day-cell.selected[data-v-0bf11501]{background-color:#0b98dc;border-radius:.3125rem}.day-cell.selected .gregorian[data-v-0bf11501],.day-cell.selected .lunar[data-v-0bf11501]{color:#fff}.gregorian[data-v-0bf11501]{font-size:14px}.lunar[data-v-0bf11501]{font-size:10px;color:#888}.backgroundContainer[data-v-65a124ce]{position:relative;width:100%;height:100vh;background-image:url(../../static/index/lightbgcnew.png);background-size:cover;background-position:center center;overflow:hidden}.assess-title[data-v-65a124ce]{margin-top:1.875rem;width:100%;height:1.875rem;display:flex;align-items:center;justify-content:space-between}.assess-title .right-icons[data-v-65a124ce]{display:flex;align-items:center;float:right;height:2.1875rem;margin-right:1.25rem}.assess-title .right-icons .right-icons-font[data-v-65a124ce]{margin-left:.3125rem;margin-right:.3125rem;font-size:1.09375rem;margin-top:-.46875rem}.assess-title .right-icons .right-icons-font-dark[data-v-65a124ce]{color:#fff;margin-left:.3125rem;margin-right:.3125rem;font-size:1.09375rem;margin-top:-.46875rem}.assess-title .right-icons .right-icons-img[data-v-65a124ce]{width:2.5rem;height:2.5rem;margin-left:.3125rem;margin-right:.3125rem;margin-top:-.625rem}.assess-title .right-icons .right-icons-img-icon[data-v-65a124ce]{width:1.875rem;height:2.5rem;margin-left:.25rem}.assess-title .left-icons[data-v-65a124ce]{display:flex;margin-left:1.25rem}.assess-title .left-icons .left-icons-img[data-v-65a124ce]{width:2.1875rem;height:2.1875rem}.assess-title .left-icons .right-icons-font[data-v-65a124ce]{font-weight:700;font-size:1.09375rem;margin-left:.3125rem;margin-top:.3125rem}.assess-title .left-icons .right-icons-text[data-v-65a124ce]{font-size:1.09375rem;margin-top:.3125rem}.assess-another[data-v-65a124ce]{width:100%;height:calc(100vh - 3.75rem);margin-top:.3125rem;display:flex;margin-left:1.5625rem}.assess-another .left-contain[data-v-65a124ce]{height:100%;width:18.75rem}.assess-another .left-contain .calendar[data-v-65a124ce]{width:100%;height:20.3125rem;background:linear-gradient(to top,#f4f3ff,#fff,#ecefff);border-radius:.78125rem}
|
||||
|
|
@ -0,0 +1 @@
|
|||
.content{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100vh}.logo{height:6.25rem;width:6.25rem;margin-top:6.25rem;margin-left:auto;margin-right:auto;margin-bottom:1.5625rem}.text-area{display:flex;justify-content:center}.title{font-size:1.125rem;color:#8f8f94}.typebutton{width:9.375rem;height:4.6875rem;display:flex;justify-content:center;align-items:center;margin-top:.9375rem;color:#fff}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
"use weex:vue";
|
||||
|
||||
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
|
||||
Promise.prototype.finally = function(callback) {
|
||||
const promise = this.constructor
|
||||
return this.then(
|
||||
value => promise.resolve(callback()).then(() => value),
|
||||
reason => promise.resolve(callback()).then(() => {
|
||||
throw reason
|
||||
})
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
|
||||
const global = uni.requireGlobal()
|
||||
ArrayBuffer = global.ArrayBuffer
|
||||
Int8Array = global.Int8Array
|
||||
Uint8Array = global.Uint8Array
|
||||
Uint8ClampedArray = global.Uint8ClampedArray
|
||||
Int16Array = global.Int16Array
|
||||
Uint16Array = global.Uint16Array
|
||||
Int32Array = global.Int32Array
|
||||
Uint32Array = global.Uint32Array
|
||||
Float32Array = global.Float32Array
|
||||
Float64Array = global.Float64Array
|
||||
BigInt64Array = global.BigInt64Array
|
||||
BigUint64Array = global.BigUint64Array
|
||||
};
|
||||
|
||||
|
||||
(()=>{var d=Object.create;var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var b=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of y(t))!w.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(s=f(t,n))||s.enumerable});return e};var h=(e,t,o)=>(o=e!=null?d(g(e)):{},b(t||!e||!e.__esModule?c(o,"default",{value:e,enumerable:!0}):o,e));var i=v((S,a)=>{a.exports=Vue});var r=h(i());var u=(e,t)=>{let o=e.__vccOpts||e;for(let[s,n]of t)o[s]=n;return o};var x={"center-column":{"":{width:170,height:170,borderRadius:80}}},V={data(){return{}},onLoad(){},methods:{}};function C(e,t,o,s,n,$){let _=(0,r.resolveComponent)("MonitorControlView");return(0,r.openBlock)(),(0,r.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,r.createElementVNode)("div",{class:"center-column",onClick:t[0]||(t[0]=(...m)=>e.jumptonve&&e.jumptonve(...m))},[(0,r.createVNode)(_,{ref:"monitor",init:"5",style:{width:"170px",height:"170px"}},null,512)])])}var p=u(V,[["render",C],["styles",[x]]]);var l=plus.webview.currentWebview();if(l){let e=parseInt(l.id),t="pages/option",o={};try{o=JSON.parse(l.__query__)}catch(n){}p.mpType="page";let s=Vue.createPageApp(p,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:o});s.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...p.styles||[]])),s.mount("#root")}})();
|
||||
|
|
@ -0,0 +1 @@
|
|||
.index-content-other[data-v-87f7dd57]{width:100%;height:100%;transition:opacity 1s ease;position:relative;background-color:#eff0f4}.index-content-down[data-v-87f7dd57]{position:absolute;bottom:1.25rem;left:50%;transform:translate(-50%)}.index-content-right[data-v-87f7dd57]{width:100%;border-radius:1.5625rem;display:flex;align-items:center;padding-top:3.125rem;font-size:1rem;position:relative}.index-content-right .index-content-title[data-v-87f7dd57]{position:absolute;top:1.875rem;left:1.875rem;display:flex;align-items:center}.index-content-right .index-content-title .shu[data-v-87f7dd57]{width:.625rem;height:1.5625rem;background:linear-gradient(to right,#0052c2,#00b4ff);border-radius:.625rem;margin-right:.9375rem}.index-content-right .index-content-title .shu-font[data-v-87f7dd57]{color:#415273;font-size:1.09375rem}.saomiao[data-v-87f7dd57]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;z-index:1}.saomiao .saoma-input[data-v-87f7dd57]{background-color:#fff;width:17.1875rem;height:2.8125rem;border-radius:.9375rem;padding-left:3.125rem;z-index:2}.saomiao .left-img[data-v-87f7dd57]{width:1.5625rem;height:1.5625rem;position:absolute;top:50%;left:.9375rem;transform:translateY(-50%);z-index:3}.saomiao .right-img[data-v-87f7dd57]{width:1.5625rem;height:1.5625rem;position:absolute;top:50%;right:6.875rem;transform:translateY(-50%);z-index:2}.blue-button[data-v-87f7dd57]{margin-left:.9375rem;width:5.3125rem;height:2.8125rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#007cff;font-size:.9375rem;background-color:#ddf0ff;border:.03125rem solid #007CFF}.big-ball[data-v-87f7dd57]{width:6.25rem;height:6.25rem;position:absolute;top:50%;left:-1.71875rem;transform:translateY(-50%);border-radius:50%;background-color:#dbe4f6}.big-ball .ball[data-v-87f7dd57]{width:4.6875rem;height:4.6875rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:50%;background-color:#cfddf1}.back-img[data-v-87f7dd57]{width:.9375rem;height:.9375rem;margin-left:3.125rem;margin-right:.625rem}.big-bgc[data-v-87f7dd57]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:34.375rem;height:34.375rem}.big-img[data-v-87f7dd57]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:28.125rem;height:28.125rem}
|
||||
|
|
@ -0,0 +1 @@
|
|||
.index-content-other[data-v-33cdb877]{width:100%;height:100%;transition:opacity 1s ease;position:relative;background-color:#eff0f4}.index-content-down[data-v-33cdb877]{position:absolute;bottom:1.25rem;left:50%;transform:translate(-50%)}.index-content-right[data-v-33cdb877]{width:100%;border-radius:1.5625rem;display:flex;align-items:center;padding-top:3.125rem;font-size:1rem;position:relative}.index-content-right .index-content-title[data-v-33cdb877]{position:absolute;top:1.875rem;left:1.875rem;display:flex;align-items:center}.index-content-right .index-content-title .shu[data-v-33cdb877]{width:.625rem;height:1.5625rem;background:linear-gradient(to right,#0052c2,#00b4ff);border-radius:.625rem;margin-right:.9375rem}.index-content-right .index-content-title .shu-font[data-v-33cdb877]{color:#415273;font-size:1.09375rem}.saomiao[data-v-33cdb877]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;z-index:1}.blue-button[data-v-33cdb877]{margin-left:.9375rem;width:5.3125rem;height:2.8125rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#007cff;font-size:.9375rem;background-color:#ddf0ff;border:.03125rem solid #007CFF}.big-ball[data-v-33cdb877]{width:6.25rem;height:6.25rem;position:absolute;top:50%;left:-1.71875rem;transform:translateY(-50%);border-radius:50%;background-color:#dbe4f6}.big-ball .ball[data-v-33cdb877]{width:4.6875rem;height:4.6875rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:50%;background-color:#cfddf1}.back-img[data-v-33cdb877]{width:.9375rem;height:.9375rem;margin-left:3.125rem;margin-right:.625rem}.big-bgc[data-v-33cdb877]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:56.25rem;height:28.125rem}.big-img[data-v-33cdb877]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:10.9375rem;height:10.9375rem}.big-img[data-v-33cdb877]:before{content:"";position:absolute;top:0;left:0;width:100%;animation:scanMove-33cdb877 1.3s ease-in-out infinite;z-index:1001;height:2.5rem;background:linear-gradient(to bottom,rgba(5,170,254,.6),rgba(5,170,254,.1),transparent);will-change:transform}.big-QR[data-v-33cdb877]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:9.375rem;height:9.375rem}.big-font[data-v-33cdb877]{position:absolute;color:#888a8b;left:0;bottom:-2.5rem;font-size:1rem;width:100%;display:flex;justify-content:center}@keyframes scanMove-33cdb877{0%{top:5%}to{top:95%}}
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 262 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 557 B |