打造自主数字人IP
沉淀数字资产
@@ -308,6 +317,7 @@ Vue.use(Toast);
import { oneList, twoList, threeList } from './load.js';
+import { getDeviceType } from '../../utils/index';
export default {
components: {
top
@@ -315,8 +325,10 @@ export default {
data() {
return {
inPage: false,
- loading: false,
- videoUrl: '',
+ loading: false, // 加载状态
+ videoUrl: '', // 视频路径
+ isVX: null, //判断是不是微信浏览器
+ videoPlayBtn: true, // 播放按钮显示隐藏
userName: '',
phone: '',
email: '',
@@ -507,6 +519,11 @@ export default {
methods: {
...mapActions(['setCharacters']),
+ // 播放视频
+ playVideo() {
+ this.videoPlayBtn = false;
+ document.getElementById('video').play();
+ },
goLogin() {
this.$router.push('/myPage');
return;
@@ -599,25 +616,37 @@ export default {
characters: state => state.publicObj.characters
})
},
-
+ created() {
+ // console.log(!getDeviceType());
+ // 判断是不是微信浏览器,配合做视频的自动播放
+ var ua = window.navigator.userAgent.toLowerCase();
+ if (ua.match(/MicroMessenger/i) == 'micromessenger') {
+ this.isVX = true;
+ return true;
+ } else {
+ this.isVX = false;
+ return false;
+ }
+ },
mounted() {
this.goView('top');
+
this.$nextTick(() => {
this.module_6_data = oneList;
this.carouselLsit = twoList;
this.partnerLsit = threeList;
this.videoUrl = 'https://video.metavatar.cc/sv/d51a6f6-187fa2dff79/d51a6f6-187fa2dff79.mp4';
// 监听点击来播放视频,微信浏览器禁用自动播放
- document.addEventListener(
- 'touchstart',
- function () {
- var video = document.getElementById('video');
- video.play();
- },
- false
- );
-
this.loading = true;
+ // document.getElementById('video').play();
+ // document.addEventListener(
+ // 'touchstart',
+ // // 'WeixinJSBridgeReady',
+ // function () {
+ // document.getElementById('video').play();
+ // },
+ // false
+ // );
});
new Swiper('.swiper-container', {