浏览代码

video

ctt_dev
chutingting 1年前
父节点
当前提交
e38689cf91
共有 2 个文件被更改,包括 24 次插入3 次删除
  1. +10
    -0
      src/api/login.js
  2. +14
    -3
      src/pages/login/index.vue

+ 10
- 0
src/api/login.js 查看文件

@@ -39,4 +39,14 @@ export function loginByCodeApi(data) {
method: 'POST',
data
})
}

/**
* @description: 获取视频
*/
export function getVideoApi(data) {
return request({
url: `https://formall.oss-accelerate.aliyuncs.com/zx_apk/H5_config.json`,
method: 'get'
})
}

+ 14
- 3
src/pages/login/index.vue 查看文件

@@ -24,8 +24,9 @@
<script setup>
//#region 导入
import { getCurrentInstance, ref,nextTick } from "vue";
import { isPlainObject, onLoad, onUnload } from "@dcloudio/uni-app";
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);

@@ -83,13 +84,23 @@ function fileReaderTest() {
// video.play();
// }

//#region 初始化
onLoad(() => {
function getVideoFn() {
// getVideoApi().then(res => {
// debugger
// })
nextTick(()=>{
const video = document.querySelector("video.uni-video-video");
video.muted = false
video.play()
})
}

onShow(() => {
getVideoFn()
})
//#region 初始化
onLoad(() => {
getVideoFn()
runGetAndroidId();
// fileReaderTest();
userInfoModulesPinia.clearStorage();


正在加载...
取消
保存