diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index aa39b72..f60ea12 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -28,8 +28,8 @@ import { isPlainObject, onLoad, onUnload, onShow } from "@dcloudio/uni-app"; import { userInfoModules } from "@/store/modules/userInfo"; import { getVideoApi } from "@/api/login.js"; - const userInfoModulesPinia = userInfoModules(); + //#endregion ---------------------------------- function toChooseStyle() { @@ -79,9 +79,18 @@ function fileReaderTest() { const videoUrl = ref('') +const { proxy } = getCurrentInstance(); + function getVideoFn() { getVideoApi().then(res => { videoUrl.value = res.data + nextTick(()=>{ + // const video = document.querySelector("video.uni-video-video"); + // video.muted = false + // video.play() + proxy.$refs.myVideo.muted = false + proxy.$refs.myVideo.play(); + }) }) } @@ -91,20 +100,11 @@ onShow(() => { }) //#region 初始化 // const myVideo = ref(null); -const { proxy } = getCurrentInstance(); onMounted(() => { - // nextTick(()=>{ - // proxy.$refs.myVideomuted = false - // proxy.$refs.myVideo.play(); - // }) + // getVideoFn() }) onLoad(() => { - nextTick(()=>{ - // const video = document.querySelector("video.uni-video-video"); - // video.muted = false - // video.play() - }) getVideoFn() runGetAndroidId(); // fileReaderTest();