chutingting 1 år sedan
förälder
incheckning
3acb35297e
2 ändrade filer med 23 tillägg och 18 borttagningar
  1. +1
    -1
      src/api/login.js
  2. +22
    -17
      src/pages/login/index.vue

+ 1
- 1
src/api/login.js Visa fil

@@ -46,7 +46,7 @@ export function loginByCodeApi(data) {
*/
export function getVideoApi(data) {
return request({
url: `https://formall.oss-accelerate.aliyuncs.com/zx_apk/H5_config.json`,
url: `/api/home/videoUrl`,
method: 'get'
})
}

+ 22
- 17
src/pages/login/index.vue Visa fil

@@ -2,8 +2,8 @@
<view class="page">
<!-- <image src="../../assets/img/homeImg.jpg" mode="scaleToFill" /> -->
<video id="myVideo"
ref="myVideo"
src='https://video.metavatar.cc/sv/30f2d513-18c4739c509/30f2d513-18c4739c509.mp4'
ref="myVideo"
:src='videoUrl'
autoplay
muted
loop
@@ -23,12 +23,11 @@

<script setup>
//#region 导入
import { getCurrentInstance, ref,nextTick } from "vue";
import { getCurrentInstance, ref,nextTick, onMounted } from "vue";
import { isPlainObject, onLoad, onUnload, onShow } from "@dcloudio/uni-app";
import { userInfoModules } from "@/store/modules/userInfo";
import { getVideoApi } from "@/api/login.js";

const myVideo = ref(null);

const userInfoModulesPinia = userInfoModules();
//#endregion ----------------------------------
@@ -78,29 +77,35 @@ function fileReaderTest() {
}
}

// // 播放
// const handelPlay = () => {
// const video = document.querySelector("video.uni-video-video");
// video.play();
// }

const videoUrl = ref('')
function getVideoFn() {
// getVideoApi().then(res => {
// debugger
// })
nextTick(()=>{
const video = document.querySelector("video.uni-video-video");
video.muted = false
video.play()
getVideoApi().then(res => {
videoUrl.value = res.data
})
}

onShow(() => {
getVideoFn()
})
//#region 初始化
// const myVideo = ref(null);
const { proxy } = getCurrentInstance();
onMounted(() => {
// nextTick(()=>{
// proxy.$refs.myVideomuted = false
// proxy.$refs.myVideo.play();
// })
})

onLoad(() => {
getVideoFn()
nextTick(()=>{
// const video = document.querySelector("video.uni-video-video");
// video.muted = false
// video.play()
})
getVideoFn()
runGetAndroidId();
// fileReaderTest();
userInfoModulesPinia.clearStorage();


Laddar…
Avbryt
Spara