import { defineComponent, nextTick, reactive, watch } from "vue"; import styles from "./index.module.less"; import iconClose from "../image/close2.svg"; import { Cell, Field, NoticeBar, Popup, Radio, RadioGroup, Slider, Switch, Tab, Tabs, closeToast, showLoadingToast, showToast } from "vant"; import state from "/src/state"; import { api_closeCamera, api_openCamera, api_savePicture } from "/src/helpers/communication"; import store from "store"; import iconInfo from "../image/info.svg"; import iconDown from "../image/down.svg"; import iconTv from "../image/tv.svg"; import iconYijian from "../image/yijian.svg"; import ScreenModel from "../../custom-plugins/helper-model/screen-model"; import Recommendation from "../../custom-plugins/helper-model/recommendation"; import html2canvas from "html2canvas"; export default defineComponent({ name: "header-settting", emits: ["close"], setup(props, { emit }) { const helperData = reactive({ show: false, recommendationShow: false, // 建议 }); const downPng = () => { showLoadingToast({ message: "下载中", duration: 0 }); setTimeout(() => { const _div = document.createElement("div"); const svg: any = document.getElementById("osmdSvgPage1")?.cloneNode(true); if (!svg) return; _div.appendChild(svg); document.body.appendChild(_div); html2canvas(_div).then(async (_canvas) => { document.body.removeChild(_div); const res = await api_savePicture({ base64: _canvas.toDataURL(), }); closeToast() if (res?.content?.status === "success") { showToast({ message: "保存成功", type: "success" }); } else { showToast({ message: "保存失败", type: "fail" }); } }); }, 50); }; // 设置改变触发 watch(state.setting, () => { store.set("musicscoresetting", state.setting); }); return () => (
emit("close")}>
{{ extra: () => , }}
下载曲谱
(helperData.show = true)}> 投屏帮助
(helperData.recommendationShow = true)}> 意见反馈
{{ extra: () => , }} {{ extra: () => , }} {{ extra: () => ( 入门 进阶 大师 ), }} {{ extra: () => , }} {{ extra: () => ( { if (value) { api_openCamera(); } else { api_closeCamera(); } }} > ), }} {{ extra: () => ( {{ button: () =>
{state.setting.cameraOpacity}
, }}
), }}
{{ extra: () => , }} {{ extra: () => , }} {{ extra: () => ( 440Hz 442Hz ), }}
{ helperData.show = false; }} position="right" teleport="body" > { helperData.show = false; }} /> { helperData.recommendationShow = false; }} />
); }, });