|
@@ -2,8 +2,9 @@ import { defineComponent, reactive } from "vue";
|
|
|
import styles from "./index.module.less"
|
|
|
import { headImg } from "../image";
|
|
|
import { headTopData } from "../index"
|
|
|
-import { Switch, showToast, Field, Popup } from "vant";
|
|
|
+import { Switch, showToast, Field, Popup, Slider } from "vant";
|
|
|
import state, { refreshMusicSvg } from "/src/state"
|
|
|
+import { api_closeCamera, api_openCamera, api_savePicture } from "/src/helpers/communication";
|
|
|
import { smoothAnimationState} from "/src/page-instrument/view-detail/smoothAnimation"
|
|
|
import Recommendation from "../../custom-plugins/helper-model/recommendation";
|
|
|
import { resetRenderMusicScore } from "/src/view/music-score";
|
|
@@ -55,8 +56,34 @@ export default defineComponent({
|
|
|
</div>
|
|
|
<div class={styles.cellBox}>
|
|
|
<div class={styles.tit}>摄像头</div>
|
|
|
- <Switch v-model={state.setting.camera}></Switch>
|
|
|
- </div>
|
|
|
+ <Switch
|
|
|
+ v-model={state.setting.camera}
|
|
|
+ onChange={ async (value) => {
|
|
|
+ if (value) {
|
|
|
+ const res = await api_openCamera();
|
|
|
+ // 没有授权
|
|
|
+ if (res?.content?.reson) {
|
|
|
+ state.setting.camera = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ api_closeCamera();
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ ></Switch>
|
|
|
+ </div>
|
|
|
+ <div class={styles.cellBox} style={{ display: state.setting.camera ? "" : "none" }}>
|
|
|
+ <div class={styles.tit}>透明度</div>
|
|
|
+ <Slider
|
|
|
+ class={styles.slider}
|
|
|
+ min={0}
|
|
|
+ max={100}
|
|
|
+ v-model:modelValue={state.setting.cameraOpacity}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ button: () => <div class={styles.sliderBtn}>{state.setting.cameraOpacity}</div>,
|
|
|
+ }}
|
|
|
+ </Slider>
|
|
|
+ </div>
|
|
|
<div class={styles.cellBox}>
|
|
|
<div class={styles.tit}>标准音高</div>
|
|
|
<div class={styles.frequency}>
|