244 lines
7.8 KiB
JavaScript
244 lines
7.8 KiB
JavaScript
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;
|
|
};
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
phoneNumber: "1234567890",
|
|
isAlarming: 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
|
|
});
|
|
});
|
|
},
|
|
methods: {
|
|
handleTelEvent(event) {
|
|
formatAppLog("log", "at pages/ceshianzhuo.nvue:56", "Tel event detail:", event.detail);
|
|
},
|
|
// 切换播放模式
|
|
switchDisplay(mode) {
|
|
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);
|
|
});
|
|
},
|
|
stopAlarm() {
|
|
this.isAlarming = false;
|
|
this.$refs.monitor.startOrStopManualAlarm(this.isAlarming, (res) => {
|
|
formatAppLog("log", "at pages/ceshianzhuo.nvue:76", "stopAlarm callback:", res);
|
|
});
|
|
},
|
|
// 翻转图像
|
|
flipImage(type) {
|
|
this.$refs.monitor.changeImageSwitch(type, (res) => {
|
|
formatAppLog("log", "at pages/ceshianzhuo.nvue:83", "flipImage callback:", res);
|
|
});
|
|
},
|
|
// 暂停或继续
|
|
resumeOrPause() {
|
|
this.$refs.monitor.resumeOrPause();
|
|
},
|
|
// 切换清晰度
|
|
changeQuality() {
|
|
this.$refs.monitor.changeQuality();
|
|
},
|
|
// 测试按钮
|
|
test() {
|
|
this.$refs.monitor.test();
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
const _component_MonitorView = resolveComponent("MonitorView");
|
|
const _component_button = resolveComponent("button");
|
|
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": "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"])
|
|
])
|
|
])
|
|
]);
|
|
}
|
|
const ceshianzhuo = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__file", "D:/hldy_app/pages/ceshianzhuo.nvue"]]);
|
|
export {
|
|
ceshianzhuo as default
|
|
};
|