1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- import Vue from "vue";
- import browser from "@/utils/browser";
- import { u_extend } from "@/utils";
- import { $showTips, $showLoading, $hideLoading } from "@/components/popupLayout";
- import { $showBirdView, $hideBirdView } from "@/components/bird_view/build.js";
- import { $showOrientationtip, $hideOrientationtip } from "@/components/orientationtip/build.js";
- Vue.prototype.$bus = new Vue();
- import clickoutside from "./v-clickoutside";
- import clickwindow from "./v-clickwindow";
- import pagination from "@/components/pagination";
- import { region } from "@/data/raw";
- window.g_lock = false;
- let hotUrl = "//super.4dage.com/";
- // let hotUrl = '//wangzhan.cctv.com/wlwm2022/'
- Vue.mixin({
- data() {
- return {
- isMobile: browser.mobile,
- isiPad: browser.iPad,
- themes: region,
- g_isLandscape: window.orientation === 90 || window.orientation === -90,
- };
- },
- computed: {
- theme() {
- return this.$route.params.type;
- }
- },
- mounted() {
- if (this.isMobile||this.isiPad) {
- // window.orientation:获取屏幕旋转方向
- window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", ()=> {
- // 正常方向或屏幕旋转180度
- if (window.orientation === 180 || window.orientation === 0) {
- this.g_isLandscape = false;
- }
- // 屏幕顺时钟旋转90度或屏幕逆时针旋转90度
- if (window.orientation === 90 || window.orientation === -90) {
- this.g_isLandscape = true;
- this.$bus.$emit("isShowHuDong", false)
- }
- });
- }
- },
- components: {
- pagination,
- },
- directives: {
- clickoutside: clickoutside,
- clickwindow: clickwindow,
- },
- methods: {
- $showTips,
- $showLoading,
- $hideLoading,
- $showBirdView,
- $hideBirdView,
- $showOrientationtip,
- $hideOrientationtip,
- u_extend,
- g_fixUrl(url) {
- return url.replace("https://super.4dage.com/", hotUrl);
- },
- handleContent(content, fontsize = 16) {
- if (!content) {
- return "";
- }
- console.log(1111);
- var reg = new RegExp(" {4}", "g"); //g就是代表全部
- return content.replace(reg, `<span style="display:inline-block;width:${fontsize * 2}px;"></span>`);
- },
- },
- });
|