123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- import Vue from "vue";
- import {
- $showBroadcast,
- $hideBroadcast,
- $showLoading,
- $hideLoading
- } from '@/components/popupLayout'
- import {$showHotspot,$hideHotspot } from '@/components/hotspot/index.js'
- import '@/assets/theme/theme.less'
- import {axios, serverName,orginLink} from '../config/http'
- import {formatTime} from '../config/utils'
- Vue.prototype.$http = axios
- Vue.prototype.$serverName = serverName
- Vue.prototype.$orginLink = orginLink
- Vue.prototype.$bus = new Vue()
- Vue.config.productionTip = false
- import stitle from "@/components/sTitle";
- import sradio from "@/components/radio";
- import sbutton from "@/components/sbutton";
- import Danmaku from "@/components/Danmaku";
- import maside from "@/components/aside";
- import returnhome from "@/newcomponents/returnhome";
- import clickoutside from "./v-clickoutside";
- import clickwindow from "./v-clickwindow";
- import { mapState } from "vuex";
- let type = [
- {
- count:1,
- name:'Bye'
- },
- {
- count:1,
- name:'Greeting'
- },
- {
- count:1,
- name:'Right'
- },
- {
- count:'infiniten',
- fps: 16,
- name:'Speaking1'
- },
- {
- count:'infiniten',
- fps: 16,
- name:'Speaking2'
- },
- {
- count:'infiniten',
- fps: 16,
- name:'Speaking3'
- },
- {
- count:'infiniten',
- fps: 16,
- name:'Speaking4'
- },
- {
- count:'infiniten',
- fps: 16,
- name:'Speaking5'
- },
- {
- count:1,
- name:'Wrong'
- },
- ]
- let g_roleType = {};
- ['female_1','female_2','male'].forEach(item => {
- let tmp = {}
- type.forEach(ii=>{
- tmp[ii.name] = {
- img: ii.name + '.png',
- count: ii.count,
- fps: ii.fps,
- xingbie: item
- }
- })
- g_roleType[item] = tmp
- });
- let g_typeStr ={
- '1':'一级专家',
- '2':'二级专家',
- '3':'三级专家',
- '4':'院士',
- '5':'其他专家',
- }
- Vue.mixin({
- components:{stitle,sradio,sbutton,Danmaku,maside,returnhome},
- data(){
- return{
- g_typeStr,
- g_roleType,
- g_defaultAvatar:require('@/assets/images/xinjiang/defaultImg.jpg')
- }
- },
- directives: {
- clickoutside: clickoutside,
- clickwindow: clickwindow,
- },
- computed: {
- ...mapState({
- userInfo: (state) => state.common.userInfo,
- theme: (state) => state.common.theme
- }),
- token(){
- let token = (window.localStorage.getItem('webtoken')&&window.localStorage.getItem('webtoken')) || ''
- return token
- }
- },
- methods: {
- $showBroadcast,
- $hideBroadcast,
- $showHotspot,
- $hideHotspot,
- $showLoading,
- $hideLoading,
- g_dealUrl(src){
- return window.manage.dealURL(src)
- },
- handleHighLight(str,key){
- if (!str) {
- return '-'
- }
- let tmp = str.replace(RegExp(key, "g"), `<span style="color:#ffe0a6;font-size:inherit;">${key}</span>`)
- console.log(tmp);
- return tmp
- },
- handleContent(content,fontsize=16){
- if (!content) {
- return ''
- }
- var reg = new RegExp(' {4}', 'g');//g就是代表全部
- return content.replace(reg , `<span style="display:inline-block;width:${fontsize*2}px;"></span>`);
- },
- formatTime,
- changetohttp(url){
- if (url[0] == '/') {
- return url
- }
- if (url.indexOf('https')<0||url.indexOf('http')<0) {
- url = 'http://' + url
- }
- return url;
- }
- }
- })
|